/* ================================================================
   StudyHub LMS v2 — Shared Stylesheet
   assets/css/style.css
   Dark theme. One file for the entire app.
   ================================================================ */

/* ── 1. CSS VARIABLES ─────────────────────────────────────────── */
:root {
    --bg:         #12151f;
    --surface:    #1a1e2e;
    --card:       #1f2336;
    --card-hover: #252a40;
    --border:     #2e3450;
    --border-dim: #222640;

    --accent:     #86efac;   /* sage green  */
    --accent2:    #7dd3fc;   /* sky blue    */
    --warn:       #fcd34d;   /* soft amber  */
    --err:        #fca5a5;   /* soft rose   */

    --text:       #e2e8f8;
    --text-muted: #8896b3;
    --text-dim:   #56638a;

    --sidebar-w:  240px;
    --navbar-h:   60px;
    --radius:     12px;
    --radius-sm:  8px;
    --radius-lg:  16px;

    --shadow:     0 4px 20px rgba(0,0,0,0.35);
    --shadow-sm:  0 2px 8px rgba(0,0,0,0.25);
}

/* ── 2. RESET & BASE ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 0.9375rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }

/* ── 3. TYPOGRAPHY ────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: 'Syne', sans-serif; font-weight: 700; line-height: 1.2; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.95rem; }

p { color: var(--text-muted); }

/* ── 4. LAYOUT SHELL ──────────────────────────────────────────── */
.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--navbar-h) 1fr;
    min-height: 100vh;
}

.app-layout .navbar    { grid-column: 1 / -1; grid-row: 1; }
.app-layout .sidebar   { grid-column: 1;       grid-row: 2; }
.app-layout .main-content { grid-column: 2;    grid-row: 2; }

/* ── 5. NAVBAR ────────────────────────────────────────────────── */
.navbar {
    height: var(--navbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.navbar-logo {
    height: 30px;
    width: auto;
    border-radius: 6px;
}

.navbar-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Syne', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    color: #0d0f14;
    flex-shrink: 0;
}

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

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.btn-logout:hover {
    color: var(--err);
    border-color: rgba(248,113,113,0.4);
    background: rgba(248,113,113,0.06);
}

/* ── 6. SIDEBAR ───────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--navbar-h);
    height: calc(100vh - var(--navbar-h));
    overflow-y: auto;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.2rem;
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    padding: 0.4rem 0.65rem;
    margin-bottom: 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    text-decoration: none;
}

.sidebar-link:hover {
    color: var(--text);
    background: rgba(255,255,255,0.04);
    border-color: var(--border-dim);
}

.sidebar-link.active {
    color: var(--accent);
    background: rgba(74,222,128,0.08);
    border-color: rgba(74,222,128,0.2);
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-dim);
}

.sidebar-logout {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 0.5rem 0.65rem;
    display: block;
    border-radius: var(--radius-sm);
    transition: color 0.15s;
}
.sidebar-logout:hover { color: var(--err); }

/* ── 7. MAIN CONTENT AREA ─────────────────────────────────────── */
.main-content {
    padding: 2rem 2.5rem;
    overflow-y: auto;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 { margin-bottom: 0.3rem; }
.page-header p  { font-size: 0.9rem; }

.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* ── 8. STAT CARDS ────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    transition: border-color 0.2s, transform 0.2s;
}

.stat-card:hover {
    border-color: rgba(74,222,128,0.25);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.6rem;
}

.stat-card .stat-value {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .stat-sub {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

.stat-card.green  .stat-value { color: var(--accent); }
.stat-card.cyan   .stat-value { color: var(--accent2); }
.stat-card.amber  .stat-value { color: var(--warn); }
.stat-card.red    .stat-value { color: var(--err); }

/* ── 9. CARDS ─────────────────────────────────────────────────── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-dim);
}

.card-header h2, .card-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

/* Course card */
.course-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    opacity: 0;
    transition: opacity 0.2s;
}

.course-card:hover {
    border-color: rgba(74,222,128,0.3);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.course-card:hover::before { opacity: 1; }

.course-card .course-code {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent2);
}

.course-card .course-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.course-card .course-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    flex: 1;
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }

/* ── 10. PROGRESS BAR ─────────────────────────────────────────── */
.progress-wrap {
    background: var(--border);
    border-radius: 99px;
    height: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 99px;
    transition: width 0.4s ease;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

/* ── 11. BADGES ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-green  { background: rgba(74,222,128,0.1);  color: var(--accent);  border: 1px solid rgba(74,222,128,0.25); }
.badge-cyan   { background: rgba(34,211,238,0.1);  color: var(--accent2); border: 1px solid rgba(34,211,238,0.25); }
.badge-amber  { background: rgba(245,158,11,0.1);  color: var(--warn);    border: 1px solid rgba(245,158,11,0.25); }
.badge-red    { background: rgba(248,113,113,0.1); color: var(--err);     border: 1px solid rgba(248,113,113,0.25); }
.badge-muted  { background: rgba(107,122,153,0.1); color: var(--text-muted); border: 1px solid rgba(107,122,153,0.2); }

/* Role badges */
.user-role-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
}

.role-admin     { background: rgba(245,158,11,0.15);  color: var(--warn);    border: 1px solid rgba(245,158,11,0.3); }
.role-professor { background: rgba(34,211,238,0.12);  color: var(--accent2); border: 1px solid rgba(34,211,238,0.25); }
.role-student   { background: rgba(74,222,128,0.1);   color: var(--accent);  border: 1px solid rgba(74,222,128,0.2); }

/* ── 12. BUTTONS ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: opacity 0.2s, transform 0.15s, background 0.15s, border-color 0.15s;
    text-decoration: none;
    line-height: 1;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #0d0f14;
    font-weight: 700;
}
.btn-primary:hover { opacity: 0.88; color: #0d0f14; }

.btn-secondary {
    background: var(--card);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--accent2); color: var(--accent2); }

.btn-danger {
    background: rgba(248,113,113,0.1);
    color: var(--err);
    border-color: rgba(248,113,113,0.3);
}
.btn-danger:hover { background: rgba(248,113,113,0.2); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── 13. FORMS ────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.95rem;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent2);
}

.form-group select option { background: var(--card); }
.form-group textarea { resize: vertical; min-height: 100px; }

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

.form-hint {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

/* ── 14. TABLES ───────────────────────────────────────────────── */
.table-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrap th {
    background: var(--surface);
    padding: 0.7rem 1.1rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.table-wrap td {
    padding: 0.85rem 1.1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-dim);
    vertical-align: middle;
}

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

.table-wrap tr:hover td { background: rgba(255,255,255,0.02); }

/* ── 15. ALERTS & FLASH MESSAGES ─────────────────────────────── */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(74,222,128,0.08);
    border: 1px solid rgba(74,222,128,0.25);
    color: var(--accent);
}

.alert-error {
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.25);
    color: var(--err);
}

.alert-warning {
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.25);
    color: var(--warn);
}

.alert-info {
    background: rgba(34,211,238,0.08);
    border: 1px solid rgba(34,211,238,0.25);
    color: var(--accent2);
}

/* ── 16. AUTH PAGES (login / register) ───────────────────────── */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 10% 10%, rgba(74,222,128,0.05) 0%, transparent 55%),
        radial-gradient(ellipse at 90% 90%, rgba(34,211,238,0.05) 0%, transparent 55%);
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.auth-card .auth-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.75rem;
}

.auth-card .auth-logo img { height: 36px; border-radius: 8px; }

.auth-card .auth-logo .auth-brand {
    font-family: 'Syne', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card h1 {
    font-size: 1.4rem;
    margin-bottom: 0.3rem;
}

.auth-card .auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.auth-card .auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-card .auth-footer a { color: var(--accent2); font-weight: 600; }
.auth-card .auth-footer a:hover { color: var(--accent); }

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* ── 17. LESSON / CONTENT AREA ────────────────────────────────── */
.lesson-body {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    line-height: 1.85;
    font-size: 0.975rem;
    color: #c8d4e8;
}

.lesson-body p  { margin-bottom: 1rem; }

.lesson-body pre {
    background: #0a0d12;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 1.25rem 0;
    font-size: 0.855rem;
    line-height: 1.65;
}

.lesson-body code {
    background: rgba(74,222,128,0.08);
    border: 1px solid rgba(74,222,128,0.15);
    border-radius: 4px;
    padding: 0.1em 0.4em;
    font-size: 0.875em;
    color: var(--accent);
}

.lesson-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: #7dd3fc;
}

/* ── 18. QUIZ COMPONENTS ──────────────────────────────────────── */
.quiz-question {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.quiz-question .q-num {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.quiz-question .q-text {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.1rem;
}

.quiz-options { display: flex; flex-direction: column; gap: 0.55rem; }

.quiz-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

.quiz-option:hover { border-color: var(--accent2); background: rgba(34,211,238,0.04); }

.quiz-option input[type="radio"] { display: none; }

.quiz-option:has(input:checked) {
    border-color: var(--accent2);
    background: rgba(34,211,238,0.07);
}

.option-key {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.opt-correct { border-color: var(--accent) !important; background: rgba(74,222,128,0.08) !important; }
.opt-correct .option-key { background: var(--accent); color: #0d0f14; border-color: var(--accent); }
.opt-wrong   { border-color: var(--err)    !important; background: rgba(248,113,113,0.07) !important; }
.opt-wrong   .option-key { background: var(--err); color: #fff; border-color: var(--err); }

/* Score card */
.score-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.score-number {
    font-family: 'Syne', sans-serif;
    font-size: 4.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
}

/* ── 19. EMPTY STATES ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { color: var(--text); margin-bottom: 0.4rem; }
.empty-state p  { font-size: 0.9rem; margin-bottom: 1.5rem; }

/* ── 20. BREADCRUMB ───────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.breadcrumb a { color: var(--accent2); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text-dim); }

/* ── 21. WEEK / LESSON LIST ───────────────────────────────────── */
.week-block {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.4rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border-dim);
    cursor: pointer;
}

.week-header h3 { font-size: 0.95rem; font-weight: 700; }

.week-body { padding: 0.5rem 0; }

.lesson-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.4rem;
    border-bottom: 1px solid var(--border-dim);
    transition: background 0.15s;
}

.lesson-row:last-child { border-bottom: none; }
.lesson-row:hover { background: rgba(255,255,255,0.02); }

.lesson-row .lesson-title { font-size: 0.9rem; font-weight: 500; }
.lesson-row .lesson-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ── 22. ANNOUNCEMENT CARD ────────────────────────────────────── */
.announcement-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent2);
    border-radius: var(--radius-sm);
    padding: 1.1rem 1.4rem;
    margin-bottom: 0.75rem;
}

.announcement-card .ann-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.announcement-card .ann-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.announcement-card .ann-body {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ── 23. SITE FOOTER ──────────────────────────────────────────── */
.site-footer {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1rem;
    font-size: 0.78rem;
    color: var(--text-dim);
    border-top: 1px solid var(--border-dim);
}

/* ── 24. UTILITY CLASSES ──────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-green  { color: var(--accent); }
.text-cyan   { color: var(--accent2); }
.text-amber  { color: var(--warn); }
.text-red    { color: var(--err); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap    { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.w-full { width: 100%; }

/* ── 25. FOCUS & MOTION ───────────────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent2);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── 26. RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
    .app-layout .main-content {
        grid-column: 1;
    }
    .main-content { padding: 1.5rem 1.25rem; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-header-row { flex-direction: column; align-items: flex-start; }
    .auth-card { padding: 2rem 1.5rem; }
    .main-content { padding: 1.25rem 1rem; }
}

/* ── 27. DASHBOARD-SPECIFIC COMPONENTS ────────────────────────── */

/* Two-column grid used on all three dashboards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-top: 0.5rem;
}

/* card-body spacing */
.card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Item list — used for courses, announcements, etc. */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-dim);
    gap: 0.75rem;
}

.item-row:last-child { border-bottom: none; }

.item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.15rem;
}

.item-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Quick action button list */
.action-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.action-list .btn {
    justify-content: flex-start;
    width: 100%;
}

@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* ── 28. MODALS ───────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-dim);
}

.modal-header h2 { font-size: 1.1rem; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem;
}
.modal-close:hover { color: var(--text); }

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-dim);
}
