/* ============================================================================
   SMART - Student Manual Access and Record Tracker
   Modern green design system
   ============================================================================ */

:root {
    /* Brand greens */
    --brand-950: #04241a;
    --brand-900: #06301f;
    --brand-800: #0b3d28;
    --brand-700: #0f5132;
    --brand-600: #146c43;
    --brand-500: #16a34a;
    --brand-400: #22c55e;
    --brand-300: #4ade80;
    --brand-accent: #10b981;
    --brand-teal: #14b8a6;

    /* Soft tints */
    --brand-soft: #e7f6ee;
    --brand-softer: #f1faf5;

    /* Neutrals */
    --bg: #eef3f0;
    --surface: #ffffff;
    --surface-2: #f7faf8;
    --border: #e4ece7;
    --border-strong: #d3ded8;
    --text: #0f1e17;
    --text-2: #38473f;
    --muted: #6b8177;

    /* Effects */
    --radius: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-xs: 0 1px 2px rgba(6, 48, 31, .05);
    --shadow-sm: 0 2px 8px -2px rgba(6, 48, 31, .08);
    --shadow-md: 0 10px 28px -10px rgba(6, 48, 31, .18);
    --shadow-lg: 0 24px 60px -18px rgba(6, 48, 31, .28);
    --ring: 0 0 0 4px rgba(16, 163, 74, .16);

    --sidebar-width: 268px;
    --topbar-height: 68px;

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

    --bs-primary: #16a34a;
    --bs-primary-rgb: 22, 163, 74;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background:
        radial-gradient(1200px 600px at 100% -10%, rgba(16, 185, 129, .07), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(20, 184, 166, .06), transparent 55%),
        var(--bg);
    color: var(--text);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

a { text-decoration: none; color: var(--brand-500); }
a:hover { color: var(--brand-700); }

h1, h2, h3, h4, h5, h6 { letter-spacing: -0.02em; color: var(--text); line-height: 1.3; margin-bottom: .5rem; }

/* Refined, consistent type scale (tighter than Bootstrap defaults so page
   titles sit closer to body text and feel even). */
h1, .h1 { font-size: 1.6rem; }
h2, .h2 { font-size: 1.4rem; }
h3, .h3 { font-size: 1.25rem; }
h4, .h4 { font-size: 1.2rem; }
h5, .h5 { font-size: 1.05rem; }
h6, .h6 { font-size: .9rem; }

/* Keep the login hero brand prominent. */
.auth-hero h1 { font-size: 2rem; }

@media (max-width: 576px) {
    h1, .h1 { font-size: 1.4rem; }
    h2, .h2 { font-size: 1.25rem; }
    h3, .h3 { font-size: 1.15rem; }
    h4, .h4 { font-size: 1.1rem; }
}

::selection { background: rgba(16, 163, 74, .18); }

/* Thin modern scrollbars */
* { scrollbar-width: thin; scrollbar-color: #cfe0d7 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #cbdcd3; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #b3cabf; background-clip: content-box; }

/* ---- App shell ---- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background:
        radial-gradient(600px 300px at 20% -10%, rgba(34, 197, 94, .18), transparent 60%),
        linear-gradient(185deg, var(--brand-900) 0%, var(--brand-950) 100%);
    color: #c9e6d7;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    display: flex; flex-direction: column;
    z-index: 1040;
    border-right: 1px solid rgba(255, 255, 255, .06);
    transition: transform .3s cubic-bezier(.16, 1, .3, 1);
}
.sidebar .brand {
    height: var(--topbar-height);
    display: flex; align-items: center; gap: .8rem;
    padding: 0 1.35rem;
    color: #fff; font-weight: 700; font-size: 1.12rem;
    letter-spacing: -0.02em; line-height: 1.15;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.sidebar .brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .brand .logo {
    width: 42px; height: 42px; border-radius: 12px;
    background: linear-gradient(140deg, var(--brand-400), var(--brand-teal));
    display: grid; place-items: center; font-size: 1.3rem; color: #04241a;
    box-shadow: 0 6px 16px -4px rgba(16, 185, 129, .5);
    flex: 0 0 42px; overflow: hidden;
}
.sidebar .brand .logo-img { background: #fff; padding: 0; box-shadow: 0 4px 12px -4px rgba(0,0,0,.35); }
.sidebar .brand .logo-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.sidebar .nav-section {
    padding: 1.15rem 1.5rem .4rem;
    font-size: .66rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .12em; color: rgba(201, 230, 215, .45);
}
.sidebar .nav-link {
    display: flex; align-items: center; gap: .85rem;
    color: #bcdccb; margin: .1rem .75rem;
    padding: .62rem .8rem; border-radius: 12px;
    font-size: .92rem; font-weight: 500;
    position: relative;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.sidebar .nav-link i { font-size: 1.1rem; width: 22px; text-align: center; opacity: .9; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar .nav-link.active {
    background: linear-gradient(100deg, rgba(34, 197, 94, .22), rgba(20, 184, 166, .16));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(74, 222, 128, .25);
}
.sidebar .nav-link.active::before {
    content: ""; position: absolute; left: -.75rem; top: 50%; transform: translateY(-50%);
    width: 4px; height: 22px; border-radius: 0 4px 4px 0;
    background: linear-gradient(var(--brand-300), var(--brand-teal));
}
.sidebar-scroll { overflow-y: auto; flex: 1; padding-bottom: 1rem; }

.main { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-width: 0; }

.topbar {
    height: var(--topbar-height);
    background: rgba(255, 255, 255, .72);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.6rem;
    position: sticky; top: 0; z-index: 1030;
}
.topbar .page-title { font-weight: 700; font-size: 1.12rem; color: var(--text); margin: 0; }

.content { padding: 1.75rem; flex: 1; animation: fadeUp .4s cubic-bezier(.16, 1, .3, 1); }

.app-footer {
    padding: 1rem 1.75rem;
    text-align: center;
    color: var(--muted);
    font-size: .8rem;
    border-top: 1px solid var(--border);
}
.app-footer a { color: var(--brand-600); font-weight: 600; }
.app-footer a:hover { color: var(--brand-700); text-decoration: underline; }
.app-footer i, .app-footer .footer-dot { color: var(--brand-500); }
.app-footer .footer-dot { margin: 0 .35rem; opacity: .6; }
:root[data-theme="dark"] .app-footer a,
:root[data-theme="dark"] .app-footer i { color: var(--brand-300); }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar-backdrop { display: none; }
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .sidebar-backdrop.show {
        display: block; position: fixed; inset: 0;
        background: rgba(4, 36, 26, .45); backdrop-filter: blur(2px); z-index: 1035;
    }
}

/* ---- Cards ---- */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    color: var(--text);
}
.card-body { padding: 1.25rem; }
.card-footer { background: transparent; border-top: 1px solid var(--border); }

/* ---- Stat cards (modern white + colored chip) ---- */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.3rem 1.35rem;
    box-shadow: var(--shadow-xs);
    position: relative; overflow: hidden;
    transition: transform .25s cubic-bezier(.16, 1, .3, 1), box-shadow .25s ease;
    height: 100%;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-card::after {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
    background: linear-gradient(90deg, var(--brand-400), var(--brand-teal));
    opacity: .0; transition: opacity .25s ease;
}
.stat-card:hover::after { opacity: 1; }
.stat-chip {
    width: 46px; height: 46px; border-radius: 13px;
    display: grid; place-items: center; font-size: 1.35rem;
    margin-bottom: .9rem;
}
.stat-value { font-size: 1.85rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: var(--text); }
.stat-label { color: var(--muted); font-size: .82rem; font-weight: 500; margin-top: .4rem; }

/* Chip color variants (also used as legacy .bg-grad-*) */
.stat-chip.c-1, .bg-grad-1 { background: rgba(16, 163, 74, .13); color: #12673f; }
.stat-chip.c-2, .bg-grad-2 { background: rgba(20, 184, 166, .14); color: #0f766e; }
.stat-chip.c-3, .bg-grad-3 { background: rgba(34, 197, 94, .14); color: #15803d; }
.stat-chip.c-4, .bg-grad-4 { background: rgba(59, 130, 246, .13); color: #1d4ed8; }
.stat-chip.c-5, .bg-grad-5 { background: rgba(139, 92, 246, .13); color: #6d28d9; }
.stat-chip.c-6, .bg-grad-6 { background: rgba(244, 63, 94, .12); color: #be123c; }

/* ---- Buttons ---- */
.btn { border-radius: 12px; font-weight: 600; letter-spacing: -0.01em; transition: all .18s ease; }
.btn:focus { box-shadow: var(--ring); }
.btn-lg { border-radius: 14px; }
.btn-sm { border-radius: 9px; }

.btn-smart {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
    border: none; color: #fff;
    box-shadow: 0 6px 16px -6px rgba(16, 163, 74, .6);
}
.btn-smart:hover { background: linear-gradient(135deg, var(--brand-600), var(--brand-700)); color: #fff; transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(16, 163, 74, .65); }
.btn-smart:active { transform: translateY(0); }

.btn-outline-smart { color: var(--brand-600); border: 1.5px solid var(--border-strong); background: var(--surface); }
.btn-outline-smart:hover { background: var(--brand-soft); border-color: var(--brand-400); color: var(--brand-700); }

.btn-light { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.btn-light:hover { background: #eef3f0; border-color: var(--border-strong); }

.text-smart { color: var(--brand-600) !important; }
a.text-smart:hover { color: var(--brand-700) !important; }
.bg-smart-soft { background: var(--brand-soft) !important; }

/* ---- Forms ---- */
.form-control, .form-select {
    border-radius: 11px;
    border: 1.5px solid var(--border-strong);
    padding: .55rem .85rem;
    background: var(--surface);
    transition: border-color .18s ease, box-shadow .18s ease;
    color: var(--text);
}
.form-control::placeholder { color: #9db3a8; }
.form-control:focus, .form-select:focus {
    border-color: var(--brand-400);
    box-shadow: var(--ring);
}
.form-control-lg, .form-select-lg { border-radius: 13px; }
.input-group-text { border-radius: 11px; border: 1.5px solid var(--border-strong); background: var(--surface-2); color: var(--muted); }
.form-label { font-weight: 600; color: var(--text-2); }
.form-check-input:checked { background-color: var(--brand-500); border-color: var(--brand-500); }
.form-check-input:focus { box-shadow: var(--ring); border-color: var(--brand-400); }

/* ---- Tables ---- */
.table { color: var(--text-2); --bs-table-hover-bg: var(--brand-softer); }
.table > thead th {
    background: var(--surface-2);
    color: var(--muted);
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    border-bottom: 1px solid var(--border) !important;
    padding: .8rem .85rem;
}
.table > :not(caption) > * > * { padding: .82rem .85rem; border-color: var(--border); }
.table { --bs-table-bg: transparent; background: transparent; }
.table tbody tr { transition: background .12s ease; }
.card .table-responsive .table tbody tr:last-child > * { border-bottom: 0; }

/* ---- SmartTable (custom search + pagination) ---- */
.smart-table-toolbar { display: flex; justify-content: flex-end; padding: 1rem 1.1rem .35rem; }
.stt-search { position: relative; }
.stt-search i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; }
.stt-search input {
    padding: .5rem .9rem .5rem 2.15rem;
    border: 1.5px solid var(--border-strong); border-radius: 11px;
    background: var(--surface); color: var(--text);
    min-width: 250px; font-size: .9rem;
}
.stt-search input:focus { outline: none; border-color: var(--brand-400); box-shadow: var(--ring); }

.smart-table-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap; padding: .85rem 1.1rem; border-top: 1px solid var(--border);
}
.stt-info { color: var(--muted); font-size: .85rem; }
.stt-pager { display: flex; align-items: center; gap: .4rem; }
.stt-btn {
    display: inline-grid; place-items: center; min-width: 34px; height: 34px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
    border-radius: 9px; padding: 0 .5rem; font-size: .85rem; font-weight: 600; cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.stt-btn:hover:not(:disabled) { background: var(--brand-soft); border-color: var(--brand-400); color: var(--brand-700); }
.stt-btn:disabled, .stt-btn.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
a.stt-btn { text-decoration: none; }
.stt-page { color: var(--muted); font-size: .85rem; font-weight: 600; padding: 0 .5rem; }
:root[data-theme="dark"] .stt-search input { background: var(--surface-2); }
:root[data-theme="dark"] .stt-btn { background: var(--surface-2); border-color: var(--border); }
:root[data-theme="dark"] .stt-btn:hover:not(:disabled) { color: var(--brand-300); }

/* ---- Badges ---- */
.badge { font-weight: 600; letter-spacing: .01em; padding: .38em .7em; border-radius: 999px; }
.badge-soft-success { background: var(--brand-soft); color: #12673f; }
.badge-soft-danger  { background: #fdeaea; color: #be123c; }
.badge-soft-warning { background: #fef3c7; color: #92600a; }
.badge-soft-muted   { background: #eef2f0; color: #5a6b62; }

/* ---- Dropdown / modal polish ---- */
.dropdown-menu { border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md); padding: .4rem; }
.dropdown-item { border-radius: 9px; padding: .5rem .7rem; font-weight: 500; }
.dropdown-item:active { background: var(--brand-500); }
.list-group-item { border-color: var(--border); }

/* ---- Modals (modern) ---- */
.modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    background: var(--surface);
    overflow: hidden;
}
.modal-header {
    padding: 1.15rem 1.35rem;
    border-bottom: 1px solid var(--border);
    align-items: center;
    gap: .8rem;
}
.modal-title { font-weight: 700; letter-spacing: -0.02em; font-size: 1.1rem; }
.modal-subtitle { font-size: .82rem; color: var(--muted); margin-top: .1rem; }
.modal-body { padding: 1.35rem; }
.modal-footer { padding: 1rem 1.35rem; border-top: 1px solid var(--border); gap: .5rem; }
.modal-footer .btn { min-width: 100px; }

/* Header icon chip */
.modal-icon {
    width: 44px; height: 44px; border-radius: 13px; flex: 0 0 44px;
    display: grid; place-items: center; font-size: 1.25rem;
    background: var(--brand-soft); color: var(--brand-700);
}
.modal-icon.danger { background: #fdeaea; color: #be123c; }
:root[data-theme="dark"] .modal-icon.danger { background: rgba(244, 63, 94, .16); color: #fb7185; }

/* Circular close button */
.modal .btn-close {
    width: 34px; height: 34px; border-radius: 10px; margin: 0; padding: 0;
    background-color: var(--surface-2); background-size: .7rem;
    opacity: .65; transition: opacity .15s ease, background-color .15s ease;
}
.modal .btn-close:hover { opacity: 1; background-color: #fdeaea; }

/* Spring entrance + blurred backdrop */
.modal.fade .modal-dialog {
    transform: scale(.94) translateY(14px);
    transition: transform .38s cubic-bezier(.16, 1, .3, 1), opacity .25s ease;
}
.modal.show .modal-dialog { transform: scale(1) translateY(0); }
.modal-backdrop.show {
    opacity: 1;
    background: rgba(4, 36, 26, .42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

:root[data-theme="dark"] .modal .btn-close {
    background-color: transparent;
    filter: invert(1) grayscale(1) brightness(1.8);
    opacity: .8;
}
:root[data-theme="dark"] .modal .btn-close:hover { background-color: rgba(244, 63, 94, .22); }
:root[data-theme="dark"] .modal-backdrop.show { background: rgba(0, 0, 0, .58); }
:root[data-theme="dark"] .modal-icon { background: rgba(16, 163, 74, .16); color: var(--brand-300); }

/* ---- Auth / login ---- */
.auth-wrapper {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--surface);
}
.auth-hero {
    background:
        radial-gradient(700px 400px at 80% 10%, rgba(74, 222, 128, .35), transparent 55%),
        radial-gradient(600px 500px at 10% 90%, rgba(20, 184, 166, .35), transparent 55%),
        linear-gradient(155deg, var(--brand-800) 0%, var(--brand-950) 100%);
    color: #eafff5;
    padding: 3.5rem;
    display: flex; flex-direction: column; justify-content: center;
    position: relative; overflow: hidden;
}
.auth-hero::after {
    content: ""; position: absolute; inset: auto -120px -160px auto;
    width: 380px; height: 380px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .12), transparent 70%);
}
.auth-hero h1 { color: #fff; }
.auth-hero .brand-badge {
    width: 68px; height: 68px;
    background: linear-gradient(140deg, var(--brand-400), var(--brand-teal));
    border-radius: 20px;
    display: grid; place-items: center;
    font-size: 2rem; margin-bottom: 1.75rem; color: #04241a;
    box-shadow: 0 12px 30px -8px rgba(16, 185, 129, .6);
    overflow: hidden;
}
.auth-hero .brand-badge-img { background: #fff; padding: 0; width: 84px; height: 84px; }
.auth-hero .brand-badge-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.auth-hero ul li { padding: .15rem 0; color: #d6f5e6; }
.auth-card {
    display: flex; align-items: center; justify-content: center; padding: 2.5rem;
    background:
        radial-gradient(650px 420px at 85% 0%, rgba(16, 185, 129, .12), transparent 60%),
        radial-gradient(520px 420px at 5% 100%, rgba(20, 184, 166, .10), transparent 55%),
        var(--surface);
}
.auth-card .inner { width: 100%; max-width: 420px; }

.auth-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2rem 1.9rem;
}

/* Compact brand for mobile (hero hidden) */
.auth-mobile-brand { display: none; text-align: center; margin-bottom: 1.5rem; }
.auth-mobile-brand .auth-mb-logo {
    width: 66px; height: 66px; border-radius: 18px; margin: 0 auto .85rem;
    display: grid; place-items: center; font-size: 2rem; color: #04241a;
    background: linear-gradient(140deg, var(--brand-400), var(--brand-teal));
    box-shadow: 0 12px 28px -8px rgba(16, 185, 129, .55); overflow: hidden;
}
.auth-mobile-brand .auth-mb-logo.has-img { background: #fff; }
.auth-mobile-brand .auth-mb-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.auth-mobile-brand h1 { font-size: 1.55rem; margin: 0; }

.auth-footer-text { text-align: center; color: var(--muted); font-size: .75rem; margin: 1.25rem 0 0; }
.auth-footer-text i { color: var(--brand-500); }
.auth-footer-text a { color: var(--brand-600); font-weight: 600; }
:root[data-theme="dark"] .auth-footer-text a, :root[data-theme="dark"] .auth-footer-text i { color: var(--brand-300); }

.nav-pills .nav-link { border-radius: 11px; color: var(--muted); font-weight: 600; }
.nav-pills .nav-link.active.btn-smart { color: #fff; }
@media (max-width: 860px) {
    .auth-wrapper { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .auth-mobile-brand { display: block; }
}

/* ---- Manual / QR / misc ---- */
.manual-category-card {
    border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem;
    transition: transform .18s cubic-bezier(.16,1,.3,1), box-shadow .18s ease, border-color .18s ease;
    height: 100%; background: var(--surface);
}
.manual-category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand-300); }
.manual-category-card .icon {
    width: 48px; height: 48px; border-radius: 13px;
    background: var(--brand-soft); color: var(--brand-700);
    display: grid; place-items: center; font-size: 1.35rem; margin-bottom: .8rem;
}
.report-icon {
    width: 58px; height: 58px; border-radius: 16px;
    background: var(--brand-soft); color: var(--brand-700);
    display: grid; place-items: center; font-size: 1.55rem;
}
:root[data-theme="dark"] .report-icon { background: rgba(16, 163, 74, .16); color: var(--brand-300); }

.manual-article { background: var(--surface); border-radius: var(--radius); padding: 2.25rem; border: 1px solid var(--border); box-shadow: var(--shadow-xs); }
.manual-article img { max-width: 100%; height: auto; border-radius: 12px; }

/* File preview frame (admin + student) */
.manual-preview { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface-2); }
.manual-preview embed { width: 100%; height: 600px; border: 0; display: block; background: #525659; }
.manual-preview--empty {
    display: grid; place-items: center; gap: .8rem;
    padding: 3.5rem 1rem; text-align: center; color: var(--muted); background: var(--surface-2);
}
.manual-preview--empty i { font-size: 2.8rem; color: var(--brand-500); }

.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; }
.avatar-fallback { background: linear-gradient(140deg, var(--brand-soft), #d6efe1); color: var(--brand-700); display: grid; place-items: center; font-weight: 700; }

.qr-frame { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; box-shadow: var(--shadow-xs); }
.qr-frame svg, .qr-frame img { width: 180px; height: 180px; }

/* ---- Modern user menu ---- */
.user-menu-btn {
    display: flex; align-items: center; gap: .6rem;
    background: transparent; border: 1px solid transparent; border-radius: 999px;
    padding: .28rem .6rem .28rem .32rem; cursor: pointer; color: var(--text);
    transition: background .15s ease, border-color .15s ease;
}
.user-menu-btn:hover { background: var(--surface-2); border-color: var(--border); }
.user-menu-avatar {
    width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: 0 0 38px;
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--brand-400);
}
.user-menu-meta { flex-direction: column; align-items: flex-start; line-height: 1.15; }
.user-menu-name { font-weight: 700; font-size: .86rem; letter-spacing: -.01em; }
.user-menu-role { font-size: .7rem; color: var(--muted); }
.user-menu-caret { font-size: .68rem; color: var(--muted); transition: transform .2s ease; }
.user-menu-btn[aria-expanded="true"] .user-menu-caret { transform: rotate(180deg); }

.user-menu-dropdown { min-width: 252px; padding: 0; overflow: hidden; }
.user-menu-head { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; }
.user-menu-avatar-lg {
    width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: 0 0 46px; font-size: 1.05rem;
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--brand-400);
}
.user-menu-head-text { min-width: 0; }
.user-menu-dropdown .dropdown-divider { margin: 0; }
.user-menu-dropdown .dropdown-item { padding: .62rem 1rem; border-radius: 0; font-weight: 500; }

.notif-badge {
    position: absolute; top: 3px; right: 3px;
    min-width: 17px; height: 17px; padding: 0 4px;
    font-size: .6rem; font-weight: 700; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px var(--surface-2);
}
:root[data-theme="dark"] .notif-badge { box-shadow: 0 0 0 2px #16241d; }

.notif-item { padding: .75rem 1rem; border-bottom: 1px solid var(--border); display: flex; gap: .7rem; }
.notif-item.unread { background: var(--brand-softer); }
.notif-item .icon { color: var(--brand-500); font-size: 1.1rem; }
/* Clickable notifications (carry a link target) */
a.notif-item, a.notif-item:hover { color: inherit; text-decoration: none; }
a.notif-link { cursor: pointer; transition: background .12s ease; }
a.notif-link:hover { background: var(--brand-soft, var(--brand-softer)); }

/* Announcements timeline (admin + student) */
.ann-timeline { position: relative; padding-left: 3.25rem; }
.ann-timeline::before { content: ""; position: absolute; left: 1.24rem; top: .5rem; bottom: .5rem; width: 2px; background: var(--border); }
.ann-item { position: relative; margin-bottom: 1rem; }
.ann-avatar { position: absolute; left: -3.25rem; top: .1rem; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 3px var(--surface); }
.ann-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ann-avatar .avatar-fallback { width: 100%; height: 100%; font-size: 1.05rem; }
.ann-item .ann-body { margin-bottom: 0; }
@media (max-width: 575.98px) {
    .ann-timeline { padding-left: 2.9rem; }
    .ann-timeline::before { left: 1.05rem; }
    .ann-avatar { left: -2.9rem; width: 36px; height: 36px; }
}

/* Legal content shown inside the login modals (Terms / Data Privacy) */
.legal-modal-body .lead { font-size: 1rem; color: var(--text-2); }
.legal-modal-body h4 { font-size: 1.02rem; margin-top: 1.15rem; }
.legal-modal-body h4:first-of-type { margin-top: .35rem; }
.legal-modal-body ul { padding-left: 1.15rem; }
.legal-modal-body ul li { margin-bottom: .35rem; }
.legal-modal-body a { color: var(--brand-600); font-weight: 600; text-decoration: none; }
.legal-modal-body a:hover { text-decoration: underline; }
:root[data-theme="dark"] .legal-modal-body a { color: var(--brand-300); }

/* Draw-to-sign signature pad (student acknowledgement) */
.sig-pad {
    position: relative; height: 160px; overflow: hidden;
    background: #ffffff;
    border: 1.5px dashed var(--border-strong); border-radius: var(--radius-md);
}
.sig-pad canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sig-hint {
    position: absolute; inset: 0; display: grid; place-items: center;
    color: #9aa8a0; font-size: .9rem; pointer-events: none; text-align: center; padding: 0 1rem;
}
.sig-pad.has-ink .sig-hint { display: none; }
.sig-clear {
    position: absolute; top: 8px; right: 8px;
    background: #fff; color: #dc3545; border: 1px solid var(--border);
    border-radius: 8px; font-size: .74rem; font-weight: 600; padding: .22rem .55rem; cursor: pointer;
}
.sig-clear:hover { background: #fff5f5; border-color: #f1aeb5; }

/* ---- Dynamic Island alerts ---- */
#island-stack {
    position: fixed; top: 14px; left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    pointer-events: none;
    width: max-content; max-width: 94vw;
}
.island {
    pointer-events: auto; cursor: pointer;
    display: flex; align-items: center;
    min-height: 46px; max-width: 94vw;
    padding: .5rem .55rem;
    background: #0a0d0c;
    color: #fff;
    border-radius: 999px;
    box-shadow: 0 12px 34px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.07);
    position: relative; overflow: hidden;
    transform: translateY(-160%) scale(.7);
    opacity: 0;
    transition: transform .55s cubic-bezier(.16,1,.3,1), opacity .3s ease;
}
.island.show { transform: translateY(0) scale(1); opacity: 1; }
.island.hide { transform: translateY(-160%) scale(.7); opacity: 0; }
.island .island-icon {
    width: 32px; height: 32px; flex: 0 0 32px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 1.05rem;
}
.island .island-text {
    font-size: .9rem; font-weight: 500; line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 0; opacity: 0;
    transition: max-width .5s cubic-bezier(.16,1,.3,1), opacity .35s ease .1s,
                padding .5s cubic-bezier(.16,1,.3,1);
}
.island.expanded .island-text { max-width: 60vw; opacity: 1; padding: 0 .85rem 0 .6rem; }
.island .island-progress {
    position: absolute; left: 0; bottom: 0; height: 2.5px; width: 100%;
    background: rgba(255,255,255,.45); border-radius: 2px;
    transform-origin: left; transform: scaleX(1);
}
.island.success .island-icon { background: rgba(52,226,168,.16); color: #34e2a8; }
.island.danger  .island-icon { background: rgba(255,107,107,.16); color: #ff6b6b; }
.island.warning .island-icon { background: rgba(255,206,84,.16); color: #ffce54; }
.island.info    .island-icon { background: rgba(94,224,192,.16); color: #5ee0c0; }
.island.success .island-progress { background: rgba(52,226,168,.7); }
.island.danger  .island-progress { background: rgba(255,107,107,.7); }
.island.warning .island-progress { background: rgba(255,206,84,.7); }
.island.info    .island-progress { background: rgba(94,224,192,.7); }

@media (prefers-reduced-motion: reduce) {
    .island, .island .island-text, .content, .card, .stat-card { transition-duration: .01ms; animation: none; }
}

/* On phones the single-line "expand" clips long messages — let the text wrap
   and always show (short ones stay a compact pill, long ones become a rounded
   card that wraps within the screen). */
@media (max-width: 576px) {
    .island {
        border-radius: 18px;
        align-items: flex-start; min-height: 0;
        padding: .65rem .7rem;
    }
    .island .island-text,
    .island.expanded .island-text {
        white-space: normal; overflow: visible; text-overflow: clip;
        overflow-wrap: break-word;
        max-width: min(72vw, 320px); opacity: 1;
        padding: .15rem .35rem .15rem .55rem;
    }
}

/* ============================================================================
   Mobile responsiveness
   ============================================================================ */
html, body { overflow-x: hidden; max-width: 100%; }
img, svg, embed, iframe, canvas { max-width: 100%; }

@media (max-width: 992px) {
    .content { padding: 1.15rem 1rem; }
    .topbar { padding: 0 .7rem; gap: .35rem; }
    /* Left group (hamburger + title) flexes and truncates; right controls stay fixed. */
    .topbar > div:first-child { flex: 1 1 auto; min-width: 0; gap: .5rem; }
    .topbar > div:last-child { flex: 0 0 auto; gap: .15rem; }
    .topbar .page-title {
        font-size: .98rem; flex: 1 1 auto; min-width: 0;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .topbar .btn { padding: .38rem .5rem; }
    .topbar .dropdown .bi-chevron-down { display: none; }  /* save space */
    .manual-preview embed { height: 460px; }
}

@media (max-width: 576px) {
    .content { padding: 1rem .8rem; }
    .card-body { padding: 1rem; }
    .card-header { padding: .85rem 1rem; }
    .stat-card { padding: 1.05rem 1.1rem; }
    .stat-value { font-size: 1.55rem; }
    .stat-chip { width: 40px; height: 40px; font-size: 1.2rem; margin-bottom: .6rem; }

    /* Page header rows (title + actions) wrap instead of overflowing. */
    .content > .d-flex.justify-content-between { flex-wrap: wrap; gap: .6rem; }

    /* Full-width table search + comfy footer on phones. */
    .smart-table-toolbar { justify-content: stretch; padding: .85rem .85rem .25rem; }
    .smart-table-toolbar .stt-search { width: 100%; }
    .stt-search input { min-width: 0; width: 100%; }
    .smart-table-footer { justify-content: center; gap: .6rem; padding: .8rem; }

    /* Roomier tap targets, tighter modals. */
    .btn { padding-left: .8rem; padding-right: .8rem; }
    .modal-body, .modal-header, .modal-footer { padding-left: 1.1rem; padding-right: 1.1rem; }
    .manual-preview embed { height: 380px; }

    /* Login card breathing room on small screens. */
    .auth-card { padding: 1.5rem 1rem; }
    .auth-panel { padding: 1.5rem 1.25rem; }
}

/* ============================================================================
   Dark mode — activated by :root[data-theme="dark"]
   ============================================================================ */
:root[data-theme="dark"] {
    --bg: #0a1310;
    --surface: #121e19;
    --surface-2: #0e1814;
    --border: #20302a;
    --border-strong: #2c3f37;
    --text: #e9f2ed;
    --text-2: #b6c8bf;
    --muted: #86a094;
    --brand-soft: rgba(16, 163, 74, .18);
    --brand-softer: rgba(16, 163, 74, .10);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-sm: 0 2px 12px -2px rgba(0, 0, 0, .55);
    --shadow-md: 0 14px 34px -12px rgba(0, 0, 0, .65);
    --shadow-lg: 0 26px 64px -18px rgba(0, 0, 0, .75);
    --ring: 0 0 0 4px rgba(34, 197, 94, .22);
}

:root[data-theme="dark"] body {
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 100% -10%, rgba(16, 185, 129, .10), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(20, 184, 166, .08), transparent 55%),
        var(--bg);
}
:root[data-theme="dark"] .topbar { background: rgba(16, 26, 22, .72); }
:root[data-theme="dark"] .bg-white { background: var(--surface) !important; }
:root[data-theme="dark"] .bg-smart-soft { background: rgba(16, 163, 74, .12) !important; }
:root[data-theme="dark"] .text-muted { color: var(--muted) !important; }
:root[data-theme="dark"] .text-dark { color: var(--text) !important; }

:root[data-theme="dark"] .table { color: var(--text-2); }
:root[data-theme="dark"] .table > thead th,
:root[data-theme="dark"] .table-light { background: var(--surface-2) !important; color: var(--muted) !important; --bs-table-bg: transparent; }
:root[data-theme="dark"] .table > tbody td { color: var(--text-2); }

:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select { background: var(--surface-2); color: var(--text); }
:root[data-theme="dark"] .form-control::placeholder { color: #6f877c; }
:root[data-theme="dark"] .input-group-text { background: var(--surface-2); color: var(--muted); }

:root[data-theme="dark"] .dropdown-menu,
:root[data-theme="dark"] .modal-content { background: var(--surface); color: var(--text); }
:root[data-theme="dark"] .dropdown-item { color: var(--text-2); }
:root[data-theme="dark"] .dropdown-item:hover,
:root[data-theme="dark"] .dropdown-item:focus { background: var(--surface-2); color: var(--text); }
:root[data-theme="dark"] .list-group-item { background: var(--surface); color: var(--text-2); }

:root[data-theme="dark"] .btn-light { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
:root[data-theme="dark"] .btn-light:hover { background: #1a2a24; border-color: var(--border-strong); }
:root[data-theme="dark"] .btn-outline-smart { background: transparent; color: var(--brand-300); border-color: var(--border-strong); }
:root[data-theme="dark"] .btn-outline-smart:hover { background: rgba(16, 163, 74, .14); color: #fff; }

:root[data-theme="dark"] .badge-soft-muted { background: #24332c; color: #a9bcb2; }
:root[data-theme="dark"] .badge-soft-warning { background: rgba(245, 158, 11, .16); color: #fcd34d; }
:root[data-theme="dark"] .badge-soft-danger { background: rgba(244, 63, 94, .16); color: #fda4af; }

:root[data-theme="dark"] .stat-chip.c-1, :root[data-theme="dark"] .bg-grad-1 { color: #4ade80; }
:root[data-theme="dark"] .stat-chip.c-2, :root[data-theme="dark"] .bg-grad-2 { color: #2dd4bf; }
:root[data-theme="dark"] .stat-chip.c-3, :root[data-theme="dark"] .bg-grad-3 { color: #4ade80; }
:root[data-theme="dark"] .stat-chip.c-4, :root[data-theme="dark"] .bg-grad-4 { color: #60a5fa; }
:root[data-theme="dark"] .stat-chip.c-5, :root[data-theme="dark"] .bg-grad-5 { color: #a78bfa; }
:root[data-theme="dark"] .stat-chip.c-6, :root[data-theme="dark"] .bg-grad-6 { color: #fb7185; }

:root[data-theme="dark"] .manual-category-card .icon { background: rgba(16, 163, 74, .16); color: var(--brand-300); }
:root[data-theme="dark"] .avatar-fallback { background: rgba(16, 163, 74, .18); color: var(--brand-300); }
:root[data-theme="dark"] .alert-warning { background: rgba(245, 158, 11, .14); border-color: rgba(245, 158, 11, .3); color: #fcd34d; }

/* Theme toggle button icon spin */
[data-theme-toggle] i { transition: transform .4s cubic-bezier(.16, 1, .3, 1); }
[data-theme-toggle]:hover i { transform: rotate(-25deg); }

/* ============================================================================
   Loading feedback — top progress bar + "preparing" overlay
   ============================================================================ */
.smart-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0;
    background: linear-gradient(90deg, var(--brand-500), var(--brand-teal));
    box-shadow: 0 0 10px rgba(16, 163, 74, .6);
    z-index: 2000; opacity: 0;
    transition: width .3s ease, opacity .35s ease;
}
.smart-progress.show { opacity: 1; }

.smart-overlay {
    position: fixed; inset: 0; z-index: 1990;
    display: flex; align-items: center; justify-content: center;
    background: rgba(6, 48, 31, .35);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    opacity: 0; visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.smart-overlay.show { opacity: 1; visibility: visible; }
.smart-overlay-card {
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
    background: var(--surface); color: var(--text);
    padding: 1.75rem 2.25rem; border-radius: var(--radius);
    box-shadow: var(--shadow-lg); border: 1px solid var(--border);
    min-width: 210px; max-width: 90vw; text-align: center;
    animation: fadeUp .3s cubic-bezier(.16, 1, .3, 1);
}
.smart-overlay-text { font-weight: 600; font-size: .95rem; }
.smart-overlay-sub { font-size: .8rem; color: var(--muted); margin-top: -.5rem; }
.smart-spinner {
    width: 46px; height: 46px; border-radius: 50%;
    border: 4px solid var(--brand-soft);
    border-top-color: var(--brand-500);
    animation: smart-spin .8s linear infinite;
}
@keyframes smart-spin { to { transform: rotate(360deg); } }
:root[data-theme="dark"] .smart-overlay { background: rgba(0, 0, 0, .55); }
:root[data-theme="dark"] .smart-spinner { border-color: rgba(16, 163, 74, .22); border-top-color: var(--brand-400); }

/* ============================================================================
   Star rating (interactive input + read-only display)
   Colours come from variables so the "on" (gold) state can never be overridden
   by the dark-mode "empty" rule (a specificity clash that hid the rating).
   ============================================================================ */
:root { --star-empty: #d3ded8; --star-on: #f59e0b; }
:root[data-theme="dark"] { --star-empty: #5f7168; --star-on: #fbbf24; }

.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: .3rem; }
.star-input input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.star-input label {
    font-size: 2.3rem; line-height: 1; color: var(--star-empty); cursor: pointer;
    transition: color .15s ease, transform .15s ease;
}
.star-input label:hover { transform: scale(1.12); }
.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label { color: var(--star-on); }

.stars-display { color: var(--star-on); white-space: nowrap; letter-spacing: 1px; }

/* ============================================================================
   Informational pages (instructions, terms, privacy, faq, about)
   ============================================================================ */
.info-page { min-height: 100vh; display: flex; flex-direction: column; }

.info-topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: .85rem 1.25rem;
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.info-brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-size: 1.15rem; }
.info-brand:hover { color: var(--text); }
.info-logo {
    width: 40px; height: 40px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-teal));
    color: #fff; font-size: 1.15rem; overflow: hidden; flex: none;
    box-shadow: var(--shadow-sm);
}
.info-logo.has-img { background: var(--surface); }
.info-logo img { width: 100%; height: 100%; object-fit: cover; }

.info-content { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 2rem 1.25rem; }
.info-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 2.25rem; animation: fadeUp .4s cubic-bezier(.16, 1, .3, 1);
}
.info-card h1 { font-size: 1.9rem; }
.info-card .lead { color: var(--text-2); font-size: 1.05rem; }
.info-card h4 { font-size: 1.15rem; }
.info-card h4:first-of-type { margin-top: 1.5rem; }
.info-card ul { padding-left: 1.2rem; }
.info-card ul li { margin-bottom: .4rem; }
.info-card a { color: var(--brand-600); font-weight: 600; text-decoration: none; }
.info-card a:hover { color: var(--brand-700); text-decoration: underline; }

.info-nav {
    display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: center;
    margin-top: 1.5rem;
}
.info-nav a { color: var(--muted); text-decoration: none; font-size: .85rem; font-weight: 600; }
.info-nav a:hover { color: var(--brand-600); }

.info-footer {
    text-align: center; padding: 1.25rem; color: var(--muted); font-size: .8rem;
    border-top: 1px solid var(--border);
}
.info-footer a { color: var(--brand-600); font-weight: 600; text-decoration: none; }
.info-footer a:hover { text-decoration: underline; }
.info-footer i { color: var(--brand-500); }

/* Numbered steps (instructions) */
.info-steps { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.25rem; }
.info-step {
    display: flex; gap: 1rem; align-items: flex-start;
    padding: 1.1rem 1.25rem; border: 1px solid var(--border);
    border-radius: var(--radius-md); background: var(--surface-2);
    transition: box-shadow .2s ease, transform .2s ease;
}
.info-step:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.info-step-no {
    flex: none; width: 34px; height: 34px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-teal));
    color: #fff; font-weight: 700; font-size: .95rem; box-shadow: var(--shadow-sm);
}

/* Feature grid (about) */
.info-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1rem; }
.info-feature {
    display: flex; gap: .85rem; align-items: flex-start;
    padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface-2);
}
.info-feature-ico {
    flex: none; width: 40px; height: 40px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-soft); color: var(--brand-600); font-size: 1.15rem;
}

/* FAQ accordion */
.info-accordion { margin-top: 1.25rem; --bs-accordion-border-color: var(--border); }
.info-accordion .accordion-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md) !important; margin-bottom: .6rem; overflow: hidden; }
.info-accordion .accordion-button { font-weight: 600; color: var(--text); background: var(--surface); }
.info-accordion .accordion-button:not(.collapsed) { color: var(--brand-700); background: var(--brand-soft); box-shadow: none; }
.info-accordion .accordion-button:focus { box-shadow: var(--ring); }
.info-accordion .accordion-body a { color: var(--brand-600); font-weight: 600; }

/* Footer link rows */
.auth-links, .app-footer-links { display: flex; flex-wrap: wrap; gap: .35rem .9rem; justify-content: center; }
.auth-links { margin: .25rem 0 .6rem; }
.auth-links a { color: var(--muted); text-decoration: none; font-size: .78rem; font-weight: 600; }
.auth-links a:hover { color: var(--brand-600); }
.app-footer-links { margin-bottom: .4rem; }
.app-footer-links a { font-size: .78rem; }

/* Dark mode */
:root[data-theme="dark"] .info-feature-ico { background: rgba(16, 163, 74, .16); color: var(--brand-300); }
:root[data-theme="dark"] .info-accordion .accordion-button:not(.collapsed) { color: var(--brand-300); background: rgba(16, 163, 74, .14); }
:root[data-theme="dark"] .info-card a,
:root[data-theme="dark"] .info-footer a,
:root[data-theme="dark"] .info-footer i,
:root[data-theme="dark"] .info-nav a:hover,
:root[data-theme="dark"] .auth-links a:hover,
:root[data-theme="dark"] .info-accordion .accordion-body a { color: var(--brand-300); }

@media (max-width: 640px) {
    .info-card { padding: 1.5rem 1.25rem; }
    .info-card h1 { font-size: 1.55rem; }
    .info-features { grid-template-columns: 1fr; }
    .info-brand { font-size: 1rem; }
}

/* ============================================================================
   Welcome / landing page (shown before login)
   ============================================================================ */
.welcome-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 2rem 1.25rem;
}
.welcome-inner {
    width: 100%; max-width: 640px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 2.5rem; animation: fadeUp .45s cubic-bezier(.16, 1, .3, 1);
}
.welcome-hero { text-align: center; }
.welcome-hero h1 { font-size: 1.85rem; }
.welcome-logo {
    width: 68px; height: 68px; margin: 0 auto 1rem; border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-teal));
    color: #fff; font-size: 2rem; overflow: hidden; box-shadow: var(--shadow-md);
}
.welcome-logo.has-img { background: var(--surface); }
.welcome-logo img { width: 100%; height: 100%; object-fit: cover; }
.welcome-tagline { color: var(--muted); margin-bottom: 0; }

.welcome-note {
    display: flex; align-items: center; gap: .6rem;
    background: var(--brand-soft); color: var(--brand-700);
    border-radius: var(--radius-md); padding: .75rem 1rem;
    font-size: .9rem; margin: 1.75rem 0 1.25rem;
}
.welcome-note i { font-size: 1.1rem; flex: none; }

.welcome-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .85rem; }
.welcome-card {
    display: flex; align-items: center; gap: .85rem;
    padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface-2); text-decoration: none; color: var(--text);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.welcome-card:hover {
    transform: translateY(-2px); box-shadow: var(--shadow-md);
    border-color: var(--brand-400); color: var(--text);
}
.welcome-card-ico {
    flex: none; width: 44px; height: 44px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-soft); color: var(--brand-600); font-size: 1.25rem;
}
.welcome-card-body { display: flex; flex-direction: column; min-width: 0; }
.welcome-card-title { font-weight: 700; font-size: .95rem; }
.welcome-card-desc { color: var(--muted); font-size: .78rem; line-height: 1.25; }
/* Always-visible "View" cue so students know the card opens a guide (works on
   touch devices too, where there is no hover). */
.welcome-card-view {
    margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: .3rem;
    font-size: .74rem; font-weight: 700; white-space: nowrap;
    color: var(--brand-600); background: var(--brand-soft);
    border: 1px solid var(--brand-400); padding: .28rem .62rem; border-radius: 99px;
    transition: all .18s ease;
}
.welcome-card-view i { transition: transform .18s ease; }
.welcome-card:hover .welcome-card-view { background: var(--brand-500); color: #fff; border-color: var(--brand-500); }
.welcome-card:hover .welcome-card-view i { transform: translateX(2px); }
.welcome-card.is-seen .welcome-card-view { display: none; }

/* Review progress */
.welcome-progress-bar {
    height: 8px; border-radius: 99px; background: var(--border);
    overflow: hidden; margin-top: 1.25rem;
}
.welcome-progress-fill {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, var(--brand-500), var(--brand-teal));
    transition: width .45s cubic-bezier(.16, 1, .3, 1);
}
.welcome-progress-text { text-align: center; color: var(--muted); font-size: .82rem; margin: .5rem 0 1.25rem; }

/* Reviewed card state */
.welcome-card.is-seen { border-color: var(--brand-400); background: var(--brand-softer); }
.welcome-card-check { margin-left: auto; color: var(--brand-500); font-size: 1.2rem; flex: none; display: none; }
.welcome-card.is-seen .welcome-card-check { display: inline-block; }

.welcome-cta { margin-top: 1.5rem; }
.welcome-cta:disabled, .welcome-cta[disabled] { opacity: .55; cursor: not-allowed; }
.welcome-admin { text-align: center; margin: .9rem 0 0; }
.welcome-admin a { color: var(--muted); font-size: .82rem; font-weight: 600; text-decoration: none; }
.welcome-admin a:hover { color: var(--brand-600); }
.welcome-agree { text-align: center; color: var(--muted); font-size: .78rem; margin: .85rem 0 0; }
.welcome-agree a { color: var(--brand-600); font-weight: 600; text-decoration: none; }
.welcome-agree a:hover { text-decoration: underline; }
.welcome-footer { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.welcome-footer a { color: var(--brand-600); font-weight: 600; text-decoration: none; }
.welcome-footer a:hover { text-decoration: underline; }
.welcome-footer i { color: var(--brand-500); }

:root[data-theme="dark"] .welcome-note { background: rgba(16, 163, 74, .14); color: var(--brand-300); }
:root[data-theme="dark"] .welcome-card-ico { background: rgba(16, 163, 74, .16); color: var(--brand-300); }
:root[data-theme="dark"] .welcome-card-view { background: rgba(16, 163, 74, .16); color: var(--brand-300); border-color: rgba(16, 163, 74, .45); }
:root[data-theme="dark"] .welcome-card:hover .welcome-card-view { background: var(--brand-500); color: #04241a; border-color: var(--brand-500); }
:root[data-theme="dark"] .welcome-card.is-seen { background: rgba(16, 163, 74, .10); border-color: rgba(16, 163, 74, .45); }
:root[data-theme="dark"] .welcome-admin a:hover { color: var(--brand-300); }
:root[data-theme="dark"] .welcome-agree a,
:root[data-theme="dark"] .welcome-footer a,
:root[data-theme="dark"] .welcome-footer i { color: var(--brand-300); }

@media (max-width: 560px) {
    .welcome-inner { padding: 1.75rem 1.35rem; }
    .welcome-hero h1 { font-size: 1.5rem; }
    .welcome-grid { grid-template-columns: 1fr; }
}
