:root {
    --primary-color: #095E44;      /* AiSensy Brand Emerald Green */
    --primary-hover: #074934;
    --dark-bg: #111827;            /* Sidebar Dark */
    --light-bg: #F9FAFB;           /* Dashboard Light Gray Background */
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --error-color: #EF4444;
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* Core Application Admin Layout Grid */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    margin-left: 260px; /* Pushes content away from the fixed 260px sidebar */
    width: calc(100% - 260px); /* Explicitly forces the workspace to occupy only the remaining screen area */
    flex-grow: 1;
    background-color: var(--light-bg);
    padding: 40px;
    min-height: 100vh;
    box-sizing: border-box; /* Ensures padding doesn't accidentally increase the element's width */
}

/* ==========================================
   PREMIUM SIDEBAR SYSTEM (PRO DESIGN)
   ========================================== */
.sidebar {
    width: 260px;
    background-color: #0f141c; /* Deep, luxury dark charcoal blue */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 32px 20px;
    position: fixed;
    height: 100vh;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.03);
}

/* Brand Area */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 6px;
    margin-bottom: 40px;
}

.logo-wrapper-box {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-wrapper-box img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.brand-icon-fallback {
    width: 26px;
    height: 26px;
    stroke: #00bfa5;
    fill: none;
    stroke-width: 2;
}

.sidebar-brand span {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.brand-accent {
    color: #00bfa5;
}

/* Menu items & SVG Icon alignments */
.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    margin-bottom: 6px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #8e9cae; /* Soft tech gray */
    text-decoration: none;
    padding: 12px 14px;
    font-weight: 500;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-icon {
    width: 18px;
    height: 18px;
    color: #718096;
    transition: color 0.2s ease;
}

/* Elegant Active/Hover States */
.sidebar-menu a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.04);
}

.sidebar-menu a:hover .nav-icon {
    color: #ffffff;
}

.sidebar-menu li.active a {
    background-color: rgba(0, 191, 165, 0.12); /* Clean semi-transparent mint glow */
    color: #00bfa5;
    font-weight: 600;
}

.sidebar-menu li.active .nav-icon {
    color: #00bfa5;
    stroke-width: 2.5; /* Emphasized vector weights */
}

/* Footer & Logout Structure */
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 20px;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #f56565; /* Vibrant red */
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.logout-icon {
    width: 18px;
    height: 18px;
    color: #f56565;
}

.btn-logout:hover {
    background-color: rgba(245, 101, 101, 0.08);
    color: #fc8181;
}

/* ==========================================
   SLIDE-OUT DRAWER SYSTEM (FIXED SCROLL)
   ========================================== */
.drawer-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0, 0, 0, 0.4); 
    z-index: 500; 
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.3s ease; 
}
.drawer-overlay.active { 
    opacity: 1; 
    pointer-events: auto; 
}

.drawer-box { 
    position: fixed; 
    top: 0; 
    right: -500px; 
    width: 100%; 
    max-width: 500px; 
    height: 100vh; 
    background: #ffffff; 
    z-index: 600; 
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15); 
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; /* Locks layout context inside viewport space boundaries */
}
.drawer-box.active { 
    right: 0; 
}

.drawer-header { 
    padding: 24px; 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: #ffffff;
    flex-shrink: 0; /* Prevents the header block height from shifting */
}
.drawer-header h2 { 
    font-size: 18px; 
    font-weight: 600; 
    color: var(--text-main); 
}
.btn-close-drawer { 
    background: none; 
    border: none; 
    font-size: 24px; 
    cursor: pointer; 
    color: var(--text-muted); 
}

.drawer-body { 
    padding: 24px; 
    flex-grow: 1; 
    overflow-y: auto; /* Dynamic scrolling active on form input fields area */
    background: #ffffff;
}

.drawer-footer { 
    padding: 20px 24px; 
    border-top: 1px solid var(--border-color); 
    background: #ffffff; 
    position: sticky; 
    bottom: 0; 
    z-index: 10;
    flex-shrink: 0; /* Keeps the sticky footer button visible */
}

/* ==========================================
   FORM HOOKS FOR SLIDE-OUT DRAWERS
   ========================================== */
.drawer-body .form-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.drawer-body .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    text-align: left;
}

/* Modernize Inputs, Dropdowns, and Selectors inside all drawers */
.drawer-body .form-group input[type="text"],
.drawer-body .form-group input[type="file"],
.drawer-body .form-group select,
.drawer-body .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: #FAFAFA;
    outline: none;
    font-family: inherit;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.drawer-body .form-group input:focus,
.drawer-body .form-group select:focus,
.drawer-body .form-group textarea:focus {
    border-color: #00bfa5;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.08);
}

/* Style for Tag Checkbox Containers */
.tag-selection-container {
    max-height: 160px;
    overflow-y: auto;
    background: #FAFAFA;
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--radius);
    width: 100%;
    box-sizing: border-box;
}

.tag-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-weight: 500 !important;
    color: #4B5563 !important;
    margin-bottom: 8px;
    cursor: pointer;
    user-select: none;
}

.tag-checkbox-label input[type="checkbox"] {
    accent-color: #00bfa5;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.tag-checkbox-label:last-child {
    margin-bottom: 0;
}

/* Helper Text */
.drawer-body .help-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.4;
}

/* Full Width Block Buttons inside Footer */
.btn-block {
    width: 100%;
    padding: 14px;
    background-color: #00bfa5;
    color: #ffffff;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-block:hover {
    background-color: #00a68f;
}