/* =========================================
   1. RESET & BASE VARIABLES
   ========================================= */
   :root {
    --primary: #4f46e5;       /* Indigo 600 */
    --primary-dark: #4338ca;  /* Indigo 700 */
    --secondary: #6366f1;     /* Indigo 500 */
    --success: #10b981;       /* Emerald 500 */
    --warning: #f59e0b;       /* Amber 500 */
    --danger: #ef4444;        /* Red 500 */
    --info: #3b82f6;          /* Blue 500 */

    --bg-body: #f3f4f6;       /* Gray 100 */
    --bg-white: #ffffff;
    --bg-sidebar: #ffffff;

    --text-dark: #1f2937;     /* Gray 800 */
    --text-medium: #4b5563;   /* Gray 600 */
    --text-light: #9ca3af;    /* Gray 400 */

    --border-color: #e5e7eb;  /* Gray 200 */
    --radius: 8px;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --sidebar-width: 260px;
    --header-height: 64px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    margin: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================================
   2. LAYOUT (SIDEBAR & NAVBAR)
   ========================================= */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: all 0.3s ease;
}

.sidebar__brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
}

.sidebar__nav {
    padding: 24px 16px;
    flex: 1;
    overflow-y: auto;
}

.sidebar__nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar__nav li {
    margin-bottom: 4px;
}

.sidebar__nav .nav-divider {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-light);
    font-weight: 700;
    padding: 16px 12px 8px;
    letter-spacing: 0.05em;
}

.sidebar__nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    color: var(--text-medium);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.sidebar__nav a .nav-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar__nav a i {
    width: 20px;
    text-align: center;
    color: var(--text-light);
    transition: color 0.2s;
}

.sidebar__nav a:hover {
    background-color: #f3f4f6;
    color: var(--text-dark);
}

.sidebar__nav a:hover i {
    color: var(--primary);
}

.sidebar__nav a.active {
    background-color: #eef2ff;
    color: var(--primary);
    font-weight: 600;
}

.sidebar__nav a.active i {
    color: var(--primary);
}

.sidebar__footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.75rem;
    text-align: center;
}

.nav-badge {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

/* --- Main Content --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
}

/* --- Navbar --- */
.navbar {
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.navbar__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.navbar__right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.navbar__profile {
    display: flex;
    align-items: center;
    gap: 12px;
    border-right: 1px solid var(--border-color);
    padding-right: 24px;
}

.navbar__profile .user-info {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.navbar__profile .user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.navbar__profile .avatar-circle {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* =========================================
   3. ALERTS & NOTIFICATIONS
   ========================================= */
.alert-banner {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 12px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.2);
    position: relative;
    z-index: 30;
}

.alert-banner__content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

/* =========================================
   4. ORDER VIEW & CARDS
   ========================================= */
.page-content {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.app-container {
    /* For pages that don't use the sidebar wrapper correctly yet */
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Section */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.page-header__title {
    margin: 0 0 12px 0;
    font-size: 1.5rem;
    color: var(--text-dark);
}

.page-header__title span {
    display: block;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-light);
    margin-bottom: 4px;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.9rem;
}

.status-warning {
    color: var(--warning);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Grids */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

/* Standard Card */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 24px;
}

.card--padded {
    padding: 24px;
}

.card__header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: #f9fafb;
}

.card__header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card__body {
    padding: 20px;
}

/* =========================================
   5. SPECIFIC ORDER COMPONENTS (PHP VIEW)
   ========================================= */

/* Description Box */
.pro-desc__general {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
}

.pro-desc__label {
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Specs Container */
.pro-specs {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.pro-specs__header {
    background: #f1f5f9;
    padding: 12px 16px;
    font-weight: 700;
    color: var(--text-medium);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.pro-specs__body {
    padding: 20px;
    background: var(--bg-white);
}

/* Individual Spec Card */
.spec-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
}

.spec-card__title {
    color: var(--primary);
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    font-weight: 700;
}

.spec-row {
    display: flex;
    margin-bottom: 6px;
    font-size: 0.875rem;
}

.spec-row__label {
    width: 140px;
    color: var(--text-light);
    font-weight: 500;
    flex-shrink: 0;
}

.spec-row__value {
    color: var(--text-dark);
    font-weight: 500;
}

.spec-row--text {
    color: var(--text-medium);
    margin-top: 4px;
}

/* =========================================
   6. STATE BOXES (Right Sidebar)
   ========================================= */
.state-box {
    text-align: center;
    padding: 24px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.state-box__icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.state-box h3, .state-box h4 {
    margin: 0 0 8px 0;
}

.state-box p {
    margin: 0 0 16px 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.state-box--success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.state-box--warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.state-box--info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.state-box--neutral { background: #f3f4f6; color: var(--text-light); }

.state-box--active {
    background: #f3f4f6;
    color: var(--text-dark);
    border: 1px dashed var(--border-color);
    text-align: left;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* =========================================
   7. ELEMENTS (Buttons, Badges, Forms)
   ========================================= */

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge--lg { padding: 6px 12px; font-size: 0.85rem; }
.badge--sm { padding: 2px 8px; font-size: 0.7rem; }
.badge--neutral { background: #f3f4f6; color: var(--text-medium); border: 1px solid #d1d5db; }

/* Status Colors */
.status-gray   { background: #e5e7eb; color: #374151; }
.status-blue   { background: #dbeafe; color: #1e40af; }
.status-orange { background: #ffedd5; color: #9a3412; }
.status-teal   { background: #ccfbf1; color: #115e59; }
.status-green  { background: #d1fae5; color: #065f46; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.2;
}

.btn--block { width: 100%; }
.btn--sm { padding: 6px 12px; font-size: 0.8rem; }
.btn--lg { padding: 14px; font-size: 1rem; }
.btn--icon { padding-right: 20px; }

.btn--primary   { background: var(--primary); color: white; }
.btn--primary:hover { background: var(--primary-dark); }

.btn--secondary { background: white; border: 1px solid var(--border-color); color: var(--text-dark); }
.btn--secondary:hover { background: #f9fafb; border-color: #d1d5db; }

.btn--success   { background: var(--success); color: white; }
.btn--success:hover { background: #059669; }

.btn--danger    { background: var(--danger); color: white; }
.btn--danger:hover { background: #dc2626; }

.btn--warning   { background: var(--warning); color: white; }
.btn--warning:hover { background: #d97706; }

.btn--white-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255, 0.6);
    color: white;
}
.btn--white-outline:hover {
    background: rgba(255,255,255, 0.1);
    border-color: white;
}

.btn-group { display: flex; gap: 10px; width: 100%; }
.flex-grow { flex: 1; }

/* Forms */
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    margin-bottom: 16px;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.file-drop-area {
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    padding: 24px;
    text-align: center;
    position: relative;
    margin-bottom: 12px;
    transition: 0.2s;
    background: #f9fafb;
}

.file-drop-area:hover {
    border-color: var(--primary);
    background: #eef2ff;
}

.file-drop-area input {
    position: absolute; left: 0; top: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    text-align: left;
    padding: 12px 16px;
    background: #f9fafb;
    color: var(--text-medium);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }

/* Files List */
.file-list { list-style: none; padding: 0; margin: 0; }
.file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}
.file-item:last-child { border-bottom: none; }
.file-item__icon {
    width: 40px; height: 40px;
    background: #f1f5f9; color: var(--text-light);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    margin-right: 12px; font-size: 1.2rem;
}
.file-link { color: var(--primary); font-weight: 500; }
.file-link:hover { text-decoration: underline; }
.file-meta { font-size: 0.75rem; color: var(--text-light); margin-top: 2px; }

/* =========================================
   8. MODALS & UTILS
   ========================================= */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s;
}

.modal__content {
    background: white;
    width: 100%;
    max-width: 450px;
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.modal__header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
}
.modal__header h3 { margin: 0; }
.modal__close { font-size: 1.5rem; cursor: pointer; color: var(--text-light); }
.modal__actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* Utils */
.text-muted { color: var(--text-light) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--primary) !important; }
.divider { height: 1px; background: var(--border-color); margin: 20px 0; }
.margin-top-md { margin-top: 24px; }
.margin-top-lg { margin-top: 32px; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Authentication Layout */
.auth-layout {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f3f4f6;
    background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    .content-grid { grid-template-columns: 1fr; }
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; width: 100%; }
}
/* =========================================
   10. COMPLEX FORM ELEMENTS (Tabs & Uploads)
   ========================================= */

/* --- Panel Tabs (P1, P2, etc.) --- */
.panel-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
    overflow-x: auto; /* Scroll on mobile */
}

.panel-tab {
    padding: 10px 24px;
    background: #f3f4f6;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.2s;
    min-width: 60px;
    text-align: center;
}

.panel-tab:hover {
    background: #e5e7eb;
    color: var(--text-medium);
}

.panel-tab.active {
    background: var(--bg-white);
    color: var(--primary);
    border-color: var(--border-color);
    border-bottom: 2px solid var(--bg-white); /* Hides the line below */
    margin-bottom: -2px; /* Overlaps the border */
}

/* --- Panel Content Animation --- */
.panel-content {
    display: none;
    animation: fadeIn 0.3s ease;
}
.panel-content.active {
    display: block;
}

/* --- Product Checkbox Grid --- */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}

.checkbox-card {
    position: relative;
}

.checkbox-card input[type="checkbox"] {
    position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0;
}

.checkbox-card label {
    display: block;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-card input[type="checkbox"]:checked + label {
    background: #eff6ff; /* Light blue bg */
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.1);
}

/* --- Upload Zone --- */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    background: #f9fafb;
    position: relative;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: #eef2ff;
}

.upload-zone input[type="file"] {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
}

.upload-icon {
    font-size: 2rem; color: var(--text-light); margin-bottom: 8px;
}
/* =========================================
   11. NOTIFICATIONS LIST STYLES
   ========================================= */
   .notif-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notif-item {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
    border-left: 4px solid transparent; /* Invisible border for alignment */
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background-color: #f9fafb;
}

/* UNREAD STATE: Blue background & border */
.notif-item--unread {
    background-color: #f0f9ff; /* Very light blue */
    border-left-color: var(--primary);
}

.notif-item--unread:hover {
    background-color: #e0f2fe;
}

/* Layout Wrapper */
.notif-link {
    display: flex;
    align-items: center;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    gap: 16px;
}

/* Circular Icon */
.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    flex-shrink: 0;
}

.notif-item--unread .notif-icon {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Text Content */
.notif-content {
    flex: 1;
}

.notif-message {
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 4px;
    font-weight: 500;
}

.notif-item--unread .notif-message {
    font-weight: 700;
    color: #1e40af; /* Darker blue text */
}

.notif-date {
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.notif-arrow {
    color: var(--text-light);
    font-size: 0.9rem;
}
/* =========================================
   12. KPI GRID & DASHBOARD FIXES
   ========================================= */

/* KPI Grid Layout */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.kpi-info h3 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.kpi-info .number {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
    margin-top: 4px;
}

/* KPI Colors */
.kpi-card.blue .kpi-icon { background: #eff6ff; color: #3b82f6; }
.kpi-card.orange .kpi-icon { background: #fff7ed; color: #f97316; }
.kpi-card.green .kpi-icon { background: #f0fdf4; color: #22c55e; }
.kpi-card.red .kpi-icon { background: #fef2f2; color: #ef4444; }

/* Table Action Wrapper (Fixes alignment) */
.action-buttons-wrapper {
    display: flex;
    justify-content: flex-end; /* Pushes buttons to the right */
    align-items: center;
    gap: 8px; /* Space between Eye icon and Assign button */
}

/* Icon Only Button (The Eye) */
.btn-icon-only {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-light);
    border: 1px solid var(--border-color);
    background: white;
    transition: all 0.2s;
}

.btn-icon-only:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: #eef2ff;
}

/* Mini Progress Bar in Table */
.progress-mini {
    display: flex;
    gap: 4px;
    height: 6px;
    width: 80px;
    border-radius: 3px;
    overflow: hidden;
}
.progress-mini div {
    flex: 1;
    border-radius: 2px;
}

/* Small Avatar */
.user-avatar-sm {
    width: 24px; 
    height: 24px; 
    background: #e2e8f0; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 10px; 
    color: var(--text-medium);
}
/* =========================================
   13. NAVBAR NOTIFICATION BELL
   ========================================= */

   .nav-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-medium);
    border-radius: 50%;
    transition: all 0.2s;
    margin-right: 16px;
    text-decoration: none;
    font-size: 1.2rem;
}

.nav-icon-btn:hover {
    background-color: #f3f4f6;
    color: var(--primary);
}

/* The Red Counter Badge */
.nav-badge-icon {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white; /* Makes it pop */
    box-sizing: content-box;
}

/* Adjust navbar profile to remove left border if needed, or keep spacing */
.navbar__profile {
    padding-left: 16px;
    border-left: 1px solid var(--border-color);
}
/* =========================================
   SIDEBAR FIXES
   ========================================= */

   .sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: all 0.3s ease;
}

.sidebar__brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
}

.sidebar__nav {
    padding: 24px 16px;
    flex: 1;
    overflow-y: auto;
}

.sidebar__nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar__nav li {
    margin-bottom: 4px;
}

/* SECTION DIVIDER (MENU) */
.sidebar__nav .nav-divider {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-light);
    font-weight: 700;
    padding: 24px 12px 8px 12px; /* More space above */
    letter-spacing: 0.05em;
}

/* SIDEBAR LINKS */
.sidebar__nav a {
    display: flex;
    align-items: center;
    /* FIX: Changed from space-between to flex-start */
    justify-content: flex-start; 
    gap: 12px; /* Consistent space between Icon and Text */
    padding: 12px 16px; /* Slightly taller click area */
    color: var(--text-medium);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
}

/* Fixed width for icons so text aligns vertically */
.sidebar__nav a i {
    width: 24px;
    text-align: center;
    color: var(--text-light);
    transition: color 0.2s;
    font-size: 1rem;
}

/* HOVER STATE */
.sidebar__nav a:hover {
    background-color: #f3f4f6;
    color: var(--text-dark);
}

.sidebar__nav a:hover i {
    color: var(--primary);
}

/* ACTIVE STATE */
.sidebar__nav a.active {
    background-color: #eef2ff; /* Light Indigo Bg */
    color: var(--primary);
    font-weight: 600;
}

.sidebar__nav a.active i {
    color: var(--primary);
}

/* NOTIFICATION BADGE IN SIDEBAR */
/* Uses margin-left: auto to push ONLY the badge to the right */
.nav-badge {
    margin-left: auto; 
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
}

.sidebar__footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.75rem;
    text-align: center;
}