[hidden] { display: none !important; }
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #dbeafe;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; font-weight: 650; }
h2 { font-size: 17px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 16px; margin: 0; font-weight: 650; }
h4 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.loading, .empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Каркас ---------- */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; transition: grid-template-columns .2s; }
.sidebar { background: #0f172a; color: #cbd5e1; display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: block; padding: 6px 0 4px; margin: 0 0 18px; text-align: center; }
.brand:hover { text-decoration: none; opacity: .9; }
/* Логотип на прозрачном фоне с белой обводкой (на 20% меньше прежних 168px) */
.brand img { display: block; width: 134px; max-width: 100%; height: auto; margin: 0 auto;
  filter: drop-shadow(1.5px 0 0 #fff) drop-shadow(-1.5px 0 0 #fff) drop-shadow(0 1.5px 0 #fff) drop-shadow(0 -1.5px 0 #fff); }
.brand small { display: block; margin-top: 8px; color: #94a3b8; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { color: #cbd5e1; padding: 9px 12px; border-radius: 6px; font-weight: 500; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.sidebar nav a:hover { background: #1e293b; text-decoration: none; color: #fff; }
.sidebar nav a.active { background: var(--primary); color: #fff; }
.me { margin-top: auto; border-top: 1px solid #1e293b; padding: 12px 8px 0; display: flex; flex-direction: column; gap: 4px; }
.me b { display: block; color: #fff; }
.me small { color: #94a3b8; }
.me .link { color: #94a3b8; text-align: left; padding: 2px 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.me .link:hover { color: #fff; }
.main { padding: 24px 28px 60px; min-width: 0; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 small { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { min-width: 260px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { display: block; font-size: 22px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat.danger b { color: var(--danger); }
a.stat:hover { text-decoration: none; border-color: var(--primary); }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- Кнопки и поля ---------- */
button { font: inherit; cursor: pointer; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: #94a3b8; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.link { background: none; border: 0; padding: 0; color: var(--primary); }
.link:hover { text-decoration: underline; }
.link-danger { color: var(--danger); }
.icon-btn { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--muted); padding: 2px 6px; border-radius: 4px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

input, select, textarea { font: inherit; color: inherit; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
textarea { resize: vertical; }
input[type=checkbox] { width: 16px; height: 16px; padding: 0; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; grid-column: span 2; }
.field.half { grid-column: span 1; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.field small { color: var(--muted); font-size: 12px; }
.field-check { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; }
.form-section { grid-column: span 2; margin: 8px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.form-error { color: var(--danger); margin-top: 10px; min-height: 0; }
.form-error:empty { display: none; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card .table-wrap { border: 0; border-radius: 0; margin: 0 -18px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table.clickable tbody tr { cursor: pointer; }
.table.clickable tbody tr:hover { background: #f1f5f9; }
.table td.num, .table th.num { text-align: right; }
.table tfoot td { font-weight: 650; background: var(--surface-2); }
tr.row-warn td { background: var(--warn-soft); }
tr.row-danger td { background: var(--danger-soft); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e2e8f0; color: #334155; white-space: nowrap; }
.st-new { background: #e0e7ff; color: #3730a3; }
.st-measure { background: #fae8ff; color: #86198f; }
.st-approved { background: #cffafe; color: #155e75; }
.st-production { background: var(--warn-soft); color: var(--warn); }
.st-ready { background: var(--ok-soft); color: var(--ok); }
.st-installed { background: #d1fae5; color: #065f46; }
.st-done { background: #e2e8f0; color: #475569; }
.st-cancelled { background: var(--danger-soft); color: var(--danger); }
.pos { color: var(--ok); }
.neg { color: var(--danger); }
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }
.alert-warn { background: var(--warn-soft); color: #78350f; }
.alert-err { background: var(--danger-soft); color: #7f1d1d; }
.alert-ok { background: var(--ok-soft); color: #14532d; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; color: var(--muted); font-weight: 500; margin-bottom: -1px; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Модальные окна и уведомления ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 10px; width: 100%; max-width: 520px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal-wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px; }
.modal-body p { margin-top: 0; }
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { padding: 10px 16px; border-radius: 6px; color: #fff; background: #0f172a; box-shadow: var(--shadow); transition: opacity .4s; max-width: 380px; }
.toast-err { background: var(--danger); }
.toast.hide { opacity: 0; }

/* ---------- Вход ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, #0f172a, #1e3a8a); }
.login { width: 100%; max-width: 360px; }
.login-logo { display: block; width: 220px; max-width: 100%; height: auto; margin: 4px auto 14px; }
.login p { margin: 0 0 18px; color: var(--muted); text-align: center; }
.print-logo { display: block; height: 46px; width: auto; margin-left: auto; }

/* ---------- Конструктор ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.canvas { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.canvas svg { width: 100%; height: auto; max-height: calc(100vh - 230px); display: block; user-select: none; }
.panel { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 16px; max-height: calc(100vh - 32px); min-height: 0; }
.panel-tabs { display: grid; grid-template-columns: repeat(6, auto); gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); flex: 0 0 auto; }
.panel-tabs button { background: none; border: 0; border-radius: 6px; padding: 7px 2px; font-weight: 600; font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.2; }
.panel-tabs button:hover { background: var(--surface-2); color: var(--text); }
.panel-tabs button.active { background: var(--primary); color: #fff; }
.panel-tabs button small { font-size: 11px; font-weight: 500; white-space: nowrap; opacity: .85; }
.panel-tabs button.has-error:not(.active) { color: var(--danger); }
.panel-tabs button.active small.neg { color: #fff; }
.panel-body { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; padding-bottom: 2px; }
.panel .card { padding: 12px 14px; }
.panel .card + .card { margin-top: 0; }
.panel h4 { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; margin-bottom: 8px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.row > .btn, .row > .shrink { flex: 0 0 auto; }
.mini-label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 3px; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.btn-grid .btn { justify-content: center; }
.templates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.templates button { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.templates button:hover { border-color: var(--primary); color: var(--primary); }
.templates svg { width: 100%; height: 44px; }
.opens { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.split-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.split-btns .btn { justify-content: center; padding: 4px 2px; }
.main:has(.editor) { padding-bottom: 16px; }
.opens button { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px; }
.opens button.active { border-color: var(--primary); background: var(--primary-soft); }
.opens svg { width: 100%; height: 34px; display: block; }
.sizes { display: flex; flex-direction: column; gap: 6px; }
.price-box { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.calc-list { font-size: 13px; }
.calc-list table { width: 100%; border-collapse: collapse; }
.calc-list td { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.calc-list td:last-child { text-align: right; white-space: nowrap; }

/* SVG чертёж */
.d-frame { fill: #f1f5f9; stroke: #334155; stroke-width: 2; }
/* Сворачиваемые карточки панели конструктора */
.foldable > h4 { cursor: pointer; user-select: none; display: flex; align-items: center; justify-content: flex-start; }
.foldable > h4 > span { margin-left: auto; }
.foldable > h4::before { content: ''; display: inline-block; width: 7px; height: 7px; margin: 0 8px 2px 1px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; opacity: .6; }
.foldable.folded > h4::before { transform: rotate(-45deg); }
.foldable.folded > h4 { margin-bottom: 0; }
.foldable.folded > :not(h4) { display: none !important; }
.swatch-metal { background-image: linear-gradient(135deg, rgba(255,255,255,.55), rgba(255,255,255,0) 45%, rgba(0,0,0,.18)) !important; }
.d-sill rect { stroke: #334155; stroke-width: 2; }
.d-sill-text { text-anchor: middle; font-weight: 600; }
.d-impost { fill: #e2e8f0; stroke: #334155; stroke-width: 1.5; }
.d-sash { fill: #f8fafc; stroke: #334155; stroke-width: 1.5; }
.d-glass { fill: #dbeafe; stroke: #64748b; stroke-width: 1; }
.d-panel { fill: #e5e7eb; stroke: #64748b; stroke-width: 1; }
.d-open { fill: none; stroke: #475569; stroke-width: 1.4; stroke-dasharray: 10 6; }
.d-handle { fill: #334155; stroke: #1e293b; }
.d-cell { fill: transparent; cursor: pointer; }
.d-cell:hover { fill: rgba(29, 78, 216, .08); }
.d-cell.sel { fill: transparent; }
.d-sel { fill: rgba(29, 78, 216, .14); stroke: var(--primary); stroke-width: 6; pointer-events: none; }
.d-dim { stroke: #64748b; stroke-width: 1; fill: none; }
.d-dim-text { fill: #0f172a; font: 600 34px var(--font); text-anchor: middle; }
.d-dim-text.small { font-size: 28px; font-weight: 500; fill: #334155; }
.d-label { fill: #475569; font: 500 28px var(--font); text-anchor: middle; }
.thumb { width: 96px; height: 72px; display: block; }
.thumb svg { width: 100%; height: 100%; }

/* Раскрой */
.bars { display: flex; flex-direction: column; gap: 4px; }
.bar { display: flex; height: 26px; border: 1px solid var(--line-strong); border-radius: 3px; overflow: hidden; background: repeating-linear-gradient(45deg, #f1f5f9 0 6px, #e2e8f0 6px 12px); font-size: 11px; }
.bar > div { background: #bfdbfe; border-right: 2px solid #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; color: #1e3a8a; font-weight: 600; }
.bar > div:nth-child(even) { background: #93c5fd; }
.bar-over > div { background: var(--danger-soft); color: var(--danger); }

@media (max-width: 1100px) {
  .editor, .cols { grid-template-columns: 1fr; }
  .panel { position: static; max-height: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app, .app.nav-min { grid-template-columns: 1fr; }
  .nav-toggle { display: none !important; }
  .sidebar { position: static; height: auto; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .brand { max-width: 200px; }
  .me { flex-direction: row; flex-wrap: wrap; gap: 12px; align-items: center; }
  .main { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field, .field.half { grid-column: span 1; }
}

/* ---------- Печать ---------- */
.print-page { background: #fff; max-width: 1000px; margin: 0 auto; padding: 24px; }
.print-page .table-wrap { border: 0; }
.print-page .table th, .print-page .table td { padding: 5px 8px; font-size: 12px; }
.print-item { display: grid; grid-template-columns: 260px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.print-item svg { width: 100%; height: auto; }
.print-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--text); padding-bottom: 10px; margin-bottom: 14px; }
.print-section { margin-top: 20px; break-inside: avoid-page; }
.print-bar-toolbar { position: sticky; top: 0; background: var(--bg); padding: 10px 24px; display: flex; gap: 8px; justify-content: center; border-bottom: 1px solid var(--line); }
@media print {
  body { background: #fff; }
  .no-print, .print-bar-toolbar { display: none !important; }
  .print-page { padding: 0; max-width: none; }
  .d-cell.sel { fill: transparent; stroke: none; }
  .d-sel { display: none; }
}
.bar, .bar > div, .d-glass, .d-sill rect, .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.row input, .row select { width: 100%; }

/* Несколько изделий в разделе «Чертёж» */
.draft-bar { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; }
.draft-tabs { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; flex: 1; }
.draft-tab { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; }
.draft-tab.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--primary-soft); }
.draft-tab.has-error { border-color: var(--danger); }
.draft-tab-main { background: none; border: 0; padding: 6px 12px; text-align: left; display: flex; flex-direction: column; }
.draft-tab-main small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.draft-tab-actions { display: flex; padding-right: 4px; }
.draft-tab-actions .icon-btn { font-size: 18px; }
.draft-add { border-style: dashed; }
.draft-right { display: flex; align-items: flex-end; gap: 16px; }
.undo-bar { display: inline-flex; gap: 6px; }
.undo-bar .btn { display: inline-flex; align-items: center; gap: 5px; }
.undo-bar .ico { width: 16px; height: 16px; display: inline-flex; }
.undo-bar .ico svg { width: 100%; height: 100%; }
.draft-total { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 16px; white-space: nowrap; }

/* Цвет профиля */
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.swatch { aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--line-strong); background-size: cover; background-position: center; padding: 0; }
.swatch:hover { border-color: var(--primary); }
.swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--primary); }
.swatch-other { background: conic-gradient(#ef4444, #f59e0b, #22c55e, #3b82f6, #a855f7, #ef4444); }

/* Шотланки */
.bar-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.bar-presets button { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px; }
.bar-presets button:hover { border-color: var(--primary); }
.bar-presets button.active { border-color: var(--primary); background: var(--primary-soft); }
.bar-presets svg { width: 100%; height: 24px; display: block; }

.d-bar-hit { pointer-events: stroke; }
.d-bar-hit-v { cursor: ew-resize; }
.d-bar-hit-h { cursor: ns-resize; }
.d-bar-hit:hover { stroke: rgba(29, 78, 216, .25); }
.canvas.dragging, .canvas.dragging * { cursor: grabbing !important; }

.bar-pos-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.bar-pos-row > span { flex: 0 0 46px; font-size: 12px; }
.bar-pos { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 4px; flex: 1; }
.bar-pos input { width: 100%; padding: 4px 6px; }

.bar-count { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.bar-count input { width: 56px; padding: 4px 6px; }
.bar-count span + input { margin-right: 8px; }
.bar-btns { display: flex; gap: 6px; margin-top: 8px; }
.bar-btns .btn { flex: 1; justify-content: center; padding: 4px 6px; }

/* Правка размеров прямо на чертеже */
.canvas { position: relative; }
.d-dim-hit { fill: transparent; }
.d-dim-edit { cursor: pointer; }
.d-dim-edit:hover .d-dim-hit { fill: rgba(29, 78, 216, .1); }
.d-dim-edit:hover .d-dim-text { fill: var(--primary); }
.dim-input { position: absolute; z-index: 5; width: 92px; padding: 4px 6px; font: 600 15px var(--font); text-align: center;
  border: 2px solid var(--primary); border-radius: 6px; box-shadow: 0 4px 14px rgba(15, 23, 42, .2); }
.dim-hint { position: absolute; z-index: 5; font-size: 11px; color: var(--muted); background: var(--surface); padding: 1px 6px; border-radius: 4px; white-space: nowrap; }

/* Палитра RAL для «Другой цвет» */
.ral { margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.ral-grid { grid-template-columns: repeat(12, 1fr); gap: 5px; }
.ral-grid .swatch { border-width: 1px; }
.swatch-pick { position: relative; cursor: pointer; display: block; overflow: hidden;
  background: conic-gradient(#ef4444, #f59e0b, #22c55e, #3b82f6, #a855f7, #ef4444); }
.swatch-pick::after { content: '+'; position: absolute; inset: 0; display: grid; place-items: center; font: 700 13px/1 var(--font); color: #fff; text-shadow: 0 0 2px #000; }
.swatch-pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }

/* Цвет стекла */
.swatches.tints { grid-template-columns: repeat(8, 1fr); gap: 5px; }
.swatch.tint-mirror { background-image: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.85) 50%, transparent 60%); }
.swatch.tint-matte { background-image: repeating-linear-gradient(45deg, rgba(148,163,184,.35) 0 2px, transparent 2px 5px); }
.tints .swatch { aspect-ratio: auto; height: 22px; border-radius: 6px; }
.h4-split { display: flex; justify-content: space-between; gap: 8px; }
.h4-split span { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text); white-space: nowrap; }

/* Москитная сетка */
.d-net { pointer-events: none; }
.net-colors { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; }
.net-colors .swatch { width: 24px; flex: 0 0 24px; }
.net-colors b { font-weight: 600; margin-left: 4px; }

/* Иконки и сворачиваемое меню */
.ico { display: inline-flex; flex: 0 0 20px; width: 20px; height: 20px; }
.ico svg { width: 100%; height: 100%; }
.me .ico { flex-basis: 16px; width: 16px; height: 16px; }
.brand-mini { display: none !important; }
.nav-toggle { margin-top: 6px; }
.app.nav-min { grid-template-columns: 64px 1fr; }
.nav-min .sidebar { padding: 16px 8px; }
.nav-min .brand-full, .nav-min .brand small, .nav-min .sidebar nav a span:not(.ico), .nav-min .me span:not(.ico), .nav-min .me-name { display: none !important; }
.nav-min .brand-mini { display: block !important; width: 34px; margin: 0 auto; filter: none; }
.nav-min .sidebar nav a { justify-content: center; padding: 10px 0; }
.nav-min .me { padding: 12px 0 0; align-items: center; }
.nav-min .me .link { justify-content: center; padding: 6px 0; }
.nav-min .me .ico { flex-basis: 20px; width: 20px; height: 20px; }
.nav-min .nav-toggle svg { transform: scaleX(-1); }

/* 3D-просмотр */
.canvas-3d { position: absolute; top: 10px; right: 10px; z-index: 4; background: var(--surface); box-shadow: var(--shadow); }
.p3d { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; padding: 3vh 3vw; }
.p3d-box { background: var(--surface); border-radius: 12px; width: 100%; height: 100%; max-width: 1400px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.p3d-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.p3d-actions { display: flex; gap: 6px; }
.p3d-canvas { flex: 1; min-height: 0; position: relative; cursor: grab; }
.p3d-canvas:active { cursor: grabbing; }
.p3d-canvas canvas { display: block; width: 100% !important; height: 100% !important; }
.p3d-hint { padding: 6px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); text-align: center; }
@media print { .canvas-3d { display: none; } }
.size-row > div { flex: 1; min-width: 0; }
.size-row select, .size-row input { width: 100%; }

/* Стороны многоугольника */
table.sides { width: 100%; border-collapse: collapse; font-size: 13px; }
table.sides td, table.sides th { padding: 3px 4px; text-align: left; font-weight: 400; }
table.sides th { color: var(--muted); font-size: 12px; }
table.sides td:first-child { width: 34px; white-space: nowrap; }
table.sides input { width: 84px; padding: 4px 6px; }
.vtx-details { margin-top: 8px; }
.vtx-details summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.card .hint { font-size: 12px; margin: 8px 0 0; }
.d-vtx { fill: #fff; stroke: #2563eb; cursor: move; }
.d-vtx:hover { fill: #2563eb; }
.d-vtx-num { fill: #2563eb; font-weight: 700; text-anchor: middle; pointer-events: none; }
.d-vtx-ghost { fill: rgba(37, 99, 235, .08); stroke: #2563eb; stroke-width: 6; stroke-dasharray: 24 14; pointer-events: none; }
@media print { .d-vtx, .d-vtx-num { display: none; } }

/* Чертёж: клиент в шапке — имя, ниже адрес и контакты */
.draw-head { display: flex; align-items: flex-start; gap: 18px; min-width: 0; }
.draw-head h1 { margin: 0; }
.draw-client { display: flex; flex-direction: column; gap: 1px; padding-top: 2px; font-size: 13px; line-height: 1.35; min-width: 0; }
.draw-client-name { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.draw-client-name > a { font-size: 16px; font-weight: 700; color: var(--text); }
.draw-client-name > a:hover { color: var(--accent, #2563eb); }
.draw-client-line { color: var(--muted); }
.draw-client-line a { color: inherit; }
.draw-head { flex-direction: column; gap: 6px; }
.draw-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.draw-title { width: min(420px, 100%); font-size: 14px; }
.draw-hint { font-size: 12px; }
.draft-title { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.client-num { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 8px; }
.draw-status { font-size: 12px; color: #16a34a; }
.draw-status.err { color: #dc2626; }
.pick-title { margin: 6px 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

/* Иконки действий в таблице склада */
.act-row { display: flex; gap: 4px; justify-content: flex-end; }
.act-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid transparent; border-radius: 8px; background: none; color: #64748b; cursor: pointer; }
.act-btn svg { width: 19px; height: 19px; }
.act-btn:hover, .act-btn:focus-visible { background: #f1f5f9; border-color: var(--line); }
.act-in:hover { color: #16a34a; }
.act-out:hover { color: #dc2626; }
.act-adjust:hover, .act-history:hover, .act-edit:hover { color: #2563eb; }

/* Карточка клиента: заказы строками — чертежи слева, описание справа */
.order-rows { display: flex; flex-direction: column; gap: 10px; }
.order-row { display: grid; grid-template-columns: minmax(0, 46%) minmax(0, 1fr) 32px; gap: 16px; padding: 12px; border: 1px solid var(--line);
  border-radius: 10px; color: inherit; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.order-row.picked { border-color: #2563eb; background: #f8fbff; }
.order-left { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.order-date { font-size: 12px; color: var(--muted); }
.order-sum { display: flex; align-items: baseline; gap: 6px 8px; flex-wrap: wrap; font-size: 15px; }
.order-sum .muted { font-size: 13px; }
.order-sum .neg { font-size: 12px; }
.order-num { font-size: 16px; }
.order-side { display: flex; flex-direction: column; align-items: center; gap: 6px; align-self: start; cursor: default; }
.order-check { display: flex; align-items: center; justify-content: center; width: 32px; height: 28px; cursor: pointer; }
.act-pdf:hover { color: #dc2626; }
.act-btn.busy { opacity: .5; cursor: progress; animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .2; } }
.order-check input { width: 18px; height: 18px; cursor: pointer; }
.order-row:hover { border-color: #93c5fd; box-shadow: 0 2px 10px rgba(37, 99, 235, .08); }
.order-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; align-content: start; }
.order-thumb { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border-radius: 8px; background: #f8fafc; min-height: 96px; }
.order-thumb-svg { width: 100%; height: 92px; }
.order-thumb-svg svg { width: 100%; height: 100%; display: block; }
.order-thumb small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.order-thumb.more { justify-content: center; font-size: 18px; font-weight: 700; color: var(--muted); }
.order-thumb.empty { justify-content: center; font-size: 12px; }
.order-info { min-width: 0; font-size: 13px; }
.order-info-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 6px; font-size: 14px; }
.order-info-sum { text-align: right; white-space: nowrap; }
.order-info-sum .neg { font-size: 12px; }
.order-addr { margin: -2px 0 6px; }
.kv-tight { grid-template-columns: 118px 1fr; gap: 3px 10px; }
.badge-draft { background: #fef3c7; color: #92400e; }

/* Вкладки внутри карточки */
.card-tabs { display: flex; gap: 4px; margin: -4px 0 14px; border-bottom: 1px solid var(--line); }
.card-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 10px 8px; margin-bottom: -1px;
  font: inherit; font-weight: 650; font-size: 15px; color: var(--muted); cursor: pointer; }
.card-tabs button.active { color: var(--text); border-bottom-color: #2563eb; }
.pay-list { display: flex; flex-direction: column; }
.pay-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.pay-item b { white-space: nowrap; }
.pay-total { display: flex; justify-content: space-between; padding-top: 10px; }
@media (max-width: 760px) { .order-row { grid-template-columns: 1fr; } }
.act-delete:hover { color: #dc2626; }
.stat small { display: block; margin-top: 4px; font-size: 12px; }
.draw-num { font-size: 13px; font-weight: 700; color: var(--muted); }

/* Карточка клиента: промежутки между блоками в 3 раза меньше обычных */
.client-page .grid { gap: 5px; margin-bottom: 5px; }
.client-page .cols { gap: 5px; }
.client-page .order-rows { gap: 3px; }
@media (max-width: 760px) { .order-row { grid-template-columns: 1fr 32px; } .order-row .order-info { grid-column: 1; } .order-row .order-side { grid-row: 1; grid-column: 2; } }
.client-page .cols > .card + .card { margin-top: 0; }
/* Номер — в колонке подписей, статус — в колонке значений, вровень с текстом под ним */
.order-info-head { display: grid; grid-template-columns: 118px 1fr; gap: 10px; justify-items: start; align-items: center; }
/* Лист для PDF рисуется вне экрана шириной А4 */
.pdf-holder { position: fixed; left: -10000px; top: 0; width: 760px; background: #fff; }
.pdf-holder .print-page { max-width: none; padding: 0; }

/* Строка заказа: номер и статус над чертежами, дата — внизу справа */
.order-left .order-info-head { display: flex; justify-content: flex-start; gap: 10px; align-items: center; margin: 0; }
.order-info { display: flex; flex-direction: column; }
.order-info .order-date { margin-top: auto; padding-top: 6px; text-align: right; }

/* Страница «посмотреть онлайн» для клиента (/v/ключ) */
.view-body { background: var(--bg, #f4f6fa); }
.view-page { max-width: 980px; margin: 0 auto; padding: 16px; }
.view-head { display: flex; align-items: center; gap: 18px; padding: 8px 0 14px; border-bottom: 2px solid #0f172a; margin-bottom: 12px; flex-wrap: wrap; }
.view-head h1 { margin: 0 0 2px; font-size: 24px; }
.view-head .muted { font-size: 14px; }
.view-logo { height: 46px; width: auto; display: block; }
.view-tip { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.view-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.view-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.view-item-head h2 { margin: 0; font-size: 18px; }
.view-item-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.view-drawing { display: block; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; cursor: zoom-in; }
.view-drawing svg { width: 100%; height: auto; max-height: 420px; display: block; }
.view-kv { grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; }
.view-empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 16px; }
.view-foot { margin: 18px 0 30px; text-align: center; font-size: 13px; color: var(--muted); }
.view-foot p { margin: 0 0 6px; }
@media (max-width: 700px) {
  .view-page { padding: 12px; }
  .view-item-body { grid-template-columns: 1fr; }
  .view-3d-btn { width: 100%; }
  .view-head h1 { font-size: 20px; }
  .view-logo { height: 38px; }
  .view-kv { grid-template-columns: 120px 1fr; }
}
/* 3D на телефоне — на весь экран */
@media (max-width: 700px) {
  .p3d { padding: 0; }
  .p3d-box { border-radius: 0; }
  .p3d-head { padding: 8px 10px; }
  .p3d-head b { font-size: 13px; }
  .p3d-actions { flex-wrap: wrap; }
  .p3d-canvas { touch-action: none; }
}

/* Окно «Поделиться» */
.share-body { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.share-qr { width: 168px; flex: 0 0 168px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.share-qr svg { width: 100%; height: auto; display: block; }
.share-actions { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 200px; }
.share-actions .btn { text-align: center; }
.share-views { font-size: 13px; }
.danger-link { color: var(--danger, #dc2626); align-self: flex-start; font-size: 13px; }
.act-share:hover { color: #2563eb; }

/* Категория клиента — цветная метка */
.cat-badge { background: color-mix(in srgb, var(--cat) 14%, #fff); color: var(--cat); border: 1px solid color-mix(in srgb, var(--cat) 35%, #fff); }
.client-title { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.client-title .badge { font-size: 13px; }

/* Шапка меню: логотип, фото сотрудника справа, ниже имя и роль */
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 4px 0; }
.side-top .brand { margin: 0; padding: 0; flex: 1; min-width: 0; text-align: left; }
.side-top .brand img.brand-full { width: 118px; margin: 0; }
.me-photo { flex: 0 0 auto; border-radius: 8px; line-height: 0; box-shadow: 0 0 0 2px #1e293b, 0 0 0 3px #334155; }
.me-photo:hover { box-shadow: 0 0 0 2px #1e293b, 0 0 0 3px var(--primary); }
.me-head { display: block; padding: 8px 4px 12px; margin-bottom: 12px; border-bottom: 1px solid #1e293b; text-align: left; }
.me-head:hover { text-decoration: none; }
.me-head b { display: block; color: #fff; font-size: 14px; line-height: 1.25; }
.me-head small { color: #94a3b8; font-size: 12px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; color: #fff; font-weight: 700; flex: 0 0 auto; vertical-align: middle; }
.nav-min .side-top { flex-direction: column; padding: 0; gap: 10px; }
.nav-min .side-top .brand { flex: none; }
.nav-min .me-photo .avatar { width: 34px !important; height: 34px !important; font-size: 13px !important; }
.nav-min .me-head { display: none; }
.me-photo .avatar { border-radius: 8px; } /* в меню фото квадратное */
.tabs a { padding: 8px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-grid > .card + .card { margin-top: 0; }
.settings-narrow { max-width: 860px; }
.contract-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.contract-editor { font: 13px/1.5 ui-monospace, Consolas, monospace; min-height: 420px; }
.ph-list { display: flex; flex-direction: column; gap: 4px; }
.ph-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 9px; cursor: pointer; font-size: 12px; color: var(--muted); }
.ph-item:hover { border-color: var(--primary); }
.ph-item code { color: var(--primary); font-size: 12px; font-weight: 600; }
.badge-ok { background: #dcfce7; color: #166534; }
.kv-section { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-weight: 600; }
/* Договор */
.contract { font-size: 13px; line-height: 1.45; color: #111; }
.contract p { margin: 0 0 6px; text-align: justify; }
.contract-h { text-align: center; font-size: 14px; margin: 14px 0 8px; }
.contract-h:first-child { font-size: 17px; margin-top: 0; }
.contract-city { display: flex; justify-content: space-between; margin: 0 0 12px; }
.contract-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 12px; }
.contract-table th, .contract-table td { border: 1px solid #555; padding: 4px 6px; vertical-align: top; }
.contract-table th { background: #f1f5f9; font-weight: 600; text-align: center; }
.contract-table .num { text-align: right; white-space: nowrap; }
.contract-req { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; break-inside: avoid; page-break-inside: avoid; }
.contract-req-name { font-weight: 700; margin: 4px 0; }
.contract-sign { margin-top: 18px; }
@media (max-width: 900px) { .contract-grid { grid-template-columns: 1fr; } }
.photo-block { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.photo-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.modal .photo-block { margin-bottom: 4px; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .side-top { justify-content: flex-start; } }

/* Главная: круговая диаграмма слева, статусы справа (2 × 4), одной высоты */
.dash-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: stretch; margin-bottom: 16px; }
.dash-chart { display: flex; flex-direction: column; margin: 0; }
.dash-chart .card-head { margin-bottom: 6px; }
.donut-tabs { margin: 0; }
.donut-box { flex: 1; display: flex; align-items: center; }
.donut { display: flex; align-items: center; gap: 18px; width: 100%; }
.donut-figure { position: relative; flex: 0 0 auto; width: 190px; height: 190px; }
.donut-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.donut-seg { stroke: var(--surface); stroke-width: 2; stroke-linejoin: round; transition: opacity .15s; }
.donut-seg.link { cursor: pointer; }
.donut-seg.dim { opacity: .28; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; padding: 0 52px; }
.donut-center b { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.donut-center span { font-size: 12px; color: var(--muted); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.donut-tip { position: absolute; z-index: 5; min-width: 150px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 7px 10px; font-size: 12px; pointer-events: none; white-space: nowrap; }
.donut-tip b { display: block; font-size: 13px; }
.donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.donut-leg { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 36px; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; color: var(--text); font-size: 13px; }
a.donut-leg:hover, .donut-leg.active { background: #f1f5f9; text-decoration: none; }
.donut-leg-name { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.donut-leg b { font-variant-numeric: tabular-nums; }
.donut-leg small { text-align: right; font-variant-numeric: tabular-nums; }
.dash-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--st, #9aa3ad); flex: 0 0 auto; }
.donut-empty { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 0; }
.donut-ring-empty { width: 150px; height: 150px; border-radius: 50%; border: 30px solid #eef1f4; }
.dash-status { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: 1fr 1fr; gap: 12px; }
.dash-st { display: flex; flex-direction: column; color: var(--text); border-top: 3px solid var(--st); min-width: 0; }
.dash-st:hover { text-decoration: none; border-color: var(--st); box-shadow: 0 0 0 1px var(--st), var(--shadow); }
.dash-st-name { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-st b { font-size: 26px; margin-top: 2px; }
.dash-st small { margin-top: auto; padding-top: 4px; font-size: 12px; line-height: 1.35; }
@media (max-width: 1100px) { .dash-top { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .dash-status { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; }
  .donut { flex-direction: column; }
}
.dash-bottom { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash-bottom > .card { margin: 0; min-width: 0; }
.dash-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 1100px) { .dash-bottom { grid-template-columns: 1fr; } }

/* Коммерческое предложение */
.offer { font-size: 14px; }
.offer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 12px; border-bottom: 2px solid #1e293b; margin-bottom: 18px; }
.offer-company { text-align: right; font-size: 12px; line-height: 1.5; color: #334155; }
.offer-company b { font-size: 14px; color: #111; }
.offer-title { margin: 0; font-size: 22px; text-align: center; }
.offer-sub { text-align: center; margin-bottom: 14px; }
.offer-to { margin-bottom: 12px; }
.offer-total { text-align: right; }
.offer-terms ul { margin: 6px 0 0; padding-left: 20px; }
.offer-terms h3 { margin: 0; font-size: 15px; }
.offer-sign { display: flex; justify-content: space-between; gap: 20px; margin-top: 36px; flex-wrap: wrap; }
/* Договор: ручная правка на листе */
.doc-note { max-width: 1000px; margin: 10px auto 0; padding: 8px 12px; border-radius: 8px; font-size: 13px; color: var(--muted); text-align: center; }
.doc-note.saved { background: #eff6ff; color: #1e40af; }
.doc-note.editing { background: var(--warn-soft); color: #78350f; }
.print-page[contenteditable="true"] { outline: 2px dashed var(--primary); outline-offset: 6px; cursor: text; }
.print-page[contenteditable="true"]:focus { outline-style: solid; }

/* Шапка заказа: стрелка к заказам клиента, имя клиента, номер; справа действия-иконки в рамке как у кнопок */
.order-title { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.order-title .act-back, .client-title .act-back { margin-left: -6px; color: var(--text); }
.order-title .act-back svg, .client-title .act-back svg { width: 22px; height: 22px; }
.order-title-client { color: var(--muted); font-weight: 600; }
.order-title-client::after { content: '·'; margin-left: 10px; }
.order-title .badge { font-size: 13px; }
.page-actions .act-btn { width: 36px; height: 36px; border-color: var(--line-strong); background: #fff; }
.page-actions .act-btn:hover { background: var(--surface-2); border-color: #94a3b8; }
.act-print:hover { color: #2563eb; }
