/* FF · пульт заказов. Направление: складской пульт — серая оболочка, белые рабочие
   поверхности, жёсткие линейки, цвет только у статуса, склада и дедлайна. */

:root {
  --bg: #e9edf2;
  --surface: #ffffff;
  --surface-2: #f2f5f8;
  --line: #dce1e7;
  --line-strong: #c3cbd4;
  --line-soft: #edf0f4;
  --hover: #f5f8fb;
  --ink: #161b21;
  --muted: #59616b;
  --faint: #6d7681;
  --accent: #1f56c7;
  --accent-weak: #e8ecfb;
  --green: #1a6a4f;
  --amber: #a85a09;
  --red: #b8372c;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;

  --r: 6px;
  --r-sm: 4px;
  --top: 56px;
  --bar: 44px;
  --sidebar: 420px;
  --ease: cubic-bezier(.2, .75, .25, 1);
  --fast: 120ms;
  --slow: 220ms;

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

:where(a, button, input, select, tr):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── верхняя панель ─────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  height: var(--top);
  padding: 0 var(--s5);
  border-bottom: 1px solid var(--line-strong);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand::before {
  content: "FF";
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--surface);
  background: var(--ink);
  border-radius: var(--r-sm);
  padding: 3px 5px;
  transform: translateY(-1px);
}
.brand span { color: var(--muted); font-weight: 400; font-size: 12px; }

.search { flex: 1; max-width: 560px; position: relative; }
.search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  translate: 0 -50%;
  width: 14px;
  height: 14px;
  color: var(--faint);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 34px;
  padding: 0 40px 0 32px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) var(--ease);
}
.search input::placeholder { color: var(--faint); }
.search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.search kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  translate: 0 -50%;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--faint);
  font: 11px/1 var(--mono);
  padding: 3px 5px;
}

.sync {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#syncShort { display: none; }
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 12%, transparent);
}
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 14%, transparent); }
.dot.err { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 14%, transparent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease),
              color var(--fast) var(--ease), transform 80ms var(--ease);
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn.primary:hover { background: #33312c; border-color: #33312c; }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn svg { width: 14px; height: 14px; }

/* ── KPI ────────────────────────────────────────────────────────── */

.kpis {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1fr 1fr 1.3fr;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface);
}
.kpi {
  padding: var(--s3) var(--s4) var(--s3) var(--s5);
  border-right: 1px solid var(--line);
  min-width: 0;
}
.kpi:last-child { border-right: 0; }
.kpi b {
  display: block;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin-bottom: 2px;
}
.kpi span {
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.kpi.alert b { color: var(--red); }
.kpi.warn b { color: var(--amber); }
.kpi.alert { background: color-mix(in srgb, var(--red) 3%, var(--surface)); }

/* ── панель фильтров ────────────────────────────────────────────── */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  min-height: var(--bar);
  padding: var(--s1) var(--s5);
  border-bottom: 1px solid var(--line-strong);
  position: sticky;
  top: var(--top);
  background: var(--surface-2);
  z-index: 15;
  flex-wrap: wrap;
}

.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tab {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  border: 0;
  background: none;
  padding: 6px 9px;
  border-radius: var(--r-sm);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab.on { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: inset 0 0 0 1px var(--line); }
.tab small { color: var(--faint); font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.tab.on small { color: var(--muted); }

.filters { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.filters-more { display: flex; gap: var(--s2); align-items: center; }
.fitem { display: block; }
.fitem > span, .sheet-head, #filterDone, #filterReset, .filter-btn { display: none; }
.fcount {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 5px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: 10px/1 var(--mono);
}
.filters .filter-btn.btn.ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }
.filters .filter-btn.btn.ghost.has { border-color: var(--accent); background: var(--accent-weak); color: var(--accent); }
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(22, 27, 33, .32); }
.filters select {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 0 4px 0 8px;
  color: var(--muted);
  cursor: pointer;
  max-width: 180px;
}
.filters select:hover { border-color: var(--line-strong); color: var(--ink); }
.filters .btn { height: 30px; padding: 0 10px; font-size: 12px; }

/* ── таблица ────────────────────────────────────────────────────── */

.layout { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - 200px); background: var(--surface); }
.layout.open { grid-template-columns: minmax(0, 1fr) var(--sidebar); }

.list { min-width: 0; display: flex; flex-direction: column; background: var(--surface); }
.tablewrap { overflow: auto; flex: 1; }

table { width: 100%; border-collapse: collapse; }
@media (min-width: 721px) { table { min-width: 820px; } }
td, th { white-space: nowrap; }

thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .055em;
  text-transform: uppercase;
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--line-strong);
}
thead th:first-child { padding-left: var(--s5); }
thead th:last-child { padding-right: var(--s5); }

tbody td {
  padding: 4px var(--s3);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
tbody td:first-child { padding-left: var(--s5); }
thead th:nth-child(6), tbody td:nth-child(6) { border-left: 1px solid var(--line); }
thead th:nth-child(5), tbody td:nth-child(5) { padding-right: var(--s5); }
tbody td:last-child { padding-right: var(--s5); }
.v { display: inline-block; vertical-align: top; max-width: 100%; line-height: 1.25; }

tbody tr { cursor: pointer; transition: background var(--fast) var(--ease); }
tbody tr:hover { background: var(--hover); }
tbody tr.on { background: var(--accent-weak); }
tbody tr.on td:first-child { box-shadow: inset 2px 0 0 var(--accent); }

tbody tr input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }

td.r, th.r { text-align: right; }
.sub { display: block; color: var(--faint); font-size: 11px; line-height: 1.35; margin-top: 0; }
.sub.wh {
  display: inline-block;
  margin: 2px 0 0 6px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.5;
}

.when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.when.overdue { color: var(--red); font-weight: 500; }
.when.soon { color: var(--amber); }

.meter {
  display: block;
  height: 2px;
  margin-top: 2px;
  border-radius: 2px;
  background: var(--surface-2);
  overflow: hidden;
  width: 72px;
}
.meter i {
  display: block;
  height: 100%;
  background: var(--green);
  transform-origin: left center;
}
.rows-in .meter i { animation: meter-in 360ms var(--ease) both; }
.meter.soon i { background: var(--amber); }
.meter.overdue i { background: var(--red); }
.meter.overdue { background: color-mix(in srgb, var(--red) 15%, var(--surface-2)); }
@keyframes meter-in { from { transform: scaleX(0); } }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 5px;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.chip.awaiting_packaging { color: var(--amber); background: color-mix(in srgb, var(--amber) 7%, var(--surface)); border-color: color-mix(in srgb, var(--amber) 24%, var(--surface)); }
.chip.awaiting_deliver { color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.chip.delivering { color: #4b4fa8; background: color-mix(in srgb, #4b4fa8 6%, var(--surface)); border-color: color-mix(in srgb, #4b4fa8 22%, var(--surface)); }
.chip.delivered { color: var(--green); background: color-mix(in srgb, var(--green) 6%, var(--surface)); border-color: color-mix(in srgb, var(--green) 22%, var(--surface)); }
.chip.cancelled, .chip.returned { color: var(--red); background: color-mix(in srgb, var(--red) 6%, var(--surface)); border-color: color-mix(in srgb, var(--red) 22%, var(--surface)); }

.selbar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s5);
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
  animation: selbar-in 160ms var(--ease) both;
}
.selbar b { font-weight: 600; }
.selbar .btn { height: 28px; font-size: 12px; }
.selbar .btn.primary { background: var(--surface); color: var(--ink); border-color: var(--surface); }
.selbar .btn.primary:hover { background: var(--surface-2); }
.selbar .btn.ghost { color: #cdd4dd; }
.selbar .btn.ghost:hover { background: #2b323a; color: var(--surface); }
@keyframes selbar-in { from { opacity: 0; transform: translateY(-4px); } }

.link {
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
}
.link:hover { color: var(--ink); text-decoration: none; }

.pager-right { display: inline-flex; align-items: center; gap: var(--s2); }
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s2) var(--s5);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  background: var(--surface-2);
}
.pager button { height: 28px; padding: 0 9px; }
.pager .num { color: var(--ink); }

/* ── карточка заказа ────────────────────────────────────────────── */

.drawer {
  border-left: 1px solid var(--line-strong);
  background: var(--surface);
  overflow: auto;
  padding: var(--s5);
  animation: drawer-in var(--slow) var(--ease) both;
}
@keyframes drawer-in { from { opacity: 0; transform: translateX(10px); } }

.drawer h2 {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 4px;
}
.dhead { display: flex; justify-content: space-between; gap: var(--s3); align-items: flex-start; }
.dclose {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.dclose:hover { background: var(--surface-2); color: var(--ink); }

.dmeta {
  margin: var(--s4) 0 0;
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 0;
  font-size: 12.5px;
  border-top: 1px solid var(--line);
}
.dmeta dt { color: var(--muted); padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.dmeta dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line-soft); text-align: right; }

.dsection { margin-top: var(--s4); color: var(--muted); font-size: 11px; }
.items { margin-top: 2px; }
.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px 84px;
  gap: var(--s3);
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
  align-items: start;
}
.item .name { color: var(--faint); font-size: 11.5px; margin-top: 2px; overflow-wrap: anywhere; }
.item .iq { color: var(--muted); text-align: right; }
.item .is { text-align: right; }

.dtotal { display: flex; justify-content: space-between; padding: var(--s3) 0; font-weight: 600; }
.dtotal .num { font-size: 14px; }
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); }
.actions .btn { flex: 1 1 auto; }

.empty {
  padding: var(--s7) var(--s5);
  color: var(--muted);
  text-align: center;
}
.empty::before {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  margin: 0 auto var(--s3);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: var(--s5);
  translate: -50% 0;
  background: var(--ink);
  color: var(--surface);
  padding: 9px var(--s4);
  border-radius: var(--r);
  font-size: 12.5px;
  max-width: min(560px, calc(100vw - 32px));
  z-index: 60;
  animation: toast-in 160ms var(--ease) both;
}
.toast.err { background: var(--red); }
@keyframes toast-in { from { opacity: 0; translate: -50% 8px; } }

.skeleton { padding: var(--s7); color: var(--faint); text-align: center; }

/* ── адаптив ────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .layout.open { grid-template-columns: 1fr; }
  .drawer {
    position: fixed;
    inset: var(--top) 0 0 auto;
    width: min(440px, 100%);
    z-index: 30;
    box-shadow: -12px 0 32px rgba(32, 31, 28, .08);
  }
  .kpi { padding: var(--s3) var(--s4); }
}

@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { border-bottom: 1px solid var(--line); }
  .kpi:nth-child(odd) { border-right: 1px solid var(--line); }
  .kpi:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .kpi b { font-size: 20px; }
}

@media (max-width: 720px) {
  .topbar { padding: 0 var(--s3); gap: var(--s2); }
  .brand span, .search kbd { display: none; }
  .sync { font-size: 11px; gap: 5px; }
  #syncTime { display: none; }
  #syncShort { display: inline-block; width: 48px; text-align: left; overflow: hidden; text-overflow: ellipsis; }
  .search { max-width: none; }
  .btn { padding: 0 10px; }

  .kpis { grid-template-columns: repeat(6, 1fr); }
  .kpi {
    grid-column: span 2;
    padding: var(--s2) var(--s3);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .kpi:nth-child(3), .kpi:nth-child(5) { border-right: 0; }
  .kpi:nth-child(4), .kpi:nth-child(5) { border-bottom: 0; }
  .kpi:last-child { grid-column: span 4; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .kpi:last-child b { margin-bottom: 0; font-size: 20px; }
  .kpi b { font-size: 19px; }
  .kpi span { font-size: 10px; letter-spacing: .04em; }

  .toolbar { padding: var(--s2) var(--s3); position: static; gap: 8px; }
  .selbar { position: sticky; top: var(--top); z-index: 6; padding: var(--s2) var(--s3); }
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    padding-right: 40px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; scroll-snap-align: start; }

  .filters { flex-wrap: nowrap; gap: 8px; width: 100%; }
  .filters select { max-width: none; height: 38px; }
  #warehouse { flex: 1; min-width: 0; }
  .filter-btn { display: inline-flex; height: 38px; padding: 0 12px; flex: 0 0 auto; }
  .filters-more { display: none; }
  .filters-more.open {
    display: grid;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 41;
    gap: 12px;
    max-height: 86vh;
    overflow: auto;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line-strong);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -16px 44px rgba(22, 27, 33, .18);
    animation: sheet-in 180ms var(--ease);
  }
  .filters-more.open .sheet-head { display: flex; align-items: center; justify-content: space-between; }
  .filters-more.open .sheet-head b { font-size: 15px; }
  .filters-more.open #filterDone { display: inline-flex; }
  .filters-more.open #filterReset { display: inline-flex; width: 100%; height: 40px; border-color: var(--line); background: var(--surface-2); color: var(--muted); }
  .filters-more.open .fitem { display: grid; gap: 5px; }
  .filters-more.open .fitem > span { display: block; color: var(--muted); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; }
  .filters-more.open select { width: 100%; max-width: none; height: 42px; background: var(--surface-2); }
  body.sheet-open { overflow: hidden; }
  @keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }

  .layout { min-height: 0; }

  table, tbody, tr, td { display: block; }
  thead { display: none; }
  tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "num num num" "status comp sum" "dest dest dest" "due due due";
    gap: 4px 8px;
    padding: 10px var(--s4) 12px;
    border-bottom: 1px solid var(--line);
  }
  tbody td { padding: 0; border: 0; white-space: normal; min-width: 0; }
  tbody td:nth-child(2) { grid-area: num; padding-right: 28px; }
  tbody td:nth-child(3) { grid-area: status; align-self: center; }
  tbody td:nth-child(4) { grid-area: comp; align-self: center; text-align: right; padding-right: 8px; }
  tbody td:nth-child(5) { grid-area: sum; align-self: center; text-align: right; }
  tbody td:nth-child(6) { grid-area: dest; border-left: 0; margin-top: 3px; }
  tbody td:nth-child(7) { grid-area: due; margin-top: 2px; white-space: nowrap; }
  tbody td:nth-child(8) { display: none; }
  tbody td.pick { position: absolute; right: var(--s4); top: 10px; display: block; }
  tbody td:nth-child(2) .v { display: block; }
  tbody td:nth-child(3) .chip { margin: 0; }
  tbody td:nth-child(4) .v { font-size: 11px; color: var(--faint); line-height: 1.3; }
  tbody td:nth-child(4) .sub { display: inline; font-size: 11px; color: var(--faint); }
  tbody td:nth-child(4) .sub::before { content: " · "; }
  tbody td:nth-child(5) .v { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
  tbody td:nth-child(6) .v { display: block; line-height: 1.35; }
  tbody td:nth-child(7) .v::before { content: "до "; color: var(--faint); font-size: 11px; }
  tbody td:nth-child(7) .meter { width: 100%; max-width: 220px; height: 3px; margin-top: 5px; }
  .v { text-align: left; min-width: 0; }
  tbody tr.on td:first-child { box-shadow: none; }
  .pager { padding: var(--s2) var(--s3) 56px; }
  @media (max-width: 360px) { #syncShort { display: none; } }
  .drawer { padding: var(--s4); }
  .dmeta { grid-template-columns: 96px 1fr; }
}

@media (min-width: 1361px) {
  .toolbar, .tabs, .filters { flex-wrap: nowrap; }
  .filters select { max-width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .filters-more.open { animation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── вход ───────────────────────────────────────────────────────── */

body.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: var(--bg);
}
.loginbox {
  width: 100%;
  max-width: 380px;
  padding: var(--s6);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
}
.loginbox .brand { margin-bottom: var(--s5); font-size: 15px; }
.loginbox .brand span { display: block; margin: 6px 0 0; line-height: 1.45; white-space: normal; }
.loginbox label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.loginbox input {
  width: 100%;
  height: 38px;
  background: var(--surface-2);
  padding: 0 var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.loginbox input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-weak); }
.loginbox .btn { width: 100%; height: 38px; margin-top: var(--s2); }
.loginbox #err { color: var(--red); font-size: 12px; margin-top: var(--s2); min-height: 1.2em; }
