/* ============ HRMS Modern Design System ============ */
:root {
    --primary: #C9A96E;
    --primary-dark: #A9874E;
    --primary-light: #F5EFE3;
    --secondary: #1B2B3A;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #0B1A2A;
    --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;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,.1);
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --bg: #F8F9FB;
    --border: #E5E1D8;
    --text: #111111;
    --overlay: rgba(15,23,42,.5);
    --transition: all .2s ease;
    --sidebar-w: 260px;
    --topbar-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w); background: var(--surface); color: var(--gray-800); border-right: 1px solid var(--gray-200);
    position: fixed; top: 0; left: 0; bottom: 0; display: flex; flex-direction: column;
    transition: var(--transition); z-index: 100;
}
.sidebar-brand {
    height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
    padding: 0 20px; border-bottom: 1px solid var(--gray-200); font-weight: 700;
    font-size: 18px; color: var(--primary);
}
.sidebar-brand .logo {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, #1B2B3A, #C9A96E);
    display: grid; place-items: center; color: #fff; font-weight: 800;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--gray-400); padding: 12px 12px 6px; }
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: var(--radius-sm); color: var(--gray-600); font-weight: 500;
    cursor: pointer; transition: var(--transition); margin-bottom: 2px;
}
.nav-item:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-item.active { background: var(--primary-light); color: #1B2B3A; border-left: 3px solid var(--primary); }
.nav-item .icon { width: 20px; height: 20px; stroke-width: 2; }
.nav-item .badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 10px; }

.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 50;
}
.topbar .search {
    flex: 1; max-width: 480px; position: relative;
}
.topbar .search input {
    width: 100%; padding: 10px 14px 10px 40px; border: 1px solid var(--gray-200);
    border-radius: 10px; background: var(--gray-50); color: var(--gray-800); font-size: 14px; outline: none;
    transition: var(--transition);
}
.topbar .search input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-light); }
.topbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-400); }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 10px; border: none; background: transparent;
    display: grid; place-items: center; cursor: pointer; color: var(--gray-600); position: relative;
    transition: var(--transition);
}
.icon-btn:hover { background: var(--gray-100); color: var(--gray-900); }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

.user-menu { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 10px; cursor: pointer; }
.user-menu:hover { background: var(--gray-100); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #1B2B3A, #C9A96E); color: #fff; display: grid; place-items: center; font-weight: 600; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.content { padding: 24px; flex: 1; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.page-subtitle { color: var(--gray-500); font-size: 13px; margin-top: 2px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 15px; font-weight: 600; color: var(--gray-900); }
.card-body { padding: 20px; }

/* Stat cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px;
    display: flex; align-items: center; gap: 16px; transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
    background: var(--primary-light); color: var(--primary);
}
.stat-icon.success { background: #d1fae5; color: var(--success); }
.stat-icon.warning { background: #fef3c7; color: var(--warning); }
.stat-icon.danger { background: #fee2e2; color: var(--danger); }
.stat-icon.info { background: #dbeafe; color: var(--info); }
.stat-value { font-size: 24px; font-weight: 700; color: var(--gray-900); }
.stat-label { font-size: 13px; color: var(--gray-500); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px;
    border-radius: var(--radius-sm); font-weight: 500; font-size: 14px;
    border: 1px solid transparent; cursor: pointer; transition: var(--transition);
    text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #1B2B3A; font-weight: 600; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-100); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.form-control {
    width: 100%; padding: 10px 12px; border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm); font-size: 14px; background: var(--surface); color: var(--gray-800); outline: none;
    transition: var(--transition);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 12px 16px; background: var(--gray-50); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-600); border-bottom: 1px solid var(--gray-200); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); font-size: 14px; color: var(--gray-700); }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--gray-50); }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-gray { background: var(--gray-100); color: var(--gray-700); }
.badge-primary { background: var(--primary-light); color: var(--primary); }

/* Progress */
.progress { height: 8px; background: var(--gray-200); border-radius: 10px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #C9A96E, #1B2B3A); transition: width .3s; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: var(--overlay); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-backdrop.active { display: flex; }
.modal { background: var(--surface); color: var(--gray-800); border-radius: var(--radius-lg); max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { padding: 18px 24px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 17px; font-weight: 600; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 8px; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: var(--surface); color: var(--gray-800); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary); min-width: 280px; animation: slideIn .3s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }


/* Utility */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 13px; }
.text-right { text-align: right; }
.hidden { display: none; }

/* Face-authentication camera preview.
   Counter-mirror the live preview so the user's left/right sides appear in their
   actual positions on screen. Face detection still reads the original video frames. */
.face-video {
    display: block; width: 100%; max-width: 320px; height: auto; max-height: 70vh; margin: 12px auto;
    border-radius: 8px; background: #000; object-fit: contain; transform: scaleX(-1) !important;
}

/* ============================================================
   Acxelerate HRMS Brand Layer
   Navy + Gold + Cream | Inter | 16px content default
   ============================================================ */
:root {
    --brand-navy: #1B2B3A;
    --brand-navy-deep: #0B1A2A;
    --brand-gold: #C9A96E;
    --brand-gold-dark: #A9874E;
    --brand-cream: #F5EFE3;
    --brand-offwhite: #F8F9FB;
    --brand-neutral: #F4F5F6;
    --brand-black: #111111;
    --brand-gray: #555555;
}
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 16px; background: var(--bg); color: var(--text); }
.page-title, .card-title, .modal-title { color: var(--brand-navy-deep); }
.sidebar-brand { color: var(--brand-navy); }
.sidebar-brand .logo, .avatar { background: linear-gradient(135deg, var(--brand-navy), var(--brand-gold)); }
.nav-item.active { background: var(--brand-cream); color: var(--brand-navy); }
.topbar { background: var(--surface); border-bottom-color: var(--border); }
.card, .stat-card, .table-wrap, .modal, .toast { border-color: var(--border); }
.card-header, .modal-header, .modal-footer { border-color: var(--border); }
.btn-primary { background: var(--brand-gold); color: var(--brand-navy); border-color: var(--brand-gold); }
.btn-primary:hover { background: var(--brand-gold-dark); color: #fff; }
.btn-secondary { color: var(--brand-navy); border-color: var(--btn-border, #D8D0C0); }
.btn-secondary:hover { background: var(--brand-cream); }
.btn-ghost:hover, .icon-btn:hover { background: var(--brand-cream); color: var(--brand-navy); }
.form-control:focus, .topbar .search input:focus { border-color: var(--brand-gold); box-shadow: 0 0 0 3px rgba(201,169,110,.20); }
.table th { background: var(--brand-cream); color: var(--brand-navy); }
.table tr:hover td { background: var(--gray-50); }
.badge-primary { background: var(--brand-cream); color: var(--brand-navy); }
.progress-bar { background: linear-gradient(90deg, var(--brand-gold), var(--brand-navy)); }
.toast { border-left-color: var(--brand-gold); }
/* Additional component styles */
.empty-state { text-align:center; padding:60px 20px; color:var(--gray-500); }
.empty-state .icon { font-size:48px; margin-bottom:12px; }
.empty-state h3 { font-size:18px; color:var(--gray-700); margin-bottom:8px; }
.divider { height:1px; background:var(--gray-200); margin:16px 0; }
.chip { display:inline-flex; align-items:center; gap:4px; padding:4px 10px; background:var(--gray-100); border-radius:20px; font-size:12px; color:var(--gray-700); }
.chip-remove { cursor:pointer; color:var(--gray-400); }
.chip-remove:hover { color:var(--danger); }
.skeleton { background:linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%); background-size:200% 100%; animation:shimmer 1.5s infinite; border-radius:6px; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }.detail-row { display:flex; justify-content:space-between; padding:10px 0; border-bottom:1px solid var(--gray-100); }
.detail-row:last-child { border-bottom:0; }
.detail-row span { color:var(--gray-500); font-size:13px; }
.detail-row strong { font-size:14px; color:var(--gray-800); }
.timeline-item { padding:12px 0 12px 24px; border-left:2px solid var(--gray-200); position:relative; }
.timeline-item::before { content:''; position:absolute; left:-5px; top:16px; width:8px; height:8px; border-radius:50%; background:var(--primary); }
.timeline-item .time { font-size:12px; color:var(--gray-400); }

/* ============================================================
   Round 3 layer: avatars, sidebar profile, theme/lang controls,
   lightbox, notifications panel, dark theme
   ============================================================ */
.btn-warning { background: var(--warning); color: #1b1b1b; }
.tab-pane { display: none; } .tab-pane.active { display: block; }

/* ---- Avatars: always a perfect circle, photo cropped to fill (never stretched) ---- */
.avatar {
    position: relative; display: inline-grid; place-items: center; flex: 0 0 auto;
    width: 36px; height: 36px; border-radius: 50%; overflow: hidden; aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, var(--brand-navy), var(--brand-gold)); color: #fff;
    font-weight: 600; line-height: 1; vertical-align: middle; user-select: none;
}
.avatar .avatar-initials { position: relative; z-index: 0; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; border-radius: 0; object-fit: cover; object-position: center; z-index: 1; display: block; }
.avatar img[data-lightbox] { cursor: zoom-in; }
.avatar.avatar-ring { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary); }

/* ---- Lightbox (click any avatar photo to see it full size) ---- */
.lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(8,12,20,.88); display: none; align-items: center; justify-content: center; flex-direction: column; gap: 14px; padding: 24px; }
.lightbox.open { display: flex; animation: lbFade .15s ease; }
.lightbox img { max-width: min(92vw, 900px); max-height: 80vh; max-height: 80dvh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #111; object-fit: contain; }
.lightbox .lb-cap { color: #f1f5f9; font-weight: 600; font-size: 16px; }
.lightbox .lb-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; cursor: pointer; line-height: 1; }
.lightbox .lb-close:hover { background: rgba(255,255,255,.28); }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }

/* ---- Sidebar ---- */
.sidebar-nav .nav-item svg.icon { flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-group > summary { list-style: none; cursor: pointer; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary .chev { margin-left: auto; width: 16px; height: 16px; transition: transform .2s; }
.nav-group[open] > summary .chev { transform: rotate(180deg); }
.nav-sub { margin: 2px 0 6px 20px; padding-left: 10px; border-left: 1px solid var(--gray-200); }
.nav-sub .nav-item { padding: 8px 10px; font-size: 14px; }
.sidebar-profile { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); color: var(--gray-800); }
.sidebar-profile:hover { background: var(--primary-light); color: var(--gray-900); }
.sidebar-profile .sp-name { font-weight: 600; font-size: 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-profile .sp-role { font-size: 12px; color: var(--gray-500); }
.sidebar-profile .sp-text { min-width: 0; flex: 1; }
.sidebar-overlay { display: none; }

/* ---- Topbar ---- */
a.user-menu { color: inherit; text-decoration: none; }
a.user-menu:hover { color: inherit; }
.user-menu .um-name { font-weight: 600; font-size: 13px; line-height: 1.25; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.user-menu .um-role { font-size: 11px; color: var(--gray-500); }
.icon-btn svg { fill: none; stroke: currentColor; }
.theme-toggle .sun { display: none; } [data-theme="dark"] .theme-toggle .sun { display: block; } [data-theme="dark"] .theme-toggle .moon { display: none; }
.lang-switch { display: inline-flex; border: 1px solid var(--gray-300); border-radius: 10px; overflow: hidden; }
.lang-switch a { padding: 7px 10px; font-size: 13px; font-weight: 600; color: var(--gray-600); line-height: 1; }
.lang-switch a.active { background: var(--primary); color: #1B2B3A; }
.lang-switch a:not(.active):hover { background: var(--gray-100); }

/* ---- Notification panel ---- */
.notif-panel { position: fixed; top: calc(var(--topbar-h) + 6px); right: 16px; width: 380px; max-width: calc(100vw - 24px); max-height: min(520px, calc(100dvh - 90px)); overflow-y: auto; background: var(--surface); color: var(--gray-800); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 300; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600; position: sticky; top: 0; background: var(--surface); }
.notif-head .link-btn { background: none; border: 0; color: var(--primary-dark); cursor: pointer; font-size: 12px; font-weight: 600; }
.notif-item { display: block; padding: 12px 16px; border-bottom: 1px solid var(--gray-100); color: inherit; }
.notif-item:hover { background: var(--gray-50); color: inherit; }
.notif-item.unread { background: var(--primary-light); }
.notif-item .n-title { font-size: 13px; font-weight: 600; } .notif-item .n-msg { font-size: 12px; color: var(--gray-500); margin-top: 2px; overflow-wrap: anywhere; }
.notif-item .n-time { font-size: 11px; color: var(--gray-400); margin-top: 4px; }
.notif-empty { padding: 28px 16px; text-align: center; color: var(--gray-500); }
.notif-foot { padding: 10px 16px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; font-size: 12px; color: var(--gray-500); }
.push-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 16px; border: 1px solid var(--primary); background: var(--primary-light); border-radius: var(--radius); font-size: 14px; }

/* ---- Search results ---- */
.search-results { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-top: 8px; max-height: 400px; overflow-y: auto; box-shadow: var(--shadow-lg); z-index: 200; }
.search-results .sr-head { padding: 8px 12px; background: var(--gray-50); font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; }
.search-results a { display: block; padding: 10px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-800); font-size: 14px; }
.search-results a:hover { background: var(--gray-50); }
.search-results .sr-empty { padding: 20px; color: var(--gray-500); text-align: center; }

/* ---- Profile hero ---- */
.profile-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-hero .avatar { font-size: 38px; }

/* ============ Dark theme ============ */
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0E1621; --surface: #16212E; --surface-2: #1B2A3A; --border: #2A3A4D; --text: #E7ECF2; --overlay: rgba(0,0,0,.65);
    --primary-light: #3A3427; --primary-dark: #E0C48A;
    --gray-50: #121C28; --gray-100: #1B2A3A; --gray-200: #2A3A4D; --gray-300: #3A4D63; --gray-400: #7C8DA3;
    --gray-500: #9AA9BB; --gray-600: #B8C4D2; --gray-700: #D3DCE6; --gray-800: #E7ECF2; --gray-900: #F5F7FA;
    --brand-cream: #2E2A20; --brand-offwhite: #0E1621; --brand-navy: #E7ECF2; --brand-navy-deep: #F5F7FA;
    --btn-border: #3A4D63;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 4px 10px rgba(0,0,0,.4); --shadow-lg: 0 10px 30px rgba(0,0,0,.55);
    --cal-present-bg:#12372A; --cal-present-fg:#6EE7A8; --cal-present-bd:#1F6B4C;
    --cal-half-bg:#3B3010;    --cal-half-fg:#F6D26B;    --cal-half-bd:#6E571A;
    --cal-absent-bg:#3C1B1E;  --cal-absent-fg:#FCA5A5;  --cal-absent-bd:#7A2E34;
    --cal-leave-bg:#17294D;   --cal-leave-fg:#9DBBFF;   --cal-leave-bd:#2C4C8C;
    --cal-holiday-bg:#2A1F4A; --cal-holiday-fg:#C9B0FF; --cal-holiday-bd:#4F3B8A;
    --cal-off-bg:#1D2733;     --cal-off-fg:#93A1B3;     --cal-off-bd:#2F3E50;
}
[data-theme="dark"] .btn-primary, [data-theme="dark"] .auth-card .btn-primary { color: #14202C; }
[data-theme="dark"] .btn-primary:hover { background: var(--brand-gold-dark); color: #fff; }
[data-theme="dark"] .nav-item.active { color: var(--brand-gold); }
[data-theme="dark"] .sidebar-brand { color: var(--brand-gold); }
[data-theme="dark"] .table th { background: var(--surface-2); color: var(--gray-700); }
[data-theme="dark"] .badge-success { background: rgba(16,185,129,.18); color: #6EE7B7; }
[data-theme="dark"] .badge-warning { background: rgba(245,158,11,.18); color: #FCD34D; }
[data-theme="dark"] .badge-danger { background: rgba(239,68,68,.2); color: #FCA5A5; }
[data-theme="dark"] .badge-info { background: rgba(59,130,246,.2); color: #93C5FD; }
[data-theme="dark"] .badge-primary { background: var(--primary-light); color: var(--brand-gold); }
[data-theme="dark"] .stat-icon.success { background: rgba(16,185,129,.18); }
[data-theme="dark"] .stat-icon.warning { background: rgba(245,158,11,.18); }
[data-theme="dark"] .stat-icon.danger { background: rgba(239,68,68,.2); }
[data-theme="dark"] .stat-icon.info { background: rgba(59,130,246,.2); }
[data-theme="dark"] .cal-weekoff { background: repeating-linear-gradient(135deg,var(--cal-off-bg),var(--cal-off-bg) 8px,#232F3D 8px,#232F3D 16px); }
[data-theme="dark"] .cal-dot.cal-weekoff { background: repeating-linear-gradient(135deg,var(--cal-off-bg),var(--cal-off-bg) 3px,#2F3E50 3px,#2F3E50 6px); }
[data-theme="dark"] .cal-cell, [data-theme="dark"] .cal-wrap { background: var(--surface); }
[data-theme="dark"] .cal-upcoming, [data-theme="dark"] .cal-none, [data-theme="dark"] .cal-pending { background: var(--surface); }
[data-theme="dark"] .cal-cell.is-today .cal-num::after { color: var(--brand-gold); }
[data-theme="dark"] .cal-pending { color: var(--brand-gold); }
[data-theme="dark"] .msg.mine .msg-bubble { color: #14202C; }
[data-theme="dark"] .toast.success { background: #123628; } [data-theme="dark"] .toast.error { background: #3C1B1E; }
[data-theme="dark"] select.form-control { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239AA9BB' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>"); }
[data-theme="dark"] .form-control::placeholder, [data-theme="dark"] input::placeholder, [data-theme="dark"] textarea::placeholder { color: var(--gray-400); }
[data-theme="dark"] input[type="date"], [data-theme="dark"] input[type="time"], [data-theme="dark"] input[type="month"] { color-scheme: dark; }
[data-theme="dark"] .progress-bar { background: linear-gradient(90deg, var(--brand-gold), #5C7EA3); }
[data-theme="dark"] .avatar { color: #fff; }
[data-theme="dark"] .auth-wrap { background: linear-gradient(135deg, #06101B 0%, #0E1D2C 65%, #6B5832 140%); }
[data-theme="dark"] .auth-right { background: var(--bg); }
[data-theme="dark"] .auth-card { background: var(--surface); border-color: var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
[data-theme="dark"] .ext-card { background: var(--surface); color: var(--text); }
[data-theme="dark"] .modal-backdrop { background: var(--overlay); }
[data-theme="dark"] a { color: var(--brand-gold); }
[data-theme="dark"] a.btn, [data-theme="dark"] .nav-item, [data-theme="dark"] .lang-switch a, [data-theme="dark"] a.user-menu, [data-theme="dark"] .sidebar-profile, [data-theme="dark"] .search-results a, [data-theme="dark"] .notif-item { color: inherit; }
[data-theme="dark"] .btn-primary { color: #14202C; }
[data-theme="dark"] .btn-danger, [data-theme="dark"] .btn-success { color: #fff; }
[data-theme="dark"] a.btn-secondary { color: var(--gray-800); }
[data-theme="dark"] .nav-item.active { color: var(--brand-gold); }
.icon-btn .dot.count { top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; font-size: 10px; font-weight: 700; line-height: 17px; color: #fff; text-align: center; }

/* Text-style button used in the notification footer */
.link-btn { background: none; border: 0; padding: 0; margin: 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--primary-dark); cursor: pointer; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }

/* ===== User picker (searchable checkbox dropdown) ===== */
.up { position: relative; width: 100%; }
.up-trigger { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 8px; text-align: left; padding: 6px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); background: var(--surface); color: var(--gray-800); font: inherit; font-size: 14px; cursor: pointer; transition: var(--transition); }
.up-trigger:hover { border-color: var(--primary); }
.up-trigger:focus-visible, .up.up-open .up-trigger { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(201,169,110,.25); }
.up-invalid .up-trigger { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.up-error { color: var(--danger); font-size: 12px; margin-top: 4px; }
.up-ph { color: var(--gray-400); flex: 1; }
.up-single { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-single small { color: var(--gray-500); margin-left: 4px; }
.up-chips { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; max-height: 96px; overflow-y: auto; padding: 2px 0; min-width: 0; }
.up-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--primary-light); color: var(--gray-800); font-size: 13px; line-height: 1.3; max-width: 100%; }
.up-chip b { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; line-height: 1; cursor: pointer; color: var(--gray-500); }
.up-chip b:hover { background: rgba(239,68,68,.15); color: var(--danger); }
.up-caret { flex: none; color: var(--gray-500); transition: transform .15s; }
.up-open .up-caret { transform: rotate(180deg); }
.up-backdrop { position: fixed; inset: 0; z-index: 3990; background: transparent; }
.up-panel { position: fixed; z-index: 4000; display: flex; flex-direction: column; background: var(--surface); color: var(--gray-800); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; }
.up-search { padding: 10px; border-bottom: 1px solid var(--border); }
.up-search input { width: 100%; padding: 9px 12px; border: 1px solid var(--gray-300); border-radius: 8px; background: var(--surface-2); color: var(--gray-800); font: inherit; font-size: 14px; outline: none; }
.up-search input:focus { border-color: var(--primary); }
.up-bar { display: flex; align-items: center; gap: 14px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 12px; }
.up-bar button { background: none; border: 0; padding: 2px 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--primary-dark); cursor: pointer; }
.up-bar button:hover { text-decoration: underline; }
.up-count { margin-left: auto; color: var(--gray-500); }
.up-list { list-style: none; margin: 0; padding: 4px; overflow-y: auto; flex: 1; min-height: 80px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.up-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.up-item:hover, .up-item.act { background: var(--surface-2); }
.up-item.on { background: var(--primary-light); }
.up-item input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary-dark); pointer-events: none; flex: none; }
.up-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--gray-300); flex: none; }
.up-item.on .up-radio { border-color: var(--primary-dark); background: radial-gradient(circle, var(--primary-dark) 45%, transparent 50%); }
.up-av { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand-navy-deep, #0B1A2A), var(--brand-gold, #C9A96E)); }
.up-txt { display: flex; flex-direction: column; min-width: 0; }
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-sub { font-size: 12px; color: var(--gray-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-none { color: var(--gray-500); font-style: italic; }
.up-empty { padding: 20px; text-align: center; color: var(--gray-500); font-size: 13px; }
.up-foot { display: none; padding: 10px; border-top: 1px solid var(--border); justify-content: flex-end; }
.up-multi .up-foot, .up-panel .up-foot { display: flex; }
.up-panel.sheet { left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-height: 78dvh; max-height: 78vh; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
.up-panel.sheet ~ .up-backdrop, .up-backdrop { }
@media (max-width: 640px) { .up-backdrop { background: rgba(0,0,0,.45); } .up-item { padding: 12px 10px; } .up-search input { font-size: 16px; } }

/* Dashboard date */
.dash-date { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--gray-700); }
.dash-date svg { color: var(--primary-dark); flex: none; }
.dash-date .dd-text { display: flex; flex-direction: column; line-height: 1.2; }
.dash-date .dd-date { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.dash-date .dd-day { font-size: 12px; color: var(--gray-500); }
@media (max-width: 640px) { .dash-date { align-self: stretch; } }
