/* Design system of the marks web UI — a dark operations console.
   Layered near-black surfaces (page < sidebar < cards < raised), hairline
   borders instead of shadows, one blue accent, and status color that always
   encodes a row outcome: green = new marks, blue = amendments/propagation,
   amber = not found / attention, red = problem rows. Text and layout tokens
   live in :root; every component below reads them, never a raw hex. */

/* --- Fonts: self-hosted Golos Text (latin + cyrillic subsets, weights
       400/500/600). A cyrillic-first grotesque built for Russian UI text;
       the fallback stack keeps every page readable before the font loads. */

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/static/fonts/golos-text-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/static/fonts/golos-text-cyrillic-400.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("/static/fonts/golos-text-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("/static/fonts/golos-text-cyrillic-500.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/static/fonts/golos-text-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/static/fonts/golos-text-cyrillic-600.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* --- Tokens ------------------------------------------------------------- */

:root {
  /* surfaces, light to raised */
  --bg-0: #0a0c10; /* page */
  --bg-1: #10141a; /* sidebar */
  --bg-2: #161b23; /* cards, inputs */
  --bg-3: #1d242e; /* hover, raised */
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);

  /* text */
  --text-1: #eef1f6;
  --text-2: #97a1b0;
  --text-3: #5f6b7a;

  /* the one accent (saturated for fills, lighter for text on dark) */
  --accent: #4c7dff;
  --accent-hover: #6991ff;
  --accent-text: #8aa8ff;
  --accent-wash: rgba(76, 125, 255, 0.12);

  /* row-outcome statuses (text-safe shades; base tones for dots) */
  --ok: #4fce75;
  --ok-text: #5fdb83;
  --warn: #e2a23c;
  --warn-text: #e7b05b;
  --err: #e06552;
  --err-text: #ee8875;

  --radius-card: 12px;
  --radius-control: 10px;
  --radius-chip: 8px;

  --font:
    "Golos Text", -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-mono:
    ui-monospace, "Cascadia Mono", Consolas, "JetBrains Mono", monospace;
}

/* --- Base ---------------------------------------------------------------- */

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

html {
  background: var(--bg-0);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--text-1);
  font: 400 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  /* The parse title ends in the uploaded file name — one long token that must
     not push a narrow viewport sideways. */
  overflow-wrap: anywhere;
}

h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

p {
  margin: 0 0 12px;
}

a {
  color: var(--accent-text);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #a5bcff;
}

code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #c8d2e0;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 2px 6px;
}

::selection {
  background: rgba(76, 125, 255, 0.35);
}

:focus-visible {
  outline: 2px solid #6e9bff;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* --- App shell: sidebar + content ---------------------------------------- */

body:not(.is-bare) {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 20px 14px 16px;
  background: var(--bg-1);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px;
}

.brand-mark {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

/* Both marks (this one and .login-mark below) are the plate + emblem pair:
   the accent square comes from the mark itself, the white emblem from the
   pud-logo.svg image, whose viewBox is already squared to the emblem — so
   filling the plate is the correct scale. */
.brand-mark img,
.login-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-1);
}

.side-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-label {
  padding: 14px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.side-label:first-child {
  padding-top: 0;
}

.side-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 14px;
  border-radius: var(--radius-control);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

a.side-item:hover {
  background: var(--bg-2);
  color: var(--text-1);
}

.side-item.is-active {
  background: var(--bg-2);
  color: var(--text-1);
}

/* The active marker of the reference design: a short light bar on the
   item's left edge. */
.side-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: #fff;
}

.side-item svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--text-3);
}

.side-item.is-active svg {
  color: var(--text-1);
}

/* A section that is planned but not built yet: readable, inert, quiet. */
.side-item.is-soon {
  color: var(--text-3);
  cursor: default;
}

.side-soon {
  margin-left: auto;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-3);
}

.side-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.side-user {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-foot form {
  margin: 0;
}

/* --- Content column ------------------------------------------------------- */

.content {
  padding: 38px 40px 72px;
}

.page {
  max-width: 1080px;
}

/* Table-first pages (the journal): the 1080 reading measure starves the one
   column that carries a full file name, so these pages take a wider stage —
   at desktop widths the longest real name then sits on a single line. */
.page-wide {
  max-width: 1500px;
}

.page-sub {
  margin: 0 0 26px;
  max-width: 62ch;
  color: var(--text-2);
}

/* --- Alerts / flash -------------------------------------------------------- */

.alert,
.flash {
  margin: 0 0 20px;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  font-size: 13.5px;
}

.alert {
  border: 1px solid rgba(224, 101, 82, 0.3);
  background: rgba(224, 101, 82, 0.09);
  color: var(--err-text);
}

.alert code {
  color: inherit;
  background: rgba(255, 255, 255, 0.09);
}

.flash {
  border: 1px solid rgba(79, 206, 117, 0.3);
  background: rgba(79, 206, 117, 0.09);
  color: var(--ok-text);
}

/* --- Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font: 500 14px/1.2 var(--font);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text-1);
}

.btn-ghost:hover {
  background: var(--bg-3);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-lg {
  padding: 11px 22px;
  font-size: 14.5px;
}

.btn-block {
  width: 100%;
}

/* --- Forms ------------------------------------------------------------------- */

.field {
  margin: 0 0 16px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--bg-2);
  color: var(--text-1);
  font: 400 14px var(--font);
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

input[type="text"]:hover,
input[type="password"]:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-3);
}

/* A disabled text input must LOOK disabled. The base rule above sets an
   explicit color and background, which overrides the browser's own greyed-out
   rendering — without this block a locked field is indistinguishable from an
   editable one (the manual-run form locks both dates under «кумулятивный»).
   Dashed border + flat page background + dimmed value; the hover/focus
   affordances are switched off, and the field's label dims with it. */
input[type="text"]:disabled,
input[type="password"]:disabled,
textarea:disabled {
  border-style: dashed;
  border-color: var(--line-strong);
  background: var(--bg-0);
  color: var(--text-3);
  -webkit-text-fill-color: var(--text-3); /* Safari ignores `color` on disabled inputs */
  opacity: 1; /* the dimming is the tokens above, not a UA-specific fade */
  cursor: not-allowed;
}

input[type="text"]:disabled:hover,
input[type="password"]:disabled:hover,
textarea:disabled:hover {
  border-color: var(--line-strong);
}

/* :has() degrades gracefully: without it only the input itself dims. */
.field:has(> input:disabled) > label,
.field:has(> textarea:disabled) > label {
  color: var(--text-3);
}

textarea {
  display: block;
  resize: vertical;
  line-height: 1.45;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-3);
}

/* The file picker as a dashed landing zone: the affordance says "drop a
   registry here" while staying the plain native input (no JS to fake it). */
input[type="file"] {
  width: 100%;
  padding: 26px 18px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-card);
  background: var(--bg-2);
  color: var(--text-2);
  font: 400 13.5px var(--font);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

input[type="file"]:hover {
  border-color: rgba(255, 255, 255, 0.26);
  background: var(--bg-3);
}

input[type="file"]:focus {
  outline: none;
  border-color: var(--accent);
  border-style: solid;
}

input[type="file"]::file-selector-button {
  margin-right: 14px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--bg-3);
  color: var(--text-1);
  font: 500 13px var(--font);
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

/* The picked file as a card (static/upload.js builds it once a file is chosen
   and hides the native zone): the xlsx icon, the name ellipsized to the card's
   width (the full name rides the title attribute), the size, and the
   «Заменить»/«Убрать» pair. Same surface family as the zone it replaces. */
.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--bg-2);
}

/* Canonical size; upload.js pins the same 28px as svg attrs — the no-CSS floor */
.file-card-icon {
  flex: none;
  width: 28px;
  height: 28px;
  color: var(--accent-text);
}

.file-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0; /* lets the name ellipsize instead of pushing the buttons out */
  flex: 1;
}

.file-card-name {
  font: 500 14px var(--font);
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card-size {
  font: 400 12.5px var(--font);
  color: var(--text-3);
}

.file-card-x {
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-2);
  font: 400 18px/1 var(--font);
  cursor: pointer;
}

.file-card-x:hover {
  border-color: var(--line-strong);
  background: var(--bg-3);
  color: var(--text-1);
}

/* A busy submit button (static/upload.js): disabled, dimmed, and carrying the
   spinner the label swap leaves room for. */
.btn.is-busy {
  opacity: 0.75;
  cursor: progress;
}

.btn.is-busy::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-busy-spin 0.8s linear infinite;
}

@keyframes btn-busy-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn.is-busy::before {
    animation: none;
  }
}

/* Every <select> in the app used to render in the OS's own chrome — the one
   control text/file inputs got styled and this one didn't. A single-value
   select gets the same field shell as a text input plus a themed chevron
   (appearance: none drops the native arrow so the background-image one is
   the only one drawn); a multi-select drops the arrow (nothing to point at)
   and grows tall enough to show more than one row without a resize. */
select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2397a1b0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      no-repeat right 12px center,
    var(--bg-2);
  color: var(--text-1);
  font: 400 14px var(--font);
  appearance: none;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}

select:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

select:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--bg-3);
}

select:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

select option {
  background: var(--bg-2);
  color: var(--text-1);
}

select[multiple] {
  padding: 6px;
  background-image: none;
  min-height: 96px;
}

select[multiple] option {
  padding: 6px 8px;
  border-radius: var(--radius-chip);
}

.hint {
  margin: 10px 0 18px;
  font-size: 13px;
  color: var(--text-3);
}

/* The «Ручной запуск» type-specific block (2026-09-09 follow-up): a plain
   fieldset groups the active type's parameters under one caption instead of
   the fields just running on from the type picker — no border box, just the
   legend and a rule under it so the group reads without a per-type <h2>. */
.field-group {
  margin: 0 0 16px;
  padding: 0;
  border: none;
}

.field-group legend {
  padding: 0 0 10px;
  width: 100%;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field-group .field:first-of-type {
  margin-top: 16px;
}

/* --- Inline control rows ----------------------------------------------------
   Related controls read as ONE line — the jobs filter bar and the schedules
   preset row (user walkthrough 2026-09-08) — and wrap to further lines on
   narrow screens instead of stacking full-width blocks. Fields take a
   compact share of the line (not the block default of the full width);
   the row's trailing buttons sit on the same baseline as the controls,
   which is why they carry the same bottom margin the fields do. */

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  column-gap: 16px;
}

.form-row .field {
  flex: 1 1 150px;
  max-width: 230px;
}

.form-row .btn {
  margin-bottom: 16px;
}

/* --- Stepper: the real sequence of the pipeline ------------------------------- */

.stepper {
  display: flex;
  align-items: center;
  margin: 0 0 26px;
}

.step {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.step-dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-2);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.step.is-active {
  color: var(--text-1);
}

.step.is-active .step-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.step.is-done .step-dot {
  border-color: rgba(79, 206, 117, 0.55);
  font-size: 0;
}

.step.is-done .step-dot::before {
  content: "\2713";
  font-size: 12px;
  color: var(--ok-text);
}

/* A dashed connector: the flow line of the pipeline, not a decoration. */
.step-line {
  flex: 1;
  min-width: 24px;
  margin: 0 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.16);
}

/* --- Cards / panels ------------------------------------------------------------ */

.card {
  max-width: 620px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-2);
}

.panel {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-2);
}

.panel-head {
  padding: 16px 20px 12px;
}

.panel-head p {
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 13px;
}

.panel-body {
  padding: 4px 20px 18px;
}

.actions {
  margin-top: 26px;
}

/* Section title with an outcome dot: the dot repeats the color the tiles
   and the journal use for the same outcome. */
.sec-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.sec-title::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--text-3);
}

.sec-ok::before {
  background: var(--ok);
}

.sec-info::before {
  background: var(--accent);
}

.sec-warn::before {
  background: var(--warn);
}

.sec-err::before {
  background: var(--err);
}

/* --- Stat tiles (the parse summary) ---------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 14px 0 0;
  padding: 0;
}

.stat {
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-2);
}

.stat dd {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--stat, var(--text-1));
}

.stat dt {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text-2);
}

.stat-ok {
  --stat: var(--ok-text);
}

.stat-info {
  --stat: var(--accent-text);
}

.stat-warn {
  --stat: var(--warn-text);
}

.stat-err {
  --stat: var(--err-text);
}

/* --- Tables ------------------------------------------------------------------------ */

.table-scroll {
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  vertical-align: top;
}

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

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

th.num,
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

td.num {
  font-weight: 500;
}

/* A zero stays quiet; a non-zero count speaks in its outcome color. */
td.pos-ok {
  color: var(--ok-text);
}

td.pos-info {
  color: var(--accent-text);
}

td.pos-warn {
  color: var(--warn-text);
}

td.pos-err {
  color: var(--err-text);
}

/* The journal's identity column: the registry file name with who uploaded it
   and when as a quiet second line. The name may be one long unbroken token, so
   it wraps anywhere instead of stretching the column. */
td.filename {
  overflow-wrap: anywhere;
  font-weight: 500;
}

.file-meta {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  white-space: nowrap;
}

/* The /users actions column: an edit link plus several one-button forms.
   Without this they glue into one pile — forms are block boxes with no
   margins, and the global input rule (width: 100%) stretches the password
   field across the cell and wraps its button. Each form keeps its input
   and button on one row; the entries stack with a small gap. */
td.row-actions > * + * {
  margin-top: 6px;
}

td.row-actions form {
  display: flex;
  align-items: center;
  gap: 6px;
}

td.row-actions input[type="password"] {
  width: 150px;
}

.table-scroll::-webkit-scrollbar {
  height: 8px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: var(--bg-3);
  border-radius: 4px;
}

.table-scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* --- Conflict decisions: the last column of the discrepancies table ---------------------- */

/* The two answers stack inside the decision cell, so a long brand list in a
   neighboring column never squeezes the radios. */
.choices {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.choices .choice {
  margin: 0;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 6px 10px 0 0;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.choice:hover {
  background: var(--bg-3);
  color: var(--text-1);
}

.choice input {
  accent-color: var(--accent);
  margin: 0;
}

/* :has() degrades to a plain native radio in browsers without it — the
   control stays fully usable, just less styled. */
.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--text-1);
}

/* A locked checkbox/radio (the form's JS disables «по регионам» once a region
   is chosen): the whole chip reads as unavailable, not just the tiny box. */
.choice:has(input:disabled) {
  border-style: dashed;
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text-3);
  cursor: not-allowed;
}

/* --- Warnings callout --------------------------------------------------------------------- */

.callout-warn ul {
  margin: 0;
  padding: 2px 0 2px 18px;
}

.callout-warn li {
  margin: 5px 0;
  color: var(--text-2);
  font-size: 13.5px;
}

.callout-warn {
  border-left: 3px solid var(--warn);
  background: rgba(226, 162, 60, 0.07);
  border-radius: 4px var(--radius-control) var(--radius-control) 4px;
}

/* --- Empty state / pagination --------------------------------------------------------------- */

.empty {
  margin-top: 22px;
  padding: 40px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
  text-align: center;
  color: var(--text-3);
}

.pager {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.pager-info {
  font-size: 13px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* --- Home tiles -------------------------------------------------------------------------------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.tile {
  display: block;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-2);
  color: var(--text-1);
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.tile:hover {
  background: var(--bg-3);
  border-color: var(--line-strong);
  color: var(--text-1);
}

.tile svg {
  width: 18px;
  height: 18px;
  color: var(--accent-text);
}

.tile-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 15px;
  font-weight: 600;
}

.tile-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}

/* --- Bare shell: login and pre-auth pages -------------------------------------------------------- */

body.is-bare {
  display: block;
  background:
    radial-gradient(
      880px 460px at 50% -12%,
      rgba(76, 125, 255, 0.16),
      transparent 62%
    ),
    var(--bg-0);
}

body.is-bare .content {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 384px;
  padding: 30px 30px 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-2);
}

.login-mark {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
}

.login-card h1 {
  margin-bottom: 4px;
  font-size: 17px;
  text-align: center;
}

.login-sub {
  margin-bottom: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
}

/* The form's submit button and the block link that follows the form
   (Войти → «Забыли пароль?», «Отправить запрос» → «Вернуться ко входу»)
   otherwise touch: the card spaces its titled children, not forms. */
.login-card form {
  margin-bottom: 16px;
}

/* --- Narrow screens: the sidebar folds into a top bar ---------------------------------------------- */

@media (max-width: 760px) {
  body:not(.is-bare) {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 12px;
    padding: 14px 14px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  /* The row wraps instead of scrolling: at phone widths the items plus the
     "скоро" pill do not fit one line, and a clipped pill behind an invisible
     scroll reads as a broken layout. A second row is honest at any width. */
  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }

  .side-label {
    display: none;
  }

  .side-item {
    padding: 8px 12px;
    white-space: nowrap;
  }

  .side-item.is-active::before {
    display: none;
  }

  .side-foot {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
  }

  /* The logout button is btn-block for the desktop column; beside the user
     name in a row it must size to its label, not fight for 100% of it. */
  .side-foot .btn {
    width: auto;
  }

  .content {
    padding: 24px 16px 56px;
  }

  .step {
    font-size: 0;
    gap: 0;
  }

  .step-line {
    margin: 0 8px;
  }
}

/* The invite link's copy row (feature rnp-ai-bot): the code is the copy
   target itself (click/Enter copies), the ghost button gives the visible
   affordance with the icon. */
.invite-copy-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.invite-copy-text {
  cursor: copy;
}

.invite-copy-text:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.invite-copy-row .is-copied {
  color: #1a7f37;
}
