:root {
    --primary: #2563EB;
    --primary-light: #3B82F6;
    --primary-lighter: #DBEAFE;
    --secondary: #EC4899;
    --bg-color: #F1F5F9;
    --bg-white: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --card-bg: #FFFFFF;
    --card-border: #E2E8F0;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --input-bg: #F8FAFC;
    --input-border: #CBD5E1;
    --divider: #E2E8F0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background – light subtle gradient instead of blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(160deg, #EFF6FF 0%, #F1F5F9 40%, #FFF7ED 100%);
}

.blob {
    display: none; /* Hide blobs in light theme */
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    padding: 16px;
    gap: 16px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Glass Panel → Clean White Panel */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}

.glass-panel-inner {
    background: var(--input-bg);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--card-border);
}

/* Sidebar */
.sidebar {
    width: 260px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    padding: 0 8px;
}

.brand i {
    font-size: 26px;
    color: var(--primary);
}

.brand h2 {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

/* Nav Links (Desktop sidebar) */
.nav-links {
    /* Mobile: được style bình thường trong @media mobile — là bottom tab bar */
    /* Desktop: ẩn — dùng sidebar-nav-links */
    display: none;
    list-style: none;
}

/* Sidebar Navigation Links (Desktop only) */
.sidebar-nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-nav-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.sidebar-nav-links li a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-nav-links li:hover a {
    background: var(--primary-lighter);
    color: var(--primary);
}

.sidebar-nav-links li.active a {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}


.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px;
    background: var(--input-bg);
    border-radius: 12px;
    margin-top: auto;
    border: 1px solid var(--card-border);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 15px;
    color: white;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
}

.user-info .role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.greeting h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.greeting p {
    color: var(--text-muted);
    font-size: 14px;
}

.actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    background: var(--card-bg);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--primary-lighter);
    color: var(--primary);
    border-color: var(--primary-light);
}

/* Date Navigation */
.date-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.current-date {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    min-width: 150px;
    text-align: center;
}

.date-nav-btn {
    width: 34px;
    height: 34px;
    font-size: 13px;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    background: rgba(241, 245, 249, 0.85);
}

.login-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

.login-brand {
    justify-content: center;
    margin-bottom: 16px;
}

.login-card h3 {
    font-size: 22px;
    margin-bottom: 6px;
    color: var(--text-main);
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
}

.login-btn {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    align-items: start;
}

.class-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.class-item {
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.class-item:hover, .class-item.selected {
    background: var(--primary-lighter);
    border-color: var(--primary-light);
    transform: translateX(4px);
}

.class-item.selected {
    border-left: 3px solid var(--primary);
}

.class-item .period {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 4px;
}

.class-item .class-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.class-item .subject {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge.primary {
    background: var(--primary-lighter);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.badge-sm {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.badge-sm.success { background: #D1FAE5; color: #059669; }
.badge-sm.warning { background: #FEF3C7; color: #B45309; }

/* Main Class Card Details */
.class-details {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.class-icon {
    width: 38px;
    height: 38px;
    background: var(--primary-lighter);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: var(--primary);
}

.detail-item .label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.detail-item .value {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-main);
}

.lesson-info h4 {
    font-size: 17px;
    margin: 8px 0;
    color: var(--text-main);
}

.lesson-info .equipment {
    font-size: 13px;
    color: var(--text-muted);
}

.lesson-info .equipment i {
    margin-right: 6px;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.glass-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.glass-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: white;
}

.glass-input::placeholder {
    color: var(--text-light);
}

.score-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-input {
    width: 70px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
}

/* Textarea & Mic */
.textarea-wrapper {
    position: relative;
}

.textarea-wrapper textarea {
    resize: vertical;
    min-height: 100px;
}

.mic-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #FDF2F8;
    border: 1px solid #FBCFE8;
    color: var(--secondary);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mic-btn:hover {
    background: var(--secondary);
    color: white;
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.3);
    transform: scale(1.08);
}

.mic-btn.recording {
    animation: pulse 1.5s infinite;
    background: var(--secondary);
    color: white;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.5); }
    70% { box-shadow: 0 0 0 12px rgba(236, 72, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0); }
}

/* Remarks section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.glass-btn {
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
}

.glass-btn:hover {
    background: var(--primary-lighter);
    color: var(--primary);
    border-color: var(--primary-light);
}

.remark-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.remark-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--input-bg);
    border-radius: 10px;
    border-left: 3px solid transparent;
    border: 1px solid var(--card-border);
    border-left: 3px solid transparent;
}

.remark-item.good { border-left-color: var(--success); background: #F0FDF4; }
.remark-item.bad { border-left-color: var(--warning); background: #FFFBEB; }

.remark-item .student {
    font-weight: 600;
    font-size: 13px;
    min-width: 120px;
    color: var(--text-main);
}

.remark-item .desc {
    font-size: 13px;
    color: var(--text-muted);
}

/* Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--divider);
}

.btn-secondary {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-main);
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--primary-lighter);
    color: var(--primary);
    border-color: var(--primary-light);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    background: #1D4ED8;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE – Tablet (≤ 1024px)
   ═══════════════════════════════════════════════════════════════════ */
.mobile-back-btn {
    display: none !important;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .login-overlay {
        align-items: flex-start !important;
        padding-top: max(10px, env(safe-area-inset-top, 10px)) !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE – Mobile (≤ 768px) – Mobile-First PWA Optimizations
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── Body & Scrolling ── */
    html {
        /* Ngăn bounce scroll trên iOS Safari */
        overscroll-behavior-y: none;
        -webkit-text-size-adjust: 100%; /* Ngăn font tự resize khi landscape */
    }

    body {
        /* Safe area cho notch & home indicator */
        padding-bottom: env(safe-area-inset-bottom);
        overscroll-behavior: none;
        /* Tăng tốc scroll bằng GPU */
        -webkit-overflow-scrolling: touch;
    }

    /* ── App Container ── */
    .app-container {
        flex-direction: column;
        padding: 0;
        gap: 0;
    }

    /* ── Sidebar (desktop) → Ẩn hoàn toàn trên mobile ── */
    .sidebar {
        display: none;
    }

    /* ── Nav-links (bottom tab bar) → Hiện trên mobile ── */
    .nav-links {
        display: flex !important;
        flex-direction: row;
        justify-content: space-around;
        align-items: stretch;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-top: 1px solid var(--card-border);
        /* Safe area cho home indicator (iPhone X+) */
        padding-bottom: env(safe-area-inset-bottom, 8px);
        padding-top: 4px;
        margin: 0;
        z-index: 1500;
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
        gap: 0;
    }

    .nav-links li {
        flex: 1;
        text-align: center;
        position: relative;
    }

    .nav-links li a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 8px 4px;
        font-size: 10px;
        font-weight: 500;
        color: var(--text-muted);
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0;
        /* Touch target tối thiểu 44px */
        min-height: 48px;
        text-decoration: none;
        transition: color 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-links li a i {
        font-size: 20px;
        margin: 0;
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .nav-links li.active a {
        color: var(--primary);
        font-weight: 600;
    }

    .nav-links li.active a i {
        transform: scale(1.15);
    }

    /* Active indicator dot */
    .nav-links li.active::after {
        content: '';
        position: absolute;
        bottom: calc(env(safe-area-inset-bottom, 8px) + 2px);
        left: 50%;
        transform: translateX(-50%);
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background: var(--primary);
    }

    /* ── Main Content ── */
    .main-content {
        flex: 1;
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 8px));
        gap: 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* ── Topbar/Header ── */
    .topbar {
        padding: 12px 16px 8px;
        gap: 8px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        position: sticky;
        top: 0;
        z-index: 100;
        border-bottom: 1px solid var(--card-border);
        /* Safe area cho notch */
        padding-top: calc(12px + env(safe-area-inset-top, 0px));
    }

    .greeting h1,
    #teacherGreeting {
        font-size: 16px !important;
        font-weight: 700;
    }

    /* ── Teacher header row ── */
    .teacher-header-row {
        flex-wrap: nowrap !important;
        gap: 8px !important;
    }

    /* ── Actions buttons ── */
    .actions {
        gap: 6px;
    }

    .actions .btn-icon,
    .btn-icon {
        /* Touch target tối thiểu 44x44 */
        width: 44px !important;
        height: 44px !important;
        font-size: 15px;
        border-radius: 12px;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
        touch-action: manipulation;
    }

    /* ── Date Navigation ── */
    .date-navigation {
        margin-top: 8px;
        gap: 6px;
    }

    .date-nav-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 14px;
        border-radius: 10px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .date-input-wrapper {
        min-width: 0 !important;
        flex: 1;
        padding: 8px 12px !important;
        border-radius: 10px !important;
    }

    #dateDisplayLabel {
        font-size: 13px !important;
    }

    /* Lịch tuần button */
    #weeklyScheduleBtn {
        padding: 8px 10px !important;
        font-size: 12px !important;
        height: 40px !important;
        white-space: nowrap;
    }

    /* ── Mobile Back Button ── */
    .mobile-back-btn {
        display: inline-flex !important;
        width: 40px !important;
        height: 40px !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* ── Glass Cards ── */
    .glass-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 16px;
        box-shadow: none;
        border-bottom: 1px solid var(--card-border);
    }

    .glass-card:hover {
        transform: none;
        box-shadow: none;
    }

    /* ── Dashboard Grid / Panel Switcher ── */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .dashboard-grid.form-active .class-list-card {
        display: none !important;
    }

    .dashboard-grid.form-active .entry-form-card {
        display: block !important;
    }

    .dashboard-grid:not(.form-active) .entry-form-card {
        display: none !important;
    }

    .dashboard-grid:not(.form-active) .class-list-card {
        display: block !important;
    }

    /* ── Class List Items ── */
    .class-item {
        padding: 16px;
        border-radius: 12px;
        margin: 0 16px 8px;
        /* Ripple effect on tap */
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.08);
        touch-action: manipulation;
        cursor: pointer;
        /* Touch target: ít nhất 48px chiều cao */
        min-height: 72px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .class-item:hover,
    .class-item.selected {
        transform: none; /* Tắt slide-in trên mobile */
    }

    .class-item .class-name {
        font-size: 16px;
    }

    .class-item .subject {
        font-size: 14px;
    }

    /* ── Card header trong form ── */
    .card-header {
        margin-bottom: 12px;
    }

    .card-header h3 {
        font-size: 16px;
    }

    .class-list-card .card-header {
        padding: 0 16px;
        margin-bottom: 8px;
    }

    .class-list {
        gap: 0;
    }

    /* ── Class Details (Lớp + Môn) ── */
    .class-details {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
        margin-bottom: 16px;
        padding: 12px;
        background: var(--input-bg);
        border-radius: 12px;
    }

    .detail-item {
        gap: 8px;
    }

    .detail-item .value {
        font-size: 14px;
    }

    /* ── Forms ── */
    .form-group {
        margin-bottom: 14px;
    }

    .form-group label {
        font-size: 12px;
        font-weight: 600;
        margin-bottom: 6px;
    }

    .glass-input {
        padding: 14px 12px;
        font-size: 16px; /* Ngăn iOS zoom khi focus (tối thiểu 16px) */
        border-radius: 10px;
        touch-action: manipulation;
    }

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

    /* ── Điểm score inputs: dùng stepper UI thay vì type=number nhỏ ── */
    .form-row-scores {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 8px !important;
    }

    .score-input {
        font-size: 18px !important;
        padding: 12px 4px !important;
        text-align: center;
        font-weight: 700;
    }

    /* ── Textarea ── */
    .textarea-wrapper textarea {
        font-size: 16px; /* Ngăn iOS zoom */
        min-height: 90px;
    }

    /* ── Form Actions (nút Lưu/Ký) ── */
    .form-actions {
        flex-direction: row;
        gap: 10px;
        margin-top: 16px;
        padding-top: 12px;
        position: sticky;
        bottom: 0;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 100;
        padding-bottom: 8px;
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
        border-top: 1px solid var(--card-border);
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
        border-radius: 16px 16px 0 0;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 12px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        min-height: 48px;
    }

    /* ── Login Card ── */
    .login-overlay {
        align-items: flex-start !important; /* Đẩy sát lên đỉnh màn hình */
        padding: max(10px, env(safe-area-inset-top, 10px)) 16px 20px 16px !important; /* Sát đỉnh màn hình, chừa safe area cho notch/Dynamic Island */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .login-card {
        max-width: 100%;
        width: 100%;
        border-radius: 20px;
        border-bottom: 1px solid var(--card-border);
        padding: 20px 18px; /* Thu gọn padding để tiết kiệm diện tích chiều cao */
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
        margin-top: 0 !important;
    }

    .login-brand {
        margin-bottom: 10px !important;
    }

    .login-subtitle {
        margin-bottom: 14px !important;
    }

    /* Bỏ handle bar trên login card */
    .login-card::before {
        display: none;
    }

    .login-card h3 {
        font-size: 19px;
    }

    /* ── Dropdown Menu trên mobile (thả xuống ngay dưới icon ở topbar) ── */
    .glass-dropdown-menu {
        position: absolute !important;
        top: 38px !important;
        left: 0 !important;
        right: auto !important;
        bottom: auto !important;
        width: 280px !important;
        max-width: calc(100vw - 32px) !important;
        border-radius: 16px !important;
        max-height: 75vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
        z-index: 2000 !important;
        background: white !important;
    }

    .dropdown-item {
        padding: 14px 18px; /* Tăng touch target */
        font-size: 14px;
        min-height: 48px;
    }

    /* ── Modal Overlays → Bottom Sheet style ── */
    .modal-overlay {
        align-items: flex-end !important;
    }

    .modal-content,
    .glass-card.modal-card {
        border-radius: 20px 20px 0 0 !important;
        border-bottom: none;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Handle bar cho modals */
    .modal-content::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: var(--card-border);
        margin: 0 auto 16px;
    }

    /* ── Session Divider ── */
    .session-divider {
        margin: 8px 16px;
    }

    /* ── Toast / Reminder ── */
    #reminderToastContainer {
        bottom: calc(72px + env(safe-area-inset-bottom, 8px));
        right: 12px;
        left: 12px;
        max-width: 100%;
        width: auto;
    }

    .reminder-toast {
        border-radius: 14px;
        padding: 12px 16px;
    }

    /* ── Notification dropdown → full width ── */
    #notifPanel {
        position: fixed !important;
        top: auto !important;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-width: unset !important;
        border-radius: 16px !important;
        max-height: 70vh;
        overflow-y: auto;
    }

    /* ── Báo cáo / Report sections ── */
    .report-section {
        padding: 12px 0;
    }

    /* ── Weekly schedule table → horizontal scroll ── */
    .weekly-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
    }

    /* ── Số điểm badge ── */
    .score-badge-grid {
        gap: 6px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   PWA Standalone Mode Enhancements
   ═══════════════════════════════════════════════════════════════════ */
@media (display-mode: standalone) {
    /* Thêm safe area cho status bar */
    .topbar {
        padding-top: calc(12px + env(safe-area-inset-top, 24px));
    }

    /* Thêm padding bottom cho home indicator */
    .nav-links {
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 20px));
    }

    .main-content {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 20px));
    }

    /* Tắt text selection để trông như native app */
    .nav-links,
    .topbar,
    .class-item,
    .btn-primary,
    .btn-secondary,
    .btn-icon {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   Touch Optimizations (chạy trên cả tablet & mobile)
   ═══════════════════════════════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
    /* Tắt hover effects trên touchscreen */
    .glass-card:hover {
        transform: none;
        box-shadow: var(--card-shadow);
    }

    .class-item:hover {
        transform: none;
        background: var(--input-bg);
        border-color: var(--card-border);
    }

    /* Active state thay cho hover */
    .class-item:active {
        background: var(--primary-lighter);
        border-color: var(--primary-light);
        transform: scale(0.99);
        transition: transform 0.1s ease;
    }

    .btn-primary:active {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }

    .btn-secondary:active,
    .btn-icon:active,
    .glass-btn:active {
        transform: scale(0.96);
        opacity: 0.85;
        transition: transform 0.1s ease, opacity 0.1s ease;
    }

    .nav-links li a:active {
        opacity: 0.7;
        transition: opacity 0.1s ease;
    }

    /* Tắt tap highlight mặc định của browser */
    * {
        -webkit-tap-highlight-color: transparent;
    }

    /* Input focus: không zoom trên iOS (font-size >= 16px) */
    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    textarea,
    select {
        font-size: 16px;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   Landscape Mobile
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) and (orientation: landscape) {
    .main-content {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }

    .nav-links {
        padding-bottom: env(safe-area-inset-bottom, 4px);
    }

    .login-card {
        border-radius: 16px;
        margin: auto;
        max-height: 95vh;
        overflow-y: auto;
    }
}


.date-select option {
    background-color: white;
    color: var(--text-main);
}

.session-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent 0%, var(--primary-light) 30%, var(--primary-light) 70%, transparent 100%);
    margin: 16px 4px;
    opacity: 0.3;
}

/* Profile Dropdown Menu Styling */
.glass-dropdown-menu {
    display: none;
    position: absolute;
    top: 32px;
    left: 0;
    background: white !important;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 6px 0;
    z-index: 1100;
    min-width: 210px;
    overflow: visible !important;
    animation: fadeInSlide 0.2s ease-out;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--primary);
    font-size: 14px;
    transition: color 0.15s ease;
}

.dropdown-item:hover {
    background: var(--primary-lighter);
    color: var(--primary) !important;
}

.dropdown-item:hover i {
    color: var(--primary) !important;
}

/* --- Profile Dropdown Side Submenu (Side Flyout) Styling --- */
.dropdown-group-box {
    position: relative;
    margin: 4px 6px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.dropdown-group-box.group-hskt {
    border: 1px solid rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.04);
}
.dropdown-group-box.group-report {
    border: 1px solid rgba(16, 185, 129, 0.25);
    background: rgba(16, 185, 129, 0.04);
}
.dropdown-group-box.group-substitute {
    border: 1px solid rgba(37, 99, 235, 0.25);
    background: rgba(37, 99, 235, 0.04);
}

.dropdown-group-title {
    padding: 8px 12px;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    border-radius: 9px;
    transition: background 0.15s ease, color 0.15s ease;
}

.group-hskt .dropdown-group-title { color: #D97706; }
.group-report .dropdown-group-title { color: #059669; }
.group-substitute .dropdown-group-title { color: #2563EB; }

.dropdown-group-box:hover .dropdown-group-title {
    background: rgba(255, 255, 255, 0.7);
}

/* Side Flyout Position & Popup Effect */
.dropdown-side-submenu {
    display: none;
    position: absolute;
    top: -4px;
    left: calc(100% + 8px);
    min-width: 255px;
    background: #FFFFFF !important;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 0 0 6px 0;
    z-index: 1250;
    flex-direction: column;
    overflow: hidden;
}

/* Triangle indicator pointing left to the parent item */
.dropdown-side-submenu::before {
    content: '';
    position: absolute;
    top: 14px;
    left: -6px;
    width: 10px;
    height: 10px;
    background: white;
    border-left: 1px solid rgba(0, 0, 0, 0.12);
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    transform: rotate(45deg);
    z-index: 1;
}

@keyframes sideFlyoutIn {
    from {
        opacity: 0;
        transform: translateX(-10px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.dropdown-side-submenu.active,
.dropdown-side-submenu.show-flex {
    display: flex !important;
    animation: sideFlyoutIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Desktop Hover support for seamless opening */
@media (min-width: 769px) {
    .dropdown-group-box:hover .dropdown-side-submenu {
        display: flex !important;
        animation: sideFlyoutIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    .dropdown-group-box:hover .fa-chevron-right {
        transform: translateX(3px) !important;
    }
}

/* Submenu Headers */
.side-submenu-header {
    padding: 10px 14px 8px 14px;
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.side-submenu-header.amber-header { color: #D97706; background: rgba(245, 158, 11, 0.1); }
.side-submenu-header.emerald-header { color: #059669; background: rgba(16, 185, 129, 0.1); }
.side-submenu-header.blue-header { color: #2563EB; background: rgba(37, 99, 235, 0.1); }

.dropdown-side-submenu .dropdown-item {
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.15s ease;
}

.dropdown-side-submenu .dropdown-item:hover {
    background: var(--primary-lighter);
    color: var(--primary) !important;
}

.dropdown-side-submenu .disabled-bgh-item {
    opacity: 0.45;
    pointer-events: none;
}

.bgh-badge {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: auto;
    font-weight: 700;
}
.bgh-badge.green { background: rgba(16, 185, 129, 0.15); color: #059669; }
.bgh-badge.indigo { background: rgba(129, 140, 248, 0.15); color: #4F46E5; }

/* Responsive Mobile View (screen <= 768px) */
@media (max-width: 768px) {
    .dropdown-side-submenu {
        position: static !important;
        width: 100% !important;
        min-width: 100% !important;
        margin-top: 4px;
        box-shadow: none !important;
        border: 1px solid rgba(0, 0, 0, 0.08) !important;
        border-radius: 10px !important;
    }
    .dropdown-side-submenu::before {
        display: none !important;
    }
}

/* Login Tabs Styling */
.login-tab:hover {
    background: var(--primary-lighter) !important;
    color: var(--primary) !important;
}
.login-tab.active {
    background: var(--primary-lighter) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

/* Parent Portal Dashboard Styling */
.parent-container {
    animation: fadeIn 0.4s ease-out;
}

.weekly-diary-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.weekly-diary-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-light);
    box-shadow: var(--card-shadow-hover);
}

.weekly-diary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--divider);
    padding-bottom: 12px;
    margin-bottom: 4px;
}

.weekly-diary-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.weekly-diary-date {
    font-size: 12px;
    color: var(--text-muted);
}

.weekly-diary-section {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.weekly-diary-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.weekly-diary-icon.academic { color: #2563EB; background: #DBEAFE; }
.weekly-diary-icon.behavior { color: #059669; background: #D1FAE5; }
.weekly-diary-icon.attendance { color: #DB2777; background: #FCE7F3; }
.weekly-diary-icon.suggestions { color: #D97706; background: #FEF3C7; }

.weekly-diary-content {
    flex: 1;
}

.weekly-diary-content h5 {
    margin: 0 0 4px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.weekly-diary-content p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    font-style: italic;
}

.weekly-diary-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-top: 1px solid var(--divider);
    padding-top: 12px;
    margin-top: 4px;
}

.confirm-read-btn {
    background: #D1FAE5;
    border: 1px solid #6EE7B7;
    color: #059669;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.confirm-read-btn:hover {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.confirmed-badge {
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}




/* Toggle Switch Styles (ON/OFF) */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #CBD5E1;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 28px;
    border: 1px solid var(--card-border);
}
.slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.switch input:checked + .slider {
    background-color: var(--primary) !important;
    border-color: var(--primary-light);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}
.switch input:checked + .slider::before {
    transform: translateX(24px);
}


/* Notification Item Card */
.notif-card {
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}
.notif-card.unread {
    background: #EFF6FF;
    border-color: #93C5FD;
}
.notif-card .notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sender-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}
.sender-tag.principal {
    background: #FEE2E2;
    color: #DC2626;
}
.sender-tag.subject_leader {
    background: #FEF3C7;
    color: #D97706;
}
.sender-tag.admin {
    background: #E0E7FF;
    color: #4338CA;
}

/* Toast Reminders Container */
#reminderToastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    width: calc(100% - 48px);
    pointer-events: none;
}
.reminder-toast {
    pointer-events: auto;
    background: white;
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-left: 5px solid var(--primary);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
}
.reminder-toast.warning {
    border-left-color: #F59E0B;
}
.reminder-toast.info {
    border-left-color: #2563EB;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ═══════════════════════════════════════════════════════════════════
   PWA Installation Banner Styling
   ═══════════════════════════════════════════════════════════════════ */
.pwa-install-banner {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 500px;
    z-index: 2500;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--primary-light);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.2);
    animation: slideDownBanner 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideDownBanner {
    from {
        opacity: 0;
        transform: translate(-50%, -24px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-lighter);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.pwa-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pwa-banner-text strong {
    font-size: 13.5px;
    color: var(--text-main);
    font-weight: 700;
}

.pwa-banner-text span {
    font-size: 11.5px;
    color: var(--text-muted);
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Admin Panel Glassmorphism Enhancements */
.admin-tab-btn {
    transition: all 0.2s ease-in-out;
}
.admin-tab-btn:hover {
    color: #F8FAFC !important;
    background: rgba(255, 255, 255, 0.08) !important;
}
.admin-tab-btn.active {
    color: #F59E0B !important;
    background: rgba(245, 158, 11, 0.15) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}
#adminTableBody tr {
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#adminTableBody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* Dedicated Admin Dashboard Layout */
.admin-container {
    width: 100%;
    min-height: 100vh;
}

#adminSidebar .sidebar-nav-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

#adminSidebar .sidebar-nav-links li:hover a {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
}

#adminSidebar .sidebar-nav-links li.active a {
    color: #F59E0B;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-weight: 600;
}

#adminSidebar .sidebar-nav-links li.active a i {
    color: #F59E0B;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE ADMIN PORTAL FOR MOBILE (≤ 768px)
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* 1. Admin Container stack vertically */
    .admin-container#adminContainer {
        flex-direction: column !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow-x: hidden !important;
    }

    /* 2. Admin Sidebar transforms into top sticky horizontal tab bar */
    .admin-container #adminSidebar.sidebar {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        min-width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        position: sticky !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 1200 !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
        border-radius: 0 0 16px 16px !important;
        padding: 10px 12px 6px 12px !important;
        background: rgba(15, 23, 42, 0.95) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    }

    /* Compact brand and hide profile card on mobile */
    .admin-container #adminSidebar .brand {
        margin-bottom: 6px !important;
        padding-bottom: 4px !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    }
    .admin-container #adminSidebar .brand h2 {
        font-size: 15px !important;
        margin: 0 !important;
    }
    .admin-container #adminSidebar .user-profile {
        display: none !important;
    }

    /* 3. Horizontal Scrollable Nav Links */
    .admin-container #adminSidebar .sidebar-nav-links {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap !important;
        gap: 8px !important;
        width: 100% !important;
        padding: 4px 2px 8px 2px !important;
        margin: 0 !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important; /* Firefox */
    }
    .admin-container #adminSidebar .sidebar-nav-links::-webkit-scrollbar {
        display: none !important; /* Chrome/Safari */
    }

    .admin-container #adminSidebar .sidebar-nav-links li {
        flex-shrink: 0 !important;
        list-style: none !important;
        margin: 0 !important;
    }

    .admin-container #adminSidebar .sidebar-nav-links li a {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 8px 14px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        border-radius: 20px !important;
        background: rgba(30, 41, 59, 0.8) !important;
        color: #94A3B8 !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        white-space: nowrap !important;
        touch-action: manipulation !important;
        transition: all 0.2s ease !important;
    }

    .admin-container #adminSidebar .sidebar-nav-links li.active a {
        background: linear-gradient(135deg, #F59E0B, #D97706) !important;
        color: #FFFFFF !important;
        border-color: #F59E0B !important;
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35) !important;
    }
    .admin-container #adminSidebar .sidebar-nav-links li.active a i {
        color: #FFFFFF !important;
    }

    /* 4. Main Workspace Mobile Adjustments */
    .admin-container .main-content {
        padding: 12px 10px 80px 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .admin-container .topbar {
        margin-bottom: 12px !important;
        padding: 6px 0 !important;
    }

    .admin-container .topbar h1 {
        font-size: 16px !important;
    }

    #adminSearchGroup {
        width: 100% !important;
        min-width: 100% !important;
    }
    #adminAddBtn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   EQUIPMENT BORROW MODAL RESPONSIVE (MOBILE OPTIMIZATIONS)
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    #equipmentBorrowModal .glass-card {
        width: 98% !important;
        max-height: 96vh !important;
        border-radius: 12px !important;
    }

    .eb-controls-toolbar {
        padding: 10px 14px !important;
        gap: 10px !important;
    }

    .eb-filters-group {
        width: 100% !important;
        gap: 10px !important;
    }

    .eb-filters-group > div {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    #ebWeekSelect, #ebTeacherSelect {
        width: 100% !important;
        min-width: 100% !important;
        height: 38px !important;
        font-size: 13px !important;
    }

    .eb-action-buttons-group {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        gap: 8px !important;
        margin-top: 4px !important;
    }

    .eb-action-buttons-group .eb-btn {
        flex: 1 1 calc(50% - 6px) !important;
        min-width: calc(50% - 6px) !important;
        max-width: calc(50% - 6px) !important;
        height: 36px !important;
        font-size: 12px !important;
        padding: 0 6px !important;
        justify-content: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        box-sizing: border-box !important;
    }
}

/* Duty Management Modal Tabs & Inactive Menu State */
.duty-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--card-border);
    margin-bottom: 12px;
}

.duty-tab-btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px 8px 0 0;
}

.duty-tab-btn:hover {
    color: var(--primary);
    background: var(--input-bg);
}

.duty-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--primary-lighter);
}

.dropdown-item.inactive-duty, .nav-btn.inactive-duty {
    opacity: 0.55;
    cursor: not-allowed !important;
    background-color: #F1F5F9 !important;
    color: #94A3B8 !important;
    position: relative;
    pointer-events: auto !important;
}

.dropdown-item.inactive-duty i, .nav-btn.inactive-duty i {
    color: #94A3B8 !important;
}


.dropdown-item.inactive-duty::after {
    content: " 🔒";
    font-size: 12px;
    margin-left: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   PWA Auto Update Banner Styling
   ═══════════════════════════════════════════════════════════════════ */
.pwa-update-banner {
    position: fixed !important;
    top: 12px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 24px) !important;
    max-width: 520px !important;
    z-index: 999999 !important;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98)) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(59, 130, 246, 0.5) !important;
    border-radius: 16px !important;
    padding: 12px 16px !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 20px rgba(59, 130, 246, 0.2) !important;
    animation: slideDownBanner 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box !important;
    margin: 0 !important;
}

.pwa-banner-content {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    width: 100% !important;
}

.pwa-banner-icon {
    width: 38px !important;
    height: 38px !important;
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60A5FA !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    flex-shrink: 0 !important;
}

.pwa-banner-text {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}

.pwa-banner-text strong {
    display: block !important;
    font-size: 14px !important;
    color: #F8FAFC !important;
    font-weight: 700 !important;
}

.pwa-banner-text span {
    font-size: 12px !important;
    color: #94A3B8 !important;
}

.pwa-banner-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
}

.pulse-icon i {
    animation: spinPulse 2s infinite linear;
}

@keyframes spinPulse {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideDownBanner {
    from {
        transform: translate(-50%, -20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}






