/* Cheecore Education - Design System Foundation */
/* Variables, Reset, Typography, Layout, Forms, Buttons */

:root {
    /* === Brand Colors === */
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --primary-bg: #F5F6FF;
    --success: #059669;
    --success-light: #ECFDF5;
    --warning: #92400E;
    --warning-light: #FFFBEB;
    --danger: #B91C1C;
    --danger-light: #FEF2F2;
    --info: #0E7490;
    --info-light: #ECFEFF;

    /* === Neutral Scale === */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* === Typography Scale === */
    --text-xs: 12px;
    --text-sm: 12px;
    --text-base: 14px;
    --text-md: 15px;
    --text-lg: 18px;
    --text-xl: 22px;
    --text-2xl: 26px;
    --text-3xl: 32px;

    /* === Spacing Scale (4px grid) === */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    /* === Radii === */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* === Shadows === */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.06), 0 4px 6px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.08), 0 8px 10px rgba(0,0,0,0.04);

    /* === Typography === */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    --transition: 0.15s ease;

    /* === Layout === */
    --sidebar-width: 240px;
    --header-height: 56px;
}

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

body {
    font-family: var(--font-family);
    background: #F5F6FA;
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: var(--text-base);
}

/* ===== Typography ===== */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; color: var(--gray-900); }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-md); }
h4 { font-size: var(--text-base); }

/* ===== Bilingual: Chinese on top, English below ===== */
.bi {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    line-height: 1.35 !important;
}
.bi .zh {
    font-weight: 600;
    font-size: inherit;
}
.bi .en {
    font-size: 0.78em;
    opacity: 0.6;
    font-weight: 400;
}

/* ===== English-First Bilingual (teacher views) ===== */
.en-first {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    line-height: 1.35 !important;
}
.en-first .en-big {
    font-weight: 600;
    font-size: inherit;
}
.en-first .zh-small {
    font-size: 0.78em;
    opacity: 0.6;
    font-weight: 400;
}

/* ===== Auth Page ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1E1B4B 0%, #312E81 40%, #4338CA 100%);
    padding: var(--space-6);
}
.auth-card {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: var(--space-10) 36px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-xl);
}
.auth-logo {
    display: block;
    margin: 0 auto var(--space-2);
    width: auto;
    height: 56px;
    max-width: 160px;
    object-fit: contain;
    border-radius: 14px;
}
.auth-card h1 {
    font-size: var(--text-xl);
    text-align: center;
    margin-bottom: 2px;
    color: var(--gray-900);
}
.auth-card h1 .en {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: var(--gray-500);
    margin-top: 2px;
}
.auth-card .subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 28px;
    font-size: 13px;
}
.auth-card .demo-notice {
    margin-top: var(--space-4);
    padding: var(--space-3);
    background: var(--success-light);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: #065F46;
    line-height: 1.6;
}

/* ===== Form Elements ===== */
.form-group { margin-bottom: var(--space-4); }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--gray-700);
}
.form-group label .bi {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}
.form-group label .bi .en {
    font-size: 0.78em;
    font-weight: 400;
    color: var(--gray-400);
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: var(--text-base);
    font-family: inherit;
    background: #fff;
    transition: all var(--transition);
    color: var(--gray-800);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-400);
}
.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}
.form-group textarea.large {
    min-height: 200px;
}

/* ===== Buttons - Unified System ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
    font-family: inherit;
    min-width: 64px;
    text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: var(--shadow-sm); }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #047857; border-color: #047857; box-shadow: var(--shadow-sm); }

.btn-warning { background: #92400E; color: #fff; border-color: #92400E; }
.btn-warning:hover { background: #78340F; border-color: #78340F; }

.btn-danger { background: #B91C1C; color: #fff; border-color: #B91C1C; }
.btn-danger:hover { background: #991B1B; border-color: #991B1B; }

.btn-info { background: #0E7490; color: #fff; border-color: #0E7490; }
.btn-info:hover { background: #155E75; border-color: #155E75; }

.btn-outline {
    background: #fff;
    border: 1.5px solid var(--gray-300);
    color: var(--gray-700);
}
.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    box-shadow: var(--shadow-xs);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--gray-500);
    padding: 6px 10px;
}
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-700); }

.btn-sm { padding: 6px 14px; font-size: var(--text-sm); min-width: 56px; }
.btn-xs { padding: 4px 10px; font-size: var(--text-xs); min-width: 44px; }
.btn-lg { padding: 11px 22px; font-size: var(--text-base); min-width: 80px; }
.btn-block { width: 100%; }

.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { background: var(--danger-light); }

.inline-form { display: inline; }

.form-select-inline,
.form-input-inline {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
}
.form-input-inline { width: 180px; }

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

.btn .bi {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.3;
}
.btn .bi .en {
    font-size: 0.72em;
    opacity: 0.8;
    font-weight: 400;
}

.btn-icon {
    width: 36px; height: 36px; padding: 0; min-width: 0;
    border-radius: var(--radius);
    font-size: 16px;
}

/* ===== Layout ===== */
.layout {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #1E1B4B 0%, #312E81 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 12px rgba(0,0,0,0.08);
}
.sidebar-header {
    padding: 24px 20px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-header img {
    width: auto;
    height: 44px;
    max-width: 160px;
    object-fit: contain;
    margin-bottom: 8px;
}
.sidebar-header .logo {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: #fff;
}
.sidebar-header .logo .en {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #A5B4FC;
    letter-spacing: 0.5px;
    margin-top: 2px;
}
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}
.sidebar-nav .nav-section {
    padding: 12px 20px 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6B6A8A;
    font-weight: 700;
    display: flex;
    flex-direction: column;
}
.sidebar-nav .nav-section .en {
    font-size: 9px;
    font-weight: 400;
    opacity: 0.6;
    letter-spacing: 0.5px;
    text-transform: none;
    margin-top: 1px;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    margin: 2px 10px;
    color: #C7C7E0;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all var(--transition);
    line-height: 1.3;
}
.sidebar-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar-nav a.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}
.sidebar-nav a .nav-icon {
    font-size: 17px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    color: #8B8AB0;
}
.sidebar-footer .user-name {
    color: #E0E0F0;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}
.sidebar-footer a, .sidebar-footer .link-btn {
    color: #A5B4FC;
    text-decoration: none;
}
.sidebar-footer a:hover, .sidebar-footer .link-btn:hover { color: #fff; }
.sidebar-footer .link-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 28px 32px;
    min-height: 100vh;
}

/* ===== Flash Messages ===== */
.flash-msg {
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.2s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.flash-success {
    background: var(--success-light);
    border: 1px solid #A7F3D0;
    color: #065F46;
}
.flash-error {
    background: var(--danger-light);
    border: 1px solid #FECACA;
    color: #991B1B;
}
.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: inherit;
    opacity: 0.6;
    padding: 0 4px;
}
.flash-close:hover { opacity: 1; }

/* ===== Page Header ===== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    line-height: 1.3;
}
.page-header h2 .bi {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
}
.page-header h2 .bi .zh {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
}
.page-header h2 .bi .en,
.page-header h2 > .en {
    font-size: 18px;
    font-weight: 400;
    color: var(--gray-400);
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
}
.page-header .breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 6px;
}
.page-header .breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
    white-space: nowrap;
}
.page-header .breadcrumb a:hover { color: var(--primary-hover); text-decoration: underline; }
.page-header .breadcrumb .sep {
    color: var(--gray-300);
    margin: 0 2px;
    user-select: none;
}
.page-header .breadcrumb .current {
    color: var(--gray-700);
    font-weight: 600;
}
.page-header .breadcrumb .bi {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    line-height: 1.3 !important;
}
.page-header .breadcrumb .bi .zh { font-size: 12px; font-weight: 500; }
.page-header .breadcrumb .bi .en { font-size: 10px; opacity: 0.55; font-weight: 400; }
.page-header .breadcrumb a .bi { display: inline-flex !important; flex-direction: column !important; align-items: flex-start !important; line-height: 1.3 !important; }
.page-header .breadcrumb a .bi .zh { font-size: 12px; font-weight: 500; }
.page-header .breadcrumb a .bi .en { font-size: 10px; opacity: 0.55; font-weight: 400; }

/* ===== Utility Classes ===== */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md { font-size: var(--text-md); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-normal { font-weight: 400; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mr-2 { margin-right: var(--space-2); }
.ml-2 { margin-left: var(--space-2); }
.ml-auto { margin-left: auto; }
.w-auto { width: auto; }

.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-sm { gap: var(--space-2); }
.gap-md { gap: var(--space-4); }
.gap-lg { gap: var(--space-6); }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.w-full { width: 100%; }
.w-auto { width: auto; }
.max-w-800 { max-width: 800px; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hidden { display: none; }
.block { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.sr-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.upload-btn-wrap { position: relative; display: inline-block; overflow: hidden; }
.upload-btn-wrap .file-upload-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; z-index: 1; }

/* ===== Dashboard Card Rows ===== */
.dash-card-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.dash-user-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
}
.dash-user-card:hover { box-shadow: var(--shadow); border-color: var(--gray-200); }
.dash-user-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700; color: #fff;
    overflow: hidden;
}
.dash-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dash-avatar-admin { background: #DC2626; }
.dash-avatar-teacher { background: #D97706; }
.dash-avatar-ta { background: #4F46E5; }
.dash-avatar-student { background: #059669; }
.dash-user-name { font-weight: 600; font-size: 15px; color: var(--gray-900); margin-bottom: 2px; }
.dash-user-email { font-size: 12px; color: var(--gray-500); margin-bottom: 10px; word-break: break-all; }
.dash-user-meta { display: flex; align-items: center; justify-content: center; gap: 8px; }
.dash-urgent-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--gray-100);
    border-left: 3px solid var(--danger);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
}
.dash-urgent-card:hover { box-shadow: var(--shadow); border-color: var(--gray-200); }
.dash-urgent-student { font-weight: 600; font-size: 14px; color: var(--gray-900); margin-bottom: 4px; }
.dash-urgent-assignment { font-size: 13px; color: var(--gray-700); margin-bottom: 2px; }
.dash-urgent-time { font-size: 12px; color: var(--danger); font-weight: 500; }

/* ===== Filter Bar ===== */
.filter-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.filter-item { display: flex; flex-direction: column; gap: 4px; }
.filter-item label { font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; }
.filter-item .form-select-inline { min-width: 150px; }
.filter-actions { flex-direction: row; align-items: center; gap: 8px; padding-bottom: 1px; }

/* ===== Accordion ===== */
.accordion-list { display: flex; flex-direction: column; gap: 10px; }
.accordion-item { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--gray-100); box-shadow: var(--shadow-xs); overflow: hidden; transition: all var(--transition); }
.accordion-item.open { border-color: var(--gray-200); box-shadow: var(--shadow); }
.accordion-header { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: none; border: none; cursor: pointer; font-family: inherit; font-size: var(--text-base); transition: background var(--transition); gap: 12px; }
.accordion-header:hover { background: var(--gray-50); }
.accordion-header-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.accordion-arrow { font-size: 12px; color: var(--gray-400); transition: transform var(--transition); flex-shrink: 0; }
.accordion-item.open .accordion-arrow { transform: rotate(90deg); color: var(--primary); }
.accordion-title { font-weight: 600; color: var(--gray-900); }
.accordion-body { display: none; padding: 0 18px 18px; }
.accordion-item.open .accordion-body { display: block; }

/* ===== Follow-up Detail Cards ===== */
.fu-detail-card { background: var(--gray-50); border-radius: var(--radius); padding: 16px; margin-bottom: 10px; border: 1px solid var(--gray-100); }
.fu-detail-card:last-child { margin-bottom: 0; }
.fu-detail-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.fu-section { margin-bottom: 12px; }
.fu-section:last-child { margin-bottom: 0; }
.fu-label { font-size: 12px; font-weight: 700; color: var(--gray-600); margin-bottom: 6px; display: flex; flex-direction: column; }
.fu-label .en { font-size: 10px; font-weight: 400; color: var(--gray-400); }
.fu-content { font-size: 13px; color: var(--gray-800); line-height: 1.7; background: #fff; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--gray-100); }
.fu-perf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.fu-perf-card { background: #fff; border-radius: var(--radius-sm); padding: 12px; border: 1px solid var(--gray-100); }
.fu-perf-name { font-weight: 600; font-size: 13px; color: var(--gray-900); margin-bottom: 4px; }
.fu-perf-row { font-size: 12px; line-height: 1.5; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .sidebar { width: 210px; }
    .main-content { margin-left: 210px; padding: 20px 22px; }
}
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
        transform: translateX(-100%);
        transition: transform var(--transition);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.35);
        z-index: 99;
    }
    .sidebar-backdrop.show { display: block; }
    .main-content { margin-left: 0; padding: 16px; }
    .detail-grid { grid-template-columns: 1fr; }
    .two-col-main { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid { grid-template-columns: 1fr; }
    .course-card-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; }
    .lesson-actions { flex-direction: column; width: 100%; }
    .lesson-actions .btn { width: 100%; }
    .modal-dialog { padding: 22px; max-width: 94vw; }

    /* Mobile hamburger */
    .mobile-menu-btn {
        display: flex !important;
    }
}
@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .main-content { padding: 12px; }
    table { font-size: 12px; }
    table th, table td { padding: 8px 10px; }
    .table-wrap { overflow-x: auto; }
}
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 200;
    background: var(--primary);
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 20px;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}
