/* Prototype admin mockup. System fonts only, no network resource. Made for a laptop (1366x768 and up);
   at phone width the tables stack into cards and nothing scrolls sideways. */

:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --ink: #18202d;
  --muted: #566274;
  --line: #d9dee7;
  --line-soft: #e9edf3;
  --nav-bg: #14213d;
  --accent: #1d5fc4;
  --new-ink: #174ea6;      --new-bg: #e4edfb;
  --decide-ink: #8a4b00;   --decide-bg: #fff0d6;   --decide-line: #f0c36d;
  --overdue-ink: #a4231a;  --overdue-bg: #fde7e4;
  --dispute-ink: #5b2fb3;  --dispute-bg: #eee7fb;
  --ok-ink: #0a6b3f;       --ok-bg: #e1f4ea;       --ok-line: #8fd1ae;
  --muted-bg: #eceff4;
  --radius: 10px;
  --yellow: #ffc800;       --yellow-ink: #1b1f2a;   --yellow-hover: #e6b400;   /* the driver app's brand colours (fleet-data §13.11) */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 3px solid #7aa7ff; outline-offset: 2px; }
.screen:focus { outline: none; }

h1 { font-size: 24px; line-height: 1.25; margin: 0 0 6px; }
h2 { font-size: 17px; line-height: 1.3; margin: 0 0 10px; }
p { margin: 0 0 10px; }

/* ---------- header ---------- */

.topbar { background: var(--nav-bg); color: #fff; }
.topbar-row {
  max-width: 1400px; margin: 0 auto; padding: 14px 24px; min-height: 68px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; line-height: 1.3; white-space: nowrap; }
.brand .ti {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px; background: var(--yellow); color: var(--yellow-ink);
  font-size: 17px; font-weight: 900; letter-spacing: -.03em; line-height: 1;
}
.brand-name span { font-weight: 400; opacity: .75; margin-left: 4px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; flex: 1 1 auto; }
.nav a {
  color: #dbe4f5; text-decoration: none; padding: 9px 14px; border-radius: 8px; font-weight: 500; line-height: 1.4;
}
.nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--nav-bg); }
.demo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-left: auto; }
.today { font-weight: 600; }
.demo-mark {
  background: var(--yellow); color: var(--yellow-ink); font-size: 13px; font-weight: 700; line-height: 1.3;
  padding: 3px 11px; border-radius: 999px; white-space: nowrap;
}

/* the live link with the driver app: the reset button in the header, the out-of-step banner, the live messages */
.reset-btn {
  background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .6); border-radius: 8px;
  padding: 6px 14px; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.3; cursor: pointer;
}
.reset-btn:hover { background: rgba(255, 255, 255, .14); }
.reset-btn:focus-visible { outline: 3px solid #7aa7ff; outline-offset: 2px; }
.sync {
  position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px;
  padding: 10px 24px; background: #ffd166; color: #2a2100; font-weight: 600; border-bottom: 1px solid #e0b44c;
}
.sync[hidden] { display: none; }
.nav-badge {
  display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: #e5322d; color: #fff;
  font-size: 13px; font-weight: 700; line-height: 20px; text-align: center;
}
.live-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; color: var(--muted); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.live-divider::before, .live-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.bubble-live { white-space: pre-wrap; overflow-wrap: anywhere; background: #fff7e0; border: 1px solid #f0d878; }

.screen { max-width: 1400px; margin: 0 auto; padding: 24px 24px 32px; }
.foot { max-width: 1400px; margin: 0 auto; padding: 0 24px 32px; color: var(--muted); font-size: 14px; }

.lead { color: var(--muted); margin: 0 0 16px; max-width: 80ch; }
.sub { color: var(--muted); font-size: 14px; }
.unknown { color: var(--decide-ink); background: var(--decide-bg); padding: 1px 8px; border-radius: 6px; font-weight: 600; }
.link { font-weight: 600; }
.plate { font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.nw { white-space: nowrap; }
.uin { display: inline-block; max-width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }
.amt { font-weight: 700; font-size: 16px; white-space: nowrap; }
.count {
  display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 999px; text-align: center;
  background: rgba(0, 0, 0, .09); font-size: 13px; font-weight: 700; line-height: 22px;
}
.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px; }

/* ---------- chips ---------- */

.chip { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; line-height: 1.35; }
.tone-new { background: var(--new-bg); color: var(--new-ink); }
.tone-decide { background: var(--decide-bg); color: var(--decide-ink); }
.tone-overdue { background: var(--overdue-bg); color: var(--overdue-ink); }
.tone-disputes { background: var(--dispute-bg); color: var(--dispute-ink); }
.tone-ok { background: var(--ok-bg); color: var(--ok-ink); }
.tone-muted { background: var(--muted-bg); color: var(--muted); }

/* ---------- the strip above the queue tabs ---------- */

.strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 16px 0 6px; }
.stat {
  display: flex; flex-direction: column-reverse; align-items: center; justify-content: center; gap: 2px;
  padding: 14px 18px 12px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
}
.stat-label { color: var(--muted); font-weight: 600; font-size: 14px; }
.stat-colon { display: none; }
.stat-num { font-size: 36px; font-weight: 800; line-height: 1.05; }
.stat-closed { background: var(--ok-bg); border-color: var(--ok-line); }
.stat-closed .stat-label { color: #0a5a35; }
.stat-closed .stat-label::after { content: " →"; }
.stat-closed .stat-num { color: var(--ok-ink); }
.stat-closed:hover { border-color: #5fb88a; }

/* ---------- queue tabs ---------- */

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 12px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600;
}
.tab:hover { border-color: #aab6c8; }
.tab.is-active.tone-new { background: var(--new-ink); border-color: var(--new-ink); color: #fff; }
.tab.is-active.tone-decide { background: #a35a00; border-color: #a35a00; color: #fff; }
.tab.is-active.tone-overdue { background: var(--overdue-ink); border-color: var(--overdue-ink); color: #fff; }
.tab.is-active.tone-disputes { background: var(--dispute-ink); border-color: var(--dispute-ink); color: #fff; }
.tab.is-active .count { background: rgba(255, 255, 255, .25); }

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

.tablewrap {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow-x: auto; margin-bottom: 8px;
}
.data { width: 100%; border-collapse: collapse; }
.data th {
  text-align: left; font-size: 14px; font-weight: 600; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap;
}
.data td { padding: 12px 14px; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.data tr:last-child td { border-bottom: 0; }
.data .row-link { cursor: pointer; }
.data .uin { word-break: normal; white-space: nowrap; }
.t-disputes { table-layout: fixed; }
.t-disputes th:nth-child(1) { width: 8%; }
.t-disputes th:nth-child(2) { width: 15%; }
.t-disputes th:nth-child(3) { width: 22%; }
.t-disputes th:nth-child(4) { width: 24%; }
.t-disputes th:nth-child(5) { width: 9%; }
.t-disputes th:nth-child(6) { width: 22%; }
.t-new td:first-child, .t-overdue td:first-child { min-width: 190px; }
.data .row-link:hover td { background: #f6f9fe; }
.data tr.changed td { background: var(--ok-bg); }
.data tr.changed:hover td { background: #d6efe2; }
.data tr.week td { background: #fff8e8; }
.data tr.week:hover td { background: #fff3d6; }

/* ---------- "requires a decision" cases ---------- */

.block { margin-bottom: 26px; }
.case {
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid #e0952a;
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 12px;
}
.case-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-size: 16px; margin-bottom: 4px; }
.why { margin: 10px 0; max-width: 120ch; }
.btn-link { font-weight: 600; text-decoration: none; }
.btn-link:hover { text-decoration: underline; }

.timeline { list-style: none; margin: 12px 0 4px; padding: 0 0 0 22px; border-left: 3px solid var(--line); }
.timeline li { position: relative; padding: 4px 0 8px 12px; }
.timeline li::before {
  content: ""; position: absolute; left: -29.5px; top: 9px; width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box;
  background: var(--surface); border: 3px solid #8b97a8;
}
.timeline li.at-violation { color: var(--overdue-ink); }
.timeline li.at-violation::before { border-color: var(--overdue-ink); background: var(--overdue-ink); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 6px 0 10px; }
.facts > div { background: var(--bg); border-radius: 8px; padding: 8px 12px; }
.facts .k { display: block; color: var(--muted); font-size: 14px; }
.facts .fact-earliest { background: var(--ok-bg); }
.facts .cap { display: block; margin-top: 2px; font-size: 14px; color: #0a5a35; }

/* ---------- fine card ---------- */

.back { display: inline-block; margin-bottom: 10px; font-weight: 600; text-decoration: none; }
.back:hover { text-decoration: underline; }
.cardhead { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 20px; }
.whopays {
  margin: 12px 0 14px; padding: 10px 14px; background: var(--muted-bg); border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0; font-size: 16px;
}
.notice {
  margin: 12px 0; padding: 12px 16px; border-radius: var(--radius); background: var(--ok-bg);
  border: 1px solid var(--ok-line); color: #064a2b; font-weight: 500;
}
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 14px;
}
.panel-decide { background: var(--decide-bg); border-color: var(--decide-line); }
.panel-decide h2 { color: var(--decide-ink); }
.actionrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.btn {
  appearance: none; -webkit-appearance: none; border: 0; border-radius: 8px; background: var(--yellow); color: var(--yellow-ink);
  font: inherit; font-weight: 700; font-size: 16px; padding: 11px 20px; cursor: pointer;
}
.btn:hover { background: var(--yellow-hover); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.col { min-width: 0; }
dl { margin: 0; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kvwide .kv { grid-template-columns: 210px minmax(0, 1fr); }
.kv dd { margin: 0; }
.cands { margin: 6px 0 0; padding-left: 18px; }

.panel-dates { border-color: var(--ok-line); }
.paycmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.paybox { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: #fafbfd; }
.paybox-earliest { background: var(--ok-bg); border-color: var(--ok-line); }
.paylabel { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.paybox-earliest .paylabel { color: #0a5a35; font-weight: 600; }
.payval { font-size: 22px; font-weight: 700; }
.payval-unknown { font-size: 15px; color: var(--decide-ink); }
.paycap { font-size: 14px; color: #0a5a35; margin-top: 4px; }

/* ---------- mechanic: car list, service book, actions ---------- */

.th-sub { display: block; white-space: normal; font-size: 14px; font-weight: 400; line-height: 1.3; margin-top: 2px; }
.btn-small { font-size: 14px; padding: 7px 14px; }
.cellaction { margin-top: 8px; }
.linkbtn {
  appearance: none; -webkit-appearance: none; border: 0; background: none; padding: 6px 0; cursor: pointer;
  color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; text-align: left; display: block;
}
.checklist { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.ck-item { display: inline-block; min-width: 72px; font-weight: 600; }
.remark { color: var(--decide-ink); }
.data tr.flag td { background: #fff8e8; }
.t-maint td:nth-child(3) { min-width: 200px; }
.evidence { margin: 10px 0 0; padding: 10px 12px; background: var(--new-bg); color: #0f3d8a; border-radius: 8px; }
.panel-actions { background: #f7faff; border-color: #b9c9e8; }
.actiongrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.actionbox .sub { margin: 8px 0 0; }
.actionbox .notice { margin: 0 0 6px; }
.notice-wait { background: var(--decide-bg); border-color: var(--decide-line); color: var(--decide-ink); }

/* ---------- dialogs ---------- */

.thread { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; max-width: 860px; }
.thread-head { border-bottom: 1px solid var(--line-soft); padding-bottom: 10px; margin-bottom: 14px; }
.msg { margin: 0 0 14px; max-width: 80%; }
.msg-out { margin-left: auto; }
.msg-meta { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.bubble { padding: 10px 14px; border-radius: 12px; background: var(--muted-bg); }
.msg-out .bubble { background: var(--new-bg); color: #0f3d8a; }
.replybox { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fafbfd; margin-top: 8px; }
.replytext { margin: 6px 0 12px; }
.replyfoot { display: flex; justify-content: flex-end; }

/* ---------- policy ---------- */

.scope { margin: -8px 0 16px; font-weight: 600; }
.mgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 12px; }
.mode { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 20px; display: flex; flex-direction: column; align-items: flex-start; }
.mode p { margin: 10px 0 0; }
.mode-sel { border-color: var(--yellow); background: #fffbea; }
.mname { font-size: 18px; font-weight: 700; }
.mtag { margin-top: 8px; padding: 2px 10px; border-radius: 999px; background: var(--muted-bg); color: var(--ink); font-size: 14px; font-weight: 600; }
.mtag-sel { background: var(--yellow); color: var(--yellow-ink); }
.mtag-sel::before { content: "✓ "; font-weight: 800; }
.mcombine { margin: 0 0 26px; color: var(--muted); }
.psub { margin: 0 0 12px; font-size: 18px; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 26px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.pname { color: var(--muted); font-weight: 600; }
.pval { font-size: 24px; font-weight: 700; margin: 4px 0 8px; }
.pcard p { margin: 0; }
.compare { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.cmp-col { border-radius: var(--radius); padding: 16px 20px; }
.cmp-bad { background: var(--overdue-bg); border: 1px solid #f2b3ad; }
.cmp-good { background: var(--ok-bg); border: 1px solid var(--ok-line); }
.cmp-label { font-weight: 700; }
.cmp-val { font-size: 34px; font-weight: 800; line-height: 1.2; margin: 6px 0 2px; }
.cmp-bad .cmp-val { color: var(--overdue-ink); }
.cmp-good .cmp-val { color: var(--ok-ink); }
.cmp-when { font-weight: 600; }
.cmp-note { margin-top: 6px; }

/* ---------- phone width: stack, never scroll sideways ---------- */

@media (max-width: 980px) { .mgrid { grid-template-columns: 1fr; } }

@media (max-width: 860px) {
  .cols, .pgrid, .cmp, .paycmp, .strip, .actiongrid { grid-template-columns: 1fr; }
  .demo-meta { margin-left: 0; }
  .stat { flex-direction: row-reverse; align-items: baseline; gap: 10px; padding: 12px 16px; }
  .stat-num { font-size: 30px; }
}

@media (max-width: 760px) {
  .topbar-row, .screen, .foot { padding-left: 16px; padding-right: 16px; }
  .topbar-row { padding-top: 10px; padding-bottom: 12px; gap: 4px 14px; min-height: 0; }
  .nav { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 4px; }
  .nav a { padding: 8px 11px; font-size: 14px; text-align: center; }
  .nav a:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .today { font-size: 13.5px; }
  .sync { padding-left: 16px; padding-right: 16px; }
  .actionrow .btn, .actionbox .btn, .replyfoot .btn { width: 100%; }
  .msg { max-width: 100%; }
  .demo-meta { gap: 4px 10px; }
  .kv, .kvwide .kv { grid-template-columns: 1fr; gap: 2px; }
  .tablewrap { overflow-x: visible; background: transparent; border: 0; }
  .data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .data, .data tbody, .data tr, .data td { display: block; width: 100%; }
  .data tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 0; }
  .data td { border-bottom: 0; padding: 5px 14px; }
  .data td::before { content: attr(data-label); display: block; font-size: 14px; color: var(--muted); }
  .data tr.changed td, .data tr.week td { background: transparent; }
  .data tr.changed { background: var(--ok-bg); }
  .data tr.week { background: #fff8e8; }
}

/* ---------- ACC: the role switcher «Войти как» and the accountant's screens (fleet-data §11) ---------- */

/* header: row 1 = brand · «Войти как» (a compact select) · date, one chip, reset; row 2 = the menu of the chosen role */
.topbar-row { column-gap: 14px; }
.brand { order: 1; }
.roles { order: 2; display: inline-flex; align-items: center; }
.demo-meta { order: 3; gap: 8px 12px; flex-wrap: nowrap; }
.nav { order: 4; flex: 1 1 100%; }
.role-select { display: inline-flex; align-items: center; gap: 8px; }
.roles-label { font-size: 14px; opacity: .85; white-space: nowrap; }
.role-select select {
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--nav-bg); background: #fff;
  padding: 6px 30px 6px 10px; border: 1px solid #fff; border-radius: 8px; cursor: pointer; max-width: 100%;
}
.role-select select:focus-visible { outline: 3px solid #7aa7ff; outline-offset: 2px; }

.denied { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid #e0952a; border-radius: var(--radius); padding: 24px 28px; max-width: 760px; }
.route-status { margin-top: 4px; font-size: 14px; font-weight: 400; color: var(--muted); }
.route-redirect { margin-top: 6px; font-size: 15px; font-weight: 700; color: var(--new-ink); }
.data .cellaction .chip { white-space: normal; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin: 0 0 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { color: var(--muted); font-size: 14px; font-weight: 600; }
.field select {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); min-width: 190px;
  padding: 8px 12px; border: 1px solid #aab6c8; border-radius: 8px;
}
.filters-dl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-left: auto; }
.btn[disabled] { background: #aab6c8; color: #fff; cursor: not-allowed; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 14px; }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile-label { color: var(--muted); font-size: 14px; font-weight: 600; }
.tile-num { margin: 4px 0 2px; font-size: 30px; font-weight: 800; line-height: 1.15; white-space: nowrap; }
.tile-sub { color: var(--muted); font-size: 14px; }
.tile-warm { background: var(--decide-bg); border-color: var(--decide-line); }
.warnbar {
  margin: 0 0 14px; padding: 12px 16px; border-radius: var(--radius); background: var(--decide-bg);
  border: 1px solid var(--decide-line); color: var(--decide-ink); font-weight: 600;
}
.note {
  margin: 6px 0 0; padding: 10px 14px; max-width: 110ch; background: var(--muted-bg);
  border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0;
}
.example {
  margin: 0 0 14px; padding: 10px 14px; background: var(--decide-bg); border: 1px dashed var(--decide-line);
  border-radius: 8px; color: var(--decide-ink); font-weight: 600;
}
.foot-note { margin: 10px 0 0; max-width: 110ch; }
.sumline { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0 0 12px; color: var(--muted); }
.sumline b { color: var(--ink); }

/* the accountant's tables: more columns, smaller type, amounts to the right */
.t-wide { font-size: 14px; }
.t-wide th, .t-wide td { padding: 8px 9px; }
.t-wide th { font-size: 14px; white-space: normal; vertical-align: bottom; line-height: 1.3; }
.data th.num, .data td.num { text-align: right; }
.data td.zero { color: var(--muted); }
.data tr.total td { background: #fafbfd; border-top: 2px solid var(--line); font-weight: 700; }
.t-reg td { line-height: 1.35; font-size: 13px; }
.data.t-reg th, .data.t-reg td { padding-left: 6px; padding-right: 6px; }   /* the 20-digit УИН stays whole, so the other columns give the room back */
.t-reg .uin { font-size: 12.5px; white-space: nowrap; word-break: normal; }
.t-reg th:first-child, .t-reg td:first-child { min-width: 150px; }   /* a fixed room for 20 monospace digits (review-visual 4) */
.t-reg .plate { font-size: 13px; }
.t-holds .uin, .t-1c .uin { font-size: 13px; }
.data td.st { border-left: 4px solid var(--line); min-width: 110px; }
.data td.st-ok { border-left-color: #5fb88a; }
.data td.st-new { border-left-color: #6d9be0; }
.data td.st-decide { border-left-color: #e0952a; }
.data td.st-disputes { border-left-color: #9b7fd6; }
.data td.st-muted { border-left-color: #8b97a8; }
.entry { white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* «Акт сверки» */
.act-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; }
.act { max-width: 920px; padding: 26px 30px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.act-title { margin: 0 0 4px; font-size: 20px; text-align: center; }
.act-period { margin: 0 0 14px; color: var(--muted); text-align: center; }
.act-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; margin: 0 0 14px; }
.act .tablewrap { border: 0; }
.act-closing { margin: 16px 0 0; font-size: 17px; font-weight: 700; }
.act-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 44px; font-size: 14px; color: var(--muted); }
.act-line { height: 26px; margin-bottom: 6px; border-bottom: 1px solid var(--ink); }
.act-mark { margin: 22px 0 0; text-align: right; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }

/* «Отчёты и рассылка» */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 16px; }
.rcard { padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.rcard-name { font-size: 16px; font-weight: 700; }
.rcard .sub { margin: 4px 0 0; }
.rcard-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; }
.schedule { margin: 0 0 12px; font-size: 16px; }
.sent-state { margin: 0; }
.email-body { margin: 0; max-width: 90ch; }
.email-files { margin-top: 10px; }
.email-files ul { display: grid; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.email-files li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.file-name { font-weight: 600; }

@media (max-width: 860px) {
  .tiles, .tiles-3, .cards { grid-template-columns: 1fr 1fr; }
  .act-parties, .act-sign { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .tiles, .tiles-3, .cards { grid-template-columns: 1fr; }
  .filters-dl { margin-left: 0; }
  .roles { width: 100%; }
  .act { padding: 18px 16px; }
  /* the accountant's wide tables do not stack into cards: they keep their columns and scroll inside their own box */
  .tablewrap.tablewrap-wide { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); }
  .data.t-wide { display: table; width: auto; min-width: 100%; }
  .data.t-wide thead { display: table-header-group; position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .data.t-wide tbody { display: table-row-group; width: auto; }
  .data.t-wide tr { display: table-row; width: auto; margin: 0; padding: 0; background: transparent; border: 0; border-radius: 0; }
  .data.t-wide td { display: table-cell; width: auto; padding: 8px 9px; border-bottom: 1px solid var(--line-soft); }
  .data.t-wide td::before { display: none; }
  .data.t-wide.t-reg { min-width: 1100px; }
  .data.t-wide.t-drivers, .data.t-wide.t-holds, .data.t-wide.t-1c { min-width: 820px; }
  .data.t-wide.t-act { min-width: 560px; }
}

/* the act prints alone */
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .topbar, .sync, .foot, .no-print { display: none !important; }
  .screen { max-width: none; margin: 0; padding: 0; }
  .act { max-width: none; padding: 0; border: 0; border-radius: 0; }
  .act .tablewrap { overflow: visible; }
  .t-wide { font-size: 11pt; }
  .data th { background: #fff; color: #000; border-bottom: 1px solid #000; }
  .data td { border-bottom: 1px solid #999; }
  .act-sign, .act-closing { break-inside: avoid; }
}

/* ACC return 1: the mechanic's car list fits 1280 px (it overflowed by 72 px; built for 1366): tighter side padding, a narrower status column, wrapping headers */
.t-maint th, .t-maint td { padding-left: 10px; padding-right: 10px; }
.t-maint td:nth-child(3) { min-width: 170px; }
.t-maint th { white-space: normal; }
.bal { margin-top: 2px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.bal b { color: var(--ink); font-weight: 700; }

/* pre-call round R-ADM1 */
.nav[hidden] { display: none; }
.hint-ignored { margin: 8px 0 0; color: var(--decide-ink); font-size: 14px; }
.data td.num .sub, .data td.num { font-variant-numeric: tabular-nums; }

/* pre-call round R-ADM2: the security service's screen (fleet-data §12) and the shared brand pieces (§13.11) */
@media (max-width: 860px) { .demo-meta { flex-wrap: wrap; } }

.sbstrip {
  margin: 0 0 14px; padding: 12px 16px; line-height: 1.7;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 16px; font-weight: 600;
}
.sbstrip b { font-size: 20px; font-weight: 800; margin-left: 2px; }
.sbs { white-space: nowrap; }
.sbs-sep { color: var(--muted); margin: 0 6px; }
.sbs-expired b, .sbs-blocked b { color: var(--overdue-ink); }
.sbs-warning b { color: var(--decide-ink); }
.sbs-reminder b { color: var(--new-ink); }
.sbs-schedule b { color: var(--ok-ink); }
.sbs-blocked b { color: var(--dispute-ink); }

.t-sec th, .t-sec td { padding-left: 10px; padding-right: 10px; }
.t-sec th { white-space: normal; vertical-align: bottom; line-height: 1.3; }
.t-sec td { line-height: 1.35; }
.t-sec td:nth-child(5) { min-width: 150px; }
.t-sec td:nth-child(7) { min-width: 140px; }
.t-sec td.st { min-width: 200px; }
.t-sec tr.row-sec { cursor: pointer; }
.t-sec tr.row-sec:hover td { background: #f6f9fe; }
.t-sec tr.row-sec.is-open td { background: #f6f9fe; border-bottom-color: transparent; }
.t-sec td.num .sub { text-align: right; }
.t-sec .sec-toggle { display: inline; padding: 0; text-align: left; font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.t-sec .sec-toggle:hover { text-decoration-color: var(--accent); }
.t-sec td.st .chip { white-space: normal; }
.t-sec td.st .btn-small { width: 100%; text-align: left; line-height: 1.3; font-size: 14px; }
.data td.st-sec-expired { border-left-color: #e5322d; }
.data td.st-sec-blocked { border-left-color: #9b7fd6; }
.data td.st-sec-warning { border-left-color: #e0952a; }
.data td.st-sec-reminder { border-left-color: #6d9be0; }
.data td.st-sec-schedule { border-left-color: #5fb88a; }
.read-yes { color: var(--ok-ink); font-weight: 600; font-size: 14px; }
.read-no { color: var(--decide-ink); font-weight: 600; font-size: 14px; }
.data tr.detail-row > td { padding: 0; background: #f6f9fe; border-bottom: 1px solid var(--line); }
.sec-detail-box { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; padding: 14px 16px 18px; }
.sec-detail-box h2 { font-size: 16px; margin: 0 0 8px; }
.hist { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.hist th { text-align: left; font-size: 14px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fafbfd; }
.hist td { padding: 9px 10px; vertical-align: top; border-bottom: 1px solid var(--line-soft); font-size: 14px; line-height: 1.4; }
.hist tr:last-child td { border-bottom: 0; }
.hist tr.hist-last td { background: #fff8e8; }
.hist th:nth-child(1) { width: 92px; }
.hist th:nth-child(2) { width: 110px; }
.hist th:nth-child(4) { width: 118px; }
.sec-preview .pv-card {
  display: flex; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(27, 31, 42, .06), 0 4px 14px rgba(27, 31, 42, .06);
}
.pv-ti {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px; background: var(--yellow); color: var(--yellow-ink);
  font-size: 17px; font-weight: 900; letter-spacing: -.03em;
}
.pv-main { min-width: 0; }
.pv-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.pv-stamp { color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.pv-body { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.pv-channel { margin: 8px 0 0; }
.sec-foot { margin: 6px 0 0; }

@media (max-width: 1100px) { .sec-detail-box { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .t-sec td:nth-child(5), .t-sec td:nth-child(7), .t-sec td.st { min-width: 0; }
  .data tr.detail-row { padding: 0; }
  .data tr.detail-row > td { padding: 0; }
  .data tr.detail-row > td::before { display: none; }
  .hist, .hist tbody, .hist tr, .hist td { display: block; width: 100%; }
  .hist thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .hist tr { border-bottom: 1px solid var(--line-soft); padding: 6px 0; }
  .hist td { border-bottom: 0; padding: 3px 10px; }
  .hist td::before { content: attr(data-label); display: block; font-size: 14px; color: var(--muted); }
  .t-sec td.st .btn-small { width: 100%; }
}

/* the registry has 11 columns and must fit 1242 px (1366 at 110 %): its cells stay at 13 px, the headers and the notes under values at 14 px */
.t-reg th { font-size: 13px; }
.t-reg td .sub, .t-reg .bal { font-size: 13px; }
