/* ActiveTrack portal theme: a modern take on the legacy ActiveTrak look
   (white header, orange tab menu with underline, light grey page, orange panels and footer). */

:root {
    --at-brand: #e6830c;
    --at-brand-dark: #a85d06;      /* text and links on white: meets WCAG AA contrast */
    --at-brand-tint: #fdf3e7;
    --at-green: #53991f;           /* legacy sign-in button */
    --at-page: #f8f8fa;
    --at-surface: #ffffff;
    --at-border: #e6e6ea;
    --at-text: #4a4a4f;
    --at-muted: #6f6f75;
    --at-heading: #26262a;
    --at-radius: .5rem;

    --bs-body-font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --bs-body-color: var(--at-text);
    --bs-body-bg: var(--at-page);
    --bs-link-color-rgb: 168, 93, 6;
    --bs-link-hover-color-rgb: 130, 72, 5;
    --bs-link-color: rgb(168, 93, 6);        /* Bootstrap's .btn-link reads these, not the -rgb pair */
    --bs-link-hover-color: rgb(130, 72, 5);
    --bs-border-color: var(--at-border);
    --bs-emphasis-color: var(--at-heading);
}

html, body { height: 100%; }

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 { color: var(--at-heading); font-weight: 600; }
h1:focus { outline: none; }

/* Wider than Bootstrap's containers: the portal is mostly data tables. */
.at-container {
    width: 100%;
    max-width: 1480px;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(.75rem, 3vw, 2rem);
    padding-right: clamp(.75rem, 3vw, 2rem);
}

.at-header .navbar > .at-container { display: flex; flex-wrap: inherit; align-items: center; justify-content: space-between; }

/* ---------- Header and tab menu ---------- */

.at-header {
    background: var(--at-surface);
    border-bottom: 1px solid var(--at-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.at-header .navbar { padding-top: .5rem; padding-bottom: .5rem; }
.at-logo { height: 28px; width: auto; display: block; }

.at-tabs .nav-link {
    color: var(--at-brand-dark);
    font-weight: 700;
    padding: .65rem .9rem;
    border-left: 4px solid transparent;
    white-space: nowrap;
}

.at-tabs .nav-link:hover,
.at-tabs .nav-link:focus-visible,
.at-tabs .nav-link.active,
.at-tabs .show > .nav-link {
    color: #000;
    border-left-color: var(--at-brand);
}

.at-tabs .nav-link .bi { margin-right: .4rem; }

.at-header .nav-link:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(230, 131, 12, .55);
    border-radius: .25rem;
}

.at-pending,
.at-tabs .nav-link.at-pending,
.dropdown-item.at-pending {
    color: #9d9da3;
    cursor: default;
    pointer-events: none;
}

.at-soon {
    font-size: .65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6f6f75;
    background: #efeff2;
    border-radius: 1rem;
    padding: .1rem .45rem;
    margin-left: .35rem;
    vertical-align: middle;
}

.at-header .dropdown-menu {
    border-color: var(--at-border);
    border-radius: var(--at-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    padding: .35rem;
}

.at-header .dropdown-item { border-radius: .35rem; padding: .5rem .75rem; }
.at-header .dropdown-item .bi { color: var(--at-brand); margin-right: .5rem; }
.at-header .dropdown-item.at-pending .bi { color: #c4c4c9; }
.at-header .dropdown-item:active { background: var(--at-brand); color: #fff; }
.at-header .dropdown-item:active .bi { color: #fff; }

.at-user-toggle { color: var(--at-heading); font-weight: 600; }
.at-user-toggle .bi { color: var(--at-brand); font-size: 1.35rem; vertical-align: -.2rem; margin-right: .35rem; }
.at-level {
    font-size: .7rem;
    font-weight: 600;
    color: var(--at-brand-dark);
    background: var(--at-brand-tint);
    border-radius: 1rem;
    padding: .15rem .5rem;
    margin-left: .35rem;
}

/* Desktop: one bar, tabs underlined like the legacy menu */
@media (min-width: 1200px) {
    .at-header .navbar { padding-top: 0; padding-bottom: 0; min-height: 64px; }
    .at-header .navbar-collapse { align-self: stretch; }
    .at-tabs { align-self: stretch; }
    .at-tabs .nav-item { display: flex; }
    .at-tabs .nav-link {
        display: flex;
        align-items: center;
        padding: 0 .7rem;
        border-left: 0;
        border-top: 4px solid transparent;
        border-bottom: 4px solid transparent;
    }
    .at-tabs .nav-link:hover,
    .at-tabs .nav-link:focus-visible,
    .at-tabs .nav-link.active,
    .at-tabs .show > .nav-link { border-bottom-color: var(--at-brand); }
    .at-tabs .nav-link.at-pending { border-bottom-color: transparent; }
    .at-tabs .nav-link .at-soon { display: none; } /* greyed text and tooltip are enough in the bar */
    .at-user { align-self: center; }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    .at-user .at-level { display: none; }
}

/* Phones and tablets: the menu collapses into a full-width list */
@media (max-width: 1199.98px) {
    .at-header .navbar-collapse { border-top: 1px solid var(--at-border); margin-top: .5rem; padding: .5rem 0; }
    .at-tabs .dropdown-menu { border: 0; box-shadow: none; padding: 0 0 0 1.25rem; }
    .at-user { border-top: 1px solid var(--at-border); margin-top: .5rem; padding-top: .5rem; }
}

.navbar-toggler { border-color: var(--at-border); }
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(230, 131, 12, .35); }

/* ---------- Page ---------- */

.at-main { flex: 1 0 auto; padding: 1.5rem 0 3rem; }

.at-page-header {
    display: flex;
    align-items: center;
    gap: .9rem;
    flex-wrap: nowrap;
    background: var(--at-brand);
    color: #fff;
    border-radius: var(--at-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.at-page-header > .bi { font-size: 1.75rem; line-height: 1; }
.at-page-header h1 { color: #fff; font-size: 1.35rem; margin: 0; }
.at-page-header p { margin: .15rem 0 0; font-size: .9rem; }
.at-page-header .at-actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; flex-shrink: 0; }

@media (max-width: 575.98px) {
    .at-page-header { flex-wrap: wrap; }
    .at-page-header .at-actions { margin-left: 0; width: 100%; }
}

.at-card {
    background: var(--at-surface);
    border: 1px solid var(--at-border);
    border-radius: var(--at-radius);
    overflow: hidden;
}

.at-note { color: var(--at-muted); font-size: .875rem; margin: .75rem .25rem 0; }

/* Rounded orange buttons, as on the legacy site */
.btn-brand, .btn-brand-outline, .btn-on-brand {
    border-radius: 2rem;
    font-weight: 600;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
}

.btn-brand { background: var(--at-brand); border-color: var(--at-brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus-visible { background: var(--at-brand-dark); border-color: var(--at-brand-dark); color: #fff; }
.btn-brand-outline { background: #fff; border-color: var(--at-brand); color: var(--at-brand-dark); }
.btn-brand-outline:hover, .btn-brand-outline:focus-visible { background: var(--at-brand); color: #fff; }
.btn-on-brand { background: #fff; border-color: #fff; color: var(--at-brand-dark); }
.btn-on-brand:hover, .btn-on-brand:focus-visible { background: var(--at-brand-tint); color: var(--at-brand-dark); }

.form-control, .form-select { background-color: var(--at-surface); }

.btn:focus-visible, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 .2rem rgba(230, 131, 12, .35);
    border-color: var(--at-brand);
}

/* ---------- Home tiles ---------- */

.at-hello { text-align: center; margin: 1rem 0 2rem; }
.at-hello h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 300; margin-bottom: .25rem; }
.at-hello p { color: var(--at-muted); font-size: 1.1rem; margin: 0; }

.at-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 760px;
    margin: 0 auto;
}

@media (min-width: 576px) { .at-tiles { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; } }

.at-tile {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: var(--at-surface);
    border: 1px solid var(--at-border);
    border-radius: var(--at-radius);
    color: var(--at-brand-dark);
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    padding: .75rem;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}

.at-tile .bi { font-size: clamp(2rem, 7vw, 2.75rem); color: var(--at-brand); transition: color .2s ease; }

a.at-tile:hover, a.at-tile:focus-visible {
    background: var(--at-brand);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
    outline: none;
}

a.at-tile:hover .bi, a.at-tile:focus-visible .bi { color: #fff; }

.at-tile.at-pending { background: #f1f1f3; color: #85858b; }
.at-tile.at-pending .bi { color: #b8b8bd; }
.at-tile small { font-weight: 400; font-size: .75rem; }

/* ---------- Tables that become cards on phones ---------- */

.at-table { margin: 0; --bs-table-bg: var(--at-surface); }

.at-table thead th {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--at-muted);
    font-weight: 600;
    white-space: nowrap;
    background: #fafafb;
}

.at-table td, .at-table th { padding: .65rem .6rem; vertical-align: middle; white-space: nowrap; }
.at-table td.at-cell-wrap { white-space: normal; min-width: 11rem; }
.at-table td.at-cell-badges { white-space: normal; min-width: 8rem; }
.at-table td.at-cell-badges .badge { margin: .1rem 0; }
.at-marker { width: 20px; height: 20px; margin-right: .35rem; }
.at-row-menu { border-color: var(--at-border); border-radius: var(--at-radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .1); padding: .35rem; }
.at-row-menu .dropdown-item { border-radius: .35rem; padding: .45rem .75rem; }
.at-row-menu .dropdown-item .bi { color: var(--at-brand); margin-right: .5rem; }
.at-map { height: 260px; border-radius: var(--at-radius); border: 1px solid var(--at-border); background: #eef0f2; }
.at-map-tall { height: 360px; }
@media (min-width: 992px) { .at-map-tall { height: 440px; } }
.at-reminder.is-on { border-color: var(--at-brand); box-shadow: inset 3px 0 0 var(--at-brand); }
.at-row-link { color: var(--at-heading); text-decoration: none; }
.at-row-link .bi { color: var(--at-brand); opacity: .6; }
.at-row-link:hover strong { color: var(--at-brand-dark); text-decoration: underline; }
.at-row-link:hover .bi { opacity: 1; }

/* Below desktop width, each row becomes a card: one per row on phones, two per row on tablets. */
@media (max-width: 991.98px) {
    .at-table-stack thead { display: none; }
    .at-table-stack, .at-table-stack tbody, .at-table-stack tr, .at-table-stack td { display: block; width: 100%; }
    .at-table-stack tbody { margin-bottom: -1px; } /* hide the last card's bottom border under the frame */
    .at-table-stack tr { padding: .85rem 1rem; border-bottom: 1px solid var(--at-border); }
    .at-table-stack td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .2rem 0; border: 0; text-align: right !important; white-space: normal; min-width: 0 !important; }
    .at-table-stack td::before { content: attr(data-label); font-weight: 600; color: var(--at-muted); text-align: left; flex-shrink: 0; }
    .at-table-stack td.at-cell-title { font-size: 1.05rem; padding-bottom: .4rem; justify-content: flex-start; text-align: left !important; }
    .at-table-stack td.at-cell-title::before { content: none; }
    .at-table-stack .at-cell { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .25rem; }
    .at-table-stack td:empty { display: none; }
}

@media (min-width: 640px) and (max-width: 991.98px) {
    .at-table-stack tbody { display: grid; grid-template-columns: 1fr 1fr; }
    .at-table-stack tr:nth-child(odd) { border-right: 1px solid var(--at-border); }
}

/* ---------- Forms ---------- */

.form-label { font-weight: 600; color: var(--at-heading); }
.form-check-input:checked { background-color: var(--at-brand); border-color: var(--at-brand); }

.at-marker-picker { display: flex; flex-wrap: wrap; gap: .5rem; }

.at-marker-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    min-width: 4.6rem;
    padding: .5rem .4rem .45rem;
    border: 1px solid var(--at-border);
    border-radius: var(--at-radius);
    background: var(--at-surface);
    font-size: .8rem;
    cursor: pointer;
}

.at-marker-option input { position: absolute; opacity: 0; pointer-events: none; }
.at-marker-option img { width: 28px; height: 28px; }
.at-marker-option .bi { font-size: 1.4rem; line-height: 28px; color: #a3a3a8; }
.at-marker-option:hover { border-color: var(--at-brand); }
.at-marker-option:has(input:checked) { border-color: var(--at-brand); background: var(--at-brand-tint); box-shadow: inset 0 0 0 1px var(--at-brand); }
.at-marker-option:has(input:focus-visible) { box-shadow: 0 0 0 .2rem rgba(230, 131, 12, .35); }

/* ---------- Help ---------- */

.at-contact dt { font-weight: 600; color: var(--at-heading); margin-top: .75rem; }
.at-contact dt:first-child { margin-top: 0; }
.at-contact dt .bi { color: var(--at-brand); margin-right: .35rem; }
.at-contact dd { margin: .15rem 0 0 1.6rem; }

.at-tag-filter { display: flex; flex-wrap: wrap; gap: .4rem; }
.at-tag {
    background: var(--at-surface);
    border: 1px solid var(--at-border);
    color: var(--at-text);
    font-weight: 600;
    text-decoration: none;
    padding: .4em .8em;
}
.at-tag:hover, .at-tag.active { background: var(--at-brand); border-color: var(--at-brand); color: #fff; }

.at-article { max-width: 60rem; overflow-x: auto; }
.at-article img { max-width: 100%; height: auto; }
.at-article table { width: 100%; margin: 1rem 0; border-collapse: collapse; font-size: .9rem; }
.at-article th, .at-article td { border: 1px solid var(--at-border); padding: .4rem .6rem; vertical-align: top; }
.at-article th { background: #fafafb; }
.at-article h2, .at-article h3, .at-article h4 { font-size: 1.1rem; margin-top: 1.5rem; }

/* ---------- Tracking Centre ---------- */

.at-tracking {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.at-tracking-map { overflow: hidden; min-height: 55vh; order: -1; }
.at-live-map { width: 100%; height: 55vh; }

@media (min-width: 992px) {
    .at-tracking { grid-template-columns: 320px 1fr; height: calc(100vh - 64px - 3rem - 63px); min-height: 520px; }
    .at-tracking-map { order: 0; min-height: 0; }
    .at-live-map { height: 100%; }
    .at-tracking-list { min-height: 0; }
}

.at-tracking-list { display: flex; flex-direction: column; }
.at-tracking-list-head { padding: 1rem 1rem .75rem; border-bottom: 1px solid var(--at-border); }
.at-tracking-list-foot { display: flex; flex-wrap: wrap; gap: .25rem 1rem; padding: .6rem 1rem; border-top: 1px solid var(--at-border); font-size: .875rem; }
.at-tracking-list-foot a { white-space: nowrap; }
.at-tracking.is-offline [data-at-updated] { color: #b42318 !important; }

.at-vehicle-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; max-height: 50vh; }
@media (min-width: 992px) { .at-vehicle-list { max-height: none; } }

.at-vehicle { border-bottom: 1px solid var(--at-border); }
.at-vehicle-button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    border-left: 4px solid transparent;
    padding: .6rem 1rem .6rem calc(1rem - 4px);
    color: var(--at-text);
}
.at-vehicle-button:hover, .at-vehicle-button:focus-visible { background: var(--at-brand-tint); outline: none; }
.at-vehicle.is-followed .at-vehicle-button { border-left-color: var(--at-brand); background: var(--at-brand-tint); }
.at-vehicle-top { display: flex; align-items: center; gap: .5rem; }
.at-vehicle-top strong { color: var(--at-heading); }
.at-vehicle-ago { margin-left: auto; font-size: .75rem; color: var(--at-muted); }
.at-vehicle-line { display: block; font-size: .8rem; color: var(--at-muted); padding-left: 1.1rem; }
.at-vehicle-dot { width: .6rem; height: .6rem; border-radius: 50%; background: #9d9da3; flex-shrink: 0; }
.at-vehicle-moving .at-vehicle-dot { background: #2e9d4e; }
.at-vehicle-stopped .at-vehicle-dot { background: var(--at-brand); }
.at-vehicle-silent .at-vehicle-dot { background: #c4c4c9; }
.at-vehicle-silent strong { color: var(--at-muted) !important; }
.at-vehicle-empty { padding: 1rem; color: var(--at-muted); font-size: .9rem; }

/* ---------- History map ---------- */

.at-history { display: grid; gap: 1rem; }
.at-history-map { overflow: hidden; }
.at-history .at-live-map { height: 60vh; }
@media (min-width: 992px) {
    .at-history .at-live-map { height: 65vh; }
    .at-history-position { grid-template-columns: 2fr 1fr; align-items: start; }
}
.at-replay { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .75rem 1rem; }
.at-replay .form-range { flex: 1 1 10rem; min-width: 0; }
@media (max-width: 575.98px) { .at-replay [data-at-replay-time] { flex-basis: 100%; } }
.at-replay .btn { min-width: 6rem; }
.at-history-steps { max-height: 50vh; overflow-y: auto; }
.at-history-steps thead th { position: sticky; top: 0; z-index: 1; }
.at-route-swatch { display: inline-block; width: .9rem; height: .9rem; border-radius: 3px; vertical-align: middle; margin-right: .4rem; }
.at-detail-list { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.at-detail-list dt { font-weight: 600; color: var(--at-muted); }
.at-detail-list dd { margin: 0; }

/* ---------- Tracking wall and Quick List ---------- */

.at-wall { display: grid; gap: 1rem; }
.at-wall-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.at-wall-head input { flex: 1 1 14rem; max-width: 20rem; }
.at-wall-links { display: flex; gap: 1rem; margin-left: auto; font-size: .875rem; }
.at-wall-map { overflow: hidden; }
.at-wall .at-live-map { height: 60vh; }
@media (min-width: 992px) { .at-wall .at-live-map { height: 70vh; } }
.at-wall.is-offline [data-at-updated] { color: #b42318 !important; }
.at-wall-latest-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--at-border); }
.at-follow-link { padding: 0; border: 0; font-weight: 600; color: var(--at-brand-dark); text-decoration: none; vertical-align: baseline; }
.at-follow-link:hover, .at-follow-link:focus-visible { text-decoration: underline; }
.at-table tr.is-followed > * { --bs-table-bg-state: var(--at-brand-tint); }
.at-table tr.is-followed > :first-child { box-shadow: inset 4px 0 0 var(--at-brand), inset 0 0 0 9999px var(--at-brand-tint); } /* Bootstrap paints cell backgrounds with box-shadow */
[data-at-refresh].is-offline .at-refresh-status { color: #b42318 !important; }
[data-at-refresh].is-offline .at-refresh-status::after { content: " · can't reach the server, retrying"; }

.at-bubble { font-family: var(--bs-body-font-family); min-width: 220px; max-width: 280px; color: var(--at-text); }
.at-bubble-rows { display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem; margin: 0 0 .5rem; font-size: .85rem; }
.at-bubble-rows dt { font-weight: 600; color: var(--at-muted); }
.at-bubble-rows dd { margin: 0; }

/* ---------- Reports ---------- */

.at-report-list { display: grid; gap: .75rem; }
@media (min-width: 768px) { .at-report-list { grid-template-columns: 1fr 1fr; } }

.at-report {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .9rem 1rem;
    color: var(--at-text);
    text-decoration: none;
}

.at-report > .bi { font-size: 1.6rem; color: var(--at-brand); flex-shrink: 0; }
.at-report strong { display: block; color: var(--at-heading); }
.at-report small { display: block; color: var(--at-muted); }
.at-report .at-soon { margin-left: auto; flex-shrink: 0; }
a.at-report:hover, a.at-report:focus-visible { border-color: var(--at-brand); box-shadow: inset 3px 0 0 var(--at-brand); }
a.at-report:hover strong { color: var(--at-brand-dark); }
.at-report.at-pending { background: #f6f6f8; }
.at-report.at-pending > .bi { color: #b8b8bd; }
.at-report.at-pending strong { color: #85858b; }

.at-report-totals {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem 1.25rem;
    padding: 1rem;
}

@media (min-width: 768px) { .at-report-totals { grid-template-columns: repeat(4, 1fr); } }

.at-report-totals span { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--at-muted); }
.at-report-totals strong { font-size: 1.15rem; color: var(--at-heading); font-variant-numeric: tabular-nums; }
.at-report-totals-sm { padding: .75rem 1rem; border-bottom: 1px solid var(--at-border); background: #fafafb; }
.at-report-totals-sm strong { font-size: 1rem; }

.at-report-day > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--at-border);
    border-left: 3px solid var(--at-brand);
}

.at-report-day-totals {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    padding: .65rem 1rem;
    border-top: 1px solid var(--at-border);
    background: #fafafb;
    font-size: .875rem;
    color: var(--at-muted);
}

.at-report-day-totals strong { color: var(--at-heading); margin-left: .25rem; font-variant-numeric: tabular-nums; }
.at-report-table td { font-variant-numeric: tabular-nums; }
.at-report-table td.at-cell-wrap { min-width: 14rem; }
.at-report-ends td { background: var(--at-brand-tint); }
.at-saved-place { font-weight: 600; color: var(--at-heading); }
.at-saved-place .bi { color: var(--at-brand); }

/* Journey positions stay a table on phones, without the GPS and map columns (the journey's average GPS is above it). */
@media (max-width: 575.98px) {
    .at-report-points th:nth-child(n+4), .at-report-points td:nth-child(n+4) { display: none; }
    .at-report-points td.at-cell-wrap { min-width: 0; white-space: normal; }
    .at-report-points td, .at-report-points th { padding-left: .5rem; padding-right: .5rem; }
}

@media print {
    .at-header, .at-footer, .at-no-print { display: none !important; }
    body { background: #fff; }
    .at-page-header { background: none; color: var(--at-heading); padding: 0 0 .5rem; border-bottom: 2px solid var(--at-brand); border-radius: 0; }
    .at-page-header h1, .at-page-header > .bi { color: var(--at-heading); }
    .at-card { border-color: #ccc; break-inside: avoid-page; }
    .at-report-day { break-inside: auto; }
    .at-report-day > header { break-after: avoid; }
    .table-responsive { overflow: visible; }
    .at-table-stack thead { display: table-header-group !important; }
    .at-table-stack, .at-table-stack tbody { display: table-row-group !important; }
    .at-table-stack { display: table !important; }
    .at-table-stack tr { display: table-row !important; }
    .at-table-stack td { display: table-cell !important; text-align: left !important; }
    .at-table-stack td::before { content: none !important; }
    .at-table td, .at-table th { white-space: normal; padding: .3rem .4rem; font-size: .8rem; }
    a { color: inherit; text-decoration: none; }
}

/* ---------- Footer ---------- */

.at-footer { background: var(--at-brand); color: #fff; padding: 1rem 0; font-size: .875rem; }
.at-footer .at-container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.at-footer img { max-height: 30px; width: auto; }
.at-footer-text { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.5rem; }
.at-footer-links { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.at-footer-links a { color: #fff; text-decoration: none; }
.at-footer-links a:hover, .at-footer-links a:focus-visible { text-decoration: underline; }

/* ---------- Public pages (Privacy, Terms) ---------- */

.at-legal { max-width: 60rem; line-height: 1.6; }
.at-legal h2 { font-size: 1.1rem; margin-top: 1.75rem; }
.at-legal h2:first-child { margin-top: 0; }
.at-legal address { margin: 0 0 1rem 1rem; }

/* ---------- Sign-in ---------- */

.at-signin-page { background: #ebebeb; }
.at-signin { width: 100%; max-width: 440px; margin: clamp(1.5rem, 8vh, 6rem) auto; padding: 0 1rem; flex: 1 0 auto; }
.at-signin .at-card { padding: 2rem 1.75rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .06); }
.at-signin-logos { display: flex; align-items: center; justify-content: center; gap: 1.25rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.at-signin-logos img { max-height: 40px; max-width: 45%; width: auto; }
.btn-signin { background: var(--at-green); border-color: var(--at-green); color: #fff; border-radius: 2rem; width: 100%; font-weight: 600; }
.btn-signin:hover, .btn-signin:focus-visible { background: #457f19; border-color: #457f19; color: #fff; }
.at-signin-help { color: #3f7a14; text-align: center; margin: 1rem 0 0; font-size: .9rem; }

/* ---------- Blazor and validation ---------- */

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #c00000; font-size: .875rem; }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after { content: "An error has occurred."; }

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* ---------- Users and permissions ---------- */

.at-check-list { max-height: 24rem; overflow-y: auto; padding: .5rem .75rem; border: 1px solid var(--at-border); border-radius: var(--at-radius); }
@media (min-width: 768px) { .at-check-list { columns: 2; } }
.at-check-list .form-check { break-inside: avoid; }

/* ---------- Password reset ---------- */

.at-reset { max-width: 30rem; }
.at-reset-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .2em; }
