/* DGA PLM — общий стиль интерфейса */

:root {
  --navy: #053456;
  --navy-hover: #042A46;
  --navy-tint: #E8EFF5;
  --navy-wash: #F4F7FA;
  --steel: #6F8BA6;
  --ground: #F4F5F7;
  --surface: #FFFFFF;
  --ink: #0B1B2B;
  --ink-2: #2F3D4C;
  --muted: #56616E;
  --line: #E1E5EA;
  --line-soft: #EEF0F3;
  --line-strong: #CBD3DC;
  --warn: #9A3412;
  --warn-bg: #FDEEE3;
  --radius: 14px;
  /* D-126: новые токены из dga-next.css (Claude Design) */
  --hover: #F1F3F6;
  --ok: #0B6B4C;
  --ok-bg: #DDF2E8;
  /* этапы: разные оттенки, чтобы не сливались (D-126, 2026-10-22) — серый, жёлтый, синий, фиолетовый, бирюзовый, зелёный */
  --sg-new: #9AA5B1;
  --sg-material: #E0A100;
  --sg-assembly: #2F80ED;
  --sg-assembled: #8E5CD9;
  --sg-tested: #14A3A0;
  --sg-shipped: #2E9E5B;
  --r: 10px;
  --r-sm: 6px;
  --dur: 160ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* Зрелость: 5 цветов, различимых и при дальтонизме (палитра Окабе–Ито) + форма точки + текст */
  --st-standard: #0072B2;
  --st-pilot: #009E73;
  --st-proto: #E69F00;
  --st-concept: #CC79A7;
  --st-obs: #8C96A0;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font: 400 15px/1.45 var(--sans); }
a { color: var(--navy); }
a:hover { color: var(--navy-hover); }
h1, h2, h3 { margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.warn { color: var(--warn); font-weight: 500; }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.shell { display: flex; align-items: stretch; min-height: 100vh; }
.side { flex: 0 0 232px; width: 232px; background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 24px; padding-bottom: 48px; }
/* контент страницы: поля 32 px, ширина до 1180 px (макет Claude Design, D-126) */
.main > :not(.top) { margin-left: 32px; margin-right: 32px; max-width: 1640px; }
.main > :first-child:not(.top) { margin-top: 28px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; text-decoration: none; color: var(--ink); }
.brand img { width: 32px; height: 32px; border-radius: 8px; display: block; }
.brand b { display: block; font-size: 15px; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.on { background: var(--navy-tint); color: var(--navy); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.side-foot { margin-top: auto; padding: 14px 6px 0; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--navy-tint); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex-shrink: 0; }
/* Меню по ролям: основное + «Ещё», значок только где ждут действия (D-126) */
.nav .lbl { flex: 1; }
.nav-more > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 8px; color: var(--muted); font-size: 15px; font-weight: 500; cursor: pointer; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary:hover { background: #F2F4F7; color: var(--ink); }
.nav-more > summary svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-more[open] > summary { color: var(--ink-2); }
.nav-more a { min-height: 36px; font-size: 14px; padding-left: 38px; }
.nav-more a svg { display: none; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--warn); color: #fff; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }

.side-foot { flex-direction: column; align-items: stretch; gap: 10px; }
.side-foot .me { display: flex; align-items: center; gap: 10px; }
.me-links { display: flex; flex-direction: column; gap: 2px; }
.me-links a { min-height: 40px; display: flex; align-items: center; padding: 0 10px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.me-links a:hover, .me-links a.on { background: #F2F4F7; color: var(--ink); }
.me-btn { display: none; }

/* Нижняя панель на телефоне: 3 главных раздела + «Меню» (D-126) */
.tabbar { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .side { display: none; }
  .side.open { display: flex; position: fixed; inset: 0 0 calc(64px + env(safe-area-inset-bottom)) 0; z-index: 40; max-width: none; min-width: 0; min-height: 0; border-radius: 0; overflow-y: auto; gap: 16px; }
  .side.open .side-foot { display: flex; }
  body.menu-open { overflow: hidden; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { flex: 1; position: relative; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font: 500 12px var(--sans); color: var(--muted); text-decoration: none; background: none; border: 0; border-radius: 12px; cursor: pointer; }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar .on { color: var(--navy); background: var(--navy-tint); }
  .tabbar .badge { position: absolute; top: 4px; right: calc(50% - 26px); min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
  /* сборщику панели нет: один экран «Цех», аватар открывает меню (D-126) */
  .me-btn { display: flex; position: fixed; top: 12px; right: 12px; z-index: 50; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--navy-tint); color: var(--navy); font-weight: 600; font-size: 14px; align-items: center; justify-content: center; cursor: pointer; }
  .side.open { bottom: 0; }
  body:has(.tabbar) .side.open { bottom: calc(64px + env(safe-area-inset-bottom)); }
  body:not(:has(.tabbar)) { padding-bottom: 0; }
}

/* Заказ: этапы шкафов и «что дальше» (D-126) */
.pipe { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.pipe li { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; background: #F2F4F7; color: var(--muted); font-size: 12px; text-align: center; }
.pipe li b { font: 600 20px var(--mono); }
.pipe li.has { background: var(--navy-tint); color: var(--navy); }
.next-step { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-left: 4px solid var(--navy); }
.next-step .ns-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 260px; }
.next-step .ns-text b { font-size: 17px; }
@media (max-width: 760px) {
  .pipe { grid-template-columns: repeat(3, 1fr); }
  .next-step .btn { width: 100%; }
}

/* ---------- page head ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; }
.page-head h1 { font-size: 28px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
.page-head .titles { display: flex; flex-direction: column; gap: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); }
.crumbs a { text-decoration: none; }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 20px 24px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card h2 { font-size: 17px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

/* ---------- buttons ---------- */
.btn { min-height: 44px; padding: 0 18px; border-radius: var(--r); border: 1px solid var(--line-strong); transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); background: var(--surface); color: var(--ink); font: 500 15px var(--sans); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--steel); color: var(--ink); }
.btn.pri { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.pri:hover { background: var(--navy-hover); color: #fff; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn.big { min-height: 60px; padding: 0 28px; font-size: 17px; border-radius: 14px; }
.btn svg { width: 18px; height: 18px; }
.icon-btn { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { border-color: var(--steel); }

/* ---------- search ---------- */
.search { flex: 1 1 360px; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 10px 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.search:focus-within { border-color: var(--navy); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 16px var(--sans); color: var(--ink); }
.kbd { font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; background: #fff; }

/* ---------- filters / segmented ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 4px; }
.flt { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--ink-2); font: 500 14px var(--sans); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.flt:hover { background: #F2F4F7; }
.flt.on { border-color: var(--navy); color: var(--navy); background: var(--navy-tint); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { padding: 12px 16px; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.t td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: #F7F9FB; }
.t .num { text-align: right; }
.t .code { font-family: var(--mono); font-weight: 500; text-decoration: none; white-space: nowrap; }
.boxed { border: 1px solid var(--line); border-radius: 14px; }

/* ---------- status ---------- */
.st { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.st::before { content: ''; width: 8px; height: 8px; border-radius: 50%; box-sizing: border-box; flex-shrink: 0; }
.st::before { width: 10px; height: 10px; }
.st-std::before { background: var(--st-standard); }
.st-pilot::before { background: var(--st-pilot); border-radius: 2px; }
.st-proto::before { border: 2.5px solid var(--st-proto); }
.st-concept::before { border: 2px dashed var(--st-concept); }
.st-obs::before { background: var(--st-obs); border-radius: 0; transform: rotate(45deg) scale(.8); }
.st-obs { color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-sm); font-size: 12px; font-weight: 500; background: #EEF1F4; color: var(--ink-2); white-space: nowrap; }
.tag.navy { background: var(--navy-tint); color: var(--navy); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: #8A3B0C; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-top: 1px solid var(--line-soft); margin: 18px -8px 0; }
.tab { min-height: 48px; padding: 0 18px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-2); font: 500 15px var(--sans); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--navy); }
.tab .mono { font-size: 12px; color: var(--muted); }
[data-panel][hidden] { display: none; }

/* ---------- key/values ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat b { font-family: var(--mono); font-size: 24px; font-weight: 500; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.kv div { display: flex; flex-direction: column; gap: 3px; }
.kv span:first-child { font-size: 13px; color: var(--muted); }
.memo { margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--navy-wash); color: var(--ink-2); line-height: 1.55; white-space: pre-line; }

/* ---------- lineage ---------- */
.lineage { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lineage a, .lineage span.cur { font-family: var(--mono); font-size: 14px; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.lineage a { border: 1px solid var(--line); color: var(--ink-2); }
.lineage a:hover { border-color: var(--steel); }
.lineage span.cur { background: var(--navy); color: #fff; }
.lineage .arr { color: #9FB0C2; }

/* ---------- checklist ---------- */
.progress { display: flex; gap: 4px; }
.progress i { flex: 1; height: 4px; background: #E1E5EA; border-radius: 2px; }
.progress i.on { background: var(--navy); }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.checks li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.checks li:last-child { border-bottom: 0; }
.checks .dot { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.checks .ok .dot { background: var(--navy); }
.checks .no .dot { border: 1.5px solid #C2410C; }
.checks .no span:last-child { margin-left: auto; }

/* ---------- revisions ---------- */
.rev-layout { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.rev-list { flex: 1 1 260px; max-width: 320px; display: flex; flex-direction: column; gap: 8px; }
.rev-body { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.rev { width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 14px 16px; cursor: pointer; font: inherit; color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
.rev[aria-pressed="true"] { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: var(--navy-wash); }
.rev .top { display: flex; justify-content: space-between; align-items: center; }
.rev .v { font-family: var(--mono); font-size: 17px; font-weight: 500; }
.rev .released { color: var(--navy); font-weight: 500; font-size: 13px; }
.rev .draft { color: var(--warn); font-weight: 500; font-size: 13px; }

/* ---------- files ---------- */
.file { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.file + .file { margin-top: 10px; }
.file .ext { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font: 500 12px var(--mono); background: var(--navy-tint); color: var(--navy); flex-shrink: 0; }
.file .ext.fw { background: var(--navy); color: #fff; }
.file .info { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.file .name { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
.file .sha { font: 13px var(--mono); color: var(--muted); padding: 8px 10px; border-radius: 8px; background: #F2F4F7; }

/* ---------- instances ---------- */
.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.inst { padding: 18px; border-radius: 14px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.inst .sn { font: 500 20px var(--mono); }

/* ---------- drawing (вид спереди) ---------- */
.drawing { background: var(--surface); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.drawing .sheet { flex: 1; min-height: 300px; position: relative; display: flex; align-items: center; justify-content: center; background-color: #F7F9FB; background-image: linear-gradient(#E6EBF1 1px, transparent 1px), linear-gradient(90deg, #E6EBF1 1px, transparent 1px); background-size: 16px 16px; }
.drawing .sheet .eyebrow { position: absolute; left: 16px; top: 14px; }
.drawing .floor { position: absolute; left: 24px; right: 24px; bottom: 34px; height: 1px; background: #9FB0C2; }
.stamp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #9FB0C2; }
.stamp div { padding: 7px 12px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid #9FB0C2; font-size: 13px; }
.stamp div:first-child { border-left: 0; }
.stamp .eyebrow { font-size: 9px; }

.cab { position: relative; width: 118px; height: 170px; margin-top: 28px; }
.cab .body { position: absolute; inset: 0; border: 1.5px solid var(--navy); border-radius: 2px; background: #fff; }
.cab .door { position: absolute; inset: 7px; border: 1px solid #C3CFDB; }
.cab .win { position: absolute; left: 20px; right: 30px; top: 18px; height: 50px; border: 1px solid var(--navy); padding: 5px 4px; display: flex; justify-content: space-evenly; }
.cab .win i { width: 2px; background: var(--steel); }
.cab .lamps { position: absolute; left: 20px; top: 82px; display: flex; gap: 7px; }
.cab .lamps i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--navy); }
.cab .handle { position: absolute; right: 13px; top: 70px; width: 3px; height: 28px; background: var(--navy); }
.cab .plinth { position: absolute; left: 5px; right: 5px; bottom: -8px; height: 7px; background: var(--steel); }
.cab .roof { position: absolute; left: -8px; right: -8px; top: -9px; height: 3px; background: var(--navy); }
.cab .ear { position: absolute; width: 12px; height: 5px; background: #9FB0C2; }
.cab .dim { position: absolute; left: -24px; top: 0; bottom: 0; width: 1px; background: var(--steel); }
.cab .dim-l { position: absolute; left: -58px; top: 50%; transform: translateY(-50%) rotate(-90deg); font: 10px var(--mono); color: var(--muted); white-space: nowrap; }

/* ---------- forms ---------- */
.form-card { max-width: 760px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.field .help { font-size: 13px; color: var(--muted); }
.field input[type=text], .field input[type=number], .field input[type=file], .field input[type=date], .field select, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; font: 400 16px var(--sans); color: var(--ink);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-tint); }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--warn); font-size: 13px; }
.form-errors { padding: 14px 16px; border-radius: 12px; background: var(--warn-bg); color: #8A3B0C; margin-bottom: 18px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ---------- in-work list ---------- */
.work-item { display: flex; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); }
.work-item:last-child { border-bottom: 0; }
.work-item .badge { width: 44px; height: 44px; border-radius: 10px; background: #F2F4F7; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font: 500 13px var(--mono); color: var(--navy); }
.work-item .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.work-item .meter { width: 150px; display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; text-align: right; font-size: 13px; }
.work-item .bar { height: 4px; border-radius: 2px; background: #E1E5EA; overflow: hidden; }
.work-item .bar i { display: block; height: 100%; background: var(--navy); }

.graph-teaser { flex: 1 1 300px; background: var(--navy); color: #fff; border-radius: var(--radius); padding: 22px 24px; text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; min-height: 220px; position: relative; overflow: hidden; }
.graph-teaser:hover { color: #fff; }
.graph-teaser::before { content: ''; position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px); background-size: 24px 24px; }
.graph-teaser > * { position: relative; }
.graph-teaser .eyebrow { color: #B9CDE0; }
.graph-teaser b { font-size: 22px; font-weight: 600; }

/* ---------- messages ---------- */
.msg { padding: 14px 18px; border-radius: 12px; background: var(--navy-tint); color: var(--navy); font-weight: 500; }
.msg.error { background: var(--warn-bg); color: #8A3B0C; }

/* ---------- command palette ---------- */
.cmdk { position: fixed; inset: 0; z-index: 50; background: rgba(6, 18, 32, .55); display: none; }
.cmdk.open { display: block; }
.cmdk-box { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); width: min(680px, calc(100% - 32px)); background: #fff; border-radius: 20px; box-shadow: 0 24px 64px rgba(6, 18, 32, .35); overflow: hidden; }
.cmdk-in { display: flex; align-items: center; gap: 14px; padding: 0 20px; min-height: 68px; border-bottom: 1px solid var(--line-soft); }
.cmdk-in input { flex: 1; border: 0; outline: 0; font: 400 19px var(--sans); color: var(--ink); min-width: 0; }
.cmdk-list { max-height: 60vh; overflow-y: auto; padding: 8px 10px 10px; }
.cmdk-list .eyebrow { display: block; padding: 12px 14px 6px; }
.cmdk-item { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 14px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.cmdk-item:hover, .cmdk-item.on { background: var(--navy-tint); color: var(--ink); }
.cmdk-item .ic { width: 36px; height: 36px; border-radius: 9px; background: #F2F4F7; color: var(--navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font: 500 11px var(--mono); }
.cmdk-item.on .ic { background: var(--navy); color: #fff; }
.cmdk-item .t1 { font-weight: 500; }
.cmdk-item .t2 { font-size: 13px; color: var(--muted); }
.cmdk-foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--line-soft); background: #F7F9FB; font-size: 13px; color: var(--muted); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 18px; }
.login-card input { width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); font: 400 16px var(--sans); }

/* ---------- revision states ---------- */
.rstate { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 8px; font: 500 13px var(--sans); }
.rs-draft { background: var(--warn-bg); color: #8A3B0C; }
.rs-review { background: #FFF4D6; color: #7A5200; }
.rs-released { background: var(--navy); color: #fff; }
.rs-obsolete { background: #E4E8EC; color: var(--muted); }
.checks .wr .dot { border: 1.5px solid #B07A00; color: #B07A00; font: 600 12px var(--sans); }
.check-row { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; cursor: pointer; }
.check-row input[type=checkbox] { width: 24px; height: 24px; flex-shrink: 0; margin: 0; accent-color: var(--navy); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- history ---------- */
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hist li { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.hist li:last-child { border-bottom: 0; }
.hist .mono { font-size: 13px; }

/* ---------- manufacturers ---------- */
.mfr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.mfr { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mfr .muted { flex-basis: 100%; }

/* ---------- цех: этапы, экран сборщика ---------- */
.stage { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 15px; font: 500 14px var(--sans); background: #E8ECF0; color: var(--ink-2); white-space: nowrap; }
.stage::before { content: ''; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; background: currentColor; opacity: .9; }
.sg-new { background: #EEF1F4; color: #3B4A5A; }
.sg-new::before { background: var(--sg-new); }
.sg-material { background: #FFF4D6; color: #7A5200; }
.sg-material::before { background: var(--sg-material); }
.sg-assembly { background: #E1EDFD; color: #124A8C; }
.sg-assembly::before { background: var(--sg-assembly); }
.sg-assembled { background: #EEE6FB; color: #5A2FA0; }
.sg-assembled::before { background: var(--sg-assembled); }
.sg-tested { background: #DDF4F3; color: #0A5E5C; }
.sg-tested::before { background: var(--sg-tested); }
.sg-shipped { background: #DEF2E6; color: #1C6B3C; }
.sg-shipped::before { background: var(--sg-shipped); }
.sg-cancelled { background: #F2F2F2; color: var(--muted); text-decoration: line-through; }
.wcard { display: flex; flex-direction: column; gap: 12px; }
.wcard-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.wcard-head .sn { font: 500 26px var(--mono); }
.wcard-meta { display: flex; flex-direction: column; gap: 3px; font-size: 15px; }
.wide-btn { width: 100%; white-space: normal; text-align: center; min-height: 64px; font-size: 18px; }
.flow { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: st; }
.flow li { flex: 1 1 110px; padding: 8px 10px; border-radius: 10px; font-size: 13px; background: #F2F4F7; color: var(--muted); counter-increment: st; }
.flow li::before { content: counter(st) ". "; }
.flow li.done { background: var(--navy-tint); color: var(--navy); }
.flow li.now { background: var(--navy); color: #fff; font-weight: 600; }
.inp { width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); font: 400 16px var(--sans); background: #fff; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photos a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; font-size: 12px; color: var(--muted); }
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #F2F4F7; }
.remark { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); line-height: 1.45; }
.remark + .remark { margin-top: 8px; }
.remark.crit { border-color: #C2410C; background: var(--warn-bg); }
.remark.closed { opacity: .65; }
.hist-row { padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
details.more > summary { list-style: none; display: inline-flex; }
details.more > summary::-webkit-details-marker { display: none; }
.checklist { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; }
.checklist li { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.checklist .txt { font-size: 16px; line-height: 1.45; }
.okno { display: flex; gap: 10px; }
.okno label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border: 1px solid var(--line-strong); border-radius: 12px; font-weight: 500; cursor: pointer; }
.okno input { width: 22px; height: 22px; accent-color: var(--navy); }
.okno label:has(input:checked) { border-color: var(--navy); background: var(--navy-tint); }
@media (max-width: 760px) {
  .page-head h1 { font-size: 24px; }
  .card { padding: 18px 16px; }
  .main > :not(.top) { margin-left: 16px; margin-right: 16px; }
  .main > :first-child:not(.top) { margin-top: 16px; }
  .main { gap: 16px; }
}

/* «Задачи»: Сделать / Жду, строки с одним глаголом (D-126, макет Claude Design) */
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cols > .main-col { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.cols > .side-col { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.todo { padding: 0; overflow: hidden; }
.todo > .card-head { padding: 18px 24px 6px; margin: 0; }
.todo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 24px; border-top: 1px solid var(--line-soft); }
.todo-row:first-of-type { border-top: 0; }
.todo-row:hover { background: #FAFBFC; }
.todo-row .what { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.todo-row .code { font: 500 14px var(--mono); color: var(--ink); text-decoration: none; }
.todo-row .meta { font-size: 13px; color: var(--muted); }
.todo-row .btn { min-height: 40px; }
.todo-foot { padding: 10px 24px 16px; font-size: 14px; }
.side-col .todo-row { padding: 10px 20px; }
.done-empty { text-align: left; padding: 28px 24px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); }
.done-empty b { font-size: 17px; color: var(--ink); }

/* Цех и шаг сборщика (D-126, шаг 2) */
.sec-title { margin: 8px 0 -8px; font-size: 15px; font-weight: 600; color: var(--muted); }
.wd-line { margin: 0; padding: 12px 16px; border-radius: 12px; background: #FFF6D6; color: #6B4E00; font-size: 14px; }
.why { margin: 0; font-size: 14px; color: var(--warn); }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.slots form { display: contents; }
.slot { min-height: 96px; border: 2px dashed var(--line-strong); border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; text-align: center; padding: 8px; transition: background .14s ease-out, border-color .14s ease-out; }
.slot:hover { background: var(--navy-wash); }
.slot-ic { font-size: 26px; line-height: 1; color: var(--navy); }
.slot.done { border-style: solid; border-color: var(--navy); background: var(--navy-tint); color: var(--navy); }
.slot.busy { opacity: .6; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .slot { transition: none; } }


/* ---------- D-126 шаг 3: классы из dga-next.css для шагов 4–7 ---------- */
.btn.ghost { border-color: transparent; background: transparent; color: var(--navy); padding: 0 10px; }
.btn.ghost:hover { background: var(--hover); }
.btn.lg { min-height: 48px; padding: 0 20px; font-size: 16px; }
.btn.xl { min-height: 64px; width: 100%; font-size: 18px; font-weight: 600; border-radius: 12px; white-space: normal; text-align: center; }
.btn[disabled], .btn.off { background: #E9ECEF; border-color: #E9ECEF; color: var(--muted); cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: 500 14px var(--sans); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: none; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: #E9ECEF; }
.seg a { min-height: 32px; padding: 0 14px; border-radius: 8px; display: inline-flex; align-items: center; color: var(--ink-2); font: 500 14px var(--sans); text-decoration: none; }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(11, 27, 43, .12); }
.path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.path li { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.path li::before { content: ''; height: 4px; border-radius: 2px; background: var(--line); }
.path li.done { color: var(--ink-2); }
.path li.done::before { background: var(--navy); opacity: .45; }
.path li.now { color: var(--navy); font-weight: 600; }
.path li.now::before { background: var(--navy); }
.strip { display: flex; height: 14px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--line-soft); }
.strip span { display: block; height: 100%; transition: flex-grow var(--dur) var(--ease); }
.strip.tall { height: 28px; border-radius: 6px; }
.s-new { background: var(--sg-new); }
.s-material { background: var(--sg-material); }
.s-assembly { background: var(--sg-assembly); }
.s-assembled { background: var(--sg-assembled); }
.s-tested { background: var(--sg-tested); }
.s-shipped { background: var(--sg-shipped); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend b { font-family: var(--mono); font-weight: 500; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--r); background: var(--ground); color: var(--ink); text-decoration: none; }
.tile:hover { background: #ECEFF2; color: var(--ink); }
.tile .sn { font: 500 16px var(--mono); }
.pop { position: relative; }
.pop > summary { list-style: none; cursor: pointer; }
.pop > summary::-webkit-details-marker { display: none; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; background: var(--surface); border-radius: 12px; box-shadow: 0 12px 32px rgba(6, 18, 32, .18), 0 0 0 1px rgba(6, 18, 32, .06); padding: 6px; display: flex; flex-direction: column; min-width: 240px; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--ink); font: 400 15px var(--sans); background: none; border: 0; text-align: left; cursor: pointer; text-decoration: none; width: 100%; }
.menu a:hover, .menu button:hover { background: var(--hover); }
.menu hr { border: 0; height: 1px; background: var(--line-soft); margin: 4px 6px; }
.menu form { display: contents; }
@media (prefers-reduced-motion: reduce) { .btn, .strip span { transition: none; } }

/* Шапка: поиск и «+ Создать» (D-126 шаг 4) */
.top { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; padding: 12px 32px; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .search { flex: 1 1 320px; max-width: 560px; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--muted); font: 400 15px var(--sans); cursor: text; text-align: left; }
.top .search svg { width: 18px; height: 18px; flex-shrink: 0; }
.top .search span:not(.kbd) { flex: 1; }
.top .search:hover { border-color: var(--line-strong); }
.top .pop { margin-left: auto; }
@media (max-width: 760px) { .top { padding: 10px 16px; } .top .search .kbd { display: none; } }


/* ---------- Тёмное меню DGA (D-126, выбор Вани 2026-10-22) ---------- */
.side { background: var(--navy); border-right: 0; color: #fff; }
.brand { padding: 8px 10px 4px; }
.brand .brand-logo { width: 96px; height: auto; border-radius: 0; }
.brand .brand-sub { font: 600 12px var(--mono); letter-spacing: .14em; color: rgba(255,255,255,.55); align-self: flex-end; padding-bottom: 2px; }
.side .nav a, .side .nav-more > summary { color: rgba(255,255,255,.74); }
.side .nav a:hover, .side .nav-more > summary:hover { background: rgba(255,255,255,.08); color: #fff; }
.side .nav a.on { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 3px 0 0 #7FB2E0; }
.side .nav-more[open] > summary { color: #fff; }
.side .nav svg { opacity: .9; }
.side .badge { background: #F08A3C; color: #1B0E02; }
.side-foot { border-top-color: rgba(255,255,255,.12); }
.side-foot .me div { color: #fff; }
.side-foot .muted { color: rgba(255,255,255,.6); }
.side .avatar { background: rgba(255,255,255,.14); color: #fff; }
.side .icon-btn { background: transparent; border-color: rgba(255,255,255,.2); color: rgba(255,255,255,.8); }
.side .icon-btn:hover { border-color: rgba(255,255,255,.5); color: #fff; }
.me-links a { color: rgba(255,255,255,.8); }
.me-links a:hover, .me-links a.on { background: rgba(255,255,255,.08); color: #fff; }
/* контент: карточки чётче на сером, главная кнопка заметнее */
.card { box-shadow: 0 1px 2px rgba(11,27,43,.05), 0 0 0 1px rgba(11,27,43,.04); }
.btn.pri { box-shadow: 0 1px 2px rgba(5,52,86,.25); }
.top { box-shadow: 0 1px 0 rgba(11,27,43,.02); }
.page-head h1 { color: var(--ink); }


/* Мягче для глаз: фон темнее, поверхности не чисто-белые (2026-10-22) */
:root { --ground: #E7EAEE; --surface: #FAFBFC; --hover: #EEF1F4; }
.top { background: #F4F6F8; }
.strip { gap: 3px; background: transparent; }
.strip span { border-radius: 3px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; }
