/* FLIKKŌ · производство. Рабочий интерфейс в фирменном стиле: бумажный фон, графит и мох,
   заголовки — Tenor Sans заглавными, текст — Inter. Отделы различаются цветом и значком.
   Каркас: меню слева, сверху месяц, ниже рабочая область карточками. Цвета графиков проверены на различимость. */
@font-face { font-family: "Inter"; src: url("fonts/Inter-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Tenor Sans"; src: url("fonts/TenorSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #eeebe4;
  --surface: #fdfcf9;
  --ink: #1f1e1c;
  --ink-2: #4b4842;
  --muted: #6b675f;
  --line: #e2ddd2;
  --line-2: #cec7b9;
  --track: #e7e2d7;
  --side: #383634;
  --accent: #383634;
  --accent-2: #5a5e51;
  --accent-soft: #eeeee9;
  /* состояние: хорошо / внимание / плохо — только для статусов */
  --good: #2f7d4f;
  --good-soft: #e6f2ea;
  --warn: #9a6512;
  --warn-soft: #fbf1df;
  --bad: #b83a26;
  --bad-soft: #fbe9e5;
  /* серии графиков (проверены валидатором: различимы при дальтонизме) */
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Tenor Sans", "Times New Roman", serif;
  --r: 12px;
  --r-sm: 8px;
  /* имена цветов, которые использует код страниц */
  --lime: var(--accent-2); --blue: var(--s1); --green: var(--good); --purple: var(--ink-2);
  --amber: var(--warn); --red: var(--bad); --ok: var(--good); --ochre: var(--warn); --moss: var(--accent-2);
  --graphite: var(--side); --paper: var(--bg); --paper-2: var(--track); --stone: #bab5a8; --silver: #d2d0ca;
  --mute: var(--muted); --mute-light: #a9a59b; --card: var(--surface); --error: var(--bad);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; text-wrap: balance; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--s1); }
:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.grow { flex: 1 1 auto; }
.num, td.n, th.n, .ticks { font-variant-numeric: tabular-nums; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100%; }
.side { background: var(--side); color: #eeebe4; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; flex-direction: column; gap: 6px; padding: 22px 20px 18px; text-decoration: none; color: #eeebe4; }
.brand img { width: 118px; height: auto; display: block; }
.brand small { font-size: 12px; color: #a9a59b; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; }
.brand .bi { display: none; width: 30px; height: 30px; }
/* на карте меню разделов сворачивается в полосу с иконками */
@media (min-width: 861px) {
  .app.rail { grid-template-columns: 64px minmax(0, 1fr); }
  .app.rail .brand { padding: 18px 0 14px; align-items: center; }
  .app.rail .brand .wm, .app.rail .brand small { display: none; }
  .app.rail .brand .bi { display: block; }
  .app.rail .nav { padding: 6px 8px; }
  .app.rail .nav a { justify-content: center; padding: 10px 0; }
  .app.rail .nav a span { display: none; }
  .app.rail .nav .sep { margin: 10px 6px; }
}
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); text-decoration: none; color: rgba(238, 235, 228, .78); font-size: 14px; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a .cnt { margin-left: auto; font-size: 12px; color: #a9a59b; font-variant-numeric: tabular-nums; }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }
.nav .sep { height: 1px; background: rgba(255, 255, 255, .1); margin: 10px 12px; }
.side-foot { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--bg); border-radius: var(--r-sm); padding: 0 12px; width: min(320px, 100%); color: var(--muted); }
.search input { border: 0; background: none; outline: none; padding: 8px 0; width: 100%; color: var(--ink); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 13px; white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.month { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px; }
.month b { min-width: 120px; text-align: center; font-weight: 600; font-size: 14px; }
.icon-btn { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 6px; cursor: pointer; font-size: 18px; line-height: 1; color: var(--ink-2); }
.icon-btn:hover { background: var(--bg); }
.only-mobile { display: none; }

main { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 20px; outline: none; max-width: 1440px; width: 100%; }

/* ---------- заголовок страницы ---------- */
.page-h { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; }
.page-h h1 { font-family: var(--font-display); font-weight: 400; font-size: 27px; line-height: 1.15; text-transform: uppercase; letter-spacing: .03em; }
.page-h p { margin: 6px 0 0; color: var(--muted); max-width: 72ch; }
.page-h .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- кнопки, поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; text-decoration: none; font-weight: 500; font-size: 14px; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #24221f; }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .45; cursor: default; }
select, input[type=text], input[type=search], input[type=number], input[type=password], input[type=date] { border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-sm); padding: 7px 10px; min-width: 0; color: var(--ink); }
input[type=number] { text-align: right; font-variant-numeric: tabular-nums; }
input::placeholder { color: #aaa69d; }
.seg { display: inline-flex; background: var(--track); border-radius: var(--r-sm); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; color: var(--ink-2); font-weight: 500; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }

/* ---------- карточки и показатели ---------- */
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel h2, .card h2 { font-size: 17px; }
.panel h2 + p, .card h2 + p { margin: -8px 0 0; color: var(--muted); font-size: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; gap: 12px; align-items: flex-start; }
.kpi .ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--accent-soft); }
.kpi .ic svg { width: 18px; height: 18px; }
.kpi span { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }
.kpi b { display: block; font-size: 24px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; margin: 4px 0 2px; }
.c-lime { color: var(--accent-2); } .bg-lime { color: var(--accent-2); }
.c-blue { color: var(--s1); } .bg-blue { color: var(--s1); }
.c-green { color: var(--good); } .bg-green { color: var(--good); }
.c-purple { color: var(--ink-2); } .bg-purple { color: var(--ink-2); }
.c-amber { color: var(--warn); } .bg-amber { color: var(--warn); }
.c-red { color: var(--bad); } .bg-red { color: var(--bad); }

/* статус «по графику / отстаём» */
.status { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--r); border: 1px solid transparent; }
.status .ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; color: #fff; }
.status b { font-size: 16px; }
.status p { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); }
.status.good { background: var(--good-soft); border-color: #cfe5d6; } .status.good .ico { background: var(--good); }
.status.warn { background: var(--warn-soft); border-color: #f0dcb6; } .status.warn .ico { background: var(--warn); }
.status.bad { background: var(--bad-soft); border-color: #f2cdc5; } .status.bad .ico { background: var(--bad); }

/* ---------- графики ---------- */
.legend { display: flex; gap: 6px 16px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.sw-1 { background: var(--s1); } .sw-2 { background: var(--s2); } .sw-3 { background: var(--s3); } .sw-0 { background: var(--track); }

.stack { display: flex; gap: 2px; height: 16px; border-radius: 4px; overflow: hidden; background: var(--surface); }
.stack.big { height: 22px; }
.stack > i { display: block; height: 100%; min-width: 0; }
.stack > i:first-child { border-radius: 4px 0 0 4px; }
.stack > i:last-child { border-radius: 0 4px 4px 0; }
.stack > i:only-child { border-radius: 4px; }
.stack > i[data-tip]:hover { filter: brightness(1.08); }
.stack-wrap { position: relative; }
.stack-wrap .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; }
.stack-wrap .mark-label { position: absolute; top: -22px; transform: translateX(-50%); font-size: 12px; color: var(--ink-2); white-space: nowrap; }

.grows { display: flex; flex-direction: column; gap: 14px; }
.grow-row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) minmax(130px, auto); gap: 6px 16px; align-items: center; }
.grow-row .name { font-weight: 600; font-size: 14px; }
.grow-row .name small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.grow-row .val { text-align: right; font-size: 14px; white-space: nowrap; }
.grow-row .val b { font-size: 15px; }
.grow-row .val small { display: block; color: var(--muted); font-size: 12px; }

.colchart { width: 100%; overflow-x: auto; }
.colchart svg { width: 100%; height: auto; max-height: 260px; display: block; overflow: visible; stroke: none; fill: none; }
.colchart svg text { stroke: none; }
.colchart .grid { stroke: var(--line); stroke-width: 1; }
.colchart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.colchart .col { fill: var(--s1); }
.colchart .col:hover { fill: #1f63b5; }
.colchart .ref { stroke: var(--ink); stroke-width: 1.5; }
.colchart .ref-label { fill: var(--ink-2); font-size: 12px; font-family: var(--font); }
.colchart .hit { fill: transparent; stroke: none; cursor: default; }

#tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: #fff; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4; max-width: 280px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
#tip b { font-size: 14px; }

.row2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.lineprog { display: flex; flex-direction: column; gap: 14px; }
.lineprog > div { display: grid; grid-template-columns: minmax(120px, 160px) minmax(0, 1fr); gap: 4px 14px; align-items: center; }
.lineprog .ln { font-weight: 600; font-size: 14px; }
.lineprog .track { height: 10px; }
.lineprog .meta { grid-column: 2; display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.lineprog .meta b { color: var(--ink); font-weight: 600; }
.track { height: 6px; background: var(--track); border-radius: 4px; overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 4px; background: currentColor; }

.bottle { display: flex; flex-direction: column; }
.bottle > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 10px 0; border-top: 1px solid var(--line); align-items: center; }
.bottle > div:first-child { border-top: 0; padding-top: 0; }
.bottle b { font-weight: 600; font-size: 14px; }
.bottle small { color: var(--muted); font-size: 12px; grid-column: 1; }
.bottle .pc { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-weight: 650; font-size: 18px; }

/* ---------- заметки и метки ---------- */
.note { border-radius: var(--r-sm); background: var(--warn-soft); color: var(--ink); padding: 12px 14px; border: 1px solid #f0dcb6; font-size: 14px; }
.note a { color: var(--ink); }
.note.ok { background: var(--good-soft); border-color: #cfe5d6; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); white-space: nowrap; font-weight: 500; vertical-align: 1px; }
.tag.metal { background: #e8f0fb; color: #1f5fae; }
.tag.wood { background: var(--good-soft); color: var(--good); }
.tag.glue { background: var(--accent-soft); color: var(--ink-2); }

/* ---------- таблицы ---------- */
.table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); max-height: calc(100vh - 280px); }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; font-weight: 600; color: var(--muted); font-size: 12px; white-space: nowrap; border-bottom-color: var(--line-2); }
th.n, td.n { text-align: right; white-space: nowrap; }
td.strong { font-weight: 650; }
th.hl, td.hl { background: #f7f6f2; }
thead th.hl { color: var(--ink); }
tr.group td { background: var(--bg); font-weight: 650; font-size: 13px; position: sticky; top: 37px; z-index: 1; }
tr.group td .muted { font-weight: 400; }
tr.total td { font-weight: 650; background: #f7f6f2; position: sticky; bottom: 0; border-bottom: 0; border-top: 1px solid var(--line-2); }
tbody tr:not(.group):not(.expand):hover td { background: #faf9f6; }
td input[type=number] { width: 86px; padding: 5px 8px; }
td input.stockin { background: #fbfaf7; }
td input.saved { border-color: var(--good); box-shadow: 0 0 0 1px var(--good); }
td input.err { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
td input:disabled { background: transparent; border-color: transparent; }
.cell-name { min-width: 220px; }
.cell-name small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; max-width: 52ch; }
.linkish { background: none; border: 0; padding: 0; color: var(--s1); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.who { font-size: 12px; color: var(--muted); max-width: 46ch; }
.gname { font-weight: 600; }
a.rowlink { color: inherit; text-decoration: none; }
a.rowlink:hover { text-decoration: underline; text-underline-offset: 3px; }
details.more > summary { cursor: pointer; color: var(--s1); font-size: 14px; }

/* ---------- производство ---------- */
.prod-list { display: flex; flex-direction: column; gap: 10px; }
details.prod { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
details.prod > summary { cursor: pointer; padding: 14px 16px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; list-style: none; }
details.prod > summary::-webkit-details-marker { display: none; }
details.prod > summary::before { content: "›"; color: var(--muted); display: inline-block; transition: transform .15s; }
details.prod[open] > summary::before { transform: rotate(90deg); }
details.prod > summary b { font-size: 15px; font-weight: 650; }
details.prod .table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); max-height: none; }
details.panel > summary { cursor: pointer; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }

/* ---------- изделия ---------- */
.split { display: grid; grid-template-columns: minmax(220px, 260px) minmax(0, 1fr); gap: 20px; align-items: start; }
.plist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); max-height: calc(100vh - 250px); overflow: auto; padding: 6px 0; }
.plist h3 { font-size: 12px; color: var(--muted); font-weight: 600; padding: 12px 16px 4px; }
.plist a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 16px; text-decoration: none; color: var(--ink); font-size: 14px; }
.plist a:hover { background: var(--bg); }
.plist a[aria-current="true"] { background: var(--accent-soft); font-weight: 600; }
.detail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail td:first-child { min-width: 200px; }
.detail h2 { font-size: 22px; }
.section-h { display: flex; align-items: baseline; gap: 10px; }
.section-h h3 { font-size: 16px; }
.addrow { display: grid; grid-template-columns: minmax(0, 3fr) 80px 110px minmax(0, 1.4fr) auto; gap: 8px; align-items: center; }
.times { display: flex; flex-wrap: wrap; gap: 12px; }
.times label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.times input { width: 130px; }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: var(--r-sm); max-width: min(560px, calc(100vw - 32px)); z-index: 40; font-size: 14px; }
.toast.err { background: var(--bad); }
.toast { display: flex; align-items: center; gap: 14px; }
.toast-act { border: 0; background: rgba(255, 255, 255, .16); color: #fff; font: 600 14px/1 var(--font); padding: 9px 14px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.toast-act:hover { background: rgba(255, 255, 255, .26); }

/* ---------- вход ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.login { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px; display: flex; flex-direction: column; gap: 14px; }
.login .brand { padding: 0 0 6px; color: var(--ink); }
.login .brand img { width: 130px; filter: brightness(.35); }
.login label { display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); font-size: 14px; }
.login input { padding: 11px 12px; font-size: 15px; }
.login .btn { min-height: 44px; }
.login .err { color: var(--bad); font-size: 14px; min-height: 20px; }

.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--side); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.me b { display: block; font-size: 14px; font-weight: 600; line-height: 1.2; }
.me small { display: block; color: var(--muted); font-size: 12px; }

.prog { display: flex; align-items: center; gap: 8px; min-width: 100px; }
.prog .track { flex: 1; }
.prog span { font-size: 12px; color: var(--muted); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.ok-c { color: var(--good); } .warn-c { color: var(--warn); } .bad-c { color: var(--bad); }
tr.expand td { background: #faf9f6; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
td .inline-form { flex-wrap: nowrap; }
td .inline-form input[type=number] { width: 84px; }
.hist { margin-top: 10px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.hist div { display: flex; gap: 14px; align-items: center; }
.risk { display: flex; flex-direction: column; }
.risk > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.risk > div:first-child { border-top: 0; padding-top: 0; }
.risk b { font-weight: 600; font-size: 14px; }
.risk small { grid-column: 1 / -1; color: var(--muted); }
.users-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.users-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

@media (max-width: 1100px) { .row2 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .app.menu-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(31, 30, 28, .45); }
  .only-mobile { display: inline-block; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .search { order: 5; width: 100%; }
  main { padding: 16px 16px 40px; }
  .grow-row { grid-template-columns: 1fr; }
  .grow-row .val { text-align: left; }
  .split { grid-template-columns: 1fr; }
  .plist { max-height: 260px; }
  .addrow { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- карта предприятия ---------- */
main.map-mode { padding: 0; max-width: none; gap: 0; }
.mapview { position: relative; height: calc(100vh - 57px); min-height: 600px; overflow: hidden; background: #ebe8df; --nav-w: 302px; --ws-w: 430px; }
.mapview.ws-wide { --ws-w: 760px; }
.mapview .map-stage { position: absolute; inset: 0; z-index: 0; isolation: isolate; }
.mapview .map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.map-labels { position: absolute; inset: 0; pointer-events: none; }
.map-float { position: absolute; z-index: 3; background: #fbf9f4; border: 1px solid rgba(59, 50, 46, .1); border-radius: 12px; box-shadow: 0 18px 40px -22px rgba(59, 50, 46, .45); }
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 24px; }
.map-live { display: inline-flex; align-items: center; gap: 5px; }
.map-live i { width: 6px; height: 6px; border-radius: 50%; background: #8fbf86; animation: livepulse 2s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(143, 191, 134, .5); } 70% { box-shadow: 0 0 0 7px rgba(143, 191, 134, 0); } 100% { box-shadow: 0 0 0 0 rgba(143, 191, 134, 0); } }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #c8553d; color: #fff; font: 700 11px/1 var(--font); font-style: normal; }
/* слова о состоянии: цвет + значок, не только цвет */
.st-good { --st: #2f7d4f; --st-bg: #e3efe3; } .st-warn { --st: #94650f; --st-bg: #f6ecd6; }
.st-bad { --st: #b0432c; --st-bg: #f6e1da; } .st-none { --st: #6b675f; --st-bg: #ebe7de; }
.sw { color: var(--st); font-weight: 600; }

/* левая панель: отделы по ходу работы */
.map-nav { top: 14px; left: 14px; bottom: 14px; width: var(--nav-w); display: flex; flex-direction: column; overflow: hidden; transition: transform .25s ease, opacity .25s; }
.nav-hidden .map-nav { transform: translateX(calc(-100% - 20px)); opacity: 0; pointer-events: none; }
.map-navopen { top: 14px; left: 14px; display: none; align-items: center; gap: 8px; padding: 10px 14px; min-height: 44px; font: 600 13px/1 var(--font); color: var(--ink); cursor: pointer; }
.nav-hidden .map-navopen { display: inline-flex; }
.mn-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 14px 18px; background: var(--side); color: #eeebe4; }
.mn-head > div { flex: 1; min-width: 0; }
.mn-head b { display: block; font: 400 17px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .06em; }
.mn-head small { font-size: 12px; color: #b9b4a8; }
.mn-head .icon-btn { color: #eeebe4; }
.mn-head .icon-btn:hover { background: rgba(255, 255, 255, .1); }
.mn-search { display: flex; align-items: center; gap: 8px; margin: 12px 12px 0; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--muted); }
.mn-search:focus-within { border-color: var(--ink-2); }
.mn-search input { border: 0; background: none; outline: none; padding: 10px 0; width: 100%; font-size: 14px; }
.mn-sites { display: flex; gap: 2px; margin: 10px 12px 2px; padding: 3px; background: var(--track); border-radius: 8px; }
.mn-sites button { flex: 1; border: 0; background: none; padding: 7px 2px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.mn-sites button[aria-pressed="true"] { background: var(--side); color: #fff; }
.mn-list { flex: 1; overflow-y: auto; padding: 2px 8px 10px; }
.mn-stage { display: flex; align-items: center; gap: 8px; padding: 14px 8px 6px; font: 400 12px/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mn-stage .num { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-2); font: 600 10px/1 var(--font); letter-spacing: 0; color: var(--ink-2); }
.mn-place { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 8px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.mn-place:hover { background: #f0ece3; }
.mn-place[aria-current="true"] { background: #fff; box-shadow: inset 3px 0 0 var(--dc), 0 1px 0 var(--line); }
.mi { width: 36px; height: 36px; border-radius: 10px; background: var(--dc); color: #fff; display: grid; place-items: center; }
.mi svg { width: 19px; height: 19px; stroke-width: 1.8; }
.mn-place .t { min-width: 0; }
.mn-place .t b { display: block; font-size: 14px; font-weight: 600; line-height: 1.25; }
.mn-place .t small { display: block; font-size: 12px; }
.mn-place .lock { color: var(--muted); display: inline-flex; }
.mn-place .lock svg { width: 15px; height: 15px; }
.mn-quiet { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 4px 8px 2px 54px; font-size: 12px; color: var(--muted); }
.mn-quiet button { border: 1px solid var(--line-2); background: none; border-radius: 999px; padding: 3px 9px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.mn-quiet button:hover, .mn-quiet button[aria-current="true"] { background: #fff; border-color: var(--ink-2); }
.mn-empty { padding: 14px 10px; color: var(--muted); font-size: 13px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); padding: 10px 16px 12px; border-top: 1px solid var(--line); }
.map-legend span { display: inline-flex; align-items: center; gap: 4px; }
.map-legend span svg { width: 14px; height: 14px; color: var(--st); stroke-width: 2.2; }
.map-legend .badge { min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }

/* кнопки масштаба */
.map-ctrl { top: 14px; right: 14px; display: flex; flex-direction: column; padding: 4px; gap: 2px; transition: right .25s ease; }
.has-ws .map-ctrl { right: calc(var(--ws-w) + 28px); }
.map-ctrl button { width: 40px; height: 40px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-size: 18px; color: var(--ink-2); }
.map-ctrl button:hover { background: var(--track); }

/* правая панель: рабочее место отдела */
.ws { top: 14px; right: 14px; bottom: 14px; width: var(--ws-w); display: flex; flex-direction: column; overflow: hidden; animation: wsin .22s ease-out; }
@keyframes wsin { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.ws-head { padding: 14px 18px 14px; display: flex; flex-direction: column; gap: 6px; border-top: 4px solid var(--dc); border-bottom: 1px solid var(--line); background: #fff; }
.ws-top { display: flex; align-items: center; gap: 8px; margin-right: -8px; }
.ws-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--dc); color: #fff; display: grid; place-items: center; flex: none; }
.ws-ic svg { width: 17px; height: 17px; stroke-width: 1.8; }
.ws-kicker { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.ws-head h2 { font: 400 23px/1.15 var(--font-display); text-transform: uppercase; letter-spacing: .03em; margin-top: 4px; }
.ws-who { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.ws-who b { color: var(--ink); }
.ws-body { flex: 1; overflow-y: auto; padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.ws-body > * { flex-shrink: 0; }
.ws-status { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; background: var(--st-bg); border-radius: 12px; padding: 12px 14px; }
.ws-status .si { width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--st); display: grid; place-items: center; }
.ws-status .si svg { width: 24px; height: 24px; stroke-width: 2.2; }
.ws-status b { display: block; font-size: 18px; font-weight: 650; color: var(--st); line-height: 1.2; }
.ws-status small { display: block; font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.ws-prog { display: flex; flex-direction: column; gap: 5px; margin-top: -4px; }
.ws-prog .pt { position: relative; height: 10px; border-radius: 6px; background: var(--track); }
.ws-prog .pt i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--st); min-width: 4px; }
.ws-prog .pt em { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.ws-prog small { font-size: 12px; color: var(--muted); }
.ws-todo { display: flex; flex-direction: column; gap: 4px; border-left: 3px solid #c8553d; padding: 2px 0 2px 12px; }
.ws-todo b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #b0432c; }
.ws-todo span { font-size: 15px; font-weight: 500; }
.ws-acts { display: flex; flex-direction: column; gap: 8px; }
.ws-act { display: grid; grid-template-columns: 40px 1fr 18px; gap: 12px; align-items: center; width: 100%; min-height: 60px; padding: 10px 14px 10px 10px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; text-align: left; cursor: pointer; font: inherit; color: var(--ink); transition: border-color .12s, background .12s; }
.ws-act:hover { border-color: var(--ink-2); }
.ws-act .ai { width: 40px; height: 40px; border-radius: 10px; background: #f1ede4; color: var(--ink-2); display: grid; place-items: center; }
.ws-act .al b { display: block; font-size: 15px; font-weight: 600; }
.ws-act .al small { display: block; font-size: 13px; color: var(--muted); }
.ws-act .ar { color: var(--muted); }
.ws-act.primary { background: var(--side); border-color: var(--side); color: #fff; min-height: 68px; }
.ws-act.primary:hover { background: #24221f; }
.ws-act.primary .ai { background: var(--dc, #5a5e51); color: #fff; }
.ws-act.primary .al small, .ws-act.primary .ar { color: #c9c4b8; }
.ws-label { font: 400 12px/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.ws-sub { margin: 0; color: var(--muted); font-size: 14px; }
.ws-search { width: 100%; min-height: 42px; }
.ws-empty { display: grid; grid-template-columns: 36px 1fr; gap: 12px; background: #f1ede4; border-radius: 12px; padding: 14px; }
.ws-empty > svg { width: 26px; height: 26px; color: var(--muted); margin: 4px; }
.ws-empty p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.ws-back { display: flex; align-items: center; gap: 12px; }
.ws-back b { font-size: 16px; }
.ws-depts { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.ws-dept { display: grid; grid-template-columns: 36px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 12px 8px 8px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; min-height: 52px; }
.ws-dept:first-child { border-top: 0; }
.ws-dept:hover { background: #faf8f3; }
.ws-dept b { font-size: 14px; font-weight: 600; }
.ws-dept small { font-size: 13px; }
.ws-trucks { display: flex; flex-direction: column; gap: 8px; }
.ws-truck { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; }
.ws-truck .ti { width: 36px; height: 36px; border-radius: 10px; background: #e3ebf1; color: #466279; display: grid; place-items: center; }
.ws-truck b { display: block; font-size: 14px; }
.ws-truck small { display: block; font-size: 13px; color: var(--muted); }
.ws-truck.ask { border-color: var(--ink-2); }
.ws-ask { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.ws-ask span { flex: 1 0 100%; font-weight: 600; font-size: 14px; }
.ws-table { border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: calc(100vh - 380px); min-height: 240px; background: #fff; }
table.mini { width: 100%; border-collapse: collapse; font-size: 14px; }
table.mini th, table.mini td { padding-left: 10px; padding-right: 10px; }
table.mini th { position: sticky; top: 0; background: #faf8f3; z-index: 1; text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
table.mini td { padding-top: 7px; padding-bottom: 7px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.mini td.cell-name { min-width: 0; }
table.mini tr:focus-within td { background: #f6f1e6; }
table.mini tr.group td { background: #f1ede4; font: 400 12px/1.2 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); padding-top: 8px; padding-bottom: 8px; }
table.mini input[type=number] { width: 84px; padding: 7px 9px; font-size: 15px; }
table.mini tfoot td { position: sticky; bottom: 0; background: #faf8f3; font-weight: 650; border-top: 1px solid var(--line-2); }
.wl { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.wl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 11px 12px; border-top: 1px solid var(--line); min-height: 52px; }
.wl-row:first-child { border-top: 0; }
.wl-row[hidden] { display: none; }
.wl-main b { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.wl-main small { display: block; font-size: 12px; color: var(--muted); }
.wl-main .route { margin-top: 6px; }
.wl-side { display: flex; align-items: center; gap: 10px; justify-content: flex-end; font-size: 14px; white-space: nowrap; }
.mkpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mkpis div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.mkpis span { display: block; font-size: 12px; color: var(--muted); }
.mkpis b { font-size: 19px; font-weight: 650; }
.route { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); }
.route .line { position: relative; height: 4px; background: var(--track); border-radius: 3px; }
.route .line i { position: absolute; left: 0; top: 0; bottom: 0; background: #466279; border-radius: 3px; }
.route .line em { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #466279; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* ввод по шагам */
.wz-top { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.wz-top b { font-size: 14px; color: var(--muted); font-weight: 600; text-align: center; }
.wz-steps { display: flex; gap: 4px; }
.wz-steps i { width: 18px; height: 4px; border-radius: 2px; background: var(--track); }
.wz-steps i.on { background: var(--ink); }
.wz-q { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; margin-top: 4px; }
.wz-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.wz-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 54px; padding: 10px 14px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.wz-item:first-child { border-top: 0; }
.wz-item:hover, .wz-item:focus-visible { background: #f6f1e6; }
.wz-item b { font-size: 15px; font-weight: 600; }
.wz-item small { font-size: 13px; color: var(--muted); }
.wz-item.dim b { color: var(--ink-2); font-weight: 500; }
.wz-item[hidden] { display: none; }
.wz-chosen { display: flex; align-items: baseline; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.wz-chosen b { font-size: 16px; flex: 1; }
.wz-qty { display: grid; grid-template-columns: 56px 1fr auto 56px; gap: 8px; align-items: center; }
.wz-qty button { height: 56px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; font-size: 26px; line-height: 1; color: var(--ink); cursor: pointer; }
.wz-qty button:hover { border-color: var(--ink-2); }
.wz-qty input { height: 56px; font-size: 30px; font-weight: 650; text-align: center; border-radius: 12px; border: 2px solid var(--ink-2); min-width: 0; }
.wz-qty span { font-size: 16px; color: var(--muted); }
.wz-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.wz-quick .btn { min-height: 40px; }
.wz-day { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.wz-more summary { cursor: pointer; font-size: 14px; color: var(--ink-2); padding: 4px 0; }
.wz-more input { margin-top: 8px; width: 180px; }
.wz-next { min-height: 52px; font-size: 16px; }
.wz-card { background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.wz-line { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; }
.wz-line span { grid-column: 1 / -1; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.wz-line b { font-size: 16px; font-weight: 600; }
.wz-line strong { font-size: 24px; font-weight: 700; white-space: nowrap; }
.wz-card small { font-size: 13px; color: var(--muted); }
.wz-warn { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; background: #f6ecd6; color: #6e4b0c; border-radius: 10px; padding: 12px 14px; font-size: 14px; font-weight: 500; }
.wz-warn svg { width: 20px; height: 20px; }
.wz-final { display: flex; flex-direction: column; gap: 8px; }
.wz-final .btn { min-height: 50px; font-size: 15px; }

/* заказы DBS */
.dbs-pipe { display: flex; flex-wrap: wrap; gap: 6px; }
.dbs-pipe button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 10px 5px 12px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.dbs-pipe button b { font-size: 12px; min-width: 18px; padding: 1px 6px; border-radius: 999px; background: var(--track); color: var(--ink-2); text-align: center; }
.dbs-pipe button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.dbs-pipe button[aria-pressed="true"] b { background: rgba(255, 255, 255, .2); color: #fff; }
.st { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--track); color: var(--ink-2); }
.st.s-new { background: #eaf2fc; color: #1d5fae; } .st.s-work { background: var(--warn-soft); color: var(--warn); }
.st.s-road { background: #e6f0fb; color: var(--s1); } .st.s-done { background: #e8f5ee; color: #2a7a52; }
.st.s-paid { background: var(--good); color: #fff; } .st.s-off { background: var(--track); color: var(--muted); }
.dbs-pipe .s-late b { background: var(--bad); color: #fff; }
.dbs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.dbs-list { display: flex; flex-direction: column; gap: 10px; }
.dbs-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.dbs-card.focus { border-color: var(--s1); box-shadow: 0 0 0 3px rgba(42, 120, 214, .15); }
.dc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dc-top b { font-size: 14px; }
.dc-top .amt { font-size: 14px; }
.dc-top .late { font-size: 11px; font-weight: 700; color: var(--bad); background: var(--bad-soft); padding: 2px 7px; border-radius: 999px; }
.dc-client b { font-weight: 600; }
.dc-client a { color: var(--s1); text-decoration: none; }
.dc-addr { color: var(--ink-2); }
.dc-items { color: var(--ink); }
.dc-meta { color: var(--muted); font-size: 12px; }
.dc-act { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.dc-act select { padding: 4px 8px; font-size: 13px; }
.dbs-form { display: flex; flex-direction: column; gap: 12px; }
.dbs-form h3 { font-size: 17px; }
.ff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.panel .ff-grid { grid-template-columns: repeat(4, 1fr); }
.ff-grid .full { grid-column: 1 / -1; }
.panel .ff-grid .wide { grid-column: span 2; }
.ff-label { font-size: 12px; color: var(--muted); }
.ff-items { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ff-item { display: grid; grid-template-columns: minmax(0, 1fr) 76px 32px; gap: 6px; width: 100%; }
.ff-hist { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.ff-hist div { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; }
.ff-note { margin: 0; font-size: 12px; color: var(--muted); }
input[type=tel] { border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-sm); padding: 7px 10px; min-width: 0; color: var(--ink); }

/* подписи на карте: значок отдела, название; подробности — при наведении */
.map-pin { pointer-events: auto; cursor: pointer; display: none; align-items: center; gap: 8px; background: #fffdf8; border-radius: 999px; padding: 4px 12px 4px 4px; box-shadow: 0 8px 20px -10px rgba(59, 50, 46, .55); border: 1px solid rgba(59, 50, 46, .1); font: 12px/1.25 var(--font); color: var(--ink); white-space: nowrap; transform: translateY(-50%); }
.map-near .map-pin { display: inline-flex; }
.map-pin .pi { position: relative; width: 28px; height: 28px; border-radius: 50%; background: var(--dc); color: #fff; display: grid; place-items: center; flex: none; }
.map-pin .pi svg { width: 16px; height: 16px; stroke-width: 1.9; }
.map-pin .pi::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fffdf8; background: #b5b0a4; }
.map-pin[data-state="good"] .pi::after { background: #3f9a62; } .map-pin[data-state="warn"] .pi::after { background: #d9a23a; } .map-pin[data-state="bad"] .pi::after { background: #c8553d; }
.map-pin .pt b { display: block; font-size: 13px; font-weight: 600; }
.map-pin .pt small { display: none; font-size: 11.5px; color: var(--muted); }
.map-close .map-pin .pt small, .map-pin:hover .pt small, .map-pin.on .pt small, .map-pin.hv .pt small { display: block; }
.map-pin em { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #c8553d; color: #fff; font: 700 10.5px/18px var(--font); font-style: normal; text-align: center; margin-left: -2px; }
.map-pin:hover, .map-pin.hv { z-index: 10 !important; }
.map-pin.on { box-shadow: 0 0 0 2px var(--dc), 0 10px 26px -8px rgba(59, 50, 46, .5); z-index: 11 !important; }
.map-pin.locked { opacity: .75; }
.map-site { pointer-events: auto; cursor: pointer; display: none; align-items: center; gap: 8px; border: 0; background: var(--side); color: #fff; font: 600 13px/1.2 var(--font); padding: 10px 16px; border-radius: 999px; box-shadow: 0 10px 24px -8px rgba(31, 30, 28, .55); white-space: nowrap; }
.map-far .map-site { display: inline-flex; }
.map-site b { font: 400 14px/1 var(--font-display); text-transform: uppercase; letter-spacing: .06em; }
.map-site i { width: 9px; height: 9px; border-radius: 50%; background: #b5b0a4; }
.map-site[data-state="good"] i { background: #6fc28a; } .map-site[data-state="warn"] i { background: #e8b54f; } .map-site[data-state="bad"] i { background: #e07a62; }
.map-site span { font-weight: 500; color: #c9c4b8; font-size: 12px; }
.map-site em { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #c8553d; color: #fff; font: 700 10.5px/18px var(--font); font-style: normal; text-align: center; }
.map-site:hover { background: #24221f; }
.map-truck { pointer-events: auto; cursor: pointer; background: #466279; color: #fff; font: 600 11px/1 var(--font); padding: 5px 9px; border-radius: 999px; box-shadow: 0 4px 12px -4px rgba(70, 98, 121, .7); white-space: nowrap; transform: translateY(-50%); }
.map-truck[data-status="loading"] { background: #a87a26; }
.map-truck[data-status="docked"] { background: #2f7d4f; }
.map-truck.van { background: #36706a; display: none; }
.map-near .map-truck.van { display: block; }
.map-truck.on { outline: 2px solid #fff; box-shadow: 0 0 0 4px var(--ink); }

@media (max-width: 1000px) {
  .mapview { height: auto; min-height: 0; display: flex; flex-direction: column; --ws-w: auto; }
  .mapview .map-stage { position: relative; height: 56vh; order: 1; }
  .map-nav, .ws { position: static; width: auto; margin: 10px; max-height: none; animation: none; }
  .map-nav { order: 3; max-height: 70vh; }
  .ws { order: 2; }
  .ws-body { overflow: visible; }
  .ws-table { max-height: 60vh; }
  .nav-hidden .map-nav { display: none; }
  .map-navopen { position: absolute; }
  .map-ctrl, .has-ws .map-ctrl { right: 14px; top: 14px; }
  .panel .ff-grid { grid-template-columns: 1fr 1fr; }
  .ws [data-wide] { display: none; }
}

/* ---------- простые экраны: «Мои дела» и «Как дела» ---------- */
.today, .board { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 18px; }
.board { max-width: 1120px; }
.td-hello p { margin: 0; color: var(--muted); font-size: 15px; }
.td-hello p::first-letter { text-transform: uppercase; }
.td-hello h1 { font: 400 34px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .03em; margin: 6px 0 4px; }
.td-hello span { font-size: 15px; color: var(--ink-2); font-weight: 500; }
.td-status { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center; background: var(--st-bg); border-radius: 16px; padding: 16px 18px; }
.td-status .si { width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--st); display: grid; place-items: center; }
.td-status .si svg { width: 28px; height: 28px; stroke-width: 2.3; }
.td-status b { display: block; font-size: 21px; font-weight: 650; color: var(--st); line-height: 1.2; }
.td-status small { display: block; font-size: 15px; color: var(--ink-2); margin-top: 2px; }
.td-block { display: flex; flex-direction: column; gap: 10px; }
.td-block h2 { font: 400 13px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 4px 0 0; }
.td-task { position: relative; display: grid; grid-template-columns: 60px 1fr 24px; gap: 16px; align-items: center; width: 100%; min-height: 96px; padding: 16px 20px 16px 16px; border: 0; border-radius: 18px; background: var(--side); color: #fff; text-align: left; cursor: pointer; font: inherit; text-decoration: none; box-shadow: 0 12px 28px -18px rgba(31, 30, 28, .8); transition: transform .12s, background .12s; }
.td-task:hover { background: #24221f; }
.td-task:active { transform: scale(.99); }
.td-task .ti { width: 60px; height: 60px; border-radius: 16px; background: var(--dc); display: grid; place-items: center; }
.td-task .ti svg { width: 30px; height: 30px; stroke-width: 1.8; }
.td-task .tt b { display: block; font-size: 21px; font-weight: 650; line-height: 1.2; }
.td-task .tt small { display: block; font-size: 15px; color: #cfcabe; margin-top: 3px; }
.td-task .tgo svg { width: 24px; height: 24px; color: #cfcabe; }
.td-hint { position: absolute; top: -10px; right: 18px; background: #c8553d; color: #fff; font: 700 12px/1 var(--font); font-style: normal; padding: 6px 10px; border-radius: 999px; animation: hintpulse 1.8s infinite; }
@keyframes hintpulse { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.td-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.td-more { display: grid; grid-template-columns: 40px 1fr 20px; gap: 12px; align-items: center; min-height: 60px; padding: 10px 16px 10px 12px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer; font: inherit; color: var(--ink); text-decoration: none; }
.td-more:first-child { border-top: 0; }
.td-more:hover { background: #faf8f3; }
.td-more .ti { width: 40px; height: 40px; border-radius: 10px; background: #f1ede4; color: var(--ink-2); display: grid; place-items: center; }
.td-more b { display: block; font-size: 16px; font-weight: 600; }
.td-more small { display: block; font-size: 14px; color: var(--muted); }
.td-more .tgo { color: var(--muted); }
.td-done-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 15px; }
.td-done-row:first-child { border-top: 0; }
.td-done-row b { font-size: 16px; }
.td-empty { margin: 0; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--muted); font-size: 16px; text-align: center; }
.td-maplink { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; color: var(--ink-2); font-size: 15px; text-decoration: none; padding: 8px 2px; }
.td-maplink:hover { color: var(--ink); text-decoration: underline; }
.td-back { display: flex; align-items: center; gap: 14px; }
.td-back h1 { font: 400 24px/1.15 var(--font-display); text-transform: uppercase; letter-spacing: .03em; }
.td-wiz { display: flex; flex-direction: column; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.td-wiz .wz-q { font-size: 26px; }
.td-wiz .wz-item { min-height: 64px; }
.td-wiz .wz-item b { font-size: 17px; }
.td-wiz .wz-qty { grid-template-columns: 72px 1fr auto 72px; }
.td-wiz .wz-qty button, .td-wiz .wz-qty input { height: 72px; }
.td-wiz .wz-qty input { font-size: 36px; }
.td-wiz .wz-next, .td-wiz .wz-final .btn { min-height: 60px; font-size: 18px; }
.td-ok { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 36px 24px; }
.td-ok .okc { width: 84px; height: 84px; border-radius: 50%; background: #e3efe3; color: #2f7d4f; display: grid; place-items: center; }
.td-ok .okc svg { width: 46px; height: 46px; stroke-width: 2.4; }
.td-ok h1 { font: 400 32px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .04em; }
.td-ok > p { margin: 0; font-size: 18px; max-width: 46ch; }
.td-ok-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.td-ok-btns .btn { min-height: 56px; padding: 0 26px; font-size: 17px; }
.td-undo { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.bd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.bd-tile { display: flex; flex-direction: column; gap: 8px; min-height: 190px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); border-top: 8px solid var(--st); text-decoration: none; color: var(--ink); transition: transform .12s, box-shadow .12s; }
.bd-tile:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -20px rgba(31, 30, 28, .6); }
.bd-top { display: flex; align-items: center; gap: 10px; }
.bd-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--dc); color: #fff; display: grid; place-items: center; }
.bd-ic svg { width: 20px; height: 20px; stroke-width: 1.8; }
.bd-name { font: 400 15px/1.2 var(--font-display); letter-spacing: .06em; text-transform: uppercase; }
.bd-word { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 650; color: var(--st); margin-top: 4px; }
.bd-word .si svg { width: 24px; height: 24px; stroke-width: 2.4; }
.bd-hint { font-size: 15px; color: var(--ink-2); }
.bd-todo { font-size: 14px; font-weight: 600; color: #b0432c; }
.bd-who { margin-top: auto; font-size: 13px; color: var(--muted); }
.bd-foot { margin: 0; color: var(--muted); font-size: 14px; }
.board .ws-prog .pt { height: 12px; }
@media (max-width: 900px) { .bd-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .bd-grid { grid-template-columns: 1fr; }
  .bd-tile { min-height: 0; }
  .td-hello h1 { font-size: 28px; }
  .td-task { grid-template-columns: 52px 1fr 20px; min-height: 84px; }
  .td-task .ti { width: 52px; height: 52px; }
  .td-task .tt b { font-size: 19px; }
}

/* просмотр «глазами сотрудника» */
.me.clickable { cursor: pointer; border-radius: 10px; padding: 4px 8px 4px 4px; margin: -4px 0; }
.me.clickable:hover { background: var(--bg); }
.avatar.pv { background: #c8553d; color: #fff; }
.avatar.pv svg { width: 16px; height: 16px; }
.previewing .topbar { box-shadow: inset 0 -3px 0 #c8553d; }
.pv-menu { position: fixed; z-index: 50; width: 320px; max-height: calc(100vh - 90px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 20px 40px -20px rgba(31, 30, 28, .55); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.pv-menu > b { font-size: 15px; }
.pv-menu > small { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.pv-menu button { text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 8px; font: inherit; font-size: 15px; cursor: pointer; color: var(--ink); }
.pv-menu button:hover, .pv-menu button[aria-pressed="true"] { background: #f1ede4; }
.pv-menu .pv-off { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; color: #b0432c; font-weight: 600; }

/* ---------- бланки для печати ---------- */
.fm-steps { margin: 0; padding: 14px 18px 14px 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.fm-ic { background: var(--dc) !important; color: #fff !important; }
.fm-print { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; }
.fm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: 100%; max-width: 820px; }
.fm-bar .btn.primary { min-height: 48px; padding: 0 22px; font-size: 16px; }
.fm-note { margin: 0; max-width: 820px; width: 100%; color: var(--muted); font-size: 14px; }
.sheet { width: 100%; max-width: 820px; background: #fff; color: #111; padding: 34px 40px 28px; box-shadow: 0 18px 40px -24px rgba(31, 30, 28, .6); border: 1px solid var(--line); font: 14px/1.35 var(--font); }
.sh-head { display: flex; justify-content: space-between; gap: 24px; border-bottom: 2px solid #111; padding-bottom: 12px; }
.sh-brand { font: 400 14px/1 var(--font-display); letter-spacing: .3em; }
.sh-kind { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #555; margin-top: 10px; }
.sh-head h2 { font: 400 26px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .03em; margin-top: 4px; }
.sh-fields { display: flex; flex-direction: column; gap: 8px; min-width: 260px; }
.sh-fields div { display: grid; grid-template-columns: 1fr; }
.sh-fields span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #555; }
.sh-fields b { font-size: 17px; font-weight: 600; letter-spacing: .02em; }
.sh-how { margin: 12px 0; padding-left: 20px; font-size: 12.5px; color: #333; display: flex; flex-direction: column; gap: 2px; }
.sh-table { width: 100%; border-collapse: collapse; }
.sh-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 6px 8px; border: 1.5px solid #111; background: #eee; color: #111; position: static; }
.sh-table td { border: 1px solid #555; padding: 0 8px; height: 34px; font-size: 13.5px; }
.sh-table .n { width: 34px; text-align: center; color: #555; }
.sh-table .h { width: 110px; text-align: center; color: #555; }
.sh-table .q { width: 150px; border: 2px solid #111; }
.sh-table tr.free td span { color: #888; font-size: 12px; }
.sh-foot { display: grid; grid-template-columns: 1fr auto; gap: 10px 24px; margin-top: 18px; align-items: end; }
.sh-foot > div:first-child span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #555; }
.sh-foot i { display: block; border-bottom: 1px solid #555; height: 26px; }
.sh-sign span { display: block; font-size: 11px; text-transform: uppercase; color: #555; }
.sh-sign b { font-size: 17px; }
.sh-foot small { grid-column: 1 / -1; color: #777; font-size: 10.5px; }
@page { size: A4; margin: 10mm; }
@media print {
  body { background: #fff !important; }
  .side, .topbar, .no-print, .toast, #tip, #previewMenu { display: none !important; }
  .app { display: block !important; }
  main { padding: 0 !important; max-width: none !important; }
  .fm-print { gap: 0; }
  .sheet { max-width: none; box-shadow: none; border: 0; padding: 0; page-break-after: always; break-after: page; }
  .sheet:last-child { page-break-after: auto; break-after: auto; }
  .sh-table tr { break-inside: avoid; }
}

/* фото бланка: проверка прочитанного */
.ph-list { overflow: visible; }
.ph-row { display: grid; grid-template-columns: 28px 1fr 110px; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.ph-row:first-child { border-top: 0; }
.ph-row.off { opacity: .45; }
.ph-row input[type=checkbox] { width: 22px; height: 22px; }
.ph-name b { display: block; font-size: 16px; font-weight: 600; }
.ph-name small { display: block; font-size: 13px; color: var(--muted); }
.ph-name select { margin-top: 6px; width: 100%; }
.ph-row input[type=number] { height: 48px; font-size: 20px; font-weight: 650; text-align: center; }
.td-ok .okc.warn { background: #f6ecd6; color: #94650f; }
.td-ok .okc.spin svg { animation: spinup 1.2s ease-in-out infinite; }
@keyframes spinup { 0%, 100% { transform: translateY(2px); } 50% { transform: translateY(-4px); } }
label.td-task, label.td-more { cursor: pointer; }
.sh-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sh-table.compact td { height: 26px; font-size: 12px; line-height: 1.15; }
.sh-table.compact td em { float: right; font-style: normal; font-size: 10px; color: #777; margin-left: 6px; }
.sh-table.compact .q { width: 64px; }
.sh-table.compact .n { width: 26px; }
.sh-note { margin: 8px 0 0; font-size: 11px; color: #666; }
.ph-row.off:has(select) { opacity: 1; }

/* Телеграм-бот в «Сотрудниках» */
.tg-panel { border-left: 4px solid #2aabee; }
.tg-panel.ok { border-left-color: var(--good); }
.tg-panel p { margin: 0; }
.tg-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.tg-steps code { background: var(--track); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.tg-link { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; background: #f1ede4; border-radius: 10px; padding: 10px 12px; }
.tg-link input { width: 100%; font-size: 14px; }

/* лист на фирменном бланке компании (как шаблон FLIKKŌ) */
.sheet.lh { display: flex; flex-direction: column; font-family: Cambria, "Times New Roman", Times, serif; font-variant-numeric: lining-nums tabular-nums; color: #111; min-height: 1160px; padding: 30px 44px 26px; }
.lh-logo { width: 300px; height: auto; display: block; margin: 0 0 14px -4px; }
.lh-req { font-size: 13px; line-height: 1.35; }
.lh-row { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0 4px; font-size: 15px; }
.lh-title { font: 400 27px/1.2 Cambria, "Times New Roman", Times, serif; letter-spacing: .02em; text-transform: uppercase; text-align: center; margin: 12px 0 4px; }
.lh-who { text-align: center; margin: 0 0 10px; font-size: 14px; }
.lh-how { margin: 0 0 10px; font-size: 11.5px; line-height: 1.4; color: #333; }
.sheet.lh .sh-table { font-family: Cambria, "Times New Roman", Times, serif; }
.sheet.lh .sh-table th { background: #e7e3da; text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; }
.lh-line { margin: 14px 0 0; font-size: 14px; }
.lh-notes { margin-top: 16px; font-size: 13px; color: #444; }
.lh-notes i { display: block; border-bottom: 1px solid #555; height: 24px; }
.lh-sign { display: flex; flex-direction: column; margin-top: 18px; font-size: 14px; }
.lh-sign b { font-weight: 400; }
.lh-code { color: #888; font-size: 10px; margin-top: 8px; }
.lh-foot { margin-top: auto; padding-top: 18px; display: flex; align-items: flex-end; gap: 12px; font-size: 13px; line-height: 1.3; }
.lh-foot div:first-child { font-size: 12px; }
.lh-foot img { width: 56px; height: auto; margin-left: 18px; }
@media print { .sheet.lh { min-height: 277mm; padding: 0; } }
/* плотнее, чтобы бланк ЧПУ на 40 деталей с подписью и подвалом умещался на один лист А4 */
.lh-logo { width: 230px; margin-bottom: 10px; }
.lh-req { font-size: 12px; }
.lh-row { margin: 10px 0 2px; font-size: 14px; }
.lh-title { font-size: 23px; margin: 6px 0 2px; }
.lh-who { margin-bottom: 6px; font-size: 13px; }
.lh-how { font-size: 11px; margin-bottom: 8px; }
.sheet.lh .sh-table.compact td { height: 22px; font-size: 11.5px; }
.sheet.lh .sh-table th { padding: 4px 8px; }
.lh-notes { margin-top: 10px; }
.lh-notes i + i { display: none; }
.lh-sign { margin-top: 10px; }
.lh-foot { padding-top: 10px; }

/* ---------- перемещения в Москву и остатки из 1С ---------- */
:root { --s4: #17457e; }
.sw-4 { background: var(--s4); }
.mv-head { flex-direction: row; align-items: center; gap: 28px; flex-wrap: wrap; border-left: 4px solid var(--st); }
.mv-head .mv-num { display: flex; flex-direction: column; gap: 2px; min-width: 220px; }
.mv-head .mv-num span { font-size: 13px; color: var(--muted); }
.mv-head .mv-num b { font: 400 34px/1.1 var(--font-display); letter-spacing: .01em; }
.mv-head .mv-num b small { font: 500 15px var(--font); color: var(--ink-2); }
.mv-head .ws-prog { flex: 1 1 320px; margin: 0; }
.mv-head .ws-prog .pt { height: 12px; }
.mv-head .ws-prog small { font-size: 13px; }
.small-note { font-size: 13px; margin: 8px 2px 0; }
.onec-how { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; color: var(--ink-2); font-size: 14px; }
.onec-zero { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--accent-soft); cursor: pointer; }
.onec-zero input { margin-top: 3px; }
.onec-zero small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
#onecTable tr.row-miss td { background: var(--warn-soft); }
#onecTable tr.row-diff td.n.strong { color: var(--s1); }
#onecTable select { max-width: 260px; }
input.stockin[data-live], input.stockin[data-start] { width: 76px; }

/* ---------- заказы DBS: застрявшие ---------- */
.dbs-card.stuck { border-color: #e9b9ad; box-shadow: inset 3px 0 0 var(--bad); }
.dc-stuck { font-size: 12.5px; font-weight: 600; color: var(--bad); }
.dbs-alert { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--bad-soft); border-color: #efc9bf; }
.dbs-alert b { color: var(--bad); }
.dbs-alert span { flex: 1 1 320px; }

/* ---------- телефон ---------- */
.tabbar { display: none; }
@media (max-width: 860px) {
  /* шапка в одну строку: меню, месяц, аватар; поиск по изделиям — в меню разделов не нужен на телефоне */
  .topbar { flex-wrap: nowrap; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
  .topbar .search { display: none; }
  .topbar .month b { min-width: 0; font-size: 14px; padding: 0 2px; }
  .topbar .me > span:not(.avatar) { display: none; }
  .topbar .me.clickable { padding: 2px; }
  .topbar #logout { padding: 6px 10px; }
  .icon-btn, .topbar .month .icon-btn { min-width: 40px; min-height: 40px; }
  main { padding: 14px 14px calc(84px + env(safe-area-inset-bottom)); gap: 16px; }

  /* нижнее меню под большой палец */
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: var(--side); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px -12px rgba(0, 0, 0, .5); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px;
    color: rgba(238, 235, 228, .72); text-decoration: none; font: 500 11.5px/1.1 var(--font); background: none; border: 0; border-radius: 10px; cursor: pointer; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .1); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .side { padding-top: env(safe-area-inset-top); overflow-y: auto; }

  /* заголовок страницы и кнопки */
  .page-h h1 { font-size: 22px; }
  .page-h p { font-size: 14px; }
  .page-h .actions { margin-left: 0; width: 100%; }
  .page-h .actions .btn { flex: 1 1 auto; justify-content: center; }

  /* цифры: по две в ряд, компактно */
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px; }
  .kpi .ic { display: none; }
  .kpi b { font-size: 19px; }
  .kpi span { font-size: 12.5px; }

  /* таблицы листаются вбок внутри себя, название изделия не растягивает строку */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .cell-name { min-width: 150px; max-width: 220px; }
  th, td { padding-left: 10px; padding-right: 10px; }

  /* iPhone увеличивает страницу при вводе, если шрифт меньше 16 px */
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 40px; }
  .dbs-grid { grid-template-columns: 1fr; }
  .dbs-pipe { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .dbs-pipe button { flex: none; }
  .mv-head .mv-num b { font-size: 28px; }

  /* карта: на маленьком экране подписи налезают — оставляем значки, подпись у выбранного */
  .map-pin { padding: 3px; gap: 0; }
  .map-pin .pt { display: none; }
  .map-pin.on, .map-pin.hv { padding: 4px 12px 4px 4px; gap: 8px; }
  .map-pin.on .pt, .map-pin.hv .pt { display: block; }
  .map-pin:not(.on):not(.hv) em { position: absolute; top: -7px; right: -7px; margin: 0; }
  .mapview .map-stage { height: 52vh; }
}
@media (max-width: 380px) { .kpi b { font-size: 17px; } .tabbar a, .tabbar button { font-size: 10.5px; } }

/* подписи разделов меню: «Путь изделия», «Итоги», «Управление» */
.nav .cap { margin: 14px 12px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(238, 235, 228, .42); }
.nav .cap:first-child { margin-top: 4px; }
.app.rail .nav .cap { height: 1px; overflow: hidden; margin: 10px 6px; background: rgba(255, 255, 255, .1); color: transparent; }

/* ---------- накладные на перемещение ---------- */
#trTable tr.row-off td { color: var(--muted); }
#trTable select { max-width: 340px; }
.tr-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 24px; background: var(--accent-soft); border-radius: var(--r-sm); padding: 12px 16px; }
.tr-sum h3 { font-size: 14px; margin: 0 0 6px; }
.tr-sum ul { margin: 0; padding-left: 18px; font-size: 14px; }
.tr-sum p { margin: 0 0 6px; font-size: 13px; }
.tr-list { display: flex; flex-direction: column; gap: 6px; }
.tr-doc { border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.tr-doc summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; cursor: pointer; font-size: 14px; }
.tr-doc ul { margin: 0; padding: 0 16px 12px 34px; font-size: 13.5px; }

/* ---------- Оргсхема: отделы как на плакате, у каждой должности — её результат ---------- */
.org { max-width: 1440px; display: flex; flex-direction: column; gap: 18px; }
.og-top-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; }
.og-top { display: flex; flex-direction: column; gap: 4px; min-width: 250px; padding: 14px 22px; background: var(--side); color: #fff; border-radius: 14px; text-align: center; }
.og-top small { font-size: 12px; color: #cfcabe; letter-spacing: .03em; }
.og-top b { font: 400 19px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .06em; }
.og-top span { font-size: 14px; color: #e9e5dc; }
.og-line { width: 44px; height: 2px; align-self: center; background: #c8553d; }
@media (max-width: 1100px) { .og-top-row { flex-direction: column; } .og-line { width: 2px; height: 14px; } }
.og-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.og-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--dc); border-radius: 18px; padding: 16px; }
.og-head { display: flex; align-items: center; gap: 10px; }
.og-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--dc); color: #fff; display: grid; place-items: center; }
.og-ic svg { width: 21px; height: 21px; stroke-width: 1.8; }
.og-head h2 { min-width: 0; margin: 0; font: 400 14.5px/1.2 var(--font-display); letter-spacing: .04em; text-transform: uppercase; overflow-wrap: anywhere; }
.og-result { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--st-bg); }
.og-result small, .og-col h3 { font: 600 11px/1.2 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0; }
.og-result b { font-size: 15px; font-weight: 600; line-height: 1.3; }
.og-rst { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; font-weight: 600; color: var(--st); }
.og-rst i { font-style: normal; font-weight: 400; color: var(--ink-2); }
.og-rst .si svg, .og-st .si svg { width: 18px; height: 18px; stroke-width: 2.4; }
.og-lvl { display: flex; flex-direction: column; gap: 8px; }
.og-lvl h3, .og-staff h3, .og-areas h3 { margin-top: 4px; }
.og-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1.5px dashed var(--line-2); border-radius: 14px; background: #fff; }
.og-card header b { display: block; font-size: 16px; font-weight: 650; line-height: 1.25; }
.og-card header small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.og-people { display: flex; flex-wrap: wrap; gap: 6px; }
.og-person { padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); font-size: 14px; }
.og-person small { color: var(--muted); }
.og-vacant { font-size: 14px; color: var(--warn); font-weight: 600; }
.og-vacant a { color: inherit; }
.og-res { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.og-res li + li { margin-top: 3px; }
.og-st { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--st-bg); color: var(--ink); text-decoration: none; }
.og-st:hover { filter: brightness(.97); }
.og-st .si { color: var(--st); margin-top: 1px; }
.og-st b { display: block; font-size: 14px; color: var(--st); }
.og-st small { display: block; font-size: 13px; color: var(--ink-2); }
.og-go { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.og-go svg { width: 16px; height: 16px; }
.og-go:hover { color: var(--ink); text-decoration: underline; }
.og-eyes { align-self: flex-start; font-size: 13px; color: var(--muted); }
.og-staff { display: flex; flex-direction: column; gap: 6px; }
.og-staff ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.og-staff li { display: flex; flex-direction: column; font-size: 14px; }
.og-staff li span { font-size: 12.5px; color: var(--muted); }
.og-staff li b { font-weight: 600; }
.og-empty { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.og-areas { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.og-areas > div { display: flex; flex-wrap: wrap; gap: 6px; }
.og-chip { padding: 5px 9px; border-radius: 8px; background: var(--track); font-size: 13px; line-height: 1.25; color: var(--ink-2); text-decoration: none; }
a.og-chip:hover { background: var(--line-2); color: var(--ink); }
@media (max-width: 1250px) { .og-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .og-grid { grid-template-columns: 1fr; }
  .og-top-row { flex-direction: column; align-items: stretch; }
  .og-line { width: 2px; height: 14px; }
  .og-top { min-width: 0; }
}

/* «Мои дела»: результат должности со схемы */
.td-ckp { margin: 0; padding: 14px 18px 14px 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-size: 16px; line-height: 1.45; color: var(--ink-2); }
.td-ckp li + li { margin-top: 4px; }

/* Сотрудники по отделам оргсхемы */
.users-grp th { padding: 14px 12px 8px; background: none; border-left: 4px solid var(--dc); font: 400 13px/1.2 var(--font-display); letter-spacing: .08em; text-transform: uppercase; text-align: left; color: var(--ink); }
.users-grp th span { font: 400 13px var(--font); letter-spacing: 0; text-transform: none; color: var(--muted); }
.u-hint { margin: 10px 0 0; font-size: 14px; }
.pv-menu .pv-grp { margin: 8px 0 0; padding: 0 12px; font: 600 11px/1.4 var(--font); font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Заказ DBS из кабинета маркетплейса: вставить текст или файл */
.dbs-quick { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1.5px dashed var(--line-2); border-radius: 14px; background: #faf8f3; }
.dq-head b { display: block; font-size: 15px; }
.dq-head small { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.4; color: var(--muted); }
.dbs-quick textarea { width: 100%; min-height: 76px; resize: vertical; font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.dbs-quick textarea:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.dq-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dq-file { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.dq-file svg { width: 16px; height: 16px; }
.dq-msg { flex: 1 1 260px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.dq-msg.busy { color: var(--muted); }
.dq-msg.err { color: var(--bad); font-weight: 600; }
.dq-ok { color: var(--good); font-weight: 600; }
.dq-warn { color: var(--warn); font-weight: 600; }
.dbs-form .ff-auto { background: var(--good-soft); border-color: #9cc9ab; }
.dbs-form .ff-warn { background: var(--warn-soft); border-color: #e2bf7f; }
.dbs-batch h3 { margin: 0 0 4px; font-size: 17px; }
.dbs-batch td { vertical-align: top; font-size: 14px; }
.dbs-batch tr.off td { opacity: .55; }
.dbs-batch input[type=checkbox] { width: 20px; height: 20px; }
.dq-wh { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
