@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

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

:root {
    --bg: #09090b;
    --bg-2: #111113;
    --bg-3: #18181b;
    --bg-4: #1f1f23;
    --surface: #27272a;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-soft: rgba(59, 130, 246, 0.1);
    --text: #fafafa;
    --text-2: #a1a1aa;
    --text-3: #71717a;
    --border: #27272a;
    --border-light: #3f3f46;
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.1);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.1);
    --error: #ef4444;
    --error-soft: rgba(239, 68, 68, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.4);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', var(--font);
}

html { scrollbar-width: thin; scrollbar-color: var(--surface) var(--bg); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 3px; }

body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }

/* ==================== LOGIN ==================== */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
}
.login-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
}
.login-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.2;
}
.login-subtitle {
    font-size: 0.75rem;
    color: var(--text-3);
    margin-top: 2px;
}
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-error { color: var(--error); font-size: 0.8rem; margin-top: 12px; min-height: 1em; }

/* ==================== BUTTONS ==================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-sm { padding: 7px 14px; font-size: 0.75rem; }

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-outline:hover { border-color: var(--text-3); color: var(--text); background: var(--bg-3); }
.btn-accent-outline { border-color: var(--accent); color: var(--accent); }
.btn-accent-outline:hover { background: var(--accent-soft); }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: transparent;
    color: var(--text-3);
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-3); }

.btn-icon-danger {
    padding: 5px 10px;
    background: transparent;
    color: var(--text-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
}
.btn-icon-danger:hover { border-color: var(--error); color: var(--error); background: var(--error-soft); }

/* ==================== APP LAYOUT ==================== */
.app { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
    width: 240px;
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px;
    border-bottom: 1px solid var(--border);
}
.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
}
.sidebar-brand {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
}
.sidebar-brand span { color: var(--accent); }

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-3);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { color: var(--text-2); background: var(--bg-3); }
.nav-item.active {
    color: var(--text);
    background: var(--bg-4);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}
.nav-badge {
    margin-left: auto;
    background: var(--bg-4);
    color: var(--text-3);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-link-ext {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text-3);
    text-decoration: none;
    font-size: 0.8rem;
    border-radius: var(--radius);
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font);
    transition: all 0.15s;
}
.sidebar-link-ext:hover { color: var(--text-2); background: var(--bg-3); }

/* MAIN */
.main {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* TOPBAR */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.panel-theme-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 6px 9px;
    color: var(--text-2);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
}
.panel-theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.panel-theme-btn .theme-moon { display: none; }
html.light .panel-theme-btn .theme-sun { display: none; }
html.light .panel-theme-btn .theme-moon { display: inline; }
.panel-lang-switch { display: flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.panel-lang-btn {
    border: 0;
    background: transparent;
    color: var(--text-3);
    font: 600 0.68rem/1 Inter, system-ui, sans-serif;
    padding: 6px 8px;
    cursor: pointer;
}
.panel-lang-btn:hover { color: var(--text); }
.panel-lang-btn.active { background: var(--brand); color: #fff; }
.save-status { font-size: 0.8rem; color: var(--success); font-weight: 500; }
.save-status.error { color: var(--error); }
.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-3, #64748b);
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
    transition: background 0.2s, box-shadow 0.2s;
}
.sync-dot.live { background: var(--success); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15); }

/* Collapsible sections (student detail + homework groups) */
.acc {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 14px;
    overflow: hidden;
}
.acc-head {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    font-weight: 600;
    font-size: 0.92rem;
    user-select: none;
}
.acc-head::-webkit-details-marker { display: none; }
.acc-head:hover { background: rgba(255, 255, 255, 0.03); }
.acc-title { flex: 0 0 auto; }
.acc-sub { font-size: 0.72rem; color: var(--text-3); font-weight: 500; }
.acc-count { margin-left: auto; font-size: 0.7rem; color: var(--text-3); background: var(--bg-3); padding: 2px 9px; border-radius: 10px; }
.acc-chevron { color: var(--text-3); font-size: 0.8rem; transition: transform 0.15s; }
.acc[open] .acc-chevron { transform: rotate(180deg); }
.acc[open] > .acc-head { border-bottom: 1px solid var(--border); }
.acc-body { padding: 14px 16px; }
.hw-student-group .acc-body { padding: 0; }

/* Quick actions bar (Students page) */
.quick-actions-card { margin-bottom: 16px; }
.qa-btn { font-size: 0.78rem; }

/* MESSAGES (admin chat) */
.msg-admin-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; height: calc(100vh - 190px); min-height: 420px; }
.msg-admin-list { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2); overflow-y: auto; }
.msg-conv { position: relative; padding: 12px 34px 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.12s; }
.msg-conv-del {
    position: absolute;
    top: 10px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-3);
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.45;
}
.msg-conv-del:hover { opacity: 1; color: var(--error); border-color: var(--error); background: var(--error-soft); }
.msg-conv:hover { background: rgba(255, 255, 255, 0.03); }
.msg-conv.active { background: rgba(59, 130, 246, 0.12); border-left: 3px solid var(--accent); }
.msg-conv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.msg-conv-name { font-weight: 600; font-size: 0.85rem; }
.msg-conv-badge { background: var(--accent); color: #fff; font-size: 0.62rem; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.msg-conv-preview { font-size: 0.75rem; color: var(--text-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-admin-thread { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2); display: flex; flex-direction: column; overflow: hidden; }
.msg-admin-thread-head { padding: 13px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 0.9rem; flex: 0 0 auto; }
.msg-admin-thread-body { flex: 1 1 auto; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.msg-admin-thread .msg-chat-compose { flex: 0 0 auto; display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.msg-admin-thread .msg-chat-compose .input { flex: 1; }
.msg-chat-empty { text-align: center; color: var(--text-3); font-size: 0.82rem; margin: auto; }
.msg-bubble { max-width: 72%; padding: 8px 12px; border-radius: 12px; font-size: 0.82rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; display: flex; flex-direction: column; gap: 3px; }
.msg-bubble.them { align-self: flex-start; background: var(--bg-3); border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.msg-bubble.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 3px; }
.msg-time { font-size: 0.62rem; opacity: 0.6; }
.msg-del { background: none; border: 0; color: inherit; opacity: 0.5; cursor: pointer; font-size: 0.72rem; padding: 0; margin-top: 2px; align-self: flex-end; }
.msg-del:hover { opacity: 1; }
.msg-deleted { font-style: italic; opacity: 0.6; }
@media (max-width: 820px) { .msg-admin-layout { grid-template-columns: 1fr; height: auto; } .msg-admin-list { max-height: 220px; } .msg-admin-thread { height: 60vh; } }

/* CONTENT */
.content {
    flex: 1;
    padding: 28px 32px;
}
.page { display: none; }
.page.active { display: block; }
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}
.page-header h3 { font-family: var(--font-display); font-size: 0.95rem; font-weight: 600; }
.action-bar { display: flex; gap: 6px; flex-wrap: wrap; }

/* SEARCH */
.search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 12px;
    flex: 1;
    max-width: 360px;
    transition: border-color 0.2s;
}
.search-wrap:focus-within { border-color: var(--accent); }
.search-wrap svg { color: var(--text-3); flex-shrink: 0; }
.search-wrap input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
    padding: 9px 0;
    outline: none;
}
.search-wrap input::placeholder { color: var(--text-3); }

/* CARDS */
.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
}
.card-body { padding: 16px 20px; }

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }

/* FORMS */
.field { margin-bottom: 14px; }
.field label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-3);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.input {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 50px; }
select.input { cursor: pointer; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.color-input { display: flex; gap: 10px; align-items: center; }
.color-input input[type="color"] {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--bg-3);
    padding: 3px;
}
.days-row { display: flex; gap: 6px; flex-wrap: wrap; }
.day-chip input { display: none; }
.day-chip span {
    display: block;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8rem;
    color: var(--text-3);
    cursor: pointer;
    transition: all 0.15s;
}
.day-chip input:checked + span {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

/* STAT CARDS */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border-light); }
.stat-card .stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.stat-card .stat-icon svg { width: 18px; height: 18px; }
.stat-icon.blue { background: var(--accent-soft); color: var(--accent); }
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.yellow { background: var(--warning-soft); color: var(--warning); }
.stat-icon.gray { background: var(--bg-4); color: var(--text-3); }
.stat-card .stat-value {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}
.stat-card .stat-label {
    font-size: 0.7rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}
/* Compact single-line summary (Students page) */
.stat-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 22px;
    margin: 0 0 18px;
    padding: 2px 2px 0;
    font-size: 0.78rem;
    color: var(--text-3);
}
.stat-line span { display: inline-flex; align-items: baseline; gap: 5px; }
.stat-line strong { color: var(--text); font-weight: 600; font-size: 0.95rem; }

/* STUDENT ACCOUNT TYPE FILTERS */
.student-filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 0 12px;
}
.student-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--text-2);
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.student-filter-tab:hover { border-color: var(--accent); color: var(--text); }
.student-filter-tab.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}
.student-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--bg-4);
    color: var(--text-3);
    font-size: 0.65rem;
}
.student-filter-tab.active .student-filter-count {
    background: var(--accent);
    color: #fff;
}
.registered-badge, .noaccount-badge {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.06em;
    vertical-align: middle;
}
.registered-badge { background: var(--success-soft); color: var(--success); }
.noaccount-badge { background: var(--warning-soft); color: var(--warning); }
.teacher-child .registered-badge, .teacher-child .noaccount-badge { margin-left: 4px; }

/* MERGE STUDENT MODAL */
.merge-source-summary {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
}
.merge-source-name { font-weight: 600; font-size: 0.9rem; }
.merge-source-meta { font-size: 0.78rem; color: var(--text-3); margin-top: 2px; }
.merge-source-counts { font-size: 0.72rem; color: var(--text-2); margin-top: 6px; }
.merge-preview { min-height: 44px; margin-bottom: 12px; }
.merge-target {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 0.8rem;
}
.merge-target > span { color: var(--text-3); }
.merge-match { color: var(--accent); font-weight: 600; }
.merge-match.muted { color: var(--text-3); font-weight: 400; }
.merge-warning {
    border: 1px solid var(--warning);
    background: var(--warning-soft);
    color: var(--warning);
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 0.75rem;
    line-height: 1.5;
    margin-bottom: 14px;
}

/* STUDENT LIST */
.s-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-2);
    flex-shrink: 0;
}
.s-balance {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 20px;
}
.s-balance.positive { background: var(--success-soft); color: var(--success); }
.s-balance.zero { background: var(--warning-soft); color: var(--warning); }
.s-balance.negative { background: var(--error-soft); color: var(--error); }

/* STUDENT DETAIL */
.detail-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.detail-top h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.detail-top .subtitle { color: var(--text-3); font-size: 0.85rem; margin-top: 4px; }
.detail-actions { display: flex; gap: 6px; }

.detail-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}
.detail-stat {
    text-align: center;
    padding: 16px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.detail-stat .val { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; }
.detail-stat .lbl { font-size: 0.65rem; color: var(--text-3); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-section { margin-bottom: 16px; }
.detail-section h4 {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}
.history-item:last-child { border-bottom: none; }
.history-item .hi-date { color: var(--text-3); min-width: 90px; font-size: 0.8rem; }
.history-item .hi-detail { flex: 1; margin-left: 12px; }
.history-item .hi-amount { font-weight: 600; font-family: var(--font-display); }

.progress-entry {
    padding: 12px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-2);
}
.progress-entry .pe-text { margin-bottom: 6px; white-space: pre-wrap; }
.progress-entry .pe-actions { display: flex; align-items: center; justify-content: space-between; }
.progress-entry .pe-date { font-size: 0.7rem; color: var(--text-3); }
.progress-entry .pe-btns { display: flex; gap: 6px; }

.scheduled-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
    font-size: 0.85rem;
}
.scheduled-item .si-time { color: var(--accent); font-weight: 500; margin-left: auto; }

/* BOOKINGS */
.booking-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.booking-item:last-child { border-bottom: none; }
.booking-info { flex: 1; }
.booking-info .name { font-weight: 600; font-size: 0.9rem; }
.booking-info .detail { font-size: 0.8rem; color: var(--text-3); margin-top: 3px; }
.booking-info .slot { font-size: 0.8rem; color: var(--accent); margin-top: 3px; font-weight: 500; }
.booking-actions { display: flex; gap: 6px; align-items: center; }
.booking-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.booking-status.requested { background: var(--warning-soft); color: var(--warning); }
.booking-status.confirmed { background: var(--success-soft); color: var(--success); }
.booking-status.rejected { background: var(--error-soft); color: var(--error); }

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    padding: 20px;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.modal-close {
    float: right;
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
    font-size: 1.1rem;
    line-height: 1;
    transition: all 0.15s;
}
.modal-close:hover { color: var(--text); background: var(--bg-3); }

.text-muted { color: var(--text-3); font-size: 0.85rem; }
.empty-msg { text-align: center; padding: 32px; color: var(--text-3); font-size: 0.85rem; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table th { color: var(--text-3); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.data-table tr:last-child td { border-bottom: 0; }
.teacher-name-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}
.teacher-expand {
    background: none;
    border: 0;
    padding: 0;
    color: var(--brand);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}
.teacher-expand::after {
    content: '\25B8';
    font-size: 0.65rem;
    transition: transform 0.15s ease;
}
.teacher-expand.open::after {
    content: '\25BE';
}
.teacher-children td {
    background: rgba(255, 255, 255, 0.02);
    padding-top: 4px;
    padding-bottom: 10px;
    padding-left: 32px;
    border-bottom: 1px solid var(--border);
}
.teacher-children-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.teacher-child {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    padding: 4px 9px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
}
.teacher-child small {
    color: var(--text-3);
    font-size: 0.68rem;
}

/* ==================== CALENDAR ==================== */
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.cal-head {
    background: var(--bg-3);
    padding: 10px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    text-align: center;
}
.cal-day {
    background: var(--bg-2);
    min-height: 110px;
    padding: 6px 8px;
    position: relative;
    cursor: pointer;
    transition: background 0.1s;
}
.cal-day:hover { background: var(--bg-3); }
.cal-day.other-month { background: var(--bg); opacity: 0.5; }
.cal-day.today { background: var(--accent-soft); }
.cal-day.today .cal-day-num { color: var(--accent); font-weight: 700; }
.cal-day-num {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 4px;
}
.cal-day.today .cal-day-num { color: var(--accent); }
.cal-event {
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 3px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    font-weight: 500;
}
.cal-event.lesson { background: var(--accent-soft); color: var(--accent); border-left: 2px solid var(--accent); }
.cal-note-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 3px;
    opacity: 0.6;
    vertical-align: middle;
}
.cal-event.lesson .cal-note-icon { color: var(--accent); }
.cal-event.scheduled { background: var(--success-soft); color: var(--success); border-left: 2px solid var(--success); }
.cal-event.payment { background: var(--warning-soft); color: var(--warning); border-left: 2px solid var(--warning); }
.cal-more {
    font-size: 0.6rem;
    color: var(--text-3);
    padding: 1px 5px;
    cursor: pointer;
}
.cal-more:hover { color: var(--accent); }
.cal-legend {
    display: flex;
    gap: 16px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-3);
}
.cal-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

/* REMOVE BUTTONS */
.btn-remove {
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    opacity: 0;
    transition: all 0.15s;
    flex-shrink: 0;
}
.history-item:hover .btn-remove,
.scheduled-item:hover .btn-remove { opacity: 1; }
.btn-remove:hover { color: var(--error); background: var(--error-soft); }
.btn-remove-inline {
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 0.65rem;
    cursor: pointer;
    padding: 0 4px;
    text-decoration: underline;
    transition: color 0.15s;
}
.btn-remove-inline:hover { color: var(--error); }

/* RESOURCES */
.resource-item {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 8px;
}
.ri-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ri-icon { font-size: 0.9rem; flex-shrink: 0; }
.ri-title { font-weight: 600; font-size: 0.85rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-date { font-size: 0.7rem; color: var(--text-3); white-space: nowrap; margin-left: auto; }

/* STUDENT CARDS */
.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.student-group{margin-bottom:24px}
.student-group-label{font-family:var(--font-display);font-size:0.8rem;font-weight:600;color:var(--text-3);text-transform:uppercase;letter-spacing:0.04em;margin-bottom:10px;padding-bottom:6px;border-bottom:1px solid var(--border)}
.student-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}
.student-card:hover { border-color: var(--accent); background: var(--bg-3); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.student-card.card-depleted{border-color:var(--error);border-width:1.5px}
.student-card.card-warning{border-color:var(--warning);border-width:1.5px}
.student-card.card-success{border-color:var(--success);border-width:1.5px}
.student-card.card-zero{opacity:.65}
.card-actions{display:flex;gap:4px;justify-content:flex-end;padding-top:8px;border-top:1px solid var(--border);opacity:0;transition:opacity .15s}
.student-card:hover .card-actions{opacity:1}
.card-action-btn{background:none;border:1px solid var(--border);border-radius:6px;padding:5px 7px;color:var(--text-3);cursor:pointer;transition:all .15s;display:flex;align-items:center;justify-content:center}
.card-action-btn:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}
.student-card-top { display: flex; align-items: center; gap: 12px; }
.student-card-info { flex: 1; min-width: 0; }
.student-card-name { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-card-meta { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }
.student-card-stats { display: flex; gap: 16px; font-size: 0.8rem; }
.student-card-stats span { color: var(--text-2); }
.student-card-stats strong { color: var(--text); font-weight: 600; }

.new-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.06em;
    vertical-align: middle;
    margin-left: 6px;
}
.pending-badge {
    display: inline-block;
    background: var(--warning-soft);
    color: var(--warning);
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.06em;
    vertical-align: middle;
    margin-left: 4px;
}

/* FINANCES */
.finances-bars{display:flex;align-items:flex-end;gap:8px;height:220px;padding:16px 0 0}
.fin-bar-col{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px}
.fin-bar-wrap{width:100%;height:180px;display:flex;align-items:flex-end;justify-content:center}
.fin-bar{width:100%;max-width:48px;background:var(--accent);border-radius:4px 4px 0 0;transition:height .3s;min-height:2px;position:relative}
.fin-bar:hover{background:var(--accent-hover)}

/* HOMEWORK */
.hw-student-row{display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:0.82rem;cursor:pointer;border-radius:var(--radius);transition:background 0.15s;border:1px solid transparent}
.hw-student-row:hover{background:rgba(255,255,255,0.03);border-color:var(--border)}
.hw-student-avatar{width:30px;height:30px;border-radius:50%;background:var(--accent-soft);color:var(--accent);display:flex;align-items:center;justify-content:center;font-size:0.65rem;font-weight:700;flex-shrink:0}
.hw-student-list{display:flex;flex-direction:column;gap:4px}
.hw-student-header{display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:0.75rem;font-weight:600;color:var(--text-3);text-transform:uppercase;letter-spacing:0.04em;border-bottom:1px solid var(--border);margin-bottom:4px}
.hw-qbuilder-item{background:var(--bg-2);border:1px solid var(--border);border-radius:var(--radius-lg);padding:16px;margin-bottom:12px;transition:border-color 0.15s}
.hw-qbuilder-item:hover{border-color:var(--border-light)}
.hw-qbuilder-head{display:flex;align-items:center;justify-content:space-between;cursor:pointer;transition:background 0.15s;border-radius:var(--radius) var(--radius) 0 0}
.hw-qbuilder-head:hover{background:rgba(255,255,255,0.03)}
.hw-qbuilder-num{font-size:0.75rem;font-weight:700;color:var(--accent);text-transform:uppercase;letter-spacing:0.04em}
.hw-qbuilder-remove{background:none;border:none;color:var(--text-3);font-size:0.72rem;cursor:pointer;padding:2px 6px;border-radius:4px;transition:color 0.15s,background 0.15s}
.hw-qbuilder-remove:hover{color:var(--error);background:var(--error-soft)}
.hw-q-sa-tags{display:flex;flex-wrap:wrap;gap:4px}
.hw-q-sa-tag{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;background:var(--bg-3);border:1px solid var(--border);border-radius:4px;font-size:0.78rem;cursor:default}
.hw-q-sa-tag button{background:none;border:none;color:var(--text-3);cursor:pointer;font-size:0.7rem;padding:0 2px;transition:color 0.15s}
.hw-q-sa-tag button:hover{color:var(--error)}

/* HOMEWORK ADMIN LIST - Override shared styles for admin context */
.hw-admin-card {
    background: var(--bg-2) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    padding: 16px !important;
    margin-bottom: 10px !important;
    transition: border-color 0.15s ease, background 0.15s ease !important;
}
.hw-admin-card:hover {
    border-color: var(--border-light) !important;
    background: var(--bg-3) !important;
}
.hw-admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.hw-admin-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}
.hw-admin-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.hw-admin-students {
    font-size: 0.78rem;
    color: var(--text-2);
    padding: 6px 0;
    border-top: 1px solid var(--border);
}
.hw-admin-students strong {
    color: var(--text);
}
.hw-admin-actions {
    display: flex;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
.hw-admin-actions .btn-outline {
    font-size: 0.72rem;
    padding: 5px 10px;
}
.hw-admin-actions .btn-remove {
    font-size: 0.72rem;
    padding: 5px 10px;
    opacity: 1;
}
.fin-bar-val{position:absolute;top:-20px;left:50%;transform:translateX(-50%);font-size:0.6rem;font-weight:600;color:var(--text-2);white-space:nowrap}
.fin-bar-label{font-size:0.7rem;color:var(--text-2);font-weight:500}
.fin-bar-sub{font-size:0.6rem;color:var(--text-3)}
@media(max-width:600px){.finances-bars{height:160px}.fin-bar-wrap{height:120px}.fin-bar{max-width:28px}}

/* RESPONSIVE */
@media (max-width: 768px) {
    .cal-day { min-height: 70px; padding: 4px; }
    .cal-event { font-size: 0.6rem; padding: 1px 3px; }
    .cal-day-num { font-size: 0.65rem; }
    .day-square-num { font-size: 3rem; }
    .day-square-card { padding: 16px; }
    .sidebar { width: 60px; }
    .sidebar-header { padding: 16px; justify-content: center; }
    .sidebar-brand, .nav-item span, .nav-badge, .sidebar-footer { display: none; }
    .nav-item { justify-content: center; padding: 12px; }
    .nav-item.active::before { display: none; }
    .main { margin-left: 60px; }
    .content { padding: 20px 16px; }
    .detail-stats { grid-template-columns: repeat(2, 1fr); }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .field-row { grid-template-columns: 1fr; }
    .action-bar { width: 100%; }
    .overview-columns { grid-template-columns: 1fr !important; }
}

/* OVERVIEW COLUMNS */
.overview-columns {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    align-items: start;
}

/* DAY SQUARE */
.day-square-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.day-square-top {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}
.day-square-num {
    font-family: var(--font-display);
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
    margin-bottom: 8px;
}
.day-square-divider {
    width: 40px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    margin-bottom: 16px;
}
.day-square-lessons {
    width: 100%;
}
.day-square-lessons-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}
.day-square-nolessons {
    font-size: 0.8rem;
    color: var(--text-3);
    padding: 8px 0;
}
.day-square-tomorrow {
    width: 100%;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    text-align: left;
}
.day-square-tomorrow-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 6px;
}

/* POST-IT NOTES */
.postits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.postit {
    padding: 10px 14px;
    border-radius: 2px;
    box-shadow: 2px 3px 6px rgba(0,0,0,.25);
    min-width: 110px;
    max-width: 140px;
    font-size: 0.78rem;
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
}
.postit:hover {
    transform: rotate(0deg) !important;
    box-shadow: 3px 5px 12px rgba(0,0,0,.35);
    z-index: 2;
}
.postit::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,.06) 50%);
    border-radius: 0 2px 0 0;
}
.postit-time {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(0,0,0,.45);
    margin-bottom: 2px;
    letter-spacing: 0.02em;
}
.postit-student {
    font-weight: 600;
    color: rgba(0,0,0,.7);
    line-height: 1.3;
}
.postit-status {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.postit-status.planned {
    background: rgba(34,197,94,.85);
    color: #fff;
}
.postit-status.unplanned {
    background: rgba(245,158,11,.85);
    color: #fff;
}

/* NOTE COMPOSER (Overview) */
.note-composer {
    border-left: 3px solid var(--accent);
}
.note-composer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 4px;
}

/* PROGRESS CARD (Student Detail) */
.progress-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    border-left: 3px solid #a855f7;
    overflow: hidden;
}
.progress-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 0;
}
.progress-card-header h4 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.progress-count {
    font-size: 0.7rem;
    color: var(--text-3);
    background: var(--bg-3);
    padding: 3px 10px;
    border-radius: 12px;
}
.progress-compose {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}
#studentProgressList {
    padding: 12px 20px;
    max-height: 400px;
    overflow-y: auto;
}
#studentProgressList .progress-entry {
    border-left: 2px solid #a855f7;
    padding-left: 12px;
}

/* PROGRESS PREVIEW (Overview) */
.progress-preview {
    padding: 10px 12px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-left: 3px solid #a855f7;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.progress-preview:last-child { margin-bottom: 0; }
.progress-preview:hover { border-color: #a855f7; background: var(--bg-4); }
.pp-student {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.pp-text {
    font-size: 0.78rem;
    color: var(--text-2);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pp-date {
    font-size: 0.68rem;
    color: var(--text-3);
    margin-top: 4px;
}

/* MISSING NOTES ALERT */
.missing-notes-alert {
    background: var(--warning-soft);
    border: 1px solid rgba(245,158,11,.2);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 14px;
}
.mna-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--warning);
    margin-bottom: 6px;
}
.mna-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.12s;
}
.mna-item:hover { background: rgba(245,158,11,.1); }
.mna-student { font-weight: 600; color: var(--text-2); }
.mna-date { color: var(--text-3); font-size: 0.72rem; }

/* PROGRESS GROUPS */
.pp-group {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
}
.pp-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.12s;
    user-select: none;
}
.pp-group-header:hover { background: var(--bg-4); }
.pp-group-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.pp-group-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}
.pp-group-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pp-group-meta {
    font-size: 0.68rem;
    color: var(--text-3);
    margin-top: 1px;
}
.pp-group-chevron {
    color: var(--text-3);
    flex-shrink: 0;
    transition: transform 0.2s;
}
.pp-group-chevron.open { transform: rotate(180deg); }
.pp-group-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    padding: 0 14px;
}
.pp-group-body.open {
    max-height: 600px;
    padding: 0 14px 10px;
}
.pp-note {
    padding: 8px 10px;
    background: var(--bg);
    border-left: 2px solid #a855f7;
    border-radius: 4px;
    margin-bottom: 6px;
}
.pp-note:last-child { margin-bottom: 0; }
.pp-note .pp-text {
    font-size: 0.78rem;
    color: var(--text-2);
    line-height: 1.4;
    white-space: pre-wrap;
}
.pp-note-aims {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.pp-aim {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-4);
    color: var(--text-3);
}
.pp-aim.done {
    background: var(--success-soft);
    color: var(--success);
}

/* UNPLANNED LESSONS ALERT */
.unplanned-alert {
    background: var(--accent-soft);
    border: 1px solid rgba(59,130,246,.2);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 14px;
}
.ua-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 6px;
}
.ua-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.12s;
}
.ua-item:hover { background: rgba(59,130,246,.1); }
.ua-student { font-weight: 600; color: var(--text-2); }
.ua-date { color: var(--text-3); font-size: 0.72rem; }

/* LESSON PLANNER */
.lp-section { margin-bottom: 14px; }
.lp-header {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}
.lp-card {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 6px;
}
.lp-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.lp-card-student {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}
.lp-card-meta {
    font-size: 0.7rem;
    color: var(--text-3);
}
.lp-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.lp-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.lp-badge.planned {
    background: var(--success-soft);
    color: var(--success);
}
.lp-badge.unplanned {
    background: var(--warning-soft);
    color: var(--warning);
}
.lp-badge.logged {
    background: var(--success-soft);
    color: var(--success);
}

/* AIM ROWS (modal) */
.aim-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.aim-row .aim-input { flex: 1; }

/* AIM CHECKBOXES (lesson logging) */
.plan-aims-review {
    margin-bottom: 14px;
    padding: 12px;
    background: var(--bg-3);
    border-radius: var(--radius);
    border-left: 3px solid var(--success);
}
.aim-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-2);
    transition: background 0.12s;
}
.aim-check:hover { background: var(--bg-4); }
.aim-check input[type="checkbox"] {
    accent-color: var(--success);
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.aim-check-text { flex: 1; }

/* PROGRESS ENTRY AIMS (student detail) */
.pe-aims {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    margin-bottom: 4px;
}
.pe-aim {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 10px;
}
.pe-aim.completed {
    background: var(--success-soft);
    color: var(--success);
}
.pe-aim.pending {
    background: var(--bg-4);
    color: var(--text-3);
}
.pe-lesson-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    color: var(--accent);
    margin-left: 6px;
}
.pe-type-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
}
.pe-type-badge.plan {
    background: var(--accent-soft);
    color: var(--accent);
}
.pe-type-badge.logged {
    background: var(--success-soft);
    color: var(--success);
}

/* LESSON PLANS ADMIN */
.lp-admin-group {
    margin-bottom: 20px;
}
.lp-admin-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.lp-admin-group-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.lp-admin-card {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 8px;
    transition: border-color 0.15s;
}
.lp-admin-card:hover { border-color: var(--border-light); }
.lp-admin-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.lp-admin-card-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.lp-admin-card-text {
    font-size: 0.78rem;
    color: var(--text-2);
    line-height: 1.4;
    white-space: pre-wrap;
}
.lp-admin-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.lp-admin-aims {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}
.lp-aim {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-4);
    color: var(--text-3);
}
.lp-aim.done {
    background: var(--success-soft);
    color: var(--success);
}
.lp-admin-hw {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}
.lp-admin-hw-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.lp-hw-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
}
.lp-hw-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--bg-4);
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 0.82rem;
}
.lp-hw-list {
    max-height: 300px;
    overflow-y: auto;
}

/* VOCABULARY TAGS */
.vocab-box {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.vocab-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
}
.vocab-tag button {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.vocab-tag button:hover { color: var(--error); }
.vocab-input-wrap { width: 100%; }
.vocab-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

/* PLAN SUMMARY (logging popup) */
.plan-summary {
    margin-bottom: 16px;
    padding: 14px;
    background: var(--bg-3);
    border-radius: var(--radius);
    border-left: 3px solid var(--success);
}
.plan-summary-section {
    margin-bottom: 10px;
}
.plan-summary-section:last-child { margin-bottom: 0; }
.plan-summary-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.plan-summary-text {
    font-size: 0.82rem;
    color: var(--text-2);
    line-height: 1.4;
    white-space: pre-wrap;
}

/* LESSON PLAN CARD SECTIONS */
.lp-admin-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 3px;
}
.lp-admin-desc { margin-top: 8px; }
.lp-admin-desc-text {
    font-size: 0.78rem;
    color: var(--text-2);
    line-height: 1.4;
    white-space: pre-wrap;
}
.lp-admin-vocab { margin-top: 8px; }
.lp-admin-postnotes {
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--success-soft);
    border-radius: 6px;
    border-left: 2px solid var(--success);
}
.lp-admin-postnotes .pe-section-label,
.lp-admin-postnotes .lp-admin-label { color: var(--success); }
.lp-admin-postnotes-text {
    font-size: 0.78rem;
    color: var(--text-2);
    line-height: 1.4;
    white-space: pre-wrap;
}

/* PROGRESS ENTRY SECTIONS (student detail) */
.pe-section { margin-top: 8px; }
.pe-section-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 3px;
}
.pe-section-text {
    font-size: 0.8rem;
    color: var(--text-2);
    line-height: 1.4;
    white-space: pre-wrap;
}
.pe-postnotes {
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--success-soft);
    border-radius: 6px;
    border-left: 2px solid var(--success);
}

/* GROUP */
.group-badge {
    display: inline-block;
    background: #8b5cf6;
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.06em;
    vertical-align: middle;
    margin-left: 6px;
}
.group-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-2);
    cursor: pointer;
    padding: 8px 0;
}
.group-toggle-cb {
    accent-color: #8b5cf6;
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.group-members-panel {
    background: rgba(139,92,246,.06);
    border: 1px solid rgba(139,92,246,.2);
    border-radius: var(--radius);
    padding: 10px;
    margin-bottom: 14px;
}
.group-members-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 600;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}
.group-member-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.group-member-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.gm-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(139,92,246,.15);
    color: #8b5cf6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}
.gm-info { min-width: 0; }
.gm-name { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.gm-meta { font-size: 0.7rem; color: var(--text-3); }
.group-members-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-left: 3px solid #8b5cf6;
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.group-members-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 0;
}
.group-members-card-header h4 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.group-members-count {
    font-size: 0.7rem;
    color: #8b5cf6;
    background: rgba(139,92,246,.15);
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}
.group-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    padding: 12px 18px 16px;
}

/* PRE-LESSON PREP */
.prep-item {
    padding: 10px 12px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
}
.prep-item:last-child { margin-bottom: 0; }
.prep-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.prep-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}
.prep-item-date {
    font-size: 0.72rem;
    color: var(--text-3);
}
.prep-item-section {
    margin-top: 6px;
}
.prep-item-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 2px;
}
.prep-item-text {
    font-size: 0.78rem;
    color: var(--text-2);
    line-height: 1.4;
}
.prep-aim-tag {
    display: inline-block;
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--warning-soft);
    color: var(--warning);
    margin-right: 4px;
    margin-bottom: 2px;
}
.prep-hw-tag {
    display: inline-block;
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    margin-right: 4px;
    margin-bottom: 2px;
}

/* ==================== LIGHT MODE ==================== */
html.light {
    --bg: #f4f6f9;
    --bg-2: #ffffff;
    --bg-3: #f1f4f8;
    --bg-4: #e9eef5;
    --surface: #dde4ec;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: rgba(37, 99, 235, 0.09);
    --text: #1f2937;
    --text-2: #4b5563;
    --text-3: #6b7280;
    --border: #d9e0e8;
    --border-light: #c9d2dd;
    --success: #15803d;
    --success-soft: rgba(21, 128, 61, 0.09);
    --warning: #a16207;
    --warning-soft: rgba(161, 98, 7, 0.09);
    --error: #b91c1c;
    --error-soft: rgba(185, 28, 28, 0.07);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);
}
html.light body,
html.light .main,
html.light .login-screen { background: var(--bg); color: var(--text); }
html.light .sidebar,
html.light .topbar,
html.light .card,
html.light .modal,
html.light .msg-admin-list,
html.light .msg-admin-thread { background: var(--bg-2); }
html.light .nav-item:hover,
html.light .msg-conv:hover { background: rgba(15, 23, 42, 0.04); }
html.light .msg-conv.active { background: rgba(37, 99, 235, 0.08); }
html.light .msg-bubble.them { background: #f3f5f8; border-color: var(--border); color: var(--text); }
html.light .cal-day { background: var(--bg-2); }
html.light .cal-day.other-month { background: var(--bg-3); }
html.light .data-table th { background: var(--bg-3); }
html.light .input { background: var(--bg-3); color: var(--text); }
html.light .btn-outline { color: var(--text-2); border-color: var(--border); }
html.light .btn-primary { color: #fff; }
html.light .login-card { background: var(--bg-2); }
html.light .topbar { border-bottom-color: var(--border); }
html.light ::-webkit-scrollbar-track { background: var(--bg); }
html.light ::-webkit-scrollbar-thumb { background: var(--surface); }
html.light .modal-overlay { background: rgba(15, 23, 42, 0.28); }

/* SUPPORT MESSAGES */
.support-msg {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--bg-2);
}
.support-msg.unread {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.support-msg-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.support-msg-name { font-weight: 600; font-size: 0.85rem; }
.support-msg-role {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
    margin-left: 4px;
}
.support-msg-date { font-size: 0.7rem; color: var(--text-3); white-space: nowrap; }
.support-msg-email { font-size: 0.72rem; color: var(--text-3); margin-top: 3px; }
.support-msg-subject { font-weight: 600; font-size: 0.82rem; margin-top: 10px; }
.support-msg-body { font-size: 0.83rem; line-height: 1.55; margin-top: 6px; white-space: pre-wrap; }
.support-msg-read { font-size: 0.68rem; color: var(--text-3); }
html.light .support-msg.unread { background: rgba(37, 99, 235, 0.06); }

/* ==================== TEACHER PLAN / USAGE ==================== */
.plan-usage-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -4px 0 18px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-3);
}
.plan-usage-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.plan-usage-text { color: var(--text-2); font-size: 0.78rem; }
.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.plan-usage-bar.limit-reached {
    border-color: var(--warning);
    background: var(--warning-soft);
}
.plan-usage-bar.limit-reached .plan-badge {
    background: var(--warning);
    color: #111;
}
.plan-card { grid-column: 1 / -1; }
.plan-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-name { color: var(--text); font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }
.plan-students { margin-top: 2px; color: var(--text-3); font-size: 0.78rem; }
.plan-meter { height: 6px; margin: 14px 0 10px; overflow: hidden; border-radius: 99px; background: var(--bg-4); }
.plan-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.3s ease; }
.plan-card.limit-reached .plan-meter span { background: var(--warning); }
.plan-note { margin-bottom: 12px; font-size: 0.76rem; line-height: 1.5; }
.plan-card .btn-outline { font-size: 0.76rem; }
@media (max-width: 600px) {
    .plan-usage-bar { align-items: flex-start; flex-direction: column; }
    .plan-usage-bar .btn-outline { width: 100%; justify-content: center; }
}
.plan-compare-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg-3);
}
.plan-compare-row div { display: flex; flex-direction: column; gap: 2px; }
.plan-compare-row strong { color: var(--text); font-size: 0.82rem; }
.plan-compare-row span { color: var(--text-3); font-size: 0.72rem; }
.plan-compare-row b { color: var(--accent); font-size: 0.76rem; white-space: nowrap; }
.btn-primary.limit-reached,
.btn-primary:disabled {
    background: var(--bg-4);
    border-color: var(--border);
    color: var(--text-3);
    box-shadow: none;
    cursor: not-allowed;
}

/* ==================== OVERVIEW SUMMARY PILLS ==================== */
.stats-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-2);
    color: var(--text-3);
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
}
.stat-pill b {
    color: var(--text);
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.sp-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.sp-dot.accent { background: var(--accent); }
.sp-dot.green { background: var(--success); }
.sp-dot.amber { background: var(--warning); }
.sp-dot.red { background: var(--error); }

/* ==================== LESSONS PRELOADER ==================== */
.lessons-preloader {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg, var(--bg-primary, #09090b));
    color: var(--text, var(--text-primary, #fafafa));
    transition: opacity .35s ease, visibility .35s ease;
}
.lessons-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.lessons-preloader-inner {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 18px;
}
.lessons-preloader-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
    opacity: .85;
}
.lessons-preloader-logo {
    font-family: 'Space Grotesk', var(--font-display, sans-serif);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--text, var(--text-primary, #fafafa));
}
.lessons-preloader-logo span {
    color: var(--accent, var(--brand, #3b82f6));
}
.lessons-preloader-bar {
    width: 180px;
    height: 1px;
    overflow: hidden;
    background: var(--border, rgba(255,255,255,.12));
}
.lessons-preloader-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent, var(--brand, #3b82f6));
    animation: lessonsPreloadBar 1.4s ease-in-out infinite;
}
@keyframes lessonsPreloadBar {
    0% { width: 0; opacity: .4; }
    45% { width: 100%; opacity: 1; }
    100% { width: 100%; opacity: 0; }
}
