/* ==========================================================================
   vnEdu Smart Sync - Design System & Modern CSS
   Author: Antigravity AI
   ========================================================================== */

:root,
html[data-theme-style="emerald"] {
    /* Professional Typography System: Be Vietnam Pro + Plus Jakarta Sans + JetBrains Mono */
    --font-sans: 'Be Vietnam Pro', 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Be Vietnam Pro', var(--font-sans);
    --font-display: 'Plus Jakarta Sans', var(--font-sans);
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    
    /* Style 1: Xanh Ngọc Sư Phạm (Emerald & Mint Teal - Dịu Mắt, Tươi Mới, Giáo Dục) */
    --primary-50: #ECFDF5;
    --primary-100: #D1FAE5;
    --primary-200: #A7F3D0;
    --primary-500: #10B981;
    --primary-600: #059669;
    --primary-700: #047857;
    --primary-800: #065F46;
    --primary-900: #064E3B;
    --primary-shadow: rgba(5, 150, 105, 0.32);
    --header-gradient: linear-gradient(135deg, #064E3B 0%, #065F46 45%, #047857 100%);
    --header-shadow: 0 4px 20px rgba(6, 78, 59, 0.3);

    /* Accent: Electric Emerald */
    --accent-50: #ECFDF5;
    --accent-100: #D1FAE5;
    --accent-500: #10B981;
    --accent-600: #059669;
    --accent-700: #047857;

    /* Warning / Amber */
    --amber-50: #FFFBEB;
    --amber-100: #FEF3C7;
    --amber-500: #F59E0B;
    --amber-600: #D97706;

    /* Slate Neutral Grayscale */
    --slate-50: #F8FAFC;
    --slate-100: #F1F5F9;
    --slate-200: #E2E8F0;
    --slate-300: #CBD5E1;
    --slate-400: #94A3B8;
    --slate-500: #64748B;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1E293B;
    --slate-900: #0F172A;

    /* Semantic Classes */
    --class-7a2: #0D9488;
    --class-7a3: #7C3AED;
    --class-9a2: #2563EB;

    /* Shadows & Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 6px -1px rgba(0, 0, 0, 0.07), 0 1px 3px -1px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.1), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
    --shadow-xl: 0 20px 35px -5px rgba(15, 23, 42, 0.15), 0 8px 16px -4px rgba(15, 23, 42, 0.08);

    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Style 2: Xanh Biển vnEdu (Ocean Blue - Chính quy, quen thuộc cổng vnEdu) */
html[data-theme-style="ocean"] {
    --primary-50: #EFF6FF;
    --primary-100: #DBEAFE;
    --primary-200: #BFDBFE;
    --primary-500: #3B82F6;
    --primary-600: #2563EB;
    --primary-700: #1D4ED8;
    --primary-800: #1E40AF;
    --primary-900: #0F172A;
    --primary-shadow: rgba(37, 99, 235, 0.35);
    --header-gradient: linear-gradient(135deg, #0F172A 0%, #1E3A8A 45%, #1D4ED8 100%);
    --header-shadow: 0 4px 20px rgba(15, 23, 42, 0.3);
}

/* Style 3: Sổ Tay Giáo Viên Ấm Áp (Warm Minimalist / Paper Notion - Dịu nhẹ, thanh lịch) */
html[data-theme-style="warm"] {
    --primary-50: #FFFBEB;
    --primary-100: #FEF3C7;
    --primary-200: #FDE68A;
    --primary-500: #D97706;
    --primary-600: #B45309;
    --primary-700: #92400E;
    --primary-800: #78350F;
    --primary-900: #1C1917;
    --primary-shadow: rgba(180, 83, 9, 0.35);
    --header-gradient: linear-gradient(135deg, #1C1917 0%, #292524 45%, #44403C 100%);
    --header-shadow: 0 4px 20px rgba(28, 25, 23, 0.3);
}

/* Style 4: Tím Công Nghệ Hiện Đại (Modern Indigo - Phong cách gốc) */
html[data-theme-style="indigo"] {
    --primary-50: #EEF2FF;
    --primary-100: #E0E7FF;
    --primary-200: #C7D2FE;
    --primary-500: #6366F1;
    --primary-600: #4F46E5;
    --primary-700: #4338CA;
    --primary-800: #3730A3;
    --primary-900: #1E1B4B;
    --primary-shadow: rgba(79, 70, 229, 0.35);
    --header-gradient: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #4338CA 100%);
    --header-shadow: 0 4px 20px rgba(30, 27, 75, 0.25);
}

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

body {
    font-family: var(--font-sans);
    font-feature-settings: "cv02", "cv03", "cv04", "cv11", "calt", "liga";
    font-variant-numeric: tabular-nums;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--slate-50);
    color: var(--slate-800);
    min-height: 100vh;
    line-height: 1.5;
    text-align: start;
    overflow-wrap: break-word;
}

h1, h2, h3, .brand-title, .day-name, .banner-title, .modal-title {
    font-family: var(--font-heading);
    letter-spacing: -0.022em;
    text-wrap: balance;
    font-weight: 700;
}

p, .banner-desc, .lesson-name {
    text-wrap: pretty;
    max-width: 80ch;
}

/* ==========================================================================
   Header Layout
   ========================================================================== */
.app-header {
    background: var(--header-gradient, linear-gradient(135deg, var(--primary-900) 0%, var(--primary-800) 50%, var(--primary-700) 100%));
    color: #FFFFFF;
    padding: 16px 24px;
    box-shadow: var(--header-shadow, 0 4px 20px rgba(30, 27, 75, 0.25));
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #FFFFFF, var(--primary-100));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 0.8rem;
    color: var(--primary-200);
    font-weight: 500;
    display: block;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.teacher-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 6px 14px 6px 8px;
    border-radius: var(--radius-full);
}

.teacher-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F43F5E, #FB7185);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(244, 63, 94, 0.4);
}

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

.teacher-name {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: #FFFFFF;
}

.teacher-id {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--primary-200);
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.02em;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-500);
    box-shadow: 0 0 8px var(--accent-500);
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: #FFFFFF;
    box-shadow: 0 4px 12px var(--primary-shadow, rgba(37, 99, 235, 0.35));
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    box-shadow: 0 6px 16px var(--primary-shadow, rgba(37, 99, 235, 0.45));
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-accent:hover:not(:disabled) {
    background: linear-gradient(135deg, #34D399, var(--accent-500));
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}

.btn-warning {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #FBBF24, #D97706);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45);
    transform: translateY(-1px);
}

.btn-outline {
    background: #FFFFFF;
    color: var(--slate-700);
    border: 1px solid var(--slate-300);
    box-shadow: var(--shadow-xs);
}

.btn-outline:hover:not(:disabled) {
    background: var(--slate-100);
    border-color: var(--slate-400);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.22);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
    max-width: 1400px;
    margin: 12px auto;
    padding: 0 18px;
}

/* Control Panel (1 dòng siêu tinh gọn, loại bỏ hoàn toàn duplicate) */
.control-panel {
    background: #FFFFFF;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 9px 15px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    margin-bottom: 10px;
}

.control-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

.control-top-bar .btn {
    padding: 6px 13px;
    font-size: 0.8rem;
    gap: 6px;
    border-radius: var(--radius-full);
}

.control-source-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Bộ Hiển Thị & Chuyển Tuần Nhanh (1 Dòng Thanh Lịch) */
.week-quick-stepper {
    display: inline-flex;
    align-items: center;
    background: var(--slate-100);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-week-step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #FFFFFF;
    color: var(--slate-600);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-week-step:hover:not(:disabled) {
    background: var(--primary-50);
    color: var(--primary-600);
    transform: scale(1.05);
}

.btn-week-step:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.week-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: none;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.week-badge-btn:hover {
    background: rgba(255, 255, 255, 0.6);
}

.week-badge-title {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--slate-800);
    letter-spacing: -0.01em;
}

.week-sem-pill {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: var(--primary-100);
    color: var(--primary-700);
}

[data-theme="dark"] .week-quick-stepper {
    background: #0F172A;
    border-color: #1F2937;
}

[data-theme="dark"] .btn-week-step {
    background: #1E293B;
    color: #94A3B8;
}

[data-theme="dark"] .btn-week-step:hover:not(:disabled) {
    background: #334155;
    color: #F8FAFC;
}

[data-theme="dark"] .week-badge-title {
    color: #F1F5F9;
}

[data-theme="dark"] .week-sem-pill {
    background: rgba(99, 102, 241, 0.25);
    color: #A5B4FC;
}

.panel-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-refresh-compact {
    padding: 6px 11px !important;
}

[data-theme="dark"] .control-nav-bar {
    border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .nav-bar-divider {
    background: rgba(255, 255, 255, 0.12);
}

.file-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--slate-100);
    color: var(--slate-700);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--slate-200);
    white-space: nowrap;
    max-width: 100%;
}

#fileNameLabel {
    display: inline-block;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.btn-change-file, .btn-reset-file {
    background: #FFFFFF;
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-sm);
    padding: 3px 9px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-600);
    cursor: pointer;
    margin-left: 8px;
    transition: var(--transition);
}

.btn-change-file:hover {
    background: var(--primary-50);
    border-color: var(--primary-500);
}

.btn-reset-file {
    color: var(--slate-500);
}

.btn-reset-file:hover {
    background: var(--slate-100);
    color: var(--slate-700);
}

/* Source Mode Switcher (Cấp độ 2: vnEdu Trực tiếp vs Cấp độ 1: File Excel Dự phòng) */
.source-mode-switch {
    display: inline-flex;
    align-items: center;
    background: var(--slate-100);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 3px;
    white-space: nowrap;
    box-shadow: var(--shadow-xs);
    position: relative;
}

.source-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--slate-600);
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: -0.01em;
}

.source-btn:hover:not(.active) {
    color: var(--slate-900);
    background: rgba(255, 255, 255, 0.7);
}

.source-btn.active[data-source="vnedu"] {
    background: linear-gradient(135deg, #10B981, #059669);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.source-btn.active[data-source="excel"] {
    background: linear-gradient(135deg, #4F46E5, #4338CA);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

/* Chấm xanh nhấp nháy cho nguồn vnEdu Online Trực tiếp */
.source-live-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34D399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
    display: inline-block;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(52, 211, 153, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    }
}

[data-theme="dark"] .source-mode-switch {
    background: #0F172A;
    border-color: #1F2937;
}

[data-theme="dark"] .source-btn {
    color: #94A3B8;
}

[data-theme="dark"] .source-btn:hover:not(.active) {
    color: #F8FAFC;
    background: rgba(30, 41, 59, 0.6);
}

[data-theme="dark"] .source-btn.active[data-source="vnedu"] {
    background: linear-gradient(135deg, #059669, #047857);
    color: #ECFDF5;
    box-shadow: 0 2px 10px rgba(5, 150, 105, 0.4);
}

[data-theme="dark"] .source-btn.active[data-source="excel"] {
    background: linear-gradient(135deg, #4338CA, #3730A3);
    color: #EEF2FF;
    box-shadow: 0 2px 10px rgba(67, 56, 202, 0.4);
}

/* Badge Nguồn trên thanh tiêu đề tuần */
.badge-source-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
}

.badge-source-tag.tag-vnedu {
    background: rgba(16, 185, 129, 0.15);
    color: #065F46;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-source-tag.tag-excel {
    background: rgba(99, 102, 241, 0.12);
    color: #3730A3;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .badge-source-tag.tag-vnedu {
    background: rgba(16, 185, 129, 0.25);
    color: #6EE7B7;
    border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .badge-source-tag.tag-excel {
    background: rgba(99, 102, 241, 0.25);
    color: #A5B4FC;
    border-color: rgba(99, 102, 241, 0.4);
}

/* Semester Switch (Quản trị Học kỳ I & II cả năm học) */
.semester-switch {
    display: inline-flex;
    align-items: center;
    background: var(--slate-100);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.sem-btn {
    padding: 5px 12px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--slate-600);
    cursor: pointer;
    transition: var(--transition);
}

.sem-btn:hover {
    color: var(--slate-800);
}

.sem-btn.active {
    background: #FFFFFF;
    color: var(--primary-600);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .semester-switch {
    background: #0F172A;
    border-color: #1F2937;
}

[data-theme="dark"] .sem-btn {
    color: #94A3B8;
}

[data-theme="dark"] .sem-btn.active {
    background: #1E293B;
    color: #818CF8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.weeks-scroller-container {
    overflow-x: auto;
    flex: 1;
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--slate-300) transparent;
}
.weeks-scroller-container::-webkit-scrollbar {
    height: 4px;
}
.weeks-scroller-container::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 4px;
}
[data-theme="dark"] .weeks-scroller-container::-webkit-scrollbar-thumb {
    background: #334155;
}

.weeks-scroller {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Week Tabs - Phân loại màu sắc trực quan công thái học */
.week-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: var(--radius-full);
    border: 1px solid var(--slate-200);
    background: #FFFFFF;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--slate-700);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    position: relative;
}

.week-tab:hover:not(.disabled) {
    background: var(--slate-100);
    border-color: var(--slate-300);
    transform: translateY(-1px);
}

/* 1. Tuần ĐANG CHỌN (Active) - Ưu tiên cao nhất */
.week-tab.active {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700)) !important;
    color: #FFFFFF !important;
    border-color: var(--primary-600) !important;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.4) !important;
    font-weight: 700;
}
.week-tab.active .week-status-tag {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #FFFFFF !important;
}

/* 2. Tuần HIỆN TẠI (Đang diễn ra - Tuần 8) */
.week-tab.week-current:not(.active) {
    border: 1.5px solid #10B981;
    background: rgba(16, 185, 129, 0.07);
    color: #047857;
    font-weight: 700;
}

.week-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 6px #10B981;
    display: inline-block;
    animation: livePulse 2s infinite;
}

/* 3. Tuần SẮP BƯỚC QUA (Tuần 9 kế tiếp) */
.week-tab.week-next:not(.active) {
    border: 1.5px solid #F59E0B;
    background: rgba(245, 158, 11, 0.08);
    color: #B45309;
    font-weight: 700;
}

/* 4. Tuần TƯƠNG LAI ĐÃ CÓ LỊCH (Tuần 10, 11...) */
.week-tab.week-future-ready:not(.active) {
    border: 1px solid #818CF8;
    background: rgba(99, 102, 241, 0.05);
    color: #4F46E5;
}

/* 5. Tuần CHƯA CÓ DATA (Ẩn màu nền, mờ nhạt, không bấm được) */
.week-tab.week-no-data {
    background: transparent !important;
    border: 1px dashed var(--slate-300) !important;
    color: var(--slate-400) !important;
    opacity: 0.42;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Status tags hiển thị bên trong ô Tuần */
.week-status-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.week-status-tag.tag-current {
    background: rgba(16, 185, 129, 0.16);
    color: #065F46;
}

.week-status-tag.tag-next {
    background: rgba(245, 158, 11, 0.2);
    color: #92400E;
}

.week-status-tag.tag-ready {
    background: rgba(99, 102, 241, 0.15);
    color: #3730A3;
}

/* Nút Học kỳ II khi bị khóa */
.sem-btn.sem-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    color: var(--slate-400);
}
.sem-btn.sem-disabled:hover {
    color: var(--slate-400);
    background: transparent;
}

/* Dark theme overrides */
[data-theme="dark"] .week-tab {
    background: #111827;
    border-color: #1F2937;
    color: #E2E8F0;
}
[data-theme="dark"] .week-tab:hover:not(.disabled) {
    background: #1E293B;
}
[data-theme="dark"] .week-tab.week-current:not(.active) {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.12);
    color: #6EE7B7;
}
[data-theme="dark"] .week-tab.week-next:not(.active) {
    border-color: #F59E0B;
    background: rgba(245, 158, 11, 0.12);
    color: #FCD34D;
}
[data-theme="dark"] .week-tab.week-future-ready:not(.active) {
    border-color: #6366F1;
    background: rgba(99, 102, 241, 0.12);
    color: #A5B4FC;
}
[data-theme="dark"] .week-tab.week-no-data {
    border-color: #374151 !important;
    color: #64748B !important;
}
[data-theme="dark"] .week-status-tag.tag-current {
    background: rgba(16, 185, 129, 0.25);
    color: #6EE7B7;
}
[data-theme="dark"] .week-status-tag.tag-next {
    background: rgba(245, 158, 11, 0.25);
    color: #FCD34D;
}
[data-theme="dark"] .week-status-tag.tag-ready {
    background: rgba(99, 102, 241, 0.25);
    color: #A5B4FC;
}
[data-theme="dark"] .sem-btn.sem-disabled {
    color: #64748B;
}

.panel-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==========================================================================
   Compact Status & Metrics Bar (1 dòng siêu tinh gọn, tiết kiệm 160px chiều cao)
   ========================================================================== */
.compact-metrics-bar {
    background: #FFFFFF;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 7px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: var(--transition);
}

.metrics-summary-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.mini-banner-icon {
    font-size: 1.15rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.summary-text-group {
    display: flex;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.summary-main-text {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--slate-800);
}

.summary-main-text strong {
    color: var(--accent-600);
    font-weight: 800;
}

.summary-sub-text {
    font-size: 0.78rem;
    color: var(--slate-500);
    font-weight: 500;
}

.metrics-badges-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.2;
    transition: all 0.2s ease;
}

.stat-pill-icon {
    font-size: 0.8rem;
    line-height: 1;
}

.stat-pill-label {
    color: var(--slate-600);
}

.stat-pill-val {
    font-family: var(--font-display);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.stat-ready {
    background: #FEF3C7;
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #92400E;
}
.stat-ready .stat-pill-label {
    color: #92400E;
}
.stat-ready .stat-pill-val {
    color: #B45309;
}

.stat-future {
    background: var(--slate-100);
    border: 1px solid var(--slate-200);
    color: var(--slate-600);
}

.mini-progress-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px 2px 5px;
    border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--primary-700);
    font-weight: 700;
    font-size: 0.78rem;
}

.mini-progress-ring {
    transform: rotate(-90deg);
}

.progress-pct-val {
    font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
}

/* Dark Theme Overrides for Compact Metrics Bar */
[data-theme="dark"] .compact-metrics-bar {
    background: #111827;
    border-color: #1F2937;
}
[data-theme="dark"] .summary-main-text {
    color: #F3F4F6;
}
[data-theme="dark"] .summary-sub-text {
    color: #9CA3AF;
}
[data-theme="dark"] .stat-ready {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #FCD34D;
}
[data-theme="dark"] .stat-ready .stat-pill-label,
[data-theme="dark"] .stat-ready .stat-pill-val {
    color: #FCD34D;
}
[data-theme="dark"] .stat-future {
    background: #1F2937;
    border-color: #374151;
    color: #9CA3AF;
}
[data-theme="dark"] .stat-future .stat-pill-label {
    color: #9CA3AF;
}
[data-theme="dark"] .mini-progress-pill {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #A5B4FC;
}

/* ==========================================================================
   Filter Toolbar
   ========================================================================== */
.filter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chips {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-chip {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--slate-200);
    background: #FFFFFF;
    color: var(--slate-600);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-chip:hover {
    border-color: var(--slate-300);
}

.filter-chip.active {
    background: var(--slate-800);
    color: #FFFFFF;
    border-color: var(--slate-800);
}

.week-daterange {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--slate-600);
    background: var(--slate-100);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   Schedule Grid & Day Cards
   ========================================================================== */
.schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.day-section {
    background: #FFFFFF;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.day-section:hover {
    box-shadow: var(--shadow-md);
}

.day-header {
    background: linear-gradient(to right, var(--slate-100), #FFFFFF);
    border-bottom: 1px solid var(--slate-200);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.day-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.day-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--slate-800);
}

.day-date {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--slate-500);
    background: #FFFFFF;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--slate-200);
}

.day-tag-today {
    background: var(--accent-100);
    color: var(--accent-700);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* Slots List within Day */
.slots-table {
    width: 100%;
    border-collapse: collapse;
}

.slots-table th {
    background: var(--slate-50);
    text-align: left;
    padding: 11px 18px;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--slate-200);
    text-wrap: balance;
}

.slots-table td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--slate-100);
    font-size: 0.85rem;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

.slots-table tr:last-child td {
    border-bottom: none;
}

.slots-table tr:hover td {
    background: #FAF5FF;
}

.period-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.session-tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.session-morning { background: #FEF3C7; color: #B45309; }
.session-afternoon { background: #E0E7FF; color: #3730A3; }

.class-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: #FFFFFF;
}

.class-7A2AL { background-color: var(--class-7a2); }
.class-7A3AL { background-color: var(--class-7a3); }
.class-9A2AL { background-color: var(--class-9a2); }

.subject-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--slate-800);
    letter-spacing: -0.01em;
}

.ppct-pill {
    display: inline-block;
    background: var(--slate-100);
    color: var(--slate-600);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    margin-left: 6px;
    letter-spacing: -0.01em;
}

.lesson-name {
    color: var(--slate-700);
    font-weight: 500;
    font-size: 0.84rem;
    max-width: 320px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    text-wrap: pretty;
}

/* Custom Remark Combobox with Dropdown Trigger */
.remark-combobox {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.remark-combobox .remark-input,
.remark-input {
    width: 100%;
    padding: 7px 30px 7px 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--slate-200);
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--slate-700);
    background: #FFFFFF;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.2s;
    cursor: text;
}

.remark-combobox .remark-input:focus,
.remark-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.remark-combobox .btn-remark-dropdown {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--slate-400);
    border-radius: 4px;
    transition: all 0.15s ease;
}

.remark-combobox .btn-remark-dropdown svg {
    pointer-events: none;
}

.remark-combobox .btn-remark-dropdown:hover {
    color: var(--primary-600);
    background: rgba(99, 102, 241, 0.1);
}

@keyframes remarkFlash {
    0% { background-color: rgba(16, 185, 129, 0.25); border-color: #10B981; }
    100% { background-color: transparent; }
}

.remark-highlight-flash {
    animation: remarkFlash 0.7s ease-out;
}

/* Attendance Pill & Badges */
.attendance-pill {
    margin-top: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.3;
    max-width: 155px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.15s ease;
    user-select: none;
}

.attendance-pill.attendance-full {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.attendance-pill.attendance-full:hover {
    background: rgba(16, 185, 129, 0.18);
    transform: translateY(-1px);
}

.attendance-pill.attendance-absent {
    background: rgba(245, 158, 11, 0.12);
    color: #D97706;
    border: 1px solid rgba(245, 158, 11, 0.35);
    font-weight: 700;
}

.attendance-pill.attendance-absent:hover {
    background: rgba(245, 158, 11, 0.22);
    transform: translateY(-1px);
}

.attendance-pill.attendance-sdd-alert {
    background: #FEF3C7;
    color: #B45309;
    border: 1px solid #F59E0B;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.2);
    animation: sddPulse 2.5s infinite ease-in-out;
}

.attendance-pill.attendance-sdd-alert:hover {
    background: #FDE68A;
    transform: translateY(-1px);
}

@keyframes sddPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15); }
}

.sdd-alert-box {
    background: #FFFBEB;
    border: 1px solid #FCD34D;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.sdd-alert-title {
    font-weight: 700;
    color: #92400E;
    font-size: 0.92rem;
    line-height: 1.4;
}

.sdd-alert-list {
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sdd-alert-item {
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFFFFF;
    color: #0F172A;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.sdd-alert-item strong {
    color: #0F172A;
}

.sdd-alert-code {
    font-size: 0.75rem;
    color: var(--slate-500);
    margin-left: 4px;
}

.sdd-alert-note {
    font-size: 0.80rem;
    color: #78350F;
    margin-bottom: 8px;
    font-style: italic;
    line-height: 1.4;
}

.attendance-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.attendance-total-text {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--slate-800);
}

.student-attendance-list-label {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--slate-500);
    margin-bottom: 8px;
}

.student-absence-type {
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid var(--slate-300);
    background: #FFFFFF;
    color: var(--slate-800);
    outline: none;
    cursor: pointer;
}

.summary-absent-active {
    font-size: 0.82rem;
    font-weight: 700;
    color: #D97706;
}

.summary-absent-zero {
    font-size: 0.82rem;
    font-weight: 700;
    color: #059669;
}

.attendance-footer-saved {
    color: #059669;
    font-weight: 600;
}

.attendance-footer-modified {
    color: #D97706;
    font-weight: 600;
}

.attendance-footer-safe {
    color: #0D9488;
    font-weight: 600;
}

.sdd-actions-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.student-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-600);
}

.student-attendance-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.student-attendance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    font-size: 0.84rem;
}

.student-attendance-row.is-absent {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.3);
}

.student-status-tag {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
}

.student-status-tag.phep {
    background: #FEF3C7;
    color: #B45309;
}

.student-status-tag.khong-phep {
    background: #FEE2E2;
    color: #B91C1C;
}

.student-status-tag.du {
    background: #D1FAE5;
    color: #047857;
}

/* Floating Remark Dropdown Menu */
.remark-dropdown-menu {
    position: fixed;
    z-index: 99999;
    min-width: 360px;
    max-width: 440px;
    background: #FFFFFF;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: none;
    animation: remarkDropIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.remark-dropdown-menu.active {
    display: block;
}

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

.remark-dropdown-header {
    padding: 10px 14px;
    background: #F8FAFC;
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.remark-dropdown-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--slate-700);
    letter-spacing: 0.02em;
}

.btn-close-dropdown {
    background: transparent;
    border: none;
    color: var(--slate-400);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}

.btn-close-dropdown:hover {
    color: var(--slate-700);
    background: var(--slate-200);
}

.remark-dropdown-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 6px 0;
}

.remark-category-label {
    padding: 8px 14px 4px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.remark-dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    font-size: 0.84rem;
    color: var(--slate-700);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    line-height: 1.35;
    user-select: none;
}

.remark-dropdown-item:hover {
    background: #EEF2FF;
    color: var(--primary-700);
}

.remark-dropdown-item.active {
    background: #E0E7FF;
    color: var(--primary-800);
    font-weight: 600;
}

.remark-dropdown-item .remark-item-icon {
    font-size: 0.95rem;
    flex-shrink: 0;
}

.remark-dropdown-item .remark-item-text {
    flex: 1;
}

.remark-dropdown-item .btn-del-custom-remark {
    background: transparent;
    border: none;
    color: var(--slate-400);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0.6;
}

.remark-dropdown-item .btn-del-custom-remark:hover {
    color: var(--danger-500);
    opacity: 1;
}

.remark-dropdown-footer {
    padding: 8px 12px;
    background: #F8FAFC;
    border-top: 1px solid var(--slate-100);
}

.btn-add-custom-remark {
    width: 100%;
    background: transparent;
    border: 1px dashed var(--slate-300);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    color: var(--primary-600);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-add-custom-remark:hover {
    background: #EEF2FF;
    border-color: var(--primary-400);
}

/* ==========================================================================
   Status Badges & Pills (Chuẩn tương phản cao AAA cho cả Sáng & Tối)
   ========================================================================== */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
}

/* 1. Đã lưu lên vnEdu (Emerald) */
.status-synced,
.status-pill.status-synced {
    background: #ECFDF5 !important;
    color: #065F46 !important;
    border: 1px solid #A7F3D0 !important;
}
.status-synced svg,
.status-pill.status-synced svg {
    stroke: #059669 !important;
}

/* 2. Sẵn sàng đồng bộ (Blue) */
.status-ready,
.status-pill.status-ready {
    background: #EFF6FF !important;
    color: #1E40AF !important;
    border: 1px solid #BFDBFE !important;
}
.status-ready svg,
.status-pill.status-ready svg {
    stroke: #2563EB !important;
}

/* 3. Chưa tới ngày dạy (Amber / Gold) - Tương phản cao chống lóa chữ */
.status-future,
.status-pill.status-future {
    background: #FEF3C7 !important;
    color: #92400E !important;
    border: 1px solid #FCD34D !important;
}
.status-future svg,
.status-pill.status-future svg {
    stroke: #92400E !important;
}

/* ==========================================================================
   Sync Progress Modal
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: #FFFFFF;
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--slate-800);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--slate-400);
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s ease;
}

.btn-close:hover { color: var(--slate-700); }

/* Khi đang đồng bộ: Tuyệt đối ẩn nút X để tránh ấn nhầm */
.modal-overlay.syncing .btn-close,
.modal-box.syncing .btn-close,
.syncing #btnCloseModal {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.modal-body {
    padding: 24px;
}

.progress-bar-wrapper {
    height: 8px;
    background: var(--slate-100);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary-500), var(--accent-500));
    transition: width 0.3s ease;
}

.sync-logs {
    height: 200px;
    background: var(--slate-900);
    color: #F8FAFC;
    border-radius: var(--radius-md);
    padding: 14px;
    font-family: monospace;
    font-size: 0.8rem;
    overflow-y: auto;
    line-height: 1.6;
}

.log-entry-success { color: #34D399; }
.log-entry-wait { color: #FBBF24; }
.log-entry-error { color: #F87171; }

.modal-footer {
    padding: 14px 24px;
    background: var(--slate-50);
    border-top: 1px solid var(--slate-200);
    display: flex;
    justify-content: flex-end;
}

/* ==========================================================================
   Toasts & Notifications System (Sonner / Radix Modern Style)
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 99999;
    max-width: 420px;
    pointer-events: none;
}

.toast {
    background: #FFFFFF;
    color: var(--slate-800);
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.15), 0 4px 10px -2px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--slate-200);
    border-left: 4px solid var(--primary-600);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    backdrop-filter: blur(8px);
}

.toast-icon {
    font-size: 1.3rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.toast-title {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--slate-800);
    line-height: 1.3;
}

.toast-desc {
    font-size: 0.8rem;
    color: var(--slate-600);
    line-height: 1.45;
}

.toast.toast-success { border-left-color: var(--accent-500); }
.toast.toast-error { border-left-color: #EF4444; }
.toast.toast-warning { border-left-color: #F59E0B; }
.toast.toast-info { border-left-color: var(--primary-600); }

[data-theme="dark"] .toast {
    background: #111827;
    border-color: #1F2937;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .toast-title {
    color: #F8FAFC;
}

[data-theme="dark"] .toast-desc {
    color: #94A3B8;
}

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

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--slate-200);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

.modal-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--slate-200);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state {
    text-align: center;
    padding: 60px 20px;
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-200);
    color: var(--slate-500);
}

/* ==========================================================================
   PRO MAX ENHANCEMENTS: Dark Mode, Search, Ring Gauge & Ambient Glow
   ========================================================================== */

/* Dark Mode Palette */
[data-theme="dark"] {
    --slate-50: #0B0F19;
    --slate-100: #111827;
    --slate-200: #1F2937;
    --slate-300: #374151;
    --slate-400: #6B7280;
    --slate-500: #9CA3AF;
    --slate-600: #D1D5DB;
    --slate-700: #E5E7EB;
    --slate-800: #F3F4F6;
    --slate-900: #FFFFFF;

    --primary-50: rgba(99, 102, 241, 0.12);
    --accent-50: rgba(16, 185, 129, 0.12);
    --amber-50: rgba(245, 158, 11, 0.12);
}

[data-theme="dark"] body {
    background-color: var(--slate-50);
    color: var(--slate-800);
}

[data-theme="dark"] .control-panel,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .day-section,
[data-theme="dark"] .modal-box,
[data-theme="dark"] .toast,
[data-theme="dark"] .loading-state {
    background-color: #111827;
    border-color: #1F2937;
}

[data-theme="dark"] .day-header {
    background: linear-gradient(to right, #111827, #1E293B);
    border-bottom-color: #1F2937;
}

[data-theme="dark"] .slots-table th {
    background: #0F172A;
    border-bottom-color: #1F2937;
}

[data-theme="dark"] .slots-table td {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .slots-table tr:hover td {
    background: rgba(99, 102, 241, 0.08);
}

[data-theme="dark"] .week-tab,
[data-theme="dark"] .filter-chip,
[data-theme="dark"] .btn-outline {
    background: #1E293B;
    border-color: #334155;
    color: #CBD5E1;
}

[data-theme="dark"] .remark-input,
[data-theme="dark"] .remark-combobox .remark-input,
[data-theme="dark"] .search-box input {
    background: #0F172A;
    border-color: #334155;
    color: #F8FAFC;
}

[data-theme="dark"] .remark-input:focus,
[data-theme="dark"] .remark-combobox .remark-input:focus,
[data-theme="dark"] .search-box input:focus {
    border-color: var(--primary-500);
}

[data-theme="dark"] .remark-combobox .btn-remark-dropdown {
    color: #94A3B8;
}

[data-theme="dark"] .remark-combobox .btn-remark-dropdown:hover {
    color: #A5B4FC;
    background: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .attendance-pill.attendance-full {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .attendance-pill.attendance-absent {
    background: rgba(245, 158, 11, 0.2);
    color: #FBBF24;
    border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .attendance-pill.attendance-sdd-alert {
    background: rgba(245, 158, 11, 0.25);
    color: #FDE68A;
    border-color: #F59E0B;
}

[data-theme="dark"] .sdd-alert-box {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.45);
    color: #F8FAFC;
}

[data-theme="dark"] .sdd-alert-title {
    color: #FBBF24;
}

[data-theme="dark"] .sdd-alert-item {
    background: #1E293B;
    border-color: rgba(245, 158, 11, 0.35);
    color: #F8FAFC;
}

[data-theme="dark"] .sdd-alert-item strong {
    color: #FFFFFF;
}

[data-theme="dark"] .sdd-alert-code {
    color: #94A3B8;
}

[data-theme="dark"] .sdd-alert-note {
    color: #FDE68A;
}

[data-theme="dark"] .attendance-summary-bar {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .attendance-total-text {
    color: #F8FAFC;
}

[data-theme="dark"] .student-attendance-list-label {
    color: #94A3B8;
}

[data-theme="dark"] .student-absence-type {
    background: #1E293B;
    border-color: #475569;
    color: #F8FAFC;
}

[data-theme="dark"] .summary-absent-active {
    color: #FBBF24;
}

[data-theme="dark"] .summary-absent-zero {
    color: #34D399;
}

[data-theme="dark"] .attendance-footer-saved {
    color: #34D399;
}

[data-theme="dark"] .attendance-footer-modified {
    color: #FBBF24;
}

[data-theme="dark"] .attendance-footer-safe {
    color: #2DD4BF;
}

[data-theme="dark"] .student-attendance-row {
    background: #0F172A;
    border-color: #334155;
    color: #F8FAFC;
}

[data-theme="dark"] .student-attendance-row.is-absent {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .student-status-tag.phep {
    background: rgba(245, 158, 11, 0.25);
    color: #FDE68A;
}

[data-theme="dark"] .student-status-tag.khong-phep {
    background: rgba(239, 68, 68, 0.25);
    color: #FCA5A5;
}

[data-theme="dark"] .student-status-tag.du {
    background: rgba(16, 185, 129, 0.2);
    color: #6EE7B7;
}

[data-theme="dark"] .remark-dropdown-menu {
    background: #1E293B;
    border-color: #334155;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .remark-dropdown-header {
    background: #0F172A;
    border-bottom-color: #334155;
}

[data-theme="dark"] .remark-dropdown-title {
    color: #F8FAFC;
}

[data-theme="dark"] .btn-close-dropdown {
    color: #94A3B8;
}

[data-theme="dark"] .btn-close-dropdown:hover {
    color: #F8FAFC;
    background: #334155;
}

[data-theme="dark"] .remark-category-label {
    color: #64748B;
}

[data-theme="dark"] .remark-dropdown-item {
    color: #E2E8F0;
}

[data-theme="dark"] .remark-dropdown-item:hover {
    background: #312E81;
    color: #C7D2FE;
}

[data-theme="dark"] .remark-dropdown-item.active {
    background: #3730A3;
    color: #E0E7FF;
}

[data-theme="dark"] .remark-dropdown-footer {
    background: #0F172A;
    border-top-color: #334155;
}

[data-theme="dark"] .btn-add-custom-remark {
    border-color: #334155;
    color: #A5B4FC;
}

[data-theme="dark"] .btn-add-custom-remark:hover {
    background: #1E293B;
    border-color: var(--primary-500);
}

[data-theme="dark"] #inputNewCustomRemark {
    background: #0F172A;
    border-color: #334155 !important;
    color: #F8FAFC;
}

[data-theme="dark"] .pro-shortcuts-pill {
    background: rgba(17, 24, 39, 0.85);
    border-color: #374151;
    color: #CBD5E1;
}

[data-theme="dark"] .pro-shortcuts-pill kbd {
    background: #1F2937;
    border-color: #4B5563;
    color: #F3F4F6;
}

/* Dark Mode Status Badges & Pills (Khắc phục triệt để lỗi màu chìm) */
[data-theme="dark"] .status-future,
html[data-theme="dark"] .status-future,
[data-theme="dark"] .status-pill.status-future,
[data-theme="dark"] .status-pill.status-future *,
html[data-theme="dark"] .status-pill.status-future * {
    background: rgba(245, 158, 11, 0.22) !important;
    background-color: rgba(245, 158, 11, 0.22) !important;
    color: #FDE68A !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
}

[data-theme="dark"] .status-future svg,
[data-theme="dark"] .status-pill.status-future svg {
    stroke: #FDE68A !important;
}

[data-theme="dark"] .status-synced,
html[data-theme="dark"] .status-synced,
[data-theme="dark"] .status-pill.status-synced,
[data-theme="dark"] .status-pill.status-synced * {
    background: rgba(16, 185, 129, 0.18) !important;
    color: #34D399 !important;
    border-color: rgba(16, 185, 129, 0.45) !important;
}

[data-theme="dark"] .status-synced svg,
[data-theme="dark"] .status-pill.status-synced svg {
    stroke: #34D399 !important;
}

[data-theme="dark"] .status-ready,
html[data-theme="dark"] .status-ready,
[data-theme="dark"] .status-pill.status-ready,
[data-theme="dark"] .status-pill.status-ready * {
    background: rgba(59, 130, 246, 0.18) !important;
    color: #60A5FA !important;
    border-color: rgba(59, 130, 246, 0.45) !important;
}

[data-theme="dark"] .status-ready svg,
[data-theme="dark"] .status-pill.status-ready svg {
    stroke: #60A5FA !important;
}

[data-theme="dark"] .session-morning {
    background: rgba(245, 158, 11, 0.18);
    color: #FCD34D;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

[data-theme="dark"] .session-afternoon {
    background: rgba(99, 102, 241, 0.18);
    color: #A5B4FC;
    border: 1px solid rgba(99, 102, 241, 0.35);
}

[data-theme="dark"] .ppct-pill {
    background: #1E293B;
    color: #94A3B8;
    border: 1px solid #334155;
}

[data-theme="dark"] .day-date {
    background: #0F172A;
    color: #94A3B8;
    border-color: #334155;
}

[data-theme="dark"] .day-tag-today {
    background: rgba(16, 185, 129, 0.2);
    color: #34D399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .file-badge {
    background: #1E293B;
    color: #E2E8F0;
    border-color: #334155;
}

[data-theme="dark"] .btn-change-file {
    background: #0F172A;
    color: #A5B4FC;
    border-color: #4338CA;
}

[data-theme="dark"] .btn-change-file:hover {
    background: #1E1B4B;
    border-color: #6366F1;
}

[data-theme="dark"] .btn-reset-file {
    background: #0F172A;
    color: #94A3B8;
    border-color: #334155;
}

[data-theme="dark"] .week-daterange {
    background: #1E293B;
    color: #94A3B8;
}

[data-theme="dark"] .btn-outline:disabled {
    background: #111827;
    border-color: #1F2937;
    color: #4B5563;
}

[data-theme="dark"] #autoPlanModal .modal-box {
    background: #0F172A;
    border: 1px solid #1E293B;
    color: #F1F5F9;
}

[data-theme="dark"] #selectPlanWeek {
    background: #1E293B !important;
    color: #F8FAFC !important;
    border-color: #334155 !important;
}

/* Glass Buttons in Header */
.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
}

/* Metric Progress Card & Ring */
.metric-indigo {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-600);
}

.text-indigo {
    color: var(--primary-600);
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Filter Toolbar & Live Search Box */
.filter-chips-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    left: 12px;
    color: var(--slate-400);
    pointer-events: none;
}

.search-box input {
    padding: 7px 14px 7px 34px;
    border-radius: var(--radius-full);
    border: 1px solid var(--slate-200);
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--slate-700);
    background: #FFFFFF;
    transition: var(--transition);
    width: 210px;
}

.search-box input:focus {
    width: 260px;
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Confetti Overlay */
.confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

/* Keyboard Shortcuts Bottom Pill */
.pro-shortcuts-pill {
    position: fixed;
    bottom: 20px;
    right: 24px;
    left: auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-full);
    padding: 6px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--slate-600);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
    z-index: 40;
    transition: var(--transition);
}

.pro-shortcuts-pill:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.pro-tag {
    background: linear-gradient(135deg, var(--primary-600), #9333EA);
    color: #FFFFFF;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.pro-shortcuts-pill kbd {
    background: var(--slate-100);
    border: 1px solid var(--slate-300);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.72rem;
    font-family: monospace;
    font-weight: 700;
    color: var(--slate-800);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

@media(max-width: 900px) {
    .pro-shortcuts-pill {
        display: none;
    }
}

/* ==========================================================================
   PPCT Configuration Modal Styling
   ========================================================================== */
.ppct-info-card {
    background: rgba(79, 70, 229, 0.06);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
}
[data-theme="dark"] .ppct-info-card {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
}
.ppct-info-desc {
    color: var(--slate-600);
    font-size: 0.82rem;
    line-height: 1.5;
    margin-top: 6px;
}
[data-theme="dark"] .ppct-info-desc {
    color: #CBD5E1;
}
.ppct-weeks-table-wrap {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 10px;
}
[data-theme="dark"] .ppct-weeks-table-wrap {
    border-color: #374151;
}
.ppct-weeks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}
.ppct-weeks-table th {
    background: var(--slate-100);
    color: var(--slate-700);
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 0.78rem;
    border-bottom: 1px solid var(--slate-200);
}
[data-theme="dark"] .ppct-weeks-table th {
    background: #1E293B;
    color: #E2E8F0;
    border-color: #374151;
}
.ppct-weeks-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--slate-100);
    color: var(--slate-800);
}
[data-theme="dark"] .ppct-weeks-table td {
    border-color: #1F2937;
    color: #F3F4F6;
}
.ppct-input {
    width: 60px;
    padding: 5px 8px;
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 700;
    color: var(--primary-600);
    outline: none;
    background: #FFFFFF;
    transition: var(--transition);
}
[data-theme="dark"] .ppct-input {
    background: #0F172A;
    border-color: #374151;
    color: #818CF8;
}
.ppct-input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}
.ppct-input:disabled {
    background: var(--slate-100);
    color: var(--slate-400);
    border-color: var(--slate-200);
    cursor: not-allowed;
}
[data-theme="dark"] .ppct-input:disabled {
    background: #1F2937;
    color: #64748B;
    border-color: #374151;
}

/* ==========================================================================
   Hierarchical Navigation Sidebar (Menu Phân Cấp Quản Trị Toàn Niên Khóa)
   Thiết kế chuẩn công thái học, responsive mượt mà và hỗ trợ Dark Mode
   ========================================================================== */

/* Nút Toggle Hamburger trên Header */
.btn-toggle-sidebar {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin-right: 2px;
}

.btn-toggle-sidebar:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.05);
}

.btn-toggle-sidebar:active {
    transform: scale(0.95);
}

/* App Body Container (Bọc Sidebar + Main Content) */
.app-body-container {
    display: flex;
    position: relative;
    width: 100%;
    min-height: calc(100vh - 76px);
}

.app-body-container .main-content {
    flex: 1;
    min-width: 0;
    margin: 20px auto;
    padding: 0 24px;
    transition: margin 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Khung Sidebar chính (Siêu Tinh Gọn - Ultra-Compact) */
.app-sidebar {
    width: 245px;
    min-width: 245px;
    flex-shrink: 0;
    background: #FFFFFF;
    border-right: 1px solid var(--slate-200);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 76px;
    height: calc(100vh - 76px);
    z-index: 40;
    transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1), transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.02);
    user-select: none;
}

/* Nút Thu gọn / Mở rộng ở mép Sidebar */
.sidebar-edge-toggle {
    position: absolute;
    top: 14px;
    right: -13px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid var(--slate-300);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate-600);
    z-index: 50;
    transition: var(--transition);
}

.sidebar-edge-toggle:hover {
    background: var(--primary-600);
    color: #FFFFFF;
    border-color: var(--primary-600);
    transform: scale(1.12);
}

[data-theme="dark"] .sidebar-edge-toggle {
    background: #1E293B;
    border-color: rgba(255, 255, 255, 0.15);
    color: #CBD5E1;
}

[data-theme="dark"] .sidebar-edge-toggle:hover {
    background: var(--primary-500);
    color: #FFFFFF;
}

/* Khi Desktop thu gọn Sidebar, nút edge chuyển sang mép trái màn hình */
@media (min-width: 1025px) {
    body.sidebar-collapsed .sidebar-edge-toggle {
        position: fixed;
        left: 10px;
        top: 92px;
        z-index: 60;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    }
    body.sidebar-collapsed .sidebar-edge-toggle .edge-icon {
        transform: rotate(180deg);
    }
}

/* Dark Mode cho Sidebar */
[data-theme="dark"] .app-sidebar {
    background: #0B1120;
    border-right-color: rgba(255, 255, 255, 0.08);
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.35);
}

/* Header Compact của Sidebar */
.sidebar-header-compact {
    padding: 11px 14px;
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

[data-theme="dark"] .sidebar-header-compact {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.sidebar-brand-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-brand-title {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--slate-800);
    font-family: var(--font-heading);
    display: block;
    line-height: 1.2;
}

[data-theme="dark"] .sidebar-brand-title {
    color: #F1F5F9;
}

.sidebar-brand-class {
    font-size: 0.67rem;
    color: var(--primary-600);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 1px;
}

[data-theme="dark"] .sidebar-brand-class {
    color: #818CF8;
}

.badge-dot-live {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-500);
    box-shadow: 0 0 6px var(--accent-500);
    display: inline-block;
}

.sidebar-close-btn {
    background: none;
    border: none;
    padding: 4px;
    color: var(--slate-400);
    border-radius: 4px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

/* Vùng cuộn danh mục phân cấp */
.sidebar-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px;
    scrollbar-gutter: stable;
}

.sidebar-scrollable::-webkit-scrollbar {
    width: 4px;
}

.sidebar-scrollable::-webkit-scrollbar-thumb {
    background: var(--slate-200);
    border-radius: 4px;
}

[data-theme="dark"] .sidebar-scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

/* Từng Section danh mục */
.sidebar-section {
    margin-bottom: 16px;
}

.sidebar-section-title {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--slate-400);
    margin-bottom: 6px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

[data-theme="dark"] .sidebar-section-title {
    color: var(--slate-500);
}

.section-title-icon {
    font-size: 0.8rem;
}

/* ==========================================
   CÂY PHÂN CẤP TREE VIEW (Học kỳ & Tháng & Tuần)
   ========================================== */
.sidebar-tree-node {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
    transition: var(--transition);
}

[data-theme="dark"] .sidebar-tree-node {
    background: rgba(30, 41, 59, 0.45);
    border-color: rgba(255, 255, 255, 0.08);
}

.sidebar-tree-node.expanded {
    border-color: var(--primary-300);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.06);
}

[data-theme="dark"] .sidebar-tree-node.expanded {
    border-color: rgba(99, 102, 241, 0.35);
}

.tree-node-header {
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.77rem;
    font-weight: 700;
    color: var(--slate-800);
    transition: background 0.15s ease;
}

[data-theme="dark"] .tree-node-header {
    color: #F1F5F9;
}

.tree-node-header:hover {
    background: rgba(99, 102, 241, 0.07);
}

.tree-toggle-arrow {
    font-size: 0.62rem;
    color: var(--slate-400);
    transition: transform 0.2s ease;
    width: 10px;
    text-align: center;
}

.tree-node-icon {
    font-size: 0.85rem;
}

.tree-node-label {
    flex: 1;
    font-family: var(--font-heading);
}

.tree-badge {
    font-size: 0.58rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-full);
}

.tree-badge.badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

[data-theme="dark"] .tree-badge.badge-active {
    background: rgba(16, 185, 129, 0.25);
    color: #34D399;
}

.tree-badge.badge-pending {
    background: var(--slate-200);
    color: var(--slate-600);
}

[data-theme="dark"] .tree-badge.badge-pending {
    background: rgba(255, 255, 255, 0.1);
    color: var(--slate-400);
}

.tree-node-children {
    padding: 3px 6px 8px;
    border-top: 1px solid var(--slate-200);
}

[data-theme="dark"] .tree-node-children {
    border-top-color: rgba(255, 255, 255, 0.06);
}

.sidebar-tree-node.collapsed .tree-node-children {
    display: none;
}

/* Nhóm Tháng (Native <details> & <summary> với Mutually Exclusive Accordion) */
details.month-group {
    margin-top: 4px;
    border-left: 2px solid var(--primary-200);
    padding-left: 6px;
    margin-left: 4px;
}

[data-theme="dark"] details.month-group {
    border-left-color: rgba(99, 102, 241, 0.3);
}

summary.month-title {
    font-size: 0.71rem;
    font-weight: 700;
    color: var(--slate-700);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 5px;
    cursor: pointer;
    border-radius: 4px;
    list-style: none;
    user-select: none;
    transition: background 0.15s ease;
}

summary.month-title::-webkit-details-marker {
    display: none;
}

summary.month-title::before {
    content: '▸';
    font-size: 0.62rem;
    color: var(--slate-400);
    transition: transform 0.2s ease;
    display: inline-block;
    width: 10px;
}

details.month-group[open] > summary.month-title::before {
    content: '▾';
    color: var(--primary-600);
}

[data-theme="dark"] details.month-group[open] > summary.month-title::before {
    color: #818CF8;
}

summary.month-title:hover {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] summary.month-title:hover {
    background: rgba(255, 255, 255, 0.05);
}

.month-count-badge {
    font-size: 0.58rem;
    background: var(--slate-100);
    color: var(--slate-500);
    padding: 1px 5px;
    border-radius: 999px;
    margin-left: auto;
    font-weight: 600;
}

[data-theme="dark"] .month-count-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--slate-400);
}

.month-icon {
    font-size: 0.75rem;
}

.month-weeks {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
}

/* Nút Từng Tuần trên Sidebar */
.sidebar-week-item {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    font-size: 0.73rem;
    font-family: var(--font-sans);
    color: var(--slate-700);
    transition: all 0.15s ease;
    text-align: left;
}

[data-theme="dark"] .sidebar-week-item {
    color: var(--slate-300);
}

.sidebar-week-item:hover {
    background: var(--primary-50);
    color: var(--primary-700);
    border-color: var(--primary-200);
}

[data-theme="dark"] .sidebar-week-item:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #FFFFFF;
    border-color: rgba(99, 102, 241, 0.3);
}

.sidebar-week-item.active {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700)) !important;
    color: #FFFFFF !important;
    font-weight: 700;
    box-shadow: 0 2px 6px var(--primary-shadow, rgba(37, 99, 235, 0.35));
    border-color: transparent;
}

.sidebar-week-item.active .week-dates {
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-week-item .week-name {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.sidebar-week-item .week-dates {
    font-size: 0.65rem;
    color: var(--slate-400);
    font-variant-numeric: tabular-nums;
}

/* Tags trạng thái trên Sidebar */
.sidebar-tag {
    font-size: 0.58rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1.2;
}

.sidebar-tag.tag-now {
    background: #F59E0B;
    color: #FFFFFF;
}

.sidebar-tag.tag-next {
    background: #10B981;
    color: #FFFFFF;
}

.sidebar-tag.tag-exam {
    background: #8B5CF6;
    color: #FFFFFF;
}

/* Footer của Sidebar */
.sidebar-footer {
    padding: 8px 12px;
    border-top: 1px solid var(--slate-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--slate-400);
}

[data-theme="dark"] .sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.06);
}

.sidebar-footer-version {
    font-weight: 700;
    font-family: var(--font-mono);
}

.sidebar-footer-tag {
    font-style: italic;
}

/* ==========================================
   SIDEBAR TREE CONTROLS & QUICK OPEN
   ========================================== */
.sidebar-section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 4px;
}

.tree-quick-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tree-ctrl-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: transparent;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--slate-500);
    cursor: pointer;
    transition: var(--transition);
}

.tree-ctrl-btn:hover {
    background: var(--slate-100);
    color: var(--primary-600);
    border-color: var(--primary-300);
}

[data-theme="dark"] .tree-ctrl-btn {
    border-color: rgba(255, 255, 255, 0.12);
    color: #94A3B8;
}

[data-theme="dark"] .tree-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #818CF8;
}

/* Nút Mở Nhanh Toàn Bộ 35 Tuần (Trên Thanh Tuần Ngang) */
.btn-sidebar-quick-open {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: var(--radius-full);
    border: 1px solid var(--slate-200);
    background: var(--slate-50);
    color: var(--slate-700);
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: var(--transition);
}

.btn-sidebar-quick-open:hover {
    background: var(--primary-50);
    color: var(--primary-700);
    border-color: var(--primary-300);
    transform: translateY(-1px);
}

[data-theme="dark"] .btn-sidebar-quick-open {
    background: #0F172A;
    border-color: #1F2937;
    color: #94A3B8;
}

[data-theme="dark"] .btn-sidebar-quick-open:hover {
    background: #1E293B;
    color: #818CF8;
    border-color: #4F46E5;
}

/* ==========================================
   Responsive & Collapse Logic
   ========================================== */

/* Trên Màn hình Desktop (>= 1025px) */
@media (min-width: 1025px) {
    body.sidebar-collapsed .app-sidebar {
        margin-left: -245px;
    }
}

/* Trên Màn hình Mobile / Tablet (< 1025px) */
@media (max-width: 1024px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        height: 100dvh;
        width: 280px;
        max-width: 86vw;
        z-index: 100;
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
    }

    .sidebar-close-btn {
        display: inline-flex;
    }

    body.sidebar-mobile-open .app-sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        z-index: 99;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s ease;
    }

    body.sidebar-mobile-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar-edge-toggle {
        display: none;
    }
}

/* ==========================================================================
   Style Switcher Popover (Hiện đại, Native Popover API)
   ========================================================================== */
.style-switcher-popover {
    inset: auto;
    position: fixed;
    top: 68px;
    right: 170px;
    margin: 0;
    background: #FFFFFF;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
    padding: 12px;
    width: 290px;
    z-index: 1000;
}
.style-switcher-popover:popover-open {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.style-switcher-title {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 6px 8px;
    border-bottom: 1px solid var(--slate-100);
}
.style-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    width: 100%;
}
.style-option-btn:hover {
    background: var(--slate-100);
}
.style-option-btn.active {
    background: var(--primary-50);
    border-color: var(--primary-500);
}
.style-palette-preview {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    font-size: 1rem;
}
.style-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.style-meta-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--slate-800);
}
.style-meta-desc {
    font-size: 0.72rem;
    color: var(--slate-500);
    line-height: 1.25;
}
[data-theme="dark"] .style-switcher-popover {
    background: #111827;
    border-color: #1F2937;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .style-switcher-title {
    color: #94A3B8;
    border-bottom-color: #1F2937;
}
[data-theme="dark"] .style-option-btn:hover {
    background: #1E293B;
}
[data-theme="dark"] .style-meta-name {
    color: #F3F4F6;
}
[data-theme="dark"] .style-meta-desc {
    color: #94A3B8;
}

/* ==========================================================================
   Responsive Text Helpers
   ========================================================================== */
.btn-text-short {
    display: none;
}
.btn-text-full {
    display: inline;
}

/* ==========================================================================
   Mobile-First Minimal Mode (@media (max-width: 640px))
   Giao diện Tối Giản Chức Năng Cân Đối Tuyệt Đối Cho Điện Thoại Di Động
   ========================================================================== */
@media (max-width: 640px) {
    /* Responsive Text Toggles */
    .btn-text-full {
        display: none !important;
    }
    .btn-text-short {
        display: inline !important;
    }

    /* 1. Header Mobile siêu mỏng nhẹ (48px) */
    .app-header {
        padding: 6px 12px;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    .header-container {
        gap: 6px;
    }
    .brand-section {
        gap: 6px;
    }
    .brand-logo svg {
        width: 20px;
        height: 20px;
    }
    .brand-title {
        font-size: 0.95rem;
    }
    .brand-subtitle {
        display: none !important;
    }
    .teacher-card {
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
    }
    .teacher-info {
        display: none !important;
    }
    .teacher-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.88rem;
    }
    #btnOpenVnEdu,
    #btnPpctConfig {
        display: none !important;
    }
    .header-actions {
        gap: 5px;
    }
    .btn-icon {
        width: 32px;
        height: 32px;
        padding: 5px;
    }

    /* 2. Main Content & Unified Alignment (1 trục thẳng tắp) */
    .main-content {
        margin: 8px auto 16px;
        padding: 0 12px;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* 3. Khối 1: Control Panel (Đều đặn, 2 nút cùng chiều cao 42px, không gãy chữ) */
    .control-panel {
        padding: 10px 12px;
        margin-bottom: 8px;
        border-radius: 14px;
        border: 1px solid var(--slate-200);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
        width: 100%;
        box-sizing: border-box;
        gap: 8px;
    }
    .control-top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .source-mode-switch,
    .source-selector {
        display: none !important;
    }
    .week-quick-stepper {
        width: 100%;
        height: 38px;
        justify-content: space-between;
        box-sizing: border-box;
    }
    .week-badge-btn {
        flex: 1;
        justify-content: center;
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    .week-badge-title {
        font-size: 0.8rem;
    }
    .panel-right {
        width: 100%;
        display: flex;
        gap: 8px;
        box-sizing: border-box;
    }
    #btnSyncToday {
        flex: 1.25;
        height: 42px;
        padding: 0 10px;
        font-size: 0.82rem;
        font-weight: 700;
        white-space: nowrap;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }
    #btnSyncWeek {
        flex: 1;
        height: 42px;
        padding: 0 8px;
        font-size: 0.8rem;
        font-weight: 700;
        white-space: nowrap;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }
    #btnAutoPlan,
    #btnRefresh {
        display: none !important;
    }

    /* 4. Khối 2: Compact Metrics Bar (Thẳng hàng, cân xứng 2 đầu) */
    .compact-metrics-bar {
        padding: 8px 12px;
        margin-bottom: 8px;
        border-radius: 14px;
        border: 1px solid var(--slate-200);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
        width: 100%;
        box-sizing: border-box;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }
    .metrics-summary-left {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
    }
    .mini-banner-icon {
        font-size: 1.1rem;
        line-height: 1;
        flex-shrink: 0;
    }
    .summary-main-text {
        font-size: 0.8rem;
        font-weight: 700;
        color: var(--slate-800);
        white-space: nowrap;
    }
    .summary-sub-text {
        display: none !important;
    }
    .metrics-badges-right {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
    }
    .stat-pill {
        padding: 3px 8px;
        font-size: 0.74rem;
        font-weight: 700;
        border-radius: 9999px;
    }
    .stat-pill-label {
        display: none !important; /* Ẩn chữ nhãn dài trên mobile, chỉ để lại icon và số liệu */
    }
    .stat-future {
        display: none !important; /* Ẩn badge Chưa tới ngày trên mobile */
    }
    .mini-progress-pill {
        padding: 2px 7px;
        font-size: 0.72rem;
    }

    /* 5. Khối 3: Filter Toolbar (Được bọc trong Card đồng bộ, ẩn scrollbar xám) */
    .filter-toolbar {
        background: #FFFFFF;
        border: 1px solid var(--slate-200);
        border-radius: 14px;
        padding: 7px 10px;
        margin-bottom: 8px;
        width: 100%;
        box-sizing: border-box;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .filter-chips-wrapper {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    .filter-chips {
        width: 100%;
        display: flex;
        gap: 6px;
        overflow-x: auto;
        white-space: nowrap;
        flex-wrap: nowrap;
        padding: 2px 0;
        scrollbar-width: none; /* Ẩn scrollbar Firefox */
        -ms-overflow-style: none; /* Ẩn scrollbar IE/Edge */
        -webkit-overflow-scrolling: touch;
    }
    .filter-chips::-webkit-scrollbar {
        display: none !important; /* Ẩn scrollbar Chrome/Safari */
    }
    .filter-chip {
        padding: 5px 12px;
        font-size: 0.76rem;
        font-weight: 600;
        border-radius: 9999px;
        flex-shrink: 0;
        line-height: 1.2;
    }
    .filter-chip:last-child {
        margin-right: 8px;
    }
    .search-box {
        display: none !important;
    }
    #weekDateRangeLabel {
        display: none !important;
    }

    /* 6. Khối 4: Day Section & Mobile Cards */
    .day-section {
        margin-bottom: 12px;
        border-radius: 14px;
        border: 1px solid var(--slate-200);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    .day-header {
        padding: 9px 12px;
        background: #FFFFFF;
        border-bottom: 1px solid var(--slate-200);
    }
    .day-name {
        font-size: 0.95rem;
    }
    .day-date {
        font-size: 0.76rem;
    }

    /* Chuyển slots-table thành Card Layout */
    .slots-table {
        display: block;
        width: 100%;
    }
    .slots-table thead {
        display: none !important;
    }
    .slots-table tbody {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 8px;
        background: var(--slate-50);
        box-sizing: border-box;
    }
    .slots-table tr {
        display: flex;
        flex-direction: column;
        background: #FFFFFF;
        border: 1px solid var(--slate-200);
        border-radius: 12px;
        padding: 10px 12px;
        gap: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
        box-sizing: border-box;
    }
    .slots-table tr:hover td {
        background: transparent;
    }
    .slots-table td {
        display: block;
        padding: 0 !important;
        border: none !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Hàng 1 của Card: Tiết học + Lớp + Điểm danh vắng */
    .slots-table tr td:nth-child(1) {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .slots-table tr td:nth-child(2) {
        margin-top: -2px;
    }
    .slots-table tr td:nth-child(2) > div {
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
    }

    /* Hàng 2 của Card: Tên bài dạy & Môn học */
    .slots-table tr td:nth-child(4) .lesson-name {
        font-size: 0.9rem;
        font-weight: 700;
        color: var(--slate-800);
        line-height: 1.35;
    }
    .slots-table tr td:nth-child(3) {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .slots-table tr td:nth-child(3) .subject-name {
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--slate-600);
    }
    .slots-table tr td:nth-child(3) .ppct-pill {
        font-size: 0.7rem;
    }

    /* Hàng 3 của Card: Nhận xét tiết học */
    .slots-table tr td:nth-child(5) .remark-input {
        font-size: 0.8rem;
        padding: 7px 10px;
    }

    /* Hàng 4 của Card: Trạng thái & Nút Lưu ngay */
    .slots-table tr td:nth-child(6) {
        display: inline-flex;
    }
    .slots-table tr td:nth-child(7) {
        margin-top: 4px;
    }
    .slots-table tr td:nth-child(7) .btn {
        width: 100%;
        height: 40px;
        padding: 0;
        font-size: 0.86rem;
        font-weight: 700;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Ẩn phím tắt */
    .pro-shortcuts-pill {
        display: none !important;
    }

    /* Dark Theme Overrides cho Mobile */
    [data-theme="dark"] .filter-toolbar {
        background: #111827;
        border-color: #1F2937;
    }
    [data-theme="dark"] .day-header {
        background: #111827;
        border-bottom-color: #1F2937;
    }
    [data-theme="dark"] .slots-table tbody {
        background: #0B1329;
    }
    [data-theme="dark"] .slots-table tr {
        background: #111827;
        border-color: #1F2937;
    }
    [data-theme="dark"] .slots-table tr td:nth-child(4) .lesson-name {
        color: #F3F4F6;
    }
}
