/* Istifaf admin panel. Arabic RTL on Bootstrap 5.3 (rtl build); fonts and icons served locally.
   Design: a dark emerald sidebar, a white top bar, white cards on a cool grey canvas, Tajawal throughout. */

/* ---------- fonts (Tajawal, SIL OFL; fonts/Tajawal-OFL-LICENSE.txt) */

@font-face { font-family: "Tajawal"; font-style: normal; font-display: swap; font-weight: 400; src: url("../fonts/tajawal-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-display: swap; font-weight: 500; src: url("../fonts/tajawal-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-display: swap; font-weight: 700; src: url("../fonts/tajawal-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-display: swap; font-weight: 800; src: url("../fonts/tajawal-arabic-800-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-display: swap; font-weight: 400; src: url("../fonts/tajawal-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-style: normal; font-display: swap; font-weight: 500; src: url("../fonts/tajawal-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-style: normal; font-display: swap; font-weight: 700; src: url("../fonts/tajawal-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-style: normal; font-display: swap; font-weight: 800; src: url("../fonts/tajawal-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- tokens */

:root {
    --app-brand: #0f6b58;
    --app-brand-dark: #0b5345;
    --app-brand-soft: #e6f3ef;
    --app-ink: #0f1f1b;
    --app-sidebar: #0b3d35;
    --app-sidebar-2: #082e28;
    --app-gold: #c9a34e;
    --app-bg: #f3f5f7;
    --app-surface: #fff;
    --app-line: #e5e9ee;
    --app-muted: #64707d;
    --app-radius: 14px;
    --app-radius-sm: 10px;
    --app-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
    --app-shadow-lg: 0 12px 40px rgba(16, 24, 40, .12);
    --app-sidebar-width: 16.5rem;

    --bs-body-font-family: "Tajawal", system-ui, "Segoe UI", Tahoma, sans-serif;
    --bs-body-font-size: .95rem;
    --bs-body-color: #1f2a37;
    --bs-body-bg: var(--app-bg);
    --bs-border-color: var(--app-line);
    --bs-secondary-color: var(--app-muted);
    --bs-primary: var(--app-brand);
    --bs-primary-rgb: 15, 107, 88;
    --bs-link-color: var(--app-brand);
    --bs-link-color-rgb: 15, 107, 88;
    --bs-link-hover-color: var(--app-brand-dark);
    --bs-link-hover-color-rgb: 11, 83, 69;
    --bs-border-radius: var(--app-radius-sm);
    --bs-border-radius-sm: 8px;
    --bs-border-radius-lg: var(--app-radius);
    --bs-focus-ring-color: rgba(15, 107, 88, .22);
}

body {
    background: var(--app-bg);
    font-family: var(--bs-body-font-family);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 700; color: var(--app-ink); letter-spacing: 0; }

.text-body-secondary { color: var(--app-muted) !important; }

::selection { background: rgba(15, 107, 88, .18); }

/* ---------- buttons */

.btn { font-weight: 500; border-radius: var(--app-radius-sm); padding-inline: 1rem; }
.btn-sm { border-radius: 8px; padding-inline: .7rem; }
.btn i.bi { vertical-align: -.1em; }
.btn > i.bi + span, .btn > i.bi:first-child { margin-inline-end: .35rem; }

.btn-primary {
    --bs-btn-bg: var(--app-brand);
    --bs-btn-border-color: var(--app-brand);
    --bs-btn-hover-bg: var(--app-brand-dark);
    --bs-btn-hover-border-color: var(--app-brand-dark);
    --bs-btn-active-bg: var(--app-brand-dark);
    --bs-btn-active-border-color: var(--app-brand-dark);
    --bs-btn-disabled-bg: var(--app-brand);
    --bs-btn-disabled-border-color: var(--app-brand);
    --bs-btn-focus-shadow-rgb: 15, 107, 88;
    box-shadow: 0 1px 2px rgba(15, 107, 88, .25);
}

.btn-outline-primary {
    --bs-btn-color: var(--app-brand);
    --bs-btn-border-color: var(--app-brand);
    --bs-btn-hover-bg: var(--app-brand);
    --bs-btn-hover-border-color: var(--app-brand);
    --bs-btn-active-bg: var(--app-brand);
    --bs-btn-active-border-color: var(--app-brand);
}

.btn-light {
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--app-line);
    --bs-btn-hover-bg: #f6f8fa;
    --bs-btn-hover-border-color: #d7dde4;
    --bs-btn-color: #2b3642;
}

.btn-outline-secondary {
    --bs-btn-color: #3b4652;
    --bs-btn-border-color: #d5dbe2;
    --bs-btn-hover-bg: #f3f5f7;
    --bs-btn-hover-color: #1f2a37;
    --bs-btn-hover-border-color: #c6cdd6;
    --bs-btn-active-bg: #eceff3;
    --bs-btn-active-color: #1f2a37;
}

.btn-link { text-decoration: none; }

.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: inline-grid;
    place-items: center;
    font-size: 1.35rem;
    border-radius: var(--app-radius-sm);
    color: #2b3642;
}

.btn-icon:hover { background: #f1f4f6; }

/* ---------- forms */

.form-label { font-weight: 500; font-size: .88rem; color: #37424e; margin-bottom: .35rem; }

.form-control, .form-select {
    border-color: #d8dee5;
    border-radius: var(--app-radius-sm);
    min-height: 2.6rem;
    background-color: #fff;
}

.form-control-sm, .form-select-sm { min-height: 2.1rem; border-radius: 8px; }
.form-control-lg { min-height: 3.2rem; }

.form-control:focus, .form-select:focus {
    border-color: rgba(15, 107, 88, .55);
    box-shadow: 0 0 0 .22rem rgba(15, 107, 88, .14);
}

.form-check-input:checked { background-color: var(--app-brand); border-color: var(--app-brand); }
.form-check-input:focus { box-shadow: 0 0 0 .22rem rgba(15, 107, 88, .14); border-color: rgba(15, 107, 88, .55); }

.input-group > .btn { border-color: #d8dee5; }

.form-section {
    font-size: .8rem;
    font-weight: 700;
    color: var(--app-brand);
    letter-spacing: .02em;
    margin: 1.5rem 0 .9rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--app-line);
}

.form-section:first-of-type { margin-top: .25rem; }

.form-actions {
    display: flex;
    gap: .5rem;
    padding-top: 1rem;
    margin-top: .5rem;
    border-top: 1px solid var(--app-line);
}

/* ---------- alerts, badges, lists, dropdowns */

.alert { border-radius: var(--app-radius-sm); border-width: 0; border-inline-start: 4px solid; }
.alert-success { background: #ecf8f1; color: #14532d; border-color: #22a35a; }
.alert-danger { background: #fdf0ef; color: #8a1c14; border-color: #dc3545; }
.alert-info { background: #eef5ff; color: #1e3a8a; border-color: #3b82f6; }
.alert-warning { background: #fff8e6; color: #7a4d00; border-color: #f0ad1f; }

.badge { font-weight: 500; letter-spacing: 0; padding: .38em .7em; border-radius: 999px; }
.badge.text-bg-success { background: #e3f6ea !important; color: #146c3a !important; }
.badge.text-bg-danger { background: #fde7e7 !important; color: #a31d1d !important; }
.badge.text-bg-warning { background: #fff2d6 !important; color: #8a5a00 !important; }
.badge.text-bg-secondary { background: #eceff3 !important; color: #46505c !important; }
.badge.text-bg-info { background: #e6f1ff !important; color: #1d4ed8 !important; }
.badge.text-bg-light { background: #f1f4f6 !important; color: #37424e !important; border: 1px solid var(--app-line); }
.badge.text-bg-primary { background: var(--app-brand-soft) !important; color: var(--app-brand-dark) !important; }

.list-group { --bs-list-group-border-color: var(--app-line); --bs-list-group-border-radius: var(--app-radius-sm); }
.list-group-item-action:hover { background: #f7f9fa; }

.dropdown-menu { border-color: var(--app-line); border-radius: var(--app-radius-sm); padding: .4rem; box-shadow: var(--app-shadow-lg) !important; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; }
.dropdown-item:active { background: var(--app-brand); }

.nav-tabs { border-bottom-color: var(--app-line); gap: .25rem; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--app-muted); font-weight: 500; border-radius: 0; }
.nav-tabs .nav-link.active { color: var(--app-brand); border-bottom-color: var(--app-brand); background: transparent; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--app-brand); --bs-nav-pills-border-radius: 8px; }
.nav-pills .nav-link { color: #37424e; }

.pagination { --bs-pagination-active-bg: var(--app-brand); --bs-pagination-active-border-color: var(--app-brand); --bs-pagination-color: var(--app-brand); }

.modal-content { border: 0; border-radius: var(--app-radius); box-shadow: var(--app-shadow-lg); }

/* ---------- layout: sidebar + content */

.app-layout { display: flex; min-height: 100vh; }

/* The sidebar is sticky and one screen tall; its colour continues down the page behind it. */
@media (min-width: 992px) {
    .app-layout { background: linear-gradient(to left, var(--app-sidebar-2) var(--app-sidebar-width), var(--app-bg) var(--app-sidebar-width)); }
}

.app-sidebar {
    --bs-offcanvas-width: var(--app-sidebar-width);
    --bs-offcanvas-bg: var(--app-sidebar);
    width: var(--app-sidebar-width);
    background: linear-gradient(180deg, var(--app-sidebar) 0%, var(--app-sidebar-2) 100%);
    color: #cfe2dc;
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .app-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        flex-shrink: 0;
    }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.brand-link { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: #fff; }
.brand-link:hover { color: #fff; }

.brand-mark {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 11px;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, #1b8d74, #0f6b58);
    color: #fff;
    font-size: 1.2rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15), 0 4px 12px rgba(0, 0, 0, .2);
    flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 1.2rem; font-weight: 800; color: #fff; }
.brand-tag { font-size: .72rem; color: rgba(207, 226, 220, .7); }

.sidebar-scroll { flex: 1; overflow-y: auto; padding: .75rem .7rem 1.5rem; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }

.side-nav { list-style: none; margin: 0; padding: 0; }

.side-heading {
    font-size: .7rem;
    font-weight: 700;
    color: rgba(207, 226, 220, .5);
    letter-spacing: .04em;
    margin: 1.1rem .8rem .35rem;
}

.side-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .58rem .8rem;
    margin-bottom: 2px;
    border-radius: 10px;
    color: #cfe2dc;
    text-decoration: none;
    font-weight: 500;
    font-size: .92rem;
    transition: background-color .15s ease, color .15s ease;
    position: relative;
}

.side-link i { font-size: 1.08rem; opacity: .85; width: 1.2rem; text-align: center; }

.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.side-link.active {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-weight: 700;
}

.side-link.active::before {
    content: "";
    position: absolute;
    inset-inline-start: -.7rem;
    top: .5rem;
    bottom: .5rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--app-gold);
}

.side-link.active i { opacity: 1; color: #9fe0cb; }

.app-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: .75rem;
    height: 4rem;
    padding: 0 1.5rem;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--app-line);
}

.topbar-title { font-weight: 700; color: var(--app-ink); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: .5rem; }

.topbar-btn { display: inline-flex; align-items: center; gap: .4rem; }

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    border: 1px solid var(--app-line);
    background: #fff;
    border-radius: 999px;
    padding: .25rem .35rem .25rem .8rem;
    font-weight: 500;
    color: #1f2a37;
}

.user-chip:hover { background: #f7f9fa; }

.avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: var(--app-brand-soft);
    color: var(--app-brand-dark);
    font-weight: 800;
}

.app-main { flex: 1; padding: 1.75rem 1.75rem 3rem; max-width: 1480px; width: 100%; }

@media (max-width: 575.98px) {
    .app-main { padding: 1.1rem 1rem 2.5rem; }
    .app-topbar { padding: 0 .75rem; }
}

/* ---------- page heading and cards */

.page-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: .75rem 1rem;
    margin-bottom: 1.35rem;
}

.page-head h1, .page-title { font-size: 1.55rem; font-weight: 800; color: var(--app-ink); margin: 0; }
.page-head .text-body-secondary, .page-sub { font-size: .9rem; color: var(--app-muted); margin-top: .25rem; }

.app-card {
    background: var(--app-surface);
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    padding: 1.35rem 1.5rem;
    box-shadow: var(--app-shadow);
}

.app-card + .app-card, section.app-card + section.app-card { margin-top: 1rem; }

.app-card > h2.h6, .app-card > .h6, .card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--app-ink);
    margin-bottom: 1rem;
}

.app-narrow { max-width: 36rem; }
.app-medium { max-width: 56rem; }
.app-search { max-width: 30rem; }
.year-input { width: 5.5rem; }

.card { border-color: var(--app-line); border-radius: var(--app-radius); box-shadow: var(--app-shadow); }

/* ---------- stat cards */

.stat {
    position: relative;
    background: var(--app-surface);
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--app-shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    background: var(--app-brand-soft);
    color: var(--app-brand);
}

.stat-icon.tone-blue { background: #e8f0fe; color: #2563eb; }
.stat-icon.tone-amber { background: #fff4dc; color: #b7791f; }
.stat-icon.tone-rose { background: #fdecef; color: #d6336c; }
.stat-icon.tone-violet { background: #f1ebff; color: #7048e8; }

.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--app-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--app-muted); font-size: .88rem; margin-top: .15rem; }

/* attendance meter on the dashboard */
.meter { display: flex; height: .6rem; border-radius: 999px; overflow: hidden; background: #eef1f4; }
.meter > span { display: block; height: 100%; }
.m-present { background: #22a35a; }
.m-late { background: #f0ad1f; }
.m-excused { background: #94a3b8; }
.m-absent { background: #e5484d; }

.legend-row { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: .9rem; }
.legend-item { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; color: #37424e; }
.legend-item b { font-variant-numeric: tabular-nums; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; }

.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .75rem; }

.quick-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .85rem 1rem;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius-sm);
    text-decoration: none;
    color: #1f2a37;
    font-weight: 500;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.quick-link i { font-size: 1.2rem; color: var(--app-brand); }
.quick-link:hover { border-color: rgba(15, 107, 88, .35); box-shadow: var(--app-shadow); transform: translateY(-1px); color: var(--app-ink); }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--app-muted); }
.empty-state i { font-size: 2.4rem; color: #b6c2cd; display: block; margin-bottom: .6rem; }

/* ---------- tables */

.table {
    --bs-table-border-color: var(--app-line);
    --bs-table-hover-bg: #f7f9fa;
    --bs-table-striped-bg: #fafbfc;
    margin-bottom: 0;
    font-variant-numeric: tabular-nums;
}

.table > thead > tr > th, .table > thead > tr > td {
    font-size: .8rem;
    font-weight: 700;
    color: var(--app-muted);
    background: #f8fafb;
    border-bottom-width: 1px;
    white-space: nowrap;
    padding-top: .7rem;
    padding-bottom: .7rem;
}

.table > :not(caption) > * > * { padding: .7rem .75rem; }
.table-sm > :not(caption) > * > * { padding: .4rem .5rem; }
.table-light { --bs-table-bg: #f8fafb; --bs-table-color: #37424e; }
.table-bordered > :not(caption) > * { border-color: var(--app-line); }

.table-responsive { border-radius: var(--app-radius-sm); }

.app-card > .table-responsive:only-child, .app-card > .table-responsive:last-child { margin-bottom: -.35rem; }

.table a:not(.btn) { font-weight: 500; text-decoration: none; }
.table a:not(.btn):hover { text-decoration: underline; }

/* ---------- stage picker (platform school form) */

.stage-picker { display: flex; flex-wrap: wrap; gap: .6rem; }

.stage-option {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1rem;
    border: 1.5px solid #d8dee5;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 500;
    color: #37424e;
    background: #fff;
    user-select: none;
    transition: all .15s ease;
}

.stage-option i { color: #c4ccd5; }
.stage-option:hover { border-color: rgba(15, 107, 88, .45); }
.btn-check:checked + .stage-option { border-color: var(--app-brand); background: var(--app-brand-soft); color: var(--app-brand-dark); }
.btn-check:checked + .stage-option i { color: var(--app-brand); }
.btn-check:focus-visible + .stage-option { box-shadow: 0 0 0 .22rem rgba(15, 107, 88, .18); }

/* ---------- sign-in pages */

.auth-body {
    background:
        radial-gradient(1200px 600px at 110% -10%, rgba(27, 141, 116, .35), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(201, 163, 78, .18), transparent 60%),
        linear-gradient(160deg, #0b3d35 0%, #082e28 100%);
    min-height: 100vh;
}

.app-auth {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.app-auth > .alert { width: 100%; max-width: 26rem; }

.auth-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.5rem; }
.auth-brand .brand-mark { width: 3rem; height: 3rem; font-size: 1.5rem; border-radius: 14px; }
.auth-brand .brand-name { font-size: 1.9rem; }

.auth-card {
    width: 100%;
    max-width: 26rem;
    background: #fff;
    border-radius: 18px;
    padding: 2.25rem 2rem 2rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
}

.auth-card h1 { font-size: 1.35rem; font-weight: 800; text-align: center; margin-bottom: .35rem; }
.auth-card .auth-lead { text-align: center; color: var(--app-muted); margin-bottom: 1.6rem; font-size: .92rem; }
.auth-card .btn { min-height: 2.9rem; }
.auth-card .form-control { min-height: 2.9rem; }

.auth-divider { display: flex; align-items: center; gap: .75rem; color: var(--app-muted); font-size: .82rem; margin: 1.25rem 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--app-line); }

.auth-foot { margin-top: 1.5rem; color: rgba(207, 226, 220, .6); font-size: .82rem; }

/* ---------- bulk entry sheets */

.marks-sheet input.mark { width: 6rem; text-align: center; font-variant-numeric: tabular-nums; }
.marks-sheet input.mark.below-pass { color: var(--bs-danger); font-weight: 700; }
.marks-sheet tr.changed td { background: #fffbe6; }

.marks-sheet tr:focus-within td,
.attendance-sheet tr:focus-within td,
.attendance-sheet tr:focus td { background: #eef7f4; }

.attendance-sheet .minutes { width: 5rem; }
.attendance-sheet tr:not(.status-late) .minutes { visibility: hidden; }
.attendance-sheet tr.status-absent td:first-child { box-shadow: inset -4px 0 0 var(--bs-danger); }
.attendance-sheet tr.status-late td:first-child { box-shadow: inset -4px 0 0 var(--bs-warning); }

.rules-table input.num { width: 4.5rem; text-align: center; }
.rules-table select { min-width: 9rem; }
.rules-table tr.rule-new td { background: #f8f9fa; }

.timetable select { min-width: 10rem; }

/* ---------- results */

.results-table .subject-head {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    max-height: 10rem;
    vertical-align: bottom;
}

.result-failed { background: #fde2e1 !important; color: #8a1c14; }
.result-supplementary { background: #fff1cc !important; }
.result-decision { background: #e1efff !important; }
.result-exempt { background: #e3f4e8 !important; }

.legend {
    display: inline-block;
    width: .9rem;
    height: .9rem;
    border-radius: .25rem;
    margin-inline-end: .3rem;
    vertical-align: middle;
    border: 1px solid var(--bs-border-color);
}

/* ---------- print: sheets fill the page, no navigation */

@media print {
    @page { size: A4 landscape; margin: 1cm; }

    body { background: #fff; }
    .app-layout { display: block; background: none; }
    .app-main { padding: 0; max-width: none; }
    .app-card { border: 0; padding: 0; box-shadow: none; }
    .table-responsive { overflow: visible; }
}

/* The validation summary hides its empty list with an inline style, which the CSP blocks: hide it here. */
.validation-summary-valid { display: none; }

/* ---------- homework and announcements */

.homework-list { display: flex; flex-direction: column; }
.homework-item { padding: 1rem 0; border-bottom: 1px solid var(--app-line); }
.homework-item:first-child { padding-top: 0; }
.homework-item:last-child { border-bottom: 0; padding-bottom: 0; }
.homework-title, .announcement-title { font-size: 1.05rem; font-weight: 700; margin: 0; color: var(--app-ink); }
.homework-body, .announcement-body { margin: .5rem 0 .6rem; color: #37424e; white-space: pre-line; }
.homework-meta { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; font-size: .85rem; color: var(--app-muted); }
.homework-meta i { margin-inline-end: .2rem; }

.attachment-list { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .7rem; }
.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .7rem;
    border: 1px solid var(--app-line);
    border-radius: 999px;
    font-size: .85rem;
    color: #2b3642;
    text-decoration: none;
    background: #fafbfc;
    max-width: 100%;
}
.attachment-chip:hover { border-color: rgba(15, 107, 88, .4); color: var(--app-brand-dark); }

.announcement-list { display: flex; flex-direction: column; gap: 1rem; }
.announcement-list .app-card + .app-card { margin-top: 0; }
.announcement-card.is-expired { opacity: .7; }
.min-w-0 { min-width: 0; }

.staff-news { display: flex; flex-direction: column; gap: .9rem; }
.staff-news-item { border-inline-start: 3px solid var(--app-gold); padding-inline-start: .8rem; }
.staff-news-item h3 { font-size: .98rem; font-weight: 700; margin: 0 0 .2rem; }
.staff-news-item p { margin: 0; color: #37424e; font-size: .9rem; white-space: pre-line; }


/* ---------- messages */

.side-badge {
    margin-inline-start: auto;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 .4rem;
    border-radius: 999px;
    background: #e5484d;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    display: inline-grid;
    place-items: center;
}

.thread-list { display: flex; flex-direction: column; }
.thread-row {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--app-line);
    text-decoration: none;
    color: inherit;
    transition: background-color .15s ease;
}
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover { background: #f7f9fa; color: inherit; }
.thread-row.is-unread { background: #f3faf7; }
.thread-row.is-unread .thread-subject { font-weight: 800; }
.thread-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.thread-top { display: flex; justify-content: space-between; gap: .75rem; }
.thread-who { font-weight: 700; color: var(--app-ink); }
.thread-time { font-size: .8rem; color: var(--app-muted); white-space: nowrap; }
.thread-subject { font-weight: 600; color: #2b3642; }
.thread-preview { color: var(--app-muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-side { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; flex-shrink: 0; }

.chat { display: flex; flex-direction: column; gap: .75rem; background: #f7f9fa; }
.chat-row { display: flex; }
.chat-row.from-school { justify-content: flex-start; }
.chat-row.from-guardian { justify-content: flex-end; }
.chat-bubble {
    max-width: min(34rem, 85%);
    padding: .7rem .95rem .5rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--app-line);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.from-school .chat-bubble { background: var(--app-brand-soft); border-color: rgba(15, 107, 88, .15); border-start-start-radius: 4px; }
.from-guardian .chat-bubble { border-start-end-radius: 4px; }
.chat-sender { font-size: .78rem; font-weight: 700; color: var(--app-brand-dark); margin-bottom: .15rem; }
.from-guardian .chat-sender { color: #5b4b8a; }
.chat-body { white-space: pre-line; color: #1f2a37; }
.chat-meta { display: flex; align-items: center; gap: .6rem; font-size: .74rem; color: var(--app-muted); margin-top: .35rem; }
.chat-reply { margin-top: .5rem; padding-top: 1rem; border-top: 1px solid var(--app-line); background: #fff; margin-inline: -1.5rem; margin-bottom: -1.35rem; padding-inline: 1.5rem; padding-bottom: 1.25rem; border-radius: 0 0 var(--app-radius) var(--app-radius); }
.chat-file { max-width: 18rem; }

.thread-facts { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0; font-size: .9rem; }
.thread-facts dt { color: var(--app-muted); font-weight: 500; }
.thread-facts dd { margin: 0; }

/* ---------------------------------------------------------------- AI tutor box in the homework form */
.tutor-box { border: 1px solid var(--app-line); border-radius: var(--app-radius-sm); padding: .75rem 1rem; background: var(--app-brand-soft); }
.tutor-box > summary { cursor: pointer; font-weight: 700; color: var(--app-brand-dark); }
.guardian-cards { display: flex; flex-wrap: wrap; gap: 1rem; }
.guardian-card { width: 100%; max-width: 420px; border: 2px dashed var(--app-line); border-radius: var(--app-radius-sm); padding: 1rem 1.25rem; background: #fff; break-inside: avoid; }
.guardian-card header { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--app-line); padding-bottom: .5rem; margin-bottom: .75rem; }
.guardian-card-brand { font-weight: 800; color: var(--app-brand-dark); font-size: 1.15rem; }
.guardian-card-school { font-size: .9rem; color: var(--app-muted); }
.guardian-card dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0 0 .75rem; }
.guardian-card dt { color: var(--app-muted); font-weight: 400; }
.guardian-card dd { margin: 0; font-weight: 600; }
.guardian-card-value { text-align: start; font-family: ui-monospace, Consolas, monospace; }
.guardian-card-password { font-size: 1.35rem; letter-spacing: .12em; }
.guardian-card-steps { font-size: .85rem; color: #37424e; margin: 0; padding-inline-start: 1.1rem; }
.guardian-card-stores { display: flex; align-items: center; gap: .75rem; border-top: 1px solid var(--app-line); margin-top: .75rem; padding-top: .6rem; font-size: .8rem; color: var(--app-muted); }
.guardian-card-stores span { flex: 1; }
.guardian-card-stores figure { margin: 0; text-align: center; }
.guardian-card-stores img { display: block; width: 84px; height: 84px; image-rendering: pixelated; }
.guardian-card-stores figcaption { font-weight: 700; color: #37424e; font-size: .8rem; }
.recipients-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--app-line); border-radius: var(--app-radius-sm); padding: .5rem .75rem; }
.channel-pinned { border-inline-start: 4px solid var(--app-gold, #c9a34e); }
.channel-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.legal-page { max-width: 820px; margin: 2rem auto; background: #fff; border: 1px solid var(--app-line); border-radius: var(--app-radius-sm); padding: 2rem; line-height: 1.8; }
.legal-page h1 { font-size: 1.5rem; font-weight: 800; color: var(--app-brand-dark); }
.legal-page h2 { font-size: 1.1rem; font-weight: 700; margin-top: 1.5rem; }
.legal-page dt { margin-top: .75rem; }
.answer-box { border: 1px solid var(--app-line); border-radius: var(--app-radius-sm); padding: .75rem 1rem; }
.answer-box > summary { cursor: pointer; font-weight: 700; color: var(--app-ink); }
.submission-list { display: flex; flex-direction: column; gap: .75rem; }
.submission-missing { opacity: .65; }
.submission-photos { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.submission-photos img { width: 140px; height: 140px; object-fit: cover; border-radius: var(--app-radius-sm); border: 1px solid var(--app-line); }
.tutor-box > summary .bi { color: var(--app-gold); }

/* AI tutor results (teacher) and alerts */
.side-badge-alert { background: #d6336c; }
.concept-bar { display: block; width: 100%; height: .5rem; border: 0; border-radius: 999px; overflow: hidden; background: var(--app-line); appearance: none; }
.concept-bar::-webkit-progress-bar { background: var(--app-line); }
.concept-bar.good::-webkit-progress-value { background: #2f9e44; }
.concept-bar.fair::-webkit-progress-value { background: #f0a020; }
.concept-bar.weak::-webkit-progress-value { background: #d6336c; }
.concept-bar.good::-moz-progress-bar { background: #2f9e44; }
.concept-bar.fair::-moz-progress-bar { background: #f0a020; }
.concept-bar.weak::-moz-progress-bar { background: #d6336c; }
.quiz-review { border-top: 1px solid var(--app-line); padding: .75rem 0; }
.quiz-review:first-of-type { border-top: 0; }

/* The platform home: sign-ins per day as small columns (heights by class, the CSP forbids inline styles). */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 90px; border-bottom: 1px solid var(--app-line); }
.spark-bar { flex: 1 1 0; min-height: 2px; background: #9fcfc1; border-radius: 3px 3px 0 0; }
.spark-bar:last-child { background: var(--app-brand, #0f6e5c); }
.spark-h-0 { height: 0%; }
.spark-h-1 { height: 5%; }
.spark-h-2 { height: 10%; }
.spark-h-3 { height: 15%; }
.spark-h-4 { height: 20%; }
.spark-h-5 { height: 25%; }
.spark-h-6 { height: 30%; }
.spark-h-7 { height: 35%; }
.spark-h-8 { height: 40%; }
.spark-h-9 { height: 45%; }
.spark-h-10 { height: 50%; }
.spark-h-11 { height: 55%; }
.spark-h-12 { height: 60%; }
.spark-h-13 { height: 65%; }
.spark-h-14 { height: 70%; }
.spark-h-15 { height: 75%; }
.spark-h-16 { height: 80%; }
.spark-h-17 { height: 85%; }
.spark-h-18 { height: 90%; }
.spark-h-19 { height: 95%; }
.spark-h-20 { height: 100%; }


/* ---------- sidebar: groups, motion, search, icons-only mode (decision 2026-11-13)
   Motion is CSS only and stops for people who ask for reduced motion. */

.app-sidebar { transition: width .24s cubic-bezier(.4, 0, .2, 1), box-shadow .24s ease; }

.side-search {
    position: relative;
    margin: .8rem .9rem .1rem;
}

.side-search i {
    position: absolute;
    inset-inline-start: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(207, 226, 220, .55);
    font-size: .9rem;
    pointer-events: none;
}

.side-search input {
    width: 100%;
    height: 2.3rem;
    padding: 0 2.2rem 0 .8rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-size: .88rem;
    outline: 0;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.side-search input::placeholder { color: rgba(207, 226, 220, .5); }
.side-search input:focus { background: rgba(255, 255, 255, .1); border-color: rgba(159, 224, 203, .45); box-shadow: 0 0 0 3px rgba(159, 224, 203, .12); }

.side-empty { color: rgba(207, 226, 220, .6); font-size: .85rem; text-align: center; margin: 1.2rem 0 0; }

.side-item[hidden], .side-group[hidden] { display: none; }

.side-group { margin-top: .2rem; }

.side-group-toggle {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .58rem .8rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #dcebe6;
    font: inherit;
    font-weight: 700;
    font-size: .9rem;
    text-align: start;
    transition: background-color .18s ease, color .18s ease;
}

.side-group-toggle > i:first-child { font-size: 1.08rem; width: 1.2rem; text-align: center; opacity: .9; transition: transform .22s ease, color .18s ease; }
.side-group-toggle:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-group-toggle:hover > i:first-child { transform: scale(1.12); }
.side-group-toggle:focus-visible, .side-link:focus-visible { outline: 2px solid rgba(159, 224, 203, .7); outline-offset: 1px; }
.side-group.has-active > .side-group-toggle { color: #fff; }
.side-group.has-active > .side-group-toggle > i:first-child { color: #9fe0cb; }

.side-group-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.side-caret { font-size: .75rem; opacity: .6; transition: transform .28s cubic-bezier(.4, 0, .2, 1); }
.side-group.open > .side-group-toggle .side-caret { transform: rotate(180deg); }
.side-group-badge { margin-inline-start: 0; }
.side-group.open > .side-group-toggle .side-group-badge { display: none; }

/* The body opens by animating a grid row from 0fr to 1fr: smooth at any height, no measuring in script. */
.side-group-body { display: grid; grid-template-rows: 0fr; }
.side-group.open > .side-group-body { grid-template-rows: 1fr; }
.nav-ready .side-group-body { transition: grid-template-rows .28s cubic-bezier(.4, 0, .2, 1); }

.side-sub {
    list-style: none;
    margin: 0;
    padding: 0;
    padding-inline-start: .95rem;
    min-height: 0;
    overflow: hidden;
    visibility: hidden;
    position: relative;
}

.nav-ready .side-sub { transition: visibility 0s linear .28s; }
.side-group.open > .side-group-body > .side-sub { visibility: visible; transition-delay: 0s; }

.side-sub::before {
    content: "";
    position: absolute;
    inset-inline-start: 1.38rem;
    top: .3rem;
    bottom: .5rem;
    width: 1px;
    background: rgba(255, 255, 255, .1);
}

.side-sub .side-link { padding-block: .5rem; font-size: .89rem; margin-inline-start: .85rem; }
.side-sub > li:first-child { margin-top: .15rem; }

.side-link { transition: background-color .18s ease, color .18s ease, padding .18s ease; overflow: hidden; }
.side-link i { transition: transform .22s ease, color .18s ease; flex-shrink: 0; }
.side-link:hover i { transform: translateX(-3px); }
.side-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.side-link.active::before {
    inset-inline-start: 0;
    top: .45rem;
    bottom: .45rem;
    border-radius: 3px;
    animation: side-mark .3s cubic-bezier(.4, 0, .2, 1) both;
}

/* Links slide in one after another when a group opens. */
.nav-ready .side-group.opening .side-sub > li { animation: side-in .26s cubic-bezier(.4, 0, .2, 1) both; }
.nav-ready .side-group.opening .side-sub > li:nth-child(2) { animation-delay: .03s; }
.nav-ready .side-group.opening .side-sub > li:nth-child(3) { animation-delay: .06s; }
.nav-ready .side-group.opening .side-sub > li:nth-child(4) { animation-delay: .09s; }
.nav-ready .side-group.opening .side-sub > li:nth-child(5) { animation-delay: .12s; }
.nav-ready .side-group.opening .side-sub > li:nth-child(6) { animation-delay: .15s; }
.nav-ready .side-group.opening .side-sub > li:nth-child(n+7) { animation-delay: .18s; }

@keyframes side-in {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes side-mark {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@keyframes page-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.app-main { animation: page-in .28s ease both; }

.side-badge { animation: badge-pop .35s cubic-bezier(.34, 1.56, .64, 1) both; }

@keyframes badge-pop {
    from { transform: scale(.4); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .8rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, .07);
    background: rgba(0, 0, 0, .12);
}

.sidebar-user .avatar { background: rgba(159, 224, 203, .16); color: #c9f0e3; flex-shrink: 0; }
.sidebar-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sidebar-user-name { color: #fff; font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: var(--app-gold); font-size: .74rem; font-weight: 500; }

#sidebarMini i { transition: transform .24s ease; }
.sidebar-mini #sidebarMini i { transform: scaleX(-1); }

/* Icons only (large screens): the sidebar narrows to a rail and opens over the page while the pointer or the keyboard is in it. */
@media (min-width: 992px) {
    .sidebar-mini { --app-sidebar-rail: 4.6rem; }
    .sidebar-mini .app-layout { background: linear-gradient(to left, var(--app-sidebar-2) var(--app-sidebar-rail), var(--app-bg) var(--app-sidebar-rail)); }
    .sidebar-mini .app-sidebar { width: var(--app-sidebar-rail); z-index: 1030; }
    .sidebar-mini .app-sidebar:hover, .sidebar-mini .app-sidebar:focus-within {
        width: var(--app-sidebar-width);
        margin-inline-end: calc(var(--app-sidebar-rail) - var(--app-sidebar-width));
        box-shadow: -18px 0 40px rgba(8, 46, 40, .28);
    }

    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .brand-text,
    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .side-text,
    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .side-group-title,
    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .side-caret,
    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .side-group-body,
    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .sidebar-user-text,
    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .side-search input,
    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .side-empty { display: none; }

    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .side-search { height: 2.3rem; }
    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .side-search i { inset-inline-start: 50%; transform: translate(50%, -50%); }
    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .side-link,
    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .side-group-toggle { justify-content: center; padding-inline: 0; }
    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .sidebar-brand,
    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .sidebar-user { justify-content: center; padding-inline: 0; }
    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .side-badge {
        position: absolute;
        top: .3rem;
        inset-inline-end: .7rem;
        min-width: .6rem;
        width: .6rem;
        height: .6rem;
        padding: 0;
        font-size: 0;
    }

    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .side-group-toggle { position: relative; }
    .sidebar-mini .app-sidebar:not(:hover):not(:focus-within) .side-group.has-active > .side-group-toggle { background: rgba(255, 255, 255, .12); }
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar, .side-group-body, .side-sub, .side-caret, .side-link, .side-link i, .side-group-toggle, .side-group-toggle > i:first-child, #sidebarMini i { transition: none !important; }
    .app-main, .side-badge, .side-link.active::before, .side-group.opening .side-sub > li, .receipt-ready { animation: none !important; }
}

/* ---------- ticking students (transport lines, discounts) and finance pages */

.pick-table .pick-cell { width: 2.6rem; text-align: center; }
.pick-table .form-check-input { width: 1.15rem; height: 1.15rem; cursor: pointer; }
.pick-label { cursor: pointer; margin: 0; font-weight: 500; }
.pick-table tr:has(.form-check-input:checked) { background: var(--app-brand-soft); }
.pick-table tr:has(.form-check-input:checked) > td { background: transparent; }

.save-bar {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem -1.5rem -1.35rem;
    padding: .8rem 1.5rem;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--app-line);
    border-radius: 0 0 var(--app-radius) var(--app-radius);
}

.finance-tabs { gap: .3rem; flex-wrap: nowrap; overflow-x: auto; padding-bottom: .2rem; scrollbar-width: thin; }
.finance-tabs .nav-link { color: #3b4652; font-weight: 500; white-space: nowrap; background: #fff; border: 1px solid var(--app-line); }
.finance-tabs .nav-link.active { border-color: var(--app-brand); }

.money-table td[dir="ltr"], .money-table th { white-space: nowrap; }
.money-table td[dir="ltr"] { font-variant-numeric: tabular-nums; text-align: start; }
.stat-value[dir="ltr"] { font-size: 1.3rem; text-align: start; }
.stat-value-sm { font-size: 1.05rem !important; }

.month-row { display: flex; align-items: center; gap: .8rem; margin-bottom: .45rem; }
.month-name { width: 8.5rem; flex-shrink: 0; color: var(--app-muted); font-size: .88rem; }
.month-value { width: 7rem; flex-shrink: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.installment-no { width: 1.5rem; text-align: center; font-weight: 700; }

.receipt-cancelled .receipt-amount { text-decoration: line-through; color: var(--app-muted); }
.receipt-cancelled { background: #fbf3f4; }
.receipt-ready { animation: page-in .35s ease both; }


/* ---------- school setup wizard (docs/school-onboarding-plan.md) */

.setup-bar { height: .6rem; border-radius: 999px; background: var(--app-line); }
.setup-percent { font-size: 1.4rem; font-weight: 800; color: var(--app-brand); }

.setup-steps { list-style: none; margin: 0; padding: 0; position: relative; }

.setup-step {
    display: flex;
    gap: 1rem;
    position: relative;
    padding-bottom: 1rem;
    animation: page-in .3s ease both;
}

.setup-step:nth-child(2) { animation-delay: .04s; }
.setup-step:nth-child(3) { animation-delay: .08s; }
.setup-step:nth-child(4) { animation-delay: .12s; }
.setup-step:nth-child(5) { animation-delay: .16s; }
.setup-step:nth-child(6) { animation-delay: .2s; }
.setup-step:nth-child(n+7) { animation-delay: .24s; }

/* the line joining the steps */
.setup-step:not(:last-child)::before {
    content: "";
    position: absolute;
    inset-inline-start: 1.2rem;
    top: 2.5rem;
    bottom: 0;
    width: 2px;
    background: var(--app-line);
}

.setup-step.setup-done:not(:last-child)::before { background: #9fd3c2; }

.setup-mark {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    font-weight: 800;
    background: #fff;
    border: 2px solid var(--app-line);
    color: var(--app-muted);
    z-index: 1;
}

.setup-done .setup-mark { background: var(--app-brand); border-color: var(--app-brand); color: #fff; }
.setup-open .setup-mark { border-color: var(--app-gold); color: #8a6a1c; }
.setup-next .setup-mark { box-shadow: 0 0 0 5px rgba(201, 163, 78, .2); }

.setup-body {
    flex: 1;
    min-width: 0;
    background: var(--app-surface);
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    padding: 1rem 1.2rem;
    box-shadow: var(--app-shadow);
}

.setup-next .setup-body { border-color: var(--app-gold); }
.setup-locked .setup-body { background: #fafbfc; }
.setup-locked .setup-body h2 { color: var(--app-muted); }

.setup-missing { margin: 0 0 .7rem; padding-inline-start: 1.1rem; font-size: .9rem; color: #8a4b00; }
.setup-done .setup-missing { color: var(--app-muted); }

.setup-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1.2rem;
    border-radius: var(--app-radius);
    background: #fff8e6;
    border: 1px solid #f0dfae;
    color: #5c4508;
    text-decoration: none;
}

.setup-banner:hover { background: #fff3d1; color: #5c4508; }
.setup-banner-icon { font-size: 1.5rem; color: #b7791f; }
.setup-banner-text { flex: 1; display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.setup-banner .setup-bar { max-width: 22rem; background: #f0dfae; }

@media (prefers-reduced-motion: reduce) {
    .setup-step { animation: none !important; }
}

/* A long list of choices inside a card (moving a section's students). */
.scroll-list { max-height: 18rem; overflow-y: auto; }
