/* Панель руководителя MANCRAFT. Правила — bi-panel/DESIGN.md (часть B скилла landing-page-design, MIT).
   Шрифт Manrope (SIL OFL 1.1, текст лицензии — fonts/OFL.txt) — свои файлы, без CDN. */
@font-face{font-family:"Manrope";font-style:normal;font-weight:400;font-display:swap;src:url("fonts/manrope-cyrillic-400-normal.woff2") format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Manrope";font-style:normal;font-weight:400;font-display:swap;src:url("fonts/manrope-latin-ext-400-normal.woff2") format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Manrope";font-style:normal;font-weight:400;font-display:swap;src:url("fonts/manrope-latin-400-normal.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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Manrope";font-style:normal;font-weight:500;font-display:swap;src:url("fonts/manrope-cyrillic-500-normal.woff2") format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Manrope";font-style:normal;font-weight:500;font-display:swap;src:url("fonts/manrope-latin-ext-500-normal.woff2") format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Manrope";font-style:normal;font-weight:500;font-display:swap;src:url("fonts/manrope-latin-500-normal.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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Manrope";font-style:normal;font-weight:600;font-display:swap;src:url("fonts/manrope-cyrillic-600-normal.woff2") format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Manrope";font-style:normal;font-weight:600;font-display:swap;src:url("fonts/manrope-latin-ext-600-normal.woff2") format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Manrope";font-style:normal;font-weight:600;font-display:swap;src:url("fonts/manrope-latin-600-normal.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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Manrope";font-style:normal;font-weight:700;font-display:swap;src:url("fonts/manrope-cyrillic-700-normal.woff2") format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Manrope";font-style:normal;font-weight:700;font-display:swap;src:url("fonts/manrope-latin-ext-700-normal.woff2") format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Manrope";font-style:normal;font-weight:700;font-display:swap;src:url("fonts/manrope-latin-700-normal.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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

/* Токены. Фоны — только #000000 #181818 #1F1F1F #272727 #313131 (DESIGN.md), без градиентов.
   Размеры текста — шкала Tailwind, отступы — только 0 2 4 8 12 16 24 32 40 48 64 80 96. */
:root {
  --bg: #000000;
  --surface: #181818;
  --nested: #1F1F1F;
  --hover: #272727;
  --line: #313131;
  --text: #F5F5F5;
  --muted: #A6A6A6;
  --faint: #8C8C8C;
  --accent: #FF6A00;
  --accent-hover: #FF7D24;
  --good: #7CC69A;
  --warn: #E3B55B;
  --bad: #F07A72;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Manrope", system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 24px;
  -webkit-text-size-adjust: 100%;
}
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; }
h1, h2, h3 { text-wrap: balance; }
p, li, dd, td { text-wrap: pretty; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
[id] { scroll-margin-top: 96px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: #000000; }

.icon { display: inline-block; width: 20px; height: 20px; flex: none; vertical-align: middle; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 40px; height: 40px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.k-good { color: var(--good); }
.k-warn { color: var(--warn); }
.k-bad { color: var(--bad); }
.k-muted { color: var(--muted); }

/* ---------- Ссылка «к содержимому» ---------- */
.skip {
  position: fixed; top: 16px; left: 16px; z-index: 100;
  padding: 8px 12px; border-radius: 8px;
  background: var(--accent); color: #000000; font-weight: 600; text-decoration: none;
  transform: translateY(-200%);
  transition: transform 500ms var(--ease);
}
.skip:focus { transform: none; }

/* ---------- Верхняя панель: плавает, по содержимому, полупрозрачная с размытием ----------
   Размытие — на ::before, а не на самой панели: backdrop-filter у предка сделал бы его
   контейнером для position:fixed, и мобильное меню не растянулось бы на весь экран. */
.topbar {
  position: fixed; top: 16px; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: center; padding: 0 16px; pointer-events: none;
}
.nav {
  pointer-events: auto; position: relative; isolation: isolate;
  display: flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 8px; border: 1px solid var(--line); border-radius: 16px;
}
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: rgba(24, 24, 24, 0.72);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.brand {
  display: flex; align-items: center; gap: 12px; padding: 0 12px 0 0;
  text-decoration: none; border-radius: 8px; flex: none;
}
.brand-mark { width: 40px; height: 40px; border-radius: 8px; }
.brand-name { font-size: 14px; line-height: 20px; font-weight: 700; white-space: nowrap; }
.brand-name span { display: block; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links ul { display: flex; gap: 4px; list-style: none; }
.nav-links form { margin: 0; }
.nav-link {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px;
  border: 0; background: transparent; color: var(--muted);
  font-size: 14px; line-height: 20px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 300ms var(--ease), color 300ms var(--ease), transform 500ms var(--ease);
}
.nav-link:hover { background: var(--hover); color: var(--text); }
.nav-link:active { transform: scale(0.98); }
.nav-link[aria-current="page"] { background: var(--nested); color: var(--accent); }
.nav-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.menu-toggle { display: none; }

@media (max-width: 1199px) {
  .brand-name { display: none; }
  .brand { padding: 0; }
}

@media (max-width: 899px) {
  .nav { width: 100%; justify-content: space-between; }
  .brand-name { display: block; }
  .no-js .nav { flex-wrap: wrap; }
  .no-js .nav-links { width: 100%; overflow-x: auto; }
  .js .menu-toggle {
    display: block; position: relative; width: 40px; height: 40px; padding: 0;
    border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer;
    transition: background-color 300ms var(--ease), transform 500ms var(--ease);
  }
  .js .menu-toggle:hover { background: var(--hover); }
  .js .menu-toggle:active { transform: scale(0.98); }
  .menu-toggle .bar {
    position: absolute; inset: 0; margin: auto; width: 16px; height: 2px; border-radius: 2px;
    background: currentColor; transition: transform 500ms var(--ease);
  }
  .menu-toggle .bar-1 { transform: translateY(-4px); }
  .menu-toggle .bar-2 { transform: translateY(4px); }
  .menu-open .menu-toggle .bar-1 { transform: rotate(45deg); }
  .menu-open .menu-toggle .bar-2 { transform: rotate(-45deg); }

  /* Мобильное меню — панель во всю высоту, пункты появляются по очереди. */
  .js .nav-links {
    position: fixed; inset: 0; z-index: -2;
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 96px 24px 40px; overflow-y: auto;
    background: rgba(0, 0, 0, 0.92);
    -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
    opacity: 0; visibility: hidden;
    transition: opacity 500ms var(--ease), visibility 0s var(--ease) 500ms;
  }
  .menu-open .nav-links { opacity: 1; visibility: visible; transition: opacity 500ms var(--ease); }
  .js .nav-links ul { flex-direction: column; gap: 4px; }
  .js .nav-links .nav-link { font-size: 24px; line-height: 32px; padding: 12px 16px; gap: 16px; }
  .js .nav-links .nav-link .icon { width: 24px; height: 24px; }
  .js .nav-sep { width: auto; height: 1px; margin: 8px 16px; }
  .js .nav-links li, .js .nav-links form, .js .nav-sep {
    opacity: 0; transform: translateY(24px);
    transition: opacity 500ms var(--ease), transform 500ms var(--ease);
  }
  .menu-open .nav-links li, .menu-open .nav-links form, .menu-open .nav-sep { opacity: 1; transform: none; }
  .menu-open .nav-links li:nth-child(2) { transition-delay: 60ms; }
  .menu-open .nav-links li:nth-child(3) { transition-delay: 120ms; }
  .menu-open .nav-links li:nth-child(4) { transition-delay: 180ms; }
  .menu-open .nav-links li:nth-child(5) { transition-delay: 240ms; }
  .menu-open .nav-sep { transition-delay: 300ms; }
  .menu-open .nav-links form { transition-delay: 340ms; }
  .menu-open body { overflow: hidden; }
}

/* ---------- Каркас страницы ---------- */
main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 96px 24px 64px; }
main:focus { outline: none; }
.page-head { padding-top: 24px; }
.page-head h1 {
  width: fit-content; max-width: 680px;
  font-size: 36px; line-height: 40px; font-weight: 700;
  background: linear-gradient(90deg, #FFFFFF, #9B9B9B);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { margin-top: 8px; max-width: 680px; color: var(--muted); }
.foot {
  width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px;
  color: var(--faint); font-size: 12px; line-height: 16px;
}

.section { margin-top: 48px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head h2 { font-size: 20px; line-height: 28px; font-weight: 700; }
.section-head p, .note { margin-top: 4px; max-width: 760px; color: var(--muted); font-size: 14px; line-height: 20px; }
.note + .note { margin-top: 8px; }
.section-note { margin-top: 16px; }
.section-head p + p { margin-top: 8px; }

.card {
  min-width: 0; padding: 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
}
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); }
.cols > * { min-width: 0; }
@media (min-width: 1024px) { .cols .section-head p { min-height: 40px; } }

.card-link {
  display: block; text-decoration: none;
  transition: background-color 300ms var(--ease), border-color 300ms var(--ease), transform 500ms var(--ease);
}
.card-link:hover { background: var(--nested); border-color: #4A4A4A; }
.card-link:active { transform: scale(0.98); }
.card-link .go { color: var(--muted); transition: transform 500ms var(--ease), color 300ms var(--ease); }
.card-link:hover .go { color: var(--accent); transform: translateX(4px); }

/* ---------- Свежесть источников ---------- */
.fresh { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px;
  border: 1px solid var(--line); border-radius: 9999px; background: var(--surface);
  font-size: 14px; line-height: 20px;
}
.chip .icon { width: 16px; height: 16px; color: var(--good); }
.chip-title { font-weight: 600; }
.chip-meta { color: var(--muted); }
.alert {
  flex-basis: 100%; display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  font-size: 14px; line-height: 20px;
}
.alert .icon { margin-top: 0; }
.alert-bad { border-color: var(--bad); }
.alert-bad > .icon { color: var(--bad); }
.alert-warn { border-color: var(--warn); }
.alert-warn > .icon { color: var(--warn); }
.alert-info > .icon { color: var(--accent); }
.alert strong { font-weight: 700; }
.alert .since { display: block; color: var(--muted); }

/* ---------- Цифры ---------- */
.stat-label { color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 600; }
.stat-value { font-size: 24px; line-height: 32px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted); font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
.stats { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 16px; }
.stat-accent { border-color: var(--accent); }

.cab { display: flex; flex-direction: column; gap: 16px; }
.cab-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.cab-head h3 { font-size: 16px; line-height: 24px; font-weight: 700; }
.cab-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.kv { display: grid; gap: 8px; }
.kv div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; font-size: 14px; line-height: 20px; }
.kv dt { color: var(--muted); }
.kv dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.trend { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; font-weight: 600; }
.trend-up { color: var(--good); }
.trend-down { color: var(--bad); }
.trend-flat, .trend-none { color: var(--muted); }
.cab-foot { padding-top: 16px; border: 0; font-size: 14px; line-height: 20px; color: var(--muted); }

.region-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.region-head h3 { display: flex; align-items: center; gap: 8px; font-size: 18px; line-height: 28px; font-weight: 700; }
.region-head h3 .icon { color: var(--accent); }
.region-stats { display: grid; gap: 4px; }

/* ---------- Значки состояния: цвет + иконка + слово ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border: 1px solid currentColor; border-radius: 9999px;
  font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap;
}
.badge .icon { width: 16px; height: 16px; }
.flag { display: flex; gap: 4px; align-items: flex-start; margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--warn); }
.flag .icon { width: 16px; height: 16px; }
.flag-info { color: var(--muted); }

/* ---------- Таблицы: широкие прокручиваются внутри своей карточки ---------- */
.card-table { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
th {
  padding: 8px 16px; background: var(--nested); border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 600; text-align: left; vertical-align: bottom;
}
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { background: var(--nested); font-weight: 700; border-bottom: 0; border-top: 1px solid var(--line); }
.num { text-align: right; white-space: nowrap; }
th.num { text-align: right; }
.prod { display: block; font-weight: 600; min-width: 200px; }
.sub { display: block; color: var(--faint); font-size: 12px; line-height: 16px; }
.reasons { list-style: none; display: grid; gap: 4px; min-width: 240px; }
.reasons li { display: flex; gap: 8px; align-items: flex-start; }
.reasons .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--warn); }
.row-bad td:first-child .prod { color: var(--text); }
.was { color: var(--muted); }
.table-note { padding: 12px 16px; color: var(--muted); font-size: 12px; line-height: 16px; background: var(--nested); }
.w-prod { min-width: 240px; }
.where { display: flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 16px; }
.where .icon { width: 16px; height: 16px; }
.card-quiet { color: var(--muted); }
.card-quiet .stat-value { color: var(--muted); }
.t-fixed { table-layout: fixed; }
.t-fixed .prod { min-width: 0; }
.t-fixed td { overflow-wrap: anywhere; }
.t-fixed .badge { white-space: normal; }
.t-stock { min-width: 760px; }
.t-comp { min-width: 1040px; }
.only-phone, .phone-line { display: none; }
.c-6 { width: 6%; } .c-9 { width: 9%; } .c-12 { width: 12%; } .c-14 { width: 14%; }
.c-24 { width: 24%; } .c-26 { width: 26%; } .c-36 { width: 36%; }

/* ---------- Пустые состояния ---------- */
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 40px; }
.empty .icon-lg { color: var(--accent); }
.empty h2 { font-size: 20px; line-height: 28px; font-weight: 700; }
.empty p { max-width: 560px; color: var(--muted); }
.empty-sm { display: flex; gap: 12px; align-items: flex-start; padding: 24px; color: var(--muted); font-size: 14px; line-height: 20px; }
.empty-sm .icon { color: var(--faint); }

/* ---------- Формы ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > .label { color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 600; }
.input {
  min-width: 0; max-width: 100%; padding: 8px 12px;
  background: var(--nested); border: 1px solid var(--line); border-radius: 8px; color: var(--text);
  font-size: 16px; line-height: 24px; height: 42px;
  transition: background-color 300ms var(--ease), border-color 300ms var(--ease);
}
.input:hover { background: var(--hover); }
.input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.input-num { width: 112px; }
.input-month { width: 176px; }
.field-error .input { border-color: var(--bad); }
.err { display: flex; gap: 4px; align-items: flex-start; color: var(--bad); font-size: 12px; line-height: 16px; max-width: 280px; }
.err .icon { width: 16px; height: 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 12px; border: 1px solid transparent; border-radius: 8px;
  font-size: 16px; line-height: 24px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 300ms var(--ease), color 300ms var(--ease), border-color 300ms var(--ease),
    transform 500ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #000000; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--nested); border-color: var(--line); color: var(--text); }
.btn-secondary:hover { background: var(--hover); }
.btn-sm { font-size: 14px; line-height: 20px; }
.btn-block { width: 100%; }

.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.jump a { gap: 8px; }
.jump .badge { margin-left: 4px; }

/* ---------- Вход и служебные страницы ---------- */
.auth { display: grid; place-items: center; padding-top: 48px; }
.auth-card { width: 100%; max-width: 440px; padding: 32px; }
.auth-card.wide { max-width: 880px; }
.auth-card h1 {
  width: fit-content; font-size: 30px; line-height: 36px; font-weight: 700;
  background: linear-gradient(90deg, #FFFFFF, #9B9B9B);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-card .lead { font-size: 14px; line-height: 20px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-card .alert { margin-top: 24px; }
.auth-card > form, .setup-grid { margin-top: 24px; }
.setup-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.setup-grid h2 { font-size: 16px; line-height: 24px; font-weight: 700; margin-bottom: 8px; }
.setup-grid p { color: var(--muted); font-size: 14px; line-height: 20px; }
.qr { margin: 16px 0; }
.qr svg { border-radius: 8px; max-width: 100%; height: auto; }
.secret {
  display: block; margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: var(--nested);
  font-family: inherit; font-size: 14px; line-height: 20px; letter-spacing: 0.08em; word-break: break-all;
}
.auth-card > .form-actions { margin-top: 24px; }
.error-code { color: var(--accent); font-size: 14px; line-height: 20px; font-weight: 700; margin-bottom: 8px; }

/* ---------- Движение: подъём на 32 px и проявление при прокрутке, один раз ---------- */
.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Загрузка: скелет в форме настоящей таблицы, пока GET-форма пересчитывает страницу. */
.is-loading td, .is-loading .stat-value, .is-loading .stat-sub { position: relative; color: transparent; }
.is-loading td *, .is-loading .stat-value * { visibility: hidden; }
.is-loading td::after, .is-loading .stat-value::after {
  content: ""; position: absolute; inset: 12px 16px; border-radius: 4px; background: var(--hover);
  animation: pulse 1200ms var(--ease) infinite alternate;
}
.is-loading .stat-value::after { inset: 4px 0; }
@keyframes pulse { from { opacity: 0.4; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-property: opacity !important; animation: none !important; }
  .js .reveal, .js .nav-links li, .js .nav-links form, .js .nav-sep { transform: none !important; }
  .btn:active, .nav-link:active, .card-link:active { transform: none; }
}

@media (max-width: 640px) {
  main { padding: 96px 16px 48px; }
  .page-head { padding-top: 16px; }
  .page-head h1 { font-size: 30px; line-height: 36px; }
  .section { margin-top: 40px; }
  .card { padding: 16px; }
  .card-table { padding: 0; }
  .auth-card { padding: 24px; }
  td { padding: 12px; }
  th { padding: 8px 12px; }
  .empty { padding: 24px; }
  .foot { padding: 24px 16px; }
  .input-month { width: 160px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat .stat-value { font-size: 20px; line-height: 28px; }
  .prod { min-width: 160px; }
  .w-prod { min-width: 176px; }
  .chip { border-radius: 12px; flex-wrap: wrap; gap: 4px 8px; }
  /* Остатки на телефоне: состояние — под названием, рядом с остатком сразу «хватит на». */
  .t-stock { table-layout: auto; min-width: 0; }
  .t-stock col { width: auto; }
  .t-stock td { overflow-wrap: normal; }
  .t-stock .prod { min-width: 144px; }
  .t-stock .badge { white-space: normal; border-radius: 8px; }
  .t-stock th { white-space: nowrap; }
  .t-stock .col-state, .t-stock .col-speed { display: none; }
  .phone-line { display: block; }
  .only-phone { display: block; margin-top: 8px; }
  .where.only-phone { display: flex; }
}
