/* CVAT Hub – MV Center look (PLAN §5.9)
   Brand colours come from MV-Center/ai_assistant: navy chrome, industrial red for actions,
   a light blue-grey page with white cards. Data keeps its own blue ramp (job phases, ordinal
   from "to do" to "done", checked in both modes); red is reserved for actions and errors.
   Status colours always appear together with an icon and a text label. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2"); /* Polish letters: ą ć ę ł ń ś ź ż */
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --navy: #1a222e;
  --navy-line: rgba(255, 255, 255, 0.14);
  --red: #c41e1e;
  --red-hover: #a31818;
  --page: #eef2f7;
  --surface: #ffffff;
  --raised: #ffffff;
  --ink: #18202a;
  --ink-2: #5d6b79;
  --heading: #1a222e;
  --grid: #e3e8ef;
  --axis: #c5cfdb;
  --border: #d8dfe8;
  --wash: rgba(26, 34, 46, 0.05);
  --link: #1f4e8c;
  --focus: #2a6fdb;
  --accent-soft: #e7f0ff;
  --done: #1a222e;
  --shadow: 0 12px 32px rgba(18, 32, 48, 0.08);

  --bucket-todo: #86b6ef;
  --bucket-annotating: #5598e7;
  --bucket-annotated: #2a78d6;
  --bucket-in_review: #1c5cab;
  --bucket-done: #104281;

  --good: #1b7f45;
  --warning: #c98a00;
  --serious: #e0703c;
  --critical: #c01c28;
  --critical-wash: #fff1f2;
  --critical-line: #f0b8be;
  --warning-wash: #fff8e6;
  --warning-line: #f1d083;

  --radius: 14px;
  --radius-sm: 8px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0e131a;
    --surface: #161d27;
    --raised: #1c2531;
    --ink: #e8edf3;
    --ink-2: #9aa8b8;
    --heading: #f2f5f9;
    --grid: #26303d;
    --axis: #3a4656;
    --border: rgba(255, 255, 255, 0.1);
    --wash: rgba(255, 255, 255, 0.05);
    --link: #8db8f2;
    --focus: #5b9bef;
    --accent-soft: rgba(91, 155, 239, 0.14);
    --done: #3a4a61;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    --bucket-todo: #184f95;
    --bucket-annotating: #256abf;
    --bucket-annotated: #3987e5;
    --bucket-in_review: #6da7ec;
    --bucket-done: #9ec5f4;
    --critical: #f0606a;
    --critical-wash: rgba(192, 28, 40, 0.16);
    --critical-line: rgba(240, 96, 106, 0.4);
    --warning-wash: rgba(201, 138, 0, 0.14);
    --warning-line: rgba(241, 208, 131, 0.35);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e131a;
  --surface: #161d27;
  --raised: #1c2531;
  --ink: #e8edf3;
  --ink-2: #9aa8b8;
  --heading: #f2f5f9;
  --grid: #26303d;
  --axis: #3a4656;
  --border: rgba(255, 255, 255, 0.1);
  --wash: rgba(255, 255, 255, 0.05);
  --link: #8db8f2;
  --focus: #5b9bef;
  --accent-soft: rgba(91, 155, 239, 0.14);
  --done: #3a4a61;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --bucket-todo: #184f95;
  --bucket-annotating: #256abf;
  --bucket-annotated: #3987e5;
  --bucket-in_review: #6da7ec;
  --bucket-done: #9ec5f4;
  --critical: #f0606a;
  --critical-wash: rgba(192, 28, 40, 0.16);
  --critical-line: rgba(240, 96, 106, 0.4);
  --warning-wash: rgba(201, 138, 0, 0.14);
  --warning-line: rgba(241, 208, 131, 0.35);
}

/* ---- base ---- */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

h1 { font-size: 24px; font-weight: 750; letter-spacing: -0.01em; color: var(--heading); margin: 0; }
h2 {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-2); margin: 0 0 12px;
}
.card-head h2 { margin: 0; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.92em; }
.subtle { color: var(--ink-2); }
.small { font-size: 12.5px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- top bar (navy) ---- */

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--navy);
  color: #fff;
  border-bottom: 1px solid var(--navy-line);
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: stretch; gap: 24px; flex-wrap: wrap; min-height: 58px;
}
.brand {
  display: inline-flex; flex-direction: column; justify-content: center; line-height: 1.1;
  color: #fff; padding: 8px 0;
}
.brand:hover { text-decoration: none; }
.brand-word { font-weight: 800; font-size: 17px; letter-spacing: 0.04em; }
.brand-app {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}
.nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: stretch; }
.nav a {
  display: inline-flex; align-items: center;
  color: rgba(255, 255, 255, 0.72);
  padding: 0 10px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  border-bottom: 3px solid transparent; border-top: 3px solid transparent;
}
.nav a:hover { color: #fff; text-decoration: none; }
.nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--red); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 0; }
.topbar-right form { margin: 0; }
.who { color: rgba(255, 255, 255, 0.86); font-size: 13px; }
.role-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28); color: rgba(255, 255, 255, 0.78);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; vertical-align: 1px;
}
.topbar-link {
  font: inherit; font-size: 13px; background: none; border: 0; padding: 0; cursor: pointer;
  color: rgba(255, 255, 255, 0.86);
}
.topbar-link:hover { color: #fff; text-decoration: underline; }
.topbar .sync-badge { color: rgba(255, 255, 255, 0.72); }
.topbar a.sync-badge.sync-failed { color: #fff; }

/* PL | EN */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; }
.lang-switch button {
  font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em;
  background: none; border: 0; border-radius: 6px; padding: 3px 6px; cursor: pointer;
  color: var(--ink-2);
}
.lang-switch button:hover:not(:disabled) { background: var(--wash); color: var(--ink); }
.lang-switch button[aria-current="true"] { color: var(--ink); cursor: default; }
.topbar .lang-switch button { color: rgba(255, 255, 255, 0.55); }
.topbar .lang-switch button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); color: #fff; }
.topbar .lang-switch button[aria-current="true"] { color: #fff; }

/* ---- layout ---- */

.page { max-width: 1320px; margin: 0 auto; padding: 26px 20px 32px; }
.page-head { margin-bottom: 20px; }
.page-head p { margin: 6px 0 0; max-width: 780px; }
.footer {
  max-width: 1320px; margin: 0 auto; padding: 0 20px 24px;
  color: var(--ink-2); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}
.card.note { box-shadow: none; background: transparent; border-style: dashed; }
.card.note p { margin: 0; color: var(--ink-2); max-width: 780px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.grid-2 > .card { margin-bottom: 0; }

/* ---- stat tiles ---- */

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
}
.tile-label { color: var(--ink-2); font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.tile-value { font-size: 32px; font-weight: 700; line-height: 1.15; margin-top: 6px; color: var(--heading); font-variant-numeric: tabular-nums; }
.tile-sub { color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }

/* ---- tables ---- */

/* position: relative so visually-hidden headers are clipped by the scroller instead of widening the page */
.table-wrap { overflow-x: auto; position: relative; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap;
}
.table td { padding: 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--wash); }
.table.compact td { padding: 7px 10px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.actions { text-align: right; white-space: nowrap; }
.table-meta { margin-bottom: 6px; }
.users-table th { white-space: normal; vertical-align: bottom; }
.users-table .input { min-width: 0; width: 180px; }
.users-table select { min-width: 0; width: 140px; }
.users-table .input-narrow { width: 100px; }
.inactive td { color: var(--ink-2); }
.error-cell { color: var(--ink-2); max-width: 460px; }
.empty { color: var(--ink-2); margin: 8px 0; }

/* ---- progress by phase: stacked bar ---- */

.bar-col { width: 34%; min-width: 180px; }
.stackbar { display: flex; gap: 2px; height: 12px; margin-top: 4px; }
.seg { flex-basis: 0; min-width: 3px; height: 100%; }
.seg:first-child { border-radius: 3px 0 0 3px; }
.seg:last-child { border-radius: 0 4px 4px 0; }
.seg:only-child { border-radius: 3px 4px 4px 3px; }
.seg:hover, .seg:focus-visible { filter: brightness(1.15); }
.bucket-todo { background: var(--bucket-todo); }
.bucket-annotating { background: var(--bucket-annotating); }
.bucket-annotated { background: var(--bucket-annotated); }
.bucket-in_review { background: var(--bucket-in_review); }
.bucket-done { background: var(--bucket-done); }

.legend { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 10px; border-radius: 2px; }

/* ---- chips and status ---- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--wash); color: var(--ink);
  font-size: 12.5px; white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; }
.status-icon { font-size: 11px; line-height: 1; }
.status-good { color: var(--good); }
.status-warning { color: var(--warning); }
.status-serious { color: var(--serious); }
.status-critical { color: var(--critical); }
.sync-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12.5px; }
a.sync-badge.sync-failed { color: var(--ink); font-weight: 600; }

.banner { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 18px; }
.banner-critical { background: var(--critical-wash); border: 1px solid var(--critical-line); }
.banner-warning { background: var(--warning-wash); border: 1px solid var(--warning-line); }
.banner .status-icon { margin-top: 3px; }
.flash {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--good);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 18px;
}

/* ---- activity feed ---- */

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.feed li:last-child { border-bottom: 0; }
.feed time { padding-top: 1px; }

.job-list { list-style: none; margin: 0; padding: 0; }
.job-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px;
  padding: 12px 0; border-bottom: 1px solid var(--grid);
}
.job-row:last-child { border-bottom: 0; }
.job-main { flex: 1 1 280px; min-width: 0; }
.job-title { font-weight: 600; }
.job-row.is-done .job-title { font-weight: 500; color: var(--ink-2); }
.job-actions { margin-left: auto; }

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---- forms ---- */

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 14px; }
.filters label, .stack label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.filters .grow { flex: 1 1 240px; }
.stack label { margin-bottom: 14px; }

select, .input {
  font: inherit; font-size: 14px; font-weight: 400; color: var(--ink); letter-spacing: normal; text-transform: none;
  background: var(--raised); border: 1px solid var(--axis); border-radius: var(--radius-sm);
  padding: 8px 10px; min-width: 150px;
}
select:focus-visible, .input:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.input.wide { width: 100%; min-width: 240px; }
.input-narrow { min-width: 0; width: 84px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--navy); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--axis); background: var(--raised); color: var(--ink);
}
.btn:hover { background: var(--wash); text-decoration: none; }
.btn-primary {
  background: var(--red); border-color: var(--red); color: #fff;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; padding: 10px 16px;
}
.btn-primary:hover { background: var(--red-hover); border-color: var(--red-hover); }
.btn-block { width: 100%; }
.btn-small { padding: 5px 11px; font-size: 12.5px; }
.btn-secondary { color: var(--heading); }
.btn-link { font: inherit; background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; }
.btn-link:hover { text-decoration: underline; }

/* a <details> drop-down with checkboxes (blocked projects) */
.picker { position: relative; }
.picker summary { cursor: pointer; color: var(--link); white-space: nowrap; list-style: none; }
.picker summary::-webkit-details-marker { display: none; }
.picker summary::after { content: " ▾"; color: var(--ink-2); }
.picker[open] .picker-list {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 260px; max-height: 280px; overflow: auto;
  background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 8px 10px; display: flex; flex-direction: column; gap: 6px;
}
.picker-list label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

/* ---- sign-in ---- */

.login { min-height: 78vh; display: grid; place-items: center; }
.login-card {
  width: min(400px, 100%);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.login-logo { background: #fff; padding: 22px 28px 16px; border-bottom: 1px solid var(--border); }
.login-logo img { display: block; width: 220px; max-width: 100%; height: auto; }
.login-body { padding: 22px 28px 8px; }
.login-title { font-size: 22px; }
.login-lead { margin: 6px 0 20px; }
.login-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 22px 14px 22px; border-top: 1px solid var(--grid);
}
.login-foot a { color: var(--ink-2); }
.form-error { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; }

.auth-page .footer { text-align: center; }

.message-page { max-width: 560px; margin: 8vh auto 0; padding: 26px 28px; }
.message-page p { margin: 10px 0 20px; }

/* ---- tooltip (chart marks) ---- */

.tooltip {
  position: fixed; z-index: 50; pointer-events: none;
  max-width: 280px; padding: 6px 9px; border-radius: 6px;
  background: var(--navy); color: #fff;
  font-size: 12.5px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* htmx: keep the previous table visible but dimmed while filters reload it */
#jobs-table.htmx-request { opacity: 0.55; transition: opacity 0.15s; }

/* ---- work flow (Phase 3) ---- */

.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.take-next { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin: 0; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions-row form { margin: 0; }
.spaced { margin-top: 22px; }

/* item cards: preview, what it is, what you can do */
.item-list { list-style: none; margin: 0; padding: 0; }
.item-card {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 8px 16px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--grid);
}
.item-card:last-child { border-bottom: 0; }
.thumb { width: 96px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); background: var(--grid); display: block; }
.is-locked .thumb { filter: grayscale(1); opacity: 0.6; }
.item-body { min-width: 0; }
.item-title { font-weight: 600; }
.item-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.item-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.item-actions form { margin: 0; }
.item-note {
  margin-top: 8px; padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--warning-wash); border: 1px solid var(--warning-line);
}
.chip-verify { background: var(--accent-soft); color: var(--heading); font-weight: 600; }
.chip-urgent { background: var(--critical-wash); }
.deadline { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.deadline.is-overdue { color: var(--critical); font-weight: 600; }
.btn-take { border-color: var(--red); color: var(--red); font-weight: 700; }
.btn-take:hover { background: var(--red); color: #fff; }
.btn-done { background: var(--done); border-color: var(--done); color: #fff; }
.btn-done:hover { filter: brightness(1.15); }

/* item states (dots use the blue data ramp; finished work anchors the dark end) */
.item-state .dot { background: var(--axis); }
.state-open .dot, .item-state.state-open .dot { background: var(--bucket-todo); }
.item-state.state-taken .dot { background: var(--bucket-annotating); }
.item-state.state-done .dot { background: var(--bucket-done); }
.item-state.state-skipped .dot, .item-state.state-cancelled .dot { background: transparent; border: 1.5px solid var(--axis); }
.holder { font-size: 12.5px; }
tr.is-current td { background: var(--wash); }

/* drop-down panels (<details class="menu">) */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 300px;
  background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 12px;
}
.cell-menu .menu-panel { left: 0; right: auto; }
.menu-panel p { margin: 0 0 10px; }
.inline-form { display: flex; gap: 6px; align-items: center; margin: 0 0 8px; }
.inline-form select { min-width: 0; flex: 1; }

/* plain checkboxes and radio buttons with a sentence next to them */
label.check, .stack label.check {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 500; letter-spacing: normal; text-transform: none; color: var(--ink);
  margin: 8px 0;
}
textarea.input { width: 100%; min-width: 0; resize: vertical; font-family: inherit; line-height: 1.45; }
.stack-label {
  display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}

/* publish form */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid .input, .form-grid select { width: 100%; min-width: 0; }
.pass-list { margin: 12px 0; padding-left: 26px; display: flex; flex-direction: column; gap: 14px; counter-reset: pass; list-style: none; }
.pass-row { position: relative; display: grid; grid-template-columns: minmax(160px, 260px) minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.pass-row::before { counter-increment: pass; content: counter(pass) "."; position: absolute; left: -26px; top: 30px; font-weight: 700; color: var(--ink-2); }
.pass-row > button { align-self: end; margin-bottom: 4px; }
.pass-row label, .verification-text {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.verification-text { margin-top: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 18px; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; padding-left: 26px; }

/* batches */
.progress { height: 8px; border-radius: 4px; background: var(--grid); overflow: hidden; margin-top: 4px; }
.progress > span { display: block; height: 100%; background: var(--bucket-annotated); }
.grid-table td.cell { min-width: 150px; }
.grid-table td.cell .cell-link { color: inherit; }
.grid-table td.cell .cell-link:hover { text-decoration: none; }
.grid-table td.cell .cell-link:hover .chip { outline: 1px solid var(--axis); }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 72ch; }
.grid-wide-left { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* needs attention */
.attention-list { list-style: none; margin: 0; padding: 0; }
.attention-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--grid);
}
.attention-list li:last-child { border-bottom: 0; }
.attention-list form { margin: 0; }

/* the admin menu in the top bar */
.nav-menu { position: relative; display: flex; align-items: stretch; }
.nav-menu > summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  color: rgba(255, 255, 255, 0.72); padding: 0 10px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  border-bottom: 3px solid transparent; border-top: 3px solid transparent;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::after { content: "▾"; font-size: 10px; }
.nav-menu > summary:hover, .nav-menu[open] > summary { color: #fff; }
.nav-menu.is-active > summary { color: #fff; border-bottom-color: var(--red); }
.nav-menu-list {
  position: absolute; top: 100%; left: 0; z-index: 40; min-width: 220px;
  background: var(--raised); border: 1px solid var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px 0; display: flex; flex-direction: column;
}
.nav .nav-menu-list a {
  color: var(--ink); padding: 9px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 14px; font-weight: 500; letter-spacing: normal; text-transform: none; border: 0;
}
.nav-menu-list a:hover { background: var(--wash); text-decoration: none; }
.nav-menu-list a[aria-current="page"] { font-weight: 700; box-shadow: inset 3px 0 0 var(--red); }
.count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0; line-height: 1;
}

@media (max-width: 720px) {
  .item-card { grid-template-columns: 72px minmax(0, 1fr); }
  .thumb { width: 72px; height: 48px; }
  .item-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .menu-panel { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; }
  .form-grid, .grid-wide-left { grid-template-columns: minmax(0, 1fr); }
  .pass-row { grid-template-columns: minmax(0, 1fr); }
  .take-next { align-items: flex-start; }
}

/* ---- instructions and files (Phase 4) ---- */

/* Markdown written by developers (and CVAT guides) */
.md { max-width: 78ch; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md table { margin: 0 0 10px; }
.md ul, .md ol { padding-left: 22px; }
.md h1, .md h2, .md h3, .md h4 {
  font-size: 15px; font-weight: 700; letter-spacing: normal; text-transform: none; color: var(--heading); margin: 14px 0 6px;
}
.md img { max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.md blockquote { border-left: 3px solid var(--axis); padding-left: 12px; color: var(--ink-2); }
.md code { background: var(--wash); padding: 1px 4px; border-radius: 4px; }
.md pre { background: var(--wash); padding: 10px; border-radius: var(--radius-sm); overflow-x: auto; }
.md table { border-collapse: collapse; }
.md th, .md td { border: 1px solid var(--grid); padding: 4px 8px; }
.md hr { border: 0; border-top: 1px solid var(--grid); }

.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 5px 0; border-bottom: 1px solid var(--grid); }
.file-list li:last-child { border-bottom: 0; }
.files-head { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin: 16px 0 4px; }
.chip-small { font-size: 11px; padding: 1px 7px; }
form.inline { display: inline; margin: 0; }
.upload-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.upload-form .input { min-width: 0; flex: 1 1 220px; padding: 6px; }
.pass-row .pass-files { grid-column: 1 / -1; }
.pass-row .pass-files .input { padding: 6px; }
details.guide > summary { cursor: pointer; list-style: none; }
details.guide > summary::-webkit-details-marker { display: none; }
details.guide > summary h2 { display: inline; margin: 0; }
details.guide > summary::after { content: " ▾"; color: var(--ink-2); }
details.guide[open] > summary { margin-bottom: 12px; }
details.add-pass { margin-top: 16px; }
details.add-pass > summary { list-style: none; display: inline-block; }
details.add-pass > summary::-webkit-details-marker { display: none; }
details.add-pass[open] > summary { margin-bottom: 14px; }
.effects { margin: 0 0 14px; padding-left: 18px; }
.effects li + li { margin-top: 4px; }

/* ---- notifications (Phase 5) ---- */

.events-table { max-width: 640px; margin-bottom: 14px; }
.input[type="time"] { width: 130px; }
.events-table td:not(:first-child), .events-table th:not(:first-child) { text-align: center; width: 110px; }
.qr { display: block; width: 264px; height: 264px; background: #fff; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.notice-text { white-space: pre-line; max-width: 60ch; }

/* ---- small screens ---- */

@media (max-width: 1360px) {
  .topbar .sync-label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}
@media (max-width: 960px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .topbar-inner { gap: 6px 20px; }
  .nav a { padding: 8px 10px; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .page, .topbar-inner, .footer { padding-left: 16px; padding-right: 16px; }
  .topbar-right { margin-left: 0; width: 100%; justify-content: space-between; }
  .login-logo, .login-body { padding-left: 20px; padding-right: 20px; }
}
