/* Ремона — интерфейс. Сталь + сигнальный жёлтый; кислород — синий, пропан — красный (как на баллонах). */
:root {
  color-scheme: light dark;
  --steel: #1e252b; --steel-2: #2b343c; --steel-3: #46525c;
  --bg: #e9ebec; --panel: #ffffff; --panel-2: #f3f4f5; --line: #d3d8db; --line-2: #e4e7e9;
  --ink: #1e252b; --ink-2: #56626b; --ink-3: #85909a;
  --signal: #f5b800; --signal-soft: #fff3c9;
  --oxy: #1f5fbf; --oxy-soft: #e3edfb; --pro: #c8372d; --pro-soft: #fbe6e4;
  --ok: #2f7d4f; --ok-soft: #e1f1e7; --warn: #a15f00; --warn-soft: #fff0d2;
  --danger: #b3261e; --danger-soft: #fbe4e2;
  --btn: var(--steel); --btn-ink: #ffffff; --btn-hover: #323e47;
  --top: #1e252b; --top-ink: #f2f4f5;
  --radius: 8px; --radius-sm: 5px;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: Bahnschrift, "DIN Alternate", "Roboto Condensed", sans-serif-condensed, "Arial Narrow", system-ui, sans-serif;
  --nav-h: 62px; --top-h: 58px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161a; --panel: #1b2126; --panel-2: #222a30; --line: #323b43; --line-2: #29323a;
    --ink: #e9edf0; --ink-2: #a7b2ba; --ink-3: #74808a; --signal-soft: #3b3110;
    --oxy: #7aaaff; --oxy-soft: #16263f; --pro: #ff8176; --pro-soft: #3d1c1a;
    --ok: #5fc686; --ok-soft: #173324; --warn: #f0b04a; --warn-soft: #3a2d12;
    --danger: #ff8279; --danger-soft: #3d1c1a;
    --btn: #e9edf0; --btn-ink: #12161a; --btn-hover: #ffffff;
    --top: #0e1215;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 var(--font-body); -webkit-tap-highlight-color: transparent;
}
body.modal-open { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- каркас */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--top); color: var(--top-ink);
  display: flex; align-items: center; gap: 12px; min-height: var(--top-h);
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700;
  font-size: 22px; letter-spacing: .01em; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex: none; border-radius: 8px; background: #fff; object-fit: contain; }
.top-user { margin-left: auto; text-align: right; line-height: 1.2; min-width: 0; }
.top-user b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-user span { font-size: 12.5px; color: #aab5bd; }
.role-chip { display: inline-block; font-size: 11.5px; font-weight: 700; line-height: 1; padding: 4px 7px; border-radius: 3px;
  background: var(--signal); color: #1e252b; margin-left: 6px; vertical-align: 1px; }
.top-user .role-chip { color: #1e252b; }
.top-user .role-chip.user { background: #3a4650; color: #e6eaed; }
.top-user .role-chip.engineer, .top-user .role-chip.foreman, .top-user .role-chip.storekeeper { background: #c9d3da; color: #1e252b; }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: #5fc686; flex: none; }
.conn-dot.off { background: #e0554b; }

.nav {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; background: var(--top);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid #000;
}
.nav a {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: #98a4ad; text-decoration: none; font-size: 10.5px; white-space: nowrap; position: relative; padding-top: 4px;
}
.nav a svg { width: 22px; height: 22px; }
.lbl-short { display: none; }
@media (max-width: 440px) { .lbl-full { display: none; } .lbl-short { display: inline; } }
.nav a.active { color: #fff; }
.nav a.active::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; background: var(--signal); }
.nav a.active svg { color: var(--signal); }
.nav .badge { position: absolute; top: 5px; left: calc(50% + 6px); }
.nav-brand { display: none; }

main { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto;
  padding: 16px 14px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }

@media (min-width: 900px) {
  .nav { top: 0; right: auto; bottom: 0; width: 214px; height: auto; flex-direction: column; justify-content: flex-start;
    padding: 14px 10px; border-top: 0; border-right: 1px solid #000; gap: 2px; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 14.5px; padding: 11px 12px;
    border-radius: var(--radius-sm); }
  .nav a svg { width: 21px; height: 21px; }
  .lbl-full { display: inline !important; } .lbl-short { display: none !important; }
  .nav a.active { background: #2b343c; }
  .nav a.active::before { top: 8px; bottom: 8px; left: 0; right: auto; width: 3px; height: auto; }
  .nav .badge { position: static; margin-left: auto; }
  .nav-brand { display: flex; padding: 6px 12px 18px; color: #fff; }
  .shell { margin-left: 214px; }
  .topbar .brand { display: none; }
  main { padding-bottom: 40px; padding-top: 22px; }
}

/* ---------------------------------------------------------------- типографика и базовые блоки */
.page-title { font-family: var(--font-head); font-size: 26px; font-weight: 700; line-height: 1.15; }
.page-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; flex-wrap: wrap; }
.page-head .grow { flex: 1 1 190px; min-width: 0; }
.page-head > .row { margin-left: auto; }
.sub { color: var(--ink-2); font-size: 13.5px; }
.muted { color: var(--ink-3); }
.section-title { font-family: var(--font-head); font-size: 18px; font-weight: 700; margin: 22px 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-title .btn { white-space: nowrap; }
.section-title .grow { flex: 1; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-pad { padding: 14px; }
.list > * + * { border-top: 1px solid var(--line-2); }
.item { display: flex; gap: 12px; padding: 12px 14px; align-items: flex-start; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 600; word-break: break-word; }
.item-meta { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; word-break: break-word; }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
a.item { text-decoration: none; }
a.item:hover { background: var(--panel-2); }
.edge { border-left: 4px solid var(--line); }
.edge.in_work { border-left-color: var(--ok); }
.edge.waiting { border-left-color: var(--signal); }
.edge.archive { border-left-color: var(--ink-3); }

.empty { text-align: center; padding: 34px 18px; color: var(--ink-2); }
.empty svg { width: 34px; height: 34px; color: var(--ink-3); margin-bottom: 6px; }
.empty .btn { margin-top: 12px; }
.skeleton { height: 90px; border-radius: var(--radius); background: linear-gradient(90deg, var(--line-2), var(--panel-2), var(--line-2)); background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite; }
.skeleton + .skeleton { margin-top: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- вкладки */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { appearance: none; border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -2px; display: flex; gap: 7px; align-items: center; }
@media (max-width: 440px) { .tab { padding: 10px 7px; gap: 4px; font-size: 14px; } .tab .count { padding: 1px 6px; } }
.tab.active { color: var(--ink); border-bottom-color: var(--signal); }
.tab .count { font-size: 12px; font-weight: 700; background: var(--line-2); color: var(--ink-2); border-radius: 10px; padding: 1px 7px; }
.tab.active .count { background: var(--signal); color: #1e252b; }
.subtabs { display: inline-flex; background: var(--line-2); border-radius: var(--radius); padding: 3px; gap: 2px; margin-bottom: 14px; }
.subtabs .tab { border: 0; margin: 0; padding: 7px 16px; border-radius: 6px; }
.subtabs .tab.active { background: var(--panel); box-shadow: 0 0 0 1px var(--line); }

/* ---------------------------------------------------------------- кнопки и формы */
.btn { appearance: none; border: 1px solid transparent; background: var(--btn); color: var(--btn-ink); border-radius: var(--radius-sm);
  padding: 9px 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--btn-hover); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.secondary { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--panel-2); }
.btn.signal { background: var(--signal); color: #1e252b; }
.btn.signal:hover { background: #ffc61f; }
.btn.danger { background: var(--panel); color: var(--danger); border-color: var(--line); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.sm { min-height: 34px; padding: 5px 10px; font-size: 13.5px; }
.btn.icon { padding: 0; width: 40px; }
.btn.icon.sm { width: 34px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.field { display: block; margin-bottom: 14px; }
.field > .label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; }
.field .hint { color: var(--ink-3); font-size: 12.5px; margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 11px; min-height: 42px; font-size: 16px; }
textarea.input { resize: vertical; min-height: 84px; }
.input:focus { outline: 3px solid color-mix(in srgb, var(--signal) 55%, transparent); border-color: var(--steel-3); }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row label { flex: 1; min-width: 88px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 8px;
  cursor: pointer; font-weight: 600; background: var(--panel); }
.radio-row input { position: absolute; opacity: 0; pointer-events: none; }
.radio-row label:has(input:checked) { background: var(--steel); color: #fff; border-color: var(--steel); }
@media (prefers-color-scheme: dark) { .radio-row label:has(input:checked) { background: var(--signal); color: #1e252b; border-color: var(--signal); } }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); margin-bottom: 14px; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--steel); flex: none; }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 14px; margin-bottom: 12px; }
.pick { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.pick:last-child { border-bottom: 0; }
.pick input { width: 20px; height: 20px; accent-color: var(--steel); }
.pick-list { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); max-height: 280px; overflow: auto; margin-bottom: 14px; }

/* ---------------------------------------------------------------- чипы, значки */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 3px 8px; border-radius: 4px;
  background: var(--line-2); color: var(--ink-2); line-height: 1.3; white-space: nowrap; }
.chip svg { width: 14px; height: 14px; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.signal { background: var(--signal-soft); color: var(--warn); }
.chip.oxy { background: var(--oxy-soft); color: var(--oxy); }
.chip.pro { background: var(--pro-soft); color: var(--pro); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e0554b; color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--steel-2); color: #fff; font-family: var(--font-head); font-weight: 700;
  display: grid; place-items: center; flex: none; position: relative; font-size: 15px; }
.avatar.admin { background: var(--signal); color: #1e252b; }
.avatar .online { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #5fc686; border: 2px solid var(--panel); }

/* ---------------------------------------------------------------- баллоны (цвета как на реальных) */
.cyl { width: 17px; height: 31px; flex: none; }
.cyl .body { stroke-width: 1.6; }
.cyl.oxygen { --g: var(--oxy); --g-soft: var(--oxy-soft); }
.cyl.propane { --g: var(--pro); --g-soft: var(--pro-soft); }
.cyl .body { stroke: var(--g); fill: var(--g); }
.cyl .head { fill: var(--steel-3); }
.cyl.cyl-empty .body { fill: var(--g-soft); }
.cyl.cyl-empty .band { display: none; }
.cyl .band { fill: rgba(255,255,255,.45); }
.cyl-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cyl-count { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.cyl-count b { font-family: var(--font-head); font-size: 22px; line-height: 1; }
.cyl-total { margin-left: auto; color: var(--ink-2); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.cyl-total b { font-family: var(--font-head); font-size: 18px; color: var(--ink); }
.qty-note { margin-top: 6px; }
.cyl-count small { color: var(--ink-2); font-weight: 500; font-size: 12.5px; }
.gas-name { font-weight: 700; min-width: 78px; }
.gas-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex-wrap: wrap; }
.gas-row + .gas-row { border-top: 1px solid var(--line-2); }
.gas-head { display: flex; align-items: center; gap: 8px; min-width: 100px; }
.gas-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.gas-head .dot.oxygen { background: var(--oxy); }
.gas-head .dot.propane { background: var(--pro); }
.gas-card { padding: 14px; }
/* счётчик количества: − число + */
.qty-block { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.qty-title { font-size: 12.5px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.qty-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; flex-wrap: wrap; }
.qty-row .lbl { flex: 1; min-width: 130px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.stepper button { appearance: none; border: 0; background: var(--panel-2); color: var(--ink); width: 44px; min-height: 44px; font-size: 24px; font-weight: 700; line-height: 1; cursor: pointer; }
.stepper button:hover:not(:disabled) { background: var(--line-2); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper .val { min-width: 54px; padding: 0 8px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--panel);
  font-family: var(--font-head); font-size: 22px; font-weight: 700; }
.stepper button.val:hover { background: var(--signal-soft); }
.stepper input.val { width: 74px; text-align: center; min-height: 44px; border-radius: 0; border-top: 0; border-bottom: 0; }
.gas-card h3 { font-family: var(--font-head); font-size: 19px; display: flex; align-items: center; gap: 8px; }
.gas-card .big { font-family: var(--font-head); font-size: 40px; line-height: 1; font-weight: 700; margin: 8px 0 2px; }
.split-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line-2); margin: 10px 0; }
.split-bar i { display: block; }
.split-bar .f.oxygen { background: var(--oxy); } .split-bar .f.propane { background: var(--pro); }
.split-bar .e.oxygen { background: var(--oxy-soft); } .split-bar .e.propane { background: var(--pro-soft); }
.grid-2 { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- главная */
.notice { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.notice + .notice { margin-top: 10px; }
.notice::before { content: ""; display: block; height: 7px;
  background: repeating-linear-gradient(135deg, var(--signal) 0 11px, var(--steel) 11px 22px); }
.notice-body { padding: 12px 14px 14px; }
.notice h3 { font-family: var(--font-head); font-size: 18px; line-height: 1.25; margin-bottom: 4px; }
.notice p { white-space: pre-wrap; word-break: break-word; }
.notice .meta { color: var(--ink-2); font-size: 13px; margin-top: 6px; }
.notice .btn { margin-top: 12px; }
.notice.read::before { background: var(--line); }
.calm { display: flex; align-items: center; gap: 10px; padding: 14px; color: var(--ink-2); }
.calm svg { width: 22px; height: 22px; color: var(--ok); }

.board { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.board a { padding: 14px; text-decoration: none; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); display: block; min-width: 0; }
.board a:nth-child(2n) { border-right: 0; }
.board a:nth-last-child(-n+2) { border-bottom: 0; }
.board a:hover { background: var(--panel-2); }
.board .num { font-family: var(--font-head); font-size: 38px; line-height: 1; font-weight: 700; }
.board .lbl { font-weight: 600; margin-top: 6px; }
.board .note { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
@media (min-width: 760px) {
  .board { grid-template-columns: repeat(4, 1fr); }
  .board a { border-bottom: 0; border-right: 1px solid var(--line-2) !important; }
  .board a:last-child { border-right: 0 !important; }
}
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick a { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 6px 12px; text-align: center; text-decoration: none;
  position: relative; font-weight: 600; font-size: 14px; }
.quick a:hover { background: var(--panel-2); }
.quick svg { width: 26px; height: 26px; display: block; margin: 0 auto 6px; color: var(--steel-3); }
@media (prefers-color-scheme: dark) { .quick svg { color: var(--ink-2); } }
.quick .badge { position: absolute; top: 7px; right: 9px; }
@media (min-width: 760px) { .quick { grid-template-columns: repeat(6, 1fr); } }
.progress { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; margin-top: 8px; max-width: 280px; }
.progress i { display: block; height: 100%; background: var(--ok); }

/* ---------------------------------------------------------------- модальные окна, уведомления */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(10,14,17,.55); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--panel); width: 100%; max-width: 520px; max-height: 92dvh; display: flex; flex-direction: column;
  border-radius: 14px 14px 0 0; border: 1px solid var(--line); animation: sheet .18s ease-out; }
.modal.wide { max-width: 720px; }
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.modal-head h2 { font-family: var(--font-head); font-size: 21px; flex: 1; line-height: 1.2; }
.modal-body { padding: 4px 16px 6px; overflow: auto; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.modal-actions .btn { flex: 1 1 auto; }
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal { border-radius: 12px; }
  .modal-actions .btn { flex: 0 0 auto; }
}
.toasts { position: fixed; z-index: 200; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--steel); color: #fff; padding: 11px 16px; border-radius: var(--radius-sm); font-weight: 600; max-width: 460px; box-shadow: 0 4px 18px rgba(0,0,0,.28);
  border-left: 5px solid var(--signal); animation: sheet .18s ease-out; pointer-events: auto; }
.toast.error { border-left-color: #e0554b; }
.toast.ok { border-left-color: #5fc686; }
.pw-box { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 22px; font-weight: 700; letter-spacing: .04em; background: var(--panel-2);
  border: 1px dashed var(--steel-3); border-radius: var(--radius-sm); padding: 14px; text-align: center; margin: 6px 0 12px; user-select: all; word-break: break-all; }

/* ---------------------------------------------------------------- вход */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: var(--steel);
  background-image: repeating-linear-gradient(135deg, transparent 0 28px, rgba(245,184,0,.07) 28px 56px); }
.login { background: var(--panel); border-radius: 12px; padding: 26px 22px 22px; width: 100%; max-width: 380px; border-top: 8px solid var(--signal); }
.login .brand { color: var(--ink); font-size: 34px; margin-bottom: 4px; }
.login .brand { flex-direction: column; gap: 6px; }
.login .brand-mark.big { width: 132px; height: 132px; border-radius: 22px; box-shadow: 0 0 0 1px var(--line); }
.login p.sub { margin-bottom: 20px; }
.login .foot { margin-top: 16px; font-size: 13px; color: var(--ink-3); text-align: center; }

/* ---------------------------------------------------------------- чат */
.chat-box { display: flex; flex-direction: column; height: calc(100dvh - var(--top-h) - var(--nav-h) - 120px - env(safe-area-inset-bottom));
  min-height: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 900px) { .chat-box { height: calc(100dvh - 190px); } }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel-2); min-height: 52px; }
.chat-head > svg { width: 26px; height: 26px; flex: none; color: var(--steel-3); }
.chat-head .grow { flex: 1; }
.chat-head b { font-weight: 700; display: block; line-height: 1.2; }
.chat-feed { flex: 1; overflow-y: auto; padding: 12px 12px 4px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.day-sep { align-self: center; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--line-2); padding: 2px 10px; border-radius: 10px; margin: 8px 0 4px; }
.msg { max-width: min(82%, 520px); padding: 7px 11px 5px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2); align-self: flex-start; word-break: break-word; }
.msg.mine { align-self: flex-end; background: var(--signal-soft); border-color: color-mix(in srgb, var(--signal) 45%, transparent); }
.msg .who { font-size: 12.5px; font-weight: 700; color: var(--oxy); margin-bottom: 1px; }
.msg .who.admin { color: var(--warn); }
.msg .txt { white-space: pre-wrap; }
.msg .txt a { color: var(--oxy); }
.msg time { display: block; text-align: right; font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.msg img.pic { display: block; max-width: 100%; max-height: 280px; border-radius: 6px; margin: 2px 0 4px; background: var(--line-2); }
.file-chip { display: flex; gap: 9px; align-items: center; padding: 8px 10px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; margin: 2px 0 4px; }
.file-chip svg { width: 22px; height: 22px; flex: none; color: var(--steel-3); }
.file-chip b { display: block; font-size: 14px; line-height: 1.25; word-break: break-all; }
.file-chip small { color: var(--ink-2); }
.gone { font-style: italic; color: var(--ink-3); font-size: 13.5px; }
.chat-more { align-self: center; }
.composer { border-top: 1px solid var(--line); padding: 8px; background: var(--panel-2); position: relative; }
.composer-row { display: flex; gap: 6px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 42px; max-height: 130px; resize: none; padding: 9px 11px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); font-size: 16px; line-height: 1.35; }
.attach-preview { display: flex; gap: 8px; align-items: center; padding: 6px 10px; margin-bottom: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
.attach-preview span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emoji-panel { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 4px); background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; box-shadow: 0 6px 24px rgba(0,0,0,.2); max-width: 420px; z-index: 5; }
.emoji-panel button { border: 0; background: none; font-size: 23px; line-height: 1; padding: 6px 0; border-radius: 5px; cursor: pointer; }
.emoji-panel button:hover { background: var(--line-2); }
.dialog-row { display: flex; gap: 12px; align-items: center; padding: 11px 14px; text-decoration: none; }
.dialog-row:hover { background: var(--panel-2); }
.dialog-row .last { color: var(--ink-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dialog-row time { font-size: 12px; color: var(--ink-3); }

/* ---------------------------------------------------------------- таблица сотрудников */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 13px; color: var(--ink-2); font-weight: 600; padding: 9px 12px; border-bottom: 2px solid var(--line); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; background: var(--panel-2); padding: 2px 6px; border-radius: 4px; }
@media (max-width: 720px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  .table td { border: 0; padding: 2px 0; }
  .table td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-3); font-size: 13px; }
}

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

.stock-sum { margin-bottom: 12px; }

.pick input[type=number] { width: 84px; height: auto; text-align: center; }
.item .stepper.item-qty { flex: none; align-self: flex-start; }
.item .stepper.item-qty button { width: 40px; min-height: 40px; }
