/* Калькулятор ADONIS — по мотивам Dashboard Design System (SnowUI, ByeWind, CC BY 4.0) */
:root {
  --font: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --bg: #FFFFFF;
  --bg-soft: #F7F9FB;
  --bg-hover: rgba(28, 28, 28, .05);
  --card: #F7F9FB;
  --line: rgba(28, 28, 28, .10);
  --line-strong: rgba(28, 28, 28, .20);
  --text: #1C1C1C;
  --text-2: rgba(28, 28, 28, .62);
  --text-3: rgba(28, 28, 28, .40);
  --primary: #1C1C1C;
  --on-primary: #FFFFFF;
  --blue: #E3F5FF;
  --purple: #E5ECF6;
  --mint: #DCF5E0;
  --yellow: #FFF6D6;
  --accent: #95A4FC;
  --accent-strong: #5E6FD8;
  --accent-soft: rgba(149, 164, 252, .22);
  --ok: #3E9E5A;
  --warn-text: #8A6100;
  --danger: #D9363E;
  --garment-line: rgba(28, 28, 28, .55);
  --canvas: #FFFFFF;
  --print-fill: #E6E9FE;
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(28, 28, 28, .04);
}
html[data-theme="dark"] {
  --bg: #1C1C1C;
  --bg-soft: #262626;
  --bg-hover: rgba(255, 255, 255, .06);
  --card: rgba(255, 255, 255, .05);
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .22);
  --text: #FFFFFF;
  --text-2: rgba(255, 255, 255, .66);
  --text-3: rgba(255, 255, 255, .42);
  --primary: #C6C7F8;
  --on-primary: #1C1C1C;
  --accent: #A8B3FD;
  --accent-strong: #C6CCFF;
  --accent-soft: rgba(168, 179, 253, .22);
  --warn-text: #F5C451;
  --garment-line: rgba(255, 255, 255, .55);
  --canvas: #232323;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
.muted { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Каркас ---------- */
.shell { display: grid; grid-template-columns: 284px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 20px 14px 14px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; min-height: 0; }
.side-new { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }

/* ---------- Реестр в левом меню ---------- */
.reg { display: flex; flex-direction: column; min-height: 0; flex: 1; border-top: 1px solid var(--line); padding-top: 14px; }
.reg-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 0 8px 8px; }
.reg-search { position: relative; margin-bottom: 8px; }
.reg-search svg { position: absolute; left: 10px; top: 11px; color: var(--text-3); }
.reg-search .input { width: 100%; height: 34px; padding-left: 30px; font-size: 13px; background: var(--bg-soft); }
.reg-list { overflow-y: auto; min-height: 0; flex: 1; margin: 0 -6px; padding: 0 6px 8px; }
.reg-empty { font-size: 12.5px; color: var(--text-3); padding: 10px 8px; line-height: 1.45; }
.reg-group + .reg-group { margin-top: 2px; }
.reg-client { display: flex; align-items: center; gap: 2px; border-radius: 8px; padding-right: 8px; }
.reg-client:hover, .reg-client.on { background: var(--bg-hover); }
.reg-client.on .reg-cname { font-weight: 600; }
.reg-chev { width: 26px; height: 30px; border: 0; background: none; display: grid; place-items: center; color: var(--text-3); border-radius: 6px; flex: none; }
.reg-chev svg { transition: transform .15s; }
.reg-group.open .reg-chev svg { transform: rotate(90deg); }
.reg-cname { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 6px 0; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
span.reg-cname { font-weight: 400; }
.reg-n { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.reg-calcs { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 6px 26px; }
.reg-calc { display: grid; grid-template-columns: 10px 1fr; column-gap: 8px; align-items: center; text-align: left; border: 0; background: none; border-radius: 8px; padding: 6px 8px; color: var(--text); }
.reg-calc:hover { background: var(--bg-hover); }
.reg-calc.on { background: var(--bg-hover); box-shadow: inset 3px 0 0 var(--primary); }
.reg-line { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.reg-no { font-weight: 600; font-variant-numeric: tabular-nums; }
.reg-date { color: var(--text-3); font-variant-numeric: tabular-nums; }
.reg-sub { grid-column: 2; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reg-none { font-size: 12px; color: var(--text-3); padding: 4px 8px; }
.reg-add { align-self: flex-start; border: 0; background: none; color: var(--text-3); font-size: 12px; padding: 4px 8px; border-radius: 6px; }
.reg-add:hover { color: var(--text); background: var(--bg-hover); }

/* Статусы расчёта */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: #A0A6AE; }
.dot.blue { background: #4F9FE0; } .dot.mint { background: #36B37E; } .dot.purple { background: #8E7CF0; }
.dot.green { background: #1F8A4C; } .dot.red { background: #E5484D; } .dot.grey { background: #A0A6AE; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; }
.status-chip.on .dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.status-sel { height: 30px; font-size: 12.5px; padding: 0 6px; }
.status-sel.tone-blue { background: var(--blue); color: #1C1C1C; } .status-sel.tone-mint { background: var(--mint); color: #1C1C1C; }
.status-sel.tone-purple { background: var(--purple); color: #1C1C1C; } .status-sel.tone-green { background: #CDEFD8; color: #1C1C1C; }
.status-sel.tone-red { background: #FDE2E3; color: #1C1C1C; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: 700; }
.brand-name { font-weight: 600; letter-spacing: .02em; }
.brand-sub { color: var(--text-3); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: none; border-radius: 8px; text-align: left; color: var(--text); }
.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.nav-item:hover { background: var(--bg-hover); }
.nav-item.on { background: var(--bg-hover); font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); }
.nav-count { margin-left: auto; font-size: 12px; color: var(--text-3); }
.theme-btn { display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: none; border-radius: 8px; color: var(--text-2); }
.theme-btn:hover { background: var(--bg-hover); color: var(--text); }
.theme-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }

/* Сотрудник в левом меню */
.me { display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid var(--line); }
.me-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; }
.me-name b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-name span { font-size: 11.5px; color: var(--text-3); }
.me .btn.link { height: auto; padding: 4px 6px; font-size: 12.5px; }
.me:empty { display: none; }

/* Вход */
.booting .shell { visibility: hidden; }
.auth-mode .shell { display: none; }
.auth:empty { display: none; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg-soft); }
.auth-card { width: 100%; max-width: 400px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: 0 10px 30px rgba(0, 0, 0, .06); }
.auth-card .brand { padding: 0; margin-bottom: 22px; }
.auth-title { font-size: 20px; font-weight: 600; margin: 0 0 8px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.auth-card .input.wide { width: 100%; }
.auth-err { min-height: 18px; margin: 0; font-size: 13px; color: var(--danger); }
.auth-card .note { margin: 14px 0 0; }
.btn.wide { width: 100%; height: 40px; }
.btn:disabled { opacity: .55; cursor: default; }

/* Ставки: только чтение для менеджера; сотрудники */
.set-fs { border: 0; padding: 0; margin: 0; min-width: 0; display: contents; }
.set-fs:disabled .input, .set-fs:disabled .select, .set-fs:disabled .btn, .set-fs:disabled .seg button { opacity: .7; cursor: default; }
.invite-box { margin-top: 14px; padding: 14px; border-radius: var(--radius-s); background: var(--accent-soft); }
.invite-box .input.wide { flex: 1; min-width: 0; }

.main { min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 28px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.crumbs { display: flex; gap: 8px; font-size: 14px; align-items: center; min-width: 0; flex-wrap: wrap; }
.crumb { border: 0; background: none; padding: 2px 4px; margin: 0 -4px; border-radius: 6px; color: var(--text-3); }
.crumb:hover { color: var(--text); background: var(--bg-hover); }
.crumb-cur { font-weight: 500; }
.dirty { margin-left: 6px; font-size: 11.5px; color: var(--warn-text); background: var(--yellow); border-radius: 6px; padding: 2px 8px; }
html[data-theme="dark"] .dirty { background: rgba(245, 196, 81, .14); }
.top-actions { display: flex; gap: 8px; }

.calc { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; padding: 24px 28px 48px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.aside { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Карточки и подписи ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 600; margin: 0; }
.card-hint { font-size: 12px; color: var(--text-3); }
.step { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 600; margin-right: 8px; vertical-align: 1px; }
.label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; min-width: 0; }
.grow { flex: 1 1 200px; }

/* ---------- Поля и кнопки ---------- */
.input, .select { height: 36px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 0 10px; min-width: 0; outline: none; }
.input:focus, .select:focus { border-color: var(--accent-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.small { width: 84px; }
.input.mid { width: 120px; }
.input.wide { width: 100%; }
.input-suffix { position: relative; display: inline-flex; align-items: center; }
.input-suffix .input { padding-right: 30px; }
.input-suffix span { position: absolute; right: 10px; color: var(--text-3); font-size: 12px; pointer-events: none; }
.btn { height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); white-space: nowrap; }
.btn:hover { background: var(--bg-hover); }
a.btn { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; }
.btn.dark { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.btn.dark:hover { opacity: .9; }
.btn.ghost { background: transparent; }
.btn.link { border: 0; background: none; padding: 0 4px; height: auto; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.btn.icon { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border-color: transparent; background: transparent; color: var(--text-3); }
.btn.icon:hover { color: var(--danger); background: var(--bg-hover); }
.btn:focus-visible, .chip:focus-visible, .tile:focus-visible, .seg button:focus-visible, .nav-item:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; height: 30px; padding: 0 14px; border-radius: 7px; color: var(--text-2); }
.seg button.on { background: var(--primary); color: var(--on-primary); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 13px; }
.chip:hover { border-color: var(--line-strong); }
.chip.on { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.chip small { color: inherit; opacity: .6; margin-left: 4px; }

/* ---------- Выбор изделия ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.tile { border: 1px solid transparent; background: var(--bg); border-radius: 12px; padding: 10px 8px 9px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.tile:hover { border-color: var(--line-strong); }
.tile.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.tile svg { width: 64px; height: 56px; }
.tile svg .gb, .tile svg .gi, .tile svg .gpaper, .tile svg .gbtn { stroke-width: 1.1px; vector-effect: non-scaling-stroke; stroke: var(--text-2); }
.tile svg .gl, .tile svg .gd { stroke-width: .8px; vector-effect: non-scaling-stroke; stroke: var(--text-2); }
.tile svg .gst, .tile svg .gf, .tile svg .grib, .tile svg .ghi, .tile svg .glabel { display: none; }
.tile svg .gbody { filter: none; }
.tile.on svg .gb, .tile.on svg .gi { stroke: var(--text); }
.tile-name { font-size: 12.5px; font-weight: 500; line-height: 1.25; }
.tile-sku { font-size: 10.5px; color: var(--text-3); letter-spacing: .02em; }
.group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 14px 0 8px; }
.group-label:first-child { margin-top: 0; }
.swatches { display: flex; gap: 8px; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong); padding: 0; }
.sw.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary); }

/* ---------- Чертёж изделия ---------- */
.stage { display: grid; gap: 16px; }
.stage.v2 { grid-template-columns: 1fr 1fr; }
.view { background: var(--canvas); border-radius: 12px; padding: 12px; border: 1px solid var(--line); }
.view-title { font-size: 12px; color: var(--text-2); display: flex; justify-content: space-between; margin-bottom: 6px; }
.view svg.garment { width: 100%; height: auto; max-height: 420px; overflow: visible; display: block; margin: 0 auto; }
.stage:not(.v2) .view svg.garment { max-height: 360px; }
.gb { fill: var(--g-fill); stroke: var(--garment-line); stroke-width: 1.8; stroke-linejoin: round; }
.gi { fill: var(--g-inner); stroke: var(--garment-line); stroke-width: 1.6; stroke-linejoin: round; }
.gl { fill: none; stroke: var(--garment-line); stroke-width: 1.3; stroke-linecap: round; opacity: .7; }
.gd { fill: none; stroke: var(--garment-line); stroke-width: 1.4; stroke-dasharray: 5 6; opacity: .55; }
/* Слои чертежа: тень, блик, резинка, отстрочка, складка, фурнитура */
.gsh { stroke: none; pointer-events: none; opacity: var(--g-sh, 1); }
.ghi { stroke: none; pointer-events: none; opacity: var(--g-hi, .4); }
.ghi2 { stroke: none; pointer-events: none; opacity: .85; }
.grib { fill: none; stroke: var(--g-rib, rgba(0, 0, 0, .1)); stroke-dasharray: 1.3 3.2; pointer-events: none; }
.gst { fill: none; stroke: var(--garment-line); stroke-width: 1.05; stroke-dasharray: 3.5 3; opacity: .5; stroke-linecap: round; pointer-events: none; }
.gf { fill: none; stroke: var(--g-fold, rgba(0, 0, 0, .05)); stroke-width: 9; stroke-linecap: round; pointer-events: none; }
.glabel { fill: #FAFAF7; stroke: var(--garment-line); stroke-width: .8; opacity: .9; }
.gbtn { fill: #F4F2EC; stroke: var(--garment-line); stroke-width: 1.2; }
.gmetal { fill: #C9CDD3; stroke: #7D838C; stroke-width: 1; }
.gmetalv { fill: url(#metalV); stroke: #7D838C; stroke-width: 1; }
.gpaper { fill: #F5F2EA; stroke: var(--garment-line); stroke-width: 1.4; }
.gcord-o { fill: none; stroke: var(--garment-line); stroke-width: 7; stroke-linecap: round; }
.gcord { fill: none; stroke: var(--g-fill); stroke-width: 4.6; stroke-linecap: round; }
.gaglet { fill: none; stroke: #9FA5AD; stroke-width: 6.5; stroke-linecap: round; }
.gloop { fill: none; stroke: var(--garment-line); stroke-width: 9; stroke-linecap: round; opacity: .85; }
/* Цвета зон и принтов не зависят от темы: они лежат на изделии, а изделие бывает белым и чёрным */
.zone rect.zf { fill: transparent; stroke: #6F7FE6; stroke-width: 1.4; stroke-dasharray: 5 5; opacity: .45; vector-effect: non-scaling-stroke; }
.zone { cursor: pointer; }
.zone:hover rect.zf { opacity: 1; fill: rgba(111, 127, 230, .14); }
.zone .zplus { fill: #5E6FD8; opacity: 0; transition: opacity .15s; }
.zone:hover .zplus { opacity: 1; }
.zone.has rect.zf { opacity: 0; }
.zone.has:hover rect.zf, .zone.sel rect.zf { opacity: .8; fill: transparent; }
.print rect.pf { fill: var(--print-fill); stroke: #5E6FD8; stroke-width: 2; vector-effect: non-scaling-stroke; }
.print.sel rect.pf { stroke: #1C1C1C; stroke-width: 2.5; }
.print text { fill: #3B47A8; font-weight: 600; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.print.sel text { fill: #1C1C1C; }
html[data-theme="dark"] .print.sel rect.pf { stroke: #FFD24D; }
.print.over rect.pf { stroke: var(--danger); fill: rgba(217, 54, 62, .12); }
.stage-help { font-size: 12px; color: var(--text-3); margin-top: 10px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.legend .lz { border: 1.5px dashed var(--accent-strong); opacity: .7; }
.legend .lp { background: var(--accent-soft); border: 1.5px solid var(--accent-strong); }

/* ---------- Список нанесений ---------- */
.prints { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.pr { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 12px; }
.pr.sel { border-color: var(--primary); }
.pr-head { display: flex; align-items: center; gap: 10px; }
.pr-dot { width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-strong); font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.pr-title { font-weight: 600; }
.pr-sub { color: var(--text-3); font-size: 12px; }
.pr-price { margin-left: auto; text-align: right; }
.pr-price b { font-size: 15px; }
.pr-price div { font-size: 11.5px; color: var(--text-3); }
.pr-grid { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.pr-detail { font-size: 12px; color: var(--text-2); }
.pr-warn { font-size: 12px; color: var(--danger); }
.empty { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 18px; text-align: center; color: var(--text-3); font-size: 13px; }
.filelabel { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px dashed var(--line-strong); border-radius: 8px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.filelabel:hover { color: var(--text); border-color: var(--text-3); }
.filelabel input { display: none; }

/* ---------- Места поставщика ---------- */
.item-head { display: flex; gap: 14px; align-items: flex-start; background: var(--bg); border-radius: 12px; padding: 14px; border: 1px solid var(--line); }
.item-head .meta { color: var(--text-2); font-size: 12.5px; }
.item-head .name { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; background: var(--purple); color: #1C1C1C; }
.badge.blue { background: var(--blue); }
.badge.mint { background: var(--mint); }
.badge.yellow { background: var(--yellow); }
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.place { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; grid-template-columns: 92px 1fr; gap: 12px 14px; align-content: start; }
.place.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.place-fig { grid-row: span 2; width: 92px; height: 92px; border-radius: 10px; background: var(--bg-soft); display: grid; place-items: center; }
.place-fig rect.max { fill: none; stroke: var(--accent-strong); stroke-dasharray: 4 3; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.place-fig rect.cur { fill: var(--accent-soft); stroke: var(--accent-strong); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.place-fig.on-drawing { background: var(--canvas); border: 1px solid var(--line); }
.place-fig svg.mini { width: 84px; height: 84px; }
.pr.has-fig { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: start; }
.pr.has-fig .place-fig { grid-row: auto; }
.pr.has-fig:has(.place-fig.wide) { grid-template-columns: 1fr; }
.pr-main { min-width: 0; }
.place:has(.place-fig.wide) { grid-template-columns: 1fr; gap: 8px; align-content: start; }
.place-fig.wide { grid-row: auto; grid-column: 1 / -1; width: 100%; height: 64px; order: -1; }
.place-fig.wide svg.mini { width: calc(100% - 16px); height: 56px; }
.place-fig svg.mini .gb, .place-fig svg.mini .gi, .place-fig svg.mini .gpaper { stroke-width: 1px; vector-effect: non-scaling-stroke; }
.place-fig svg.mini .gl, .place-fig svg.mini .gd { stroke-width: .7px; vector-effect: non-scaling-stroke; }
.place-fig svg.mini .gst, .place-fig svg.mini .gf, .place-fig svg.mini .grib { display: none; }
.place-fig svg.mini .gbody { filter: none; }
.area rect.af { fill: rgba(111, 127, 230, .10); stroke: #6F7FE6; stroke-width: 1.2; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; }
.view svg.garment .area rect.af { stroke-dasharray: 5 5; }
.place-name { font-weight: 600; font-size: 13px; line-height: 1.3; }
.place-name .pr-dot.sm { display: inline-grid; width: 18px; height: 18px; font-size: 10px; margin-right: 6px; vertical-align: 1px; }
.place-sub { font-size: 12px; color: var(--text-3); }
.place-body { grid-column: 1 / -1; display: grid; gap: 10px; }
.place-res { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 10px; }
.place-res b { color: var(--text); font-size: 14px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; user-select: none; }
.toggle input { width: 16px; height: 16px; accent-color: var(--primary); }

/* ---------- Итог ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi { border-radius: var(--radius); padding: 16px; color: #1C1C1C; }
.kpi.blue { background: var(--blue); }
.kpi.purple { background: var(--purple); }
.kpi-label { font-size: 12.5px; font-weight: 500; margin-bottom: 8px; }
.kpi-val { font-size: 22px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; }
.kpi-sub { font-size: 11.5px; color: rgba(28, 28, 28, .55); margin-top: 6px; }
.kpi.big { grid-column: 1 / -1; }
.kpi.big .kpi-val { font-size: 30px; }
.sum { background: var(--card); border-radius: var(--radius); padding: 16px; }
.sum-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; display: flex; justify-content: space-between; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: right; font-weight: 500; color: var(--text-3); padding: 0 0 8px; font-size: 11.5px; }
.tbl th:first-child { text-align: left; }
.tbl td { padding: 7px 0 7px 8px; border-top: 1px solid var(--line); text-align: right; vertical-align: top; white-space: nowrap; }
.tbl td:first-child { white-space: normal; }
.tbl td:first-child { text-align: left; padding-left: 0; padding-right: 8px; color: var(--text-2); }
.tbl tr.total td { font-weight: 600; color: var(--text); }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 5px 0; }
.kv span:first-child { color: var(--text-2); }
.warns { display: flex; flex-direction: column; gap: 8px; }
.warn { background: var(--yellow); color: #5C4100; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.4; }
html[data-theme="dark"] .warn { background: rgba(245, 196, 81, .14); color: var(--warn-text); }
.note { font-size: 12px; color: var(--text-3); line-height: 1.45; }
.summary-empty { background: var(--purple); }
.summary-empty .kpi-val { font-size: 28px; color: var(--text-3); margin-bottom: 10px; }

/* ---------- Клиент в расчёте ---------- */
.calc-no { font-weight: 600; font-variant-numeric: tabular-nums; }
.client-box { display: flex; align-items: center; gap: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.cb-avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--purple); color: #1C1C1C; display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; }
.cb-avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 11.5px; }
.cb-avatar.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 18px; }
.cb-main { flex: 1; min-width: 0; }
.cb-name { font-weight: 600; font-size: 15px; }
.cb-meta { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.cb-meta.muted { color: var(--text-3); }
.cb-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.newcl { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.input.mid2 { width: 150px; }
.pick-list { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pick-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 6px 12px 6px 6px; text-align: left; max-width: 280px; }
.pick-item:hover { border-color: var(--line-strong); }
.pick-text { min-width: 0; display: flex; flex-direction: column; }
.pick-text b { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-text small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-hint { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; width: 100%; }
.pick-empty { font-size: 12.5px; color: var(--text-3); }

/* ---------- Нанесение шагами: место → способ → код ---------- */
.steps { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.step-row { display: grid; grid-template-columns: 116px 1fr; gap: 12px; align-items: start; }
.step-label { font-size: 12px; color: var(--text-2); padding-top: 7px; }
.step-body { min-width: 0; }
.chip-input { height: 30px; width: 150px; border-radius: 15px; font-size: 13px; }
.code-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.code-row + .code-row { margin-top: 6px; }
.code-name { font-size: 12px; color: var(--text-3); min-width: 150px; }
.chip.code { height: auto; min-height: 30px; padding: 4px 12px; display: inline-flex; flex-direction: column; align-items: flex-start; border-radius: 10px; line-height: 1.2; }
.chip.code b { font-weight: 600; font-size: 13px; }
.chip.code small { margin: 0; font-size: 11px; }
.pr-main .pr-head { align-items: flex-start; }

/* ---------- Реестр, клиенты ---------- */
.page { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 24px; max-width: 1180px; }
.page.wide-page { max-width: 1440px; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.tbl-wrap { overflow-x: auto; }
.stbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.stbl th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px; padding: 0 8px 8px 0; }
.stbl td { padding: 6px 8px 6px 0; border-top: 1px solid var(--line); }
.stbl .input { height: 32px; }
.reg-tbl td { padding: 10px 12px 10px 0; vertical-align: middle; }
.reg-tbl th { padding-right: 12px; }
.reg-tbl .num { text-align: right; }
.reg-tbl th:nth-last-child(-n+4) { text-align: right; }
.reg-tbl th:nth-last-child(2), .reg-tbl th:last-child { text-align: left; }
.reg-tbl.team-tbl th { text-align: left; }
.rowlink { cursor: pointer; }
.rowlink:hover td { background: var(--bg-hover); }
.rowlink td:first-child { padding-left: 8px; border-radius: 8px 0 0 8px; }
.nowrap { white-space: nowrap; }
.cell-client { display: flex; align-items: center; gap: 10px; }
.client-head { display: flex; align-items: center; gap: 14px; }
.client-title { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.client-actions { margin-left: auto; display: flex; gap: 8px; }
.contact-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px 0; border-top: 1px solid var(--line); }
.card-head + .contact-row { border-top: 0; padding-top: 0; }
.contact-row .pr-dot { margin-bottom: 7px; }
.input.area { height: auto; padding: 8px 10px; width: 100%; resize: vertical; line-height: 1.4; }
.btn.link.danger { color: var(--danger); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--primary); color: var(--on-primary); padding: 10px 16px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .calc { grid-template-columns: 1fr; }
  .aside { position: static; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .reg-list { max-height: 260px; }
  .step-row { grid-template-columns: 1fr; gap: 4px; }
  .step-label { padding-top: 0; }
}
@media (max-width: 560px) {
  .stage.v2 { grid-template-columns: 1fr; }
  .client-box { flex-wrap: wrap; }
}
