/* SRV-Files — modern Bootstrap 2, light.
 *
 * Keeps BS2's skeleton: 4px radii, bordered white panels on light gray,
 * striped tables, pill labels, dark navbar, #0088cc blue.
 * Drops the era's surface: every gradient, text-shadow and inset bevel.
 *
 * Exactly three shadows exist in this file (modal, popover, bulk bar).
 * That restraint is what separates "modern BS2" from "BS2 cosplay".
 */

:root {
    /* surfaces */
    --c-page: #f2f4f6;
    --c-surface: #fff;
    --c-subtle: #f7f8fa;
    --c-sunken: #eceff3;
    --c-stripe: #f8f9fa;
    --c-hover: #eef4f9;
    --c-selected: #dceefa;
    --c-selected-hov: #cfe7f8;
    --c-video-stage: #101418;

    /* borders */
    --c-border: #d6dbe0;
    --c-border-hair: #e7eaee;
    --c-border-control: #8a94a1;
    --c-border-strong: #b3bcc6;

    /* text */
    --c-text: #1f2933;
    --c-text-muted: #5b6672;
    --c-text-hint: #6b7684;
    --c-text-dis: #8a949f;

    /* blue: fill vs text are split because #0088cc fails AA as text */
    --c-blue: #0088cc;
    --c-blue-hover: #0077b3;
    --c-blue-active: #069;
    --c-link: #0077b3;
    --c-link-strong: #005f92;
    --c-link-hover: #005580;
    --c-blue-bg: #e6f4fb;
    --c-blue-border: #a8d8ef;
    --c-blue-text: #0b5f8a;

    --c-success: #2f8132;
    --c-success-hover: #276b2a;
    --c-success-bg: #eaf6ea;
    --c-success-border: #b7dfb7;
    --c-success-text: #22702a;

    /* amber is a fill only: white on it is 3.18:1 */
    --c-warning: #d97706;
    --c-warning-bg: #fdf3e3;
    --c-warning-border: #f0d5a8;
    --c-warning-text: #8a5300;

    --c-danger: #c0392b;
    --c-danger-hover: #a32d22;
    --c-danger-active: #8c2419;
    --c-danger-bg: #fdeeec;
    --c-danger-border: #f2bdb7;
    --c-danger-text: #a02318;

    --c-nav-bg: #2b3138;
    --c-nav-bg-hover: #343b43;
    --c-nav-bg-active: #20252b;
    --c-nav-border: #1c2126;
    --c-nav-text: #c9d1d9;
    --c-nav-rule: #4a525b;
    --c-nav-focus: #79c0ff;

    --c-chip-bg: #f0f2f5;
    --c-chip-border: #dfe3e8;
    --c-chip-text: #4a5561;

    --c-backdrop: rgba(20, 26, 32, .45);
    --sh-modal: 0 8px 24px rgba(16, 22, 28, .18);
    --sh-popover: 0 4px 12px rgba(16, 22, 28, .14);
    --sh-bulkbar: 0 -2px 8px rgba(16, 22, 28, .10);

    --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Liberation Sans", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;

    --sp-1: 2px;  --sp-2: 4px;  --sp-3: 6px;  --sp-4: 8px;
    --sp-5: 12px; --sp-6: 16px; --sp-7: 20px; --sp-8: 24px;
    --sp-9: 32px; --sp-10: 40px;

    --r-sm: 3px; --r: 4px; --r-lg: 6px; --r-pill: 10px;

    --w-page: 1680px;
    --w-sidebar: 240px;
    --h-navbar: 48px;

    --z-thead: 2; --z-bulkbar: 50; --z-navbar: 100;
    --z-backdrop: 1000; --z-modal: 1001;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 14px;
    line-height: 20px;
    scroll-padding-top: 88px;
}

body {
    margin: 0;
    background: var(--c-page);
    color: var(--c-text);
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 20px;
}

a { color: var(--c-link); text-decoration: none; }
a:hover { color: var(--c-link-hover); text-decoration: underline; }

h1 { font-size: 22px; line-height: 30px; font-weight: 600; margin: 0 0 var(--sp-7); }
h2 { font-size: 18px; line-height: 26px; font-weight: 600; margin: 0 0 var(--sp-6); }

/* :focus-visible, so a mouse click never rings but the keyboard always does.
   The offset puts the ring outside the control, where it is judged against the
   page background — one ring colour then works on every variant. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--c-blue);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ── navbar ──────────────────────────────────────────────────────────── */

.topbar {
    position: sticky;
    top: 0;
    z-index: var(--z-navbar);
    display: flex;
    align-items: center;
    gap: var(--sp-6);
    height: var(--h-navbar);
    padding: 0 var(--sp-7);
    background: var(--c-nav-bg);
    border-bottom: 1px solid var(--c-nav-border);
}

.topbar :focus-visible { outline-color: var(--c-nav-focus); outline-offset: -2px; }

.brand { font-size: 16px; font-weight: 600; color: #fff; margin-right: var(--sp-4); }
.brand:hover { color: #fff; text-decoration: none; }

.topbar nav { display: flex; }

.topbar nav a {
    padding: 0 12px;
    line-height: var(--h-navbar);
    font-size: 14px;
    font-weight: 500;
    color: var(--c-nav-text);
    border-bottom: 2px solid transparent;
}

.topbar nav a:hover { color: #fff; background: var(--c-nav-bg-hover); text-decoration: none; }

.topbar nav a[aria-current="page"] {
    color: #fff;
    background: var(--c-nav-bg-active);
    border-bottom-color: var(--c-blue);
}

.topbar .user { margin-left: auto; display: flex; align-items: center; gap: var(--sp-5); }
.topbar .login { font-size: 13px; color: var(--c-nav-text); }
.topbar .user a { color: var(--c-nav-text); font-size: 13px; }
.topbar .user a:hover { color: #fff; }

.role {
    font-size: 11px;
    font-weight: 500;
    padding: 1px 8px;
    border-radius: var(--r-pill);
    border: 1px solid var(--c-nav-rule);
    color: var(--c-nav-text);
}

/* The only warm colour in the navbar: an operator should always be able to see
   whether they can currently destroy data. */
.role-admin { border-color: #d9a441; color: #f0c674; }
.role-root { border-color: #e8837a; color: #ffb3ab; }

/* ── layout ──────────────────────────────────────────────────────────── */

main { max-width: var(--w-page); margin: 0 auto; padding: var(--sp-7); }

/* minmax(0,1fr) is required or a dense table blows the grid out */
.split { display: grid; grid-template-columns: var(--w-sidebar) minmax(0, 1fr); gap: var(--sp-7); }

.sidebar {
    position: sticky;
    top: calc(var(--h-navbar) + var(--sp-7));
    max-height: calc(100vh - var(--h-navbar) - var(--sp-10));
    overflow-y: auto;
}

.sidebar-group {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--c-text-muted);
    padding: 10px 12px 4px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: 5px 12px;
    font-size: 13px;
    color: var(--c-text);
}

.sidebar a:hover { background: #f0f4f8; text-decoration: none; }
.sidebar a[aria-current="page"] { background: var(--c-blue-bg); box-shadow: inset 3px 0 0 var(--c-blue); }
.sidebar a .n { margin-left: auto; font-size: 11px; color: var(--c-text-muted); font-variant-numeric: tabular-nums; }

/* ── panel / well ────────────────────────────────────────────────────── */

.panel {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    margin-bottom: var(--sp-7);
}

.panel--clip { overflow: hidden; }

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-5);
    padding: 12px var(--sp-6);
    background: var(--c-subtle);
    border-bottom: 1px solid var(--c-border-hair);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    font-size: 14px;
    font-weight: 500;
}

.panel-body { padding: var(--sp-6) var(--sp-7); }
.panel-body--flush { padding: 0; }

.panel-foot {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: 12px var(--sp-6);
    background: var(--c-subtle);
    border-top: 1px solid var(--c-border-hair);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.well {
    background: var(--c-subtle);
    border: 1px solid var(--c-border-hair);
    border-radius: var(--r-lg);
    padding: var(--sp-6) var(--sp-7);
}

.well-sm { padding: 10px 12px; border-radius: var(--r); }

/* ── stat tiles ──────────────────────────────────────────────────────── */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); margin-bottom: var(--sp-7); }
.stat { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 14px var(--sp-6); }
.stat-label { font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--c-text-muted); margin-bottom: 6px; }
.stat-value { font-size: 24px; line-height: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-value.is-bad { color: var(--c-danger-text); }
.stat-sub { font-size: 12px; color: var(--c-text-muted); margin-top: 4px; }

/* ── buttons ─────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    color: #24303c;
    background: var(--c-surface);
    background-image: none;
    border: 1px solid var(--c-border-control);
    border-radius: var(--r);
    text-shadow: none;
    box-shadow: none;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: background-color .12s ease, border-color .12s ease;
}

.btn:hover { background: #f2f4f6; border-color: var(--c-border-strong); color: #24303c; text-decoration: none; }
.btn:active { background: #e8ecf0; }

.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--c-blue); border-color: var(--c-blue-hover); color: #fff; }
.btn-primary:hover { background: var(--c-blue-hover); border-color: var(--c-blue-hover); color: #fff; }
.btn-primary:active { background: var(--c-blue-active); }

.btn-danger { background: var(--c-danger); border-color: var(--c-danger-hover); color: #fff; }
.btn-danger:hover { background: var(--c-danger-hover); border-color: var(--c-danger-hover); color: #fff; }
.btn-danger:active { background: var(--c-danger-active); }

/* Reversible destruction gets the quiet variant. Spending solid red on the
   trash trains operators to click through red — the exact reflex you cannot
   afford on permanent deletion. */
.btn-danger-soft { background: var(--c-surface); border-color: #e2b8b2; color: var(--c-danger-text); }
.btn-danger-soft:hover { background: var(--c-danger-bg); border-color: #e2b8b2; color: var(--c-danger-text); }

.btn-success { background: var(--c-success); border-color: var(--c-success-hover); color: #fff; }
.btn-success:hover { background: var(--c-success-hover); color: #fff; }

.btn-link { background: none; border-color: transparent; color: var(--c-link); }
.btn-link:hover { background: none; border-color: transparent; text-decoration: underline; }

.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: var(--r-sm); }
.btn-lg { height: 38px; padding: 0 16px; font-size: 15px; }

.btn-group { display: inline-flex; }
.btn-group .btn + .btn { margin-left: -1px; }
.btn-group .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.btn-group .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-group .btn:hover, .btn-group .btn:focus-visible { z-index: 1; }

/* Two pointer-slip widths between a safe action and a destructive one */
.btn-sep { margin-left: var(--sp-8); }

/* ── table ───────────────────────────────────────────────────────────── */

/* No overflow:hidden here. Non-visible overflow turns the wrapper into a
   scroll container, and the sticky header then sticks to the wrapper instead of
   the viewport — the first data rows end up hidden behind it. Corners are
   rounded on the edge cells instead. */
.grid-wrap { border: 1px solid var(--c-border); border-radius: var(--r-lg); }
.grid { width: 100%; border-collapse: collapse; background: var(--c-surface); }
.grid thead th:first-child { border-top-left-radius: var(--r-lg); }
.grid thead th:last-child { border-top-right-radius: var(--r-lg); }
.grid tbody tr:last-child td:first-child { border-bottom-left-radius: var(--r-lg); }
.grid tbody tr:last-child td:last-child { border-bottom-right-radius: var(--r-lg); }

/* Fixed layout is not cosmetic: with long Cyrillic filenames, auto layout
   reflows the whole table on every render and column widths jump between pages */
.grid--files { table-layout: fixed; }

.grid thead th {
    position: sticky;
    top: var(--h-navbar);
    z-index: var(--z-thead);
    background: var(--c-subtle);
    padding: 8px 10px;
    font-size: 11px;
    line-height: 16px;
    font-weight: 600;
    /* Not text-transform: uppercase. Ukrainian uppercase widens words 20-30%
       and destroys word-shape recognition. */
    letter-spacing: .02em;
    color: var(--c-text-muted);
    text-align: left;
    border-bottom: 2px solid var(--c-border);
    white-space: nowrap;
}

.grid td {
    padding: 6px 10px;
    font-size: 13px;
    line-height: 18px;
    border-bottom: 1px solid var(--c-border-hair);
    vertical-align: middle;
}

.grid tbody tr:last-child td { border-bottom: 0; }

/* Order matters: each rule must beat the previous one without !important */
.grid tbody tr { background: var(--c-surface); }
.grid tbody tr:nth-child(even) { background: var(--c-stripe); }
.grid tbody tr:hover { background: var(--c-hover); }
.grid tbody tr.is-selected { background: var(--c-selected); }
.grid tbody tr.is-selected:hover { background: var(--c-selected-hov); }
.grid tbody tr.is-selected > td:first-child { box-shadow: inset 3px 0 0 var(--c-blue); }
.grid tbody tr.is-dim { opacity: .55; }

.grid--bordered td, .grid--bordered th { border-right: 1px solid #eceff3; }
.grid--bordered td:last-child, .grid--bordered th:last-child { border-right: 0; }

.grid th a { color: inherit; display: block; }
.grid th a:hover { color: var(--c-text); text-decoration: none; }
.grid th[aria-sort="ascending"], .grid th[aria-sort="descending"] { color: var(--c-text); background: var(--c-hover); }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: 12px; }
.muted { color: var(--c-text-muted); font-size: 12px; }

/* .trunc lives on an inner span: overflow:hidden on the td would clip the
   focus ring of any link inside it */
.trunc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-sub { display: block; font-size: 12px; color: var(--c-text-muted); margin-top: 1px; }

.cell-check { padding: 0 !important; width: 34px; }
.cell-check label { display: flex; align-items: center; justify-content: center; height: 30px; width: 100%; cursor: pointer; }

/* Native checkbox: BS2 blue via accent-color, native focus ring, native
   keyboard and screen-reader behaviour, zero markup. The full-cell label turns
   a 15px target into 34x30 — which matters when a misclick queues a terabyte. */
.grid input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: var(--c-blue); cursor: pointer; }

.is-empty td { padding: var(--sp-9) var(--sp-7); text-align: center; color: var(--c-text-muted); }

/* ── forms ───────────────────────────────────────────────────────────── */

.input, .select, textarea.input {
    display: block;
    width: 100%;
    height: 32px;
    padding: 5px 9px;
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 20px;
    color: var(--c-text);
    background: var(--c-surface);
    border: 1px solid var(--c-border-control);
    border-radius: var(--r);
    box-shadow: none;
    transition: border-color .12s ease;
}

textarea.input { height: auto; min-height: 72px; }
.input::placeholder { color: var(--c-text-hint); }
.input:hover, .select:hover { border-color: #6f7b88; }

/* A flush outline rather than a box-shadow glow: it survives forced-colors */
.input:focus, .select:focus, textarea.input:focus {
    border-color: var(--c-blue);
    outline: 3px solid rgba(0, 136, 204, .25);
    outline-offset: 0;
}

.input[disabled], .select[disabled] { background: var(--c-sunken); color: var(--c-text-dis); border-color: var(--c-border); cursor: not-allowed; }
.input[aria-invalid="true"] { border-color: var(--c-danger); }

.input-sm { height: 26px; padding: 3px 7px; font-size: 13px; }
.input-lg { height: 38px; padding: 8px 11px; font-size: 15px; }

.select {
    appearance: none;
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%235b6672' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px 6px;
}

.field { margin-bottom: var(--sp-6); }
.field-row { display: flex; gap: var(--sp-5); align-items: flex-end; flex-wrap: wrap; }
.label { display: block; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--c-text-muted); margin-bottom: 4px; }
.help { font-size: 12px; color: var(--c-text-muted); margin-top: 4px; }

/* ── badges, chips ───────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 7px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    border: 1px solid var(--c-chip-border);
    background: var(--c-chip-bg);
    color: var(--c-chip-text);
    border-radius: var(--r-pill);
    white-space: nowrap;
    vertical-align: middle;
}

.badge-info { background: var(--c-blue-bg); border-color: var(--c-blue-border); color: var(--c-blue-text); }
.badge-ok { background: var(--c-success-bg); border-color: var(--c-success-border); color: var(--c-success-text); }
.badge-warn { background: var(--c-warning-bg); border-color: var(--c-warning-border); color: var(--c-warning-text); }
.badge-bad { background: var(--c-danger-bg); border-color: var(--c-danger-border); color: var(--c-danger-text); }

.label-sq { border-radius: var(--r-sm); }

.code {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 16px;
    padding: 1px 5px;
    background: var(--c-chip-bg);
    border: 1px solid var(--c-chip-border);
    border-radius: var(--r-sm);
    color: #3c4753;
}

.code-warn { background: var(--c-warning-bg); border-color: var(--c-warning-border); color: var(--c-warning-text); }
.code-bad { background: var(--c-danger-bg); border-color: var(--c-danger-border); color: var(--c-danger-text); }

/* ── progress and capacity bars ──────────────────────────────────────── */

.progress { height: 10px; background: #e6eaee; border-radius: 5px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--c-blue); transition: width .3s linear; }
.progress--lg { height: 14px; border-radius: 7px; }
.progress--sm { height: 6px; border-radius: 3px; }
.progress.is-done > span { background: var(--c-success); }
.progress.is-failed > span { background: var(--c-danger); }
.progress.is-cancelled > span { background: #8a949f; }

/* The track carries a 1px tick at 90% — the "about to run out" line, visible
   before the fill reaches it. No markup, no JS. */
.bar {
    display: inline-block;
    width: 120px;
    height: 8px;
    background: #e6eaee;
    background-image: linear-gradient(90deg, transparent 0 90%, #c2a6a3 90% calc(90% + 1px), transparent 0);
    border-radius: 4px;
    overflow: hidden;
    vertical-align: middle;
}

.bar > span { display: block; height: 100%; background: var(--c-success); }
.bar .bar-warn { background: var(--c-warning); }
.bar .bar-bad { background: var(--c-danger); }
.bar--wide { width: 100%; height: 10px; border-radius: 5px; }

/* ── tabs, breadcrumbs, alerts, pager ────────────────────────────────── */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--c-border); margin-bottom: var(--sp-6); }

.tabs a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--c-text-muted);
    border: 1px solid transparent;
    border-radius: var(--r) var(--r) 0 0;
    margin-bottom: -1px;
}

.tabs a:hover { background: var(--c-chip-bg); color: var(--c-text); text-decoration: none; }

/* The negative margin plus a surface-coloured bottom border is BS2's "tab sits
   on the rule" trick — the one place the era's structural cleverness still reads
   as correct. */
.tabs a[aria-current="page"] {
    background: var(--c-surface);
    color: var(--c-text);
    border-color: var(--c-border);
    border-bottom-color: var(--c-surface);
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0 0 var(--sp-5);
    padding: 7px 12px;
    background: var(--c-subtle);
    border: 1px solid var(--c-border-hair);
    border-radius: var(--r);
    font-size: 13px;
}

.crumbs li { white-space: nowrap; }
.crumbs li + li::before { content: "/"; color: var(--c-border-strong); margin: 0 8px; }
.crumbs [aria-current="page"] { color: var(--c-text); font-weight: 500; }
.crumbs .badge-info { margin-right: var(--sp-4); }

.alert {
    padding: 10px 14px;
    border: 1px solid;
    border-radius: var(--r);
    font-size: 13px;
    line-height: 19px;
    margin-bottom: var(--sp-6);
}

.alert strong { font-weight: 600; }
.alert a { color: var(--c-link-strong); }
.alert-info { background: var(--c-blue-bg); border-color: var(--c-blue-border); color: var(--c-blue-text); }
.alert-ok { background: var(--c-success-bg); border-color: var(--c-success-border); color: var(--c-success-text); }
.alert-warn { background: var(--c-warning-bg); border-color: var(--c-warning-border); color: var(--c-warning-text); }
.alert-bad { background: var(--c-danger-bg); border-color: var(--c-danger-border); color: var(--c-danger-text); }
.alert--loud { border-left-width: 3px; }

/* No numbered pager: the index is cursor-paginated, so page numbers do not
   exist as a concept here. */
.pager { display: flex; align-items: center; gap: var(--sp-4); margin: var(--sp-6) 0; }
.pager .range { font-size: 12px; color: var(--c-text-muted); font-variant-numeric: tabular-nums; }
.pager .spacer { margin-left: auto; }

.toolbar { display: flex; align-items: center; gap: var(--sp-5); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.toolbar .spacer { margin-left: auto; }
.toolbar .input-sm { width: 280px; }

/* ── bulk action bar ─────────────────────────────────────────────────── */

.bulkbar {
    position: sticky;
    bottom: 0;
    z-index: var(--z-bulkbar);
    display: flex;
    align-items: center;
    gap: var(--sp-5);
    height: 52px;
    padding: 0 var(--sp-7);
    margin-top: var(--sp-6);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-bulkbar);
}

.bulkbar .count { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bulkbar .spacer { margin-left: auto; }

/* ── modal ───────────────────────────────────────────────────────────── */

.backdrop { position: fixed; inset: 0; background: var(--c-backdrop); z-index: var(--z-backdrop); }
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: var(--sp-8); }

.modal-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 90vh;
    background: var(--c-surface);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-modal);
}

.modal-sm { max-width: 420px; }
.modal-md { max-width: 640px; }
.modal-lg { max-width: 960px; }
.modal-video { max-width: min(1100px, 92vw); }

.modal-head { display: flex; align-items: center; padding: 14px var(--sp-7); border-bottom: 1px solid var(--c-border-hair); font-size: 16px; font-weight: 500; }
.modal-close { margin-left: auto; width: 28px; height: 28px; font-size: 20px; line-height: 1; background: none; border: 0; border-radius: var(--r-sm); color: var(--c-text-muted); cursor: pointer; }
.modal-close:hover { background: var(--c-chip-bg); color: var(--c-text); }
.modal-body { padding: var(--sp-7); overflow-y: auto; flex: 1; }
.modal-body--flush { padding: 0; }
.modal-foot { display: flex; align-items: center; gap: var(--sp-4); padding: 12px var(--sp-7); border-top: 1px solid var(--c-border-hair); background: var(--c-subtle); border-radius: 0 0 var(--r-lg) var(--r-lg); }

.modal--danger { border-color: var(--c-danger-border); }
.modal--danger .modal-head { background: var(--c-danger-bg); border-bottom-color: var(--c-danger-border); color: var(--c-danger-text); display: block; }
.modal--danger .eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .02em; margin-bottom: 2px; }
.modal--danger .modal-title { font-size: 16px; line-height: 22px; font-weight: 700; }
.modal--danger .statement { font-size: 15px; line-height: 22px; margin: 0 0 var(--sp-6); }

.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--sp-5); margin: 0; }
.dl dt { font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--c-text-muted); }
.dl dd { margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; }

/* ── video preview ───────────────────────────────────────────────────── */

.preview { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.preview-stage { background: var(--c-video-stage); display: grid; place-items: center; min-height: 320px; position: relative; }
.preview-stage video { width: 100%; max-height: 62vh; display: block; }
.preview-meta { border-left: 1px solid var(--c-border-hair); padding: var(--sp-6); overflow-y: auto; max-height: 62vh; }
.preview-sheet { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; background: var(--c-video-stage); }
.preview-sheet img { width: 100%; display: block; cursor: pointer; opacity: .85; }
.preview-sheet img:hover { opacity: 1; }

/* ── misc ────────────────────────────────────────────────────────────── */

.login-box { width: 340px; margin: 12vh auto; }
.login-box .panel-body { padding: 28px 28px 24px; }
.login-brand { font-size: 18px; font-weight: 600; text-align: center; margin-bottom: 2px; }
.login-sub { font-size: 12px; color: var(--c-text-muted); text-align: center; margin-bottom: var(--sp-7); }
.login-box .btn { width: 100%; }

.empty { color: var(--c-text-muted); }
.stack { display: flex; align-items: center; gap: var(--sp-4); }
.wrap { display: flex; gap: var(--sp-4); flex-wrap: wrap; }

.freshness { display: flex; align-items: center; gap: var(--sp-5); font-size: 12px; }

@media (max-width: 1100px) {
    .split { grid-template-columns: 1fr; }
    .sidebar { position: static; max-height: none; }
    [data-col="codec"], [data-col="duration"] { display: none; }
}

@media print {
    .topbar, .sidebar, .bulkbar, .pager, .toolbar { display: none; }
    body { background: #fff; }
    .grid td, .grid th { border-color: #999; }
}

[x-cloak] { display: none !important; }
