/* Vostok Control — admin and dispatcher chrome.
 *
 * Every value here comes from `docs/design-system.md`, which transcribes
 * `Vostok Design System.dc.html`. The admin is a Vostok surface: it uses the
 * same palette, type ramp, radii and motion as the passenger and driver
 * applications, never another product's look.
 *
 * Fonts are served locally rather than from a CDN so the control panel keeps
 * working on a restricted network.
 */

@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(/fonts/Manrope-Regular.ttf) format('truetype'); }
@font-face { font-family: Manrope; font-weight: 500; font-display: swap; src: url(/fonts/Manrope-Medium.ttf) format('truetype'); }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(/fonts/Manrope-SemiBold.ttf) format('truetype'); }
@font-face { font-family: Manrope; font-weight: 700; font-display: swap; src: url(/fonts/Manrope-Bold.ttf) format('truetype'); }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url(/fonts/Manrope-ExtraBold.ttf) format('truetype'); }
/* The two marks Uzbek is written with — ‘ in o‘ and g‘, ’ in ma’lum. Manrope
 * draws them as a small square tick that reads as a typewriter apostrophe, so
 * "Qo‘ng‘iroqlar" looked misspelt although the text was right. These two faces
 * hold only those two characters, drawn as the turned comma and the comma they
 * are (the same files the public site uses), and stand in for Manrope's
 * wherever Manrope is set: a face declared later wins for the range it names. */
@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(/fonts/UzQuotes-Regular.ttf?v=2) format('truetype'); unicode-range: U+2018-2019, U+02BC; }
@font-face { font-family: Manrope; font-weight: 500; font-display: swap; src: url(/fonts/UzQuotes-Regular.ttf?v=2) format('truetype'); unicode-range: U+2018-2019, U+02BC; }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(/fonts/UzQuotes-Regular.ttf?v=2) format('truetype'); unicode-range: U+2018-2019, U+02BC; }
@font-face { font-family: Manrope; font-weight: 700; font-display: swap; src: url(/fonts/UzQuotes-Bold.ttf?v=2) format('truetype'); unicode-range: U+2018-2019, U+02BC; }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url(/fonts/UzQuotes-Bold.ttf?v=2) format('truetype'); unicode-range: U+2018-2019, U+02BC; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-display: swap; src: url(/fonts/JetBrainsMono-Medium.ttf) format('truetype'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 700; font-display: swap; src: url(/fonts/JetBrainsMono-Bold.ttf) format('truetype'); }
/* The small upper-case labels are set in JetBrains Mono, whose two marks are as
 * straight: YO‘LOVCHI and TO‘LOV get the same two glyphs. */
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-display: swap; src: url(/fonts/UzQuotes-Regular.ttf?v=2) format('truetype'); unicode-range: U+2018-2019, U+02BC; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 700; font-display: swap; src: url(/fonts/UzQuotes-Bold.ttf?v=2) format('truetype'); unicode-range: U+2018-2019, U+02BC; }

:root {
  /* Brand */
  --yellow: #ffed00;
  --yellow-hover: #fff44d;
  --yellow-pressed: #d9c900;
  --ink: #1c1b17;
  --steel: #c5c6c6;
  --paper: #f7f6f2;
  --gold-ink: #a89c00;
  --gold-text: #8a7f00;

  /* Light surfaces */
  --bg: #f7f6f2;
  --panel: #ffffff;
  --fill: #f7f6f2;
  --fill-border: #e9e7df;
  --chrome-border: #e2e0d8;
  --divider: #efede6;
  --muted: #8a8880;
  --muted-soft: #a8a69e;
  --muted-deep: #6e6c66;

  /* Dark chrome (sidebar) */
  --sheet-dark: #1c1b17;
  --surface-dark: #26241f;
  --surface-raised-dark: #35322b;
  --border-dark: #35322b;
  --muted-dark: #8a8880;
  --muted-deep-dark: #5a574e;

  /* Semantic */
  --success: #2f9e63;
  --success-fill: rgba(79, 192, 127, .15);
  --danger: #d24330;
  --danger-fill: rgba(229, 83, 61, .1);
  --danger-border: #f0c9c1;
  --info: #6c9fe0;
  --info-fill: rgba(108, 159, 224, .15);
  --cashback-fill: #fffbe0;
  --cashback-border: #f0e48a;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 14px;
  --r-xl: 16px;
  --r-xxl: 18px;
  --r-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 3px 10px rgba(28, 27, 23, .09);
  --shadow-md: 0 4px 14px rgba(28, 27, 23, .10);
  --shadow-yellow: 0 8px 20px rgba(217, 201, 0, .35);

  /* Motion */
  --t-tap: 120ms ease;
  --t-color: 150ms ease;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Manrope, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Numerals, plates and technical labels take the mono face, exactly as the
 * mobile applications render them. */
.mono, .num, .plate, .table td.num, .metric strong, .kpi strong {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

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

.layout { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--sheet-dark);
  color: var(--paper);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 8px 22px;
  color: var(--paper);
  text-decoration: none;
}
.brand small {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-dark);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--yellow);
  color: var(--ink);
  flex: none;
}

.nav { flex: 1; }
.nav-heading {
  margin: 20px 12px 7px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-deep-dark);
}
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 2px 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--steel);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--t-color), color var(--t-color);
}
/* One drawn icon family, all on the same 24-grid at the same stroke, taking
   the colour of the entry they belong to. They used to be Unicode characters
   from half a dozen typefaces, so half were outlines and half were solid. */
.nav-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--muted);
  transition: color var(--t-color);
}
.nav-icon svg { display: block; }
.nav a:hover { background: var(--surface-dark); color: var(--paper); }
.nav a:hover .nav-icon { color: var(--paper); }
.nav a.active { background: var(--surface-raised-dark); color: var(--yellow); font-weight: 800; }
.nav a.active .nav-icon { color: var(--yellow); }

/* How many things on that screen are waiting for an operator.
   Pushed to the right edge by `margin-left: auto` so the counts line up down
   the sidebar and can be scanned without reading the labels. */
.nav-badge {
  margin-left: auto;
  flex: none;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  text-align: center;
}
/* On the current page the link itself is yellow, so the badge inverts to stay
   legible rather than disappearing into it. */
.nav a.active .nav-badge { background: var(--ink); color: var(--yellow); }

.sidebar-user {
  margin-top: 20px;
  padding: 16px 10px 0;
  border-top: 1px solid var(--border-dark);
  display: grid;
  gap: 4px;
}
.sidebar-user strong { font-size: 14px; font-weight: 800; }
.sidebar-user span { font-size: 12px; color: var(--muted-dark); }
.sidebar-user a { color: var(--yellow); text-decoration: none; font-weight: 700; }
.sidebar-user form { margin-top: 8px; }
.sidebar-user button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--steel);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.sidebar-user button:hover { color: var(--yellow); }

.content { padding: 28px 34px; min-width: 0; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}
.topbar h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.topbar p { margin: 7px 0 0; color: var(--muted-deep); font-size: 14px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--chrome-border);
  border-radius: var(--r-pill);
  background: var(--panel);
  font-size: 13px;
  font-weight: 700;
}

/* ------------------------------------------------------------------- cards */

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.wide { grid-column: span 3; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; }

.card {
  background: var(--panel);
  border: 1px solid var(--fill-border);
  border-radius: var(--r-xxl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card h2 { margin: 0 0 18px; font-size: 17px; font-weight: 800; }
.card.compact { align-self: start; }

.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.card-heading h2 { margin: 0; }

/* Reusable operational facts. Primary and secondary values must remain
   visibly separate on both the wide desk and the dispatcher tablet. */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  margin: 0;
}
.detail-grid > div {
  min-width: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--divider);
}
.detail-grid dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.detail-grid dd {
  min-width: 0;
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.4;
}
.detail-grid dd small {
  display: block;
  margin-top: 3px;
  color: var(--muted-deep);
  font-size: 11px;
  font-weight: 550;
}
.tx-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--divider);
}
.tx-row > span { min-width: 0; }
/* A stored value in the change history: kept as written, wrapped to fit. */
.audit-value { margin: 0; max-width: 46ch; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.topbar .eyebrow a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.permission-group { margin-top: 16px; }
.permission-group .permission-grid { margin-bottom: 0; }
/* A moment and when it happened: "Bekor qilingan — 08.10.2026 16:05". The dash
 * is always there; while the moment has not come it stands alone. */
.tx-row--stamp { justify-content: flex-start; gap: 8px; }
/* The status history prints the status's own name, as the dictionary words it. */
#status-history .timeline b { text-transform: none; }
.tx-row--stamp strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tx-row--stamp .tx-sep { color: var(--muted); font-weight: 500; }
.tx-row small { display: block; margin-top: 3px; color: var(--muted); }
.toolbar-more + .toolbar-more { margin-top: 8px; }
.toolbar-more pre { max-width: 100%; overflow: auto; }

.metric span {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.metric strong { display: block; margin-top: 9px; font-size: 29px; }

/* Ledger block — divided rows with a bold total, as on the mobile receipts. */
.ledger { background: var(--fill); border-radius: var(--r-xxl); padding: 0 18px; }
.ledger .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--fill-border);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted-deep);
}
.ledger .row:last-child { border-bottom: 0; }
.ledger .row.total { padding: 16px 0; font-size: 16px; font-weight: 800; color: var(--ink); }
.ledger .row b { font-family: var(--mono); font-weight: 700; color: var(--ink); }
.ledger .row.total b { font-size: 24px; letter-spacing: -.02em; }
.ledger .row b.minus { color: var(--danger); }
.ledger .row b.gold { color: var(--gold-text); }

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

.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 13px 8px;
  border-bottom: 1px solid var(--divider);
  text-align: left;
  font-size: 14px;
  vertical-align: middle;
}
.table th {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
/* A column that can be sorted is a link. It reads as the heading it is —
   not as the browser's blue, underlined default — and says which way the
   list is ordered when it is the one doing the ordering. */
.table th a { color: inherit; text-decoration: none; }
.table th a:hover, .table th a.asc, .table th a.desc { color: var(--ink); }
.table th a.asc::after { content: " ↑"; }
.table th a.desc::after { content: " ↓"; }
.table tbody tr { transition: background var(--t-color); }
.table tbody tr:hover { background: var(--fill); }
.table small, .permission-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

/* --------------------------------------------------------- status & badges */

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--fill);
  border: 1px solid var(--fill-border);
  color: var(--muted-deep);
  font-size: 12px;
  font-weight: 700;
}
.status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status.active, .status.online, .status.completed, .status.approved {
  background: var(--success-fill);
  border-color: transparent;
  color: var(--success);
}
.status.blocked, .status.cancelled, .status.offline, .status.rejected {
  background: var(--danger-fill);
  border-color: transparent;
  color: var(--danger);
}
.status.pending, .status.busy {
  background: rgba(255, 237, 0, .22);
  border-color: transparent;
  color: var(--gold-text);
}
.status.in-trip, .status.info {
  background: var(--info-fill);
  border-color: transparent;
  color: var(--info);
}
.status.solid {
  background: var(--yellow);
  border-color: transparent;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: .04em;
}
.status.solid::before { display: none; }

/* Vehicle plate, matching the mobile applications. */
.plate {
  display: inline-block;
  padding: 7px 11px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--yellow);
  font-size: 14px;
  letter-spacing: .06em;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--fill-border);
  border-radius: var(--r-pill);
  background: var(--fill);
  font-size: 13px;
  font-weight: 700;
}
.tag.selected { background: var(--ink); border-color: var(--ink); color: var(--yellow); font-weight: 800; }

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--yellow);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--t-color), transform var(--t-tap);
}
.btn:hover { background: var(--yellow-hover); }
.btn:active { background: var(--yellow-pressed); transform: scale(.97); }
.btn.secondary { background: var(--fill); border: 1px solid var(--fill-border); color: var(--ink); font-weight: 700; }
.btn.secondary:hover { background: var(--divider); }
.btn.outline { background: transparent; border: 1.5px solid var(--chrome-border); color: var(--ink); font-weight: 700; }
.btn.outline:hover { border-color: var(--yellow-pressed); }
.btn.inverse { background: var(--ink); color: var(--yellow); }
.btn.inverse:hover { background: #2a2924; }
.btn.danger { background: transparent; border: 1.5px solid var(--danger-border); color: var(--danger); }
.btn.danger:hover { background: var(--danger-fill); }
.btn.elevated { box-shadow: var(--shadow-yellow); }
.btn[disabled], .btn.disabled {
  background: var(--fill);
  border-color: var(--fill-border);
  color: var(--muted-soft);
  cursor: not-allowed;
  box-shadow: none;
}

.actions { display: flex; gap: 6px; align-items: center; }
.actions form { margin: 0; }
/* A row with three actions on it — edit, reset the password, block. Full-size
 * buttons made the staff table wider than its card, so the last one was cut
 * off at the edge; these are the same buttons, a size down. */
.actions--compact { gap: 5px; }
.actions--compact .btn { padding: 8px 11px; font-size: 12.5px; white-space: nowrap; }
.cell-sub { display: block; margin-top: 2px; color: var(--muted-deep); font-size: 12.5px; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ alerts */

.alert {
  margin: 0 0 16px;
  padding: 13px 16px;
  border-radius: var(--r-lg);
  font-size: 14px;
  font-weight: 600;
}
.alert.success { background: var(--success-fill); color: var(--success); }
.alert.error { background: var(--danger-fill); border: 1px solid var(--danger-border); color: var(--danger); }
.alert.warning { background: var(--cashback-fill); border: 1px solid var(--cashback-border); color: var(--gold-text); }
.alert.info { background: var(--fill, #F2F1EB); border: 1px solid var(--fill-border, #E2E0D8); color: var(--ink, #1C1B17); }
/* A notification that can be dismissed: the words, and a cross a thumb can
   find. The cross takes the colour of the notice it closes. */
.alert.is-dismissible { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-right: 8px; }
.alert .alert-text { min-width: 0; overflow-wrap: anywhere; }
.alert.is-dismissible .alert-text { padding-top: 1px; }
.alert-close {
  flex: none; width: 36px; height: 36px; margin: -8px 0; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 9px; background: rgba(28, 27, 23, .06); color: inherit;
  font-family: inherit; font-size: 24px; font-weight: 600; line-height: 1; cursor: pointer; opacity: .9;
  transition: opacity .15s ease, background .15s ease;
}
.alert-close:hover { opacity: 1; background: rgba(28, 27, 23, .14); }
.alert-close:focus-visible { opacity: 1; outline: 2px solid currentColor; outline-offset: 2px; }

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

.card label { display: grid; gap: 7px; margin-bottom: 15px; font-size: 13px; font-weight: 700; }
.card input, .card select, .card textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--fill-border);
  border-radius: var(--r-lg);
  background: var(--fill);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  transition: border-color var(--t-color), box-shadow var(--t-color), background var(--t-color);
}
.card input:focus, .card select:focus, .card textarea:focus {
  outline: 0;
  background: var(--panel);
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(255, 237, 0, .35);
}
.card input.mono, .card input[inputmode='numeric'] { font-family: var(--mono); }
.card .check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.card .check input, .permission-card input { width: auto; }

.admin-date-field {
  display: inline-flex;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}
.admin-date-field > input[type='date'],
.admin-date-field > input[type='datetime-local'] {
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.admin-date-trigger {
  flex: 0 0 42px;
  border: 1.5px solid var(--fill-border);
  border-left: 0;
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  background: var(--yellow);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}
.admin-date-trigger:hover { background: var(--yellow-hover); }
.admin-date-trigger:focus-visible { outline: 3px solid rgba(255, 237, 0, .45); outline-offset: 2px; }
.filters .admin-date-field { max-width: 255px; }
.filters .admin-date-field input { width: 100%; max-width: none; }

.permission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.permission-card {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  margin: 0 !important;
  padding: 15px;
  border: 1px solid var(--fill-border);
  border-radius: var(--r-lg);
  background: var(--panel);
}
.permission-card input { margin-top: 3px; }

.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input { max-width: 340px; }
.filters select { max-width: 190px; }
.filters input, .filters select {
  padding: 11px 14px;
  border: 1.5px solid var(--fill-border);
  border-radius: var(--r-lg);
  background: var(--panel);
  font: inherit;
  font-weight: 600;
}

.form-card { max-width: 850px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.span-2 { grid-column: span 2; }
.error-text { margin: 8px 0; color: var(--danger); font-size: 13px; font-weight: 600; }

/* Segmented control, matching the mobile period switchers. */
.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--fill); }
.segmented a {
  padding: 10px 16px;
  border-radius: var(--r-sm);
  color: var(--muted-deep);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--t-color), color var(--t-color);
}
.segmented a.active { background: var(--yellow); color: var(--ink); font-weight: 800; }

/* ------------------------------------------------------------------- login */

/* Sign in: one centred card — branding, two fields, one button. */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 237, 0, .14), transparent 60%),
    var(--ink);
}
.login-card {
  position: relative;
  width: min(384px, 100%);
  padding: 34px 34px 36px;
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 22px 52px rgba(0, 0, 0, .34);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 22px 0 26px;
}
.login-brand .brand-mark {
  width: 44px;
  height: 44px;
  flex: none;
  padding: 8px;
  border-radius: 13px;
  background: var(--ink);
}
.login-brand .brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.login-brand > img { display: block; height: auto; }
.lang-switch--login { margin: 0; }
.login-card .field:has(input[type=checkbox]) label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.login-card .field:has(input[type=checkbox]) { margin: 16px 0 4px; }
.login-card .field input[type=checkbox], .login-remember { width: auto; margin: 0; }
.login-card .field-error { margin-top: 6px; color: #c62828; font-size: 12px; font-weight: 700; }
.login-card .has-error input { border-color: #c62828; }
.btn-block { width: 100%; margin-top: 10px; justify-content: center; }

/* The form fields, shared by the sign-in card. */
.field { margin: 16px 0; }
.field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.field input {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--fill-border);
  border-radius: var(--r-lg);
  background: var(--fill);
  font: inherit;
  font-weight: 600;
}
.field input:focus {
  outline: 0;
  background: var(--panel);
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(255, 237, 0, .35);
}

/* ---------------------------------------------------------- language */

/* Used by the workspace header and by the sign-in card, so it lives here
 * rather than in the operations sheet the sign-in page does not load. */
.lang-switch {
  margin-left: auto;
  display: inline-flex;
  flex: none;
  flex-wrap: nowrap;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--chrome-border);
  border-radius: 999px;
  background: var(--fill);
}
.lang-switch a {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--muted-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.lang-switch img {
  display: block;
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(28, 27, 23, .14);
}
.lang-switch a:hover { color: var(--ink); }
.lang-switch a.is-active { background: var(--yellow); color: var(--ink); }
.lang-switch a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* -------------------------------------------------------------- pagination */

.pagination { display: flex; gap: 5px; list-style: none; padding: 0; }
.pagination a, .pagination span {
  display: block;
  padding: 9px 13px;
  border-radius: var(--r-sm);
  background: var(--fill);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.pagination .active a, .pagination .active span, .pagination a:hover { background: var(--yellow); }
.pagination .active a, .pagination .active span { font-weight: 800; cursor: default; }
.pagination .disabled a, .pagination .disabled span { opacity: .4; pointer-events: none; }
.pagination .disabled span { opacity: .45; cursor: not-allowed; }

/* The pager footer every table shares: summary, rows-per-page, page buttons. */
.admin-pager {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  min-height: 38px;
}
.admin-pager .pager-summary { color: var(--muted-deep); font-size: 13px; margin-right: auto; }
.admin-pager .pager-summary strong { color: var(--ink); }
.admin-pager .pager-size {
  flex: none;
  width: auto;
  max-width: 190px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
/* A long page list must scroll rather than push the layout sideways. */
.admin-pager nav { max-width: 100%; overflow-x: auto; }
.admin-pager nav .pagination { flex-wrap: nowrap; }

@media (max-width: 640px) {
  .admin-pager .pager-summary { width: 100%; margin-right: 0; }
  .admin-pager nav { order: 3; width: 100%; }
}

/* ------------------------------------------------------------------- empty */

.empty {
  display: grid;
  place-items: center;
  gap: 13px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted-deep);
}
.empty strong { font-size: 17px; font-weight: 800; color: var(--ink); }
.empty p { margin: 0; max-width: 360px; font-size: 14px; line-height: 1.55; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .wide { grid-column: span 2; }
  .permission-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .content { padding: 20px; }
  .split, .form-grid, .permission-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .grid { grid-template-columns: 1fr; }
  .wide { grid-column: span 1; }
  .detail-grid { grid-template-columns: 1fr; }
  /* Four figures need not each take a screen's height on a phone: two to a row (2026-11-14). */
  .grid:has(> .card.metric:nth-child(2)):not(:has(> :not(.metric))) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* A route, A to B (2026-11-14): a marker for each point, a line between them, the address and its note beside it.
   `<div class="route-points"><div><i>A</i><span><b>address</b><small>note</small></span></div>…</div>` */
.route-points { display: grid; gap: 0; margin: 4px 0 16px; }
.route-points > div { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; }
.route-points > div:last-child { padding-bottom: 0; }
.route-points > div:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 28px;
  bottom: 2px;
  width: 2px;
  border-radius: 2px;
  background: var(--fill-border);
}
.route-points i {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}
.route-points > div:last-child i { background: var(--ink); color: var(--yellow); }
.route-points span { min-width: 0; padding-top: 2px; }
.route-points b { display: block; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.route-points small { display: block; margin-top: 3px; color: var(--muted-deep); font-size: 12.5px; }

/* Identifier cell: a uuid shortened to its leading block, full value on hover. */
.cell-id { width: 1%; white-space: nowrap; }
.id-short { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted-deep); cursor: help; }

/* ------------------------------------------------------- date picker */

/* flatpickr in Vostok colours. The library ships its own light theme; only
 * the parts that would otherwise look borrowed are restated. */
.vostok-date, .vostok-date--alt {
  padding: 11px 14px;
  border: 1.5px solid var(--fill-border);
  border-radius: var(--r-lg);
  background: var(--fill);
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  min-width: 160px;
}
.vostok-date:focus, .vostok-date--alt:focus {
  outline: 0;
  background: var(--panel);
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(255, 237, 0, .35);
}
.vostok-date--range, .vostok-date--range.vostok-date--alt { min-width: 230px; cursor: pointer; }
/* flatpickr hides the source field and shows this one. */
input.vostok-date--alt { display: block; }

.flatpickr-calendar {
  border-radius: 16px;
  border: 1px solid var(--chrome-border);
  box-shadow: 0 18px 44px rgba(28, 27, 23, .16);
  font-family: inherit;
}
.flatpickr-calendar .flatpickr-day.selected,
.flatpickr-calendar .flatpickr-day.startRange,
.flatpickr-calendar .flatpickr-day.endRange,
.flatpickr-calendar .flatpickr-day.selected:hover,
.flatpickr-calendar .flatpickr-day.startRange:hover,
.flatpickr-calendar .flatpickr-day.endRange:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--ink);
  font-weight: 800;
}
.flatpickr-calendar .flatpickr-day.inRange {
  background: rgba(255, 237, 0, .26);
  border-color: rgba(255, 237, 0, .26);
  box-shadow: -5px 0 0 rgba(255,237,0,.26), 5px 0 0 rgba(255,237,0,.26);
}
.flatpickr-calendar .flatpickr-day.today { border-color: var(--ink); }
.flatpickr-calendar .flatpickr-day:hover { background: var(--fill); }
.flatpickr-months .flatpickr-month, .flatpickr-weekdays { color: var(--ink); }
.flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 700; }
/* 2026-11-14: the month is a list and the year a field — both look like the panel's own controls. */
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year { border-radius: var(--r-xs); padding: 2px 4px; }
.flatpickr-current-month .flatpickr-monthDropdown-months:hover,
.flatpickr-current-month input.cur-year:hover { background: var(--fill); }
.flatpickr-calendar .flatpickr-day:focus-visible,
.flatpickr-calendar .flatpickr-monthDropdown-months:focus-visible,
.flatpickr-calendar input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.flatpickr-calendar .flatpickr-day.flatpickr-disabled { color: var(--muted-soft); }
/* A calendar inside a dialog stays above the dialog's own content. */
dialog .flatpickr-calendar { z-index: 10; }
/* On a phone the calendar is never wider than the screen. */
@media (max-width: 420px) {
  .flatpickr-calendar { max-width: calc(100vw - 24px); }
}

/* The field and the button that empties it (date-picker.js). */
.vostok-date-field { position: relative; display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.vostok-date-field > input { padding-right: 36px; width: 100%; }
.vostok-date-clear {
  position: absolute;
  right: 8px;
  display: none;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-deep);
  cursor: pointer;
}
.vostok-date-field.has-value .vostok-date-clear { display: grid; }
.vostok-date-clear:hover { background: var(--fill-border); color: var(--ink); }
.vostok-date-clear:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.filters .vostok-date-field { max-width: 255px; }

/* Upload box while a file is being dragged over it. */
.upload-field.is-dropping .upload-preview,
.upload-field.is-dropping label {
  outline: 2px dashed var(--ink);
  outline-offset: 3px;
}
.upload-field.is-dropping { background: rgba(255, 237, 0, .10); border-radius: var(--r-sm); }

/* ------------------------------------------------------ sidebar groups */

.nav-group + .nav-group { margin-top: 4px; }
.nav-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 12px 8px;
  border: 0;
  background: none;
  color: var(--muted-soft);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}
.nav-heading:hover { color: var(--paper); }
.nav-heading:focus-visible { outline: 2px solid var(--yellow); outline-offset: -2px; border-radius: 8px; }
.nav-caret {
  margin-left: auto;
  width: 0;
  height: 0;
  border: 4px solid transparent;
  border-top-color: currentColor;
  transform: translateY(2px);
  transition: transform .18s ease;
}
.nav-group.is-open .nav-caret { transform: rotate(180deg) translateY(2px); }
.nav-links { display: none; }
.nav-group.is-open .nav-links { display: block; }

/* ------------------------------------------------------ modal, lightbox */

dialog.modal {
  width: min(520px, calc(100vw - 32px));
  padding: 26px;
  border: 1px solid var(--chrome-border);
  border-radius: 20px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(28,27,23,.28);
}
dialog.modal::backdrop { background: rgba(28, 27, 23, .55); }
dialog.modal h2 { margin: 0 0 6px; font-size: 19px; font-weight: 800; }
dialog.modal .modal-lede { margin: 0 0 16px; color: var(--muted-deep); font-size: 14px; }
dialog.modal label { display: block; font-size: 13px; font-weight: 700; }
dialog.modal textarea {
  width: 100%;
  margin-top: 7px;
  padding: 12px 14px;
  border: 1.5px solid var(--fill-border);
  border-radius: var(--r-lg);
  background: var(--fill);
  font: inherit;
  font-weight: 600;
  resize: vertical;
}
/* A choice in a dialog is a field like the text under it, not the browser's
   own little control sitting beside its label. */
dialog.modal select {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 12px 14px;
  border: 1.5px solid var(--fill-border);
  border-radius: var(--r-lg);
  background-color: var(--fill);
  font: inherit;
  font-weight: 600;
}
dialog.modal select:focus { outline: 0; background-color: var(--panel); border-color: var(--ink); box-shadow: 0 0 0 4px rgba(255,237,0,.35); }
dialog.modal textarea:focus { outline: 0; background: var(--panel); border-color: var(--ink); box-shadow: 0 0 0 4px rgba(255,237,0,.35); }
dialog.modal label small { display: block; margin-top: 6px; color: var(--muted-deep); font-size: 12px; font-weight: 600; }
dialog.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-error {
  margin: 0 0 14px;
  padding: 10px 13px;
  border-radius: var(--r-sm);
  background: var(--danger-fill);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}
.review-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.review-actions form { margin: 0; }
.btn-approve { background: var(--success); color: #fff; }
.btn-approve:hover { filter: brightness(1.06); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: rgba(16, 15, 12, .88);
}
.lightbox[hidden] { display: none; }
.lightbox-figure { margin: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; max-width: 100%; }
.lightbox-figure img { max-width: min(1100px, 86vw); max-height: 80vh; border-radius: 12px; background: #fff; }
.lightbox-figure figcaption { color: rgba(247,246,242,.82); font-size: 13px; font-weight: 600; }
.lightbox-close, .lightbox-step {
  flex: none;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(247,246,242,.12);
  color: var(--paper);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close { position: absolute; top: 20px; right: 22px; font-size: 22px; }
.lightbox-close:hover, .lightbox-step:hover { background: rgba(247,246,242,.24); }
.cell-actions { white-space: nowrap; }
@media (max-width: 640px) { .lightbox-step { width: 38px; height: 38px; } }

/* ---------------------------------------------------------- section tabs */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 18px;
}

.tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  border: 1.5px solid var(--chrome-border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}

.tabs .tab:hover { border-color: var(--ink); transform: translateY(-1px); }
.tabs .tab:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.tabs .tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--yellow);
}

.tab-icon { font-size: 15px; line-height: 1; }

.tab-count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--muted-deep);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.tab-count.is-live { background: var(--yellow); color: var(--ink); }
.tabs .tab.is-active .tab-count { background: rgba(247, 246, 242, .18); color: var(--paper); }
.tabs .tab.is-active .tab-count.is-live { background: var(--yellow); color: var(--ink); }

/* Below the tablet break the labels go and the icons carry the tabs, so all
   six sections stay on screen instead of scrolling off the right edge. */
@media (max-width: 720px) {
  .tabs { gap: 6px; }
  .tabs .tab { padding: 10px 12px; gap: 6px; }
  .tabs .tab-label { display: none; }
  .tabs .tab.is-active .tab-label { display: inline; }
  .tab-icon { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .tabs .tab { transition: none; }
  .tabs .tab:hover { transform: none; }
}

/* ------------------------------------------------- label / value details */

.detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px 24px;
  margin: 0;
}

.detail-list > div { min-width: 0; }

.detail-list dt {
  margin: 0 0 3px;
  color: var(--muted-deep);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.detail-list dd {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.field-hint {
  margin: -4px 0 14px;
  color: var(--muted-deep);
  font-size: 13px;
}

/* ------------------------------------------------------- searchable select */

.ajax-select { position: relative; }

.ajax-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--fill-border);
  border-radius: var(--r-lg);
  background: var(--fill);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.ajax-select-button:focus-visible {
  outline: 0;
  background: var(--panel);
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(255, 237, 0, .35);
}

.ajax-select-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ajax-select-text.is-placeholder { color: var(--muted-deep); font-weight: 600; }
.ajax-select-caret { flex: none; color: var(--muted-deep); }

.ajax-select-clear {
  position: absolute;
  top: 50%;
  right: 38px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: var(--chrome-border);
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.ajax-select-clear[hidden] { display: none; }
.ajax-select-clear:hover { background: var(--ink); color: var(--paper); }

.ajax-select-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 10px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(28, 27, 23, .18);
}

.ajax-select-panel[hidden] { display: none; }

.ajax-select-search {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--fill-border);
  border-radius: var(--r-sm);
  background: var(--fill);
  font: inherit;
  font-weight: 650;
}

.ajax-select-search:focus { outline: 0; border-color: var(--ink); background: var(--panel); }

.ajax-select-list {
  max-height: 260px;
  margin: 8px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.ajax-select-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.ajax-select-option small { color: var(--muted-deep); font-size: 12px; font-weight: 600; }
.ajax-select-option:hover, .ajax-select-option:focus { background: var(--fill); outline: 0; }
.ajax-select-option.is-selected { background: var(--yellow); }

.ajax-select-note {
  padding: 12px 11px;
  color: var(--muted-deep);
  font-size: 13px;
  font-weight: 600;
}

/* ------------------------------------------------- counts that need noticing */

.count-badge {
  display: inline-block;
  min-width: 30px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--muted-deep);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.count-badge.is-alert { background: var(--danger-fill); color: var(--danger); }

/* A row the operator should look at before acting on it. The badge already
   carries the number; the tint is what makes it findable while scrolling. */
.table tbody tr.row-alert > td { background: var(--danger-fill); }
.table tbody tr.row-alert:hover > td { background: var(--danger-fill); filter: brightness(.98); }

.card.metric.is-alert { border-color: var(--danger-border); }
.card.metric.is-alert strong { color: var(--danger); }

.inline-form { display: inline; margin: 0; }

/* ------------------------------------------------------- current image card */

.current-image {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 0 0 16px;
  padding: 14px;
  border: 1.5px solid var(--chrome-border);
  border-radius: var(--r-lg);
  background: var(--fill);
}

.current-image img {
  flex: none;
  width: 160px;
  height: 110px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--panel);
  cursor: zoom-in;
}

.current-image strong { display: block; font-size: 14px; }
.current-image small { display: block; margin: 3px 0 10px; color: var(--muted-deep); overflow-wrap: anywhere; }

@media (max-width: 560px) {
  .current-image { flex-direction: column; }
  .current-image img { width: 100%; height: auto; }
}

/* ------------------------------------------------ site content, by section */

.content-section { margin: 0 0 26px; }

.content-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--chrome-border);
}

.content-section-head h2 { margin: 0; font-size: 17px; font-weight: 800; }
.content-section-head span { color: var(--muted-deep); font-size: 12px; font-weight: 700; }

.content-sections { margin-top: 14px; }
.content-sections .content-section { margin: 0; }

.content-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 12px;
}

.content-card {
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--chrome-border);
  border-radius: var(--r-lg);
  background: var(--panel);
  overflow: hidden;
}

.content-card.is-draft { border-style: dashed; background: var(--fill); }

.content-card-image {
  display: block;
  width: 100%;
  height: 132px;
  object-fit: cover;
  background: var(--fill);
  cursor: zoom-in;
}

.content-card-body { flex: 1; padding: 12px 14px 8px; min-width: 0; }

.content-card-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
}

.content-card-meta code {
  color: var(--muted-deep);
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.content-card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 800; line-height: 1.35; }
.content-card p { margin: 0 0 8px; color: var(--muted-deep); font-size: 13px; line-height: 1.55; }
.content-card-link { font-family: inherit; overflow-wrap: anywhere; }

.content-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.content-card-tags span {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--muted-deep);
  font-size: 11px;
  font-weight: 700;
}

.content-card-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 12px;
}

.image-field-form { margin: 0; }
.content-card .status { flex: none; }

/* ------------------------------------------------------ validation messages */

/* Yii renders a field error into `.help-block` and marks the wrapper
   `.has-error`. Neither had a rule, so a rejected field looked exactly like an
   accepted one and the reason was printed in body text. */
.help-block {
  margin: 7px 0 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 650;
}

.help-block:empty { display: none; }

.has-error > label,
.has-error > label > span { color: var(--danger); }

.has-error input,
.has-error select,
.has-error textarea,
.has-error .ajax-select-button {
  border-color: var(--danger-border);
  background: var(--danger-fill);
}

.has-error input:focus,
.has-error select:focus,
.has-error textarea:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(210, 67, 48, .18);
}

/* The summary above a form, for the errors that belong to no single field. */
.alert.error ul,
.alert.error p { margin: 0; padding-left: 18px; }
.alert.error li { font-weight: 650; }

/* Several values, as removable chips above the control. */
.ajax-select--multiple .ajax-select-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.ajax-select--multiple .ajax-select-chips:empty { display: none; }

.ajax-select-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 11px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.ajax-select-chip-remove {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(28, 27, 23, .14);
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.ajax-select-chip-remove:hover { background: var(--ink); color: var(--yellow); }

/* The picture that goes out with a notification. */
.notification-image { display: grid; gap: 10px; justify-items: start; }
.notification-image img {
  max-width: 260px;
  max-height: 170px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--chrome-border);
  background: var(--fill);
  cursor: zoom-in;
}
.notification-image img[hidden] { display: none; }
.notification-image .actions { display: flex; gap: 8px; }
.notification-image label.btn { margin: 0; cursor: pointer; }

/* A row nobody has looked at yet. */
.table tbody tr.row-new > td { background: rgba(255, 237, 0, .16); }
.table tbody tr.row-new:hover > td { background: rgba(255, 237, 0, .24); }

/* ----------------------------------------------------------------- toolbar */

/* One filter bar rather than a row of unrelated fields: the period on its own
   line because it is chosen first and changes what everything else means, then
   the named filters, then the reference numbers folded away. */
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid var(--fill-border);
  border-radius: var(--r-xl);
  background: var(--fill);
}

/* Grid and flex children default to min-content width, which lets the period
   row push the whole card wider than the screen on a phone. */
.toolbar > * { min-width: 0; }

.toolbar-periods {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.toolbar-periods .segmented { background: var(--panel); max-width: 100%; }
.toolbar-periods .segmented > * { flex: none; white-space: nowrap; }
.toolbar-range { display: flex; align-items: center; gap: 8px; }
.toolbar-range .vostok-date, .toolbar-range .vostok-date--alt { min-width: 250px; background: var(--panel); }

/* The period buttons are links — they are a place you can go back to — except
   Custom, which only opens the calendar, so it has to be told to look alike. */
.segmented button {
  padding: 10px 16px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--muted-deep);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-color), color var(--t-color);
}
.segmented button.active { background: var(--yellow); color: var(--ink); font-weight: 800; }
.segmented a:hover, .segmented button:hover { color: var(--ink); }

.toolbar-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: end;
  gap: 12px;
}
.toolbar .field { display: grid; gap: 7px; margin: 0; }
.toolbar .field > span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--muted-deep);
}
.toolbar .field input {
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--fill-border);
  border-radius: var(--r-lg);
  background: var(--panel);
  font: inherit;
  font-weight: 600;
}
.toolbar .field input:focus {
  outline: 0;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(255, 237, 0, .35);
}
.toolbar .ajax-select-button { background: var(--panel); }

/* Apply first and filled, Reset beside it and quiet: one is the action, the
   other is the way back. */
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.toolbar-actions .btn { white-space: nowrap; }

.toolbar-more > summary {
  width: max-content;
  padding: 6px 0;
  color: var(--muted-deep);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.toolbar-more > summary:hover { color: var(--ink); }
.toolbar-more .toolbar-fields { padding-top: 10px; }

@media (max-width: 980px) {
  .grid-3 { grid-template-columns: 1fr; }
  .toolbar { padding: 14px; }
  .toolbar-periods { align-items: stretch; flex-direction: column; }
  /* The six periods stay on one line and scroll, rather than reflowing into a
     block of ragged buttons that no longer reads as one control. */
  .toolbar-periods .segmented { width: 100%; overflow-x: auto; }
  .toolbar-range, .toolbar-range .vostok-date, .toolbar-range .vostok-date--alt { width: 100%; min-width: 0; }
  .toolbar-fields { grid-template-columns: 1fr; }
  .toolbar-actions .btn { flex: 1; text-align: center; }
}

/* The back office's own error page. */
.error-page { max-width: 620px; margin: 8vh auto 0; text-align: left; }
.error-page h1 { margin: 8px 0 10px; font-size: 26px; letter-spacing: -.02em; }
.error-page p { margin: 0 0 22px; color: var(--muted-deep); font-size: 15px; line-height: 1.55; }
.error-page .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* The passenger's photo, or their initials, beside the name on their card. */
.client-identity { display: flex; align-items: center; gap: 16px; }
.client-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  object-fit: cover;
}
img.client-avatar { border: 1px solid var(--fill-border); background: var(--fill); cursor: zoom-in; }

/* ------------------------------------------------- ActiveForm field groups */

/* `.card label` assumes the label wraps its input, and spaces itself for that.
   A field built by ActiveForm is a group — label, input, hint, error, one
   after another — so there the label sat 15px above its own input and the
   next field touched this one. In a group the label belongs to the input
   below it and the space goes between groups. */
.card .form-group { min-width: 0; margin: 0 0 16px; }
.card .form-group > label { display: block; margin: 0 0 7px; }
.card .form-group > .hint-block { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; font-weight: 500; }
.card .form-group > .help-block { margin: 6px 0 0; font-size: 12px; }
.card .form-group.required > label::after { content: ' *'; color: var(--danger); font-weight: 700; }

/* ------------------------------------------------------------ staff alerts
   The bell in the header: what the office has been told, and a short banner
   when something arrives while the page is open. */
.staff-alerts { position: relative; margin-left: auto; flex: none; }
.staff-alerts + .lang-switch { margin-left: 10px; }

/* The signed-in person, in the header: their name opens a small menu with
 * what they do to their own account. */
.profile-menu { position: relative; margin-left: 10px; min-width: 0; }
.profile-menu-button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; max-width: 280px; padding: 0 12px;
  border: 1px solid var(--chrome-border); border-radius: 12px;
  background: var(--panel); color: var(--ink);
  font: 700 13.5px/1.2 inherit; cursor: pointer;
}
.profile-menu-button:hover { border-color: var(--ink); }
.profile-menu-button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.profile-menu-button[aria-expanded="true"] { border-color: var(--ink); }
.profile-menu-button .workspace-identity { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu-avatar { flex: none; color: var(--muted-deep); }
.profile-menu-caret { flex: none; transition: transform .15s ease; }
.profile-menu-button[aria-expanded="true"] .profile-menu-caret { transform: rotate(180deg); }
.profile-menu-panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  width: max-content; min-width: 220px; max-width: min(320px, calc(100vw - 24px));
  padding: 6px; border: 1px solid var(--chrome-border); border-radius: 14px;
  background: var(--panel); box-shadow: 0 18px 44px rgba(28, 27, 23, .18);
}
.profile-menu-head { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--fill-border); }
.profile-menu-head strong { font-size: 13.5px; font-weight: 800; overflow-wrap: anywhere; }
.profile-menu-head span { font-size: 12px; color: var(--muted-deep); }
.profile-menu-form { margin: 0; }
.profile-menu-item {
  display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 9px;
  background: none; color: var(--ink); text-align: left; text-decoration: none;
  font: 600 13.5px/1.3 inherit; cursor: pointer;
}
.profile-menu-item:hover, .profile-menu-item:focus-visible { background: var(--fill); outline: none; }
.profile-menu-item:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
@media (max-width: 760px) {
  /* The name does not fit beside the bell and the flags; the figure stands for it. */
  .profile-menu { margin-left: 6px; }
  .profile-menu-button { padding: 0 9px; gap: 4px; }
  .profile-menu-button .workspace-identity { display: none; }
}
@media (max-width: 520px) { .profile-menu-button { min-height: 36px; } .profile-menu-panel { position: fixed; top: 68px; right: 12px; } }
/* The header is one row of five things. On a phone the row was wider than the
 * screen: the account button kept its width while its box was squeezed to
 * nothing, so it hung off the right edge and every page scrolled sideways.
 * The button is never squeezed, and the row gives up what it can spare —
 * the gaps, and the flags beside UZ and RU — so the page title keeps room. */
.workspace-header > .profile-menu, .workspace-header > .staff-alerts { flex: none; }
@media (max-width: 520px) {
  /* Two classes: the operations sheet is loaded after this one and sets the
   * row's own gap and padding with one. */
  .main-column .workspace-header { gap: 8px; padding-left: 14px; padding-right: 14px; }
  .workspace-header .lang-switch img { display: none; }
  .workspace-header .lang-switch a { padding: 5px 9px; }
  .workspace-header .profile-menu, .workspace-header .staff-alerts + .lang-switch { margin-left: 0; }
}
.staff-alerts-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--chrome-border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.staff-alerts-button:hover { border-color: var(--ink); }
.staff-alerts-button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.staff-alerts-button.has-unread { background: var(--yellow); border-color: var(--ink); }
.staff-alerts-button b {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font: 800 11px/20px var(--mono);
  text-align: center;
}
.staff-alerts-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  width: min(380px, calc(100vw - 24px));
  border: 1px solid var(--chrome-border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(28, 27, 23, .18);
  overflow: hidden;
}
.staff-alerts-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--fill-border); }
.staff-alerts-head strong { font-size: 14px; font-weight: 800; }
.staff-alerts-head button { border: 0; background: none; padding: 4px 0; color: var(--muted-deep); font: 700 12.5px/1.2 inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.staff-alerts-head button:hover { color: var(--ink); }
.staff-alerts-list { max-height: min(60vh, 440px); overflow-y: auto; }
.staff-alerts-empty { margin: 0; padding: 18px 16px; color: var(--muted-deep); font-size: 13px; line-height: 1.5; }
.staff-alert { display: block; padding: 12px 16px 13px; border-bottom: 1px solid var(--fill-border); color: var(--ink); text-decoration: none; }
.staff-alert:last-child { border-bottom: 0; }
a.staff-alert:hover { background: var(--fill); }
.staff-alert.is-unread { box-shadow: inset 3px 0 0 var(--yellow-pressed); background: rgba(255, 237, 0, .08); }
.staff-alert strong { display: block; font-size: 13.5px; font-weight: 800; }
.staff-alert span { display: block; margin-top: 3px; font-size: 13px; line-height: 1.45; color: var(--ink); }
.staff-alert small { display: block; margin-top: 5px; font-family: var(--mono); font-size: 11.5px; color: var(--muted-deep); }
.staff-alert-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1300;
  display: block;
  width: min(380px, calc(100vw - 32px));
  padding: 14px 16px 15px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 16px 40px rgba(28, 27, 23, .32), inset 4px 0 0 var(--yellow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.staff-alert-toast.show { opacity: 1; transform: none; }
.staff-alert-toast strong { display: block; font-size: 14px; font-weight: 800; color: var(--yellow); }
.staff-alert-toast span { display: block; margin-top: 4px; font-size: 13px; line-height: 1.45; }
@media (prefers-reduced-motion: reduce) { .staff-alert-toast { transition: none; } }
@media (max-width: 520px) { .staff-alerts + .lang-switch { margin-left: 6px; } .staff-alerts-button { width: 36px; height: 36px; } }
/* On a phone the bell is in the middle of the header, so a panel hung from it
   would run off the left edge: it spans the screen under the header instead. */
@media (max-width: 640px) {
  .staff-alerts-panel { position: fixed; left: 12px; right: 12px; top: 68px; width: auto; }
}

/* ------------------------------------------------- tones, badges, wide lists */

/* A badge coloured by what a model says of itself (success, info, warning,
   danger) rather than by the name of one particular status. */
.status.success { background: var(--success-fill); border-color: transparent; color: var(--success); }
.status.warning { background: rgba(255, 237, 0, .22); border-color: transparent; color: var(--gold-text); }
.status.danger { background: var(--danger-fill); border-color: transparent; color: var(--danger); }
.status.neutral::before { opacity: .45; }

/* Several short labels in one cell: a vehicle's tariffs. */
.badge-row { display: flex; flex-wrap: wrap; gap: 4px; }
.mini-badge {
  display: inline-block;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid var(--fill-border);
  border-radius: 6px;
  background: var(--fill);
  color: var(--muted-deep);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
  /* 2026-11-14: wraps instead of cutting "Лабо / Дамас — Грузоперевозки" to its first word. */
  overflow-wrap: anywhere;
}

/* A value nobody has given yet. */
.table .unset, .detail-list .unset { color: var(--muted-soft, var(--muted)); font-weight: 500; }

/* Lists with many columns keep to the card: the widths are set, a long name
   is cut with an ellipsis and stays readable in its title. */
.table.vehicle-table { table-layout: fixed; min-width: 920px; }
.table.vehicle-table td { overflow-wrap: anywhere; }
.table .cell-line { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table.vehicle-table .status { padding: 5px 9px; gap: 6px; white-space: nowrap; }
.table.vehicle-table .btn { padding-left: 12px; padding-right: 12px; }
.table.vehicle-table th { white-space: normal; overflow-wrap: anywhere; }
.table.vehicle-table td:last-child { padding-left: 4px; padding-right: 4px; text-align: right; }

/* A field shown for one choice of another control. */
[data-visible-when][hidden] { display: none !important; }

/* The registry's word on a company: the number, its band, when it was asked. */
.tax-rating { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.tax-rating-score { font-variant-numeric: tabular-nums; font-weight: 800; }
.tax-note { margin: 10px 0 0; color: var(--muted-deep); font-size: 12.5px; line-height: 1.5; }

/* Cards that follow one another down a page, outside a grid. */
.card.stacked { margin-top: 16px; }

/* Promo codes: who a code is for */
.promo-assignment { border: 1px solid var(--fill-border, #E2E0D8); border-radius: 12px; padding: 14px 16px; margin: 0 0 18px; display: flex; flex-direction: column; gap: 10px; }
.promo-assignment legend { padding: 0 6px; font-weight: 600; }
/* A choice with a line of explanation under its words. `.card label` is a
   one-column grid made for a label above its field; here the box stands
   beside the words, at the size of a box. */
.card .promo-assignment label.promo-choice { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 10px; row-gap: 3px; align-items: center; margin: 0; font-size: 14px; font-weight: 700; cursor: pointer; }
.card .promo-assignment label.promo-choice input { grid-column: 1; grid-row: 1; width: 18px; height: 18px; margin: 0; padding: 0; }
.card .promo-assignment label.promo-choice small { grid-column: 2; font-size: 12.5px; font-weight: 500; line-height: 1.45; opacity: .75; }
.promo-client { margin-left: 28px; max-width: 460px; }
.card .promo-client label.field { margin-bottom: 0; }
.promo-client[hidden] { display: none; }

/* ------------------------------------------------------- consistency layer (2026-10-25, Admin-wide UI audit)
 * One look for the same thing everywhere, found by walking every Admin page in Russian and Uzbek. */

/* Links in content: ink, not the browser's blue; underlined where they are words in a sentence. */
#admin-content a:not([class]), .table td a:not(.btn):not(.row-action) {
  color: var(--ink); font-weight: 700; text-decoration: none;
  background-image: linear-gradient(var(--yellow-pressed), var(--yellow-pressed)); background-size: 0 2px;
  background-position: 0 100%; background-repeat: no-repeat; transition: background-size var(--t-color);
}
#admin-content a:not([class]):hover, .table td a:not(.btn):not(.row-action):hover { background-size: 100% 2px; }
#admin-content p a:not([class]), #admin-content small a:not([class]) { text-decoration: underline; text-underline-offset: 3px; background: none; }

/* A keyboard focus everyone can see, on anything that takes one (the mouse does not draw it). */
:where(a, button, summary, select, input[type="checkbox"], input[type="radio"], [tabindex]):focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px rgba(255, 237, 0, .55);
}
.sidebar :where(a, button):focus-visible { outline-color: var(--yellow); box-shadow: none; }

/* Icons: the drawn set (AdminIcon), one size per place, beside their words. */
.icon { flex: none; vertical-align: -3px; }
.btn .icon { width: 16px; height: 16px; margin-left: -2px; }
.btn.sm, .actions .btn, td.actions .btn { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn.sm .icon, .actions .btn .icon { width: 15px; height: 15px; }
.icon-button { display: inline-grid; place-items: center; }
.icon-button .icon { width: 17px; height: 17px; }
.tab-icon { display: inline-grid; place-items: center; }
.tab-icon .icon { width: 16px; height: 16px; }
.menu-toggle { display: inline-grid; place-items: center; }
.metric-symbol .icon { width: 18px; height: 18px; }

/* Row actions: on one line at the end of the row; the one that removes or blocks looks like it. */
/* Each button keeps its words on one line; several buttons wrap onto a second line rather than widen the table. */
td.actions, .table td.actions { white-space: normal; text-align: right; }
.table td.actions .btn { margin-block: 2px; }
td.actions > .actions, td.actions { justify-content: flex-end; }
.table td.actions { display: table-cell; }
.table td.actions > * { vertical-align: middle; }
.table td.actions > * + * { margin-left: 6px; }
.table td.actions form, .table td.actions .inline-form { display: inline-block; margin: 0; vertical-align: middle; }
.btn.danger-soft { background: transparent; border: 1.5px solid var(--danger-border); color: var(--danger); }
.btn.danger-soft:hover { background: var(--danger-fill); }

/* A status pill reads as one word group; it never breaks over two lines inside a table. */
.table .status { white-space: nowrap; }
.table td.num, .table th.num, .table td.money, .table th.money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* A long value keeps the table narrow; the whole value is in its title. */
.cell-truncate { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A passenger worth a second look: a red edge and the red count, not a whole red row. */
.table tbody tr.row-alert > td { background: transparent; }
.table tbody tr.row-alert > td:first-child { box-shadow: inset 3px 0 var(--danger); }
.table tbody tr.row-alert:hover > td { background: var(--fill); filter: none; }

/* Grouped choices inside forms, drawn like the cards around them, not the browser's grey frame. */
.card fieldset, dialog.modal fieldset {
  margin: 0 0 15px; padding: 12px 14px 6px; border: 1.5px solid var(--fill-border); border-radius: var(--r-lg); min-width: 0;
}
.card fieldset > legend, dialog.modal fieldset > legend { padding: 0 6px; font-size: 13px; font-weight: 700; }
.card fieldset label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 600; }
.card fieldset label input { width: auto; }

/* Date fields: one calendar — the Admin's button; the browser's own picker icon inside the field is hidden. */
.admin-date-field input::-webkit-calendar-picker-indicator { display: none; }
.admin-date-trigger { display: inline-grid; place-items: center; }
.admin-date-trigger .icon { width: 17px; height: 17px; }
.ajax-select-caret { display: inline-grid; place-items: center; }

/* The live dot ("В эфире" / "Jonli"), the same on the Dashboard as on the dispatch page. */
.live-pill { gap: 7px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: admin-live 1.6s ease-in-out infinite; }
@keyframes admin-live { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* The way back to the list a page belongs to: one look on every form. */
.back-link { display: inline-flex; align-items: center; gap: 6px; }

/* A pager arrow is a drawn chevron, aligned with the numbers beside it. */
.pagination a .icon, .pagination span .icon { width: 16px; height: 16px; vertical-align: -3px; }
.pagination [aria-current="page"] { font-weight: 800; }

/* A form on its way: the button pressed says so (admin-shell.js marks it aria-busy; a second press does nothing). */
.btn[aria-busy="true"], button[aria-busy="true"] { cursor: progress; opacity: .75; }
.btn[aria-busy="true"]::after {
  content: ''; width: 13px; height: 13px; margin-left: 4px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: admin-spin .7s linear infinite;
}
@keyframes admin-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn[aria-busy="true"]::after { animation: none; } }

/* Tables in a narrow side column (an order's route, its revisions): headings may wrap, the table scrolls in its card,
 * never the page. */
aside .table th { letter-spacing: .06em; white-space: normal; }
aside .table-wrap { overflow-x: auto; }

/* "No results" under a table is said only where the table does not already say so in a row of its own
 * (a single cell across the table, or an .empty / .empty-state block in the same card). */
:where(.card, section, .table-wrap):has(table tbody td[colspan], .empty, .empty-state) .pager-summary.is-empty { display: none; }

/* A notice with its icon first (2026-10-25: IP telephony says why there is no recording). */
.alert.alert-with-icon { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; }
.alert.alert-with-icon > svg { flex: none; margin-top: 1px; color: var(--muted-deep); }
.alert.alert-with-icon a { color: inherit; font-weight: 700; }

/* ------------------------------------------------- compact long pages (2026-10-30) */

/* A column of a split may never be wider than its share: without this one wide table pushed the whole page sideways. */
.split > * { min-width: 0; }

/* Key figures on one line, above the page's cards. Two a row on a phone. */
.metric-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric-strip .card.metric { min-width: 0; padding: 14px 16px; }
.metric-strip .metric strong { margin-top: 6px; font-size: 21px; line-height: 1.2; overflow-wrap: anywhere; }
.metric-strip .metric small { display: block; margin-top: 4px; color: var(--muted-deep); font-size: 12px; }
.metric-strip .metric a { color: inherit; }
.metric-strip.is-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 820px) { .metric-strip.is-four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Cards one under the other, the gap in one place. A shared partial carries its own inline margin for the pages that
 * stack by hand, so here the margin has to lose to the gap. */
.card-stack { display: grid; gap: 14px; align-content: start; min-width: 0; }
.card-stack > * { min-width: 0; }
.card-stack > .card { margin: 0 !important; }
.card-stack + .card-stack, .split + .card-stack { margin-top: 14px; }

/* Two small cards side by side, stacked when there is no room for both. */
.card-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card-pair > * { min-width: 0; margin: 0 !important; }
/* An odd card left over at the end takes the whole row instead of half of it with a hole beside it (2026-11-14). */
.card-pair > :last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 1320px) { .card-pair { grid-template-columns: minmax(0, 1fr); } }

/* A card that folds: what is read now and then stays one line until it is wanted. */
details.card > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 22px; font-size: 16px; font-weight: 800; list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before {
  content: ''; flex: none; width: 7px; height: 7px; margin: 0 3px 0 2px;
  border-right: 2px solid var(--muted-deep); border-bottom: 2px solid var(--muted-deep);
  transform: rotate(-45deg); transition: transform .15s ease;
}
details.card + .card { margin-top: 14px; }
details.card[open] > summary::before { transform: rotate(45deg); }
details.card[open] > summary { margin-bottom: 14px; }
details.card > summary h2 { margin: 0; font-size: 16px; }
details.card > summary strong { font-weight: 800; }
details.card > summary .fold-note { color: var(--muted-deep); font-size: 12.5px; font-weight: 600; }
details.card > summary .fold-end { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { details.card > summary::before { transition: none; } }
/* On a phone the title has its own line beside the arrow, whatever its length; the note and the action go under it. */
@media (max-width: 640px) { details.card > summary h2 { flex: 1 1 calc(100% - 30px); } }

/* A long table keeps its rows and scrolls inside its card, under its own headings. */
.table-wrap.is-capped { max-height: 460px; overscroll-behavior: contain; }
.table-wrap.is-capped thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.table.is-compact th, .table.is-compact td { padding: 9px 8px; font-size: 13px; }
.table.is-compact th { font-size: 9.5px; letter-spacing: .1em; }
.table.is-compact small { display: block; margin-top: 2px; color: var(--muted-deep); font-size: 12px; }
.table.is-compact .btn { padding: 6px 10px; font-size: 12.5px; white-space: nowrap; }
/* Room to read on a phone: the table scrolls in its card instead of squeezing every column to one word. */
.table.is-wide-route { min-width: 560px; }
/* A long address reads as two lines; the whole of it is on the title. */
.clip-lines { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.clip-lines.is-one { -webkit-line-clamp: 1; }
/* The same for a list of rows in a side column. */
.list-capped { max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }

/* App sessions as a short list in a narrow column (2026-11-14): sessions/_compact.php. */
.session-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.session-list li { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--fill-border); border-radius: var(--r-lg); background: var(--panel); min-width: 0; }
.session-list .session-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.session-list .session-line strong { min-width: 0; overflow-wrap: anywhere; }
.session-list small { color: var(--muted-deep); font-size: 12.5px; overflow-wrap: anywhere; }
.session-list .num { font-family: var(--mono); font-size: 12px; }
.session-list .session-end { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.session-list .session-end input { flex: 1 1 140px; min-width: 0; }

/* A wide table on a phone (2026-11-14): `.table-stack` turns each row into a card and each cell into a line with its
   own heading, taken from the cell's `data-label`. Nothing scrolls sideways and nothing is cut. Only below 760px, and
   only for the whole table at once — a single cell made a block on a desktop row would break the row.
   It stays at the end of the file: `.table.is-compact td` and `.table.is-wide-route` weigh the same and would win. */
@media (max-width: 760px) {
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; box-sizing: border-box; }
  .table-stack, .table.table-stack { table-layout: auto; min-width: 0; }
  .table-stack colgroup { display: none; }
  .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-stack tbody tr {
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid var(--fill-border);
    border-radius: var(--r-lg);
    background: var(--panel);
  }
  .table-stack tbody tr:hover { background: var(--panel); }
  .table-stack td { padding: 6px 0; border-bottom: 0; text-align: left !important; }
  /* The heading sits in the left third, the value and its notes flow in the rest as they do on a desktop row. */
  .table-stack td[data-label] { position: relative; padding-left: 40%; min-height: 22px; }
  .table-stack td[data-label]::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    top: 8px;
    width: 37%;
    font-family: var(--mono);
    font-size: 9.5px;
    line-height: 1.4;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted-soft);
    overflow-wrap: anywhere;
  }
  /* The cell that names the row (a person, an order) is the card's heading: full width, no label of its own. */
  .table-stack td.stack-title { padding: 0 0 8px !important; margin-bottom: 4px; border-bottom: 1px solid var(--divider); }
  .table-stack td.stack-title::before { display: none; }
  .table-stack td.row-actions, .table-stack td.actions { padding-top: 10px; text-align: left !important; }
  .table-stack td[colspan] { display: block; text-align: center !important; }
  /* A long status or address wraps inside the card; a chip kept on one line would push the card sideways. */
  .table-stack td { overflow-wrap: anywhere; }
  .table-stack td .status { white-space: normal; max-width: 100%; }
}

/* The Sessions table (2026-11-14): fixed columns so ten of them fit the page; the end-session form wraps in its cell. */
.sessions-table { table-layout: fixed; }
.sessions-table td { overflow-wrap: anywhere; }
/* A date and its time on two lines in a narrow column, never drawn over the next cell. */
.sessions-table td.num { white-space: normal; }
.sessions-table .session-end { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.sessions-table .session-end input { width: 100%; min-width: 0; }

/* The order list (2026-11-14): the route takes the spare width instead of a fixed minimum that pushed the table wider than the page. */
.orders-table .route-cell { min-width: 200px; overflow-wrap: anywhere; }
.sessions-table .session-end .btn { max-width: 100%; white-space: normal; text-align: left; }
