/* ============================================================
   Graphite: the admin's visual system.
   Quiet and near-monochrome. Hairline borders instead of shadows,
   colour kept for status, ember only on the brand mark.
   Geist is self-hosted (vendor/geist, SIL OFL) because the admin
   CSP only allows fonts from 'self'.
   ============================================================ */
@font-face {
    font-family: "Geist";
    src: url("vendor/geist/Geist-Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Geist Mono";
    src: url("vendor/geist/GeistMono-Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --g-bg: #fafaf9;
    --g-surface: #fff;
    --g-text: #18181b;
    --g-text-2: #3f3f46;
    --g-muted: #71717a;
    --g-faint: #a1a1aa;
    --g-line: #e7e5e4;
    --g-line-strong: #d6d3d1;
    --g-hover: #f4f4f3;
    --g-active: #ececeb;
    --g-ember: #e8631a;
    --g-ok: #15803d;
    --g-warn: #b45309;
    --g-bad: #dc2626;
    --g-info: #2563eb;
    --g-font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --g-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --adm-sidebar-w: 232px;

    /* Bootstrap, re-pointed at Graphite */
    --bs-body-font-family: var(--g-font);
    --bs-font-monospace: var(--g-mono);
    --bs-body-font-size: .875rem;
    --bs-body-color: var(--g-text);
    --bs-body-color-rgb: 24, 24, 27;
    --bs-body-bg: var(--g-surface);   /* components (cards, inputs, menus) sit on white; body paints --g-bg itself */
    --bs-emphasis-color: var(--g-text);
    --bs-secondary-color: var(--g-muted);
    --bs-tertiary-bg: var(--g-hover);
    --bs-border-color: var(--g-line);
    --bs-border-color-translucent: var(--g-line);
    --bs-border-radius: .375rem;
    --bs-border-radius-sm: .3rem;
    --bs-border-radius-lg: .5rem;
    --bs-primary: #18181b;
    --bs-primary-rgb: 24, 24, 27;
    --bs-link-color: var(--g-text);
    --bs-link-color-rgb: 24, 24, 27;
    --bs-link-hover-color: #000;
    --bs-link-hover-color-rgb: 0, 0, 0;
    --bs-focus-ring-color: rgba(24, 24, 27, .16);
    --bs-box-shadow-sm: none;
    --bs-code-color: var(--g-text-2);
    --bs-highlight-bg: #fdf3e4;
}

body { background: var(--g-bg); -webkit-font-smoothing: antialiased; }
code, kbd, pre, samp, .font-monospace { font-family: var(--g-mono); }

/* Hide Alpine-bound elements until Alpine initialises (avoids a flash). */
[x-cloak] { display: none !important; }

.brand { font-weight: 700; letter-spacing: -.3px; }

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5 { letter-spacing: -.015em; font-weight: 600; }

/* Links read as text; the underline marks them. */
a { text-underline-offset: .18em; text-decoration-color: var(--g-line-strong); }
a:hover { text-decoration-color: currentColor; }
.table a, .list-group a, .card-header a, .nav a, .btn, .dropdown-item { text-decoration: none; }
.table a:hover, .list-group a:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn { --bs-btn-font-weight: 500; --bs-btn-font-size: .8125rem; --bs-btn-padding-y: .375rem; --bs-btn-padding-x: .75rem; --bs-btn-border-radius: .375rem; }
.btn-sm { --bs-btn-font-size: .78rem; --bs-btn-padding-y: .22rem; --bs-btn-padding-x: .55rem; }
.btn-primary, .btn-dark {
    --bs-btn-bg: #18181b; --bs-btn-border-color: #18181b; --bs-btn-color: #fff;
    --bs-btn-hover-bg: #27272a; --bs-btn-hover-border-color: #27272a; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #3f3f46; --bs-btn-active-border-color: #3f3f46;
    --bs-btn-disabled-bg: #18181b; --bs-btn-disabled-border-color: #18181b;
    --bs-btn-focus-shadow-rgb: 24, 24, 27;
}
.btn-light, .btn-outline-secondary, .btn-outline-primary, .btn-outline-dark {
    --bs-btn-bg: #fff; --bs-btn-color: var(--g-text); --bs-btn-border-color: var(--g-line-strong);
    --bs-btn-hover-bg: var(--g-hover); --bs-btn-hover-color: var(--g-text); --bs-btn-hover-border-color: var(--g-faint);
    --bs-btn-active-bg: var(--g-active); --bs-btn-active-color: var(--g-text); --bs-btn-active-border-color: var(--g-faint);
    --bs-btn-disabled-color: var(--g-faint); --bs-btn-disabled-bg: #fff; --bs-btn-disabled-border-color: var(--g-line);
    --bs-btn-focus-shadow-rgb: 24, 24, 27;
}
.btn-secondary {
    --bs-btn-bg: var(--g-active); --bs-btn-color: var(--g-text); --bs-btn-border-color: var(--g-active);
    --bs-btn-hover-bg: #e4e4e2; --bs-btn-hover-color: var(--g-text); --bs-btn-hover-border-color: #e4e4e2;
    --bs-btn-active-bg: var(--g-line-strong); --bs-btn-active-color: var(--g-text);
}
/* Semantic outlines stay quiet: white fill, neutral border, coloured label. */
.btn-outline-success, .btn-outline-warning, .btn-outline-danger, .btn-outline-info {
    --bs-btn-bg: #fff; --bs-btn-border-color: var(--g-line-strong);
    --bs-btn-hover-border-color: currentColor; --bs-btn-active-border-color: currentColor;
    --bs-btn-disabled-bg: #fff; --bs-btn-disabled-border-color: var(--g-line);
}
.btn-outline-success { --bs-btn-color: var(--g-ok);   --bs-btn-hover-bg: #ecf6ef; --bs-btn-hover-color: var(--g-ok);   --bs-btn-active-bg: #dcefe2; --bs-btn-active-color: var(--g-ok);   --bs-btn-disabled-color: var(--g-ok); }
.btn-outline-warning { --bs-btn-color: var(--g-warn); --bs-btn-hover-bg: #fdf3e4; --bs-btn-hover-color: var(--g-warn); --bs-btn-active-bg: #fbe8cc; --bs-btn-active-color: var(--g-warn); --bs-btn-disabled-color: var(--g-warn); }
.btn-outline-danger  { --bs-btn-color: var(--g-bad);  --bs-btn-hover-bg: #fdeeee; --bs-btn-hover-color: var(--g-bad);  --bs-btn-active-bg: #fbdcdc; --bs-btn-active-color: var(--g-bad);  --bs-btn-disabled-color: var(--g-bad); }
.btn-outline-info    { --bs-btn-color: var(--g-info); --bs-btn-hover-bg: #edf2fd; --bs-btn-hover-color: var(--g-info); --bs-btn-active-bg: #dde7fb; --bs-btn-active-color: var(--g-info); --bs-btn-disabled-color: var(--g-info); }
.btn-success { --bs-btn-bg: var(--g-ok); --bs-btn-border-color: var(--g-ok); --bs-btn-hover-bg: #166534; --bs-btn-hover-border-color: #166534; --bs-btn-active-bg: #14532d; --bs-btn-active-border-color: #14532d; }
.btn-danger  { --bs-btn-bg: var(--g-bad); --bs-btn-border-color: var(--g-bad); --bs-btn-hover-bg: #b91c1c; --bs-btn-hover-border-color: #b91c1c; --bs-btn-active-bg: #991b1b; --bs-btn-active-border-color: #991b1b; }
.btn-group > .btn { --bs-btn-border-radius: .375rem; }
.btn-link { --bs-btn-color: var(--g-text-2); --bs-btn-hover-color: var(--g-text); }

/* ---------- Cards: a hairline, never a shadow ---------- */
.card {
    --bs-card-border-color: var(--g-line);
    --bs-card-border-radius: .5rem;
    --bs-card-inner-border-radius: calc(.5rem - 1px);
    --bs-card-cap-bg: var(--g-surface);
    --bs-card-cap-padding-y: .6rem;
    --bs-card-cap-padding-x: .875rem;
    --bs-card-spacer-x: .875rem;
    --bs-card-spacer-y: .875rem;
}
.adm-main .card.border-0 { border: 1px solid var(--g-line) !important; }
.adm-main .shadow-sm, .adm-main .shadow { box-shadow: none !important; }
.card-header { font-weight: 600; }
.card-header .small, .card-header small { font-weight: 400; }
.list-group { --bs-list-group-border-color: var(--g-line); --bs-list-group-item-padding-x: .875rem; --bs-list-group-item-padding-y: .55rem; --bs-list-group-action-hover-bg: var(--g-hover); --bs-list-group-active-bg: #18181b; --bs-list-group-active-border-color: #18181b; }

/* ---------- Tables: one style on every screen ----------
   Always: .card > .table-responsive > table.table.align-middle, pager in
   .card-footer. .table-sm / .table-hover / .adm-svc-table no longer change
   the look; every table gets the same rows, header and hover. */
.table {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--g-line);
    --bs-table-hover-bg: var(--g-hover);
    --bs-table-striped-bg: #fbfbfa;
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0;
}
.table > :not(caption) > * > * { padding: .55rem .75rem; }
.table > tbody > tr:hover > * { --bs-table-bg-state: var(--g-hover); }
.table > tbody > tr:last-child > * { border-bottom-color: transparent; }
.table > :not(caption) > * > :first-child { padding-left: .875rem; }
.table > :not(caption) > * > :last-child { padding-right: .875rem; }
.table thead th, .table > thead > tr > th {
    font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em;
    color: var(--g-muted); background: #fbfbfa; white-space: nowrap; vertical-align: middle;
}
.table-light { --bs-table-bg: #fbfbfa; --bs-table-color: var(--g-muted); --bs-table-border-color: var(--g-line); }
.card > .table-responsive:not(:last-child), .card > .table:not(:last-child) { border-bottom: 1px solid var(--g-line); }
.card-footer { --bs-card-cap-bg: var(--g-surface); font-size: .8125rem; color: var(--g-muted); }
.pagination { margin-bottom: 0; }

/* ---------- Page scaffolding: intro line, toolbar ----------
   Every list screen: [.adm-lede] → .adm-toolbar (filters left,
   actions right) → table card. */
.adm-lede { max-width: 72ch; margin: 0 0 1rem; font-size: .8125rem; color: var(--g-muted); }
.adm-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 1rem; }
.adm-toolbar > .adm-filterbar { display: flex; flex-wrap: wrap; gap: .5rem; flex: 0 1 auto; min-width: 0; }
.adm-toolbar-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-left: auto; }
.adm-back { display: flex; width: fit-content; align-items: center; gap: .25rem; margin-bottom: 1rem; font-size: .8125rem; color: var(--g-muted); text-decoration: none; }
.adm-back:hover { color: var(--g-text); }
.adm-cell-wide { min-width: 16rem; max-width: 30rem; }

/* ---------- Badges: soft tint, readable text ---------- */
.badge { font-weight: 500; font-size: .72rem; padding: .25em .55em; border-radius: .3rem; letter-spacing: 0; }
.badge.text-bg-success   { background: #ecf6ef !important; color: var(--g-ok) !important; }
.badge.text-bg-danger    { background: #fdeeee !important; color: var(--g-bad) !important; }
.badge.text-bg-warning   { background: #fdf3e4 !important; color: var(--g-warn) !important; }
.badge.text-bg-info, .badge.text-bg-primary { background: #edf2fd !important; color: var(--g-info) !important; }
.badge.text-bg-secondary, .badge.text-bg-light { background: var(--g-hover) !important; color: var(--g-text-2) !important; box-shadow: inset 0 0 0 1px var(--g-line); }
.badge.text-bg-dark      { background: #18181b !important; color: #fff !important; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-color: var(--g-line-strong); font-size: .875rem; }
.form-control-sm, .form-select-sm { font-size: .8125rem; }
.form-control::placeholder { color: var(--g-faint); }
.form-control:focus, .form-select:focus { border-color: var(--g-faint); box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
.form-check-input { border-color: var(--g-line-strong); }
.form-check-input:checked, .form-check-input:indeterminate { background-color: #18181b; border-color: #18181b; }
.form-check-input:focus { border-color: var(--g-faint); box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
.form-label { font-weight: 500; font-size: .8125rem; color: var(--g-text-2); margin-bottom: .3rem; }
.form-text { color: var(--g-muted); font-size: .78rem; }
.input-group-text { background: var(--g-hover); border-color: var(--g-line-strong); color: var(--g-muted); }

/* ---------- Tabs, pills, pagination, menus, modals, alerts ---------- */
.nav-tabs { --bs-nav-tabs-border-color: var(--g-line); --bs-nav-tabs-link-active-color: var(--g-text); --bs-nav-tabs-link-active-border-color: var(--g-line) var(--g-line) var(--bs-body-bg); --bs-nav-tabs-link-hover-border-color: transparent; }
.nav-tabs .nav-link, .nav-pills .nav-link { color: var(--g-muted); font-weight: 500; }
.nav-tabs .nav-link:hover, .nav-pills .nav-link:hover { color: var(--g-text); }
.nav-tabs .nav-link.active { font-weight: 600; }
.nav-pills { --bs-nav-pills-link-active-bg: #18181b; --bs-nav-pills-border-radius: .375rem; }
.nav-pills .nav-link.active { color: #fff; }
.pagination { --bs-pagination-color: var(--g-text-2); --bs-pagination-border-color: var(--g-line); --bs-pagination-hover-color: var(--g-text); --bs-pagination-hover-bg: var(--g-hover); --bs-pagination-hover-border-color: var(--g-line); --bs-pagination-active-bg: #18181b; --bs-pagination-active-border-color: #18181b; --bs-pagination-focus-box-shadow: 0 0 0 3px var(--bs-focus-ring-color); --bs-pagination-focus-color: var(--g-text); --bs-pagination-font-size: .8125rem; }
.dropdown-menu { --bs-dropdown-border-color: var(--g-line); --bs-dropdown-border-radius: .5rem; --bs-dropdown-font-size: .8125rem; --bs-dropdown-link-hover-bg: var(--g-hover); --bs-dropdown-link-active-bg: var(--g-active); --bs-dropdown-link-active-color: var(--g-text); box-shadow: 0 8px 24px -8px rgba(24,24,27,.18); }
.modal { --bs-modal-border-color: var(--g-line); --bs-modal-border-radius: .625rem; --bs-modal-header-border-color: var(--g-line); --bs-modal-footer-border-color: var(--g-line); }
.alert { --bs-alert-border-radius: .5rem; --bs-alert-padding-y: .65rem; --bs-alert-padding-x: .9rem; font-size: .8125rem; }
.alert-success { --bs-alert-bg: #f3faf5; --bs-alert-border-color: #cfe8d7; --bs-alert-color: #14532d; }
.alert-danger  { --bs-alert-bg: #fef5f5; --bs-alert-border-color: #f6d0d0; --bs-alert-color: #991b1b; }
.alert-warning { --bs-alert-bg: #fefaf2; --bs-alert-border-color: #f3dfb8; --bs-alert-color: #78350f; }
.alert-info, .alert-primary { --bs-alert-bg: #f5f8fe; --bs-alert-border-color: #d6e1f8; --bs-alert-color: #1e3a8a; }
.alert-light, .alert-secondary { --bs-alert-bg: #fbfbfa; --bs-alert-border-color: var(--g-line); --bs-alert-color: var(--g-text-2); }
.alert .alert-link { font-weight: 600; }

/* Bootstrap helpers, on the Graphite scale */
.bg-light { background-color: #fbfbfa !important; }
.bg-body-tertiary { background-color: var(--g-hover) !important; }
.bg-warning-subtle { background-color: #fefaf2 !important; }
.border-warning { border-color: #f3dfb8 !important; }
.border-danger { border-color: #f6d0d0 !important; }
.card.border-danger > .card-header, .card.border-danger .card-title { color: var(--g-bad); }
.text-muted, .text-body-secondary, .text-secondary { color: var(--g-muted) !important; }
.text-success { color: var(--g-ok) !important; }
.text-danger { color: var(--g-bad) !important; }
.text-warning { color: var(--g-warn) !important; }
.text-info { color: var(--g-info) !important; }
.text-dark { color: var(--g-text) !important; }
.badge.rounded-pill { border-radius: 999px; }
.card-header-tabs { --bs-nav-tabs-link-active-bg: var(--g-surface); --bs-nav-tabs-link-active-border-color: var(--g-line) var(--g-line) var(--g-surface); }
.card-header:has(.card-header-tabs) { background: #fbfbfa; }
hr { border-color: var(--g-line); opacity: 1; }
.form-range::-webkit-slider-thumb { background: #18181b; }
.form-range::-moz-range-thumb { background: #18181b; }
.form-switch .form-check-input:focus { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23a1a1aa'/%3e%3c/svg%3e"); }
.progress { --bs-progress-bar-bg: #18181b; --bs-progress-bg: var(--g-active); }

/* ============================================================
   Sidebar
   - Desktop (>= lg): persistent sticky full-height rail.
   - Mobile  (<  lg): off-canvas drawer that slides in over the
     content, toggled by the header hamburger (see app.php).
   ============================================================ */
.adm-sidebar {
    width: var(--adm-sidebar-w);
    min-width: var(--adm-sidebar-w);
    min-height: 100vh;
    background: var(--g-bg);
    color: var(--g-text-2);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;            /* the nav scrolls; brand + footer stay pinned */
    border-right: 1px solid var(--g-line);
}

/* Brand / logo */
.adm-brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem .9rem .6rem;
}
.adm-brand-link {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
    text-decoration: none;
    color: var(--g-text);
}
.adm-brand-logo {
    flex-shrink: 0;
    display: block;
}
.adm-brand-name { font-weight: 600; font-size: .875rem; letter-spacing: -.01em; }
.adm-brand-name small { font-weight: 400; color: var(--g-faint); margin-left: .15rem; }

/* Nav (scroll area) */
.adm-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: .25rem .6rem 1rem;
}
.adm-nav-section {
    padding: 1rem .6rem .3rem;
    font-size: .6875rem;
    font-weight: 500;
    color: var(--g-faint);
}
.adm-nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .34rem .6rem;
    margin-bottom: 1px;
    border-radius: .375rem;
    color: var(--g-text-2);
    font-size: .8125rem;
    font-weight: 400;
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
}
.adm-nav-link i {
    flex-shrink: 0;
    width: 1.1rem;
    text-align: center;
    font-size: .95rem;
    color: var(--g-faint);
}
.adm-nav-link:hover { background: var(--g-hover); color: var(--g-text); }
.adm-nav-link.active { background: var(--g-active); color: var(--g-text); font-weight: 600; }
.adm-nav-link.active i { color: var(--g-text); }
.adm-nav-link:focus-visible { outline: 2px solid var(--g-text); outline-offset: -2px; }

/* Footer (logged-in user) */
.adm-sidebar-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .7rem .9rem;
    border-top: 1px solid var(--g-line);
}
.adm-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--g-active);
    color: var(--g-text);
    font-size: .7rem;
    font-weight: 600;
}
.adm-user-name { font-size: .8125rem; font-weight: 500; line-height: 1.2; color: var(--g-text); }
.adm-user-role { font-size: .72rem; color: var(--g-muted); text-transform: capitalize; }

/* Thin scrollbar inside the nav (WebKit). */
.adm-nav::-webkit-scrollbar { width: 6px; }
.adm-nav::-webkit-scrollbar-thumb { background: var(--g-line-strong); border-radius: 3px; }

.adm-main { min-width: 0; }

/* Top bar */
.adm-topbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .5rem;
    min-height: 52px;
    padding: .5rem 1rem;
    background: rgba(250, 250, 249, .88);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--g-line);
    position: sticky;
    top: 0;
    z-index: 1020;
}
.adm-topbar-title { display: flex; align-items: center; gap: .4rem; min-width: 0; font-size: .8125rem; color: var(--g-muted); white-space: nowrap; overflow: hidden; }
.adm-topbar-title a { color: var(--g-muted); text-decoration: none; }
.adm-topbar-title a:hover { color: var(--g-text); }
.adm-topbar-title .bi { font-size: .65rem; color: var(--g-faint); }
.adm-topbar-title b { font-weight: 600; color: var(--g-text); overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 575.98px) { .adm-topbar-title > :not(b) { display: none; } }
@media (min-width: 992px) { .adm-topbar { padding: .5rem 1.5rem; } }

/* Dimmed backdrop behind the mobile drawer. */
.adm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(24,24,27,.35);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease;
}
.adm-backdrop.show { opacity: 1; visibility: visible; }

@media (max-width: 991.98px) {
    .adm-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        min-height: 100%;
        z-index: 1045;
        background: var(--g-surface);
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 0 0 32px rgba(24,24,27,.18);
    }
    .adm-sidebar.open { transform: translateX(0); }
}

/* ============================================================
   KPI cards: label on top, figure below, no icon tile.
   ============================================================ */
.kpi-card { border: 1px solid var(--g-line) !important; border-radius: .5rem; box-shadow: none; transition: border-color .15s ease; }
.kpi-card:hover { border-color: var(--g-line-strong) !important; }
.kpi-card .card-body { padding: .8rem .95rem; }
.kpi-card .kpi-icon { display: none; }
.kpi-card .card-body > .min-w-0 { display: flex; flex-direction: column; gap: .1rem; }
.kpi-card .kpi-label { order: -1; color: var(--g-muted); font-size: .78rem; font-weight: 500; line-height: 1.3; }
.kpi-card .kpi-value { font-size: 1.35rem; font-weight: 600; letter-spacing: -.025em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpi-card .kpi-value .bi { font-size: .9em; }
.kpi-card .small.text-muted { font-size: .75rem; }

/* Tinted icon badge, still used outside KPI cards */
.kpi-icon { width: 30px; height: 30px; border-radius: .375rem; display: grid; place-items: center; font-size: .9rem; flex-shrink: 0; }
.kpi-icon-success { background: #ecf6ef; color: var(--g-ok); }
.kpi-icon-danger  { background: #fdeeee; color: var(--g-bad); }
.kpi-icon-warning { background: #fdf3e4; color: var(--g-warn); }
.kpi-icon-info    { background: #edf2fd; color: var(--g-info); }
.kpi-icon-neutral { background: var(--g-hover); color: var(--g-muted); }

@media (max-width: 575.98px) {
    .kpi-card .kpi-value { font-size: 1.1rem; }
    .kpi-card .card-body { padding: .7rem .75rem; }
}



/* ============================================================
   Filter / search bars
   Controls size to their content on desktop and stack to full
   width on phones, so they never overflow a narrow viewport.
   ============================================================ */
.adm-filterbar .form-select,
.adm-filterbar .form-control {
    width: auto;
    min-width: 9rem;
    flex: 1 1 auto;
}
@media (max-width: 575.98px) {
    .adm-filterbar { width: 100%; }
    .adm-filterbar .form-select,
    .adm-filterbar .form-control,
    .adm-filterbar .btn {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
    }
}

/* ============================================================
   Tab strips that may not fit a phone width: scroll sideways
   instead of wrapping into a ragged second row.
   ============================================================ */
.adm-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.adm-tabs::-webkit-scrollbar { height: 0; }
.adm-tabs .nav-link { white-space: nowrap; }

/* ============================================================
   Styled table header (report tables, bank ledger)
   NOTE: .table-responsive sets overflow-x:auto, which makes the
   browser compute overflow-y to auto too — so it becomes its own
   scroll container. A sticky thead with top>0 would then be pushed
   DOWN from the container top (leaving a gap and covering row 1),
   because it sticks to the container, not the page. So top:0:
   the header sits flush and still sticks IF the container ever
   scrolls vertically (e.g. a future max-height).
   ============================================================ */
.adm-sticky-head thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fbfbfa;
    box-shadow: 0 1px 0 var(--g-line);
}

/* ============================================================
   Empty-state rows (inside <tbody>) — consistent icon + text
   ============================================================ */
.adm-empty {
    text-align: center;
    padding: 2.25rem 1rem;
    color: var(--g-muted);
}
.adm-empty .bi { font-size: 2rem; display: block; margin-bottom: .5rem; opacity: .45; }
.adm-empty p { margin: 0; font-size: .9rem; }
.adm-empty a { color: var(--g-muted); }

/* ============================================================
   Dashboard section label between two KPI rows
   ============================================================ */
.kpi-section-label {
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--g-muted);
    margin-top: .25rem;
}

/* ============================================================
   Utilities
   ============================================================ */
.min-w-0 { min-width: 0 !important; }

/* ============================================================
   BuzzMelt admin additions
   ============================================================ */

/* Staff sign-in */
.adm-auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: var(--g-bg); }
.adm-auth-card { width: 100%; max-width: 380px; border: 1px solid var(--g-line); border-radius: .75rem; box-shadow: 0 1px 2px rgba(24,24,27,.04), 0 16px 40px -20px rgba(24,24,27,.18); }
.adm-auth-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.25rem; }


/* Article body editor */
.adm-body-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; min-height: 22rem; }

/* Visual / Text editor (editor.js), after the WordPress classic editor */
.adm-editor { border: 1px solid var(--g-line); border-radius: .5rem; background: #fff; overflow: hidden; }
.adm-ed-head { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding: .35rem .5rem; background: #fbfbfa; border-bottom: 1px solid var(--g-line); }
.adm-ed-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; }
.adm-editor[data-mode="visual"] .adm-ed-toolbar + .adm-ed-toolbar,
.adm-editor[data-mode="text"] .adm-ed-toolbar:first-child { display: none; }
.adm-ed-format { width: auto; min-width: 8.5rem; margin-right: .25rem; }
.adm-ed-btn { --bs-btn-padding-x: .45rem; --bs-btn-padding-y: .2rem; border: 1px solid transparent; color: var(--g-text-2); line-height: 1.2; }
.adm-ed-btn:hover { background: #fff; border-color: var(--g-line-strong); }
.adm-ed-btn.active, .adm-ed-btn:active { background: var(--g-active); border-color: var(--g-line-strong); color: var(--g-text); }
.adm-ed-qt { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; background: #fff; border-color: var(--g-line-strong); }
.adm-ed-sep { width: 1px; height: 1.25rem; background: var(--g-line); margin: 0 .3rem; }
.adm-ed-tabs { display: flex; gap: 2px; margin-left: auto; }
.adm-ed-tab { border: 1px solid var(--g-line); background: var(--g-hover); color: var(--g-muted); font-size: .8rem; padding: .2rem .7rem; border-radius: .35rem; }
.adm-ed-tab[aria-selected="true"] { background: #fff; color: var(--g-text); font-weight: 600; }
.adm-ed-visual { min-height: 22rem; max-height: 70vh; overflow-y: auto; resize: vertical; padding: 1rem 1.25rem; outline: 0; font-size: 1rem; line-height: 1.7; color: var(--g-text); }
.adm-ed-visual.is-empty::before { content: "Start writing…"; color: var(--g-faint); position: absolute; pointer-events: none; }
.adm-ed-visual > :first-child { margin-top: 0; }
.adm-ed-visual p { margin: 0 0 1rem; }
.adm-ed-visual h2 { font-size: 1.45rem; margin: 1.5rem 0 .6rem; }
.adm-ed-visual h3 { font-size: 1.18rem; margin: 1.25rem 0 .5rem; }
.adm-ed-visual blockquote { margin: 1.25rem 0; padding: .15rem 0 .15rem 1rem; border-left: 3px solid #e8631a; font-size: 1.1rem; color: var(--g-text); }
.adm-ed-visual blockquote p { margin: 0; }
.adm-ed-visual ul, .adm-ed-visual ol { margin: 0 0 1rem; padding-left: 1.4rem; }
.adm-ed-visual hr { border: 0; border-top: 2px solid var(--g-line); margin: 1.5rem 0; opacity: 1; }
.adm-ed-visual a { color: #c2410c; }
.adm-editor[data-mode="visual"] .adm-ed-text { display: none; }
.adm-editor[data-mode="text"] .adm-ed-visual { display: none; }
.adm-editor .adm-ed-text { border: 0; border-radius: 0; box-shadow: none; resize: vertical; }
.adm-ed-status { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem .75rem; border-top: 1px solid var(--g-line); background: #fbfbfa; font-size: .75rem; color: var(--g-muted); }
.adm-editor--full { position: fixed; inset: 0; z-index: 1060; border-radius: 0; display: flex; flex-direction: column; }
.adm-editor--full .adm-ed-visual, .adm-editor--full .adm-ed-text { flex: 1 1 auto; max-height: none; resize: none; }
.adm-editor--full .adm-ed-visual { padding: 2rem max(1.25rem, calc((100% - 46rem) / 2)); }
.adm-editor--full .adm-ed-text { padding: 2rem max(1.25rem, calc((100% - 52rem) / 2)); }
body.adm-ed-lock { overflow: hidden; }
/* Dialogs opened from distraction-free mode sit above the full-screen editor. */
body.adm-ed-lock .modal-backdrop { z-index: 1065; }
body.adm-ed-lock .modal { z-index: 1070; }
.adm-ed-bar { display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem 0; background: #fbfbfa; }
.adm-ed-bar .adm-ed-tabs { margin-bottom: -1px; }
.adm-ed-bar .adm-ed-tab { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.adm-ed-bar .adm-ed-media { margin-bottom: .35rem; }
.adm-ed-status.is-busy .adm-ed-count { color: #c2410c; font-weight: 600; }
.adm-ed-fig { position: relative; margin: 1.25rem 0; cursor: default; user-select: none; }
.adm-ed-fig img { display: block; max-width: 100%; height: auto; border-radius: .4rem; outline: 3px solid transparent; outline-offset: 2px; }
.adm-ed-fig.is-selected img, .adm-ed-fig:hover img { outline-color: #18181b; }
.adm-ed-fig figcaption { margin-top: .35rem; font-size: .85rem; color: var(--g-muted); }
.adm-ed-figbar { position: absolute; top: .5rem; right: .5rem; display: none; gap: .25rem; }
.adm-ed-fig:hover .adm-ed-figbar, .adm-ed-fig.is-selected .adm-ed-figbar { display: flex; }
.adm-ed-figbar .btn { box-shadow: 0 1px 4px rgba(0,0,0,.25); }

/* Editor widgets: image settings, embeds, audio/video, tables, columns (editor.js) */
.adm-ed-head { position: relative; }
.adm-ed-btn:disabled { opacity: .35; }
.adm-ed-visual::after { content: ""; display: table; clear: both; }
.adm-ed-widget.is-selected > .adm-ed-figbar, .adm-ed-widget:hover > .adm-ed-figbar, .adm-ed-widget:focus-within > .adm-ed-figbar { display: flex; }
.adm-ed-figbar { z-index: 2; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100% - 1rem); }
.adm-ed-figbar .btn { --bs-btn-padding-x: .4rem; --bs-btn-padding-y: .15rem; }
.adm-ed-fig.is-w25 { width: 25%; } .adm-ed-fig.is-w33 { width: 33.333%; } .adm-ed-fig.is-w50 { width: 50%; }
.adm-ed-fig.is-w66 { width: 66.666%; } .adm-ed-fig.is-w75 { width: 75%; }
.adm-ed-fig[class*="is-w"] { margin-inline: auto; }
.adm-ed-fig.is-left { float: left; margin: .35rem 1.25rem .75rem 0; }
.adm-ed-fig.is-right { float: right; margin: .35rem 0 .75rem 1.25rem; }
.adm-ed-fig.is-left:not([class*="is-w"]), .adm-ed-fig.is-right:not([class*="is-w"]) { width: 50%; }
.adm-ed-fig.is-left .adm-ed-figbar, .adm-ed-fig.is-right .adm-ed-figbar,
.adm-ed-fig[class*="is-w"] .adm-ed-figbar { top: .25rem; right: .25rem; }
.adm-ed-fig.is-border-thin img { border: 1px solid #a8a29e; }
.adm-ed-fig.is-border-thick img { border: 4px solid #fff; box-shadow: 0 0 0 1px #a8a29e; }
.adm-ed-fig.is-radius-none img { border-radius: 0; } .adm-ed-fig.is-radius-sm img { border-radius: 6px; }
.adm-ed-fig.is-radius-md img { border-radius: 12px; } .adm-ed-fig.is-radius-lg img { border-radius: 22px; }
.adm-ed-fig.is-radius-circle img { border-radius: 50%; aspect-ratio: 1; object-fit: cover; }
.adm-ed-fig.is-shadow img { box-shadow: 0 14px 30px -16px rgba(0,0,0,.55); }
.adm-ed-fig.is-crop img { width: 100%; object-fit: cover; }
.adm-ed-fig.ratio-16x9 img, .adm-ed-embed-frame.ratio-16x9 { aspect-ratio: 16 / 9; }
.adm-ed-fig.ratio-4x3 img, .adm-ed-embed-frame.ratio-4x3 { aspect-ratio: 4 / 3; }
.adm-ed-fig.ratio-3x2 img { aspect-ratio: 3 / 2; }
.adm-ed-fig.ratio-1x1 img, .adm-ed-embed-frame.ratio-1x1 { aspect-ratio: 1; }
.adm-ed-fig.ratio-2x3 img { aspect-ratio: 2 / 3; }
.adm-ed-fig.ratio-9x16 img, .adm-ed-embed-frame.ratio-9x16 { aspect-ratio: 9 / 16; }
.adm-ed-embed-frame.ratio-9x16 { max-width: 18rem; margin-inline: auto; }
.adm-ed-tag { display: inline-flex; align-items: center; gap: .25rem; margin-top: .35rem; font-size: .75rem; color: var(--g-muted); }
.adm-ed-embed, .adm-ed-av { clear: both; }
.adm-ed-embed-frame { position: relative; display: grid; place-items: center; overflow: hidden; border-radius: .4rem; background: #1c1917; outline: 3px solid transparent; outline-offset: 2px; }
.adm-ed-embed-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; outline: 0; }
.adm-ed-embed.is-selected .adm-ed-embed-frame, .adm-ed-embed:hover .adm-ed-embed-frame { outline-color: #18181b; }
.adm-ed-play { position: relative; display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: #e8631a; color: #fff; font-size: 1.8rem; }
.adm-ed-embed-frame .adm-ed-tag { position: absolute; left: .5rem; bottom: .5rem; margin: 0; padding: .15rem .5rem; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; }
.adm-ed-av { padding: .5rem; border: 1px solid var(--g-line); border-radius: .5rem; background: #fbfbfa; }
.adm-ed-av video { display: block; width: 100%; max-height: 24rem; border-radius: .35rem; background: #1c1917; }
.adm-ed-av audio { display: block; width: 100%; margin-top: .35rem; }
.adm-ed-av.is-selected, .adm-ed-av:hover { border-color: #18181b; }
.adm-ed-audio .adm-ed-tag { margin-top: 0; }

.adm-ed-table { position: relative; margin: 1.25rem 0; clear: both; padding-top: .25rem; }
.adm-ed-tblbar { position: static; display: none; margin-bottom: .35rem; max-width: none; justify-content: flex-start; }
.adm-ed-tblbar .btn { box-shadow: none; border: 1px solid var(--g-line); }
.adm-ed-tblcap { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.adm-ed-tblwrap { overflow-x: auto; border: 1px solid var(--g-line); border-radius: .4rem; }
.adm-ed-table.is-selected .adm-ed-tblwrap, .adm-ed-table:focus-within .adm-ed-tblwrap { border-color: #18181b; }
.adm-ed-tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.adm-ed-tbl.is-fit { width: auto; }
.adm-ed-tbl th, .adm-ed-tbl td { min-width: 4rem; padding: .45rem .65rem; border: 1px solid var(--g-line); vertical-align: top; outline: 0; }
.adm-ed-tbl.is-compact th, .adm-ed-tbl.is-compact td { padding: .2rem .45rem; font-size: .88rem; }
.adm-ed-tbl th { background: #f5f5f4; font-weight: 600; }
.adm-ed-tbl.is-striped tr:nth-child(even) td { background: #fafaf9; }
.adm-ed-tbl tr:first-child th:is(:empty, :has(> br:only-child))::before { content: "Heading"; color: var(--g-faint); font-weight: 400; }
.adm-ed-tbl td:focus, .adm-ed-tbl th:focus { box-shadow: inset 0 0 0 2px #e8631a; }
.adm-ed-tbl .ta-c { text-align: center; } .adm-ed-tbl .ta-r { text-align: right; }

.adm-ed-cols { position: relative; display: grid; gap: 1rem; margin: 1.25rem 0; padding: 2.1rem .5rem .5rem; clear: both; border: 1px dashed var(--g-line-strong, #d6d3d1); border-radius: .5rem; }
.adm-ed-cols.is-selected, .adm-ed-cols:focus-within { border-color: #18181b; }
.adm-ed-cols--50-50 { grid-template-columns: 1fr 1fr; } .adm-ed-cols--33-67 { grid-template-columns: 1fr 2fr; }
.adm-ed-cols--67-33 { grid-template-columns: 2fr 1fr; } .adm-ed-cols--33-33-33 { grid-template-columns: repeat(3, 1fr); }
.adm-ed-cols--25-25-25-25 { grid-template-columns: repeat(4, 1fr); }
.adm-ed-cols.is-gap-sm { gap: .5rem; } .adm-ed-cols.is-gap-lg { gap: 2rem; }
.adm-ed-cols.is-center { align-items: center; }
.adm-ed-colbar { top: .35rem; right: .35rem; display: flex; }
.adm-ed-colbar .btn { box-shadow: none; border: 1px solid var(--g-line); }
.adm-ed-col { min-width: 0; min-height: 3rem; padding: .35rem .5rem; border-radius: .35rem; background: #fbfbfa; outline: 0; }
.adm-ed-col:focus { box-shadow: inset 0 0 0 1px #a8a29e; }
.adm-ed-col > :last-child { margin-bottom: 0; }
.adm-ed-col:has(> p:only-child > br:only-child)::before { content: "Write, or add media…"; position: absolute; color: var(--g-faint); pointer-events: none; }

.adm-ed-visual .ispoiler { padding: 0 2px; border-radius: 3px; background: #e7e5e4; box-shadow: inset 0 -2px 0 #57534e; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.adm-ed-visual .ispoiler::before { content: "\F777"; font-family: bootstrap-icons; font-size: .75em; margin-right: 3px; color: #57534e; vertical-align: .05em; }
.adm-ed-titlecard { clear: both; }
.adm-ed-tc { display: flex; gap: .75rem; align-items: center; padding: .6rem; border: 1px solid var(--g-line); border-radius: .5rem; background: #fff; }
.adm-ed-titlecard.is-selected .adm-ed-tc, .adm-ed-titlecard:hover .adm-ed-tc { border-color: #18181b; }
.adm-ed-titlecard.is-missing .adm-ed-tc { border-style: dashed; border-color: #dc2626; }
.adm-ed-tc-poster { flex: none; display: grid; place-items: center; width: 3.25rem; aspect-ratio: 2 / 3; border-radius: .3rem; overflow: hidden; background: #e7e5e4; color: #fff; font-size: 1.2rem; }
.adm-ed-tc-poster img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; outline: 0 !important; }
.adm-ed-tc-text { display: grid; min-width: 0; line-height: 1.3; }
.adm-ed-tc-kind { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--g-muted); }
.adm-ed-tc-name { font-size: 1.05rem; }
.adm-ed-tc-sub { color: var(--g-muted); }
.adm-ed-titlecard.is-missing .adm-ed-tc-sub { color: #dc2626; }
.adm-ed-titlecard figcaption { padding-left: .6rem; border-left: 2px solid #e8631a; }

.adm-ed-spoiler { position: relative; margin: 1.25rem 0; padding: .5rem; clear: both; border: 1px dashed #f0a574; border-radius: .5rem; background: #fff7f1; }
.adm-ed-spoiler.is-selected, .adm-ed-spoiler:focus-within { border-color: #e8631a; }
.adm-ed-spoilhead { display: flex; align-items: center; gap: .5rem; min-height: 1.9rem; padding: 0 7rem .4rem .25rem; font-weight: 600; font-size: .9rem; }
.adm-ed-spoiltag { padding: .1rem .5rem; border-radius: 999px; background: #e8631a; color: #fff; font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.adm-ed-spoilbody { position: relative; min-height: 3rem; padding: .5rem .75rem; border-radius: .35rem; background: #fff; outline: 0; }
.adm-ed-spoilbody:focus { box-shadow: inset 0 0 0 1px #f0a574; }
.adm-ed-spoilbody > :last-child { margin-bottom: 0; }
.adm-ed-spoilbody:has(> p:only-child > br:only-child)::before { content: "Write what the spoiler hides…"; position: absolute; color: var(--g-faint); pointer-events: none; }

.adm-ed-html { position: relative; margin: 1.25rem 0; padding: .5rem; clear: both; border: 1px solid var(--g-line); border-radius: .5rem; background: #fafaf9; }
.adm-ed-html.is-direct { border-color: #f59e0b; background: #fffbeb; }
.adm-ed-html.is-selected { border-color: #18181b; }
.adm-ed-htmlhead { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; min-height: 1.9rem; padding: 0 9rem .35rem .25rem; font-size: .85rem; }
.adm-ed-htmlmode { padding: .05rem .45rem; border-radius: 999px; background: #e7e5e4; font-size: .7rem; font-weight: 600; }
.adm-ed-html.is-direct .adm-ed-htmlmode { background: #f59e0b; color: #fff; }
.adm-ed-htmllabel { color: var(--g-muted); }
.adm-ed-htmllock { margin: 0 .25rem .4rem; font-size: .75rem; color: var(--g-muted); }
.adm-ed-htmlcode { margin: 0; max-height: 16rem; overflow: auto; padding: .5rem .65rem; border-radius: .35rem; background: #1c1917; color: #e7e5e4; font-size: .75rem; line-height: 1.5; white-space: pre; }
.adm-ed-codebox { font-size: .8rem; line-height: 1.5; tab-size: 2; white-space: pre; }
.adm-ed-results { display: grid; gap: 2px; max-height: 18rem; overflow-y: auto; margin-top: .25rem; }
.adm-ed-result { display: flex; align-items: center; gap: .6rem; padding: .3rem .4rem; border: 0; border-radius: .35rem; background: none; text-align: left; }
.adm-ed-result:hover, .adm-ed-result:focus-visible { background: var(--g-hover); outline: 0; }
.adm-ed-result-img { flex: none; width: 2rem; aspect-ratio: 2 / 3; border-radius: .2rem; overflow: hidden; background: #e7e5e4; }
.adm-ed-result-img img { width: 100%; height: 100%; object-fit: cover; }
.adm-ed-result-text { display: grid; line-height: 1.25; font-size: .85rem; }
.adm-ed-result-text small { color: var(--g-muted); }
.adm-ed-noresult { padding: .4rem; font-size: .8rem; color: var(--g-muted); }
.adm-ed-picked { color: #15803d; }

.adm-ed-pop { position: absolute; z-index: 20; min-width: 14rem; padding: .5rem; background: #fff; border: 1px solid var(--g-line); border-radius: .5rem; }
.adm-ed-pop-label { font-size: .75rem; color: var(--g-muted); margin: 0 .15rem .4rem; }
.adm-ed-grid { display: grid; grid-template-columns: repeat(8, 1.25rem); gap: 3px; }
.adm-ed-cell { width: 1.25rem; height: 1.25rem; padding: 0; border: 1px solid var(--g-line); border-radius: 3px; background: #fff; }
.adm-ed-cell.is-on { background: #fde2d0; border-color: #e8631a; }
.adm-ed-layout, .adm-ed-menuitem { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .35rem .5rem; border: 0; border-radius: .35rem; background: none; text-align: left; font-size: .85rem; color: var(--g-text); }
.adm-ed-layout:hover, .adm-ed-layout:focus-visible, .adm-ed-menuitem:hover, .adm-ed-menuitem:focus-visible { background: var(--g-hover); }
.adm-ed-layout-prev { display: flex; gap: 2px; width: 3.25rem; height: 1.1rem; }
.adm-ed-layout-prev span { background: #d6d3d1; border-radius: 2px; }
@media (max-width: 575.98px) {
    .adm-ed-fig.is-left, .adm-ed-fig.is-right { float: none; width: auto !important; margin: 1.25rem 0; }
    .adm-ed-cols { grid-template-columns: 1fr !important; }
}

.adm-media-file { display: grid; place-items: center; align-content: center; gap: .25rem; width: 100%; height: 100%; color: var(--g-muted); background: #f5f5f4; font-size: 2rem; }
.adm-media-file small { font-size: .7rem; font-weight: 600; letter-spacing: .05em; }
.adm-mm-name { position: absolute; inset: auto 0 0 0; padding: .2rem .35rem; font-size: .7rem; color: var(--g-text); background: rgba(255,255,255,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Media library (media.js) */
.adm-drop { position: relative; border: 2px dashed var(--g-line-strong); border-radius: .75rem; padding: 1.75rem 1rem; text-align: center; background: #fbfbfa; transition: background .15s, border-color .15s; }
.adm-drop.is-over { border-color: #18181b; background: var(--g-hover); }
.adm-drop-icon { font-size: 2rem; color: var(--g-faint); display: block; margin-bottom: .25rem; }
.adm-drop-queue { max-width: 32rem; margin-left: auto; margin-right: auto; }
.adm-drop-queue:empty { display: none; }
.adm-q-row { display: grid; grid-template-columns: minmax(0, 1fr) 8rem; gap: .15rem .75rem; align-items: center; padding: .3rem 0; border-top: 1px solid var(--g-line); }
.adm-q-name { font-weight: 600; }
.adm-q-bar { height: .45rem; }
.adm-q-note:empty { display: none; }
.adm-q-row .adm-q-note { grid-column: 2; }
.adm-q-row.is-error { grid-template-columns: 1fr; }
.adm-q-row.is-error .adm-q-note { grid-column: 1; }
.adm-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.adm-media-tile { position: relative; display: block; aspect-ratio: 1; border-radius: .5rem; overflow: hidden; background: var(--g-line); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.adm-media-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.adm-media-tile:hover img, .adm-media-tile:focus-visible img { transform: scale(1.04); }
.adm-media-tile:focus-visible { outline: 3px solid #18181b; outline-offset: 2px; }
.adm-media-name { position: absolute; inset: auto 0 0 0; padding: 1.25rem .5rem .35rem; font-size: .75rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .15s; }
.adm-media-tile:hover .adm-media-name, .adm-media-tile:focus-visible .adm-media-name { opacity: 1; }
.adm-media-preview { display: grid; place-items: center; min-height: 20rem; background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 50% / 20px 20px; border-radius: .5rem; }
.adm-media-preview img { max-width: 100%; max-height: 70vh; height: auto; }
.adm-media-meta { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; }
.adm-media-meta dt { font-weight: 600; color: var(--g-muted); }
.adm-media-meta dd { margin: 0; }

/* Image editor: a crop box over the preview (media-image.js) */
.adm-ie-canvas { position: relative; display: inline-block; max-width: 100%; line-height: 0; user-select: none; -webkit-user-select: none; touch-action: none; overflow: hidden; }
.adm-ie-canvas img { max-width: 100%; max-height: 70vh; width: auto; height: auto; display: block; }
.adm-ie-canvas.is-cropping { cursor: crosshair; }
.adm-ie-box { position: absolute; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .55); outline: 1px solid rgba(255,255,255,.9); cursor: move;
  background-image: linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)), linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)),
                    linear-gradient(90deg, rgba(255,255,255,.35), rgba(255,255,255,.35)), linear-gradient(90deg, rgba(255,255,255,.35), rgba(255,255,255,.35));
  background-size: 100% 1px, 100% 1px, 1px 100%, 1px 100%; background-position: 0 33.33%, 0 66.66%, 33.33% 0, 66.66% 0; background-repeat: no-repeat; }
.adm-ie-h { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; background: #fff; border: 1px solid #18181b; border-radius: 2px; }
.adm-ie-h-nw { left: 0; top: 0; cursor: nwse-resize; } .adm-ie-h-n { left: 50%; top: 0; cursor: ns-resize; } .adm-ie-h-ne { left: 100%; top: 0; cursor: nesw-resize; }
.adm-ie-h-e { left: 100%; top: 50%; cursor: ew-resize; } .adm-ie-h-se { left: 100%; top: 100%; cursor: nwse-resize; } .adm-ie-h-s { left: 50%; top: 100%; cursor: ns-resize; }
.adm-ie-h-sw { left: 0; top: 100%; cursor: nesw-resize; } .adm-ie-h-w { left: 0; top: 50%; cursor: ew-resize; }
.adm-ie-dims { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); padding: .15rem .45rem; border-radius: .25rem; background: rgba(15, 23, 42, .75); color: #fff; font-size: .72rem; line-height: 1.2; white-space: nowrap; pointer-events: none; }
@media (pointer: coarse) { .adm-ie-h { width: 22px; height: 22px; margin: -11px 0 0 -11px; } }

/* "Add media" dialog */
.adm-mm { max-width: min(1140px, calc(100vw - 1.5rem)); margin-left: auto; margin-right: auto; }
.adm-mm .modal-content { height: min(88vh, 52rem); }
.adm-mm-tabs { display: flex; gap: 1.25rem; }
.adm-mm-tab { border: 0; background: none; padding: .6rem 0; color: var(--g-muted); font-weight: 600; font-size: .9rem; border-bottom: 3px solid transparent; }
.adm-mm-tab[aria-selected="true"] { color: var(--g-text); border-bottom-color: #18181b; }
.adm-mm-pane[data-pane-body="upload"] { padding: 1.5rem; height: 100%; }
.adm-mm-drop { height: 100%; min-height: 16rem; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.adm-mm-drop .adm-drop-queue { width: 100%; }
.adm-mm-lib { display: flex; height: 100%; }
.adm-mm-lib:not([hidden]) { display: flex; }
.adm-mm-browse { flex: 1 1 auto; min-width: 0; overflow-y: auto; padding: 1rem; }
.adm-mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; }
.adm-mm-item { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: .35rem; overflow: hidden; background: var(--g-line); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.adm-mm-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.adm-mm-item:focus-visible { outline: 3px solid #18181b; outline-offset: 2px; }
.adm-mm-item.is-selected { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #18181b; }
.adm-mm-check { position: absolute; top: .3rem; right: .3rem; width: 1.5rem; height: 1.5rem; border-radius: .25rem; background: #18181b; color: #fff; display: none; place-items: center; font-size: .9rem; }
.adm-mm-item.is-selected .adm-mm-check { display: grid; }
.adm-mm-side { flex: 0 0 18rem; overflow-y: auto; padding: 1rem; background: #fbfbfa; border-left: 1px solid var(--g-line); }
.adm-mm-side-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--g-muted); margin-bottom: .6rem; }
.adm-mm-side-thumb { width: 5rem; height: 5rem; object-fit: cover; border-radius: .25rem; flex-shrink: 0; }
@media (max-width: 767.98px) {
  .adm-mm-lib:not([hidden]) { flex-direction: column; }
  .adm-mm-side { flex-basis: auto; border-left: 0; border-top: 1px solid var(--g-line); }
}

/* Title/poster swatch in tables */
.adm-swatch { width: 28px; height: 42px; border-radius: 4px; flex-shrink: 0; display: grid; place-items: center; color: #fff; font-size: .65rem; font-weight: 700; }
.adm-hue { width: 1.25rem; height: 1.25rem; border-radius: 50%; display: inline-block; vertical-align: middle; }
.adm-log { white-space: pre-wrap; font-size: .8rem; max-height: 28rem; overflow: auto; background: #18181b; color: #e4e4e7; border-radius: .5rem; padding: .75rem; }

/* TMDB run log */
.adm-log { white-space: pre-wrap; word-break: break-word; max-height: 32rem; overflow: auto; background: #18181b; color: #e4e4e7; border-radius: 0 0 .5rem .5rem; }
/* /admin/worker: the job column keeps room for its description. */
.adm-job { min-width: 13rem; }
.adm-job-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .25rem; min-width: 6.5rem; }
.adm-job-actions form { display: inline; }
.adm-job-when { min-width: 9.5rem; }
.adm-spark { display: inline-block; vertical-align: middle; overflow: visible; }

/* Services (/admin/services) */
.adm-svc-stats { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1.25rem; font-size: .85rem; color: var(--g-text-2); }
.adm-svc-stats b { color: var(--g-text); }
.adm-svc-stats a { text-decoration: none; }
.adm-svc-tabs .nav-link { padding: .4rem .75rem; font-size: .875rem; }
.adm-svc-tabs .badge { font-weight: 500; }
.adm-svc-table .form-control-sm, .adm-svc-table .form-select-sm { min-width: 7rem; }
.adm-svc-kind { width: 9rem; }
.adm-svc-add > td { background: #fbfbfa; border-bottom: 0; }
.adm-svc-logo { width: 22px; height: 22px; vertical-align: middle; object-fit: cover; }
.adm-svc-logo-none { display: inline-block; border-radius: .375rem; background: var(--g-line); }
.adm-chip { --bs-btn-padding-y: .1rem; --bs-btn-padding-x: .5rem; border: 1px solid var(--g-line); border-radius: 999px; }
.adm-svc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem .75rem .25rem; }
.adm-svc-search { position: relative; display: flex; align-items: center; gap: .5rem; }
.adm-svc-search .bi-search { position: absolute; left: .55rem; color: var(--g-faint); font-size: .8rem; pointer-events: none; }
.adm-svc-search input { padding-left: 1.7rem; width: 13rem; }
.adm-svc-note { margin: 0; padding: 0 .75rem .6rem; font-size: .8rem; color: var(--g-muted); }
.adm-svc-check { width: 2rem; text-align: center; }
.adm-svc-name { min-width: 9rem; max-width: 16rem; }
.adm-svc-off .adm-svc-name, .adm-svc-off .form-select { color: var(--g-muted); }
.adm-svc-off .adm-svc-logo { opacity: .55; }
.adm-svc-savebar { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem .75rem; background: #fff; border-top: 1px solid var(--g-line); border-radius: 0 0 var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius); box-shadow: 0 -4px 10px rgba(0,0,0,.04); }
.adm-svc-scroll { max-height: 22rem; overflow-y: auto; }

/* Title editor (/admin/titles/{id}) */
.adm-hero { position: relative; overflow: hidden; border-radius: .5rem; color: #fff; background: linear-gradient(135deg, hsl(var(--h) 12% 20%), #18181b); }
.adm-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; opacity: .35; filter: saturate(.9); }
.adm-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,12,20,.92) 0%, rgba(10,12,20,.65) 55%, rgba(10,12,20,.35) 100%); pointer-events: none; }
.adm-hero-body, .adm-hero-stats { position: relative; z-index: 1; }
.adm-hero-body { display: flex; gap: 1.25rem; padding: 1.25rem 1.25rem 1rem; align-items: flex-start; }
.adm-hero-poster { flex: 0 0 110px; aspect-ratio: 2 / 3; border-radius: .5rem; overflow: hidden; background: hsl(var(--h) 55% 38%); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.adm-hero-poster img { width: 100%; height: 100%; object-fit: cover; }
.adm-hero-poster span { font-size: 1.75rem; font-weight: 700; letter-spacing: .04em; opacity: .9; }
.adm-hero-main { flex: 1 1 auto; min-width: 0; }
.adm-hero-title { font-size: 1.6rem; font-weight: 700; margin: 0; line-height: 1.2; }
.adm-hero-year { font-weight: 400; opacity: .6; }
.adm-hero-meta { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin-top: .35rem; font-size: .875rem; opacity: .85; }
.adm-hero-meta > span + span::before { content: "·"; margin-right: .9rem; opacity: .6; margin-left: -.45rem; }
.adm-hero-tagline { margin: .6rem 0 0; font-style: italic; opacity: .75; font-size: .9rem; }
.adm-hero-chip { background: rgba(255,255,255,.14); color: #fff; font-weight: 500; }
.adm-hero-actions { display: flex; flex-direction: column; gap: .4rem; align-items: stretch; }
.adm-cert { border: 1px solid rgba(255,255,255,.55); border-radius: .25rem; padding: 0 .3rem; font-size: .78rem; }
.adm-genre, .adm-keyword { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; background: var(--g-hover); color: var(--g-text-2); border: 1px solid var(--g-line); }
.adm-hero .adm-genre { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; }
.adm-keyword { background: #fff; color: var(--g-muted); }
.adm-hero-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; border-top: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.25); }
.adm-hero-stats > div { padding: .55rem 1rem; border-right: 1px solid rgba(255,255,255,.08); }
.adm-hero-stats > div:last-child { border-right: 0; }
.adm-hero-stats dt { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .6; }
.adm-hero-stats dd { margin: 0; font-size: 1.05rem; font-weight: 600; }
.adm-hero-stats small { font-weight: 400; opacity: .6; font-size: .75rem; }
@media (max-width: 767.98px) {
  .adm-hero-body { flex-wrap: wrap; }
  .adm-hero-poster { flex-basis: 76px; }
  .adm-hero-title { font-size: 1.25rem; }
  .adm-hero-actions { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .adm-hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.adm-title-tabs .nav-link { font-size: .875rem; padding: .45rem .8rem; color: var(--g-text-2); }
.adm-title-tabs .nav-link.active { color: var(--g-text); font-weight: 600; }
.adm-title-tabs .nav-link .bi { opacity: .7; }
.adm-hint { display: flex; gap: .5rem; align-items: flex-start; font-size: .82rem; color: var(--g-text-2); background: #fbfbfa; border: 1px solid var(--g-line); border-radius: .5rem; padding: .5rem .75rem; }
.adm-hint-warn { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.adm-genre-toggle { --bs-btn-padding-y: .15rem; --bs-btn-padding-x: .6rem; border-radius: 999px; font-size: .8rem; }
.adm-facts { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; font-size: .84rem; }
.adm-facts dt { color: var(--g-muted); font-weight: 500; white-space: nowrap; }
.adm-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.adm-side-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--g-muted); margin-bottom: .35rem; }
.adm-idlink { --bs-btn-padding-y: .1rem; --bs-btn-padding-x: .5rem; font-size: .78rem; }
.adm-idlink .bi { font-size: .7rem; }
.adm-company-logo { max-height: 26px; max-width: 90px; object-fit: contain; }
.adm-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .75rem 1.25rem; margin: 0; }
.adm-roles dt { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--g-muted); }
.adm-roles dd { margin: 0; font-size: .9rem; }
.adm-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: .6rem; }
.adm-person { display: flex; gap: .6rem; align-items: center; padding: .4rem; border-radius: .5rem; border: 1px solid var(--g-line); }
.adm-person img, .adm-person-none { flex: 0 0 44px; width: 44px; height: 56px; border-radius: .35rem; object-fit: cover; }
.adm-person-none { display: grid; place-items: center; color: #fff; font-weight: 700; background: hsl(var(--h) 35% 55%); }
.adm-person-name { display: block; font-weight: 600; font-size: .86rem; color: var(--g-text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.adm-person-name:hover { text-decoration: underline; }
.adm-person-role { font-size: .8rem; color: var(--g-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-person-meta { font-size: .72rem; color: var(--g-faint); }
.adm-dept > th { background: #fbfbfa; font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--g-muted); }
.adm-link-logo { width: 56px; height: 28px; object-fit: contain; background: #fbfbfa; border-radius: 4px; padding: 2px; }
.adm-link-logo-lg { width: 120px; height: 56px; }
a.adm-keyword { text-decoration: none; }
a.adm-keyword:hover { border-color: var(--g-faint); color: var(--g-text); }

.adm-season > summary { list-style: none; cursor: pointer; }
.adm-season > summary::-webkit-details-marker { display: none; }
.adm-season[open] > summary { border-bottom: 1px solid var(--g-line); }
.adm-still { width: 72px; height: 40px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.adm-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.adm-clamp-4 { -webkit-line-clamp: 4; }

/* TMDB bulk import */
.adm-bulk-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .75rem; }
.adm-bulk-filters label { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: var(--g-muted); }
.adm-bulk-filters .form-control, .adm-bulk-filters .form-select { min-width: 9rem; }
.adm-bulk-table td { vertical-align: top; }
.adm-bulk-table .adm-bulk-title { min-width: 11rem; }
.adm-bulk-table td:nth-child(6) { min-width: 18rem; max-width: 36rem; }

.adm-imgs { display: grid; gap: .75rem; }
.adm-imgs-posters, .adm-imgs-logos { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.adm-imgs-backdrops { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.adm-img { margin: 0; border-radius: .5rem; border: 1px solid var(--g-line); overflow: hidden; background: #fbfbfa; }
.adm-img img { display: block; width: 100%; height: auto; }
.adm-imgs-posters .adm-img img { aspect-ratio: 2 / 3; object-fit: cover; }
.adm-imgs-backdrops .adm-img img { aspect-ratio: 16 / 9; object-fit: cover; }
.adm-imgs-logos .adm-img img { aspect-ratio: 2 / 1; object-fit: contain; padding: .5rem; background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 50% / 14px 14px; }
.adm-img figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .25rem; padding: .35rem .45rem; font-size: .72rem; color: var(--g-muted); }
.adm-img.is-current { border-color: var(--g-ok); box-shadow: 0 0 0 2px rgba(21,128,61,.2); }

/* Title editor: Overview, Edit */
/* One column until the tab area itself is wide enough for two (not the window). */
.adm-title-main { container-type: inline-size; }
.adm-ov { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.adm-ov > .card { margin: 0; }
.adm-ov > .adm-ov-wide { grid-column: 1 / -1; }
@container (min-width: 760px) { .adm-ov { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.adm-title-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.adm-title-tabs .nav-link { white-space: nowrap; }
.adm-grid-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .8rem 1.25rem; }
.adm-grid-facts dt { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--g-muted); }
.adm-grid-facts dd { margin: .1rem 0 0; font-size: .9rem; }
.adm-hero-orig { font-size: .9rem; opacity: .7; margin-top: .1rem; }
.adm-cert-dark { display: inline-block; border: 1px solid var(--g-faint); border-radius: .25rem; padding: 0 .35rem; font-size: .78rem; font-weight: 600; color: var(--g-text-2); }
.adm-company { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .55rem .2rem .25rem; border: 1px solid var(--g-line); border-radius: .5rem; font-size: .82rem; color: var(--g-text-2); text-decoration: none; }
a.adm-company:hover { border-color: var(--g-faint); color: var(--g-text); }
.adm-company .adm-company-logo { max-height: 22px; max-width: 64px; }
.adm-legend { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--g-text-2); padding-bottom: .35rem; margin-bottom: .75rem; border-bottom: 1px solid var(--g-line); width: 100%; }
.adm-lock { font-weight: 500; font-size: .75rem; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 999px; padding: 0 .45rem; margin-left: .35rem; white-space: nowrap; }
.adm-lock .btn-link { font-size: .75rem; color: #92400e; text-decoration: underline; }
.adm-edit .adm-svc-savebar, .card > .adm-svc-savebar { border-radius: 0 0 .375rem .375rem; }
.adm-title-form > .adm-svc-savebar { border-top: 0; border-radius: .375rem; }
.adm-title-side { position: sticky; top: 1rem; }
@media (max-width: 1199.98px) { .adm-title-side { position: static; } }

/* Categories (/admin/categories). Each row sets --h, its hue. */
.adm-cats { list-style: none; margin: 0; padding: 0; }
.adm-cat { display: flex; background: #fff; }
.adm-cats > .adm-cat + .adm-cat { border-top: 1px solid var(--g-line); }
.adm-cat-order { flex: 0 0 2.75rem; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: .55rem 0; background: #fbfbfa; border-right: 1px solid var(--g-line); }
.adm-cat-move { --bs-btn-padding-y: 0; --bs-btn-padding-x: .35rem; --bs-btn-border-color: transparent; --bs-btn-hover-bg: var(--g-line); --bs-btn-disabled-border-color: transparent; color: var(--g-muted); line-height: 1.3; }
.adm-cat-move:disabled { opacity: .25; }
.adm-cat-pos { font-size: .72rem; font-weight: 700; color: var(--g-faint); font-variant-numeric: tabular-nums; line-height: 1.4; }
.adm-cat-main { flex: 1 1 auto; min-width: 0; }
.adm-cat-sum { display: flex; align-items: center; gap: .85rem; padding: .8rem 1rem; cursor: pointer; list-style: none; transition: background .12s; }
.adm-cat-sum::-webkit-details-marker { display: none; }
.adm-cat-sum:hover { background: #fbfbfa; }
.adm-cat-sum:focus-visible { outline: 2px solid hsl(var(--h) 60% 45%); outline-offset: -2px; }
.adm-cat-main[open] > .adm-cat-sum { background: #fbfbfa; border-bottom: 1px solid var(--g-line); }
.adm-cat-tile { flex: 0 0 2rem; height: 2rem; border-radius: .375rem; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: .9rem; background: hsl(var(--h) 55% 45%); }
.adm-cat-tile-new { background: #fff; color: var(--g-muted); border: 1px dashed var(--g-line-strong); }
.adm-cat-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.adm-cat-name { font-weight: 600; color: var(--g-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-cat-slug { font-weight: 400; font-size: .78rem; color: var(--g-faint); margin-left: .35rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.adm-cat-blurb { font-size: .84rem; color: var(--g-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-cat-count { flex-shrink: 0; font-size: .8rem; color: var(--g-text-2); text-decoration: none; padding: .2rem .6rem; border-radius: 999px; background: #fff; border: 1px solid var(--g-line); white-space: nowrap; }
.adm-cat-count:hover { border-color: var(--g-faint); color: var(--g-text); }
.adm-cat-count b { color: var(--g-text); font-variant-numeric: tabular-nums; }
.adm-cat-toggle { flex-shrink: 0; display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; color: var(--g-muted); }
.adm-cat-toggle .bi { transition: transform .15s; }
.adm-cat-main[open] .adm-cat-toggle .bi { transform: rotate(180deg); }
.adm-cat-main[open] .adm-cat-toggle-label { visibility: hidden; }
.adm-cat-body { padding: 1rem 1rem .9rem; }
.adm-cat-colour { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.adm-cat-colour .adm-hue-range { flex: 1 1 14rem; max-width: 26rem; }
.adm-cat-pill { display: inline-block; max-width: 14rem; padding: .2rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600; color: #fff; background: hsl(var(--h) 60% 45%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-cat-pill:empty::before { content: "Preview"; opacity: .8; }
.adm-cat-hueval { font-size: .75rem; color: var(--g-faint); font-variant-numeric: tabular-nums; }
.adm-cat-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--g-line); }
.adm-cat-del { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.adm-cat-del .form-select { width: auto; max-width: 15rem; }
.adm-hue-range::-webkit-slider-runnable-track { height: .55rem; border-radius: 999px; background: linear-gradient(to right, hsl(0 60% 45%), hsl(60 60% 45%), hsl(120 60% 45%), hsl(180 60% 45%), hsl(240 60% 45%), hsl(300 60% 45%), hsl(359 60% 45%)); }
.adm-hue-range::-moz-range-track { height: .55rem; border-radius: 999px; background: linear-gradient(to right, hsl(0 60% 45%), hsl(60 60% 45%), hsl(120 60% 45%), hsl(180 60% 45%), hsl(240 60% 45%), hsl(300 60% 45%), hsl(359 60% 45%)); }
.adm-hue-range::-webkit-slider-thumb { width: 1.3rem; height: 1.3rem; margin-top: -.375rem; background: hsl(var(--h, 210) 60% 45%); border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2), 0 1px 4px rgba(0,0,0,.25); }
.adm-hue-range::-moz-range-thumb { width: 1.3rem; height: 1.3rem; background: hsl(var(--h, 210) 60% 45%); border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2), 0 1px 4px rgba(0,0,0,.25); }
.adm-hue-range:active::-webkit-slider-thumb { background: hsl(var(--h, 210) 60% 45%); }
.adm-hue-range:active::-moz-range-thumb { background: hsl(var(--h, 210) 60% 45%); }
@media (max-width: 575.98px) {
    .adm-cat-slug, .adm-cat-toggle-label { display: none; }
    .adm-cat-sum { gap: .6rem; padding: .7rem .75rem; }
}

/* ---- Article editor: SEO panel (articles/_seo.php, seo.js) ---- */
.adm-seo { --seo-state: var(--g-faint); }
.adm-seo .is-good, .adm-seo-mini.is-good, .adm-seo-badge.is-good { --seo-state: var(--g-ok); }
.adm-seo .is-ok, .adm-seo-mini.is-ok, .adm-seo-badge.is-ok { --seo-state: var(--g-warn); }
.adm-seo .is-bad, .adm-seo-mini.is-bad, .adm-seo-badge.is-bad { --seo-state: var(--g-bad); }
.adm-seo-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--seo-state, var(--g-faint)); flex: none; }
.adm-seo-badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; color: var(--g-text-2); }
.adm-seo-badge .adm-seo-dot { background: var(--seo-state); }
.adm-seo-mini { display: flex; align-items: center; gap: .45rem; padding: .45rem .6rem; border: 1px solid var(--g-line); border-radius: var(--bs-border-radius); color: var(--g-text); text-decoration: none; font-size: .8125rem; }
.adm-seo-mini:hover { background: var(--g-hover); color: var(--g-text); }
.adm-seo-mini .adm-seo-dot { background: var(--seo-state); }

.adm-seo-meter { height: 4px; margin-top: .35rem; border-radius: 2px; background: var(--g-line); overflow: hidden; }
.adm-seo-meter > span { display: block; height: 100%; width: 0; background: var(--seo-state); transition: width .2s, background-color .2s; }

.adm-seo-serp { padding: .9rem 1rem; border: 1px solid var(--g-line); border-radius: .5rem; background: #fff; font-family: Arial, sans-serif; max-width: 600px; }
.adm-seo-serp[data-device="mobile"] { max-width: 400px; }
.adm-seo-serp-site { display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; font-size: 14px; line-height: 1.3; color: #202124; }
.adm-seo-serp-site > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.adm-seo-serp-fav { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #f1f3f4; color: var(--g-ember); font-size: 14px; flex: none; }
.adm-seo-serp-url { font-size: 12px; color: #4d5156; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-seo-serp-title { font-size: 20px; line-height: 1.3; color: #1a0dab; margin-bottom: .2rem; overflow-wrap: anywhere; }
.adm-seo-serp[data-device="mobile"] .adm-seo-serp-title { font-size: 18px; }
.adm-seo-serp-desc { font-size: 14px; line-height: 1.58; color: #4d5156; overflow-wrap: anywhere; }
.adm-seo-serp-desc b { color: #202124; font-weight: 700; }
.adm-seo-serp-date { color: #70757a; }

.adm-seo-tabs .nav-link { font-size: .8125rem; padding: .4rem .75rem; }
.adm-seo-tabcount:not(:empty) { display: inline-block; min-width: 1.2rem; margin-left: .25rem; padding: 0 .3rem; border-radius: 1rem; font-size: .6875rem; line-height: 1.2rem; text-align: center; color: #fff; background: var(--g-faint); }
.adm-seo-tabcount.is-ok { background: var(--g-warn); }
.adm-seo-tabcount.is-bad { background: var(--g-bad); }

.adm-seo-checks { list-style: none; margin: 0; padding: 0; }
.adm-seo-check { display: flex; align-items: flex-start; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid var(--g-line); font-size: .8125rem; line-height: 1.45; }
.adm-seo-check:last-child { border-bottom: 0; }
.adm-seo-check > i { color: var(--seo-state); margin-top: .1rem; }
.adm-seo-go { font-size: .75rem; flex: none; }

.adm-seo-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.adm-seo-stat { padding: .5rem .6rem; border: 1px solid var(--g-line); border-radius: var(--bs-border-radius); }
.adm-seo-stat span { display: block; font-weight: 600; font-size: 1rem; font-variant-numeric: tabular-nums; }
.adm-seo-stat small { color: var(--g-muted); font-size: .7rem; }
.adm-seo-phrases td, .adm-seo-phrases th { padding: .2rem .35rem; }
.adm-seo-outline { list-style: none; padding: 0; margin: 0; font-size: .8125rem; }
.adm-seo-outline li { padding: .15rem 0; border-left: 2px solid var(--g-line); padding-left: .5rem; }
.adm-seo-outline li.is-h1 { font-weight: 600; border-left-color: var(--g-text); }
.adm-seo-outline li.is-h2 { margin-left: .75rem; }
.adm-seo-outline li.is-h3 { margin-left: 1.5rem; color: var(--g-text-2); }
.adm-seo-links { list-style: none; padding: 0; margin: 0; font-size: .8125rem; }
.adm-seo-links li { padding: .15rem 0; }

.adm-seo-social { display: flex; flex-direction: column; max-width: 500px; border: 1px solid var(--g-line); border-radius: .5rem; overflow: hidden; background: #fff; }
.adm-seo-social-img { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; aspect-ratio: 1200 / 630; background: var(--g-hover); color: var(--g-faint); font-size: .75rem; }
.adm-seo-social-img i { font-size: 1.75rem; }
.adm-seo-social-img img { width: 100%; height: 100%; object-fit: cover; }
.adm-seo-social-body { padding: .6rem .8rem; border-top: 1px solid var(--g-line); background: #f7f7f6; }
.adm-seo-social-host { font-size: .6875rem; color: var(--g-muted); letter-spacing: .02em; }
.adm-seo-social-title { font-weight: 600; font-size: .9375rem; line-height: 1.3; margin: .1rem 0; overflow-wrap: anywhere; }
.adm-seo-social-desc { font-size: .8125rem; color: var(--g-muted); overflow-wrap: anywhere; }
.adm-seo-opt { padding: .6rem .8rem; border: 1px solid var(--g-line); border-left: 3px solid var(--g-ok); border-radius: var(--bs-border-radius); background: var(--g-hover); font-size: .8125rem; }
.adm-seo-opt .adm-seo-check { padding: .3rem 0; }
.adm-seo-ai { border-left-color: var(--bs-primary, #0d6efd); }
.adm-seo-ai .btn-outline-secondary { font-size: .8125rem; background: #fff; color: var(--g-text); }
.adm-seo-ai .btn-outline-secondary.active { background: var(--g-hover); border-color: var(--g-ok); color: var(--g-text); box-shadow: inset 3px 0 0 var(--g-ok); }
.adm-seo-ai-note { color: var(--seo-state); }
.adm-seo-ai-note.is-good { --seo-state: var(--g-ok); }
.adm-seo-ai-note.is-ok { --seo-state: var(--g-warn); }

/* AI writing helpers (partials/ai_write.php) and the person biography card. */
.adm-ai-item { font-size: .8125rem; background: #fff; color: var(--g-text); }
.adm-ai-item.active { background: var(--g-hover); border-color: var(--g-ok); color: var(--g-text); box-shadow: inset 3px 0 0 var(--g-ok); }
.adm-ai-check { font-size: .75rem; padding: .35rem .55rem; border-radius: var(--bs-border-radius); border: 1px solid var(--g-line); border-left: 3px solid var(--seo-state); background: var(--g-hover); }
.adm-ai-check.is-good { --seo-state: var(--g-ok); }
.adm-ai-check.is-ok { --seo-state: var(--g-warn); }
.adm-ai-check.is-bad { --seo-state: var(--g-bad); }
.adm-ai-check > .d-flex > .bi { color: var(--seo-state); }
.adm-bio-read { max-height: 16rem; overflow-y: auto; white-space: normal; }

/* "Write with AI" under the article body (articles/_body_ai.php). */
.adm-body-ai { border: 1px solid var(--g-line); border-radius: var(--bs-border-radius); padding: .5rem .75rem; background: var(--g-hover); }
.adm-body-ai > summary { cursor: pointer; }
.adm-body-ai-result { border: 1px solid var(--g-line); border-radius: var(--bs-border-radius); padding: .6rem .75rem; background: #fff; font-size: .8125rem; }
.adm-body-ai-preview { max-height: 22rem; overflow-y: auto; padding: .5rem .75rem; border-left: 3px solid var(--g-line); }
.adm-body-ai-badge { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; padding: .1rem .45rem; border-radius: 999px; border: 1px solid var(--g-line); }
.adm-body-ai-badge.is-good { --seo-state: var(--g-ok); }
.adm-body-ai-badge.is-ok { --seo-state: var(--g-warn); }
.adm-body-ai-badge .bi { color: var(--seo-state); }

/* AI advice on /admin/reviews (review-ai.js). */
.adm-review-ai { margin-top: .4rem; font-size: .8125rem; }
.adm-review-ai-box { border: 1px solid var(--g-line); border-left: 3px solid var(--seo-state, var(--g-line)); border-radius: var(--bs-border-radius); padding: .4rem .6rem; background: var(--g-hover); color: var(--g-text); }
.adm-review-ai-box.is-approve { --seo-state: var(--g-ok); }
.adm-review-ai-box.is-spoilers { --seo-state: var(--g-warn); }
.adm-review-ai-box.is-hide { --seo-state: var(--g-warn); }
.adm-review-ai-box.is-delete { --seo-state: var(--g-bad); }
.adm-review-ai-box mark { background: rgba(255, 193, 7, .25); padding: 0 .1rem; }
.adm-review-ai-pulse { outline: 2px solid var(--g-bad); outline-offset: 2px; border-radius: var(--bs-border-radius); }

/* Article editor: featured image card */
.adm-fi { display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--g-line); border-radius: var(--bs-border-radius); background: var(--g-hover); }
.adm-fi img { width: 100%; height: 100%; object-fit: cover; }
.adm-fi.is-empty { border-style: dashed; }
.adm-fi span { display: flex; flex-direction: column; align-items: center; gap: .25rem; font-size: .8125rem; color: var(--g-muted); }
.adm-fi span .bi { font-size: 1.5rem; }
.adm-fi-path { font-size: .75rem; color: var(--g-muted); }

/* ---------- Ads (/admin/ads) ---------- */
/* Served-per-day bars: one <span> per day, height set inline. */
.adm-adbars { display: flex; align-items: flex-end; gap: 3px; height: 48px; }
.adm-adbars span { flex: 1; min-height: 2px; border-radius: 2px 2px 0 0; background: #f0a375; }
.adm-adbars span:last-child { background: #e8631a; }
/* Placements: a sketch of each page with its slots. */
.adm-wf { display: grid; gap: 4px; font-size: .6875rem; }
.adm-wf-block { padding: 4px 8px; border-radius: 4px; background: var(--g-hover); color: var(--g-muted); }
.adm-wf-ad {
    display: block; padding: 5px 8px; border-radius: 4px; border: 1.5px dashed #e8631a; background: #fff4ec;
    color: #9a3d0b; font-weight: 600; text-decoration: none;
}
.adm-wf-ad b { display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; margin-right: 2px; border-radius: 50%; background: #e8631a; color: #fff; font-size: .625rem; }
.adm-wf-ad.is-live { border-style: solid; background: #e8f6ee; border-color: #198754; color: #0f5132; }
.adm-wf-ad.is-live b { background: #198754; }
.adm-wf-ad:hover { filter: brightness(.97); }
.adm-wf-split { display: grid; grid-template-columns: minmax(0, 1fr) 36%; gap: 4px; }
.adm-wf-col { display: grid; gap: 4px; align-content: start; }
.adm-wf-side .adm-wf-block { background: #f1f1ef; }

/* Search Console (/admin/seo): clicks and impressions, each on its own scale. */
.adm-gsc-chart { display: block; width: 100%; height: 180px; overflow: visible; }
.adm-gsc-chart polyline { fill: none; stroke-width: 2; stroke-linejoin: round; }
.adm-gsc-chart polyline.adm-gsc-clicks { stroke: var(--g-info); }
.adm-gsc-chart polyline.adm-gsc-impr { stroke: #7c3aed; opacity: .75; }
.adm-gsc-chart rect { fill: transparent; }
.adm-gsc-chart rect:hover { fill: var(--g-hover); }
.adm-gsc-key { display: inline-block; width: .75rem; height: .2rem; border-radius: 1px; margin-right: .35rem; vertical-align: middle; }
.adm-gsc-key.adm-gsc-clicks { background: var(--g-info); }
.adm-gsc-key.adm-gsc-impr { background: #7c3aed; }
.adm-gsc-cell { max-width: 28rem; min-width: 12rem; word-break: break-word; }
.adm-gsc-spark { display: block; width: 100%; height: 40px; }
.adm-gsc-spark polyline { fill: none; stroke: var(--g-info); stroke-width: 1.5; stroke-linejoin: round; }

/* Page speed (/admin/seo/speed): Google's good / needs-improvement / poor bands. */
.adm-rate-good { color: var(--g-ok); }
.adm-rate-ni { color: var(--g-warn); }
.adm-rate-poor { color: var(--g-bad); }
.adm-rate-none { color: var(--g-muted); }
.adm-rate { font-variant-numeric: tabular-nums; font-weight: 600; }
.adm-score { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 3px solid currentColor; font-weight: 700; font-variant-numeric: tabular-nums; }
.adm-perf-table tr:has(+ .adm-perf-more) td { border-bottom: 0; }
.adm-perf-trend { display: block; width: 100%; height: 60px; overflow: visible; }
.adm-perf-trend polyline { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.adm-perf-trend line { stroke: var(--g-line-strong); stroke-width: 1; stroke-dasharray: 4 3; }

/* ============================================================
   Box office: the day's round on the list, the day-by-day table
   on a film's page (/admin/box-office).
   ============================================================ */
.bo-round { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.bo-round.is-due { box-shadow: inset 3px 0 0 var(--bs-warning); }
.bo-round__film { min-width: 12rem; flex: 1 1 14rem; }
.bo-round__form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.bo-round__day { min-width: 9.5rem; font-size: .875rem; }
.bo-round__amt { width: 13rem; }
.bo-days { max-height: 70vh; overflow-y: auto; }
.bo-days thead th { position: sticky; top: 0; z-index: 1; }
.bo-days .bd-amt { min-width: 6rem; }
.bo-days tr.bd-weekend > td { background: rgba(255, 193, 7, .08); }
.bo-days .bd-total { color: var(--g-muted); }
@media (max-width: 575.98px) {
    .bo-round__form, .bo-round__amt { width: 100%; }
}
.bo-days .bd-day { min-width: 4.25rem; }
