/* Учёт оборудования — Мясокомбинат «Северный». Один акцент, плотная сетка, Golos Text локально. */
@font-face { font-family: "Golos Text"; font-weight: 400; font-display: swap; src: url("../fonts/golos-text-400-cyrillic.2b8fbbb33a14.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-weight: 400; font-display: swap; src: url("../fonts/golos-text-400-latin.f57df9832ab8.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, 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: "Golos Text"; font-weight: 500; font-display: swap; src: url("../fonts/golos-text-500-cyrillic.2b8fbbb33a14.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-weight: 500; font-display: swap; src: url("../fonts/golos-text-500-latin.f57df9832ab8.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, 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: "Golos Text"; font-weight: 600; font-display: swap; src: url("../fonts/golos-text-600-cyrillic.2b8fbbb33a14.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-weight: 600; font-display: swap; src: url("../fonts/golos-text-600-latin.f57df9832ab8.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f3f4f6; --surface: #ffffff; --surface-2: #f8f9fb; --border: #e2e5ea; --border-strong: #c9cfd8;
  --text: #15181e; --text-2: #4b5563; --muted: #7b8494;
  --accent: #1d5fd1; --accent-hover: #174db0; --accent-soft: #e8f0fd; --accent-text: #ffffff;
  --ok: #1d7f4f; --ok-soft: #e3f4ea; --warn: #a65c00; --warn-soft: #fdf0dc; --danger: #c02a2a; --danger-soft: #fbe5e5;
  --info: #1d5fd1; --info-soft: #e8f0fd; --muted-soft: #eceef2;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --radius: 6px; --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1216; --surface: #171b21; --surface-2: #1d222a; --border: #272d37; --border-strong: #3a4250;
  --text: #e7eaef; --text-2: #b4bcc8; --muted: #7f8896;
  --accent: #5b94f0; --accent-hover: #74a6f5; --accent-soft: #1b2a45; --accent-text: #0b1220;
  --ok: #4cc38a; --ok-soft: #14301f; --warn: #e2a93b; --warn-soft: #332611; --danger: #ef6b6b; --danger-soft: #3a1818;
  --info: #5b94f0; --info-soft: #1b2a45; --muted-soft: #232a34;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); font-feature-settings: "tnum" 1; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
p { margin: 0 0 8px; }
.ic { vertical-align: -3px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.grow { flex: 1; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 12px; }

/* --- плашка демо --- */
.demo-bar { background: #1f2430; color: #d6dae3; font-size: 12px; line-height: 28px; height: 28px; padding: 0 12px; white-space: nowrap; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 6px; position: relative; }
.demo-bar a { color: #fff; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.demo-bar .db-short, .demo-bar .db-x { display: none; }
.demo-bar.db-hidden { display: none; }
.db-about { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px; border: 0; background: none; color: #fff; font: inherit; font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.db-x { position: absolute; right: 0; top: 0; height: 28px; width: 40px; border: 0; background: none; color: #d6dae3; cursor: pointer; place-items: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:root[data-theme="dark"] .demo-bar { background: #0a0c10; }

/* --- шапка --- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.topbar-in { max-width: 1320px; margin: 0 auto; padding: 0 20px; height: 52px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 6px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-size: 13px; font-weight: 700; letter-spacing: 0; }
.brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; line-height: 1.1; }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a { padding: 6px 10px; border-radius: var(--radius); color: var(--text-2); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; width: 34px; height: 34px; border-radius: var(--radius); border: 1px solid transparent; background: transparent; color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.dot { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface-2); cursor: pointer; list-style: none; color: var(--text); }
.user-chip::-webkit-details-marker, .more-menu summary::-webkit-details-marker { display: none; }
.more-menu summary { list-style: none; }
.umenu, .more-menu { position: relative; }
.umenu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 240px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(15, 18, 22, .18); padding: 6px; display: grid; }
.umenu-pop form { margin: 0; }
.umenu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: grid; }
.umenu-head span { color: var(--muted); font-size: 12px; }
.umenu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: 4px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.umenu-item:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.umenu-item .ic { color: var(--muted); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.user-chip .name { font-weight: 500; line-height: 1.1; font-size: 13px; }
.user-chip .role { font-size: 11px; color: var(--muted); line-height: 1.1; }
.user-chip form { margin: 0; display: flex; }
.user-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; display: grid; }
.user-chip button:hover { color: var(--danger); }

/* --- контейнер --- */
.main { max-width: 1320px; margin: 0 auto; padding: 20px 20px 16px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); }

/* --- карточки, таблицы --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-body { padding: 14px; }
.card-foot { padding: 10px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.t td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: var(--surface-2); }
.t a.strong, .strong { font-weight: 500; color: var(--text); }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t .sub { display: block; color: var(--muted); font-size: 12px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.empty .ic { color: var(--border-strong); margin-bottom: 8px; }

/* --- бейджи --- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 18px; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: var(--muted-soft); color: var(--text-2); }
.tag { display: inline-block; padding: 0 6px; border: 1px solid var(--border); border-radius: 4px; font-size: 11px; color: var(--muted); line-height: 18px; }

/* --- кнопки --- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; line-height: 18px; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(1.08); }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: center; }

/* --- формы --- */
.input, select.input, textarea.input { width: 100%; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; line-height: 20px; }
.input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.field { display: grid; gap: 4px; }
.field label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.field .help { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--danger); }
.field.inline { grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.field .check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); font-weight: 400; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.form-grid .span2 { grid-column: span 2; }
.check { width: 16px; height: 16px; accent-color: var(--accent); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.filters .input { width: auto; min-width: 140px; padding: 5px 9px; font-size: 13px; }
.filters .search { min-width: 220px; flex: 1; }
.filters select.input { padding-right: 26px; }

/* --- вкладки --- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 8px; overflow-x: auto; }
.tabs a { padding: 10px 12px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { background: var(--muted-soft); color: var(--text-2); border-radius: 9px; padding: 0 6px; font-size: 11px; line-height: 18px; }
.tabs a.active .count { background: var(--accent-soft); color: var(--accent); }

/* --- KPI --- */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.kpi .label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 24px; font-weight: 600; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .value.danger { color: var(--danger); }
.kpi .value.warn { color: var(--warn); }
.kpi .note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.grid-2-3 { display: grid; grid-template-columns: 2fr 3fr; gap: 16px; }
.grid-2 > *, .grid-3-2 > *, .grid-2-3 > *, .stack > *, .kpis > * { min-width: 0; }

/* --- простые диаграммы --- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: 6px 0 0; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.bars .bar i { display: block; width: 100%; max-width: 48px; background: var(--accent); border-radius: 3px 3px 0 0; opacity: .9; }
.bars .bar span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.bars .bar b { font-size: 11px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.hbar { display: grid; grid-template-columns: 180px 1fr 70px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.hbar .track { height: 10px; background: var(--muted-soft); border-radius: 5px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.hbar .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.hbar.danger .track i { background: var(--danger); }
.hbar.warn .track i { background: var(--warn); }

/* --- описание (dl) --- */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }

/* --- статус-процесс заявки --- */
.steps { display: flex; align-items: center; gap: 0; }
.step { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.step i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: 11px; font-style: normal; background: var(--surface); }
.step.done { color: var(--text-2); }
.step.done i { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.current { color: var(--accent); }
.step.current i { border-color: var(--accent); color: var(--accent); }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 8px; min-width: 16px; }
.step-line.done { background: var(--ok); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline .pt { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); margin-top: 6px; }
.timeline li.status .pt { background: var(--accent); }
.timeline .meta { font-size: 12px; color: var(--muted); }

/* --- сообщения --- */
.msgs { display: grid; gap: 8px; margin-bottom: 14px; }
.msg { padding: 9px 12px; border-radius: var(--radius); border: 1px solid; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.msg-success { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.msg-error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.msg-warning { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.msg-info { background: var(--info-soft); border-color: transparent; color: var(--info); }

/* --- пагинация --- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* --- список-карточки для телефона --- */
.cards-mobile { display: none; }
.t tr[data-href] { cursor: pointer; }
.chips { display: flex; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.chip { display: inline-flex; align-items: center; padding: 3px 12px; border: 1px solid var(--border-strong); border-radius: 16px; color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap; background: var(--surface); }
.chip:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.m-card { display: block; position: relative; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
a.m-card:hover { text-decoration: none; border-color: var(--border-strong); }
.m-card.has-chev { padding-right: 36px; }
.m-card .chev { position: absolute; right: 10px; top: 50%; margin-top: -9px; color: var(--muted); }
.mc-1 { display: flex; align-items: center; gap: 8px; color: var(--text); }
.mc-1 b { font-weight: 600; }
.mc-link { min-height: 44px; margin: -12px -14px 0; padding: 12px 14px 0; display: flex; }
.mc-link:hover { text-decoration: none; }
.mc-r { margin-left: auto; }
.mc-2 { margin-top: 4px; }
.mc-3 { margin-top: 3px; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-btn { margin-top: 10px; min-height: 44px; }
.danger { color: var(--danger); }
.warn { color: var(--warn); }

/* --- нижний лист --- */
.sheet { position: fixed; z-index: 70; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--border-strong); border-bottom: 0; border-radius: 12px 12px 0 0; box-shadow: 0 -12px 32px rgba(15, 18, 22, .2); padding-bottom: env(safe-area-inset-bottom); }
.sheet[hidden] { display: none; }
.sheet-head, .fsheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--border); }
.sheet-body { padding: 14px 16px 16px; }
.sheet-actions { display: grid; gap: 8px; margin-top: 12px; }
.sheet-bg { position: fixed; inset: 0; z-index: 65; background: rgba(15, 18, 22, .42); }
.sheet-bg[hidden] { display: none; }
.fsheet { display: contents; }
.fsheet-head { display: none; }
.fs-field { display: contents; }
.fs-field > span { display: none; }

/* --- полоска «что потыкать» --- */
.steps-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 6px 6px 6px 14px; margin-bottom: 14px; background: var(--accent-soft); border: 1px solid transparent; border-radius: var(--radius); font-size: 13px; }
.steps-strip a { font-weight: 500; }
.ss-title { color: var(--text-2); font-weight: 600; }
.ss-arr { color: var(--muted); }
.ss-x { margin-left: auto; order: 9; }

/* --- подвал --- */
.site-foot { max-width: 1320px; margin: 0 auto; padding: 8px 20px 32px; color: var(--muted); font-size: 12px; }

/* --- вход --- */
.login-wrap { min-height: calc(100vh - 28px); display: grid; place-items: start center; padding: 40px 16px 24px; }
.login { width: 100%; max-width: 480px; }
.login-brand { margin-bottom: 14px; }
.login-h1 { font-size: 22px; line-height: 1.25; margin-bottom: 16px; }
.role-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; text-align: left; padding: 10px 14px; margin-bottom: 8px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius); cursor: pointer; font: inherit; color: var(--text); }
.role-btn.role-first { border-color: var(--accent); border-width: 2px; padding: 9px 13px; }
.start-here { font-style: normal; font-size: 11px; font-weight: 600; color: var(--accent-text); background: var(--accent); border-radius: 9px; padding: 1px 7px; margin-left: 4px; white-space: nowrap; vertical-align: 1px; }
.login-note { margin: 10px 0 12px; }
.login-more { border-top: 1px solid var(--border); }
.login-more summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 500; color: var(--text-2); }
.login-more p { color: var(--text-2); font-size: 13px; }
.login-links { margin: 12px 0 0; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.login-links a { min-height: 44px; display: inline-flex; align-items: center; }
.role-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.role-btn b { display: block; font-weight: 600; }
.role-btn span { display: block; font-size: 12px; color: var(--muted); }
.role-btn .ic { color: var(--accent); }

/* --- QR и наклейки --- */
.qr-box { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.qr-box svg { width: 132px; height: 132px; background: #fff; padding: 6px; border-radius: 4px; border: 1px solid var(--border); }
.scan-video { width: 100%; max-width: 420px; aspect-ratio: 1; background: #000; border-radius: var(--radius); overflow: hidden; margin: 0 auto; }
.scan-video video { width: 100%; height: 100%; object-fit: cover; }
#reader { width: 100%; }
#reader video { border-radius: var(--radius); }

/* --- нижняя панель (телефон) --- */
.bottom-nav { display: none; }

/* --- командная палитра (Ctrl+K) --- */
.palette { position: fixed; inset: 0; z-index: 60; background: rgba(15, 18, 22, .38); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette-box { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(15, 18, 22, .18); overflow: hidden; }
.palette-box .input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 12px 14px; font-size: 15px; }
.palette-box .input:focus { outline: none; }
.palette-box ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette-box li a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 4px; color: var(--text); }
.palette-box li a:hover, .palette-box li.sel a { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.palette-foot { padding: 8px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

/* --- печать --- */
@media print {
  .demo-bar, .topbar, .bottom-nav, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .main { padding: 0; max-width: none; }
}

/* --- адаптив --- */
@media (max-width: 1024px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .grid-3-2, .grid-2-3 { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 130px 1fr 60px; }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  .main { padding: 14px 16px 8px; }
  .site-foot { padding: 0 16px calc(76px + env(safe-area-inset-bottom)); }
  .topbar-in { padding: 0 12px; height: 48px; gap: 8px; }
  .nav, .user-chip .name, .user-chip .role, .brand small { display: none; }
  .brand { font-size: 14px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi .value { font-size: 20px; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }
  .filters .input { min-width: 0; flex: 1; }
  .filters .search { min-width: 100%; }
  .page-head h1 { font-size: 18px; }
  .table-mobile-hide { display: none; }
  .hide-mobile { display: none !important; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dt { font-size: 12px; margin-top: 6px; }
  .hbar { grid-template-columns: 1fr; gap: 3px; }
  .bars { gap: 3px; }
  .bars .bar b { font-size: 11px; white-space: normal; text-align: center; line-height: 1.1; }
  .bars .bar span { font-size: 11px; }
  .card-head { flex-wrap: wrap; }
  .hbar .val { text-align: left; }
  .steps { flex-wrap: wrap; row-gap: 6px; }
  .step-line { min-width: 8px; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a { flex: 1; display: grid; place-items: center; gap: 2px; padding: 8px 4px 6px; font-size: 11px; color: var(--text-2); font-weight: 500; }
  .bottom-nav a.active { color: var(--accent); }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav .scan-main { color: var(--accent); }
  .qr-box { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .btn-mobile-block { width: 100%; justify-content: center; }
}
@media (min-width: 761px) { .only-mobile { display: none !important; } }

/* --- телефон < 640: один мобильный модуль (карточки, листы, зоны 44, поля 16) --- */
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px !important; }
  .input { min-height: 44px; }
  .check { width: 22px; height: 22px; }
  .field .check-row { min-height: 44px; font-size: 15px; }
  .card-head a { min-width: 44px; justify-content: center; }
  .crumbs a { min-width: 44px; }
  .dl dd a { min-height: 44px; display: inline-flex; align-items: center; }
  .demo-bar { justify-content: flex-start; padding: 0 40px 0 12px; }
  .demo-bar .db-full { display: none; }
  .demo-bar .db-short { display: inline; overflow: hidden; text-overflow: ellipsis; }
  .demo-bar .db-x { display: grid; }
  .topbar-in { height: 52px; gap: 4px; padding: 0 8px 0 12px; }
  .brand { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .dot { top: 6px; right: 6px; }
  .user-chip { padding: 4px; min-height: 44px; min-width: 44px; justify-content: center; border-radius: 22px; }
  .user-chip .avatar { width: 34px; height: 34px; font-size: 12px; }
  .chip-txt { display: none; }
  .umenu-pop { min-width: 260px; max-width: calc(100vw - 16px); }
  .umenu-item { min-height: 48px; }
  .btn { min-height: 44px; padding: 10px 14px; }
  .btn-sm { min-height: 44px; font-size: 13px; }
  .page-head .row .btn { flex: 1 1 auto; justify-content: center; }
  .page-head .act-row .btn-primary { flex-basis: 100%; }
  .act-row .more-menu { flex: none; }
  .tabs a { min-height: 44px; }
  .card-head a, .crumbs a, .pager a { min-height: 44px; display: inline-flex; align-items: center; }
  .crumbs { flex-wrap: wrap; }
  .login-wrap { padding: 14px 16px 24px; }
  .login-brand { margin-bottom: 8px; }
  .login-h1 { font-size: 19px; margin-bottom: 12px; }
  .role-btn { margin-bottom: 6px; }
  .role-btn b { font-size: 14px; }
  .chips { padding: 8px 12px; }
  .chip { min-height: 44px; padding: 0 16px; font-size: 14px; }
  /* списки: таблица → карточки */
  .list-table { display: none; }
  .cards-mobile { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px; }
  .card { min-width: 0; }
  .t td a, .t td .btn { min-height: 44px; display: inline-flex; align-items: center; }
  /* фильтры → кнопка «Фильтры (N)» + нижний лист */
  .filters { flex-wrap: nowrap; padding: 10px 12px; }
  .filters .search { min-width: 0; flex: 1; min-height: 44px; }
  .fsheet-btn { flex: none; }
  .fsheet { display: none; position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 12px 12px 0 0; box-shadow: 0 -12px 32px rgba(15, 18, 22, .2); padding: 0 0 calc(12px + env(safe-area-inset-bottom)); max-height: 85vh; overflow-y: auto; }
  .fsheet.open { display: grid; gap: 12px; }
  .fsheet-head { display: flex; }
  .fs-field { display: grid; gap: 4px; padding: 0 16px; }
  .fs-field > span { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); }
  .fs-field .input { width: 100%; min-height: 48px; min-width: 0; }
  .fs-check { padding: 0 16px; min-height: 44px; font-size: 15px; }
  .fsheet-apply { margin: 4px 16px 0; min-height: 52px; justify-content: center; font-size: 16px; background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
  .fsheet-reset { margin: 0 16px; justify-content: center; }
  .steps-strip { display: grid; grid-template-columns: 1fr auto; gap: 0; font-size: 14px; padding: 0 0 4px 12px; }
  .steps-strip a { grid-column: 1 / -1; }
  .ss-title { align-self: center; }
  .ss-arr { display: none; }
  .ss-x { grid-column: 2; grid-row: 1; }
  .steps-strip a { min-height: 44px; display: inline-flex; align-items: center; }
  .site-foot { padding: 0 16px calc(76px + env(safe-area-inset-bottom)); }
  .site-foot a { min-height: 44px; display: inline-flex; align-items: center; }
  .sheet { max-width: none; }
}
