/* SchoolFlow retheme for Tabler (dark mode): OLED black + the logo's blue and red.
   Tabler reads these --tblr-* variables everywhere, so the whole look is changed in this one block. */
:root,
[data-bs-theme="dark"] {
    --tblr-body-bg: #000;
    --tblr-bg-surface: #0c0c0c;
    --tblr-bg-surface-secondary: #111;
    --tblr-bg-surface-tertiary: #161616;
    --tblr-bg-forms: #0c0c0c;
    --tblr-border-color: #262626;
    --tblr-border-color-translucent: #262626;
    --tblr-primary: #0ea5e0;
    --tblr-primary-rgb: 14, 165, 224;
    --tblr-link-color: #0ea5e0;
    --tblr-link-color-rgb: 14, 165, 224;
    --tblr-danger: #ff3f22;
    --tblr-danger-rgb: 255, 63, 34;
    --tblr-success: #4ade80;
    --tblr-success-rgb: 74, 222, 128;
    --tblr-warning: #f5c542;
    --tblr-warning-rgb: 245, 197, 66;
}
/* The sidebar is black too, with a thin divider instead of a lighter panel. */
.navbar-vertical { --tblr-navbar-bg: #000; border-right: 1px solid #262626; }
.navbar-vertical .navbar-brand .brand-link { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.navbar-vertical .navbar-brand .brand-mark { flex: none; height: 36px; width: 36px; object-fit: contain; }
/* No logo set: the school's first letter in a badge, so the collapsed menu still has a mark. */
.navbar-vertical .navbar-brand .brand-initial { display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: #0ea5e0; color: #fff; font-weight: 700; font-size: 1.25rem; }
.navbar-vertical .navbar-brand .brand-name { line-height: 1.15; overflow-wrap: anywhere; }

/* Payment status dots (same as the old theme) */
.dot { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 50%; margin-right: 0.3em; }
.dot-green { background: #3ecf6e; }
.dot-yellow { background: #f5c542; }
.dot-red { background: #ff3f22; }

/* Native <dialog> pop-up (Register payment) dressed like a Tabler card */
dialog.pop {
    background: var(--tblr-bg-surface);
    color: var(--tblr-body-color);
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius-lg, 8px);
    padding: 1.5rem;
    width: min(460px, 92vw);
}
dialog.pop::backdrop { background: rgba(0, 0, 0, 0.75); }

.form-control, .form-select { background-color: #0c0c0c; border-color: #262626; }
.form-control:focus, .form-select:focus { background-color: #0c0c0c; }

/* ------------------------------------------------------------------------------------------
   Compatibility layer: pages written as plain HTML (bare <table>, <input>, <button>, <h1>...)
   get the Tabler look automatically, so a page doesn't need converting to look right.
   Pages that use Tabler classes (.table, .btn, .form-control...) are unaffected.
   ------------------------------------------------------------------------------------------ */
.page-header:has(.page-title:empty) { display: none; }
/* The title keeps some room: on a phone the buttons next to it wrap onto their own line instead
   of covering it (they used to overlap "Weekly Timetable"). */
.page-header .row > .col:has(> .page-title) { min-width: 10rem; }
/* Tabler's title is a flex row, which drops the space between "Tuition charges" and the
   "— September 2026" span after it (UX review E7): the gap puts it back. */
.page-title { flex-wrap: wrap; column-gap: 0.4rem; }

:is(.page-body, .page-center) h1 { font-size: 1.5rem; font-weight: 600; margin: 0 0 1rem; }
:is(.page-body, .page-center) h2 { font-size: 1.1rem; font-weight: 600; margin: 2rem 0 0.75rem; }
:is(.page-body, .page-center) h3 { font-size: 1rem; font-weight: 600; }
:is(.page-body, .page-center) hr { border-color: var(--tblr-border-color); opacity: 1; }
:is(.page-body, .page-center) small, :is(.page-body, .page-center) .muted { color: var(--tblr-secondary-color, #8c8c8c); }
:is(.page-body, .page-center) em { color: var(--tblr-secondary-color, #8c8c8c); }

/* Tables: a bordered, rounded block with hairlines between rows */
:is(.page-body, .page-center) table:not(.table) {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--tblr-border-color);
    border-radius: 8px;
    background: var(--tblr-bg-surface);
    margin-bottom: 1rem;
    overflow: hidden;
}
:is(.page-body, .page-center) table:not(.table) th,
:is(.page-body, .page-center) table:not(.table) td {
    padding: 0.6rem 0.9rem;
    border: 0;
    border-bottom: 1px solid var(--tblr-border-color);
    vertical-align: top;
    font-size: 0.875rem;
}
:is(.page-body, .page-center) table:not(.table) tr:last-child > td,
:is(.page-body, .page-center) table:not(.table) tr:last-child > th { border-bottom: 0; }
:is(.page-body, .page-center) table:not(.table) th {
    background: var(--tblr-bg-surface-secondary);
    color: var(--tblr-secondary-color, #8c8c8c);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}
:is(.page-body, .page-center) table:not(.table) th a { color: inherit; }
:is(.page-body, .page-center) table:not(.table) tbody tr:hover > td,
:is(.page-body, .page-center) table:not(.table) > tr:hover > td { background: #101010; }
:is(.page-body, .page-center) table:not(.table) td + td, :is(.page-body, .page-center) table:not(.table) th + th { border-left: 1px solid #1a1a1a; }
tr.inactive, td.inactive { color: #5c5c5c; }
tr.inactive a { color: #4a7c93; }

/* Forms */
:is(.page-body, .page-center) form p { margin: 0 0 0.9rem; }
:is(.page-body, .page-center) label { display: block; font-weight: 500; font-size: 0.875rem; margin-bottom: 0.3rem; }
:is(.page-body, .page-center) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="hidden"]):not(.form-control),
:is(.page-body, .page-center) select:not(.form-select),
:is(.page-body, .page-center) textarea:not(.form-control) {
    background: #0c0c0c;
    color: var(--tblr-body-color);
    border: 1px solid var(--tblr-border-color);
    border-radius: 6px;
    padding: 0.4rem 0.7rem;
    font: inherit;
    font-size: 0.9rem;
    max-width: 100%;
}
:is(.page-body, .page-center) input:focus, :is(.page-body, .page-center) select:focus, :is(.page-body, .page-center) textarea:focus {
    outline: none;
    border-color: var(--tblr-primary);
    box-shadow: 0 0 0 0.2rem rgba(14, 165, 224, 0.2);
}
:is(.page-body, .page-center) input[type="checkbox"], :is(.page-body, .page-center) input[type="radio"] { accent-color: var(--tblr-primary); }
:is(.page-body, .page-center) textarea { min-width: min(30rem, 100%); }
:is(.page-body, .page-center) input.is-invalid, .field-error, .errors { color: var(--tblr-danger); }

/* Buttons */
:is(.page-body, .page-center) button:not(.btn):not(.btn-close), :is(.page-body, .page-center) input[type="submit"]:not(.btn),
:is(.page-body, .page-center) a.button {
    display: inline-flex;
    align-items: center;
    background: #111;
    color: var(--tblr-body-color);
    border: 1px solid #2f2f2f;
    border-radius: 6px;
    padding: 0.4rem 0.9rem;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
}
:is(.page-body, .page-center) button:not(.btn):hover, :is(.page-body, .page-center) input[type="submit"]:not(.btn):hover {
    border-color: var(--tblr-primary);
    color: var(--tblr-primary);
}
/* The main action of a form that has fields is the blue button; one-click forms (archive, delete,
   deactivate...) and small inline buttons stay neutral. */
:is(.page-body, .page-center) form:not([style*="inline"]):has(:is(input, select, textarea):not([type="hidden"])) > p:last-of-type > button[type="submit"]:first-child,
:is(.page-body, .page-center) form:not([style*="inline"]):has(:is(input, select, textarea):not([type="hidden"])) > button[type="submit"]:last-of-type,
:is(.page-body, .page-center) form:not([style*="inline"]):has(:is(input, select, textarea):not([type="hidden"])) > p > button[type="submit"]:only-of-type {
    background: var(--tblr-primary);
    border-color: var(--tblr-primary);
    color: #fff;
}
:is(.page-body, .page-center) label + br { display: none; }

/* Old-style flash / notes / tabs / pager */
.flash { padding: 0.7rem 1rem; margin-bottom: 1rem; border-radius: 6px; border: 1px solid transparent; }
.flash.error { background: rgba(255, 63, 34, 0.1); color: #ff8a75; border-color: rgba(255, 63, 34, 0.5); }
.flash.success { background: rgba(74, 222, 128, 0.1); color: #4ade80; border-color: rgba(74, 222, 128, 0.4); }
.note { border: 1px solid var(--tblr-border-color); border-radius: 8px; background: var(--tblr-bg-surface); padding: 0.7rem 1rem; margin-bottom: 0.75rem; }
.pre { white-space: pre-wrap; }
.tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--tblr-border-color); margin-bottom: 1.25rem; }
.tabs a { color: var(--tblr-secondary-color, #8c8c8c); padding: 0.5rem 0; margin-bottom: -1px; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--tblr-body-color); text-decoration: none; }
.tabs a.active { color: var(--tblr-body-color); font-weight: 600; border-bottom-color: var(--tblr-primary); }
.pager { color: var(--tblr-secondary-color, #8c8c8c); display: flex; gap: 1rem; align-items: center; }

/* Old dashboard-style cards (.cards > .card with label/value/note) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.card > .card-label { color: var(--tblr-secondary-color, #8c8c8c); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.card > .card-value { font-size: 1.9rem; font-weight: 600; margin: 0.3rem 0; }
.card > .card-note { color: var(--tblr-secondary-color, #8c8c8c); font-size: 0.8rem; }
.cards > .card, .alert-card { padding: 1rem 1.25rem; }
.alert-card { display: block; width: 100%; margin-bottom: 1rem; }
.alert-card table { margin: 0.75rem 0; }
.card-red { border-color: rgba(255, 63, 34, 0.6); }
.card-red > .card-value { color: var(--tblr-danger); }

/* Timetable blocks */
.slot-block { background: rgba(14, 165, 224, 0.12); border-left: 3px solid var(--tblr-primary); border-radius: 4px; padding: 4px 8px; margin-bottom: 6px; font-size: 0.8rem; }
.slot-block a { display: block; font-weight: 600; color: var(--tblr-body-color); }
.slot-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.4rem; }

/* Pop-ups written with the old class name */
dialog.modal { position: fixed; display: none; }
dialog.modal[open] { display: block; }
dialog.modal, dialog.pop {
    background: var(--tblr-bg-surface);
    color: var(--tblr-body-color);
    border: 1px solid var(--tblr-border-color);
    border-radius: 10px;
    padding: 1.5rem;
    width: min(520px, 92vw);
    max-width: none;
    height: fit-content;   /* with inset: 0, "auto" would stretch the box to the whole screen height */
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    margin: auto;
    inset: 0;
}
dialog.modal::backdrop { background: rgba(0, 0, 0, 0.75); }
dialog.modal h2 { margin-top: 0; }

/* Row actions: centred, spaced, compact; delete-type buttons in red */
:is(.page-body, .page-center) table:not(.table) td { vertical-align: middle; }
:is(.page-body, .page-center) table:not(.table) td > a + a,
:is(.page-body, .page-center) table:not(.table) td > a + form,
:is(.page-body, .page-center) table:not(.table) td > form + a,
:is(.page-body, .page-center) table:not(.table) td > form + form,
:is(.page-body, .page-center) table:not(.table) td > button + a,
:is(.page-body, .page-center) table:not(.table) td > a + button { margin-left: 0.75rem; }
:is(.page-body, .page-center) table:not(.table) td button:not(.btn) { padding: 0.2rem 0.65rem; font-size: 0.8rem; }
:is(.page-body, .page-center) form[action*="delete"] button:not(.btn),
:is(.page-body, .page-center) form[action*="remove"] button:not(.btn),
:is(.page-body, .page-center) form[action*="purge"] button:not(.btn) {
    color: var(--tblr-danger);
    border-color: rgba(255, 63, 34, 0.45);
    background: transparent;
}
:is(.page-body, .page-center) form[action*="delete"] button:not(.btn):hover,
:is(.page-body, .page-center) form[action*="remove"] button:not(.btn):hover,
:is(.page-body, .page-center) form[action*="purge"] button:not(.btn):hover { background: rgba(255, 63, 34, 0.12); border-color: var(--tblr-danger); color: var(--tblr-danger); }
:is(.page-body, .page-center) form[style*="inline"] { display: inline-block; }
/* Filter bars: search box gets room */
:is(.page-body, .page-center) input[type="search"], :is(.page-body, .page-center) input[name="q"] { min-width: 18rem; }

/* Larger table text everywhere (Tabler tables and plain tables alike) */
.table { font-size: 1rem; }
.table > thead th { font-size: 0.78rem; }
.table > :not(caption) > * > * { padding-top: 0.8rem; padding-bottom: 0.8rem; }
:is(.page-body, .page-center) table:not(.table) th,
:is(.page-body, .page-center) table:not(.table) td { font-size: 1rem; }
:is(.page-body, .page-center) table:not(.table) th { font-size: 0.78rem; }
.table .btn-icon { width: 2.4rem; height: 2.4rem; }

/* ------------------------------------------------------------------------------------------
   Auto-hiding sidebar (desktop): a slim icon rail that opens over the page on hover / keyboard
   focus, so the content gets the full width. On phones Tabler's own collapse button is used.
   ------------------------------------------------------------------------------------------ */
@media (min-width: 992px) {
    :root, [data-bs-theme="dark"] { --tblr-sidebar-width: 4.5rem; }   /* the page only reserves the rail */
    .navbar-vertical.navbar-expand-lg {
        width: 4.5rem;
        overflow: hidden;
        transition: width 0.18s ease, box-shadow 0.18s ease;
    }
    .navbar-vertical.navbar-expand-lg:hover,
    .navbar-vertical.navbar-expand-lg:focus-within {
        width: 16rem;
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
    }
    /* collapsed: icons only */
    .navbar-vertical.navbar-expand-lg:not(:hover):not(:focus-within) .brand-name,
    .navbar-vertical.navbar-expand-lg:not(:hover):not(:focus-within) .nav-link-title,
    .navbar-vertical.navbar-expand-lg:not(:hover):not(:focus-within) .dropdown-menu,
    .navbar-vertical.navbar-expand-lg:not(:hover):not(:focus-within) .dropdown-toggle::after { display: none !important; }
    .navbar-vertical.navbar-expand-lg:not(:hover):not(:focus-within) .nav-link { justify-content: center; }
    .navbar-vertical.navbar-expand-lg:not(:hover):not(:focus-within) .nav-link-icon { margin: 0; }
    /* the rail's icons are the only thing it shows: 20 px, not Tabler's 14 (UX review D8) */
    .navbar-vertical.navbar-expand-lg .nav-link-icon, .navbar-vertical.navbar-expand-lg .nav-link-icon .ti { font-size: 1.25rem; width: 1.5rem; height: 1.5rem; }
    .navbar-vertical.navbar-expand-lg:not(:hover):not(:focus-within) .navbar-brand { justify-content: center; padding-inline: 0; }
    .navbar-vertical .navbar-collapse { overflow-x: hidden; }
    .navbar-vertical .navbar-brand { min-height: 3.75rem; }
    .navbar-vertical.navbar-expand-lg form.mt-auto { white-space: nowrap; }
}
/* Sidebar group colours (2026-09-22, Daniel: colour the menu buttons AND the pages listed
   inside each one -- Dashboard blue (the theme's existing accent), Academic green, Finance
   yellow, Setup purple. The colour class goes on the <li class="nav-item"> (see base.html's
   `group` macro and the Dashboard <li>), not just the toggle link, so both the button and its
   dropdown-item pages read the same --nav-btn-color/--nav-btn-bg via ordinary CSS inheritance;
   the "section you are in" active/open rules just below read those same variables (falling back
   to the old hardcoded blue for any nav-item that somehow has no colour class) so the highlight
   is per-group too. */
.nav-item.nav-color-academic { --nav-btn-color: #2fb344; --nav-btn-bg: rgba(47, 179, 68, 0.16); }
.nav-item.nav-color-finance { --nav-btn-color: #f5c542; --nav-btn-bg: rgba(245, 197, 66, 0.16); }
/* Setup's purple lightened from #ae3ec9, which was just under the readable contrast on black (D8). */
.nav-item.nav-color-setup { --nav-btn-color: #c872dc; --nav-btn-bg: rgba(174, 62, 201, 0.16); }
.nav-item.nav-color-dashboard { --nav-btn-color: var(--tblr-primary); --nav-btn-bg: rgba(14, 165, 224, 0.16); }
.nav-item[class*="nav-color-"] > .nav-link,
.nav-item[class*="nav-color-"] > .nav-link .nav-link-icon,
.nav-item[class*="nav-color-"] .dropdown-item:not(.active) {
    color: var(--nav-btn-color);
}

/* the section you are in stays lit, also when the rail is collapsed */
.navbar-vertical .nav-item.dropdown:has(.dropdown-item.active) > .nav-link,
.navbar-vertical .nav-item.active > .nav-link { color: #fff; background: var(--nav-btn-bg, rgba(14, 165, 224, 0.16)); border-radius: 6px; }
.navbar-vertical .nav-item.dropdown:has(.dropdown-item.active) > .nav-link .nav-link-icon,
.navbar-vertical .nav-item.active > .nav-link .nav-link-icon { color: var(--nav-btn-color, var(--tblr-primary)); }
.navbar-vertical .dropdown-item.active { color: #fff; background: var(--nav-btn-bg, rgba(14, 165, 224, 0.16)); }

/* Weekly timetable */
/* Weekly Timetable (timetable/week_view.html). Computer: .tt-week, a grid with one row per hour
   (label + one cell per day). Phone: .tt-phone, one day at a time; the day panels are switched with
   the `hidden` attribute, so they must not get a display rule. --tt-color is the teacher's colour. */
/* overflow: clip, not hidden, which would stop the sticky day headers sticking (UX review 2026-09-29). */
.tt-week { display: grid; border: 1px solid var(--tblr-border-color); border-radius: 8px; overflow: clip; background: var(--tblr-bg-surface); }
.tt-week > div { border-top: 1px solid var(--tblr-border-color); border-left: 1px solid var(--tblr-border-color); min-width: 0; }
.tt-corner, .tt-head { border-top: 0 !important; }
.tt-corner, .tt-hour { border-left: 0 !important; }
.tt-head { padding: 0.6rem 0.75rem; position: sticky; top: 0; z-index: 1; background: var(--tblr-bg-surface); }
.tt-hour { padding: 0.5rem 0.4rem; font-weight: 600; font-size: 0.8rem; color: var(--tblr-secondary); text-align: right; }
.tt-cell { padding: 0.3rem; }
.tt-today.tt-head { background: #0b1d26; }
.tt-today.tt-cell { background: rgba(14, 165, 224, 0.05); }
/* A day the school is closed (Holidays and breaks): the whole day yellow, its classes faded. */
.tt-closed.tt-head, .tt-closed.tt-head.tt-today { background: #2b2410; box-shadow: inset 0 3px 0 var(--tblr-yellow); }
.tt-closed.tt-cell, .tt-closed-all.tt-week .tt-cell, .tt-closed-all.tt-week .tt-head { background: rgba(245, 159, 0, 0.12); }
.tt-closed .tt-slot, .tt-closed-all .tt-slot { opacity: 0.55; }
.tt-closed-note { color: var(--tblr-yellow); font-weight: 600; }
.tt-daytabs .btn.tt-closed { border-color: var(--tblr-yellow); }
.tt-slot {
    display: block;
    margin-bottom: 0.3rem;
    padding: 0.2rem 0.5rem;
    background: color-mix(in srgb, var(--tt-color) 10%, #0d0d0d);
    border: 1px solid color-mix(in srgb, var(--tt-color) 25%, transparent);
    border-left: 4px solid var(--tt-color, var(--tblr-primary));
    border-radius: 6px;
    color: var(--tblr-body-color);
    font-size: 0.8rem;
    line-height: 1.3;
    text-decoration: none;
    transition: background 0.12s, border-color 0.12s;
}
.tt-slot:last-child { margin-bottom: 0; }
.tt-slot:hover { background: color-mix(in srgb, var(--tt-color) 20%, #0d0d0d); border-color: var(--tt-color); text-decoration: none; }
.tt-time { display: flex; align-items: center; gap: 0; font-weight: 700; color: var(--tt-color); white-space: nowrap; }
.tt-count { margin-left: auto; font-weight: 500; color: var(--tblr-secondary); }
/* The teacher's initials next to the count: the colour alone isn't enough for colour-blind staff. */
.tt-initials { margin-left: auto; margin-right: 0.4rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em; color: var(--tt-color); border: 1px solid color-mix(in srgb, var(--tt-color) 45%, transparent); border-radius: 4px; padding: 0 0.25rem; }
.tt-initials + .tt-count { margin-left: 0; }
.tt-count .ti { margin-right: 0.15rem; }
.tt-count-empty { color: var(--tblr-warning); }
.tt-line { display: flex; align-items: baseline; gap: 0.4rem; }
.tt-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-room { flex: none; max-width: 55%; color: var(--tblr-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-room .ti { margin-right: 0.15rem; }
.tt-meta { color: var(--tblr-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-meta .ti { margin-right: 0.2rem; }
.tt-legend { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tt-legend-item {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.8rem;
    border: 1px solid var(--tblr-border-color); color: var(--tblr-body-color); text-decoration: none;
}
.tt-legend-item::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--tt-color); }
.tt-legend-item:hover { border-color: var(--tt-color); text-decoration: none; }
.tt-legend-item.active { border-color: var(--tt-color); background: color-mix(in srgb, var(--tt-color) 18%, transparent); }
/* Today view: teacher columns, finished classes faded, the running ones marked. */
.tt-teacher-head { border-top: 3px solid var(--tt-color) !important; }
.tt-slot.tt-past { opacity: 0.58; }  /* 0.4 made dark colours unreadable (UX review T6) */
.tt-slot.tt-now { box-shadow: 0 0 0 2px var(--tt-color); }
.tt-now-badge { font-size: 0.65rem; padding: 0.1rem 0.35rem; }
.tt-hour-now { color: var(--tblr-green); }
.tt-phone { display: none; }
.tt-daytabs { display: flex; gap: 0.3rem; overflow-x: auto; }
.tt-daytab-count { margin-left: 0.3rem; opacity: 0.7; font-size: 0.75em; }
.tt-phone .tt-slot { font-size: 0.9rem; padding: 0.55rem 0.7rem; margin-bottom: 0.5rem; }
@media (max-width: 991.98px) {
    .tt-week { display: none; }
    .tt-phone { display: block; }
}

/* Lesson form (app/templates/lessons/lesson_form.html): like Bootstrap's .d-flex, but WITHOUT
   !important -- this one gets toggled to "none" by the "No makeup needed" checkbox's inline
   script, and .d-flex's !important would silently win over that (same bug as the sidebar
   editor's d-none, see the CLAUDE.md note on it). */
.makeup-fields { display: flex; }

/* Sidebar "Edit menu" mode (app/static/nav-editor.js): drag a row to reorder it, click the eye
   to hide it. Hidden until toggled on; hides the normal nav list and the toggle button while active.
   Explicit colours/background on every piece (not just inherited from the black sidebar) --
   plain <li>/<span> here don't automatically pick up the same text colour Tabler's own
   .nav-link/.dropdown-item components get, and go unreadably dark otherwise. */
.nav-editor { display: none; }
#sidebar-menu.nav-editing .nav-view,
#sidebar-menu.nav-editing .js-nav-editor-toggle { display: none; }
#sidebar-menu.nav-editing .nav-editor { display: block; }
.nav-editor-row {
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.35rem;
    border-radius: 6px;
    border: 1px solid var(--tblr-border-color);
    background: var(--tblr-bg-surface-secondary);
    color: var(--tblr-body-color, #fff);
}
.nav-editor-item { background: var(--tblr-bg-surface-tertiary); }
.nav-editor-row span { color: inherit; }
.nav-editor-handle { cursor: grab; color: var(--tblr-secondary-color, #8c8c8c); }
.nav-editor-hide-btn { color: var(--tblr-body-color, #fff); }
.nav-editor-row.nav-editor-dragging { opacity: 0.35; }
.nav-editor-row-hidden { opacity: 0.45; }
.nav-editor-row-hidden .nav-editor-hide-btn i { color: var(--tblr-danger); }

/* ---------------------------------------------------------------- pickers (_macros.html `picker`)
   Rows are shown/hidden with the `hidden` attribute by static/app.js, so they must NOT use a
   Bootstrap d-* class (those are !important and would beat [hidden]). */
.picker-list { max-height: 20rem; overflow-y: auto; }
/* ".picker .picker-item" (not just ".picker-item") so it beats the compatibility rule for plain
   labels above, ":is(.page-body, .page-center) label". */
.picker .picker-item {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .85rem; margin: 0; cursor: pointer;
    font-weight: normal; font-size: inherit;
    border-bottom: 1px solid var(--tblr-border-color);
}
.picker .picker-item:last-of-type { border-bottom: 0; }
.picker .picker-item:hover { background: rgba(var(--tblr-primary-rgb), .08); }
.picker .picker-item[hidden] { display: none; }
.picker-item-checked { background: rgba(var(--tblr-primary-rgb), .14); }
.picker-item .form-check-input { width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
.picker-label { flex-grow: 1; }
.picker-sub { color: var(--tblr-secondary); font-size: .8rem; white-space: nowrap; }

/* ---------------------------------------------------------------- tables a few rows tall
   `.scroll-rows` (app.js sets the exact height from data-rows; this max-height is the fallback):
   the table scrolls inside and its headings stay on top. */
.scroll-rows { max-height: 21rem; overflow-y: auto; }
.scroll-rows thead th { position: sticky; top: 0; z-index: 1; background: var(--tblr-bg-surface); }

/* A dropdown that a script has set and locked (the bank-import review's category once "Pays
   tuition of" picks a charge: it's Tuition). `disabled` would leave it out of the form. */
.select-locked { pointer-events: none; background-color: var(--tblr-bg-surface-secondary); opacity: .75; }

/* ---------------------------------------------------------------- messages after an action */
.alert .alert-icon { font-size: 1.25rem; line-height: 1.2; }
.flash-auto { transition: opacity .4s ease; }
.flash-hiding { opacity: 0; }

/* ---------------------------------------------------------------- student page */
.datagrid-1col { grid-template-columns: 1fr; }

/* Targets of "#anchor" links (back to the list after an action, the student in a lesson):
   stop below the sticky top bar, and the student row pointed at is highlighted. */
.scroll-anchor { scroll-margin-top: 5rem; }
.list-group-item.scroll-anchor:target { background: rgba(14, 165, 224, 0.12); box-shadow: inset 3px 0 0 var(--tblr-primary); }

/* The phone menu button: about a thumb's size (44 px) instead of 32 (UX review D8). */
.navbar-toggler { min-width: 2.75rem; min-height: 2.75rem; }

/* Syllabus: a point's materials listed under it (UX review Y3). */
.syllabus-materials { padding-left: 1.25rem; columns: 2 18rem; column-gap: 2rem; }
.syllabus-materials li { break-inside: avoid; padding: 0.1rem 0; }

/* A row that needs a look (Teacher hours: a lesson logged twice, a class without a weekly time). */
.row-attention > td { background: rgba(245, 159, 0, 0.10); }

/* F7: the tuition charge a Financeiro "undo on Tuition charges" link points at. */
tr.scroll-anchor:target > td { background: rgba(14, 165, 224, 0.12); }

/* S9: Pending makeups filters: long class names must not push the page wider than a phone. */
.makeup-filter { max-width: 100%; }

/* S10: Missing info's badge-colour legend wraps as a line of text on a phone. */
.missing-legend .badge { vertical-align: baseline; }

/* D2: the current page in the menu (UX review D2). The pages inside a group stay plain on every
   screen (Daniel, 2026-09-22: "plain items inside groups"; on phones the group-colour rule above
   used to win and colour them green/yellow). The page you are on is clearly marked in its group's
   colour: a coloured bar on the left, the group's tint behind it, white bold text. The #sidebar-menu
   id beats Tabler's `.navbar-expand-lg .navbar-collapse .dropdown-menu .dropdown-item.active`, which
   gave it only a 6% white, the same as hover. */
#sidebar-menu .dropdown-menu .dropdown-item { color: rgba(255, 255, 255, 0.7); }
#sidebar-menu .dropdown-menu .dropdown-item:hover,
#sidebar-menu .dropdown-menu .dropdown-item:focus-visible { color: #fff; }
#sidebar-menu .dropdown-menu .dropdown-item.active {
    color: #fff; font-weight: 600; border-radius: 4px;
    background: var(--nav-btn-bg, rgba(14, 165, 224, 0.16));
    box-shadow: inset 3px 0 0 var(--nav-btn-color, var(--tblr-primary));
}

/* D3: Edit menu. A one-line hint above the list, and Save/Cancel stuck to the bottom of the
   sidebar (computer) or the screen (phone) while the long list scrolls, on a black strip so rows
   passing under it don't show through. The error line shows when every page would be hidden. */
.nav-editor-hint { font-size: 0.8rem; line-height: 1.35; color: var(--tblr-secondary-color, #8c8c8c); margin: 0 0 0.6rem; white-space: normal; }
.nav-editor-actions { position: sticky; bottom: 0; z-index: 2; background: #000; padding-top: 0.6rem; padding-bottom: 0.75rem; border-top: 1px solid #262626; }
.nav-editor-error { font-size: 0.8rem; line-height: 1.35; color: var(--tblr-danger); margin: 0 0 0.5rem; white-space: normal; }
.nav-editor-error[hidden] { display: none; }

/* S7: row buttons on one line; on a phone they stack in a narrow column instead of running off the edge (Students list). */
.row-actions { white-space: nowrap; }
@media (max-width: 575.98px) { .row-actions { white-space: normal; width: 1%; } }

/* S10: a jump to a form field (#cpf from Missing info, the "Not saved" links) leaves room above it
   for its label, instead of putting the box at the very top edge under the top bar. */
.form-control, .form-select, .form-check-input { scroll-margin-top: 30vh; }

/* S3 / C8 / U5: an unticked checkbox inside a yellow warning was a near-black square on dark yellow. */
.alert-warning .form-check-input:not(:checked) { border-color: var(--tblr-warning); background-color: transparent; }
