/* ==========================================================
   Bitlite School Portal — self-contained Admin-Lite style CSS
   No external framework dependency.
   ========================================================== */

:root {
    --navy: #1b2a4a;
    --navy-dark: #121e35;
    --gold: #b8860b;
    --gold-light: #f4e9d8;
    --grey-bg: #f4f6f9;
    --border: #dee2e6;
    --text: #222;
    --muted: #6c757d;
    --success: #1e7e34;
    --danger: #b02a37;
    --sidebar-width: 250px;
}

/* ---------------- Theme palettes (Settings → General Settings) ---------------- */
body.theme-emerald { --navy: #14532d; --navy-dark: #0d3b20; --gold: #d4af37; --gold-light: #eaf5ec; }
body.theme-royal   { --navy: #1e3a8a; --navy-dark: #16265e; --gold: #94a3b8; --gold-light: #eef2f7; }
body.theme-maroon  { --navy: #7f1d1d; --navy-dark: #5c1414; --gold: #d4a017; --gold-light: #fdf3e2; }
body.theme-slate   { --navy: #1e293b; --navy-dark: #0f172a; --gold: #14b8a6; --gold-light: #e6fdfa; }
body.theme-sunset   { --navy: #9a3412; --navy-dark: #7c2d12; --gold: #eab308; --gold-light: #fef3e2; }
body.theme-ocean    { --navy: #0e7490; --navy-dark: #155e75; --gold: #22d3ee; --gold-light: #ecfeff; }
body.theme-lavender { --navy: #581c87; --navy-dark: #3b0764; --gold: #f5c451; --gold-light: #f4ecff; }
body.theme-burgundy { --navy: #6b1029; --navy-dark: #4a0a1c; --gold: #c9a227; --gold-light: #fbeef0; }
body.theme-onyx     { --navy: #18181b; --navy-dark: #09090b; --gold: #eab308; --gold-light: #fdf6e3; }

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--grey-bg);
    color: var(--text);
    font-size: 14.5px;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--gold); }

/* ---------------- Modern toggle switches (opt-in via .toggle-switch,
   not applied to every checkbox globally). Genuine on/off settings
   (e.g. "Shuffle questions", "Allow retakes") read well as a switch;
   a checkbox used to pick items from a list (e.g. Bulk Publish's
   class picker) does not - a row of wide switches there is confusing,
   since a switch implies a persistent state toggle, not "select this
   item from many". Checkboxes stay native by default; add
   class="toggle-switch" only to genuine on/off settings. ---------------- */
input[type="checkbox"].toggle-switch {
    appearance: none;
    -webkit-appearance: none;
    width: 38px;
    height: 21px;
    min-width: 38px;
    background: #ccc;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background .2s ease;
    vertical-align: middle;
    flex-shrink: 0;
    margin: 0;
}
input[type="checkbox"].toggle-switch::before {
    content: "";
    position: absolute;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #fff;
    top: 2px;
    left: 2px;
    transition: left .2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
input[type="checkbox"].toggle-switch:checked { background: var(--navy); }
input[type="checkbox"].toggle-switch:checked::before { left: 19px; }
input[type="checkbox"].toggle-switch:disabled { opacity: .5; cursor: not-allowed; }
input[type="checkbox"].toggle-switch:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* Smaller variant for tight inline contexts (e.g. a compact reply row) where the full 38x21 size would look oversized next to small text. */
input[type="checkbox"].toggle-switch-sm { width: 28px; height: 16px; min-width: 28px; }
input[type="checkbox"].toggle-switch-sm::before { width: 12px; height: 12px; top: 2px; left: 2px; }
input[type="checkbox"].toggle-switch-sm:checked::before { left: 14px; }
input[type="checkbox"] { cursor: pointer; }

/* ---------------- Bulk Publish: scope selector (All Classes switch + class picker) ---------------- */
.bulk-publish-scope { margin: 14px 0; }
.bulk-scope-toggle {
    display: flex; align-items: center; gap: 12px;
    background: var(--ice-soft, var(--grey-bg)); border: 1px solid var(--border);
    border-radius: 10px; padding: 12px 14px; cursor: pointer; margin-bottom: 12px;
    transition: border-color .15s ease;
}
.bulk-scope-toggle:hover { border-color: var(--gold); }
.bulk-scope-toggle span { display: flex; flex-direction: column; gap: 1px; }
.bulk-scope-sub { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.bulk-class-picker { transition: opacity .15s ease; }
.bulk-class-picker.bulk-picker-disabled { opacity: .45; pointer-events: none; }
.bulk-picker-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bulk-picker-header a { font-size: 12px; }
.bulk-class-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 14px;
    border: 1px solid var(--border); border-radius: 8px; padding: 12px; max-height: 200px; overflow-y: auto;
}
.bulk-class-item { display: flex; align-items: center; gap: 7px; font-weight: 400; font-size: 13px; }

/* ---------------- CBT exam creation: Exam Options toggles ---------------- */
.exam-option-row { margin-bottom: 10px; }
.exam-option-toggle {
    display: flex; align-items: center; gap: 12px;
    background: var(--grey-bg); border: 1px solid var(--border);
    border-radius: 10px; padding: 11px 14px; cursor: pointer;
    transition: border-color .15s ease;
}
.exam-option-toggle:hover { border-color: var(--gold); }
.exam-option-toggle span { display: flex; flex-direction: column; gap: 1px; }
.exam-option-sub { font-size: 11.5px; color: var(--muted); font-weight: 400; }

/* ---------------- Settings tabbed layout ---------------- */
.settings-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--border); flex-wrap: wrap; }
.settings-tab-btn {
    background: none; border: none; padding: 10px 18px;
    font-size: 13px; font-weight: 600; color: var(--muted);
    cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: color .15s ease, border-color .15s ease;
}
.settings-tab-btn:hover { color: var(--navy); }
.settings-tab-btn.active { color: var(--navy); border-bottom-color: var(--gold); }

/* ---------------- Layout shell ---------------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--navy);
    color: #fff;
    flex-shrink: 0;
    transition: width .2s ease;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Icon-only collapsed mode (desktop): sidebar narrows, labels hide,
   icons stay visible — it is never fully hidden. */
.app-shell.sidebar-collapsed .sidebar { width: 64px; }
.app-shell.sidebar-collapsed .label,
.app-shell.sidebar-collapsed .chevron,
.app-shell.sidebar-collapsed .brand-full { display: none; }
.app-shell.sidebar-collapsed .brand-mini { display: block !important; }
.app-shell.sidebar-collapsed .sidebar nav a { justify-content: center; padding: 12px 0; }
.app-shell.sidebar-collapsed .sidebar-section-label { justify-content: center; padding: 12px 0; cursor: default; }
.app-shell.sidebar-collapsed .sidebar-group-body { display: block !important; }

.sidebar-brand {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    text-align: left;
    position: relative;
}
.sidebar-brand strong.brand-full { color: var(--gold); font-size: 16px; letter-spacing: .5px; }
.sidebar-brand span.brand-full { display: block; font-size: 11.5px; color: rgba(255,255,255,.6); margin-top: 2px; }
.sidebar-brand strong.brand-mini { display: none; color: var(--gold); font-size: 18px; text-align: center; }
.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 12px; right: 12px;
    width: 30px; height: 30px;
    background: rgba(255,255,255,.08);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.sidebar-close-btn:hover { background: rgba(255,255,255,.16); }

.sidebar-section-label {
    padding: 14px 20px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255,255,255,.45);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}
.sidebar-section-label:hover { color: rgba(255,255,255,.75); }
.sidebar-section-label .chevron { transition: transform .15s ease; font-size: 10px; }
.sidebar-section-label.collapsed .chevron { transform: rotate(-90deg); }

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,.85);
    font-size: 14px;
    border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active {
    background: rgba(184,134,11,.15);
    border-left-color: var(--gold);
    color: #fff;
    font-weight: 600;
}
.sidebar nav a .icon { width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-bottom {
    border-top: 1px solid rgba(255,255,255,.12);
    padding: 6px 0;
}
.sidebar-bottom a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,.85);
    font-size: 14px;
    border-left: 3px solid transparent;
}
.sidebar-bottom a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-bottom a.active { background: rgba(184,134,11,.15); border-left-color: var(--gold); color: #fff; font-weight: 600; }
.sidebar-bottom a .icon { width: 18px; text-align: center; flex-shrink: 0; }
.app-shell.sidebar-collapsed .sidebar-bottom a { justify-content: center; padding: 12px 0; }

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 5;
}
.topbar h1 { font-size: 18px; margin: 0; flex: 1; color: var(--navy); }
.topbar-search { margin-right: 10px; }
.topbar-search input {
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 12.8px;
    width: 220px;
    background: var(--grey-bg);
}
.topbar-search input:focus { outline: none; border-color: var(--gold); background: #fff; }
.sidebar-toggle {
    background: none; border: none; font-size: 20px; cursor: pointer; color: var(--navy);
}
.topbar-user { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); }
.btn-logout {
    background: var(--navy); color: #fff; padding: 6px 14px; border-radius: 4px; font-size: 13px;
}
.btn-logout:hover { background: var(--gold); color: #fff; }

.topbar-profile-link { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.topbar-profile-link:hover { color: var(--navy); }
.topbar-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.topbar-avatar-fallback {
    display: flex; align-items: center; justify-content: center;
    background: var(--navy); color: #fff; font-weight: 700; font-size: 13px;
}

/* ---------------- Sidebar toggle: burger <-> close icon ---------------- */
.sidebar-toggle .icon-close { display: none; }

.back-btn {
    background: var(--grey-bg);
    border: 1px solid var(--border);
    color: var(--navy);
    padding: 7px 12px;
    border-radius: 5px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}
.back-btn:hover { background: var(--gold-light); border-color: var(--gold); }
@media (min-width: 861px) {
    .app-shell:not(.sidebar-collapsed) .sidebar-toggle .icon-burger { display: none; }
    .app-shell:not(.sidebar-collapsed) .sidebar-toggle .icon-close { display: inline; }
}
@media (max-width: 860px) {
    .app-shell.sidebar-open .sidebar-toggle .icon-burger { display: none; }
    .app-shell.sidebar-open .sidebar-toggle .icon-close { display: inline; }
}

/* ---------------- Profile dropdown ---------------- */
.profile-wrapper { position: relative; }
.profile-toggle {
    background: none; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 8px; color: var(--muted); padding: 2px;
}
.profile-toggle:hover { color: var(--navy); }
.profile-caret { font-size: 9px; }
.profile-dropdown {
    display: none;
    position: absolute; right: 0; top: 130%;
    width: 220px;
    background: #fff; border: 1px solid var(--border); border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    z-index: 30; overflow: hidden;
}
.profile-dropdown.open { display: block; }
.profile-dropdown-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.profile-dropdown-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.profile-dropdown-header div { display: flex; flex-direction: column; min-width: 0; }
.profile-dropdown-header strong { font-size: 13px; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-dropdown-header span { color: var(--muted); font-size: 11px; }
.profile-dropdown-item { display: block; padding: 10px 14px; font-size: 13px; color: var(--text); border-bottom: 1px solid var(--border); }
.profile-dropdown-item:last-child { border-bottom: none; }
.profile-dropdown-item:hover { background: var(--grey-bg); }
.profile-dropdown-logout { color: var(--danger); }

/* ---------------- Logos ---------------- */
.login-logo { max-height: 60px; max-width: 220px; display: block; margin: 0 auto 14px; object-fit: contain; }
.sidebar-logo { max-height: 34px; max-width: 170px; object-fit: contain; margin-bottom: 6px; display: block; }

/* ---------------- Theme picker (Settings → General Settings) ---------------- */
.theme-picker { display: flex; gap: 12px; flex-wrap: wrap; }
.theme-option {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    cursor: pointer; padding: 10px; border: 2px solid var(--border); border-radius: 8px;
    font-size: 11.5px; text-align: center; width: 112px;
}
.theme-option.selected, .theme-option:hover { border-color: var(--gold); }
.theme-option input { display: none; }
.theme-swatch { width: 64px; height: 32px; border-radius: 6px; display: block; }
.theme-swatch-default .theme-swatch { background: linear-gradient(90deg, #1b2a4a 50%, #b8860b 50%); }
.theme-swatch-emerald .theme-swatch { background: linear-gradient(90deg, #14532d 50%, #d4af37 50%); }
.theme-swatch-royal .theme-swatch   { background: linear-gradient(90deg, #1e3a8a 50%, #94a3b8 50%); }
.theme-swatch-maroon .theme-swatch  { background: linear-gradient(90deg, #7f1d1d 50%, #d4a017 50%); }
.theme-swatch-slate .theme-swatch   { background: linear-gradient(90deg, #1e293b 50%, #14b8a6 50%); }
.theme-swatch-sunset .theme-swatch   { background: linear-gradient(90deg, #9a3412 50%, #eab308 50%); }
.theme-swatch-ocean .theme-swatch    { background: linear-gradient(90deg, #0e7490 50%, #22d3ee 50%); }
.theme-swatch-lavender .theme-swatch { background: linear-gradient(90deg, #581c87 50%, #f5c451 50%); }
.theme-swatch-burgundy .theme-swatch { background: linear-gradient(90deg, #6b1029 50%, #c9a227 50%); }
.theme-swatch-onyx .theme-swatch     { background: linear-gradient(90deg, #18181b 50%, #eab308 50%); }

/* ---------------- App footer ---------------- */
.app-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: #fff;
    display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: space-between;
    font-size: 12px; color: var(--muted);
}
.app-footer-version { font-weight: 700; color: var(--navy); }
.app-footer-social a { margin-left: 10px; color: var(--navy); }
.app-footer-social a:first-child { margin-left: 0; }

.notif-wrapper { position: relative; }
.notif-bell {
    background: none; border: none; cursor: pointer; font-size: 18px; position: relative; padding: 4px;
}
.notif-badge {
    position: absolute; top: -2px; right: -2px;
    background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
    border-radius: 10px; padding: 1px 5px; line-height: 1.3;
}
.notif-dropdown {
    display: none;
    position: absolute; right: 0; top: 130%;
    width: 300px; max-height: 380px; overflow-y: auto;
    background: #fff; border: 1px solid var(--border); border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    z-index: 30;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-header { padding: 10px 14px; font-weight: 700; color: var(--navy); border-bottom: 1px solid var(--border); font-size: 13px; }
.notif-item {
    display: block; padding: 10px 14px; border-bottom: 1px solid var(--border);
    font-size: 12.8px; color: var(--text);
}
.notif-item:hover { background: var(--grey-bg); }
.notif-item.unread { background: var(--gold-light); font-weight: 600; }
.notif-item .notif-time { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 3px; }
.notif-empty { padding: 16px 14px; color: var(--muted); font-size: 12.8px; text-align: center; }
.notif-viewall { display: block; text-align: center; padding: 9px; font-size: 12.5px; font-weight: 600; color: var(--navy); border-top: 1px solid var(--border); }

.page-content { padding: 22px; flex: 1; min-width: 0; }

/* ---------------- Cards ---------------- */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
}
.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-body { padding: 18px; }

/* ---------------- Stat widgets ---------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    border-left: 4px solid var(--gold);
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    animation: statCardIn .5s ease both;
    transition: transform .2s ease, box-shadow .2s ease;
    position: relative;
}
.stat-card::before {
    content: "";
    display: block;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--gold);
    opacity: .14;
    margin-bottom: 12px;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.1); }
.stat-grid .stat-card:nth-child(1) { animation-delay: .03s; }
.stat-grid .stat-card:nth-child(2) { animation-delay: .09s; }
.stat-grid .stat-card:nth-child(3) { animation-delay: .15s; }
.stat-grid .stat-card:nth-child(4) { animation-delay: .21s; }
.stat-grid .stat-card:nth-child(5) { animation-delay: .27s; }
.stat-grid .stat-card:nth-child(6) { animation-delay: .33s; }
@keyframes statCardIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .stat-card { animation: none; }
    .stat-card:hover { transform: none; }
}
/* ---------------- Dashboard greeting header ---------------- */
.dash-greeting { margin-bottom: 20px; }
.dash-greeting .eyebrow {
    font-size: 10.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--gold);
}
.dash-greeting h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--navy);
    margin: 3px 0 2px;
}
.dash-greeting p { font-size: 12.8px; color: var(--muted); margin: 0; }

/* ---------------- Dashboard: weekly attendance trend bars ---------------- */
.dash-trend-bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 14px; }
.dash-trend-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.dash-trend-bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.dash-trend-bar-fill {
    width: 100%;
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: height 1s cubic-bezier(.2,.8,.3,1);
}
.dash-trend-bar-fill:last-child, .dash-trend-bar-col:last-child .dash-trend-bar-fill {
    background: linear-gradient(180deg, #ffbd85 0%, var(--gold) 100%);
}
.dash-trend-bar-value {
    position: absolute; top: -18px; left: 0; right: 0; text-align: center;
    font-size: 10.5px; color: var(--muted); font-weight: 700;
}
.dash-trend-bar-label { margin-top: 6px; font-size: 10.5px; color: var(--muted); font-weight: 600; }

/* ---------------- Dashboard: recent activity feed ---------------- */
.dash-feed { display: flex; flex-direction: column; gap: 12px; }
.dash-feed-item {
    display: flex; gap: 10px; align-items: flex-start;
    opacity: 0; transform: translateX(8px);
    animation: dashFeedIn .5s ease forwards;
}
@keyframes dashFeedIn { to { opacity: 1; transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
    .dash-feed-item { animation: none; opacity: 1; transform: none; }
    .dash-trend-bar-fill { transition: none; }
}
.dash-feed-dot {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--grey-bg); color: var(--navy);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.dash-feed-text { font-size: 12.8px; color: var(--text); font-weight: 500; }
.dash-feed-time { font-size: 10.8px; color: var(--muted); margin-top: 1px; }

.stat-card .stat-value { font-size: 27px; font-weight: 800; color: var(--navy); letter-spacing: -.01em; }
.stat-card .stat-label { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* Colorful stat card accents (dashboard) — each stat gets its own accent
   color so the dashboard reads as lively rather than monochrome navy/gold */
.stat-card.stat-color-1 { border-left-color: #2563eb; }
.stat-card.stat-color-1 .stat-value { color: #2563eb; }
.stat-card.stat-color-1::before { background: #2563eb; }
.stat-card.stat-color-2 { border-left-color: #7c3aed; }
.stat-card.stat-color-2 .stat-value { color: #7c3aed; }
.stat-card.stat-color-2::before { background: #7c3aed; }
.stat-card.stat-color-3 { border-left-color: #db2777; }
.stat-card.stat-color-3 .stat-value { color: #db2777; }
.stat-card.stat-color-3::before { background: #db2777; }
.stat-card.stat-color-4 { border-left-color: #d97706; }
.stat-card.stat-color-4 .stat-value { color: #d97706; }
.stat-card.stat-color-4::before { background: #d97706; }
.stat-card.stat-color-5 { border-left-color: #16a34a; }
.stat-card.stat-color-5 .stat-value { color: #16a34a; }
.stat-card.stat-color-5::before { background: #16a34a; }
.stat-card.stat-color-6 { border-left-color: #dc2626; }
.stat-card.stat-color-6 .stat-value { color: #dc2626; }
.stat-card.stat-color-6::before { background: #dc2626; }

/* ---------------- Dashboard charts (pure CSS/SVG, no libraries) ---------------- */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}
.chart-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 16px;
    animation: chartCardIn .6s ease both;
    animation-delay: .2s;
    transition: box-shadow .2s ease;
}
.chart-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,.08); }
@keyframes chartCardIn {
    from { opacity: 0; transform: scale(.97); }
    to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .chart-card { animation: none; }
}
.chart-card-title { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .03em; }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.donut {
    width: 130px; height: 130px; border-radius: 50%;
    background: conic-gradient(var(--navy) calc(var(--p, 50) * 1%), var(--gold) 0);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.donut-hole {
    width: 90px; height: 90px; border-radius: 50%; background: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-weight: 700; color: var(--navy); font-size: 19px; text-align: center;
}
.donut-hole span { font-size: 10.5px; font-weight: 400; color: var(--muted); }
.donut-legend { font-size: 12.8px; }
.donut-legend div { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.donut-legend .swatch { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.bar-row .bar-label { width: 100px; font-size: 12.5px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-track { flex: 1; background: var(--grey-bg); border-radius: 4px; height: 16px; overflow: hidden; }
.bar-row .bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--navy), var(--gold));
    border-radius: 4px;
    animation: barFillIn 1s cubic-bezier(.22,1,.36,1) both;
    animation-delay: .3s;
}
@keyframes barFillIn {
    from { width: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .bar-row .bar-fill { animation: none; }
}
.bar-row .bar-value { width: 32px; text-align: right; font-size: 12.5px; font-weight: 700; color: var(--navy); flex-shrink: 0; }

.progress-linear { background: var(--grey-bg); border-radius: 20px; height: 24px; overflow: hidden; position: relative; margin-bottom: 6px; }
.progress-linear-fill { height: 100%; background: linear-gradient(90deg, var(--navy), var(--gold)); border-radius: 20px 0 0 20px; }
.progress-linear-label {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.chart-empty { color: var(--muted); font-size: 12.8px; text-align: center; padding: 20px 0; }

.permission-matrix th, .permission-matrix td { white-space: nowrap; padding: 7px 10px; }
.permission-matrix td:first-child { white-space: normal; font-weight: 600; }

/* ---------------- CBT exam-taking ---------------- */
.cbt-timer-bar {
    position: sticky; top: 0; z-index: 10;
    background: var(--navy); color: #fff;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px; font-weight: 700; font-size: 15px;
    border-radius: 6px; margin-bottom: 12px;
}
.cbt-timer-bar.cbt-timer-warning { background: var(--danger); animation: cbtPulse 1s infinite; }
@keyframes cbtPulse { 0%, 100% { opacity: 1; } 50% { opacity: .7; } }
.cbt-progress-badge {
    font-size: 12.5px; font-weight: 600; background: rgba(255,255,255,.15);
    padding: 5px 12px; border-radius: 20px; white-space: nowrap;
}
.cbt-progress-badge.cbt-progress-complete { background: var(--gold); color: var(--navy); }
.cbt-question-nav {
    display: flex; flex-wrap: wrap; gap: 6px;
    background: #fff; border: 1px solid var(--border); border-radius: 6px;
    padding: 10px; margin-bottom: 16px;
}
.cbt-question-nav-item {
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 1px solid var(--border); font-size: 12px; font-weight: 700;
    color: var(--text); text-decoration: none; transition: background .15s ease, border-color .15s ease;
}
.cbt-question-nav-item:hover { border-color: var(--gold); }
.cbt-question-nav-item.cbt-question-nav-answered { background: var(--success); border-color: var(--success); color: #fff; }
.cbt-question-nav-item.cbt-question-nav-current { outline: 2px solid var(--navy); outline-offset: 1px; font-weight: 800; }
.cbt-question {
    border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px; margin-bottom: 14px;
    scroll-margin-top: 90px;
}
.cbt-question-text { margin-bottom: 8px; line-height: 1.5; }
.cbt-option {
    display: block; padding: 8px 10px; margin-bottom: 6px; border-radius: 4px;
    font-weight: 400; cursor: pointer; border: 1px solid transparent;
}
.cbt-option:hover { background: var(--grey-bg); }
.cbt-option input { margin-right: 8px; }

/* ---------------- Tables ---------------- */
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.8px; }
table.data-table th, table.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
table.data-table th {
    background: var(--navy);
    color: #fff;
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
table.data-table tbody tr:nth-child(even) { background: #fafbfd; }
table.data-table tbody tr:hover { background: var(--gold-light); }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; color: var(--navy); }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--navy);
}

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    font-size: 13.5px;
    cursor: pointer;
    font-weight: 600;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); color: #fff; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #966d09; color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }

/* ---------------- Alerts / badges ---------------- */
.alert { padding: 11px 15px; border-radius: 4px; margin-bottom: 16px; font-size: 13.8px; }
.alert-success { background: #e6f4ea; color: var(--success); border: 1px solid #b7e0c3; }
.alert-danger { background: #fbe7e9; color: var(--danger); border: 1px solid #f0bcc2; }
.alert-info { background: #e8f0fa; color: #1c4a7a; border: 1px solid #bcd6f0; }

/* ---------------- Error alerts as modal popups ---------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 16px;
    animation: modalFadeIn .18s ease both;
}
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
    background: #fff;
    border-radius: 10px;
    padding: 28px 26px 22px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    animation: modalPopIn .22s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes modalPopIn {
    from { opacity: 0; transform: scale(.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-box.modal-danger { border-top: 4px solid var(--danger); }
.modal-icon { font-size: 34px; margin-bottom: 10px; }
.modal-message { font-size: 14.5px; color: var(--text); line-height: 1.6; margin-bottom: 18px; }
.modal-message-list { text-align: left; font-size: 13.5px; color: var(--text); line-height: 1.7; margin: 0 0 18px 20px; padding: 0; }
.modal-close-btn { min-width: 120px; }

/* ---------------- Birthday celebration modal ---------------- */
.birthday-modal-overlay { background: rgba(15, 23, 42, .7); z-index: 300; }
.birthday-modal-box {
    max-width: 440px;
    background: linear-gradient(160deg, #fff 0%, #fff8e8 100%);
    border: none;
    position: relative;
    overflow: hidden;
    animation: modalPopIn .3s cubic-bezier(.34,1.56,.64,1) both, birthdayGlow 2.2s ease-in-out infinite;
}
@keyframes birthdayGlow {
    0%, 100% { box-shadow: 0 0 30px 4px rgba(212,175,55,.35), 0 20px 60px rgba(0,0,0,.3); }
    50% { box-shadow: 0 0 50px 12px rgba(212,175,55,.65), 0 20px 60px rgba(0,0,0,.3); }
}
.birthday-emoji { font-size: 40px; margin-bottom: 8px; animation: birthdayBounce 1.4s ease-in-out infinite; }
@keyframes birthdayBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-6px) rotate(-4deg); }
    75% { transform: translateY(-6px) rotate(4deg); }
}
.birthday-modal-title {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--navy), var(--gold), var(--navy));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: birthdayShimmer 3s linear infinite;
    margin: 4px 0 10px;
}
@keyframes birthdayShimmer { to { background-position: 200% center; } }
.birthday-modal-message { font-size: 14.5px; color: var(--text); line-height: 1.6; }
@media (prefers-reduced-motion: reduce) {
    .birthday-modal-box, .birthday-emoji, .birthday-modal-title { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
    .modal-overlay, .modal-box { animation: none; }
}

/* ---------------- PWA install banner (mobile) ---------------- */
.pwa-install-banner {
    position: fixed;
    left: 12px; right: 12px; bottom: 12px;
    z-index: 150;
    background: var(--navy);
    color: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    font-size: 13px;
    animation: pwaBannerIn .3s ease both;
}
@keyframes pwaBannerIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.pwa-install-banner span { flex: 1; line-height: 1.4; }
.pwa-install-btn {
    background: var(--gold);
    color: var(--navy);
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-weight: 700;
    font-size: 12.5px;
    cursor: pointer;
    flex-shrink: 0;
}
.pwa-dismiss-btn {
    background: none;
    border: none;
    color: #fff;
    opacity: .7;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    flex-shrink: 0;
}
.pwa-dismiss-btn:hover { opacity: 1; }

/* ---------------- Messaging (inbox + conversation thread) ---------------- */
.inbox-list { display: flex; flex-direction: column; }
.inbox-row {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    text-decoration: none; color: var(--text);
    transition: background .15s ease;
}
.inbox-row:hover { background: var(--grey-bg); }
.inbox-row-unread { background: var(--gold-light); }
.inbox-row-unread .inbox-row-top strong { color: var(--navy); }
.inbox-avatar {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    background: var(--navy); color: #fff; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.inbox-row-body { flex: 1; min-width: 0; }
.inbox-row-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.inbox-time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.inbox-row-snippet { font-size: 12.8px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-unread-badge {
    background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
    border-radius: 10px; padding: 2px 8px; flex-shrink: 0;
}

.inbox-filter-row { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.inbox-filter-btn {
    background: var(--grey-bg); border: 1px solid var(--border); border-radius: 20px;
    padding: 5px 14px; font-size: 12px; font-weight: 600; color: var(--muted);
    cursor: pointer; transition: all .15s ease;
}
.inbox-filter-btn:hover { background: #fff; }
.inbox-filter-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.inbox-avatar-announcement { background: var(--gold); color: var(--navy); font-size: 17px; }

.inbox-type-badge {
    display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .03em; padding: 1px 7px; border-radius: 4px; margin-right: 6px; vertical-align: middle;
}
.inbox-type-announcement { background: rgba(184,134,11,.15); color: var(--gold-dark, #92670a); }
.inbox-type-private { background: var(--grey-bg); color: var(--muted); }

.message-thread {
    max-height: 480px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
    padding: 10px 4px; margin-bottom: 14px;
}
.message-bubble { max-width: 75%; padding: 9px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; }
.message-bubble-other { align-self: flex-start; background: var(--grey-bg); border-bottom-left-radius: 3px; }
.message-bubble-own { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 3px; }
.message-sender { font-size: 10.5px; font-weight: 700; color: var(--navy); margin-bottom: 3px; }
.message-time { font-size: 10px; opacity: .65; margin-top: 4px; text-align: right; }
.message-reply-form { display: flex; gap: 8px; align-items: flex-end; }
.message-reply-form textarea { width: 100%; resize: none; }

.recipient-results {
    border: 1px solid var(--border); border-radius: 6px; margin-top: 4px;
    max-height: 220px; overflow-y: auto;
}
.recipient-result { padding: 9px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--border); }
.recipient-result:last-child { border-bottom: none; }
.recipient-result:hover { background: var(--grey-bg); }

/* ---------------- Messaging: delivery channel selection ---------------- */
.notify-channel-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.notify-channel-option {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 400; color: var(--text); cursor: pointer;
}
.notify-channel-option input { margin: 0; }
.notify-channel-fixed { color: var(--muted); cursor: default; }
.notify-channel-compact { font-size: 11.5px; color: var(--muted); }
.message-reply-form .notify-channel-row { gap: 12px; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.badge-present { background: #e6f4ea; color: var(--success); }
.badge-absent { background: #fbe7e9; color: var(--danger); }
.badge-active { background: #e6f4ea; color: var(--success); }
.badge-inactive { background: #ececec; color: var(--muted); }
.badge-partpaid { background: #fff3cd; color: #8a6100; }

/* ---------------- Finance stat card color variants ---------------- */
.stat-card-finance-blue { border-left-color: #2563eb; }
.stat-card-finance-blue .stat-value { color: #2563eb; }
.stat-card-finance-blue::before { background: #2563eb; }
.stat-card-finance-green { border-left-color: #16a34a; }
.stat-card-finance-green .stat-value { color: #16a34a; }
.stat-card-finance-green::before { background: #16a34a; }
.stat-card-finance-red { border-left-color: #dc2626; }
.stat-card-finance-red .stat-value { color: #dc2626; }
.stat-card-finance-red::before { background: #dc2626; }
.stat-card-finance-purple { border-left-color: #9333ea; }
.stat-card-finance-purple .stat-value { color: #9333ea; }
.stat-card-finance-purple::before { background: #9333ea; }

/* ---------------- Login page ---------------- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
}
.login-box {
    background: #fff;
    width: 360px;
    border-radius: 8px;
    padding: 34px 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.login-box h2 { text-align: center; color: var(--navy); margin: 0 0 4px; }
.login-box p.subtitle { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-box .btn { width: 100%; margin-top: 6px; }

/* ---------------- Password visibility toggle (all password fields) ---------------- */
.password-toggle-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    opacity: .45;
    padding: 4px;
    line-height: 1;
}
.password-toggle-btn:hover { opacity: .8; }
.password-toggle-btn.is-showing { opacity: .9; }

/* ---------------- Login page: split slider layout ---------------- */
.login-wrapper-split {
    align-items: center;
    justify-content: center;
    padding: 32px;
}
.login-shell {
    display: flex;
    width: 100%;
    max-width: 1180px;
    max-height: 720px;
    min-height: 560px;
    margin: 0 auto;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,.4);
}
.login-slider-panel {
    flex: 1 1 56%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.login-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}
.login-slide.active { opacity: 1; }
.login-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(15,23,42,.72) 0%, rgba(15,23,42,.35) 50%, rgba(15,23,42,.75) 100%);
}
.login-slide-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 1;
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    padding: 28px 36px;
    text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.login-motivation {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.45;
    padding: 0 44px;
    max-width: 480px;
    text-shadow: 0 3px 14px rgba(0,0,0,.55);
}
.login-motivation::before {
    content: "\201C";
    display: block;
    font-size: 64px;
    font-weight: 900;
    line-height: 1;
    color: var(--gold);
    margin-bottom: 4px;
    text-shadow: none;
}
.login-motivation-mobile { display: none; }
.login-motivation-desc {
    display: block;
    font-size: 14px;
    font-weight: 400;
    margin-top: 8px;
    opacity: .85;
}
.login-form-panel {
    flex: 1 1 44%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 30px 16px;
}
.login-wrapper-split .login-shell .login-box {
    box-shadow: none;
    width: 100%;
    max-width: 360px;
    padding: 0;
    position: relative;
}
.login-wrapper-split .login-shell .login-box::before {
    content: "";
    display: block;
    height: 4px;
    width: 64px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--gold), var(--navy));
    margin: 0 auto 20px;
}
.login-box .form-group input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,.18);
}
.login-apply-btn {
    display: block;
    text-align: center;
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    border: 1.5px solid var(--gold);
    color: var(--navy);
    font-weight: 700;
    font-size: 13.5px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.login-apply-btn:hover { background: var(--gold); color: #fff; }
.login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 6px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------------- Public pages (admission form/status/letter) ---------------- */
.public-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    padding: 40px 16px;
}
.public-card {
    background: #fff;
    width: 100%;
    max-width: 720px;
    border-radius: 8px;
    padding: 34px 36px;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.public-header { text-align: center; margin-bottom: 24px; }
.public-header h2 { color: var(--navy); margin: 8px 0 4px; }
.public-header .subtitle { color: var(--muted); font-size: 13.5px; }
.public-logo { max-height: 56px; max-width: 200px; object-fit: contain; }
.public-nav {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.public-nav a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-size: 12.8px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.3);
    transition: background .15s ease, color .15s ease;
}
.public-nav a:hover { background: rgba(255,255,255,.15); }
.public-nav a.public-nav-active { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.public-card .btn { width: 100%; margin-top: 6px; }
.public-card .btn-outline { width: auto; }
.tracking-code-box {
    background: var(--grey-bg); border: 2px dashed var(--gold); border-radius: 6px;
    padding: 16px; text-align: center; margin: 16px 0;
}
.tracking-code-box .code { font-size: 24px; font-weight: 800; color: var(--navy); letter-spacing: 2px; }

/* ---------------- Report card ---------------- */
.report-card {
    background: #fff;
    border: 2px solid var(--navy);
    padding: 26px 30px;
    max-width: 850px;
    margin: 0 auto;
}
.report-card .rc-header { text-align: center; border-bottom: 3px solid var(--gold); padding-bottom: 14px; margin-bottom: 18px; }
.report-card .rc-header h2 { color: var(--navy); margin: 0 0 3px; font-size: 20px; letter-spacing: .02em; }
.report-card .rc-header p { margin: 2px 0; color: var(--muted); font-size: 13px; }
.rc-report-type {
    display: inline-block;
    font-size: 15px !important;
    font-weight: 800;
    color: var(--navy) !important;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin: 8px 0 4px !important;
    padding: 4px 22px;
    border-top: 1.5px solid var(--gold);
    border-bottom: 1.5px solid var(--gold);
}
.rc-term-line { font-size: 12px !important; color: var(--muted) !important; margin-top: 3px !important; }
.rc-photo {
    position: absolute;
    top: 0;
    right: 0;
    width: 78px;
    height: 78px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--gold);
}
.rc-logo {
    position: absolute;
    top: 0;
    left: 0;
    max-width: 78px;
    max-height: 78px;
    object-fit: contain;
}
.rc-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 20px; margin-bottom: 18px; font-size: 13.8px; }

/* ---------------- Student profile hero header ---------------- */
.profile-hero { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; }
.profile-hero-photo {
    width: 96px; height: 96px; border-radius: 50%;
    object-fit: cover; border: 3px solid var(--gold-light); flex-shrink: 0;
}
.profile-hero-photo-initials {
    background: var(--navy); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 800;
}
.profile-hero-info { flex: 1; min-width: 200px; }
.profile-hero-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-hero-name { font-size: 22px; font-weight: 800; color: var(--navy); margin: 0; letter-spacing: -.01em; }
.profile-hero-subtitle { font-size: 13px; color: var(--muted); margin: 4px 0 12px; }
.profile-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.profile-info-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 24px;
    padding-top: 16px; border-top: 1px solid var(--border);
}
.profile-info-item { display: flex; flex-direction: column; gap: 2px; }
.profile-info-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.profile-info-value { font-size: 13.8px; color: var(--text); font-weight: 500; }
@media (max-width: 640px) {
    .profile-info-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------------- Printable ID card (CR80 standard: 85.6mm x 54mm) ---------------- */
.id-card-wrap { display: flex; gap: 20px; flex-wrap: wrap; }
.id-card {
    width: 85.6mm; height: 54mm;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    display: flex; flex-direction: column;
    overflow: hidden;
    font-size: 10px;
}
.id-card-header {
    background: var(--navy); color: #fff;
    padding: 6px 8px; text-align: center; flex-shrink: 0;
}
.id-card-logo { height: 18px; margin-bottom: 2px; }
.id-card-school-name { font-size: 11px; font-weight: 800; line-height: 1.1; }
.id-card-type { font-size: 7.5px; letter-spacing: .06em; opacity: .85; margin-top: 1px; }
.id-card-body { display: flex; gap: 8px; padding: 8px; flex: 1; }
.id-card-photo {
    width: 22mm; height: 26mm; object-fit: cover;
    border-radius: 4px; border: 1px solid var(--border); flex-shrink: 0;
}
.id-card-photo-initials {
    background: var(--navy); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 800;
}
.id-card-details { flex: 1; min-width: 0; }
.id-card-name { font-size: 12px; font-weight: 800; color: var(--navy); margin-bottom: 4px; line-height: 1.15; }
.id-card-row { display: flex; justify-content: space-between; font-size: 9px; margin-bottom: 2px; gap: 6px; }
.id-card-row span { color: var(--muted); }
.id-card-row strong { text-align: right; }
.id-card-footer {
    display: flex; justify-content: space-between; align-items: flex-end;
    padding: 4px 8px 6px; font-size: 7.5px; color: var(--muted); border-top: 1px dashed var(--border);
}
.id-card-signature { border-top: 1px solid var(--muted); padding-top: 2px; }
.id-card-back { align-items: center; justify-content: center; text-align: center; padding: 10px; }
.id-card-back-content p { margin: 2px 0; font-size: 8.5px; }
.id-card-note { color: var(--muted); font-size: 7px !important; margin-top: 6px !important; }
@media print {
    .id-card { box-shadow: none; break-inside: avoid; }
    .id-card-wrap { gap: 8mm; }
}

/* ---------------- Assignment details hero header ---------------- */
.assignment-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.assignment-hero-title { font-size: 20px; font-weight: 800; color: var(--navy); margin: 0; letter-spacing: -.01em; }
.assignment-hero-subtitle { font-size: 12.8px; color: var(--muted); margin: 4px 0 0; }
.assignment-hero-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.assignment-instructions { font-size: 13.5px; line-height: 1.6; margin: 12px 0; }
.rc-meta div strong { color: var(--navy); }

/* ---------------- Report card "beautiful rows" (compact info table) ---------------- */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}
.info-table tr:nth-child(even) { background: var(--grey-bg); }
.info-table td { padding: 8px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
.info-table tr:last-child td { border-bottom: none; }
.info-table td.info-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; width: 22%; white-space: nowrap; }
.info-table td.info-value { font-weight: 600; color: var(--navy); width: 28%; }

/* ---------------- Report card: mobile responsiveness (screen, not print) ---------------- */
@media (max-width: 600px) {
    .report-card { padding: 16px 14px; max-width: 100%; }
    .rc-logo, .rc-photo { width: 46px; height: 46px; max-width: 46px; max-height: 46px; }
    .report-card .rc-header { padding: 0 56px 10px; }
    .report-card .rc-header h2 { font-size: 15px; line-height: 1.3; }
    .report-card .rc-header p { font-size: 10.5px; }
    .rc-report-type { font-size: 11.5px !important; padding: 3px 10px; margin: 6px 0 3px !important; }
    .rc-term-line { font-size: 10px !important; }
    .rc-contact { font-size: 9.5px; }

    .rc-meta { grid-template-columns: 1fr; gap: 4px; font-size: 12px; margin-bottom: 14px; }

    /* Each info-table cell becomes its own line, in DOM order (label
       immediately followed by its own value), instead of a cramped
       4-column label/value/label/value row. */
    .info-table, .info-table tr, .info-table td { display: block; width: 100% !important; }
    .info-table tr { padding: 2px 0; }
    .info-table td.info-label { padding: 6px 12px 0; }
    .info-table td.info-value { padding: 0 12px 6px; }
    .info-table tr:nth-child(even) { background: transparent; }

    .report-card table.data-table { font-size: 11.5px; }
    .report-card table.data-table th, .report-card table.data-table td { padding: 6px 8px; white-space: nowrap; }
    .report-card .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    .performance-summary { flex-wrap: wrap; gap: 8px; }
}

/* Performance summary strip — Grand Total / Grand Average / GPA, shown
   bold right after the Academic Performance table */
.performance-summary {
    display: flex; flex-wrap: wrap; gap: 0;
    border: 2px solid var(--navy);
    border-radius: 6px;
    overflow: hidden;
    margin: 14px 0 18px;
}
.performance-summary .ps-item {
    flex: 1 1 auto; min-width: 130px;
    text-align: center;
    padding: 10px 8px;
    border-right: 1px solid rgba(255,255,255,.25);
    background: var(--navy);
}
.performance-summary .ps-item:last-child { border-right: none; }
.performance-summary .ps-value { font-size: 19px; font-weight: 800; color: #fff; }
.performance-summary .ps-label { font-size: 10.5px; color: var(--gold-light); text-transform: uppercase; letter-spacing: .04em; }

/* ---------------- Principal signature block ---------------- */
.signature-block {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}
.signature-block .signature-inner { text-align: center; }
.signature-block img.signature-img { max-height: 46px; max-width: 160px; object-fit: contain; display: block; margin: 0 auto 4px; }
.signature-block .signature-line { border-top: 1px solid var(--text); width: 170px; margin: 4px auto 4px; }
.signature-block .signature-label { font-size: 11.5px; color: var(--muted); }

/* ---------------- School contact line in report card header ---------------- */
.rc-contact { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------------- Shared print heading for all reports ---------------- */
.report-print-header {
    text-align: center;
    border-bottom: 3px solid var(--gold);
    padding-bottom: 14px;
    margin-bottom: 20px;
}
.report-print-logo { max-height: 56px; max-width: 180px; object-fit: contain; margin-bottom: 6px; }
.report-print-header h2 { color: var(--navy); margin: 0 0 4px; }
.report-print-title { font-weight: 700; font-size: 15px; color: var(--navy); margin: 6px 0 2px; }
.report-print-meta { font-size: 11px; color: var(--muted); }
.bulk-page-break { border-top: 3px dashed var(--border); margin: 30px 0; padding-top: 30px; }

.attendance-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.attendance-box .a-item {
    text-align: center;
    background: var(--gold-light);
    border-radius: 6px;
    padding: 12px 6px;
    border: 1px solid #e6d3ac;
}
.attendance-box .a-item .a-value { font-size: 22px; font-weight: 700; color: var(--navy); }
.attendance-box .a-item .a-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; }

/* ---------------- Psychomotor / Affective domain blocks ---------------- */
.domain-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0 6px;
}
.domain-block h3 { color: var(--navy); font-size: 13.5px; margin: 0 0 6px; }
table.domain-table td { padding: 5px 10px; font-size: 12.8px; }
table.domain-table .domain-rating { text-align: right; font-weight: 600; color: var(--navy); white-space: nowrap; }
.rc-scale-note { font-size: 10.5px; color: var(--muted); margin-top: 6px; }

/* ---------------- Scrollable / grid tables (attendance, ratings) ---------------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.attendance-grid th, .attendance-grid td { text-align: center; white-space: nowrap; }
.attendance-grid .att-select { min-width: 92px; }
.sticky-col {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 2;
    text-align: left !important;
    white-space: normal !important;
}
table.data-table th.sticky-col { background: var(--navy); z-index: 3; }
.btn-mini {
    display: inline-block;
    width: 22px; height: 22px;
    line-height: 22px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.4);
    background: rgba(255,255,255,.08);
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
}
table.data-table th .btn-mini { color: #fff; }

/* ============================================================
   Responsive / Mobile
   ============================================================ */
@media (max-width: 860px) {
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 78%;
        max-width: 280px;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 4px 0 18px rgba(0,0,0,.25);
    }
    .app-shell.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-close-btn { display: block; }
    .app-shell.sidebar-collapsed .sidebar { width: 78%; max-width: 280px; }
    .app-shell.sidebar-collapsed .label,
    .app-shell.sidebar-collapsed .chevron,
    .app-shell.sidebar-collapsed .brand-full { display: block; }
    .app-shell.sidebar-collapsed .brand-mini { display: none !important; }
    .app-shell.sidebar-collapsed .sidebar nav a { justify-content: flex-start; padding: 10px 20px; }
    .app-shell.sidebar-collapsed .sidebar-section-label { justify-content: space-between; padding: 14px 20px 6px; }

    .main-content { width: 100%; }

    .topbar h1 { font-size: 15.5px; }
    .topbar-search { display: none; }
    .back-btn { padding: 6px 8px; font-size: 0; }
    .back-btn::before { content: "\2190"; font-size: 14px; }
    .profile-name-label { display: none; }
    .profile-caret { display: none; }
    .page-content { padding: 14px; }

    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 12px; }
    .stat-card .stat-value { font-size: 20px; }

    .form-grid { grid-template-columns: 1fr; }
    .rc-meta { grid-template-columns: 1fr; }
    .domain-columns { grid-template-columns: 1fr; }
    .attendance-box { grid-template-columns: 1fr 1fr; }

    table.data-table { min-width: 560px; }
    .card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    .login-box { width: 90%; max-width: 340px; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .attendance-box { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Print — Report Card must fit on exactly one page
   ============================================================ */
@page {
    size: A4;
    margin: 8mm 10mm;
}

@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .bulk-page-break { page-break-before: always; break-before: page; }
    .bulk-report-wrapper .report-card { page-break-inside: avoid; break-inside: avoid; }
    .page-content { padding: 0; }
    body { background: #fff; font-size: 11.5px; }

    .report-card {
        border-width: 1px;
        padding: 10px 16px;
        max-width: 100%;
        box-shadow: none;
    }
    .report-card .rc-header { padding-bottom: 8px; margin-bottom: 10px; border-bottom-width: 2px; }
    .report-card .rc-header h2 { font-size: 17px; margin-bottom: 2px; }
    .report-card .rc-header p { font-size: 10.5px; margin: 1px 0; }
    .rc-report-type { font-size: 12px !important; padding: 3px 14px; margin: 5px 0 3px !important; }
    .rc-term-line { font-size: 9.5px !important; }
    .rc-photo { width: 52px; height: 52px; }
    .rc-logo { max-width: 52px; max-height: 52px; }

    .rc-meta { font-size: 11px; gap: 3px 16px; margin-bottom: 10px; }
    .rc-contact { font-size: 9px; }

    .info-table { margin-bottom: 8px; }
    .info-table td { padding: 4px 8px; font-size: 10.5px; }
    .info-table td.info-label { font-size: 8.5px; }

    .performance-summary { margin: 8px 0 10px; }
    .performance-summary .ps-item { padding: 6px 4px; }
    .performance-summary .ps-value { font-size: 14px; }
    .performance-summary .ps-label { font-size: 8px; }

    .signature-block { margin-top: 10px; }
    .signature-block img.signature-img { max-height: 34px; max-width: 120px; }
    .signature-block .signature-line { width: 130px; }
    .signature-block .signature-label { font-size: 9px; }

    .report-card h3 { font-size: 12px; margin-bottom: 6px; }

    .attendance-box { gap: 6px; margin-bottom: 10px; }
    .attendance-box .a-item { padding: 6px 4px; }
    .attendance-box .a-item .a-value { font-size: 15px; }
    .attendance-box .a-item .a-label { font-size: 8.5px; }

    .report-card table.data-table { font-size: 10.5px; }
    .report-card table.data-table th, .report-card table.data-table td { padding: 4px 6px; }

    .domain-columns { gap: 10px; margin: 8px 0 4px; }
    .domain-block h3 { font-size: 11px; margin-bottom: 3px; }
    table.domain-table td { padding: 2px 6px; font-size: 10px; }
    .rc-scale-note { font-size: 8.5px; margin-top: 3px; }

    .report-card .rc-meta:last-of-type { margin-top: 10px; font-size: 10.5px; }
}

/* ---------------- Login page: mobile — slider hidden, only the
   motivation message shows, pinned near the bottom ---------------- */
@media (max-width: 860px) {
    .login-wrapper-split { padding: 0; }
    .login-shell { flex-direction: column; max-width: 100%; max-height: none; min-height: 100vh; border-radius: 0; box-shadow: none; }
    .login-slider-panel.no-mobile { display: none; }
    .login-form-panel { min-height: 100vh; justify-content: space-between; padding: 30px 16px; background: #fff; }
    .login-motivation-mobile {
        display: block;
        color: var(--navy);
        font-weight: 700;
        text-align: center;
        font-size: 14px;
        line-height: 1.5;
        padding: 0 12px;
        margin-top: 24px;
    }
}
