* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4a90e2;
    --primary-dark: #357abd;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --light: #f8f9fa;
    --dark: #343a40;
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: var(--dark);
    overscroll-behavior: none;
}

/* LOGIN PAGE */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
    box-sizing: border-box;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-box h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 28px;
}

.subtitle {
    text-align: center;
    color: var(--secondary);
    margin-bottom: 30px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark);
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.error-message {
    color: var(--danger);
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
}

.info-text {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.info-text p {
    font-size: 12px;
    color: var(--secondary);
    margin: 5px 0;
}

/* DASHBOARD */
.dashboard {
    min-height: 100vh;
    background: var(--light);
}

.dashboard-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 16px 0 0 0;
    box-shadow: 0 4px 20px rgba(26, 115, 232, 0.35), 0 2px 8px rgba(0, 0, 0, 0.18);
    position: relative;
    z-index: 900;
    overflow: hidden;
}

/* Swoosh decoration on desktop header */
.dashboard-header::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 160px;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 80' preserveAspectRatio='none'%3E%3Cpath d='M160 0 C110 0, 90 20, 80 40 C70 60, 60 80, 0 80 L160 80 Z' fill='rgba(255,255,255,0.06)'/%3E%3Cpath d='M160 0 C120 0, 105 15, 100 35 C94 55, 85 80, 40 80 L160 80 Z' fill='rgba(255,255,255,0.05)'/%3E%3Cpath d='M160 10 C140 10, 128 25, 124 45 C119 65, 112 80, 90 80 L160 80 Z' fill='rgba(255,255,255,0.07)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    pointer-events: none;
    z-index: 0;
}

/* Keep all header children above the swoosh */
.dashboard-header > * {
    position: relative;
    z-index: 1;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px 14px;
}

.header-nav-row {
    display: flex;
    align-items: center;
    border-top: none;
    padding: 0 16px 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.header-nav-row::-webkit-scrollbar { display: none; }

/* Sticky nav bar — lives outside .dashboard-header so overflow:hidden doesn't trap it */
.desktop-sticky-nav {
    position: sticky;
    top: 0;
    z-index: 900;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 2px 10px rgba(26,115,232,0.28);
    border-top: 1px solid rgba(255,255,255,0.15);
}

.dashboard-header h1 {
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-size: 14px;
}

.btn-logout {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: white;
    color: var(--primary);
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* STATS CARDS */
.stats-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px var(--shadow);
    text-align: center;
}

.stat-number {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
}

.leaves-taken .stat-number {
    color: var(--danger);
}

.leaves-remaining .stat-number {
    color: var(--success);
}

.stat-label {
    color: var(--secondary);
    font-size: 14px;
    font-weight: 500;
}

/* MAIN CONTENT */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.form-section, .history-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px var(--shadow);
}

.form-section h2, .history-section h2 {
    color: var(--primary);
    margin-bottom: 25px;
    font-size: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.radio-label span {
    font-size: 14px;
}

.days-info {
    padding: 15px;
    background: var(--light);
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    color: var(--secondary);
}

.days-info strong {
    color: var(--primary);
    font-size: 20px;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--success) 0%, #218838 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-top: 10px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

/* HISTORY SECTION */
.history-list {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Push the scrollbar track further right, away from the card content,
       by extending the box past the card edge and compensating with padding. */
    margin-right: -14px;
    padding-right: 14px;
}

/* ── Base card ── */
.history-item {
    position: relative;
    padding: 16px 18px 16px 18px;
    background: #ffffff;
    border: 1px solid #e0e4ed;
    border-radius: 14px;
    margin-bottom: 16px;
    overflow: hidden;
    min-width: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* No colored left border on any card — all identical border */
.history-item.pending-item,
.history-item.rejected-item {
    border: 1px solid #e0e4ed;
}

/* ── Date row: icon + blue bold text ── */
.history-date-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.history-date-icon {
    font-size: 17px;
    line-height: 1;
}

.history-date {
    font-weight: 700;
    color: #4a6cf7;
    font-size: 15px;
    letter-spacing: 0.01em;
}

/* ── Badges row: status pill + days pill + pdf button all inline ── */
.history-badges-row {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: nowrap;
    margin-bottom: 14px;
}

/* ── APPROVED pill: green, wide, checkmark ── */
.badge-approved {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #28c76f;
    color: #fff;
    padding: 7px 20px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ── PENDING pill: amber/orange-yellow, hourglass ── */
.badge-pending {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ff9f43;
    color: #fff;
    padding: 7px 20px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ── REJECTED pill ── */
.badge-rejected {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ea5455;
    color: #fff;
    padding: 7px 20px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ── Working days pill: dark navy/indigo ── */
.history-days {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #3a4fd4;
    color: #ffffff;
    padding: 7px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* ── PDF button: rectangular, white bg, light gray border, gray icon+text ── */
.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    color: #555e6d;
    border: 1.5px solid #c8cfe0;
    padding: 5px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}

.btn-pdf:hover {
    background: #f4f6fb;
}

/* ── Rejection Reason button — styled like PDF but in red tones ── */
.btn-reason {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff5f5;
    color: #dc3545;
    border: 1.5px solid #f5c6cb;
    padding: 5px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}

.btn-reason:hover {
    background: #f8d7da;
}

[data-theme="dark"] .btn-reason {
    background: #2b1f22;
    color: #f5a0aa;
    border-color: #6b3040;
}

[data-theme="dark"] .btn-reason:hover {
    background: #3a2529;
}

/* ── Thin divider between badges row and reason text ── */
.history-divider {
    border: none;
    border-top: 1px solid #ebebf0;
    margin: 13px 0 11px 0;
}

/* ── Info text ── */
.history-reason {
    color: #2d3748;
    margin-bottom: 4px;
    font-size: 13.5px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.history-reason strong,
.history-informed strong {
    font-weight: 700;
    color: #1a202c;
}

.history-informed {
    font-size: 13.5px;
    color: #2d3748;
}

/* ── Download circle: bottom-right corner, pending/rejected ── */
.btn-download-circle {
    position: absolute;
    bottom: 16px;
    right: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #ffffff;
    border: 1.5px solid #c8cfe0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 17px;
    font-weight: 400;
    color: #555e6d;
    transition: background 0.15s;
    line-height: 1;
}

.btn-download-circle:hover {
    background: #f4f6fb;
}

/* PDF button visibility handled via JS inline styles */

.no-data {
    text-align: center;
    color: var(--secondary);
    padding: 40px;
    font-style: italic;
}

/* ══════════════════════════════════════════════════════
   LEAVE HISTORY — SECTION HEADER
   ══════════════════════════════════════════════════════ */

.history-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

/* Override the h2 rule so it doesn't add its own border/margin */
.history-section .history-section-header h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.lh-count-pill {
    display: inline-flex;
    align-items: center;
    background: #eef1fd;
    color: #3a4fd4;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    margin-left: auto;
}

/* ══════════════════════════════════════════════════════
   LEAVE HISTORY — STANDALONE CONTROL BAR
   Sits inside the card but styled as a distinct zone,
   bleeding edge-to-edge with a tinted background band.
   ══════════════════════════════════════════════════════ */

.lh-control-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 10px;
    margin: 16px -30px 20px -30px;
    padding: 11px 30px;
    background: #f4f6fc;
    border-top: 1px solid #e4e8f5;
    border-bottom: 1px solid #e4e8f5;
}

/* ── Filter strip (pills row) ── */
.lh-filter-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1 1 auto;
}

.lh-filter-label {
    font-size: 10.5px;
    font-weight: 700;
    color: #9aa0b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-right: 2px;
    white-space: nowrap;
}

/* ── Status pills ── */
.lh-pill {
    padding: 5px 13px;
    border-radius: 20px;
    border: 1.5px solid #d5daf0;
    background: #ffffff;
    color: #5a6280;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    line-height: 1.5;
}

.lh-pill:hover {
    background: #e8ecf9;
    border-color: #a8b2e0;
    color: #3a4fd4;
}

.lh-pill.active {
    background: #3a4fd4;
    color: #ffffff;
    border-color: #3a4fd4;
    box-shadow: 0 2px 8px rgba(58, 79, 212, 0.28);
}

.lh-pill[data-status="pending"].active  { background: #ff9f43; border-color: #ff9f43; box-shadow: 0 2px 8px rgba(255,159,67,.3); }
.lh-pill[data-status="approved"].active { background: #28c76f; border-color: #28c76f; box-shadow: 0 2px 8px rgba(40,199,111,.3); }
.lh-pill[data-status="rejected"].active { background: #ea5455; border-color: #ea5455; box-shadow: 0 2px 8px rgba(234,84,85,.3); }

/* ── Sort strip ── */
.lh-sort-strip {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    margin-left: 12px;
    padding-left: 14px;
    border-left: 1px solid #d8dcee;
}

.lh-sort-select {
    padding: 5px 28px 5px 9px;
    border: 1.5px solid #d5daf0;
    border-radius: 8px;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%239aa0b8' height='12' viewBox='0 0 24 24' width='12' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-size: 12px;
    color: #5a6280;
    font-weight: 600;
    cursor: pointer;
    min-width: 128px;
    transition: border-color 0.15s;
}

.lh-sort-select:focus {
    outline: none;
    border-color: #3a4fd4;
    box-shadow: 0 0 0 2px rgba(58,79,212,0.1);
}

/* ── Empty filter state ── */
.lh-empty-filter {
    text-align: center;
    color: var(--secondary);
    padding: 36px 20px;
    font-size: 14px;
}

.lh-empty-filter .lh-empty-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

/* ── Mobile: control bar stacks gracefully ── */
@media (max-width: 600px) {
    .lh-control-bar {
        margin-left: -20px;
        margin-right: -20px;
        padding-left: 16px;
        padding-right: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .lh-sort-strip {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        padding-top: 8px;
        border-top: 1px solid #dde1f0;
        width: 100%;
    }
    .lh-filter-strip { width: 100%; }
    .lh-pill { font-size: 11.5px; padding: 5px 11px; }
    .lh-sort-select { min-width: 0; flex: 1; }

    /* ── Cancel button: wrap to next row, same natural size as status pill ── */
    .history-badges-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    .btn-cancel-leave {
        width: auto;
        margin-top: 2px;
    }
}

@media (max-width: 480px) {
    .lh-control-bar {
        margin-left: -15px;
        margin-right: -15px;
        padding-left: 14px;
        padding-right: 14px;
    }
}


/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.modal-content h3 {
    color: var(--warning);
    margin-bottom: 15px;
    font-size: 24px;
}

.modal-content p {
    color: var(--secondary);
    margin-bottom: 25px;
    font-size: 16px;
}

.btn-modal {
    padding: 12px 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-modal:hover {
    background: var(--primary-dark);
}

/* ── MOBILE HEADER ── */
.mobile-header {
    display: none !important;
}

@media (max-width: 768px) {
    /* Hide desktop header on mobile */
    .desktop-header {
        display: none !important;
    }

    /* Show mobile header */
    .mobile-header {
        display: flex !important;
        align-items: center;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        height: 56px;
        padding: 0 14px;
        gap: 10px;
        position: sticky;
        top: 0;
        z-index: 999;
        box-shadow: 0 2px 8px rgba(0,0,0,0.18);
        overflow: hidden;
    }
    /* Swoosh on mobile header */
    .mobile-header::after {
        content: '';
        position: absolute;
        top: 0; right: 0;
        width: 160px;
        height: 100%;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 80' preserveAspectRatio='none'%3E%3Cpath d='M160 0 C110 0, 90 20, 80 40 C70 60, 60 80, 0 80 L160 80 Z' fill='rgba(255,255,255,0.06)'/%3E%3Cpath d='M160 0 C120 0, 105 15, 100 35 C94 55, 85 80, 40 80 L160 80 Z' fill='rgba(255,255,255,0.05)'/%3E%3Cpath d='M160 10 C140 10, 128 25, 124 45 C119 65, 112 80, 90 80 L160 80 Z' fill='rgba(255,255,255,0.07)'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-size: 100% 100%;
        pointer-events: none;
        z-index: 0;
    }
    .mobile-header > * {
        position: relative;
        z-index: 1;
    }

    /* Hamburger button */
    .mobile-hamburger {
        background: none;
        border: none;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        padding: 4px;
        flex-shrink: 0;
    }
    .mobile-hamburger span {
        display: block;
        width: 22px;
        height: 2px;
        background: #ffffff;
        border-radius: 2px;
    }

    /* Center: logo + title */
    .mobile-header-center {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
    }
    .mobile-header-logo {
        font-size: 20px;
        line-height: 1;
    }
    .mobile-header-title {
        color: #ffffff;
        font-size: 16px;
        font-weight: 700;
        letter-spacing: 0.01em;
        white-space: nowrap;
    }

    /* Right side: welcome text + divider + logout */
    .mobile-header-right {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
    }
    .mobile-welcome {
        color: rgba(255,255,255,0.85);
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 160px;
    }
    .mobile-welcome strong {
        color: #ffffff;
        font-weight: 700;
    }
    .mobile-header-divider {
        width: 1px;
        height: 24px;
        background: rgba(255,255,255,0.4);
        flex-shrink: 0;
    }
    .mobile-logout-btn {
        background: none;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 4px;
        flex-shrink: 0;
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-card {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .dashboard-header h1 {
        font-size: 20px;
    }
    
    .login-box {
        padding: 30px 20px;
    }
    
    .chart-modal-content {
        width: 95%;
        max-width: 95%;
        padding: 20px;
        margin: 10px;
    }
    
    .chart-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .form-section, .history-section {
        padding: 20px 15px;
    }
    
    .stat-number {
        font-size: 36px;
    }
}

/* ATTENDANCE PERCENTAGE STYLES */
.attendance-percentage {
    background: white !important;
    border: 2px solid #4a90e2 !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.attendance-percentage .stat-number {
    color: #4a90e2 !important;
}

.attendance-percentage .stat-label {
    color: #6c757d !important;
}

.attendance-percentage:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.3) !important;
    background: #f8f9ff !important;
}

/* CHART MODAL STYLES */
.chart-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.chart-modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
    z-index: 1;
}

.chart-close:hover {
    color: #dc3545;
}

.chart-modal-content h3 {
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 25px;
    text-align: center;
}

.chart-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.chart-stat {
    background: var(--light);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.chart-label {
    display: block;
    font-size: 13px;
    color: var(--secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.chart-value {
    display: block;
    font-size: 22px;
    font-weight: bold;
    color: var(--primary);
}

#attendancePieChart {
    max-width: 100%;
    height: auto !important;
    margin: 0 auto;
    display: block;
}

/* Mobile optimizations for chart */
@media (max-width: 768px) {
    .chart-modal-content {
        width: 95%;
        max-width: 95%;
        padding: 25px 20px;
        margin: 10px;
    }
    
    .chart-modal-content h3 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .chart-info {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 25px;
    }
    
    .chart-stat {
        padding: 12px;
    }
    
    .chart-label {
        font-size: 12px;
    }
    
    .chart-value {
        font-size: 20px;
    }
    
    .chart-close {
        right: 15px;
        top: 15px;
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .chart-modal-content {
        padding: 20px 15px;
    }
    
    .chart-modal-content h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .chart-info {
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .chart-stat {
        padding: 10px;
    }
    
    .chart-label {
        font-size: 11px;
        margin-bottom: 5px;
    }
    
    .chart-value {
        font-size: 18px;
    }
}
/* ══════════════════════════════════════════
   MOBILE DRAWER MENU
══════════════════════════════════════════ */
.mobile-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1100;
    backdrop-filter: blur(3px);
}
.mobile-drawer-overlay.open { display: block; }

body.drawer-open { overflow: hidden; }
/* Bug fix: hide student bottom nav when drawer is open */
@media (max-width: 768px) {
    body.drawer-open .student-mobile-bottom-nav {
        display: none !important;
    }
}

/* Hide bottom nav ONLY for specific excluded modals on mobile */
@media (max-width: 768px) {
    body.bnav-hide .student-mobile-bottom-nav {
        display: none !important;
    }
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: -340px;
    width: 330px;
    height: 100%;
    background: #fff;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    box-shadow: 8px 0 32px rgba(0,0,0,0.15);
    transition: left 0.3s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}
.mobile-drawer.open { left: 0; }

/* Drawer header */
.drawer-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 20px 16px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Swoosh on drawer header */
.drawer-header::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 160px;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 80' preserveAspectRatio='none'%3E%3Cpath d='M160 0 C110 0, 90 20, 80 40 C70 60, 60 80, 0 80 L160 80 Z' fill='rgba(255,255,255,0.06)'/%3E%3Cpath d='M160 0 C120 0, 105 15, 100 35 C94 55, 85 80, 40 80 L160 80 Z' fill='rgba(255,255,255,0.05)'/%3E%3Cpath d='M160 10 C140 10, 128 25, 124 45 C119 65, 112 80, 90 80 L160 80 Z' fill='rgba(255,255,255,0.07)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    pointer-events: none;
    z-index: 0;
}
.drawer-header > * {
    position: relative;
    z-index: 1;
}
.drawer-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.drawer-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    border: 2px solid rgba(255,255,255,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.drawer-user-text {
    min-width: 0;
    flex: 1;
}
.drawer-username {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.drawer-dept {
    color: rgba(255,255,255,0.78);
    font-size: 12px;
    margin-top: 3px;
    white-space: normal;
    line-height: 1.35;
    word-break: break-word;
}
.drawer-close {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.8);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
    transition: background 0.18s;
    align-self: flex-start;
}
.drawer-close:hover { background: rgba(255,255,255,0.15); }

/* Nav card - white rounded card overlapping the header */
.drawer-nav-card {
    background: #fff;
    border-radius: 18px 18px 0 0;
    margin-top: -18px;
    margin-right: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
    border-right: 4px solid var(--primary);
}

/* Nav items */
.drawer-nav {
    list-style: none;
    padding: 6px 0 0;
    flex: 1;
    overflow-y: auto;
    margin: 0;
}
.drawer-nav-divider {
    display: none;
}
.drawer-nav li {
    border-bottom: 1px solid #f0f2f5;
}
.drawer-nav li:last-child {
    border-bottom: none;
}
.drawer-nav li a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 15px 20px;
    color: #1f2937;
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    border-left: none;
    transition: background 0.15s;
}
.drawer-nav li a:hover,
.drawer-nav li a:active {
    background: #fef2f2;
    border-left-color: transparent;
    color: #1f2937;
}
.drawer-nav li a:hover .drawer-nav-icon,
.drawer-nav li a:active .drawer-nav-icon { color: #6b7280; }

.drawer-nav-icon {
    width: 24px;
    height: 24px;
    color: #6b7280;
    flex-shrink: 0;
    transition: color 0.15s;
}
.drawer-nav-label { flex: 1; }

/* Fix: drawer announcement badge must be a circle, not a wide pill */
@media (max-width: 768px) {
    #drawerNotifBadge.badge-visible {
        position: static !important;
        display: inline-flex !important;
        width: 20px !important;
        height: 20px !important;
        min-width: 20px !important;
        max-width: 20px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        font-size: 11px !important;
        line-height: 1 !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }
    /* Ensure hidden state always wins on mobile */
    #drawerNotifBadge:not(.badge-visible) {
        display: none !important;
    }
}

.drawer-footer {
    padding: 14px 16px 20px;
    border-top: 1px solid #f0f2f5;
    flex-shrink: 0;
}
.drawer-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 13px 16px;
    background: #fff5f5;
    color: #dc2626;
    border: 1.5px solid #fecdd3;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
}
.drawer-logout-btn:hover { background: #fee2e2; border-color: #fca5a5; }

/* ══════════════════════════════════════════
   YOUR DETAILS MODAL  (bottom sheet)
══════════════════════════════════════════ */
.your-details-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.52);
    z-index: 1300;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.your-details-modal.open { display: flex; }

.your-details-content {
    background: #f8fafc;
    width: 100%;
    max-width: 480px;
    border-radius: 20px 20px 0 0;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    animation: detailsSlideUp 0.3s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}
@keyframes detailsSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* Handle bar */
.your-details-content::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

.your-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px 14px;
    flex-shrink: 0;
}
.your-details-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.01em;
}
.your-details-close {
    background: #e2e8f0;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.your-details-close:hover { background: #cbd5e1; }

.your-details-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 14px 24px;
    flex: 1;
}

/* Loading state */
.details-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 0;
    color: #94a3b8;
    font-size: 14px;
}
/* Splash-style wave bars for Your Details loading */
.details-splash-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 54px;
}
.details-splash-bar {
    width: 10px;
    border-radius: 6px;
    background: #90CAF9;
    animation: detailsWave 1s ease-in-out infinite;
    transform-origin: bottom center;
}
.details-splash-bar:nth-child(1) { height: 28px; animation-delay: 0s; }
.details-splash-bar:nth-child(2) { height: 50px; animation-delay: 0.18s; background: #64B5F6; }
.details-splash-bar:nth-child(3) { height: 26px; animation-delay: 0.36s; }
@keyframes detailsWave {
    0%   { transform: scaleY(1);    opacity: 0.7; }
    50%  { transform: scaleY(1.45); opacity: 1;   }
    100% { transform: scaleY(1);    opacity: 0.7; }
}

/* Profile banner inside modal */
.details-profile-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 18px;
}
.details-avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    border: 2px solid rgba(255,255,255,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.details-profile-info { min-width: 0; }
.details-profile-name {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.details-profile-id {
    color: rgba(255,255,255,0.78);
    font-size: 12px;
    margin-top: 2px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
}

/* Section title */
.details-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 4px 8px;
}

/* Info card */
.details-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e9eef5;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-bottom: 1px solid #f1f5f9;
}
.detail-row.no-border { border-bottom: none; }
.detail-label-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.detail-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}
.detail-value {
    font-size: 13.5px;
    color: #1e293b;
    font-weight: 600;
    text-align: right;
}
.detail-mono { font-family: 'Courier New', monospace; letter-spacing: 0.04em; }
.detail-break { 
    word-break: break-all; 
}
.detail-email {
    font-size: 12.5px;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-all;
    display: block;
    max-width: 100%;
    text-align: right;
}
/* Email row — stacks vertically: label top-left, email right-aligned below */
.detail-row-email {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.detail-row-email .detail-value {
    text-align: right;
    width: 100%;
    word-break: break-all;
    white-space: normal;
    font-size: 13px;
}
.detail-na { color: #cbd5e1; font-style: italic; font-weight: 400; }

.details-note {
    font-size: 11.5px;
    color: #94a3b8;
    text-align: center;
    margin-top: 4px;
    padding: 0 8px;
}

/* =============================================
   ACADEMIC CALENDAR MODAL
   ============================================= */
.ac-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0,0,0,0.55);
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: acFadeIn .2s ease;
}
.ac-modal.open { display: flex; }

@keyframes acFadeIn { from { opacity:0; } to { opacity:1; } }

.ac-modal-content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    position: relative;
    animation: acSlideUp .25s cubic-bezier(.4,0,.2,1);
}
.ac-modal-scroll-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;   /* required for flex children to scroll correctly */
    overscroll-behavior: contain;
}
@keyframes acSlideUp { from { transform:translateY(30px); opacity:0; } to { transform:none; opacity:1; } }

/* Header */
.ac-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    padding: 16px 20px;
    border-radius: 16px 16px 0 0;
    color: #fff;
}
.ac-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ac-modal-title-wrap h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .3px;
}
.ac-modal-close {
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.ac-modal-close:hover { background: rgba(255,255,255,0.32); }

/* Month navigator */
.ac-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 6px;
}
.ac-nav-btn {
    background: #f0f4ff;
    border: none;
    color: #4a90e2;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}
.ac-nav-btn:hover { background: #4a90e2; color: #fff; }
.ac-month-label {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a5f;
    letter-spacing: .2px;
}

/* Summary bar */
.ac-summary {
    display: flex;
    gap: 12px;
    padding: 10px 20px 4px;
}
.ac-summary-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    border-radius: 10px;
    gap: 2px;
}
.ac-summary-item.ac-working { background: #e8f5e9; }
.ac-summary-item.ac-holiday { background: #fdecea; }
.ac-summary-num {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
}
.ac-summary-item.ac-working .ac-summary-num { color: #2e7d32; }
.ac-summary-item.ac-holiday .ac-summary-num { color: #c62828; }
.ac-summary-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #555;
}

/* Legend */
.ac-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px 2px;
    font-size: 12px;
    color: #555;
    flex-wrap: wrap;
}
.ac-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.ac-legend-dot.ac-wd    { background: #4caf50; }
.ac-legend-dot.ac-exam  { background: #ffa726; }
.ac-legend-dot.ac-hol   { background: #e53935; }
.ac-legend-dot.ac-today { background: #4a90e2; border: 2px solid #1565c0; }

/* Calendar body */
.ac-body {
    padding: 10px 16px 16px;
    position: relative;
    min-height: 220px;
}

.ac-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    font-size: 12px;
    color: #64B5F6;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.ac-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 46px;
}
.ac-spinner span {
    display: inline-block;
    width: 8px;
    border-radius: 6px;
    background: #90CAF9;
    animation: acWave 1s ease-in-out infinite;
    transform-origin: bottom center;
}
.ac-spinner span:nth-child(1) { height: 24px; animation-delay: 0s; }
.ac-spinner span:nth-child(2) { height: 42px; animation-delay: 0.18s; background: #64B5F6; }
.ac-spinner span:nth-child(3) { height: 22px; animation-delay: 0.36s; }
@keyframes acWave {
    0%,100% { transform: scaleY(1);    opacity: 0.65; }
    50%     { transform: scaleY(1.5);  opacity: 1;    }
}
@keyframes achWave {
    0%,100% { transform: scaleY(1);    opacity: 0.65; }
    50%     { transform: scaleY(1.55); opacity: 1;    }
}

/* Grid */
.ac-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.ac-cell {
    border-radius: 8px;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    position: relative;
    cursor: default;
}
.ac-cell.ac-hdr {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    cursor: default;
    aspect-ratio: auto;
    padding: 4px 0;
}
.ac-cell.ac-empty  { background: transparent; }
.ac-cell.ac-day    { background: #f8f9fa; cursor: pointer; transition: background .15s, transform .1s; }
.ac-cell.ac-day:hover { background: #e3eeff; transform: scale(1.08); z-index: 1; }

.ac-cell.ac-cell-working { background: #e8f5e9; }
.ac-cell.ac-cell-holiday { background: #fdecea; }
.ac-cell.ac-cell-exam    { background: #fff8e1; }
.ac-cell.ac-cell-today   { background: #e3eeff; outline: 2px solid #4a90e2; outline-offset: -2px; }

.ac-day-num {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}
.ac-cell.ac-cell-holiday .ac-day-num { color: #c62828; }
.ac-cell.ac-cell-working .ac-day-num { color: #2e7d32; }
.ac-cell.ac-cell-exam    .ac-day-num { color: #f57f17; }
.ac-cell.ac-cell-today   .ac-day-num { color: #1565c0; }

.ac-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    margin-top: 2px;
}
.ac-dot.ac-wd  { background: #4caf50; }
.ac-dot.ac-hol { background: #e53935; }
.ac-dot.ac-exam { background: #ffa726; }

/* Day detail pop-up inside modal */
.ac-day-detail {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 2px solid #e3eeff;
    padding: 0;
    border-radius: 0 0 12px 12px;
}
.ac-day-detail-inner {
    padding: 14px 20px 16px;
    position: relative;
}
.ac-day-detail-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: #f0f4ff;
    border: none;
    color: #4a90e2;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ac-day-detail-close:hover { background: #4a90e2; color: #fff; }
.ac-day-detail-date {
    font-size: 14px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 8px;
    padding-right: 30px;
}
.ac-day-detail-status { margin-bottom: 6px; }
.ac-detail-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}
.ac-badge-working { background: #e8f5e9; color: #2e7d32; }
.ac-badge-exam    { background: #fff8e1; color: #f57f17; }
.ac-badge-holiday { background: #fdecea; color: #c62828; }
.ac-day-detail-reason,
.ac-day-detail-sem {
    font-size: 13px;
    color: #555;
    margin-top: 4px;
}

@media (max-width: 480px) {
    .ac-modal-content {
        border-radius: 12px;
        overflow: hidden;          /* clips blue header to rounded corners on mobile */
    }
    .ac-modal-header {
        border-radius: 12px 12px 0 0; /* match the content radius */
    }
    .ac-modal {
        padding: 12px;             /* tighter padding on small screens */
        align-items: center;       /* modal centered vertically on screen */
        padding-top: 12px;
    }
    .ac-day-num { font-size: 11px; }
    .ac-cell.ac-day { border-radius: 6px; }
    .ac-grid { gap: 3px; }
}

/* =============================================
   DESKTOP NAV MENU IN HEADER
   ============================================= */
.desktop-nav {
    display: flex;
    gap: 2px;
    padding: 6px 0;
    flex-wrap: nowrap;
}
.desktop-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 7px;
    color: rgba(255,255,255,0.88);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s, color 0.18s;
    border: none;
    background: none;
    position: relative;
}
.desktop-nav-link:hover {
    background: rgba(255,255,255,0.18);
    color: #ffffff;
}
.desktop-nav-link svg {
    flex-shrink: 0;
    opacity: 0.82;
}

/* Hide desktop nav on mobile/tablet */
@media (max-width: 900px) {
    .desktop-nav { display: none; }
    .header-nav-row { display: none; }
    .desktop-sticky-nav { display: none !important; }
}

/* Tighten header content layout to fit nav */
@media (min-width: 901px) {
    .user-info {
        flex-shrink: 0;
    }
}

/* =============================================
   EMAIL LEFT-ALIGN FIX (Student Details Modal)
   ============================================= */
/* The email value should align from the very left edge
   matching the label's starting position (icon left edge) */
.detail-email-full {
    display: block;
    width: 100%;
    text-align: right;
    padding-left: 0;
    word-break: break-all;
    white-space: normal;
    font-size: 13px;
    color: #1e293b;
    font-weight: 600;
}

/* =============================================
   LEAVE CANCELLATION STYLES
   ============================================= */
/* Cancel button hover (inline style handles base, CSS handles hover) */
button[onclick*="cancelLeave"]:hover {
    background: #ffd5d5 !important;
    border-color: #e74c3c !important;
    color: #a93226 !important;
}
button[onclick*="cancelLeave"]:disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
}

/* ── Cancel leave button (class-based, theme-aware) ── */
.btn-cancel-leave {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff0f0;
    color: #c0392b;
    border: 1.5px solid #f5c6c6;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
    transition: background .15s, border-color .15s;
}
.btn-cancel-leave:hover {
    background: #ffd5d5;
    border-color: #e74c3c;
    color: #a93226;
}
.btn-cancel-leave:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Dark mode cancel button */
[data-theme="dark"] .btn-cancel-leave {
    background: rgba(192,57,43,0.12) !important;
    color: #f87171 !important;
    border-color: rgba(248,113,113,0.3) !important;
}
[data-theme="dark"] .btn-cancel-leave:hover {
    background: rgba(192,57,43,0.22) !important;
    border-color: rgba(248,113,113,0.5) !important;
}

/* ── PDF button responsive visibility ── */
.btn-pdf--hidden { display: none !important; }
.btn-pdf--mobile {
    position: absolute;
    bottom: 14px;
    right: 16px;
}

/* Cancelled history card — muted appearance */
.leave-card-cancelled {
    opacity: 0.72;
    border-color: #ced4da !important;
    background: #f8f9fa !important;
}

/* =============================================
   LEAVE ANALYTICS – modal styles below
   ============================================= */

/* =============================================
   LEAVE ANALYTICS MODAL
   ============================================= */
.analytics-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 16px;
    overflow-y: auto;
}

.analytics-modal {
    background: #fff;
    border-radius: 18px;
    width: 100%;
    max-width: 860px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    padding: 28px 28px 24px;
    position: relative;
    animation: analyticsSlideIn 0.28s cubic-bezier(.22,.68,0,1.2);
}

@keyframes analyticsSlideIn {
    from { opacity: 0; transform: translateY(-24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.analytics-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.analytics-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.analytics-subtitle {
    font-size: 13px;
    color: var(--secondary);
    margin: 4px 0 0;
}

.analytics-close-btn {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: var(--secondary);
    cursor: pointer;
    padding: 0 4px;
    transition: color .15s;
}
.analytics-close-btn:hover { color: var(--danger); }

/* KPI Row */
.analytics-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.analytics-kpi {
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
}

.analytics-kpi-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
}

.analytics-kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    opacity: 0.75;
}

.analytics-kpi--taken    { background: #fff1f0; color: #c0392b; }
.analytics-kpi--remaining { background: #f0fff4; color: #1a7a3e; }
.analytics-kpi--avg      { background: #eef4ff; color: #3553b0; }
.analytics-kpi--projected { background: #fffbeb; color: #b45309; }

/* Charts Grid */
.analytics-chart-card {
    background: #f9fafb;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    padding: 16px;
}

.analytics-chart-card--flat {
    background: #f9fafb;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    padding: 16px;
}

.analytics-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 6px;
}

.analytics-chart-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.analytics-chart-badge {
    font-size: 11px;
    font-weight: 600;
    background: #fee2e2;
    color: #b91c1c;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.analytics-chart-badge--info {
    background: #dbeafe;
    color: #1e40af;
}

.analytics-chart-badge--warn {
    background: #fef3c7;
    color: #92400e;
}

.analytics-chart-badge--ok {
    background: #dcfce7;
    color: #166534;
}

.analytics-chart-wrap {
    position: relative;
    height: 220px;
}

.analytics-note {
    font-size: 12px;
    color: var(--secondary);
    margin: 10px 0 0;
    line-height: 1.5;
    text-align: center;
}

/* ── Tabs ── */
.analytics-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    border-bottom: 2px solid #e8ecf0;
    padding-bottom: 0;
}

.analytics-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: color .15s, border-color .15s, background .15s;
    white-space: nowrap;
}

.analytics-tab:hover {
    color: var(--primary);
    background: rgba(74,144,226,0.06);
}

.analytics-tab--active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(74,144,226,0.07);
}

.analytics-tab-panel {
    animation: tabFadeIn .18s ease;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Mobile */
@media (max-width: 600px) {
    .analytics-modal { padding: 16px 14px 16px; }
    .analytics-kpi-row { grid-template-columns: 1fr 1fr; }
    .analytics-kpi-value { font-size: 22px; }
    .analytics-tab { font-size: 12px; padding: 7px 10px; gap: 4px; }
    .analytics-chart-wrap { height: 200px; }
}

/* ── Medical Document Upload ── */
.doc-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fafbfc;
    user-select: none;
}
.doc-upload-area:hover {
    border-color: #4a90e2;
    background: #f0f7ff;
}
.doc-upload-area svg {
    display: block;
    margin: 0 auto;
    transition: stroke 0.2s;
}
.doc-upload-area:hover svg {
    stroke: #4a90e2;
}
#docPreview {
    display: none;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f0f7ff;
    border: 1px solid #bee3f8;
    border-radius: 8px;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   SETTINGS MODAL
   ============================================================ */

/* ---- Settings modal animations ---- */
@keyframes settingsSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
@keyframes settingsFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

/* ---- Mobile: bottom sheet ---- */
.settings-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.52);
    z-index: 1400;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.settings-modal.open { display: flex; }

.settings-content {
    background: var(--settings-bg, #f8fafc);
    width: 100%;
    max-width: 480px;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    animation: settingsSlideUp 0.3s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}

/* ---- Desktop: centered dialog, scrollable body ---- */
@media (min-width: 769px) {
    .settings-modal {
        align-items: center;
        justify-content: center;
    }
    .settings-content {
        border-radius: 20px;
        height: 88vh;
        max-height: 88vh;
        width: 480px;
        max-width: 480px;
        animation: settingsFadeIn 0.2s ease;
        overflow: visible;
        box-shadow: 0 25px 60px rgba(0,0,0,0.35);
    }
    .settings-handle-bar {
        display: none;
    }
    .settings-body {
        border-radius: 0 0 20px 20px;
        overflow-y: scroll;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
}

.settings-handle-bar {
    width: 36px;
    height: 4px;
    background: var(--settings-handle, #cbd5e1);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px 10px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--settings-border, #e2e8f0);
}
.settings-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--settings-text, #1e293b);
}
.settings-header-left svg { stroke: var(--primary); }
.settings-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--settings-text, #1e293b);
    margin: 0;
}
.settings-close {
    background: var(--settings-close-bg, #e2e8f0);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    color: var(--settings-close-color, #64748b);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.settings-close:hover { background: var(--settings-close-hover, #cbd5e1); }

.settings-body {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 14px 14px 28px;
    flex: 1;
    min-height: 0;
}

.settings-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--settings-section-label, #94a3b8);
    padding: 14px 4px 6px;
}

.settings-card {
    background: var(--settings-card-bg, #ffffff);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--settings-border, #e8edf3);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.settings-row-spread {
    justify-content: space-between;
    margin-bottom: 0;
}

.settings-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.settings-icon-photo  { background: #e0f2fe; color: #0284c7; }
.settings-icon-photo svg { stroke: #0284c7; }
.settings-icon-password { background: #fef3c7; color: #d97706; }
.settings-icon-password svg { stroke: #d97706; }
.settings-icon-theme  { background: #f0fdf4; color: #16a34a; }
.settings-icon-theme svg { stroke: #16a34a; }

.settings-card-info { flex: 1; min-width: 0; }
.settings-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--settings-text, #1e293b);
    margin-bottom: 2px;
}
.settings-card-desc {
    font-size: 12px;
    color: var(--settings-muted, #64748b);
}

/* ---- Profile Photo ---- */
.settings-photo-area {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 0 10px;
}
.settings-photo-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--settings-photo-bg, #f1f5f9);
    border: 2px solid var(--settings-border, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.settings-pdf-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 9px;
    font-weight: 700;
    color: #e74c3c;
}
.settings-photo-actions {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.settings-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}
.settings-upload-btn:hover { background: var(--primary-dark); }
.settings-remove-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: none;
    color: #e74c3c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.settings-remove-btn:hover { background: #fff5f5; }
.settings-photo-hint {
    font-size: 11px;
    color: var(--settings-muted, #94a3b8);
    margin-top: 4px;
}

/* ---- Form Groups (Password) ---- */
.settings-form-group {
    margin-bottom: 12px;
}
.settings-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--settings-text, #374151);
    margin-bottom: 5px;
}
.settings-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.settings-input {
    width: 100%;
    padding: 9px 38px 9px 12px;
    border: 1.5px solid var(--settings-border, #d1d5db);
    border-radius: 9px;
    font-size: 14px;
    background: var(--settings-input-bg, #fff);
    color: var(--settings-text, #1e293b);
    outline: none;
    transition: border-color 0.2s;
}
.settings-input:focus { border-color: var(--primary); }
.settings-eye-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    padding: 4px;
}
.settings-eye-btn:hover { color: var(--primary); }

/* Password strength */
.settings-strength-bar {
    height: 4px;
    background: var(--settings-border, #e2e8f0);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}
.settings-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.35s, background 0.35s;
}
.settings-strength-label {
    font-size: 11px;
    font-weight: 600;
    margin-top: 3px;
    min-height: 16px;
}

/* ---- Save Row ---- */
.settings-save-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}
.settings-save-btn {
    padding: 9px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}
.settings-save-btn:hover:not(:disabled) { background: var(--primary-dark); }
.settings-save-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.settings-save-status {
    font-size: 12px;
    font-weight: 500;
    min-height: 18px;
}
.settings-status-success { color: #16a34a; }
.settings-status-error   { color: #dc2626; }
.settings-status-pending { color: #6b7280; }

/* ---- Dark Mode Toggle Switch ---- */
.settings-toggle-switch {
    position: relative;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}
.settings-toggle-switch input { opacity: 0; width: 0; height: 0; }
.settings-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 26px;
    cursor: pointer;
    transition: background 0.25s;
}
.settings-toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.settings-toggle-switch input:checked + .settings-toggle-slider { background: var(--primary); }
.settings-toggle-switch input:checked + .settings-toggle-slider::before { transform: translateX(20px); }

/* ---- Header profile avatar ---- */
.header-profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}
.header-profile-avatar:empty { display: none; }

/* ============================================================
   DARK MODE  —  Premium Charcoal + Indigo Accent Theme
   Deep slate base · Soft indigo highlights · High contrast text
   ============================================================ */

:root {
    /* ── EXACT INSTAGRAM DARK THEME COLORS ──
       Sampled pixel-by-pixel from the reference screenshot
    */
    --dm-bg:       #0c0f14;   /* TRUE background — Instagram exact #0c0f14 */
    --dm-surface:  #1a1d24;   /* Cards/panels — slightly lifted from bg */
    --dm-surface2: #222630;   /* Inputs, hover — second level */
    --dm-surface3: #2b2f38;   /* Grid cells exact — Instagram #2b2f38 */

    /* Borders */
    --dm-border:   #2b3036;   /* Grid/tab color exact — Instagram #2b3036 */
    --dm-border2:  #3a3f4a;   /* Hover border */

    /* Typography — pure white text like Instagram */
    --dm-text:     #f5f5f5;   /* Primary — near white */
    --dm-muted:    #a8aab8;   /* Secondary labels */
    --dm-subtle:   #4e5268;   /* Placeholder */

    /* Accent */
    --dm-accent:   #6c7ee1;
    --dm-accent2:  #4f5ec4;

    /* Aliases */
    --dm-card:     #1a1d24;
    --dm-input:    #222630;
}

/* Prevent white flash: apply dark bg to html root immediately */
[data-theme="dark"],
[data-theme="dark"] body {
    background: var(--dm-bg);
    color: var(--dm-text);
}

/* Suppress transitions on first paint to avoid flash */
[data-theme="dark"].no-transition,
[data-theme="dark"].no-transition * {
    transition: none !important;
}

/* ── Cards & Surfaces ── */
[data-theme="dark"] .stats-card,
[data-theme="dark"] .leave-form-section,
[data-theme="dark"] .leave-history-section,
[data-theme="dark"] .form-card,
[data-theme="dark"] .history-card,
[data-theme="dark"] .leave-card,
[data-theme="dark"] .card {
    background: var(--dm-card);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

/* ── Modals & Overlays ── */
[data-theme="dark"] .your-details-content,
[data-theme="dark"] .ac-modal-content,
[data-theme="dark"] .analytics-modal {
    background: var(--dm-surface);
    color: var(--dm-text);
    border-color: var(--dm-border);
}

/* ── Settings modal variables — exact Instagram ── */
[data-theme="dark"] {
    --settings-bg:            #1a1d24;
    --settings-card-bg:       #222630;
    --settings-border:        #2b3036;
    --settings-text:          #f5f5f5;
    --settings-muted:         #a8aab8;
    --settings-section-label: #4e5268;
    --settings-close-bg:      #222630;
    --settings-close-color:   #a8aab8;
    --settings-close-hover:   #2b2f38;
    --settings-handle:        #3a3f4a;
    --settings-input-bg:      #222630;
    --settings-photo-bg:      #222630;
}

/* ── Inputs ── */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .settings-input {
    background: var(--dm-input);
    border-color: var(--dm-border);
    color: var(--dm-text);
}
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: var(--dm-accent);
    box-shadow: 0 0 0 3px rgba(108,126,225,0.15);
    background: var(--dm-surface3);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--dm-subtle); }

/* ── Header — exact Instagram #0c0f14 background ── */
[data-theme="dark"] .dashboard-header {
    background: #0c0f14;
    border-bottom: 1px solid #2b3036;
    box-shadow: none;
}
[data-theme="dark"] .dashboard-header h1 { color: #f5f5f5; }
[data-theme="dark"] .dashboard-header p  { color: #a8aab8 !important; }
[data-theme="dark"] .header-nav-row { border-top-color: #2b3036; }
[data-theme="dark"] .user-info span { color: #a8aab8; }
[data-theme="dark"] .user-info strong,
[data-theme="dark"] #welcomeUser { color: #f5f5f5; }
[data-theme="dark"] .btn-logout {
    background: #1a1d24;
    border: 1px solid #3a3f4a;
    color: #f5f5f5;
    font-weight: 600;
}
[data-theme="dark"] .btn-logout:hover {
    background: #2b2f38;
    border-color: #5a5f6e;
    color: #fff;
}
[data-theme="dark"] .desktop-nav-link {
    color: #a8aab8;
    background: #1a1d24;
    border-color: #2b3036;
}
[data-theme="dark"] .desktop-nav-link:hover {
    background: #2b2f38;
    color: #f5f5f5;
    border-color: #3a3f4a;
}

/* ── Mobile drawer ── */
[data-theme="dark"] .mobile-drawer {
    background: var(--dm-surface);
    border-right: 1px solid var(--dm-border);
}
[data-theme="dark"] .drawer-nav li a {
    color: var(--dm-muted);
}
[data-theme="dark"] .drawer-nav li a:hover {
    background: var(--dm-surface2);
    color: var(--dm-text);
}
[data-theme="dark"] .drawer-footer {
    border-top-color: var(--dm-border);
}

/* ── Text hierarchy ── */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 { color: var(--dm-text); }

[data-theme="dark"] p,
[data-theme="dark"] label { color: var(--dm-muted); }

[data-theme="dark"] .detail-label,
[data-theme="dark"] .section-title,
[data-theme="dark"] .card-title { color: var(--dm-text); }

[data-theme="dark"] .detail-value { color: var(--dm-muted); }

/* ── Dividers ── */
[data-theme="dark"] hr,
[data-theme="dark"] .detail-row { border-color: var(--dm-border); }

/* ── Tables ── */
[data-theme="dark"] table,
[data-theme="dark"] th,
[data-theme="dark"] td {
    border-color: var(--dm-border);
    color: var(--dm-text);
}
[data-theme="dark"] th {
    background: var(--dm-surface2);
    color: var(--dm-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
[data-theme="dark"] tr:nth-child(even) { background: rgba(255,255,255,0.02); }

/* ── Stat items — exact Instagram card surface ── */
[data-theme="dark"] .stat-item {
    background: #1a1d24 !important;
    border: 1px solid #2b3036 !important;
    box-shadow: none !important;
}
[data-theme="dark"] .stat-label { color: #a8aab8; }
[data-theme="dark"] .leaves-taken .stat-number     { color: #7c8ff5; }
[data-theme="dark"] .leaves-remaining .stat-number  { color: #f87171; }
[data-theme="dark"] .attendance-percentage .stat-number { color: #7c8ff5; }

/* ── Form section & history section — same card surface ── */
[data-theme="dark"] .form-section,
[data-theme="dark"] .history-section {
    background: #1a1d24;
    border: 1px solid #2b3036;
    box-shadow: none;
}
[data-theme="dark"] .form-section h2,
[data-theme="dark"] .history-section h2 {
    color: #7c8ff5;
    border-bottom-color: #2b3036;
}

/* ── Form inputs ── */
[data-theme="dark"] .form-group label { color: #a8aab8; }
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: #222630;
    border-color: #2b3036;
    color: #f5f5f5;
}
[data-theme="dark"] .form-hint,
[data-theme="dark"] .form-note,
[data-theme="dark"] small { color: #4e5268; }

/* ── Submit button — green like Instagram action buttons ── */
[data-theme="dark"] .submit-btn,
[data-theme="dark"] .apply-btn,
[data-theme="dark"] button[class*="submit"] {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 3px 12px rgba(5,150,105,0.35);
    border: none;
    color: #fff;
}

/* ── Sort dropdown — exact Instagram surface ── */
[data-theme="dark"] .lh-sort-select {
    background-color: #222630 !important;
    color: #f5f5f5 !important;
    border-color: #2b3036 !important;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23a8aab8' height='14' viewBox='0 0 24 24' width='14' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>") !important;
}
[data-theme="dark"] .lh-sort-select option {
    background: #222630;
    color: #f5f5f5;
}

/* ── Page containers ── */
[data-theme="dark"] .dashboard-container,
[data-theme="dark"] .main-content,
[data-theme="dark"] main,
[data-theme="dark"] .page-content { background: #0c0f14; }

/* ── Profile avatar ── */
[data-theme="dark"] .header-profile-avatar,
[data-theme="dark"] .desktop-profile-avatar {
    border-color: #2b3036;
    background: #222630;
}

/* ── Your Details modal ── */
[data-theme="dark"] .your-details-content { background: var(--dm-surface); }
[data-theme="dark"] .your-details-header h3 { color: var(--dm-text); }
[data-theme="dark"] .details-card {
    background: var(--dm-surface2);
    border-color: var(--dm-border);
}
[data-theme="dark"] .details-section-title { color: var(--dm-subtle); }

/* ── Calendar modal ── */
[data-theme="dark"] .ac-modal-content { background: var(--dm-surface); }
[data-theme="dark"] .ac-day {
    background: var(--dm-surface2);
    color: var(--dm-text);
    border-color: transparent;
}
[data-theme="dark"] .ac-day:hover { background: var(--dm-surface3); }
[data-theme="dark"] .ac-weekday { color: var(--dm-subtle); }
[data-theme="dark"] .ac-summary {
    background: var(--dm-surface2);
    border-color: var(--dm-border);
}
[data-theme="dark"] .ac-day-detail {
    background: var(--dm-surface);
    border-color: var(--dm-border);
}

/* ── Leave status badges — vivid on dark ── */
[data-theme="dark"] .status-pending {
    background: rgba(251,191,36,0.12);
    color: #fbbf24;
    border: 1px solid rgba(251,191,36,0.2);
}
[data-theme="dark"] .status-approved {
    background: rgba(52,211,153,0.12);
    color: #34d399;
    border: 1px solid rgba(52,211,153,0.2);
}
[data-theme="dark"] .status-rejected {
    background: rgba(248,113,113,0.12);
    color: #f87171;
    border: 1px solid rgba(248,113,113,0.2);
}

/* ── Leave form & history sections ── */
[data-theme="dark"] .leave-form-section,
[data-theme="dark"] .leave-history-section {
    background: var(--dm-card);
    border-color: var(--dm-border);
}

/* ── Filter pills — exact Instagram button look ── */
[data-theme="dark"] .lh-pill {
    background: #1a1d24;
    border-color: #2b3036;
    color: #a8aab8;
}
[data-theme="dark"] .lh-pill:hover {
    background: #2b2f38;
    border-color: #3a3f4a;
    color: #f5f5f5;
}
[data-theme="dark"] .lh-pill.active {
    background: var(--dm-accent);
    border-color: var(--dm-accent);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(108,126,225,0.3);
}
[data-theme="dark"] .lh-pill[data-status="pending"].active {
    background: #b45309; border-color: #b45309; color: #fff;
}
[data-theme="dark"] .lh-pill[data-status="approved"].active {
    background: #059669; border-color: #059669; color: #fff;
}
[data-theme="dark"] .lh-pill[data-status="rejected"].active {
    background: #dc2626; border-color: #dc2626; color: #fff;
}
[data-theme="dark"] .lh-filter-label { color: #4e5268; }

/* ── Sort select ── */
[data-theme="dark"] .lh-sort-select {
    background-color: var(--dm-surface2);
    border-color: var(--dm-border);
    color: var(--dm-text);
    background-image: url("data:image/svg+xml;utf8,<svg fill='%238b90a8' height='14' viewBox='0 0 24 24' width='14' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
}
[data-theme="dark"] .lh-sort-select:focus {
    border-color: var(--dm-accent);
    box-shadow: 0 0 0 2px rgba(108,126,225,0.15);
}
[data-theme="dark"] .lh-sort-strip { border-left-color: var(--dm-border); }

/* ── Leave history item cards — exact Instagram surface ── */
[data-theme="dark"] .history-item {
    background: #1a1d24 !important;
    border: 1px solid #2b3036 !important;
    box-shadow: none !important;
}
[data-theme="dark"] .history-item:hover {
    background: #222630 !important;
    border-color: #3a3f4a !important;
}

/* Date text */
[data-theme="dark"] .history-date { color: #7c8ff5; }

/* Status badges */
[data-theme="dark"] .badge-approved { background: #059669; }
[data-theme="dark"] .badge-pending  { background: #b45309; }
[data-theme="dark"] .badge-rejected { background: #dc2626; }

/* Working days pill — exact Instagram grid cell color */
[data-theme="dark"] .history-days {
    background: #2b2f38;
    color: #a8aab8;
    border: 1px solid #3a3f4a;
}

/* PDF button */
[data-theme="dark"] .btn-pdf {
    background: #222630;
    border-color: #2b3036;
    color: #a8aab8;
}
[data-theme="dark"] .btn-pdf:hover {
    background: #2b2f38;
    color: #f5f5f5;
}

/* Divider */
[data-theme="dark"] .history-divider { border-top-color: #2b3036; }

/* Text in cards */
[data-theme="dark"] .history-reason,
[data-theme="dark"] .history-informed { color: #a8aab8; }
[data-theme="dark"] .history-reason strong,
[data-theme="dark"] .history-informed strong { color: #f5f5f5; }

/* Section titles */
[data-theme="dark"] .leave-history-section h2,
[data-theme="dark"] .leave-form-section h2 {
    color: #7c8ff5;
    border-bottom-color: #2b3036;
}

/* Records badge */
[data-theme="dark"] .lh-count-badge,
[data-theme="dark"] [class*="records-badge"],
[data-theme="dark"] .history-count {
    background: #2b2f38;
    color: #a8aab8;
    border: 1px solid #3a3f4a;
}

/* Form inputs */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-control,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] select.form-select,
[data-theme="dark"] textarea.form-textarea {
    background: #222630 !important;
    border-color: #2b3036 !important;
    color: #f5f5f5 !important;
}

/* Checkbox/radio labels */
[data-theme="dark"] .checkbox-label,
[data-theme="dark"] .radio-label { color: #a8aab8; }

/* Notes under fields */
[data-theme="dark"] .field-hint,
[data-theme="dark"] .form-note,
[data-theme="dark"] .input-note { color: #4e5268 !important; }

/* ── Settings accordion ── */
[data-theme="dark"] .sett-option { border-color: var(--dm-border); }
[data-theme="dark"] .sett-option:hover,
[data-theme="dark"] .sett-option.active { background: var(--dm-surface2); }
[data-theme="dark"] .sett-opt-title { color: var(--dm-text); }
[data-theme="dark"] .sett-opt-sub,
[data-theme="dark"] .sett-chevron { color: var(--dm-muted); }
[data-theme="dark"] .sett-panel-inner { background: var(--dm-surface); border-color: var(--dm-border); }
[data-theme="dark"] .sett-photo-upload-zone {
    background: var(--dm-surface2);
    border-color: var(--dm-border2);
}
[data-theme="dark"] .sett-photo-upload-zone:hover {
    border-color: var(--dm-accent);
    background: var(--dm-surface3);
}
[data-theme="dark"] .sett-photo-big-preview { background: var(--dm-surface); border-color: var(--dm-border2); }
[data-theme="dark"] .sett-upload-main { color: var(--dm-accent); }
[data-theme="dark"] .sett-upload-sub { color: var(--dm-subtle); }
[data-theme="dark"] .sett-icon-photo    { background: #1c1e2e; color: #7c8ff5; }
[data-theme="dark"] .sett-icon-password { background: #1e1a10; color: #f59e0b; }
[data-theme="dark"] .sett-icon-theme    { background: #0f1e14; color: #34d399; }
[data-theme="dark"] .sett-icon-contact  { background: #1a1b2e; color: #818cf8; }
[data-theme="dark"] .sett-contact-admin:hover { background: #1e1f35; }
[data-theme="dark"] .sett-opt-avatar { background: var(--dm-surface2); border-color: var(--dm-border); }

/* ── Password panel inputs ── */
[data-theme="dark"] .pw-input {
    background: var(--dm-input);
    border-color: var(--dm-border);
    color: var(--dm-text);
}
[data-theme="dark"] .pw-input:focus {
    background: var(--dm-surface3);
    border-color: var(--dm-accent);
    box-shadow: 0 0 0 3px rgba(108,126,225,0.15);
}
[data-theme="dark"] .pw-input::placeholder { color: var(--dm-subtle); }
[data-theme="dark"] .pw-label { color: var(--dm-muted); }
[data-theme="dark"] .pw-strength-track { background: var(--dm-border); }
[data-theme="dark"] .pw-dot { background: var(--dm-border2); }
[data-theme="dark"] .pw-eye-btn { color: var(--dm-subtle); }
[data-theme="dark"] .pw-eye-btn:hover { color: var(--dm-accent); }
[data-theme="dark"] .pw-update-btn {
    background: linear-gradient(135deg, #4a90e2 0%, #2563eb 100%);
    box-shadow: 0 4px 16px rgba(74,144,226,0.35);
}
[data-theme="dark"] .pw-forgot-link { color: var(--dm-accent); }
[data-theme="dark"] .pw-forgot-link:hover {
    background: rgba(108,126,225,0.1);
    color: #a5b4fc;
}

/* ── Save photo button ── */
[data-theme="dark"] .sett-save-photo-btn {
    background: linear-gradient(135deg, #4a90e2, #2563eb);
    box-shadow: 0 3px 10px rgba(74,144,226,0.32);
}
[data-theme="dark"] .sett-remove-btn {
    background: rgba(248,113,113,0.08);
    border-color: rgba(248,113,113,0.3);
    color: #f87171;
}
[data-theme="dark"] .sett-remove-btn:hover {
    background: rgba(248,113,113,0.15);
    border-color: #f87171;
}

/* ── Submit leave button ── */
[data-theme="dark"] [class*="submit-btn"],
[data-theme="dark"] .submit-leave-btn,
[data-theme="dark"] button[type="submit"] {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 3px 12px rgba(5,150,105,0.3);
}

/* ── Section titles in form ── */
[data-theme="dark"] .form-section h2,
[data-theme="dark"] .history-section h2,
[data-theme="dark"] .leave-history-section h2,
[data-theme="dark"] .leave-form-section h2 { color: #7c8ff5; }

/* ── Smooth transitions ── */
body, .settings-content, .your-details-content, .ac-modal-content,
.dashboard-header, .mobile-drawer, input, select, textarea,
.stats-card, .leave-card, .lh-pill, .sett-option {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}


/* =============================================
   SETTINGS ACCORDION (v2)
   ============================================= */
.sett-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.sett-option:hover, .sett-option.active { background: #f5f8ff; }
.sett-option-last { border-bottom: none; border-radius: 0 0 16px 16px; }
.sett-opt-left { display: flex; align-items: center; gap: 13px; }
.sett-opt-icon {
    width: 40px; height: 40px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sett-icon-photo    { background: #e8f0fe; color: #4a90e2; }
.sett-icon-password { background: #fff3e0; color: #f57c00; }
.sett-icon-theme    { background: #e8f5e9; color: #388e3c; }
.sett-icon-contact  { background: #f0f4ff; color: #6366f1; }
.sett-contact-admin { cursor: pointer; transition: background 0.15s; }
.sett-contact-admin:hover { background: #f8faff; }
.sett-opt-title  { font-size: 14px; font-weight: 700; color: #1a1a2e; line-height: 1.3; }
.sett-opt-sub    { font-size: 11.5px; color: #94a3b8; margin-top: 1px; }
.sett-opt-right  { display: flex; align-items: center; gap: 10px; }
.sett-opt-avatar {
    width: 30px; height: 30px; border-radius: 50%; overflow: hidden;
    background: #f0f2f5; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sett-chevron { transition: transform 0.25s ease; }

.sett-panel { max-height: 0; overflow: hidden; transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1); }
.sett-panel.open { max-height: 900px; }
.sett-panel-inner { padding: 16px 18px 20px; background: #fafbff; border-top: 1px solid #f0f2f5; }

/* Upload zone */
.sett-photo-upload-zone {
    border: 2px dashed #c5d5f0; border-radius: 14px; background: #f5f8ff;
    padding: 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px;
    cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.sett-photo-upload-zone:hover { border-color: #4a90e2; background: #edf3ff; }
.sett-photo-big-preview {
    width: 80px; height: 80px; border-radius: 50%; overflow: hidden;
    background: #e8eef8; display: flex; align-items: center; justify-content: center;
    border: 3px solid #c5d5f0; flex-shrink: 0;
}
.sett-upload-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: #4a90e2;
}
.sett-photo-btns { display: flex; gap: 10px; margin-top: 14px; }
.sett-remove-btn {
    flex: 1; padding: 10px; border: 1.5px solid #fca5a5; border-radius: 10px;
    background: #fff; color: #ef4444; font-size: 13px; font-weight: 600; cursor: pointer;
}

/* Details avatar — make room for photo */
.details-avatar-circle {
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(255,255,255,0.2); overflow: hidden;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    border: 2.5px solid rgba(255,255,255,0.5);
}

/* ============================================================
   PROFESSIONAL SETTINGS REDESIGN — Profile Photo + Password
   ============================================================ */

/* --- Photo Panel --- */
.sett-photo-panel { padding: 20px 18px 22px !important; }

.sett-photo-upload-zone {
    border: 2px dashed #c5d5f0; border-radius: 16px; background: linear-gradient(135deg, #f5f8ff 0%, #eef2ff 100%);
    padding: 24px 16px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px;
    cursor: pointer; transition: all 0.25s ease; position: relative;
}
.sett-photo-upload-zone:hover { border-color: #4f7fe4; background: linear-gradient(135deg, #edf2ff 0%, #e0e7ff 100%); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(79,127,228,0.12); }
.sett-photo-upload-zone:active { transform: translateY(0); }

.sett-photo-ring {
    position: relative; width: 90px; height: 90px; flex-shrink: 0;
}
.sett-photo-big-preview {
    width: 90px; height: 90px; border-radius: 50%; overflow: hidden;
    background: #e8eef8; display: flex; align-items: center; justify-content: center;
    border: 3px solid #c5d5f0; box-shadow: 0 4px 12px rgba(79,127,228,0.18);
    transition: border-color 0.2s;
}
.sett-photo-upload-zone:hover .sett-photo-big-preview { border-color: #4f7fe4; }

.sett-photo-cam-badge {
    position: absolute; bottom: 2px; right: 2px;
    width: 26px; height: 26px; border-radius: 50%;
    background: linear-gradient(135deg, #4f7fe4, #6366f1);
    display: flex; align-items: center; justify-content: center;
    border: 2.5px solid white; box-shadow: 0 2px 6px rgba(79,127,228,0.35);
}

.sett-upload-text { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.sett-upload-main { font-size: 13px; font-weight: 700; color: #4f7fe4; letter-spacing: 0.01em; }
.sett-upload-sub  { font-size: 11px; color: #94a3b8; font-weight: 500; }

.sett-photo-action-row {
    display: flex; gap: 10px; margin-top: 14px; width: 100%;
}
.sett-remove-btn {
    flex: 1; padding: 10px 14px; border: 1.5px solid #fca5a5; border-radius: 12px;
    background: #fff5f5; color: #ef4444; font-size: 13px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: all 0.2s ease;
}
.sett-remove-btn:hover { background: #fee2e2; border-color: #ef4444; transform: translateY(-1px); }

.sett-save-photo-btn {
    flex: 2; padding: 10px 14px;
    background: linear-gradient(135deg, #4a90e2, #2563eb);
    color: white; border: none; border-radius: 12px;
    font-size: 13px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: all 0.2s ease; box-shadow: 0 3px 10px rgba(74,144,226,0.30);
}
.sett-save-photo-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(74,144,226,0.42); }
.sett-save-photo-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* --- Password Panel --- */
.sett-pw-panel { padding: 20px 18px 22px !important; }

.pw-field-group { margin-bottom: 16px; }

.pw-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 700; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 7px;
}

.pw-input-wrap { position: relative; display: flex; align-items: center; }

.pw-input {
    width: 100%; padding: 12px 44px 12px 14px;
    border: 1.5px solid #e2e8f0; border-radius: 12px;
    font-size: 14px; font-weight: 500;
    background: #f8fafc; color: #1e293b;
    outline: none; transition: all 0.2s ease;
    box-sizing: border-box;
}
.pw-input:focus {
    border-color: #4f7fe4; background: #fff;
    box-shadow: 0 0 0 3px rgba(79,127,228,0.12);
}
.pw-input::placeholder { color: #cbd5e1; font-weight: 400; }

.pw-eye-btn {
    position: absolute; right: 12px; background: none; border: none;
    cursor: pointer; color: #94a3b8; display: flex; align-items: center; padding: 4px;
    transition: color 0.2s;
}
.pw-eye-btn:hover { color: #4f7fe4; }

/* Strength bar + dots */
.pw-strength-track {
    height: 3px; background: #e2e8f0; border-radius: 3px;
    margin-top: 8px; overflow: hidden;
}
.pw-strength-bar { height: 100%; width: 0; border-radius: 3px; transition: width 0.4s ease, background 0.4s ease; }

.pw-strength-dots {
    display: flex; align-items: center; gap: 5px; margin-top: 7px;
}
.pw-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #e2e8f0; transition: background 0.35s ease;
    flex-shrink: 0;
}
.pw-strength-text { font-size: 11px; font-weight: 700; margin-left: 4px; }

/* Actions row */
.pw-actions {
    display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap;
}
.pw-update-btn {
    flex: 1; min-width: 140px; padding: 13px 20px;
    background: linear-gradient(135deg, #4a90e2 0%, #2563eb 100%);
    color: white; border: none; border-radius: 14px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.25s ease; box-shadow: 0 4px 14px rgba(74,144,226,0.32);
    letter-spacing: 0.02em;
}
.pw-update-btn:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(74,144,226,0.44); }
.pw-update-btn:active { transform: translateY(0); }

.pw-forgot-link {
    display: flex; align-items: center; gap: 5px;
    font-size: 12.5px; font-weight: 600; color: #4f7fe4;
    text-decoration: none; white-space: nowrap; padding: 6px 4px;
    border-radius: 8px; transition: all 0.2s ease;
}
.pw-forgot-link:hover { color: #3b5fc0; background: #f0f4ff; padding: 6px 10px; }

.pw-status {
    display: block; font-size: 12.5px; font-weight: 600;
    min-height: 18px; margin-top: 10px; padding: 0 2px;
}

/* ============================================================
   DARK MODE — COMPLETE WHITE ELIMINATION  v12 fix
   Every white/light surface replaced with exact Instagram colors
   BG=#0c0f14  Card=#1a1d24  Input=#222630  Cell=#2b2f38
   ============================================================ */

/* 1. PAGE & BODY */
[data-theme="dark"] body,
[data-theme="dark"] .dashboard-main,
[data-theme="dark"] .main-wrapper { background: #0c0f14 !important; }

/* 2. STATS CARD WRAPPER — the container that shows as gap between cards */
[data-theme="dark"] .stats-card { background: #0c0f14 !important; }

/* 3. EVERY STAT ITEM — including attendance-percentage which has !important white */
[data-theme="dark"] .stat-item,
[data-theme="dark"] .stat-item.leaves-taken,
[data-theme="dark"] .stat-item.leaves-remaining,
[data-theme="dark"] .stat-item.attendance-percentage {
    background: #1a1d24 !important;
    border: 1px solid #2b3036 !important;
    box-shadow: none !important;
}
[data-theme="dark"] .attendance-percentage:hover {
    background: #222630 !important;
    box-shadow: none !important;
    border-color: #6c7ee1 !important;
}

/* 4. FORM SECTION & HISTORY SECTION */
[data-theme="dark"] .form-section,
[data-theme="dark"] .history-section,
[data-theme="dark"] .leave-form-section,
[data-theme="dark"] .leave-history-section {
    background: #1a1d24 !important;
    border: 1px solid #2b3036 !important;
    box-shadow: none !important;
}

/* 5. ALL INPUTS, SELECTS, TEXTAREAS — INCLUDING REASON DROPDOWN */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #222630 !important;
    border-color: #2b3036 !important;
    color: #f5f5f5 !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #4e5268 !important; }
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    background: #2b2f38 !important;
    border-color: #6c7ee1 !important;
    box-shadow: 0 0 0 2px rgba(108,126,225,0.15) !important;
    outline: none !important;
}
[data-theme="dark"] select option {
    background: #222630 !important;
    color: #f5f5f5 !important;
}

/* 6. TOTAL DAYS BOX */
[data-theme="dark"] .days-info {
    background: #1a1d24 !important;
    border: 1px solid #2b3036 !important;
    color: #a8aab8 !important;
}
[data-theme="dark"] .days-info strong { color: #7c8ff5 !important; }

/* 7. LEAVE HISTORY CARDS */
[data-theme="dark"] .history-item {
    background: #1a1d24 !important;
    border: 1px solid #2b3036 !important;
    box-shadow: none !important;
}
[data-theme="dark"] .history-item:hover {
    background: #222630 !important;
    border-color: #3a3f4a !important;
}

/* 8. FILTER PILLS (unselected = dark, not white) */
[data-theme="dark"] .lh-pill {
    background: #1a1d24 !important;
    border-color: #2b3036 !important;
    color: #a8aab8 !important;
}
[data-theme="dark"] .lh-pill:hover {
    background: #2b2f38 !important;
    color: #f5f5f5 !important;
}
[data-theme="dark"] .lh-pill.active {
    background: #6c7ee1 !important;
    border-color: #6c7ee1 !important;
    color: #fff !important;
}
[data-theme="dark"] .lh-pill[data-status="pending"].active  { background:#b45309 !important; border-color:#b45309 !important; }
[data-theme="dark"] .lh-pill[data-status="approved"].active { background:#059669 !important; border-color:#059669 !important; }
[data-theme="dark"] .lh-pill[data-status="rejected"].active { background:#dc2626 !important; border-color:#dc2626 !important; }

/* 9. SORT DROPDOWN */
[data-theme="dark"] .lh-sort-select {
    background-color: #222630 !important;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23a8aab8' height='14' viewBox='0 0 24 24' width='14' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>") !important;
    border-color: #2b3036 !important;
    color: #f5f5f5 !important;
}

/* 10. PDF BUTTON */
[data-theme="dark"] .btn-pdf {
    background: #222630 !important;
    border-color: #2b3036 !important;
    color: #a8aab8 !important;
}
[data-theme="dark"] .btn-pdf:hover { background: #2b2f38 !important; color: #f5f5f5 !important; }

/* 11. MOBILE DRAWER */
[data-theme="dark"] .mobile-drawer { background: #1a1d24 !important; }

/* 12. MODALS — all white modal backgrounds */
[data-theme="dark"] .modal-content,
[data-theme="dark"] .chart-modal-content,
[data-theme="dark"] .ac-modal-content,
[data-theme="dark"] .analytics-modal,
[data-theme="dark"] .your-details-content,
[data-theme="dark"] .settings-content {
    background: #1a1d24 !important;
    border: 1px solid #2b3036 !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6) !important;
    color: #f5f5f5 !important;
}

/* 13. CALENDAR MODAL internals */
[data-theme="dark"] .ac-day {
    background: #222630 !important;
    border-color: #2b3036 !important;
    color: #f5f5f5 !important;
}
[data-theme="dark"] .ac-day:hover { background: #2b2f38 !important; }
[data-theme="dark"] .ac-day-detail { background: #1a1d24 !important; border-color: #2b3036 !important; }
[data-theme="dark"] .ac-summary    { background: #222630 !important; }

/* 14. DETAILS CARD */
[data-theme="dark"] .details-card {
    background: #1a1d24 !important;
    border-color: #2b3036 !important;
}

/* 15. ANALYTICS MODAL KPI CARDS */
[data-theme="dark"] .analytics-kpi--taken,
[data-theme="dark"] .analytics-kpi--projected,
[data-theme="dark"] [class*="analytics-kpi"] {
    background: #222630 !important;
    border: 1px solid #2b3036 !important;
}

/* 16. FILTER STRIP CONTAINER */
[data-theme="dark"] .lh-filter-strip,
[data-theme="dark"] .lh-controls-bar,
[data-theme="dark"] .lh-sort-strip { background: transparent !important; }

/* 17. ALL LABELS AND GENERAL TEXT */
[data-theme="dark"] label,
[data-theme="dark"] .form-group label,
[data-theme="dark"] .field-label { color: #a8aab8 !important; }
[data-theme="dark"] .form-note,
[data-theme="dark"] .field-hint,
[data-theme="dark"] small { color: #4e5268 !important; }

/* 18. RADIO BUTTON LABELS */
[data-theme="dark"] .radio-label,
[data-theme="dark"] .checkbox-label { color: #a8aab8 !important; }

/* 19. SECTION H2 TITLES */
[data-theme="dark"] .form-section h2,
[data-theme="dark"] .history-section h2,
[data-theme="dark"] .leave-form-section h2,
[data-theme="dark"] .leave-history-section h2 {
    color: #7c8ff5 !important;
    border-bottom-color: #2b3036 !important;
}

/* 20. HISTORY TEXT */
[data-theme="dark"] .history-date { color: #7c8ff5 !important; }
[data-theme="dark"] .history-reason,
[data-theme="dark"] .history-informed { color: #a8aab8 !important; }
[data-theme="dark"] .history-reason strong,
[data-theme="dark"] .history-informed strong { color: #f5f5f5 !important; }
[data-theme="dark"] .history-divider { border-top-color: #2b3036 !important; }
[data-theme="dark"] .history-days {
    background: #2b2f38 !important;
    color: #a8aab8 !important;
    border: 1px solid #3a3f4a !important;
}

/* 21. SETTINGS PANEL */
[data-theme="dark"] .sett-panel-inner,
[data-theme="dark"] .sett-photo-panel,
[data-theme="dark"] .sett-pw-panel {
    background: #1a1d24 !important;
    border-color: #2b3036 !important;
}
[data-theme="dark"] .sett-option { border-color: #2b3036 !important; }
[data-theme="dark"] .sett-option:hover { background: #222630 !important; }
[data-theme="dark"] .sett-photo-upload-zone {
    background: #222630 !important;
    border-color: #3a3f4a !important;
}
[data-theme="dark"] .pw-input {
    background: #222630 !important;
    border-color: #2b3036 !important;
    color: #f5f5f5 !important;
}
[data-theme="dark"] .pw-input:focus { background: #2b2f38 !important; border-color: #6c7ee1 !important; }


/* ============================================================
   DARK MODE COMPLETE FIX — v14 FINAL
   Zero white/light surfaces. All gaps, bars, pills, items dark.
   ============================================================ */

/* ── 1. STATS CARD GAP FIX: the container that shows between cards ── */
[data-theme="dark"] .stats-card {
    background: #0c0f14 !important;
    gap: 20px;
}
[data-theme="dark"] .stat-item,
[data-theme="dark"] .stat-item.leaves-taken,
[data-theme="dark"] .stat-item.leaves-remaining,
[data-theme="dark"] .stat-item.attendance-percentage {
    background: #1a1d24 !important;
    border: 1px solid #2b3036 !important;
    box-shadow: none !important;
}
[data-theme="dark"] .attendance-percentage {
    border: 1px solid #6c7ee1 !important;
}

/* ── 2. CONTROL BAR (filter + sort strip container) ── */
[data-theme="dark"] .lh-control-bar {
    background: #111418 !important;
    border-top-color: #2b3036 !important;
    border-bottom-color: #2b3036 !important;
}

/* ── 3. FILTER PILLS (unselected) ── */
[data-theme="dark"] .lh-pill {
    background: #1a1d24 !important;
    border-color: #2b3036 !important;
    color: #a8aab8 !important;
}
[data-theme="dark"] .lh-pill:hover {
    background: #2b2f38 !important;
    border-color: #3a3f4a !important;
    color: #f5f5f5 !important;
}
[data-theme="dark"] .lh-pill.active {
    background: #6c7ee1 !important;
    border-color: #6c7ee1 !important;
    color: #fff !important;
}
[data-theme="dark"] .lh-pill[data-status="pending"].active  { background: #b45309 !important; border-color: #b45309 !important; }
[data-theme="dark"] .lh-pill[data-status="approved"].active { background: #059669 !important; border-color: #059669 !important; }
[data-theme="dark"] .lh-pill[data-status="rejected"].active { background: #dc2626 !important; border-color: #dc2626 !important; }

/* ── 4. SORT SELECT (Newest first dropdown) ── */
[data-theme="dark"] .lh-sort-select,
[data-theme="dark"] #lhSortBy {
    background-color: #222630 !important;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23a8aab8' height='14' viewBox='0 0 24 24' width='14' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>") !important;
    border-color: #2b3036 !important;
    color: #f5f5f5 !important;
}
[data-theme="dark"] .lh-sort-strip {
    border-left-color: #2b3036 !important;
}

/* ── 5. ALL SELECT DROPDOWNS (including Reason for Leave) ── */
[data-theme="dark"] select,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] textarea {
    background: #222630 !important;
    background-color: #222630 !important;
    border-color: #2b3036 !important;
    color: #f5f5f5 !important;
}
[data-theme="dark"] select:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus {
    background: #2b2f38 !important;
    border-color: #6c7ee1 !important;
    box-shadow: 0 0 0 2px rgba(108,126,225,0.15) !important;
}
[data-theme="dark"] select option {
    background: #222630 !important;
    color: #f5f5f5 !important;
}

/* ── 6. TOTAL DAYS BOX ── */
[data-theme="dark"] .days-info {
    background: #1a1d24 !important;
    border: 1px solid #2b3036 !important;
    color: #a8aab8 !important;
}
[data-theme="dark"] .days-info strong {
    color: #7c8ff5 !important;
}

/* ── 7. HISTORY ITEMS (leave record cards) ── */
[data-theme="dark"] .history-item,
[data-theme="dark"] .history-item.pending-item,
[data-theme="dark"] .history-item.rejected-item,
[data-theme="dark"] .history-item.approved-item {
    background: #1a1d24 !important;
    border: 1px solid #2b3036 !important;
    box-shadow: none !important;
}
[data-theme="dark"] .history-item:hover {
    background: #222630 !important;
    border-color: #3a3f4a !important;
}

/* ── 8. PDF BUTTON in history items ── */
[data-theme="dark"] .btn-pdf {
    background: #222630 !important;
    border-color: #2b3036 !important;
    color: #a8aab8 !important;
}
[data-theme="dark"] .btn-pdf:hover {
    background: #2b2f38 !important;
    color: #f5f5f5 !important;
}

/* ── 9. WORKING DAYS PILL in history items ── */
[data-theme="dark"] .history-days {
    background: #2b2f38 !important;
    color: #a8aab8 !important;
    border: 1px solid #3a3f4a !important;
}

/* ── 10. SETTINGS PANEL — remove light backgrounds ── */
[data-theme="dark"] .sett-option:hover,
[data-theme="dark"] .sett-option.active {
    background: #222630 !important;
}
[data-theme="dark"] .sett-icon-photo    { background: #1c1e2e !important; color: #7c8ff5 !important; }
[data-theme="dark"] .sett-icon-password { background: #1e1a10 !important; color: #f59e0b !important; }
[data-theme="dark"] .sett-icon-theme    { background: #0f1e14 !important; color: #34d399 !important; }
[data-theme="dark"] .sett-icon-contact  { background: #1a1b2e !important; color: #818cf8 !important; }

/* ── 11. REMOVE BUTTON in settings ── */
[data-theme="dark"] .sett-remove-btn {
    background: rgba(248,113,113,0.08) !important;
    border-color: rgba(248,113,113,0.3) !important;
    color: #f87171 !important;
}
[data-theme="dark"] .sett-remove-btn:hover {
    background: rgba(248,113,113,0.15) !important;
}

/* ── 12. PASSWORD PANEL ── */
[data-theme="dark"] .pw-input {
    background: #222630 !important;
    border-color: #2b3036 !important;
    color: #f5f5f5 !important;
}
[data-theme="dark"] .pw-input:focus {
    background: #2b2f38 !important;
    border-color: #6c7ee1 !important;
}
[data-theme="dark"] .pw-input::placeholder { color: #4e5268 !important; }
[data-theme="dark"] .pw-strength-track { background: #2b3036 !important; }
[data-theme="dark"] .pw-dot { background: #2b3036 !important; }

/* ── 13. ANALYTICS KPI CARDS ── */
[data-theme="dark"] .analytics-kpi--taken,
[data-theme="dark"] .analytics-kpi--projected,
[data-theme="dark"] [class*="analytics-kpi"] {
    background: #222630 !important;
    color: #f5f5f5 !important;
}

/* ── 14. CALENDAR CELLS ── */
[data-theme="dark"] .ac-cell.ac-day {
    background: #222630 !important;
    color: #f5f5f5 !important;
}
[data-theme="dark"] .ac-cell.ac-day:hover { background: #2b2f38 !important; }

/* ── 15. FORM SECTION WRAPPER ── */
[data-theme="dark"] .form-section,
[data-theme="dark"] .history-section,
[data-theme="dark"] .leave-form-section,
[data-theme="dark"] .leave-history-section {
    background: #1a1d24 !important;
    border: 1px solid #2b3036 !important;
    box-shadow: none !important;
}

/* ── 16. MAIN PAGE BACKGROUND ── */
[data-theme="dark"] body,
[data-theme="dark"] .dashboard,
[data-theme="dark"] .dashboard-container,
[data-theme="dark"] .main-content,
[data-theme="dark"] .dashboard-main,
[data-theme="dark"] main {
    background: #0c0f14 !important;
}

/* ── 17. CHART MODAL ── */
[data-theme="dark"] .chart-modal-content,
[data-theme="dark"] .chart-stat {
    background: #1a1d24 !important;
    border-color: #2b3036 !important;
    color: #f5f5f5 !important;
}
[data-theme="dark"] .chart-label { color: #a8aab8 !important; }
[data-theme="dark"] .chart-value { color: #7c8ff5 !important; }

/* ── 18. LOGIN BOX (not dark, but make consistent) ── */
[data-theme="dark"] .login-box {
    background: #1a1d24 !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6) !important;
}
[data-theme="dark"] .login-box h1 { color: #7c8ff5 !important; }
[data-theme="dark"] .subtitle { color: #a8aab8 !important; }
[data-theme="dark"] .form-group label { color: #a8aab8 !important; }
[data-theme="dark"] .info-text { border-top-color: #2b3036 !important; }
[data-theme="dark"] .info-text p { color: #4e5268 !important; }


/* ── 19. READONLY INPUTS (Student Name / ID) ── */
.input-readonly {
    background: #f8f9fa;
    cursor: not-allowed;
}
.form-note {
    color: #6c757d;
    font-size: 12px;
}
[data-theme="dark"] .input-readonly {
    background: #222630 !important;
    border-color: #2b3036 !important;
    color: #a8aab8 !important;
    cursor: not-allowed;
    opacity: 0.8;
}
[data-theme="dark"] .form-note {
    color: #4e5268 !important;
}


/* ── 20. CROP MODAL dark theme fix ── */
[data-theme="dark"] #cropModal > div {
    background: #1a1d24 !important;
}
[data-theme="dark"] #cropModal > div > div:first-child {
    border-bottom-color: #2b3036 !important;
    background: #1a1d24 !important;
}
[data-theme="dark"] #cropModal > div > div:first-child span {
    color: #f5f5f5 !important;
}
[data-theme="dark"] #cropModal > div > div:nth-child(2) {
    background: #222630 !important;
}
[data-theme="dark"] #cropModal > div > div:last-child button:first-child {
    background: #222630 !important;
    border-color: #3a3f4a !important;
    color: #a8aab8 !important;
}

/* ── 21. NO-DATA / EMPTY STATE ── */
[data-theme="dark"] .no-data,
[data-theme="dark"] .lh-empty-filter {
    color: #a8aab8 !important;
}

/* ── 22. LEAVE FORM CARD CONTAINER ── */
[data-theme="dark"] .leave-form-card,
[data-theme="dark"] .leave-card {
    background: #1a1d24 !important;
    border-color: #2b3036 !important;
}


/* ============================================================
   DARK MODE v14 FINAL-2 — COMPLETE WHITE ELIMINATION
   Fixes: history-item white, lh-count-pill, sort triangles
   ============================================================ */

/* ── A. HISTORY SECTION container (white bg) ── */
[data-theme="dark"] .history-section {
    background: #1a1d24 !important;
    border: 1px solid #2b3036 !important;
    box-shadow: none !important;
    color: #f5f5f5 !important;
}
[data-theme="dark"] .history-section-header {
    border-bottom-color: #2b3036 !important;
}

/* ── B. HISTORY ITEM CARDS — full override for every state ── */
[data-theme="dark"] .history-item,
[data-theme="dark"] .history-item.pending-item,
[data-theme="dark"] .history-item.rejected-item,
[data-theme="dark"] .history-item.approved-item,
[data-theme="dark"] .history-item.cancelled-item,
[data-theme="dark"] #leaveHistory .history-item {
    background: #1a1d24 !important;
    background-color: #1a1d24 !important;
    border: 1px solid #2b3036 !important;
    box-shadow: none !important;
    color: #f5f5f5 !important;
}
[data-theme="dark"] .history-item:hover,
[data-theme="dark"] #leaveHistory .history-item:hover {
    background: #222630 !important;
    background-color: #222630 !important;
    border-color: #3a3f4a !important;
}

/* ── C. 9 RECORDS BADGE (lh-count-pill) ── */
[data-theme="dark"] .lh-count-pill {
    background: #2b2f38 !important;
    color: #7c8ff5 !important;
    border: 1px solid #3a3f4a !important;
}

/* ── D. SORT SELECT — eliminate triangles completely ── */
[data-theme="dark"] .lh-sort-select,
[data-theme="dark"] select.lh-sort-select,
[data-theme="dark"] #lhSortBy {
    /* kill ALL native browser arrows */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    /* dark bg + single clean SVG arrow */
    background-color: #222630 !important;
    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='%23a8aab8'><path d='M7 10l5 5 5-5z'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 12px 12px !important;
    padding-right: 28px !important;
    border: 1.5px solid #2b3036 !important;
    color: #f5f5f5 !important;
    border-radius: 8px !important;
}
[data-theme="dark"] .lh-sort-select option,
[data-theme="dark"] #lhSortBy option {
    background: #222630 !important;
    background-color: #222630 !important;
    color: #f5f5f5 !important;
}

/* ── E. CONTROL BAR background ── */
[data-theme="dark"] .lh-control-bar {
    background: #111418 !important;
    background-color: #111418 !important;
    border-top: 1px solid #2b3036 !important;
    border-bottom: 1px solid #2b3036 !important;
}

/* ── F. FILTER PILLS ── */
[data-theme="dark"] .lh-pill {
    background: #1a1d24 !important;
    border-color: #2b3036 !important;
    color: #a8aab8 !important;
}
[data-theme="dark"] .lh-pill:hover {
    background: #2b2f38 !important;
    color: #f5f5f5 !important;
}
[data-theme="dark"] .lh-pill.active {
    background: #6c7ee1 !important;
    border-color: #6c7ee1 !important;
    color: #fff !important;
}
[data-theme="dark"] .lh-pill[data-status="pending"].active  { background: #b45309 !important; border-color: #b45309 !important; }
[data-theme="dark"] .lh-pill[data-status="approved"].active { background: #059669 !important; border-color: #059669 !important; }
[data-theme="dark"] .lh-pill[data-status="rejected"].active { background: #dc2626 !important; border-color: #dc2626 !important; }

/* ── G. HISTORY TEXT COLOURS ── */
[data-theme="dark"] .history-reason,
[data-theme="dark"] .history-informed {
    color: #a8aab8 !important;
}
[data-theme="dark"] .history-reason strong,
[data-theme="dark"] .history-informed strong,
[data-theme="dark"] .history-item b,
[data-theme="dark"] .history-item strong {
    color: #f5f5f5 !important;
}

/* ── H. PDF BUTTON (white outline) ── */
[data-theme="dark"] .btn-pdf,
[data-theme="dark"] .history-item .btn-pdf {
    background: #222630 !important;
    background-color: #222630 !important;
    border: 1px solid #2b3036 !important;
    color: #a8aab8 !important;
    box-shadow: none !important;
}
[data-theme="dark"] .btn-pdf:hover { background: #2b2f38 !important; color: #f5f5f5 !important; }

/* ── I. WORKING DAYS PILL ── */
[data-theme="dark"] .history-days,
[data-theme="dark"] .badge-days,
[data-theme="dark"] [class*="working-day"],
[data-theme="dark"] [class*="days-pill"] {
    background: #2b2f38 !important;
    color: #a8aab8 !important;
    border: 1px solid #3a3f4a !important;
}

/* ── J. SORT STRIP BORDER ── */
[data-theme="dark"] .lh-sort-strip {
    border-left: 1px solid #2b3036 !important;
    background: transparent !important;
}
[data-theme="dark"] .lh-filter-label {
    color: #4e5268 !important;
}


/* ============================================================
   SORT SELECT — DEFINITIVE FINAL FIX (overrides all above)
   Kills native arrows, single clean SVG, dark background
   ============================================================ */
[data-theme="dark"] .lh-sort-select,
[data-theme="dark"] select.lh-sort-select,
[data-theme="dark"] #lhSortBy {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-color: #222630 !important;
    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='%23a8aab8'><path d='M7 10l5 5 5-5z'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 12px 12px !important;
    border: 1.5px solid #2b3036 !important;
    color: #f5f5f5 !important;
    padding-right: 28px !important;
}
[data-theme="dark"] .lh-sort-select option,
[data-theme="dark"] #lhSortBy option {
    background: #222630 !important;
    background-color: #222630 !important;
    color: #f5f5f5 !important;
}


/* ============================================================
   v16 — TARGETED 4-ISSUE FIX
   1. Desktop header: blue gradient restored (dark only on mobile)
   2. History cards: lighter than container
   3. Analytics modal: full dark
   4. Calendar: white/light cells with readable text
   ============================================================ */

/* ══════════════════════════════════════════
   FIX 1 — DESKTOP HEADER: keep blue gradient
   Dark header ONLY on mobile (≤900px)
   ══════════════════════════════════════════ */
@media (min-width: 901px) {
    [data-theme="dark"] .dashboard-header {
        background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%) !important;
        border-bottom: none !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
    }
    [data-theme="dark"] .dashboard-header h1 { color: #fff !important; }
    [data-theme="dark"] .dashboard-header p  { color: rgba(255,255,255,0.85) !important; }
    [data-theme="dark"] .header-nav-row { border-top-color: rgba(255,255,255,0.18) !important; }
    [data-theme="dark"] .user-info span { color: rgba(255,255,255,0.85) !important; }
    [data-theme="dark"] .user-info strong,
    [data-theme="dark"] #welcomeUser { color: #fff !important; }
    [data-theme="dark"] .btn-logout {
        background: rgba(255,255,255,0.2) !important;
        border: 1px solid rgba(255,255,255,0.5) !important;
        color: #fff !important;
    }
    [data-theme="dark"] .btn-logout:hover {
        background: rgba(255,255,255,0.35) !important;
        color: #fff !important;
    }
    [data-theme="dark"] .desktop-nav-link {
        color: rgba(255,255,255,0.88) !important;
        background: rgba(255,255,255,0.08) !important;
        border-color: rgba(255,255,255,0.18) !important;
    }
    [data-theme="dark"] .desktop-nav-link:hover {
        background: rgba(255,255,255,0.22) !important;
        color: #fff !important;
        border-color: rgba(255,255,255,0.4) !important;
    }
}

/* ══════════════════════════════════════════
   FIX 2 — HISTORY CARDS: visibly lighter
   Container: #1a1d24 → Cards: #262b36
   ══════════════════════════════════════════ */
[data-theme="dark"] .history-section {
    background: #161920 !important;
    border: 1px solid #2b3036 !important;
}
[data-theme="dark"] .history-item,
[data-theme="dark"] .history-item.pending-item,
[data-theme="dark"] .history-item.rejected-item,
[data-theme="dark"] .history-item.approved-item,
[data-theme="dark"] .history-item.cancelled-item,
[data-theme="dark"] #leaveHistory .history-item {
    background: #252a35 !important;
    background-color: #252a35 !important;
    border: 1px solid #343a48 !important;
    box-shadow: 0 1px 6px rgba(0,0,0,0.25) !important;
}
[data-theme="dark"] .history-item:hover,
[data-theme="dark"] #leaveHistory .history-item:hover {
    background: #2c3242 !important;
    background-color: #2c3242 !important;
    border-color: #4a5068 !important;
}
/* PDF button matches card */
[data-theme="dark"] .btn-pdf,
[data-theme="dark"] .history-item .btn-pdf {
    background: #1e2230 !important;
    border: 1.5px solid #343a48 !important;
    color: #a8aab8 !important;
}
[data-theme="dark"] .btn-pdf:hover {
    background: #2c3242 !important;
    color: #f5f5f5 !important;
}
/* Also update JS-rendered items via a CSS custom property trick */
[data-theme="dark"] #leaveHistory {
    --item-bg: #252a35;
    --item-border: #343a48;
    --item-text: #a8aab8;
    --item-date: #7c8ff5;
}

/* ══════════════════════════════════════════
   FIX 3 — ANALYTICS MODAL: full dark
   ══════════════════════════════════════════ */
[data-theme="dark"] .analytics-modal {
    background: #1a1d24 !important;
    border: 1px solid #2b3036 !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7) !important;
    color: #f5f5f5 !important;
}
[data-theme="dark"] .analytics-title { color: #7c8ff5 !important; }
[data-theme="dark"] .analytics-subtitle { color: #a8aab8 !important; }
[data-theme="dark"] .analytics-close-btn { color: #a8aab8 !important; }
[data-theme="dark"] .analytics-close-btn:hover { color: #f87171 !important; }

/* KPI cards — colorful tints on dark */
[data-theme="dark"] .analytics-kpi--taken {
    background: rgba(192,57,43,0.18) !important;
    color: #f87171 !important;
    border: 1px solid rgba(248,113,113,0.2) !important;
}
[data-theme="dark"] .analytics-kpi--remaining {
    background: rgba(5,150,105,0.18) !important;
    color: #34d399 !important;
    border: 1px solid rgba(52,211,153,0.2) !important;
}
[data-theme="dark"] .analytics-kpi--avg {
    background: rgba(108,126,225,0.18) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(165,180,252,0.2) !important;
}
[data-theme="dark"] .analytics-kpi--projected {
    background: rgba(180,83,9,0.18) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(251,191,36,0.2) !important;
}
[data-theme="dark"] [class*="analytics-kpi"] {
    background: #222630 !important;
}
[data-theme="dark"] .analytics-kpi--taken,
[data-theme="dark"] .analytics-kpi--remaining,
[data-theme="dark"] .analytics-kpi--avg,
[data-theme="dark"] .analytics-kpi--projected {
    background: unset !important; /* let the specific rules above apply */
}
/* restore specific after the wildcard reset */
[data-theme="dark"] .analytics-kpi.analytics-kpi--taken    { background: rgba(192,57,43,0.18) !important; color: #f87171 !important; }
[data-theme="dark"] .analytics-kpi.analytics-kpi--remaining { background: rgba(5,150,105,0.18) !important; color: #34d399 !important; }
[data-theme="dark"] .analytics-kpi.analytics-kpi--avg       { background: rgba(108,126,225,0.18) !important; color: #a5b4fc !important; }
[data-theme="dark"] .analytics-kpi.analytics-kpi--projected { background: rgba(180,83,9,0.18) !important; color: #fbbf24 !important; }

/* Chart cards */
[data-theme="dark"] .analytics-chart-card,
[data-theme="dark"] .analytics-chart-card--flat {
    background: #222630 !important;
    border-color: #2b3036 !important;
}
[data-theme="dark"] .analytics-chart-header h3 { color: #f5f5f5 !important; }
[data-theme="dark"] .analytics-chart-badge { background: rgba(220,38,38,0.18) !important; color: #f87171 !important; }
[data-theme="dark"] .analytics-chart-badge--info { background: rgba(29,78,216,0.18) !important; color: #93c5fd !important; }
[data-theme="dark"] .analytics-chart-badge--warn { background: rgba(180,83,9,0.18) !important; color: #fbbf24 !important; }
[data-theme="dark"] .analytics-chart-badge--ok   { background: rgba(5,150,105,0.18) !important; color: #34d399 !important; }
[data-theme="dark"] .analytics-note { color: #4e5268 !important; }

/* Tabs */
[data-theme="dark"] .analytics-tabs { border-bottom-color: #2b3036 !important; }
[data-theme="dark"] .analytics-tab { color: #a8aab8 !important; }
[data-theme="dark"] .analytics-tab:hover { color: #7c8ff5 !important; background: rgba(108,126,225,0.08) !important; }
[data-theme="dark"] .analytics-tab--active { color: #7c8ff5 !important; border-bottom-color: #7c8ff5 !important; background: rgba(108,126,225,0.1) !important; }

/* ══════════════════════════════════════════
   FIX 4 — CALENDAR: white/light for readability
   Modal body white, cells light, text dark
   ══════════════════════════════════════════ */
[data-theme="dark"] .ac-modal-content {
    background: #ffffff !important;
    color: #1a1a2e !important;
}
/* Nav area */
[data-theme="dark"] .ac-nav-btn {
    background: #f0f4ff !important;
    color: #4a90e2 !important;
    border: none !important;
}
[data-theme="dark"] .ac-nav-btn:hover { background: #4a90e2 !important; color: #fff !important; }
[data-theme="dark"] .ac-month-label { color: #1e3a5f !important; }

/* Summary cards */
[data-theme="dark"] .ac-summary-item.ac-working { background: #e8f5e9 !important; }
[data-theme="dark"] .ac-summary-item.ac-holiday { background: #fdecea !important; }
[data-theme="dark"] .ac-summary-item.ac-working .ac-summary-num { color: #2e7d32 !important; }
[data-theme="dark"] .ac-summary-item.ac-holiday .ac-summary-num { color: #c62828 !important; }
[data-theme="dark"] .ac-summary-label { color: #555 !important; }

/* Legend */
[data-theme="dark"] .ac-legend { color: #555 !important; }

/* Header row day names */
[data-theme="dark"] .ac-cell.ac-hdr { color: #888 !important; }

/* Day cells */
[data-theme="dark"] .ac-cell.ac-day {
    background: #f8f9fa !important;
    color: #333 !important;
}
[data-theme="dark"] .ac-cell.ac-day:hover { background: #e3eeff !important; }
[data-theme="dark"] .ac-cell.ac-cell-working { background: #e8f5e9 !important; }
[data-theme="dark"] .ac-cell.ac-cell-holiday { background: #fdecea !important; }
[data-theme="dark"] .ac-cell.ac-cell-today   { background: #e3eeff !important; outline: 2px solid #4a90e2 !important; }
[data-theme="dark"] .ac-day-num { color: #333 !important; }
[data-theme="dark"] .ac-cell.ac-cell-holiday .ac-day-num { color: #c62828 !important; }
[data-theme="dark"] .ac-cell.ac-cell-working .ac-day-num { color: #2e7d32 !important; }
[data-theme="dark"] .ac-cell.ac-cell-today   .ac-day-num { color: #1565c0 !important; }

/* Day detail popup */
[data-theme="dark"] .ac-day-detail {
    background: #fff !important;
    border-top-color: #e3eeff !important;
    color: #1a1a2e !important;
}


/* ============================================================
   v17 — CALENDAR FULL WHITE + ANALYTICS KPI TEXT FIX
   ============================================================ */

/* ══════════════════════════════════════════════════
   CALENDAR: Force every child element to white/light
   ══════════════════════════════════════════════════ */

/* The entire modal body is pure white */
[data-theme="dark"] .ac-modal-content,
[data-theme="dark"] .ac-modal-content * {
    background-color: transparent;
}

/* Re-apply modal content white base */
[data-theme="dark"] .ac-modal-content {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1a1a2e !important;
    border-radius: 16px !important;
    overflow: hidden !important;
}

/* Blue header — keep original gradient, perfect rounded top corners */
[data-theme="dark"] .ac-modal-header {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%) !important;
    border-radius: 16px 16px 0 0 !important;
    color: #fff !important;
}
[data-theme="dark"] .ac-modal-title-wrap h3 { color: #fff !important; }
[data-theme="dark"] .ac-modal-close {
    background: rgba(255,255,255,0.18) !important;
    color: #fff !important;
    border-radius: 50% !important;
}
[data-theme="dark"] .ac-modal-close:hover { background: rgba(255,255,255,0.32) !important; }

/* Nav row: white background */
[data-theme="dark"] .ac-nav {
    background: #ffffff !important;
}
[data-theme="dark"] .ac-nav-btn {
    background: #f0f4ff !important;
    color: #4a90e2 !important;
}
[data-theme="dark"] .ac-nav-btn:hover { background: #4a90e2 !important; color: #fff !important; }
[data-theme="dark"] .ac-month-label { color: #1e3a5f !important; }

/* Summary bar: white bg, colored cards */
[data-theme="dark"] .ac-summary {
    background: #ffffff !important;
}
[data-theme="dark"] .ac-summary-item {
    background: #f0f0f0 !important;
}
[data-theme="dark"] .ac-summary-item.ac-working {
    background: #e8f5e9 !important;
}
[data-theme="dark"] .ac-summary-item.ac-holiday {
    background: #fdecea !important;
}
[data-theme="dark"] .ac-summary-item.ac-working .ac-summary-num { color: #2e7d32 !important; }
[data-theme="dark"] .ac-summary-item.ac-holiday .ac-summary-num { color: #c62828 !important; }
[data-theme="dark"] .ac-summary-label { color: #555 !important; }

/* Legend row: white bg */
[data-theme="dark"] .ac-legend {
    background: #ffffff !important;
    color: #555 !important;
}

/* Calendar body: white */
[data-theme="dark"] .ac-body {
    background: #ffffff !important;
}

/* Day name headers */
[data-theme="dark"] .ac-cell.ac-hdr {
    background: transparent !important;
    color: #888 !important;
}

/* Empty cells */
[data-theme="dark"] .ac-cell.ac-empty {
    background: transparent !important;
}

/* Regular day cells — light gray bg with dark text */
[data-theme="dark"] .ac-cell.ac-day {
    background: #f8f9fa !important;
    color: #333 !important;
}
[data-theme="dark"] .ac-cell.ac-day:hover {
    background: #e3eeff !important;
    color: #333 !important;
}

/* Working day cell */
[data-theme="dark"] .ac-cell.ac-cell-working {
    background: #e8f5e9 !important;
}
/* Holiday cell */
[data-theme="dark"] .ac-cell.ac-cell-holiday {
    background: #fdecea !important;
}
/* Today cell */
[data-theme="dark"] .ac-cell.ac-cell-today {
    background: #e3eeff !important;
    outline: 2px solid #4a90e2 !important;
}

/* Day numbers */
[data-theme="dark"] .ac-day-num {
    color: #333 !important;
    background: transparent !important;
}
[data-theme="dark"] .ac-cell.ac-cell-holiday .ac-day-num { color: #c62828 !important; }
[data-theme="dark"] .ac-cell.ac-cell-working .ac-day-num { color: #2e7d32 !important; }
[data-theme="dark"] .ac-cell.ac-cell-today   .ac-day-num { color: #1565c0 !important; }

/* Day detail popup at bottom */
[data-theme="dark"] .ac-day-detail {
    background: #fff !important;
    border-top-color: #e3eeff !important;
    color: #1a1a2e !important;
}
[data-theme="dark"] .ac-day-detail-inner { background: #fff !important; color: #1a1a2e !important; }
[data-theme="dark"] .ac-day-detail-date { color: #1e3a5f !important; }
[data-theme="dark"] .ac-day-detail-status,
[data-theme="dark"] .ac-day-detail-reason,
[data-theme="dark"] .ac-day-detail-sem { color: #555 !important; }
[data-theme="dark"] .ac-day-detail-close {
    background: #f0f4ff !important;
    color: #4a90e2 !important;
}
[data-theme="dark"] .ac-day-detail-close:hover { background: #4a90e2 !important; color: #fff !important; }

/* ══════════════════════════════════════════════════
   ANALYTICS KPI: Remove dark box behind text
   The wildcard [class*="analytics-kpi"] was setting
   .analytics-kpi-value and .analytics-kpi-label bg
   to #222630, causing the "highlighted text" look
   ══════════════════════════════════════════════════ */

/* Reset the background on text elements inside KPI cards */
[data-theme="dark"] .analytics-kpi-value,
[data-theme="dark"] .analytics-kpi-label {
    background: transparent !important;
    background-color: transparent !important;
}

/* The KPI container colors — clean, no inner dark box */
[data-theme="dark"] .analytics-kpi.analytics-kpi--taken {
    background: rgba(192,57,43,0.22) !important;
    color: #f87171 !important;
    border: 1px solid rgba(248,113,113,0.25) !important;
}
[data-theme="dark"] .analytics-kpi.analytics-kpi--remaining {
    background: rgba(5,150,105,0.22) !important;
    color: #34d399 !important;
    border: 1px solid rgba(52,211,153,0.25) !important;
}
[data-theme="dark"] .analytics-kpi.analytics-kpi--avg {
    background: rgba(108,126,225,0.22) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(165,180,252,0.25) !important;
}
[data-theme="dark"] .analytics-kpi.analytics-kpi--projected {
    background: rgba(180,83,9,0.22) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(251,191,36,0.25) !important;
}

/* Force the wildcard to not touch value/label children */
[data-theme="dark"] [class*="analytics-kpi"] {
    background: transparent !important;
}
/* Re-apply only to the parent containers */
[data-theme="dark"] .analytics-kpi.analytics-kpi--taken    { background: rgba(192,57,43,0.22) !important; }
[data-theme="dark"] .analytics-kpi.analytics-kpi--remaining { background: rgba(5,150,105,0.22) !important; }
[data-theme="dark"] .analytics-kpi.analytics-kpi--avg       { background: rgba(108,126,225,0.22) !important; }
[data-theme="dark"] .analytics-kpi.analytics-kpi--projected { background: rgba(180,83,9,0.22) !important; }

/* ── Attendance card: visible blue border in dark mode (matches light theme) ── */
[data-theme="dark"] .stat-item.attendance-percentage,
[data-theme="dark"] .stats-card .stat-item.attendance-percentage {
    border: 2px solid #4a6cf7 !important;
    box-shadow: 0 0 0 1px rgba(74, 108, 247, 0.15) !important;
}
[data-theme="dark"] .stat-item.attendance-percentage:hover,
[data-theme="dark"] .stats-card .stat-item.attendance-percentage:hover {
    border-color: #6c7ee1 !important;
    box-shadow: 0 0 0 3px rgba(108, 126, 225, 0.18) !important;
}

/* ── Student Mobile Bottom Navigation Bar ── */
.student-mobile-bottom-nav {
    display: none;
}
@media (max-width: 768px) {
    .student-mobile-bottom-nav {
        display: flex;
        position: fixed;
        /* Always anchor to the absolute bottom edge — no gap */
        bottom: 0;
        left: 0;
        right: 0;
        /* Height = 60px nav + safe area for gesture bar (0 on most phones) */
        height: calc(52px + env(safe-area-inset-bottom, 0px));
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.10);
        z-index: 10000;
        align-items: stretch;
        justify-content: space-around;
        /* GPU compositing layer — prevents repaint jitter when
           Chrome's address bar shows/hides and resizes the visual viewport */
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        will-change: transform;
        transition: none !important;
    }
    [data-theme="dark"] .student-mobile-bottom-nav {
        background: #1e2330;
        border-top-color: #2d3448;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.35);
    }
    .student-bnav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        gap: 3px;
        cursor: pointer;
        color: #6b7280;
        background: none;
        border: none;
        /* Top padding normal; bottom padding absorbs safe area so icons
           stay centred in the visible 60px and the extra area is just bg */
        padding: 0 0 env(safe-area-inset-bottom, 0px);
        font-size: 11px;
        font-weight: 500;
        font-family: inherit;
        transition: color 0.15s, background 0.15s;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        text-decoration: none;
    }
    [data-theme="dark"] .student-bnav-item {
        color: #9ca3af;
    }
    .student-bnav-item svg {
        width: 24px;
        height: 24px;
        transition: transform 0.15s;
    }
    .student-bnav-item:hover,
    .student-bnav-item:active,
    .student-bnav-item.active {
        color: #4a90e2;
        background: rgba(74, 144, 226, 0.07);
    }
    .student-bnav-item:active svg {
        transform: scale(0.9);
    }
    /* Push page content above the nav */
    body {
        padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px));
    }
}

/* ══════════════════════════════════════════════════════════════════
   STUDENT DASHBOARD — UNIFIED SCROLLBAR STYLE
   Matches the thin elegant scrollbar in the Announcements modal
   (5px width, transparent track, soft rounded thumb).
   Applied to every scrollable container in the student dashboard.
   Firefox uses scrollbar-width/scrollbar-color (thin variant).
   Desktop and mobile both get the same treatment — on mobile the
   custom scrollbar only shows when actively scrolling anyway.
   ══════════════════════════════════════════════════════════════════ */

/* ── Webkit (Chrome / Edge / Safari / Android WebView) ── */
.history-list::-webkit-scrollbar,
.modal-overlay::-webkit-scrollbar,
.your-details-body::-webkit-scrollbar,
.settings-body::-webkit-scrollbar,
.ac-modal-scroll-body::-webkit-scrollbar,
.analytics-modal-overlay::-webkit-scrollbar,
.analytics-scroll-body::-webkit-scrollbar,
.ann-modal-body::-webkit-scrollbar,
#achievementsBody::-webkit-scrollbar,
.drawer-nav::-webkit-scrollbar,
.mobile-drawer::-webkit-scrollbar,
.qrs-body::-webkit-scrollbar,
.sqr-body::-webkit-scrollbar,
#qrs-myatt-table-wrap::-webkit-scrollbar {
    width: 5px;
    height: 5px; /* horizontal scrollbars if any */
}

.history-list::-webkit-scrollbar-track,
.modal-overlay::-webkit-scrollbar-track,
.your-details-body::-webkit-scrollbar-track,
.settings-body::-webkit-scrollbar-track,
.ac-modal-scroll-body::-webkit-scrollbar-track,
.analytics-modal-overlay::-webkit-scrollbar-track,
.analytics-scroll-body::-webkit-scrollbar-track,
.ann-modal-body::-webkit-scrollbar-track,
#achievementsBody::-webkit-scrollbar-track,
.drawer-nav::-webkit-scrollbar-track,
.mobile-drawer::-webkit-scrollbar-track,
.qrs-body::-webkit-scrollbar-track,
.sqr-body::-webkit-scrollbar-track,
#qrs-myatt-table-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb,
.modal-overlay::-webkit-scrollbar-thumb,
.your-details-body::-webkit-scrollbar-thumb,
.settings-body::-webkit-scrollbar-thumb,
.ac-modal-scroll-body::-webkit-scrollbar-thumb,
.analytics-modal-overlay::-webkit-scrollbar-thumb,
.analytics-scroll-body::-webkit-scrollbar-thumb,
.ann-modal-body::-webkit-scrollbar-thumb,
#achievementsBody::-webkit-scrollbar-thumb,
.drawer-nav::-webkit-scrollbar-thumb,
.mobile-drawer::-webkit-scrollbar-thumb,
.qrs-body::-webkit-scrollbar-thumb,
.sqr-body::-webkit-scrollbar-thumb,
#qrs-myatt-table-wrap::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover,
.modal-overlay::-webkit-scrollbar-thumb:hover,
.your-details-body::-webkit-scrollbar-thumb:hover,
.settings-body::-webkit-scrollbar-thumb:hover,
.ac-modal-scroll-body::-webkit-scrollbar-thumb:hover,
.analytics-modal-overlay::-webkit-scrollbar-thumb:hover,
.analytics-scroll-body::-webkit-scrollbar-thumb:hover,
.ann-modal-body::-webkit-scrollbar-thumb:hover,
#achievementsBody::-webkit-scrollbar-thumb:hover,
.drawer-nav::-webkit-scrollbar-thumb:hover,
.mobile-drawer::-webkit-scrollbar-thumb:hover,
.qrs-body::-webkit-scrollbar-thumb:hover,
.sqr-body::-webkit-scrollbar-thumb:hover,
#qrs-myatt-table-wrap::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ── Firefox ── */
.history-list,
.your-details-body,
.settings-body,
.ac-modal-scroll-body,
.analytics-scroll-body,
.ann-modal-body,
#achievementsBody,
.drawer-nav,
.mobile-drawer,
.qrs-body,
.sqr-body,
#qrs-myatt-table-wrap {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* ── Dark theme adjustments ── */
[data-theme="dark"] .history-list::-webkit-scrollbar-thumb,
[data-theme="dark"] .your-details-body::-webkit-scrollbar-thumb,
[data-theme="dark"] .settings-body::-webkit-scrollbar-thumb,
[data-theme="dark"] .ac-modal-scroll-body::-webkit-scrollbar-thumb,
[data-theme="dark"] .analytics-scroll-body::-webkit-scrollbar-thumb,
[data-theme="dark"] .ann-modal-body::-webkit-scrollbar-thumb,
[data-theme="dark"] #achievementsBody::-webkit-scrollbar-thumb,
[data-theme="dark"] .drawer-nav::-webkit-scrollbar-thumb,
[data-theme="dark"] .mobile-drawer::-webkit-scrollbar-thumb,
[data-theme="dark"] .qrs-body::-webkit-scrollbar-thumb,
[data-theme="dark"] .sqr-body::-webkit-scrollbar-thumb,
[data-theme="dark"] #qrs-myatt-table-wrap::-webkit-scrollbar-thumb {
    background: #3d4a5c;
}
[data-theme="dark"] .history-list::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .your-details-body::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .settings-body::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .ac-modal-scroll-body::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .analytics-scroll-body::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .ann-modal-body::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] #achievementsBody::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .drawer-nav::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .mobile-drawer::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .qrs-body::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .sqr-body::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] #qrs-myatt-table-wrap::-webkit-scrollbar-thumb:hover {
    background: #5a6e85;
}
[data-theme="dark"] .history-list,
[data-theme="dark"] .your-details-body,
[data-theme="dark"] .settings-body,
[data-theme="dark"] .ac-modal-scroll-body,
[data-theme="dark"] .analytics-scroll-body,
[data-theme="dark"] .ann-modal-body,
[data-theme="dark"] #achievementsBody,
[data-theme="dark"] .drawer-nav,
[data-theme="dark"] .mobile-drawer,
[data-theme="dark"] .qrs-body,
[data-theme="dark"] .sqr-body,
[data-theme="dark"] #qrs-myatt-table-wrap {
    scrollbar-color: #3d4a5c transparent;
}

/* ── Login / Register pages: eliminate dead scroll space on mobile ──
   display:block kills flex-container stretching — the root cause on Android Chrome */
@media (max-width: 600px) {
    body:has(.login-container) {
        display: block !important;
        min-height: unset !important;
        height: auto !important;
    }
    .login-container {
        display: block !important;
        min-height: unset !important;
        height: auto !important;
        padding: 24px 16px;
    }
}
