/* AMID · Production Orders — дизайн-система (раздел 10 ТЗ).
   Светлая тема, токены — CSS-переменные. Шрифты: Golos Text, номера и SKU — JetBrains Mono. */

:root {
  --bg: #F3F3EF;
  --sidebar: #ECEAE4;
  --surface: #FFFFFF;
  --border: #E3E2DC;
  --line: #EFEEE9;
  --hover: #F7F7F3;
  --text: #18181A;
  --text-2: #55544F;
  --muted: #6B6A64;
  --accent: #2340C9;
  --accent-hover: #1C34A8;
  --accent-weak: #E6EBFB;
  --ring: 0 0 0 3px #E3E8FB;

  --green: #1A8A52;  --green-t: #11633C;  --green-bg: #E1F2E8;
  --amber: #C77700;  --amber-t: #824A00;  --amber-bg: #FBEFD9;
  --red: #C8321F;    --red-t: #A11F14;    --red-bg: #FBE5E2;
  --violet: #6D4AE0; --violet-t: #4D33B8; --violet-bg: #EEEAFC;
  --teal: #0E7C7C;   --teal-t: #0B5F5F;   --teal-bg: #DFF1F0;
  --sky: #0B7BC2;    --sky-t: #075A8E;    --sky-bg: #E0F0FA;
  --blue: #2340C9;   --blue-t: #1A2F99;   --blue-bg: #E6EBFB;
  --gray: #8A8983;   --gray-t: #4A4945;   --gray-bg: #EFEEE9;
  --dark: #2B2B2E;   --dark-t: #FFFFFF;   --dark-bg: #2B2B2E;
  --brown: #8B5E34;  --brown-t: #6B4423;  --brown-bg: #F3EBE2;
  --pink: #B5426B;   --pink-t: #8E2F52;   --pink-bg: #F8E6EE;
  --orange: #D9661F; --orange-t: #A84A10; --orange-bg: #FCEBDD;
  --pin-bg: #FFF7E3; --pin-border: #EFD595; --pin-t: #7A4600;

  --r-card: 12px; --r-ctl: 8px; --r-badge: 6px;
  --shadow-pop: 0 8px 28px rgba(24, 24, 26, .14), 0 1px 3px rgba(24, 24, 26, .08);
  --sb-w: 236px;
  --tb-h: 56px;
  --font: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.45 var(--font); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; line-height: 1.25; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.mono { font-family: var(--mono); font-weight: 600; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.t2 { color: var(--text-2); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.b { font-weight: 600; }
.red { color: var(--red-t); } .amber { color: var(--amber-t); } .green { color: var(--green-t); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gap4 { gap: 4px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }

.link-btn { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }

/* ── ИКОНКИ ── */
.ic { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 20px; height: 20px; }
.ic-xl { width: 40px; height: 40px; stroke-width: 1.4; }

/* ── КАРКАС ── */
.app { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.app.collapsed { --sb-w: 64px; }
.sb {
  position: sticky; top: 0; height: 100vh; height: 100dvh; background: var(--sidebar);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; z-index: 300;
}
.sb-logo { display: flex; align-items: center; gap: 10px; height: var(--tb-h); padding: 0 16px; flex: none; }
.sb-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--text); color: #fff; flex: none;
  display: grid; place-items: center; font: 700 13px/1 var(--font); letter-spacing: .02em;
}
.sb-name { font-weight: 700; font-size: 14px; white-space: nowrap; }
.sb-name span { font-weight: 500; color: var(--muted); }
.sb-nav { flex: 1 1 auto; overflow-y: auto; padding: 4px 10px 12px; scrollbar-width: thin; }
.sb-group { margin-top: 14px; }
.sb-group:first-child { margin-top: 4px; }
.sb-gt { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 8px 6px; white-space: nowrap; }
.sb-item {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px; border-radius: 8px;
  color: var(--text-2); font-weight: 500; white-space: nowrap; text-decoration: none !important;
}
.sb-item:hover { background: rgba(255, 255, 255, .55); color: var(--text); }
.sb-item.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(24, 24, 26, .06); }
.sb-item.active .ic { color: var(--accent); }
.sb-item .lbl { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
.sb-cnt { font-size: 11px; font-weight: 600; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: rgba(24, 24, 26, .07); color: var(--text-2); display: inline-grid; place-items: center; }
.sb-cnt.alert { background: var(--red); color: #fff; }
.sb-foot { flex: none; padding: 10px; border-top: 1px solid var(--border); }
.sb-shift { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .6); font-size: 12px; color: var(--text-2); }
.sb-shift .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); flex: none; }
.sb-collapse { margin-top: 8px; width: 100%; justify-content: flex-start; color: var(--muted); }
.app.collapsed .sb-name, .app.collapsed .sb-gt, .app.collapsed .sb-item .lbl,
.app.collapsed .sb-cnt, .app.collapsed .sb-shift span, .app.collapsed .sb-collapse span { display: none; }
.app.collapsed .sb-item { justify-content: center; position: relative; }
.app.collapsed .sb-cnt.alert { display: block; position: absolute; top: 5px; right: 8px; min-width: 8px; height: 8px; padding: 0; font-size: 0; }
.app.collapsed .sb-gt { height: 1px; background: var(--border); margin: 0 8px 8px; padding: 0; }
.app.collapsed .sb-shift { justify-content: center; }

.main { min-width: 0; display: flex; flex-direction: column; }
.tb {
  position: sticky; top: 0; z-index: 200; height: var(--tb-h); flex: none; display: flex; align-items: center; gap: 12px;
  padding: 0 20px 0 24px; background: rgba(243, 243, 239, .92); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.tb-burger { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted); flex: 1 1 auto; }
.crumbs a { color: var(--muted); }
.crumbs b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs .sep { color: #B9B8B1; }
.tb-search {
  display: flex; align-items: center; gap: 8px; width: 320px; height: 34px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: text;
}
.tb-search span { flex: 1; font-size: 13px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { font: 600 11px/1 var(--mono); padding: 3px 5px; border-radius: 5px; border: 1px solid var(--border); background: var(--bg); color: var(--muted); }
.tb-btn { position: relative; }
.tb-dot { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.tb-user { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 10px; background: none; border: 0; cursor: pointer; }
.tb-user:hover { background: rgba(24, 24, 26, .05); }
.tb-user .nm { font-weight: 600; font-size: 13px; line-height: 1.2; text-align: left; }
.tb-user .rl { font-size: 11px; color: var(--muted); text-align: left; }
.as-banner { background: var(--violet-bg); color: var(--violet-t); font-size: 12px; padding: 6px 24px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid #DCD3F8; }

.view { padding: 24px 28px 48px; min-width: 0; flex: 1 1 auto; }
.page-h { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-h .ttl { flex: 1 1 auto; min-width: 0; }
.page-h .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-h .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── КАРТОЧКИ ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.card-p { padding: 18px 20px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); min-height: 52px; }
.card-h h2, .card-h h3 { flex: 1 1 auto; }
.card-b { padding: 16px 20px; }
.card-f { padding: 12px 20px; border-top: 1px solid var(--line); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

/* ── КНОПКИ ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: var(--r-ctl); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  -webkit-appearance: none; appearance: none;
}
.btn:hover { background: var(--hover); border-color: #D6D5CE; }
.btn:focus-visible, .inp:focus, .chip:focus-visible, .tab:focus-visible, .sb-item:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-dark { background: var(--text); border-color: var(--text); color: #fff; }
.btn-dark:hover { background: #2E2E31; border-color: #2E2E31; }
.btn-danger { color: var(--red-t); }
.btn-danger:hover { background: var(--red-bg); border-color: #F1C4BE; }
.btn-danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(24, 24, 26, .05); border-color: transparent; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; border-radius: 10px; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }
.btn-block { width: 100%; }
.btn .cnt { font-size: 11px; color: var(--muted); }

/* ── ПОЛЯ ── */
.inp {
  height: 34px; padding: 0 10px; border-radius: var(--r-ctl); border: 1px solid var(--border); background: var(--surface);
  min-width: 0; width: 100%; transition: border-color .12s, box-shadow .12s;
}
.inp:hover { border-color: #D3D2CB; }
.inp:focus { border-color: #9EAEEB; }
.inp::placeholder { color: #9E9D96; }
textarea.inp { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
select.inp { padding-right: 28px; -webkit-appearance: none; appearance: none; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B6A64' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center; }
.inp-sm { height: 28px; font-size: 12px; border-radius: 7px; }
.inp.err { border-color: var(--red); }
.inp[readonly] { background: var(--bg); }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld > label, .lbl-s { font-size: 12px; font-weight: 500; color: var(--text-2); }
.fld .req::after { content: ' *'; color: var(--red); }
.fld .hint { font-size: 11px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-sec { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 -2px; grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.search-inp { position: relative; }
.search-inp .ic { position: absolute; left: 10px; top: 9px; color: var(--muted); pointer-events: none; }
.search-inp .inp { padding-left: 32px; }

/* ── БЕЙДЖИ ── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-badge);
  font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--gray-bg); color: var(--gray-t);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; flex: none; }
.badge.nodot::before { display: none; }
.badge.lg { height: 26px; font-size: 13px; padding: 0 10px; }
.t-gray   { background: var(--gray-bg);   color: var(--gray-t); }
.t-violet { background: var(--violet-bg); color: var(--violet-t); }
.t-sky    { background: var(--sky-bg);    color: var(--sky-t); }
.t-blue   { background: var(--blue-bg);   color: var(--blue-t); }
.t-amber  { background: var(--amber-bg);  color: var(--amber-t); }
.t-teal   { background: var(--teal-bg);   color: var(--teal-t); }
.t-green  { background: var(--green-bg);  color: var(--green-t); }
.t-red    { background: var(--red-bg);    color: var(--red-t); }
.t-dark   { background: var(--dark-bg);   color: var(--dark-t); }
.t-brown  { background: var(--brown-bg);  color: var(--brown-t); }
.t-pink   { background: var(--pink-bg);   color: var(--pink-t); }
.t-orange { background: var(--orange-bg); color: var(--orange-t); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.d-gray { background: var(--gray); } .d-violet { background: var(--violet); } .d-sky { background: var(--sky); }
.d-blue { background: var(--blue); } .d-amber { background: var(--amber); } .d-teal { background: var(--teal); }
.d-green { background: var(--green); } .d-red { background: var(--red); } .d-dark { background: var(--dark); }
.d-brown { background: var(--brown); } .d-pink { background: var(--pink); } .d-orange { background: var(--orange); }

/* ── ТАБЛИЦЫ ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  height: 36px; padding: 0 12px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; background: #FCFCFA;
}
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl td { height: 49px; padding: 6px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #FAFAF7; }
.tbl tr.click { cursor: pointer; }
.tbl th.sort { cursor: pointer; user-select: none; }
.tbl th.sort:hover { color: var(--text); }
.tbl th .arr { opacity: .35; margin-left: 2px; }
.tbl th.on { color: var(--text); }
.tbl th.on .arr { opacity: 1; }
.tbl tfoot td { font-weight: 600; background: #FCFCFA; border-top: 1px solid var(--line); border-bottom: 0; height: 44px; }
.tbl.compact td { height: 40px; }
.tbl .cell-2 { font-size: 12px; color: var(--muted); margin-top: 1px; }
.tbl .inp { height: 30px; font-size: 13px; }
.tbl td.act { width: 1%; white-space: nowrap; text-align: right; }
.tbl tr.muted-row td { color: var(--muted); }

/* ── ПРОГРЕСС ── */
.pb { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; position: relative; }
.pb > i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.pb.lg { height: 10px; border-radius: 5px; }
.pb.lg > i { border-radius: 5px; }
.pb > i.green { background: var(--green); } .pb > i.amber { background: var(--amber); } .pb > i.red { background: var(--red); }
.pb > i.teal { background: var(--teal); } .pb > i.violet { background: var(--violet); } .pb > i.gray { background: #C9C8C1; }
.pbx { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.pbx .pb { flex: 1 1 auto; }
.pbx b { font-size: 12px; font-weight: 600; min-width: 34px; text-align: right; }

/* ── ВКЛАДКИ, СЕГМЕНТЫ, ЧИПЫ ── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab .c { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 8px; background: rgba(24, 24, 26, .06); color: var(--text-2); }
.tab.active .c { background: var(--accent-weak); color: var(--accent); }
.tab .c.red { background: var(--red-bg); color: var(--red-t); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: rgba(24, 24, 26, .06); flex-wrap: wrap; }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: none; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(24, 24, 26, .1); }
.seg button .c { font-size: 11px; color: var(--muted); margin-left: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap;
}
.chip:hover { border-color: #CFCEC7; color: var(--text); }
.chip.on { background: var(--accent-weak); border-color: #C3CEF5; color: var(--accent); }

/* ── KPI ── */
.kpi { padding: 16px 18px; }
.kpi .k-l { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .k-v { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; line-height: 1.15; }
.kpi .k-v small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi .k-s { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.click { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.kpi.click:hover { border-color: #CFCEC7; box-shadow: 0 2px 8px rgba(24, 24, 26, .05); }
.kpi .k-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; float: right; }

/* ── АВАТАРЫ ── */
.av {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 11px; font-weight: 600; color: #fff; letter-spacing: .02em;
}
.av.sm { width: 22px; height: 22px; font-size: 9px; }
.av.lg { width: 36px; height: 36px; font-size: 13px; }
.who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.who .ell { max-width: 180px; }
.orders-tbl .who .ell { max-width: 130px; }
.orders-tbl td, .orders-tbl th { padding-left: 10px; padding-right: 10px; }

/* ── МОДАЛКИ ── */
.modal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; }
.modal-bg { position: absolute; inset: 0; background: rgba(24, 24, 26, .38); animation: fade .15s ease; }
.modal-panel {
  position: relative; width: 560px; max-width: 100%; max-height: 88vh; max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-pop); animation: pop .16s ease;
}
.modal-panel.sm { width: 420px; } .modal-panel.lg { width: 760px; } .modal-panel.xl { width: 980px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex: none; }
.modal-head h2 { flex: 1 1 auto; font-size: 16px; }
.modal-head .sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1 1 auto; overscroll-behavior: contain; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); flex: none; }
.modal-foot .grow { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.preview-img { display: block; max-width: 100%; max-height: 72vh; margin: 0 auto; border-radius: 8px; }
.preview-frame { width: 100%; height: 72vh; border: 0; border-radius: 8px; background: var(--bg); }

/* ── ВЫПАДАЮЩЕЕ МЕНЮ ── */
.menu {
  position: fixed; z-index: 500; min-width: 200px; max-width: 320px; padding: 5px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-pop); animation: pop .12s ease;
  max-height: 70vh; overflow-y: auto;
}
.menu button, .menu a {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 7px;
  cursor: pointer; text-align: left; font-size: 13px; color: var(--text); text-decoration: none !important;
}
.menu button:hover, .menu a:hover, .menu .on { background: var(--hover); }
.menu button.danger { color: var(--red-t); }
.menu button:disabled { opacity: .45; cursor: not-allowed; }
.menu .sep { height: 1px; background: var(--line); margin: 4px 2px; }
.menu .mh { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 10px 4px; }
.menu .chk { margin-left: auto; color: var(--accent); }

/* ── ТОСТ ── */
#toast-root { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 13000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 10px; background: var(--text); color: #fff;
  box-shadow: var(--shadow-pop); font-size: 13px; font-weight: 500; animation: pop .18s ease; pointer-events: auto;
}
.toast.err { background: var(--red-t); }
.toast .ic { color: #8FE0B5; }
.toast.err .ic { color: #FFD2CC; }

/* ── ПУСТО, ЗАГРУЗКА ── */
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .ic-xl { color: #B7B6AF; margin-bottom: 10px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.sk { background: linear-gradient(90deg, #ECEBE6 0%, #F5F5F1 50%, #ECEBE6 100%); background-size: 200% 100%; animation: sk 1.2s infinite linear; border-radius: 6px; }
@keyframes sk { to { background-position: -200% 0; } }
.sk-line { height: 12px; margin: 10px 0; }
.sk-block { height: 120px; border-radius: 12px; }
.err-box { padding: 40px 20px; text-align: center; }
.err-box b { display: block; font-size: 16px; margin: 8px 0 4px; }

/* ── ЗАКРЕПЛЁННЫЙ КОММЕНТАРИЙ ── */
.pin { background: var(--pin-bg); border: 1px solid var(--pin-border); color: var(--pin-t); border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; }
.pin .pin-l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px; }
.pin .pin-t { color: #4A2C00; font-weight: 500; }
.pin .pin-m { font-size: 12px; margin-top: 4px; opacity: .9; }
.pin a { color: var(--pin-t); font-weight: 600; white-space: nowrap; }

/* ── ПОИСК (Ctrl+K) ── */
.cmdk { width: 620px; }
.cmdk .modal-head { padding: 10px 14px; }
.cmdk .modal-head input { border: 0; box-shadow: none !important; height: 38px; font-size: 15px; padding: 0 4px; }
.cmdk-list { padding: 6px; max-height: 60vh; overflow-y: auto; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.cmdk-item:hover, .cmdk-item.on { background: var(--hover); }
.cmdk-item .mono { font-size: 13px; }

/* ── УВЕДОМЛЕНИЯ ── */
.notif { width: 380px; padding: 0; }
.notif-h { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-h b { flex: 1; }
.notif-list { max-height: 60vh; overflow-y: auto; }
.notif-i { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notif-i:hover { background: var(--hover); }
.notif-i.unread { background: #F5F7FE; }
.notif-i .ni-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.notif-i .ni-t { font-size: 13px; line-height: 1.4; }
.notif-i .ni-m { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ── ДАШБОРД ── */
.prod-today { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 2fr); gap: 0; }
.prod-today .big { padding: 20px 22px; border-right: 1px solid var(--line); }
.prod-today .big .v { font-size: 36px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.prod-today .big .v small { font-size: 16px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.prod-today .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.prod-today .kpis .kpi + .kpi { border-left: 1px solid var(--line); }
.prod-today .kpis .kpi { padding: 20px 18px; }
.chart { width: 100%; display: block; }
.chart text { font: 500 11px var(--font); fill: var(--muted); }
.chart .lbl-v { font-weight: 600; fill: var(--text-2); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.segbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); gap: 2px; }
.segbar i { display: block; height: 100%; min-width: 3px; }
.feed-i { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.feed-i:last-child { border-bottom: 0; }
.feed-i .t { color: var(--muted); font-size: 12px; min-width: 38px; }
.load-row { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 7px 0; font-size: 13px; }
.load-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.load-row > span:first-child .cell-2 { overflow: hidden; text-overflow: ellipsis; }

/* ── КАРТОЧКА ЗАКАЗА ── */
.oh { padding: 18px 22px 16px; }
.oh-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.oh-num { font: 600 24px/1.2 var(--mono); letter-spacing: -.02em; }
.oh-acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.oh-props { display: grid; grid-template-columns: repeat(7, minmax(0, auto)); gap: 8px 28px; margin-top: 16px; justify-content: start; }
.oh-props .p-l { font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.oh-props .p-v { font-size: 13px; font-weight: 500; margin-top: 3px; white-space: nowrap; }
.stepper { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 4px 0 2px; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.st { display: flex; align-items: center; gap: 8px; flex: 1 1 0; min-width: 104px; }
.st .c { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 600; border: 1.5px solid var(--border); color: var(--muted); background: var(--surface); }
.st .n { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.st .ln { flex: 1 1 auto; height: 2px; background: var(--border); margin: 0 8px; min-width: 10px; border-radius: 1px; }
.st.done .c { background: var(--green); border-color: var(--green); color: #fff; }
.st.done .n { color: var(--text-2); }
.st.done .ln { background: var(--green); }
.st.cur .c { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-weak); }
.st.cur .n { color: var(--text); font-weight: 600; }
.st:last-child { flex: 0 0 auto; }
.st.cancel .c { background: var(--red); border-color: var(--red); color: #fff; }
/* длинный маршрут (своя ткань: 11 шагов) — компактнее; на узком экране подписи только у текущего шага */
.stepper.many .st { min-width: 0; flex: 1 1 auto; gap: 6px; }
.stepper.many .st:last-child { flex: 0 0 auto; }
.stepper.many .st .n { font-size: 11.5px; }
.stepper.many .st .ln { margin: 0 4px; min-width: 6px; }
@media (max-width: 1380px) { .stepper.many .st:not(.cur) .n { display: none; } }
.weights { font-size: 12px; color: var(--muted); }
.stage-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 80px 110px; gap: 12px; align-items: center; padding: 8px 0; font-size: 13px; }
.heat td { text-align: center; }
.heat td.h { font-weight: 600; }
.mat-def { color: var(--red-t); font-weight: 600; }

/* комментарии */
.composer { display: flex; gap: 12px; }
.composer .box { flex: 1 1 auto; min-width: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.composer .box:focus-within { border-color: #9EAEEB; box-shadow: var(--ring); }
.composer textarea { border: 0; width: 100%; resize: vertical; min-height: 72px; padding: 10px 12px; outline: none; background: none; border-radius: 10px; line-height: 1.45; }
.composer .bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.composer .who-get { font-size: 12px; color: var(--muted); margin-top: 6px; }
.composer .reply-to { display: flex; gap: 8px; align-items: center; font-size: 12px; padding: 6px 10px; background: var(--accent-weak); color: var(--accent); border-radius: 8px 8px 0 0; }
.mention-pop { position: fixed; z-index: 600; }
.att-list { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 10px 8px; }
.att { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 7px; background: var(--bg); font-size: 12px; max-width: 240px; }
.att .ell { max-width: 180px; }
.cm { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cm:last-child { border-bottom: 0; }
.cm-b { flex: 1 1 auto; min-width: 0; }
.cm-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.cm-h b { font-weight: 600; }
.cm-h .tm { color: var(--muted); font-size: 12px; }
.cm-t { margin-top: 4px; white-space: pre-wrap; word-wrap: break-word; }
.cm-t .mn { color: var(--accent); background: var(--accent-weak); border-radius: 4px; padding: 0 3px; font-weight: 500; }
.cm-acts { display: flex; gap: 2px; margin-top: 6px; margin-left: -8px; }
.cm-replies { margin-top: 10px; padding-left: 14px; border-left: 2px solid var(--line); }
.cm-replies .cm { padding: 10px 0; }
.cm.pinned > .cm-b > .cm-h::after { content: none; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img { width: 132px; height: 88px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; background: var(--bg); }
.doc-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-size: 12px; margin-top: 8px; margin-right: 6px; cursor: pointer; max-width: 300px; }
.doc-chip:hover { border-color: #CFCEC7; }
.ftype { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; font: 700 9px/1 var(--font); letter-spacing: .02em; flex: none; }
.ft-pdf { background: var(--red-bg); color: var(--red-t); } .ft-xls { background: var(--green-bg); color: var(--green-t); }
.ft-doc { background: var(--blue-bg); color: var(--blue-t); } .ft-img { background: var(--violet-bg); color: var(--violet-t); }
.ft-cad { background: var(--teal-bg); color: var(--teal-t); } .ft-oth { background: var(--gray-bg); color: var(--gray-t); }
.drop {
  border: 1.5px dashed #CFCEC7; border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer;
  transition: border-color .12s, background .12s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: #F7F9FE; color: var(--accent); }
.cat-list button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; font-size: 13px; color: var(--text-2); }
.cat-list button:hover { background: var(--hover); }
.cat-list button.on { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.cat-list .c { margin-left: auto; font-size: 12px; color: var(--muted); }

/* история */
.tl-day { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 6px; }
.tl-day:first-child { margin-top: 0; }
.tl-i { display: grid; grid-template-columns: 48px 14px minmax(0, 1fr); gap: 10px; padding: 7px 0; position: relative; }
.tl-i .tm { font-size: 12px; color: var(--muted); padding-top: 1px; }
.tl-i .dt { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; position: relative; z-index: 1; box-shadow: 0 0 0 3px var(--surface); }
.tl-i::before { content: ''; position: absolute; left: 62px; top: 20px; bottom: -8px; width: 1.5px; background: var(--line); }
.tl-i:last-child::before { display: none; }
.tl-i .tx { font-size: 13px; }
.tl-i .by { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── МАСТЕР СОЗДАНИЯ ── */
.wiz { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.wiz-steps { padding: 10px; position: sticky; top: calc(var(--tb-h) + 16px); }
.wiz-step { display: flex; gap: 12px; padding: 10px; border-radius: 10px; cursor: pointer; align-items: flex-start; }
.wiz-step:hover { background: var(--hover); }
.wiz-step.on { background: var(--accent-weak); }
.wiz-step .c { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--muted); flex: none; background: var(--surface); }
.wiz-step.on .c { border-color: var(--accent); background: var(--accent); color: #fff; }
.wiz-step.done .c { border-color: var(--green); background: var(--green); color: #fff; }
.wiz-step .n { font-weight: 600; font-size: 13px; }
.wiz-step .d { font-size: 12px; color: var(--muted); margin-top: 1px; }
.wiz-num { margin: 8px 4px 2px; padding: 12px; border-radius: 10px; background: var(--bg); font-size: 12px; color: var(--muted); }
.wiz-num b { display: block; font: 600 16px/1.3 var(--mono); color: var(--text); margin-top: 2px; }
.prod-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.prod-card { border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: var(--surface); text-align: left; display: flex; gap: 12px; align-items: flex-start; }
.prod-card:hover { border-color: #CFCEC7; }
.prod-card.on { border-color: var(--accent); background: #F7F9FE; box-shadow: var(--ring); }
.prod-card .pi { width: 36px; height: 36px; border-radius: 9px; background: var(--bg); display: grid; place-items: center; flex: none; color: var(--text-2); }
.matrix td { padding: 4px 6px; }
.matrix .inp { width: 74px; text-align: right; height: 32px; }
.matrix th { text-align: center; }
.checklist { display: flex; flex-direction: column; gap: 8px; }
.checklist .ci { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.checklist .ci .c { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--border); color: transparent; }
.checklist .ci.ok .c { background: var(--green); border-color: var(--green); color: #fff; }
.summary dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 13px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 500; }

/* ── KANBAN ── */
.kb { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kb-col { background: rgba(24, 24, 26, .035); border-radius: 12px; padding: 10px; min-height: 200px; transition: background .12s, box-shadow .12s; }
.kb-col.over { background: var(--accent-weak); box-shadow: inset 0 0 0 2px #B9C6F3; }
.kb-col.deny { background: var(--red-bg); }
.kb-h { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; font-size: 13px; }
.kb-h b { font-weight: 600; }
.kb-h .s { margin-left: auto; font-size: 12px; color: var(--muted); }
.kb-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px 12px; margin-bottom: 8px; position: relative; overflow: hidden; cursor: pointer; }
.kb-card[draggable="true"] { cursor: grab; }
.kb-card:hover { border-color: #CFCEC7; box-shadow: 0 2px 8px rgba(24, 24, 26, .06); }
.kb-card.dragging { opacity: .45; }
.kb-card.late::before, .kb-card.risk::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; }
.kb-card.late::before { background: var(--red); }
.kb-card.risk::before { background: var(--amber); }
.kb-card .t { font-weight: 600; font-size: 13px; margin-top: 6px; }
.kb-card .c2 { font-size: 12px; color: var(--muted); margin-top: 1px; }
.kb-card .ft { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; }

/* ── КАЛЕНДАРЬ ── */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cal-h { padding: 8px 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); }
.cal-d { min-height: 118px; padding: 6px 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; min-width: 0; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d:hover { background: #FAFAF7; }
.cal-d.out { background: #FBFBF9; color: #B5B4AD; }
.cal-d.sel { background: #F7F9FE; box-shadow: inset 0 0 0 2px #C3CEF5; }
.cal-d.we { background: #FBFBF8; }
.cal-n { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; padding: 2px 4px 4px; }
.cal-n .num { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-d.today .cal-n .num { background: var(--accent); color: #fff; }
.cal-n .sum { font-size: 11px; color: var(--muted); font-weight: 500; }
.cal-o { display: block; font-size: 11px; font-weight: 500; padding: 2px 6px; border-radius: 5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: 11px; color: var(--muted); padding: 2px 6px; }

/* ── ГАНТ ── */
.gantt { display: grid; min-width: 1100px; }
.gantt-h, .gantt-r { display: grid; grid-template-columns: 250px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.gantt-r:hover { background: #FAFAF7; }
.gantt-l { padding: 8px 14px 8px 20px; min-width: 0; border-right: 1px solid var(--line); cursor: pointer; }
.gantt-days { display: grid; position: relative; }
.gantt-day { border-right: 1px solid #F4F3EF; font-size: 10px; text-align: center; color: var(--muted); padding: 4px 0; }
.gantt-day.we { background: rgba(24, 24, 26, .035); }
.gantt-day.td { background: var(--accent-weak); color: var(--accent); font-weight: 700; }
.gantt-track { display: grid; position: relative; height: 100%; min-height: 46px; }
.gantt-track .cellbg { border-right: 1px solid #F4F3EF; }
.gantt-track .cellbg.we { background: rgba(24, 24, 26, .03); }
.gantt-bar { position: absolute; top: 12px; height: 22px; border-radius: 6px; overflow: hidden; display: flex; align-items: center; font-size: 11px; font-weight: 600; color: #fff; padding: 0 8px; white-space: nowrap; cursor: pointer;
  background: color-mix(in srgb, var(--bar) 42%, #fff); }
.gantt-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bar); }
.gantt-bar span { position: relative; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.gantt-bar.plan { background: repeating-linear-gradient(-45deg, #E4E3DD, #E4E3DD 6px, #EDECE7 6px, #EDECE7 12px); color: var(--text-2); border: 1px dashed #C9C8C1; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); opacity: .7; pointer-events: none; z-index: 1; }

/* ── УЧАСТКИ, ЗАДАНИЯ ── */
.sec-card .q-i { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.sec-card .q-i:last-child { border-bottom: 0; }
.sec-card .q-i:hover .mono { color: var(--accent); }
.task { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.task.cur { box-shadow: inset 0 0 0 2px var(--accent); }
.task .tt { font-size: 16px; font-weight: 600; }
.task .nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.task .nums div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.task .nums span { display: block; font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.task .nums b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.task .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.task .acts .btn { flex: 1 1 auto; padding: 0 10px; }
.stepper-inp { display: flex; align-items: center; gap: 8px; }
.stepper-inp .inp { text-align: center; font-size: 22px; font-weight: 700; height: 52px; }
.stepper-inp .btn { height: 52px; width: 52px; font-size: 20px; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini-kpis div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.mini-kpis span { display: block; font-size: 11px; color: var(--muted); }
.mini-kpis b { font-size: 18px; }

/* ── АНАЛИТИКА ── */
.hbar { display: grid; grid-template-columns: 170px minmax(0, 1fr) 60px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.hbar .bar { height: 14px; border-radius: 4px; background: var(--line); overflow: hidden; }
.hbar .bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.heat-c { border-radius: 6px; padding: 8px 4px; text-align: center; font-weight: 600; font-size: 12px; }
.tip { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--amber-bg); color: var(--amber-t); font-size: 13px; }

/* ── РОЛИ ── */
.mx td.cell { text-align: center; font-size: 12px; }

/* ── ВХОД ── */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 400px; max-width: 100%; padding: 28px; }
.auth-card .logo { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-err { background: var(--red-bg); color: var(--red-t); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.auth-ok { background: var(--green-bg); color: var(--green-t); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.demo-logins { margin-top: 18px; font-size: 12px; color: var(--muted); }
.demo-logins button { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: 3px 7px; margin: 3px 3px 0 0; cursor: pointer; font: 500 12px var(--mono); color: var(--text-2); }
.demo-logins button:hover { border-color: var(--accent); color: var(--accent); }

/* ── ОБЩИЙ ПЛАНШЕТ: вход по PIN ── */
.pin-card { width: 520px; }
.pin-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.pin-person { display: flex; align-items: center; gap: 12px; padding: 12px; min-height: 64px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); cursor: pointer; text-align: left; font: inherit; }
.pin-person:hover, .pin-person:focus-visible { border-color: var(--accent); background: #F7F9FE; outline: none; }
.pin-person b { display: block; font-size: 14px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0 14px; min-height: 16px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #C9C8C1; }
.pin-dots i.on { background: var(--text); border-color: var(--text); }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.keypad button { height: 58px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font: 600 24px/1 var(--font);
  color: var(--text); cursor: pointer; display: grid; place-items: center; -webkit-appearance: none; appearance: none; touch-action: manipulation; }
.keypad button:active { background: var(--accent-weak); border-color: #C3CEF5; }
.keypad button .ic { width: 24px; height: 24px; }

/* ── АДАПТИВ ── */
@media (max-width: 1279px) {
  .app { --sb-w: 64px; }
  .app .sb-name, .app .sb-gt, .app .sb-item .lbl, .app .sb-cnt:not(.alert), .app .sb-shift span, .app .sb-collapse { display: none; }
  .app .sb-item { justify-content: center; position: relative; }
  .app .sb-cnt.alert { position: absolute; top: 5px; right: 8px; min-width: 8px; height: 8px; padding: 0; font-size: 0; }
  .app .sb-gt { display: block; height: 1px; background: var(--border); margin: 0 8px 8px; padding: 0; font-size: 0; }
  .app .sb-shift { justify-content: center; }
  .app.open-sb .sb { position: fixed; left: 0; top: 0; bottom: 0; width: 236px; box-shadow: var(--shadow-pop); }
  .app.open-sb .sb-name, .app.open-sb .sb-gt, .app.open-sb .sb-item .lbl, .app.open-sb .sb-cnt, .app.open-sb .sb-shift span { display: revert; }
  .app.open-sb .sb-item { justify-content: flex-start; }
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .oh-props { grid-template-columns: repeat(4, minmax(0, auto)); }
  .tb-search { width: 240px; }
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prod-today { grid-template-columns: minmax(0, 1fr); }
  .prod-today .big { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 767px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sb { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-pop); }
  .app.open-sb .sb { transform: none; width: 260px; }
  .app .sb-name, .app .sb-gt, .app .sb-item .lbl, .app .sb-cnt, .app .sb-shift span { display: revert; }
  .app .sb-gt { height: auto; background: none; margin: 0; padding: 0 8px 6px; font-size: 11px; }
  .app .sb-item { justify-content: flex-start; }
  .app .sb-cnt.alert { position: static; min-width: 20px; height: 18px; padding: 0 6px; font-size: 11px; }
  .tb { padding: 0 12px; gap: 8px; }
  .tb-burger { display: inline-flex; }
  .tb-search { width: 34px; padding: 0; justify-content: center; }
  .tb-search span, .tb-search kbd, .tb-user .nm, .tb-user .rl { display: none; }
  .view { padding: 16px 16px 40px; }
  .g2, .g3, .g4, .g5, .g6, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi-row.g6, .kpi-row.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oh-props { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prod-today .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prod-today .kpis .kpi:nth-child(3) { border-left: 0; }
  .wiz { grid-template-columns: minmax(0, 1fr); }
  .wiz-steps { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .wiz-step { flex: 0 0 auto; white-space: nowrap; }
  .pin { flex-wrap: wrap; }
  .pin > .grow { flex-basis: calc(100% - 40px); }
  .pin > a { margin-left: 28px; }
  .progress-head { flex-wrap: wrap; row-gap: 4px; }
  .progress-head .grow { display: none; }
  .wiz-step .d, .wiz-num { display: none; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-panel, .modal-panel.sm, .modal-panel.lg, .modal-panel.xl { width: 100%; max-height: 92dvh; border-radius: 16px 16px 0 0; }
  .modal-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .modal-foot .btn { height: 44px; flex: 1 1 auto; }
  .inp { font-size: 16px; }
  .hbar { grid-template-columns: 110px minmax(0, 1fr) 50px; }
  .cal-d { min-height: 74px; }
  .cal-o { display: none; }
}
@media print {
  .sb, .tb, .oh-acts, .no-print { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
}

/* ── ЦЕХА: карточки и план выпуска ── */
.ws-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; padding: 6px 0; }
.ws-line + .ws-line { border-top: 1px dashed var(--line); }
.ws-line .big { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.ws-line .pb { grid-column: 1 / -1; }
.ws-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--text-2);
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.ws-tag.mine { background: var(--accent-weak); border-color: #C3CEF5; color: var(--accent); }
.plan-grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 960px; }
.plan-grid th, .plan-grid td { border-bottom: 1px solid var(--line); padding: 6px 8px; font-size: 13px; text-align: right; white-space: nowrap; }
.plan-grid th:first-child, .plan-grid td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; white-space: normal; min-width: 210px; }
.plan-grid thead th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface); }
.plan-grid th.we, .plan-grid td.we { background: rgba(24, 24, 26, .03); }
.plan-grid th.td, .plan-grid td.td { background: var(--accent-weak); }
.plan-grid .inp { width: 84px; height: 30px; text-align: right; padding: 0 8px; }
.plan-grid .inp.chg { border-color: var(--amber); background: var(--amber-bg); }
.plan-grid .f { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.plan-grid .f.red { color: var(--red-t); }
.plan-grid tr.grp td { background: var(--bg); font-weight: 600; font-size: 12px; color: var(--text-2); }
.plan-grid tr.grp td:first-child { text-align: left; }
.plan-grid tfoot td { font-weight: 600; background: var(--bg); }
