/* =========================================================
   HR Analytics Dashboard - Enterprise Modern Theme
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Primary palette - Deep indigo / corporate blue */
    --primary-50:  #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;

    /* Neutral - cool grays */
    --gray-50:  #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Status colors */
    --success: #059669;
    --success-light: #d1fae5;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --info: #0891b2;
    --info-light: #cffafe;

    /* Surfaces */
    --bg-app: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;

    /* Sidebar */
    --sidebar-bg: #0f172a;
    --sidebar-bg-2: #1e293b;
    --sidebar-active: rgba(99, 102, 241, 0.15);
    --sidebar-active-border: #6366f1;
    --sidebar-text: #cbd5e1;
    --sidebar-text-active: #ffffff;
    --sidebar-section: #64748b;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Shadows - elegant, layered */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.10), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-glow: 0 0 0 4px rgba(99, 102, 241, 0.12);

    /* Geometry */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-2xl: 22px;

    /* Sidebar width */
    --sidebar-w: 264px;

    /* Transition */
    --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-med:  220ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg-app);
    color: var(--gray-800);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App background pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(at 0% 0%, rgba(99,102,241,0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(99,102,241,0.04) 0px, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

a { color: var(--primary-600); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--primary-700); }

/* =========================================================
   SIDEBAR
   ========================================================= */
.sidebar {
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    width: var(--sidebar-w);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.08);
    z-index: 100;
}

.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
        radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.sidebar-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.sidebar-brand {
    padding: 1.5rem 1.5rem 1.25rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-brand i {
    font-size: 1.7rem;
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.3));
}
.sidebar-brand span {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    background: linear-gradient(180deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    list-style: none;
    padding: 1rem 0.75rem;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

.sidebar-nav .nav-item { padding: 0; margin-bottom: 2px; }

.sidebar-nav .nav-section,
.sidebar-nav .nav-section-label {
    color: var(--sidebar-section);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1.25rem 0.85rem 0.5rem;
    font-weight: 600;
    display: block;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all var(--t-fast);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}
.sidebar-nav .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, var(--primary-400), var(--primary-600));
    border-radius: 0 3px 3px 0;
    transition: transform var(--t-med);
}
.sidebar-nav .nav-link:hover {
    color: var(--sidebar-text-active);
    background: rgba(255, 255, 255, 0.04);
}
.sidebar-nav .nav-link.active {
    color: var(--sidebar-text-active);
    background: var(--sidebar-active);
    font-weight: 600;
}
.sidebar-nav .nav-link.active::before {
    transform: translateY(-50%) scaleY(1);
}
.sidebar-nav .nav-link i {
    width: 18px;
    font-size: 1.05rem;
    text-align: center;
    color: var(--gray-400);
    transition: color var(--t-fast);
}
.sidebar-nav .nav-link.active i,
.sidebar-nav .nav-link:hover i {
    color: var(--primary-400);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
}
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    padding: 0.5rem;
    border-radius: var(--radius-md);
}
.user-info i {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.user-info .user-name {
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.2;
}
.user-info small {
    color: var(--gray-400) !important;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-footer .btn {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-weight: 500;
    font-size: 0.82rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all var(--t-fast);
}
.sidebar-footer .btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */
.main-content {
    margin-left: var(--sidebar-w);
    padding: 1.75rem 2rem;
    min-height: 100vh;
}
.full-content { padding: 0; min-height: 100vh; }

.page-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.page-header h1 i {
    color: var(--primary-600);
    font-size: 1.4rem;
    padding: 0.5rem;
    background: var(--primary-50);
    border-radius: var(--radius-md);
}
.page-header p {
    margin: 0.4rem 0 0;
    color: var(--gray-500);
    font-size: 0.92rem;
}

/* =========================================================
   FLASH MESSAGES
   ========================================================= */
.flash-container { margin-bottom: 1.25rem; }
.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: 0.95rem 1.25rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid;
}
.alert-success { background: var(--success-light); color: #064e3b; border-left-color: var(--success); }
.alert-danger  { background: var(--danger-light); color: #7f1d1d; border-left-color: var(--danger); }
.alert-warning { background: var(--warning-light); color: #78350f; border-left-color: var(--warning); }
.alert-info    { background: var(--info-light); color: #155e75; border-left-color: var(--info); }

/* =========================================================
   KPI CARDS
   ========================================================= */
.kpi-card {
    background: var(--surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 1.4rem 1.5rem;
    display: flex;
    gap: 1.1rem;
    align-items: center;
    box-shadow: var(--shadow-xs);
    transition: all var(--t-med);
    height: 100%;
    position: relative;
    overflow: hidden;
}
.kpi-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-500);
}
.kpi-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 60%);
    pointer-events: none;
}
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-200);
}

.kpi-card.kpi-primary::before { background: linear-gradient(180deg, var(--primary-400), var(--primary-600)); }
.kpi-card.kpi-danger::before  { background: linear-gradient(180deg, #f87171, var(--danger)); }
.kpi-card.kpi-success::before { background: linear-gradient(180deg, #34d399, var(--success)); }
.kpi-card.kpi-info::before    { background: linear-gradient(180deg, #22d3ee, var(--info)); }
.kpi-card.kpi-light::before   { background: linear-gradient(180deg, var(--gray-300), var(--gray-400)); }

.kpi-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-size: 1.5rem;
    flex-shrink: 0;
    background: var(--primary-50);
    color: var(--primary-600);
}
.kpi-card.kpi-danger .kpi-icon  { background: var(--danger-light);  color: var(--danger);  }
.kpi-card.kpi-success .kpi-icon { background: var(--success-light); color: var(--success); }
.kpi-card.kpi-info .kpi-icon    { background: var(--info-light);    color: var(--info);    }
.kpi-card.kpi-primary .kpi-icon { background: var(--primary-50);    color: var(--primary-600); }

.kpi-content { flex: 1; min-width: 0; }
.kpi-label {
    color: var(--gray-500);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.kpi-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.kpi-value-sm {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}
.kpi-sub {
    color: var(--gray-500);
    font-size: 0.78rem;
    margin-top: 0.2rem;
    display: block;
}

/* =========================================================
   CHART CARDS
   ========================================================= */
.chart-card {
    background: var(--surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow-xs);
    height: 100%;
    transition: box-shadow var(--t-med);
}
.chart-card:hover { box-shadow: var(--shadow-md); }
.chart-title {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.95rem;
    margin-bottom: 1.1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: -0.01em;
}
.chart-title::after {
    content: '';
    width: 36px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
    border-radius: 2px;
    margin-left: auto;
}

/* =========================================================
   CARDS & TABLES
   ========================================================= */
.card {
    border: 1px solid var(--gray-200) !important;
    border-radius: var(--radius-xl) !important;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}
.card-header {
    background: var(--surface-2) !important;
    border-bottom: 1px solid var(--gray-200);
    padding: 0.9rem 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}
.card-body { padding: 1.25rem; }

.table { margin-bottom: 0; }
.table thead th {
    background: var(--gray-50);
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
    border-top: none;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}
.table tbody td {
    padding: 0.9rem 1rem;
    border-color: var(--gray-100);
    vertical-align: middle;
    font-size: 0.875rem;
}
.table tbody tr { transition: background var(--t-fast); }
.table-hover tbody tr:hover { background: var(--primary-50); }
.table-dark { /* override – we don't want dark headers */ }
.table-dark th {
    background: var(--gray-50) !important;
    color: var(--gray-700) !important;
    border: none !important;
    border-bottom: 1px solid var(--gray-200) !important;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.88rem;
}
.info-row:last-child { border-bottom: none; }
.info-row > span:first-child { color: var(--gray-500); font-weight: 500; }
.info-row > strong { color: var(--gray-900); font-weight: 600; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
    font-weight: 500;
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: all var(--t-fast);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-lg { padding: 0.7rem 1.5rem; font-size: 0.95rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    border-color: var(--primary-600);
    color: #fff;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: var(--surface);
    color: var(--gray-700);
    border-color: var(--gray-300);
}
.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

.btn-light {
    background: var(--surface);
    color: var(--gray-700);
    border-color: var(--gray-200);
}
.btn-light:hover { background: var(--gray-50); }

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn-outline-primary {
    color: var(--primary-600);
    border-color: var(--primary-300);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--primary-600);
    color: #fff;
    border-color: var(--primary-600);
}
.btn-outline-secondary {
    color: var(--gray-600);
    border-color: var(--gray-300);
    background: transparent;
}
.btn-outline-secondary:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

/* =========================================================
   FORMS
   ========================================================= */
.form-label {
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
}
.form-control, .form-select {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    color: var(--gray-900);
    background: var(--surface);
    transition: all var(--t-fast);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    outline: 0;
}
.form-control::placeholder { color: var(--gray-400); }

.input-group-text {
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
    color: var(--gray-500);
}

.form-check-input {
    width: 1.1em;
    height: 1.1em;
    margin-top: 0.2em;
    border: 1.5px solid var(--gray-300);
    border-radius: 4px;
}
.form-check-input:checked {
    background-color: var(--primary-600);
    border-color: var(--primary-600);
}
.form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

/* =========================================================
   BADGES
   ========================================================= */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.32em 0.65em;
    border-radius: 999px;
    letter-spacing: 0.02em;
}
.bg-success { background: var(--success-light) !important; color: var(--success) !important; }
.bg-danger  { background: var(--danger-light)  !important; color: var(--danger)  !important; }
.bg-primary { background: var(--primary-100)   !important; color: var(--primary-700) !important; }
.bg-warning { background: var(--warning-light) !important; color: var(--warning) !important; }
.bg-info    { background: var(--info-light)    !important; color: var(--info)    !important; }

/* =========================================================
   PAGINATION
   ========================================================= */
.pagination { gap: 0.25rem; }
.page-item .page-link {
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    background: var(--surface);
    border-radius: var(--radius-md) !important;
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--t-fast);
}
.page-item .page-link:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-700);
}
.page-item.active .page-link {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: #fff;
}

/* =========================================================
   LOGIN PAGE
   ========================================================= */
.login-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    min-height: 100vh;
}
.login-card {
    background: var(--surface);
    padding: 4rem 4.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}
.login-card::after {
    content: '';
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--gray-400);
    font-size: 0.8rem;
}
.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.login-header i {
    color: var(--primary-600);
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.25));
}
.login-header h2 {
    font-weight: 800;
    margin: 0.75rem 0 0;
    font-size: 1.75rem;
    color: var(--gray-900);
    letter-spacing: -0.03em;
}
.login-header p {
    color: var(--gray-500);
    margin: 0.25rem 0 0;
    font-size: 0.92rem;
}
.login-footer {
    margin-top: 2rem;
    text-align: center;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
}
.login-footer small { color: var(--gray-600); font-size: 0.8rem; }

.login-bg {
    background:
        radial-gradient(circle at 20% 30%, rgba(165, 180, 252, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, var(--primary-700) 0%, var(--primary-900) 100%);
    color: #fff;
    padding: 5rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.login-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}
.login-bg > * { position: relative; z-index: 1; }
.login-bg h1 {
    font-size: 2.6rem;
    font-weight: 800;
    margin: 0 0 1rem;
    letter-spacing: -0.03em;
    line-height: 1.15;
    background: linear-gradient(180deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.login-bg p {
    font-size: 1.05rem;
    opacity: 0.85;
    line-height: 1.65;
    max-width: 440px;
}
.login-bg ul {
    list-style: none;
    padding: 0;
    margin: 2.5rem 0 0;
}
.login-bg ul li {
    padding: 0.65rem 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.login-bg ul li i {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.85rem;
}

/* =========================================================
   PREDICTION RESULT
   ========================================================= */
.result-box {
    padding: 2rem 1.5rem;
    border-radius: var(--radius-xl);
    margin-bottom: 1.25rem;
    text-align: center;
    color: #fff;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.result-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}
.result-box.risk-low {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}
.result-box.risk-medium {
    background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
}
.result-box.risk-high {
    background: linear-gradient(135deg, #f97316 0%, #c2410c 100%);
}
.result-box.risk-very-high {
    background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%);
}
.result-box .probability {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.result-box .risk-level {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.6rem;
    font-weight: 600;
    opacity: 0.95;
}
.result-box p { font-size: 0.92rem; opacity: 0.92; }

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.metric-item:last-child { border: none; }
.metric-item .metric-label {
    color: var(--gray-600);
    font-size: 0.86rem;
    font-weight: 500;
}
.metric-item .metric-value {
    font-weight: 700;
    color: var(--primary-700);
    font-variant-numeric: tabular-nums;
    font-size: 0.95rem;
}

/* =========================================================
   STAR RATING
   ========================================================= */
.bi-star-fill { color: var(--warning); }

/* =========================================================
   SCROLLBAR
   ========================================================= */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--gray-50); }
::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 5px;
    border: 2px solid var(--gray-50);
}
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* =========================================================
   ANIMATIONS
   ========================================================= */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.kpi-card, .chart-card, .card {
    animation: fadeInUp 0.4s ease-out backwards;
}
.row .col-md-3:nth-child(1) .kpi-card { animation-delay: 0.0s; }
.row .col-md-3:nth-child(2) .kpi-card { animation-delay: 0.06s; }
.row .col-md-3:nth-child(3) .kpi-card { animation-delay: 0.12s; }
.row .col-md-3:nth-child(4) .kpi-card { animation-delay: 0.18s; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1200px) {
    .main-content { padding: 1.25rem 1.5rem; }
}
@media (max-width: 992px) {
    .login-wrapper { grid-template-columns: 1fr; }
    .login-bg { display: none; }
    .login-card { padding: 2.5rem 1.5rem; }
    .sidebar { transform: translateX(-100%); transition: transform var(--t-med); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 1rem; }
    .mobile-menu-btn { display: inline-flex; }
}
@media (min-width: 993px) {
    .mobile-menu-btn { display: none; }
}

/* Mobile menu toggle */
.mobile-menu-btn {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 101;
    background: var(--surface);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    box-shadow: var(--shadow-md);
    color: var(--gray-700);
    cursor: pointer;
}

/* =========================================================
   UTILITIES
   ========================================================= */
.text-muted { color: var(--gray-500) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.font-mono { font-family: var(--font-mono); }
.gradient-text {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Section title (between sections) */
.section-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 1.75rem 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--gray-200) 0%, transparent 100%);
}

/* Skeleton placeholder for loading charts */
.chart-skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.4s ease-in-out infinite;
    height: 280px;
    border-radius: var(--radius-md);
}
@keyframes skeleton {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =========================================================
   LOGIN PAGE - PREMIUM ADDITIONS
   ========================================================= */
.login-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 16px -4px rgba(99, 102, 241, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.25);
    position: relative;
}
.login-logo i {
    font-size: 2.2rem;
    color: #fff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.login-logo::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), transparent);
    z-index: -1;
    filter: blur(8px);
}

.login-header h2 {
    font-size: 1.85rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.025em;
    color: var(--gray-900);
}
.login-header p {
    color: var(--gray-500);
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
}
.login-badge {
    display: inline-block;
    margin-top: 0.85rem;
    padding: 0.3rem 0.85rem;
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    color: var(--primary-700);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 999px;
    border: 1px solid var(--primary-200);
}

.form-floating-modern {
    position: relative;
}
.form-label-modern {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}
.form-label-modern i { color: var(--primary-500); font-size: 0.95rem; }
.form-floating-modern .form-control {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    background: var(--gray-50);
    transition: all var(--t-fast);
}
.form-floating-modern .form-control:focus {
    border-color: var(--primary-400);
    background: #fff;
    box-shadow: var(--shadow-glow);
    outline: none;
}

.login-card .btn-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    border: none;
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: all var(--t-fast);
    letter-spacing: 0.01em;
}
.login-card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.45);
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 1.75rem 0 1rem;
    color: var(--gray-400);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}
.login-divider span { padding: 0 1rem; }

.demo-accounts {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.demo-account {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.9rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--t-fast);
}
.demo-account:hover {
    background: #fff;
    border-color: var(--primary-300);
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}
.demo-account.demo-account-active {
    background: var(--primary-50);
    border-color: var(--primary-500);
}
.demo-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 1.1rem;
}
.demo-avatar-admin {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}
.demo-avatar-hr {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}
.demo-info { flex: 1; line-height: 1.3; }
.demo-info strong {
    display: block;
    font-size: 0.88rem;
    color: var(--gray-900);
    font-weight: 600;
}
.demo-info small {
    color: var(--gray-500);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}
.demo-account > i:last-child {
    color: var(--gray-400);
    font-size: 1.15rem;
}
.demo-account:hover > i:last-child {
    color: var(--primary-500);
    transform: translateX(2px);
}

.login-footer-meta {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-100);
    color: var(--gray-400);
    font-size: 0.75rem;
}

/* Login bg side */
.login-bg {
    position: relative;
    overflow: hidden;
}
.login-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(165, 180, 252, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(192, 132, 252, 0.2) 0%, transparent 40%);
    pointer-events: none;
}
.login-bg-content {
    position: relative;
    z-index: 1;
    max-width: 540px;
    margin: 0 auto;
}
.login-bg-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.95rem;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1.75rem;
}
.pulse-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
    70%  { box-shadow: 0 0 0 12px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.login-bg h1 {
    font-size: 2.85rem;
    font-weight: 800;
    margin: 0 0 1.5rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
}
.gradient-text-light {
    background: linear-gradient(135deg, #a5b4fc 0%, #f0abfc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-stats {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.login-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.login-stat-label {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.15rem;
}

/* =========================================================
   ENHANCED PAGE HEADER & TOPBAR
   ========================================================= */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-xs);
}
.topbar-search {
    flex: 1;
    max-width: 380px;
    position: relative;
}
.topbar-search input {
    width: 100%;
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.85rem 0.55rem 2.3rem;
    font-size: 0.88rem;
    transition: all var(--t-fast);
}
.topbar-search input:focus {
    border-color: var(--primary-400);
    background: #fff;
    outline: none;
    box-shadow: var(--shadow-glow);
}
.topbar-search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}
.topbar-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.topbar-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    color: var(--gray-600);
    transition: all var(--t-fast);
    position: relative;
    text-decoration: none;
}
.topbar-btn:hover {
    background: var(--primary-50);
    color: var(--primary-600);
    border-color: var(--primary-200);
}
.topbar-btn .badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 7px;
    height: 7px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--surface);
}
.topbar-date {
    color: var(--gray-500);
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

.breadcrumb-modern {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--gray-500);
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
}
.breadcrumb-modern a { color: var(--gray-500); text-decoration: none; }
.breadcrumb-modern a:hover { color: var(--primary-600); }
.breadcrumb-modern .current { color: var(--gray-800); font-weight: 600; }
.breadcrumb-modern i { font-size: 0.7rem; color: var(--gray-300); }

/* KPI trend indicators */
.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    margin-top: 0.35rem;
}
.kpi-trend.trend-up {
    color: var(--success);
    background: var(--success-light);
}
.kpi-trend.trend-down {
    color: var(--danger);
    background: var(--danger-light);
}
.kpi-trend.trend-neutral {
    color: var(--gray-600);
    background: var(--gray-100);
}

/* Employee avatar (initials) */
.emp-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.78rem;
    flex-shrink: 0;
    letter-spacing: 0;
}
.emp-avatar-1 { background: linear-gradient(135deg, #6366f1, #4338ca); }
.emp-avatar-2 { background: linear-gradient(135deg, #ec4899, #be185d); }
.emp-avatar-3 { background: linear-gradient(135deg, #10b981, #047857); }
.emp-avatar-4 { background: linear-gradient(135deg, #f59e0b, #b45309); }
.emp-avatar-5 { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.emp-avatar-6 { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.emp-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.emp-row-text strong {
    display: block;
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.88rem;
    line-height: 1.25;
}
.emp-row-text small {
    color: var(--gray-500);
    font-size: 0.75rem;
}

/* Soft badges */
.badge-soft {
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.badge-soft.bs-success { background: var(--success-light); color: #065f46; }
.badge-soft.bs-danger  { background: var(--danger-light);  color: #7f1d1d; }
.badge-soft.bs-warning { background: var(--warning-light); color: #78350f; }
.badge-soft.bs-info    { background: var(--info-light);    color: #155e75; }
.badge-soft.bs-gray    { background: var(--gray-100);      color: var(--gray-700); }
.badge-soft .badge-dot-inline {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* Action button group in table */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    transition: all var(--t-fast);
    text-decoration: none;
}
.btn-icon:hover {
    background: var(--primary-50);
    color: var(--primary-600);
    border-color: var(--primary-200);
}
.btn-icon.btn-icon-danger:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: #fca5a5;
}

@media (max-width: 992px) {
    .login-stats { grid-template-columns: repeat(2, 1fr); }
    .topbar { flex-direction: column; gap: 0.75rem; align-items: stretch; }
    .topbar-search { max-width: none; }
}

/* User avatar circle in sidebar */
.user-avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-400) 0%, var(--primary-700) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}
.user-info i { display: none; }

/* =========================================================
   EMPLOYEE HERO CARD
   ========================================================= */
.emp-hero {
    background: linear-gradient(135deg, #fff 0%, var(--primary-50) 100%) !important;
    border: 1px solid var(--primary-100) !important;
    position: relative;
    overflow: hidden;
}
.emp-hero::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    pointer-events: none;
}
.emp-quick-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.85rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--primary-100);
}
.emp-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.emp-stat-label {
    color: var(--gray-500);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.emp-stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}
@media (max-width: 768px) {
    .emp-quick-stats { grid-template-columns: repeat(3, 1fr); }
}

/* Star rating refinement */
.bi-star-fill { color: #f59e0b; font-size: 0.85rem; }

/* =========================================================
   INSIGHT CALLOUT
   ========================================================= */
.insight-callout {
    display: flex;
    gap: 0.95rem;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-radius: var(--radius-xl);
    padding: 1rem 1.25rem;
    align-items: center;
    box-shadow: var(--shadow-xs);
}
.insight-callout .insight-icon {
    width: 42px;
    height: 42px;
    background: #fff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d97706;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.15);
}
.insight-content {
    font-size: 0.88rem;
    color: #78350f;
    line-height: 1.5;
}
.insight-content strong { color: #92400e; font-weight: 700; }

/* =========================================================
   DARK MODE THEME
   ========================================================= */
:root[data-theme="dark"] {
    /* Surfaces flipped */
    --bg-app: #0b1120;
    --surface: #111827;
    --surface-2: #1f2937;

    /* Text - inverted */
    --gray-50:  #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;

    /* Status colors slightly brighter */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --info: #22d3ee;
    --info-light: rgba(34, 211, 238, 0.15);

    /* Sidebar adjustments */
    --sidebar-bg: #020617;
    --sidebar-bg-2: #0f172a;
    --sidebar-active: rgba(99, 102, 241, 0.22);
    --sidebar-text: #cbd5e1;
    --sidebar-text-active: #ffffff;

    /* Shadows for dark surfaces */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.35), 0 2px 4px -2px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 0 4px rgba(99, 102, 241, 0.25);
}

/* Dark mode body background pattern - subtler */
:root[data-theme="dark"] body::before {
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.10) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.08) 0px, transparent 50%);
}

/* Dark mode card surfaces */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .kpi-card,
:root[data-theme="dark"] .chart-card,
:root[data-theme="dark"] .topbar {
    background: var(--surface) !important;
    border-color: #1e293b !important;
}

:root[data-theme="dark"] .card-header {
    background: var(--surface-2) !important;
    color: var(--gray-700);
    border-bottom-color: #1e293b;
}

:root[data-theme="dark"] .table {
    color: var(--gray-700);
    --bs-table-bg: transparent;
    --bs-table-color: var(--gray-700);
    --bs-table-hover-bg: rgba(99, 102, 241, 0.08);
}
:root[data-theme="dark"] .table thead th {
    background: var(--surface-2) !important;
    color: var(--gray-600);
    border-color: #1e293b;
}
:root[data-theme="dark"] .table td,
:root[data-theme="dark"] .table th {
    border-color: #1e293b;
}

:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select {
    background: var(--surface-2);
    border-color: #334155;
    color: var(--gray-700);
}
:root[data-theme="dark"] .form-control:focus,
:root[data-theme="dark"] .form-select:focus {
    background: var(--surface);
    border-color: var(--primary-400);
    color: var(--gray-800);
}
:root[data-theme="dark"] .form-control::placeholder {
    color: var(--gray-500);
}

:root[data-theme="dark"] .btn-light {
    background: var(--surface-2);
    border-color: #334155;
    color: var(--gray-700);
}
:root[data-theme="dark"] .btn-light:hover {
    background: #334155;
    color: var(--gray-800);
}

:root[data-theme="dark"] .btn-icon {
    background: var(--surface-2);
    border-color: #334155;
    color: var(--gray-600);
}
:root[data-theme="dark"] .btn-icon:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: var(--primary-400);
    color: var(--primary-300);
}

:root[data-theme="dark"] .info-row {
    border-bottom-color: #1e293b;
}

:root[data-theme="dark"] .emp-hero {
    background: linear-gradient(135deg, var(--surface) 0%, #1e1b4b 100%) !important;
    border-color: var(--primary-800) !important;
}
:root[data-theme="dark"] .emp-quick-stats {
    border-top-color: var(--primary-800);
}

:root[data-theme="dark"] .insight-callout {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.10) 0%, rgba(217, 119, 6, 0.18) 100%);
    border-color: rgba(217, 119, 6, 0.35);
}
:root[data-theme="dark"] .insight-callout .insight-icon {
    background: var(--surface-2);
    color: var(--warning);
}
:root[data-theme="dark"] .insight-content { color: #fde68a; }
:root[data-theme="dark"] .insight-content strong { color: #fef3c7; }

:root[data-theme="dark"] .alert-success { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
:root[data-theme="dark"] .alert-danger { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }
:root[data-theme="dark"] .alert-warning { background: rgba(251, 191, 36, 0.15); color: #fde68a; }
:root[data-theme="dark"] .alert-info { background: rgba(34, 211, 238, 0.15); color: #67e8f9; }

:root[data-theme="dark"] .pagination .page-link {
    background: var(--surface-2);
    border-color: #334155;
    color: var(--gray-600);
}
:root[data-theme="dark"] .pagination .page-item.active .page-link {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: #fff;
}

:root[data-theme="dark"] .badge-soft.bs-gray {
    background: rgba(148, 163, 184, 0.18);
    color: var(--gray-700);
}

:root[data-theme="dark"] .login-card {
    background: var(--surface);
}
:root[data-theme="dark"] .login-header h2 { color: var(--gray-800); }
:root[data-theme="dark"] .login-divider { color: var(--gray-500); }
:root[data-theme="dark"] .login-divider::before,
:root[data-theme="dark"] .login-divider::after { background: #334155; }
:root[data-theme="dark"] .demo-account {
    background: var(--surface-2);
    border-color: #334155;
}
:root[data-theme="dark"] .demo-account:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary-500);
}
:root[data-theme="dark"] .demo-info strong { color: var(--gray-800); }

/* =========================================================
   THEME TOGGLE BUTTON
   ========================================================= */
.theme-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 500;
    width: 100%;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all var(--t-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}
.theme-toggle .theme-icon-dark,
.theme-toggle .theme-icon-light { display: none; }
:root:not([data-theme="dark"]) .theme-toggle .theme-icon-dark { display: inline; }
:root[data-theme="dark"] .theme-toggle .theme-icon-light { display: inline; }

/* =========================================================
   STAR EMPLOYEES PAGE
   ========================================================= */
.star-hero {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 35%, #fcd34d 100%) !important;
    border: 1px solid #fbbf24 !important;
    overflow: hidden;
    position: relative;
}
.star-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.45) 0%, transparent 35%),
        radial-gradient(circle at 85% 80%, rgba(217,119,6,0.18) 0%, transparent 45%);
    pointer-events: none;
}
.star-hero-body {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2.5rem 2rem !important;
}
.star-crown {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px -4px rgba(217, 119, 6, 0.5),
                inset 0 2px 4px rgba(255,255,255,0.4);
    animation: crown-float 3s ease-in-out infinite;
}
.star-crown i {
    font-size: 1.8rem;
    color: #fff;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.25));
}
@keyframes crown-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.star-hero-label {
    color: #78350f;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.25rem;
}
.star-hero-avatar {
    width: 110px !important;
    height: 110px !important;
    font-size: 2rem !important;
    border-radius: 24px !important;
    margin: 0 auto 1.25rem;
    box-shadow: 0 12px 28px -6px rgba(0,0,0,0.25),
                0 0 0 6px rgba(255,255,255,0.4);
}
.star-hero-name {
    font-size: 2rem;
    font-weight: 800;
    color: #451a03;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
}
.star-hero-meta {
    color: #78350f;
    font-size: 0.92rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}
.star-hero-meta i { color: #b45309; margin-right: 0.3rem; }
.star-hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-xl);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.6);
}
.star-stat-label {
    color: #92400e;
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}
.star-stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #451a03;
    line-height: 1;
    margin: 0.3rem 0 0.2rem;
    font-variant-numeric: tabular-nums;
}
.star-stat-value small { font-size: 0.8rem; color: #92400e; font-weight: 600; }
.star-stat-stars { color: #f59e0b; font-size: 0.85rem; }
.star-stat-stars .bi-star { color: rgba(146, 64, 14, 0.25); }
.star-stat-sub { font-size: 0.72rem; color: #92400e; }
.star-hero-btn {
    background: rgba(255,255,255,0.7) !important;
    border: 1px solid rgba(146, 64, 14, 0.3) !important;
    color: #78350f !important;
    font-weight: 600;
    padding: 0.6rem 1.5rem !important;
    border-radius: var(--radius-md) !important;
}
.star-hero-btn:hover {
    background: #fff !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Monthly cards */
.star-month-card {
    transition: transform var(--t-fast), box-shadow var(--t-fast);
    border: 1px solid var(--gray-200) !important;
    height: 100%;
}
.star-month-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md) !important;
}
.star-month-card.star-month-current {
    border: 2px solid var(--warning) !important;
    background: linear-gradient(135deg, #fffbeb 0%, #fff 100%) !important;
}
.star-month-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
    line-height: 1;
}
.star-month-year {
    color: var(--gray-500);
    font-size: 0.75rem;
    margin-top: 0.15rem;
}
.star-month-num {
    background: var(--gray-100);
    color: var(--gray-500);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}
.star-month-name {
    display: block;
    color: var(--gray-900) !important;
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.2;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.star-month-name:hover { color: var(--primary-600) !important; }
.star-month-role {
    color: var(--gray-500);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.star-month-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
}
.star-month-perf { color: #f59e0b; font-size: 0.8rem; }
.star-month-score {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

/* Dark mode override for star page */
:root[data-theme="dark"] .star-hero {
    background: linear-gradient(135deg, #422006 0%, #78350f 50%, #92400e 100%) !important;
    border-color: #b45309 !important;
}
:root[data-theme="dark"] .star-hero-label,
:root[data-theme="dark"] .star-hero-meta,
:root[data-theme="dark"] .star-stat-label,
:root[data-theme="dark"] .star-stat-sub { color: #fde68a; }
:root[data-theme="dark"] .star-hero-meta i { color: #fbbf24; }
:root[data-theme="dark"] .star-hero-name,
:root[data-theme="dark"] .star-stat-value { color: #fef3c7; }
:root[data-theme="dark"] .star-stat-value small { color: #fde68a; }
:root[data-theme="dark"] .star-hero-stats {
    background: rgba(0,0,0,0.25);
    border-color: rgba(251,191,36,0.25);
}
:root[data-theme="dark"] .star-stat-stars .bi-star { color: rgba(254, 243, 199, 0.18); }
:root[data-theme="dark"] .star-hero-btn {
    background: rgba(255,255,255,0.1) !important;
    border-color: rgba(251, 191, 36, 0.4) !important;
    color: #fde68a !important;
}
:root[data-theme="dark"] .star-month-card.star-month-current {
    background: linear-gradient(135deg, #422006 0%, var(--surface) 100%) !important;
}
:root[data-theme="dark"] .star-month-num {
    background: var(--surface-2);
    color: var(--gray-500);
}
:root[data-theme="dark"] .star-month-footer { border-top-color: #1e293b; }

@media (max-width: 768px) {
    .star-hero-stats { grid-template-columns: repeat(2, 1fr); }
    .star-hero-name { font-size: 1.5rem; }
    .star-crown { width: 50px; height: 50px; top: 1rem; right: 1rem; }
    .star-crown i { font-size: 1.3rem; }
}

/* =========================================================
   AVATAR IMG WRAPPER (DiceBear-powered)
   ========================================================= */
.emp-avatar-img-wrap {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: var(--gray-100);
}
.emp-avatar-img-wrap.emp-avatar-1 { background: linear-gradient(135deg, #6366f1, #4338ca); }
.emp-avatar-img-wrap.emp-avatar-2 { background: linear-gradient(135deg, #ec4899, #be185d); }
.emp-avatar-img-wrap.emp-avatar-3 { background: linear-gradient(135deg, #10b981, #047857); }
.emp-avatar-img-wrap.emp-avatar-4 { background: linear-gradient(135deg, #f59e0b, #b45309); }
.emp-avatar-img-wrap.emp-avatar-5 { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.emp-avatar-img-wrap.emp-avatar-6 { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.emp-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: relative;
    z-index: 1;
}

.emp-avatar-initials {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    z-index: 0;
    text-transform: uppercase;
    letter-spacing: 0;
    font-size: inherit;
}

/* When image fails, parent gets this class — bring initials on top */
.emp-avatar-img-wrap.emp-avatar-fallback-active .emp-avatar-initials {
    z-index: 2;
}

/* Subtle ring around avatars */
.emp-avatar-img-wrap {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.65);
}
:root[data-theme="dark"] .emp-avatar-img-wrap {
    box-shadow: 0 0 0 2px rgba(30, 41, 59, 0.65);
}

/* Loading skeleton while image fetches */
.emp-avatar-img {
    animation: avatar-fade-in 0.3s ease-out;
}
@keyframes avatar-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Star hero — center the avatar wrapper */
.star-hero-avatar-wrap {
    display: flex;
    justify-content: center;
    margin: 0 auto 1.25rem;
}
.star-hero-avatar-wrap .emp-avatar-img-wrap {
    box-shadow: 0 12px 28px -6px rgba(0,0,0,0.25),
                0 0 0 6px rgba(255,255,255,0.6);
}

/* =========================================================
   ADMIN-ONLY SIDEBAR ACCENTS
   ========================================================= */
.sidebar-role-pill {
    margin-left: auto;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    -webkit-text-fill-color: #fff;
    -webkit-background-clip: initial;
    background-clip: initial;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}
.sidebar-role-pill i {
    -webkit-text-fill-color: #fff;
    background: none;
    filter: none;
    font-size: 0.7rem;
}

/* Admin sidebar — subtle red accent in admin-only section header */
.sidebar-admin .nav-section:has(.bi-shield-fill-check),
.sidebar-admin .nav-section i.bi-shield-fill-check {
    color: #f87171;
}

/* Admin-only menu links — red accent stripe */
.nav-link-admin::before {
    background: linear-gradient(180deg, #f87171, #dc2626) !important;
}
.nav-link-admin:hover,
.nav-link-admin.active {
    background: rgba(239, 68, 68, 0.12) !important;
}
.nav-link-admin i {
    color: #f87171 !important;
}

/* =========================================================
   USER ROLE BADGE (in sidebar footer)
   ========================================================= */
.user-info .user-role-badge-admin {
    display: inline-block;
    margin-top: 0.15rem;
    padding: 0.1rem 0.5rem;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-radius: 999px;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}
.user-info .user-role-badge-hr {
    display: inline-block;
    margin-top: 0.15rem;
    padding: 0.1rem 0.5rem;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border-radius: 999px;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

/* =========================================================
   ADMIN CONTROL PANEL (dashboard widget)
   ========================================================= */
.admin-panel {
    background: linear-gradient(135deg, #fee2e2 0%, #fff 60%, #fef3c7 100%);
    border: 1px solid #fecaca !important;
    border-radius: var(--radius-xl) !important;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.admin-panel-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 6px 14px -3px rgba(239, 68, 68, 0.4);
}
.admin-panel-text { flex: 1; min-width: 200px; }
.admin-panel-text strong {
    font-size: 1rem;
    color: #7f1d1d;
    font-weight: 700;
    display: block;
}
.admin-panel-text span {
    font-size: 0.85rem;
    color: #991b1b;
}
.admin-panel-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.admin-panel .btn-admin {
    background: #fff;
    border: 1px solid #fca5a5;
    color: #991b1b;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--t-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.admin-panel .btn-admin:hover {
    background: #fef2f2;
    border-color: #f87171;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.admin-panel .btn-admin.btn-admin-primary {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #fff;
    border-color: #b91c1c;
}
.admin-panel .btn-admin.btn-admin-primary:hover {
    box-shadow: 0 8px 18px -4px rgba(239, 68, 68, 0.5);
}

/* Dark mode admin panel */
:root[data-theme="dark"] .admin-panel {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, var(--surface) 60%, rgba(217, 119, 6, 0.10) 100%) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}
:root[data-theme="dark"] .admin-panel-text strong { color: #fca5a5; }
:root[data-theme="dark"] .admin-panel-text span { color: #fecaca; }
:root[data-theme="dark"] .admin-panel .btn-admin {
    background: var(--surface-2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

/* =========================================================
   NAV BADGE (unread notification count in sidebar)
   ========================================================= */
.nav-badge {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    margin-left: auto;
    min-width: 22px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
}

/* =========================================================
   NOTIFICATIONS LIST
   ========================================================= */
.notif-unread {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.06), transparent 30%);
    border-left: 3px solid var(--primary-500) !important;
}
.notif-dot {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.notif-info    { background: var(--info-light); color: var(--info); }
.notif-success { background: var(--success-light); color: var(--success); }
.notif-warning { background: var(--warning-light); color: var(--warning); }
.notif-danger  { background: var(--danger-light); color: var(--danger); }

:root[data-theme="dark"] .notif-unread {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.18), transparent 30%);
}
:root[data-theme="dark"] .list-group-item {
    background: transparent;
    color: var(--gray-700);
    border-color: #1e293b;
}

/* =========================================================
   SIDEBAR — COMPACT REFINEMENTS (override for tight fit)
   ========================================================= */
:root { --sidebar-w: 248px; }

.sidebar-brand {
    padding: 1.1rem 1.1rem 0.85rem !important;
    gap: 0.55rem !important;
    flex-wrap: wrap;
}
.sidebar-brand i { font-size: 1.45rem !important; }
.sidebar-brand span {
    font-size: 1rem !important;
    flex: 1 1 auto;
    min-width: 0;
}

.sidebar-role-pill {
    margin-left: 0 !important;
    font-size: 0.56rem !important;
    padding: 0.15rem 0.45rem !important;
    flex: 0 0 auto;
    gap: 0.2rem;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.4);
}
.sidebar-role-pill i { font-size: 0.62rem !important; }

.sidebar-nav {
    padding: 0.5rem 0.6rem !important;
}
.sidebar-nav .nav-section {
    padding: 0.85rem 0.7rem 0.35rem !important;
    font-size: 0.62rem !important;
    letter-spacing: 0.07em !important;
}
.sidebar-nav .nav-link {
    padding: 0.5rem 0.7rem !important;
    font-size: 0.82rem !important;
    gap: 0.6rem !important;
    line-height: 1.25;
}
.sidebar-nav .nav-link i {
    font-size: 0.98rem !important;
    width: 16px !important;
}

.nav-badge {
    font-size: 0.58rem !important;
    padding: 0.05rem 0.42rem !important;
    min-width: 18px !important;
    margin-left: auto;
    line-height: 1.3;
}

.sidebar-footer {
    padding: 0.7rem 0.85rem !important;
}
.user-info {
    padding: 0.3rem !important;
    gap: 0.55rem !important;
    margin-bottom: 0.25rem;
}
.user-avatar-circle {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.92rem !important;
    border-width: 1.5px !important;
}
.user-info .user-name {
    font-size: 0.82rem !important;
    line-height: 1.15 !important;
}
.user-info .user-role-badge-admin,
.user-info .user-role-badge-hr {
    font-size: 0.55rem !important;
    padding: 0.07rem 0.42rem !important;
    margin-top: 0.1rem !important;
}

.theme-toggle {
    padding: 0.4rem 0.6rem !important;
    font-size: 0.76rem !important;
    margin-bottom: 0.35rem !important;
}

.sidebar-footer .btn-outline-light {
    padding: 0.38rem !important;
    font-size: 0.76rem !important;
}

/* Adjust main content margin to new sidebar width */
.main-content {
    margin-left: var(--sidebar-w) !important;
}

/* Hide scrollbar visually but keep functional (when menu is long) */
.sidebar-nav::-webkit-scrollbar { width: 3px; }

/* On laptops with shorter screens, allow more breathing room */
@media (max-height: 800px) {
    .sidebar-brand { padding: 0.85rem 1rem 0.7rem !important; }
    .sidebar-nav .nav-link { padding: 0.42rem 0.7rem !important; font-size: 0.8rem !important; }
    .sidebar-nav .nav-section { padding: 0.6rem 0.7rem 0.3rem !important; }
}

/* =========================================================
   COMPARE PAGE - GRID LAYOUT WITH FILTERS
   ========================================================= */
.compare-form-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: stretch;
}
.compare-side {
    background: var(--surface-2);
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}
.compare-side-a {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--surface-2) 80%);
    border-color: var(--primary-200);
}
.compare-side-b {
    background: linear-gradient(135deg, #fce7f3 0%, var(--surface-2) 80%);
    border-color: #fbcfe8;
}
.compare-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    color: var(--gray-400);
}
.compare-arrow i { font-size: 1.5rem; }
.compare-btn-wrap {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 0.25rem;
}
.compare-btn-wrap .btn { min-width: 220px; }

/* Hide native option styling when filtered out (display:none doesn't work on options in some browsers) */
.compare-select option[hidden] { display: none; }
.compare-select option { padding: 0.4rem 0.6rem; }
.compare-select option:checked {
    background: var(--primary-100);
    color: var(--primary-800);
    font-weight: 600;
}

/* Dark mode */
:root[data-theme="dark"] .compare-side-a {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, var(--surface) 80%) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}
:root[data-theme="dark"] .compare-side-b {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.12) 0%, var(--surface) 80%) !important;
    border-color: rgba(236, 72, 153, 0.3) !important;
}
:root[data-theme="dark"] .compare-select option:checked {
    background: rgba(99, 102, 241, 0.3);
    color: var(--gray-800);
}

@media (max-width: 768px) {
    .compare-form-grid {
        grid-template-columns: 1fr;
    }
    .compare-arrow {
        transform: rotate(90deg);
        padding: 0.5rem 0;
    }
}

/* =========================================================
   COLLAPSIBLE NAV GROUPS - MODERN ACCORDION
   ========================================================= */
.sidebar-brand-link {
    text-decoration: none !important;
    transition: background var(--t-fast);
    cursor: pointer;
}
.sidebar-brand-link:hover {
    background: rgba(255, 255, 255, 0.04);
}

.nav-group {
    margin-top: 0.25rem;
    padding: 0 !important;
}
.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.7rem;
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--t-fast);
    letter-spacing: 0.01em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
    position: relative;
}
.nav-group-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--sidebar-text-active);
}
.nav-group-toggle i:first-child {
    color: var(--primary-400);
    font-size: 0.95rem;
}
.nav-group-toggle span {
    flex: 1;
    font-weight: 700;
}
.nav-group-chevron {
    font-size: 0.7rem !important;
    transition: transform var(--t-med);
    color: var(--gray-500) !important;
}
.nav-group-toggle[aria-expanded="true"] .nav-group-chevron {
    transform: rotate(180deg);
}

.nav-group-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}
.nav-group-list.open {
    max-height: 500px;
}
.nav-group-list li {
    padding: 0;
    margin: 1px 0 1px 0.5rem;
}
.nav-group-list .nav-link {
    font-size: 0.8rem !important;
    padding: 0.4rem 0.7rem 0.4rem 1.4rem !important;
    position: relative;
}
.nav-group-list .nav-link::after {
    content: '';
    position: absolute;
    left: 0.55rem;
    top: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-50%);
    transition: all var(--t-fast);
}
.nav-group-list .nav-link:hover::after,
.nav-group-list .nav-link.active::after {
    background: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Admin group accent */
.nav-group-toggle.nav-group-admin i:first-child {
    color: #f87171;
}
.sidebar-admin .nav-group-toggle.nav-group-admin:hover {
    background: rgba(239, 68, 68, 0.08);
}

/* Smooth nav-link active indicator update for nested items */
.nav-group-list .nav-link.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--sidebar-text-active);
    font-weight: 600;
}

@media (max-height: 800px) {
    .nav-group-list .nav-link { padding: 0.35rem 0.7rem 0.35rem 1.4rem !important; }
}
