/* CSS_VERSION: 50 */
:root {
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f0f3f7; --text: #1b2430; --muted: #627083; --line: #dfe4eb;
  --primary: #1f4e79; --primary-2: #2d6aa3; --on-primary: #ffffff;
  --prod: #2e7d32; --defect: #c62828; --order: #6a1b9a; --ship: #fbc02d;
  --ok-bg: #e3f2e5; --ok: #1b5e20; --warn-bg: #fff6d6; --warn: #8a5a00; --bad-bg: #fde3e3; --bad: #b71c1c; --gray-bg: #eceff3;
  --radius: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .05);
  --nav-h: 64px; --side-w: 232px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161d; --surface: #1a212b; --surface-2: #222b37; --text: #e6ebf2; --muted: #9aa7b8; --line: #2e3947;
    --primary: #5b9bd5; --primary-2: #7fb1e0; --on-primary: #0d1620;
    --prod: #66bb6a; --defect: #ef5350; --order: #ba68c8; --ship: #fbc02d;
    --ok-bg: #1d3a24; --ok: #a5d6a7; --warn-bg: #3d3214; --warn: #ffd54f; --bad-bg: #44201f; --bad: #ef9a9a; --gray-bg: #29323e;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ---------- каркас ---------- */
.layout { min-height: 100vh; }
.side { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--topbar-bg, var(--primary)); color: var(--on-primary); }
.topbar h1 { font-size: 17px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .live { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #9e9e9e; display: inline-block; }
.dot.on { background: #69f0ae; }
main { padding: 16px; padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); max-width: 1500px; margin: 0 auto; }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--nav-h); text-decoration: none; color: var(--muted); font-size: 11px; }
.bottomnav a.active { color: var(--primary); font-weight: 600; }
.bottomnav svg, .side svg { width: 22px; height: 22px; }
@media (min-width: 900px) {
  .layout { display: grid; grid-template-columns: var(--side-w) 1fr; }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); padding: 16px 10px; gap: 2px; }
  .side .brand { font-weight: 700; color: var(--primary); padding: 4px 12px 16px; font-size: 16px; }
  .side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text); }
  .side a:hover { background: var(--surface-2); }
  .side a.active { background: var(--primary); color: var(--on-primary); }
  .side .grow { flex: 1; }
  .side .who { padding: 10px 12px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
  .bottomnav { display: none; }
  main { padding: 24px; padding-bottom: 40px; }
  .topbar .burger { display: none; }
}

/* ---------- элементы ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 16px; margin-bottom: 16px; }
.card h2 { font-size: 17px; margin: 0 0 12px; }
.card h3 { font-size: 15px; margin: 16px 0 8px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 160px; min-width: 0; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid2 { grid-template-columns: minmax(380px, 520px) 1fr; align-items: start; } }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
label.f > span b { color: var(--defect); }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-2); outline-offset: 0; border-color: transparent; }
input.need { background: var(--warn-bg); }
input.bad { background: var(--bad-bg); }
textarea { min-height: 70px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.btn.danger { color: var(--defect); border-color: var(--defect); }
.btn.block { width: 100%; }
.btn.big { min-height: 52px; font-size: 16px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.sm { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .sp { flex: 1; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); padding: 4px; border-radius: 12px; gap: 4px; margin-bottom: 16px; }
.seg button { border: 0; background: transparent; padding: 10px 6px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); min-height: 44px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg button.on.prod { color: var(--prod); } .seg button.on.defect { color: var(--defect); } .seg button.on.order { color: var(--order); } .seg button.on.ship { color: var(--ship); }
.info { background: var(--surface-2); border-radius: 10px; padding: 12px; margin-bottom: 12px; font-size: 14px; }
.info .nm { font-weight: 600; margin-bottom: 6px; }
.info dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; }
.info dt { color: var(--muted); } .info dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.alert { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); } .alert.warn { background: var(--warn-bg); color: var(--warn); } .alert.bad { background: var(--bad-bg); color: var(--bad); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-done { background: var(--ok-bg); color: var(--ok); } .st-work { background: var(--warn-bg); color: var(--warn); } .st-none { background: var(--bad-bg); color: var(--bad); } .st-noord { background: var(--gray-bg); color: var(--muted); }
.def { background: var(--bad-bg); color: var(--bad); }

/* ---------- таблицы ---------- */
.tablewrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; max-height: 70vh; background: var(--surface); }
table.t { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
table.t th { position: sticky; top: 0; z-index: 1; background: var(--primary); color: var(--on-primary); font-weight: 600; text-align: left; padding: 8px 10px; white-space: nowrap; }
table.t td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
#ac-rows td { vertical-align: middle; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--surface-2); }
table.t tr.defect td { background: var(--bad-bg); }
table.t tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 700; border-top: 2px solid var(--line); }
td.c-ok { background: var(--ok-bg); } td.c-warn { background: var(--warn-bg); } td.c-bad { background: var(--bad-bg); }
.cards { display: grid; gap: 10px; }
.rc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.rc.defect { border-left: 4px solid var(--defect); }
.rc .top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.rc .sub { color: var(--muted); font-size: 13px; }
.rc .kv { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; margin-top: 6px; }
.only-desk { display: none; }
@media (min-width: 900px) { .only-desk { display: block; } .only-mob { display: none; } }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.kpi .l { font-size: 12px; color: var(--muted); } .kpi .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- график ---------- */
.chart { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center; font-size: 12.5px; }
@media (min-width: 900px) { .bar-row { grid-template-columns: 170px 1fr; } }
.bars { display: grid; gap: 2px; }
.bar { height: 9px; border-radius: 4px; min-width: 2px; }
.bar.o { background: var(--order); } .bar.p { background: var(--prod); } .bar.s { background: var(--ship); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; margin-bottom: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- модальное окно, тост ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(10, 15, 25, .5); display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal-box { background: var(--surface); width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 18px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .modal { align-items: center; } .modal-box { border-radius: 16px; } }
.modal-box h2 { margin-top: 0; font-size: 18px; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 60; background: #1b2430; color: #fff;
  padding: 12px 16px; border-radius: 10px; max-width: calc(100% - 32px); opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }
#toast.err { background: #b71c1c; }
@media (min-width: 900px) { #toast { bottom: 24px; } }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; }
.login .logo { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.login .logo img { width: 44px; height: 44px; }

/* ---------- печать ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  html { font-size: 10.5pt; }
  body { font-size: 10.5pt; }
  table.t { font-size: 10.5pt; }
  table.t th, table.t td { padding: 3px 5px; }
  .print-title { font-size: 13pt; }
  .side, .topbar, .bottomnav, .toolbar, .noprint, #toast { display: none !important; }
  .layout { display: block; } main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .tablewrap { max-height: none; overflow: visible; border: 0; }
  table.t th { position: static; background: #ddd !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.t tfoot td { position: static; }
  .only-desk { display: block !important; } .only-mob { display: none !important; }
  body { background: #fff; }
  .print-title { display: block !important; }
  /* цветовые подсветки табеля — только на экране; печать чёрно-белая */
  .hr-tabel td.tb-holwork, .hr-tabel td.tb-over, .hr-tabel td.tb-off, .hr-tabel td.tb-graphoff { background: #fff !important; color: #000 !important; }
  .hr-tabel td.tb-holwork { font-weight: normal; }
  .hr-tabel thead th, .hr-tabel thead th.tb-we, .hr-tabel thead th.tb-hol { background: #ddd !important; color: #000 !important; }
  /* печать ведомости: все колонки на альбомном листе */
  .hr-pay { table-layout: auto; font-size: 8pt; }
  .hr-pay th, .hr-pay td { padding: 2px 3px; }
  .hr-pay thead th { white-space: normal; max-width: 78px; font-size: 7.5pt; }
  .hr-pay tbody tr { break-inside: avoid; }
  /* печатные подписи */
  .print-sign { display: block !important; margin-top: 26px; font-size: 10.5pt; }
  .print-sign .sg-row { display: flex; justify-content: space-between; gap: 40px; margin-top: 14px; }
}
.print-title { display: none; font-size: 18px; font-weight: 700; margin-bottom: 8px; }
/* печатные подписи: только при печати */
.print-sign { display: none; }

table.t td b { white-space: nowrap; }
table.t td:nth-child(2) { min-width: 220px; }

/* ---------- главная страница ---------- */
.homegrid { display: grid; gap: 16px; grid-template-columns: 1fr; max-width: 1000px; margin: 24px auto; }
@media (min-width: 900px) { .homegrid { grid-template-columns: repeat(3, 1fr); } }
.homecard { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 24px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  text-decoration: none; color: var(--text); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.homecard:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16, 24, 40, .12); }
.homecard.soon { opacity: .55; }
.homecard h2 { margin: 0; font-size: 18px; color: var(--text); }
.homecard p { margin: 0; font-size: 13.5px; color: var(--muted); }
.hc-ic { width: 52px; height: 52px; border-radius: 14px; background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center; }
.hc-ic svg { width: 28px; height: 28px; }

/* ---------- burger и свёрнутое меню ---------- */
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none;
  border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; }
.iconbtn:hover { background: rgba(255, 255, 255, .15); }
.iconbtn svg { width: 22px; height: 22px; }
.topbar .burger { display: none; }
@media (min-width: 900px) {
  .topbar .burger { display: inline-flex; }
  .layout.side-collapsed { display: block; }
.layout.on-home { display: block; }
.layout.on-home main { max-width: 1000px; margin: 0 auto; }
  .layout.side-collapsed .side { display: none; }
  .layout.side-collapsed main { max-width: none; }
}


/* числовые столбцы — по центру */
table.t th.num, table.t td.num { text-align: center; }

/* кнопка-карточка «На главную» в шапке */
.homecard-btn { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.14); color: var(--on-primary); text-decoration: none; font-size: 13.5px; white-space: nowrap; }
.homecard-btn svg { width: 16px; height: 16px; }
.homecard-btn:hover { background: rgba(255,255,255,.22); }
@media (min-width: 900px) { .topbar { position: relative; } .topbar-mid { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; } }
@media (max-width: 899px) { .topbar-mid { display: none; } }


/* ---------- меню: главная без левого меню, справа профиль/настройки ---------- */
.rnav { display: inline-flex; gap: 6px; margin-left: auto; }
.rnav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; font-size: 13.5px;
  color: var(--on-primary); background: rgba(255,255,255,.12); text-decoration: none; white-space: nowrap; }
.rnav a:hover { background: rgba(255,255,255,.22); }
.rnav a.active { background: rgba(255,255,255,.28); font-weight: 600; }
.rnav a svg { width: 18px; height: 18px; }
@media (max-width: 899px) { .rnav { display: none; } }

/* --- сборка 19 --- */
.rnav-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; font-size: 13.5px; color: inherit; background: rgba(255,255,255,.12); text-decoration: none; white-space: nowrap; border: none; cursor: pointer; font-family: inherit; }
.rnav-btn:hover { background: rgba(255,255,255,.22); }
.rnav-btn svg { width: 18px; height: 18px; }
@media (max-width: 899px) { .rnav-btn { display: none; } }
.side-toggle { position: absolute; top: 50%; right: -14px; transform: translateY(-50%); width: 28px; height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; box-shadow: 0 2px 6px rgba(16,24,40,.12); z-index: 5; }
.side-toggle:hover { color: var(--text); }
.layout.side-collapsed .side-toggle { right: auto; left: 0; top: 16px; transform: none; border-radius: 8px; }
.layout.on-home .topbar h1 { text-align: center; }
@media (min-width: 900px) { .layout.on-home .topbar { position: relative; } .layout.on-home .topbar h1 { position: absolute; left: 0; right: 0; pointer-events: none; } }

/* --- сборка 20: свёрнутое меню (ярлыки + авто-раскрытие при наведении) --- */
.layout.side-collapsed { display: grid; grid-template-columns: 56px 1fr; }
.layout.side-collapsed main { max-width: 1500px; }
.layout.side-collapsed .side { display: flex; position: fixed; left: 0; top: 0; width: 56px; height: 100vh; z-index: 40; padding: 12px 8px; overflow: hidden; background: var(--surface); border-right: 1px solid var(--line); box-shadow: 0 4px 14px rgba(16,24,40,.16); }
.layout.side-collapsed .side a { justify-content: center; padding: 10px 6px; }
.layout.side-collapsed .side a span { display: none; }
.layout.side-collapsed .side .who { display: none; }
.layout.side-collapsed .side:hover { width: 236px; }
.layout.side-collapsed .side:hover a { justify-content: flex-start; padding: 10px 12px; }
.layout.side-collapsed .side:hover a span { display: inline; }
.layout.side-collapsed .side:hover .who { display: block; }
.layout.side-collapsed .side-toggle { right: -14px; left: auto; top: 50%; transform: translateY(-50%); z-index: 50; }
@media (max-width: 899px) { .layout.side-collapsed { display: block; } .layout.side-collapsed .side { display: none; } }

/* --- сборка 22: свёрнутое меню стабильно (фикс сдвига контента влево) --- */
.layout.side-collapsed { display: block !important; }
.layout.side-collapsed .side { display: flex; position: fixed; left: 0; top: 0; width: 56px; height: 100vh; z-index: 40; padding: 12px 8px; overflow: hidden; background: var(--surface); border-right: 1px solid var(--line); box-shadow: 0 4px 14px rgba(16,24,40,.16); }
.layout.side-collapsed .side a { justify-content: center; padding: 10px 6px; }
.layout.side-collapsed .side a span { display: none; }
.layout.side-collapsed .side .who { display: none; }
.layout.side-collapsed .side-toggle { right: -14px; left: auto; top: 50%; transform: translateY(-50%); z-index: 50; }
.layout.side-collapsed main { max-width: none; padding-left: 72px; }
@media (max-width: 899px) { .layout.side-collapsed .side { display: none; } .layout.side-collapsed main { padding-left: 16px; } }

/* --- сборка 23: контент при свёрнутом меню сдвинут правее полосы ярлыков --- */
.layout.side-collapsed > div { padding-left: 56px; }
.layout.side-collapsed main { padding-left: 16px; }
@media (max-width: 899px) { .layout.side-collapsed > div { padding-left: 0; } }

/* ---------- (26) хаб главной: две карточки ---------- */
.homegrid.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 899px) { .homegrid.two { grid-template-columns: 1fr; } }

/* ---------- (27) табель, календарь, начисления ---------- */
.hr-tabel th, .hr-tabel td { padding: 2px 4px; }
/* сетка табеля: видимые границы, по центру */
.hr-tabel { border-collapse: collapse; }
.hr-tabel th, .hr-tabel td { border: 1px solid var(--line); padding: 2px 3px; }
.hr-pay th, .hr-pay td { border: 1px solid var(--line); }
.hr-tabel td.tb-cell { text-align: center; }
.hr-tabel thead th { text-align: center; vertical-align: middle; }
/* шапка табеля: число — голубоватое, день недели — чёрный крупнее */
/* шапка табеля и ведомости: ярко-зелёный фон, чёрные буквы */
.hr-tabel thead th, .hr-pay thead th { background: #2ecc40; color: #111; font-weight: 700; }
/* выходные дни (сб/вс) в шапке табеля — ярко-красноватые */
.hr-tabel thead th.tb-we { background: #ff5a52; }
.hr-tabel thead th .tb-wd { color: #111; font-size: 15px; font-weight: 800; letter-spacing: .2px; }
.hr-tabel thead th.tb-we, .hr-tabel thead th.tb-hol { color: #111; }
.hr-tabel thead th.tb-we .tb-wd, .hr-tabel thead th.tb-hol .tb-wd { color: #111; }
.hr-tabel td.tb-flat { outline: 1px dashed #8a8a8a; outline-offset: -2px; }
.hr-tabel td.tb-short { color: #e22424; font-weight: 700; }
/* смена попала на выходной/нерабочий день — ярко-красноватая */
.hr-tabel td.tb-holwork { background: #ff5a52; font-weight: 700; color: #111; }
.hr-tabel thead th { min-width: 26px; font-size: 13px; font-weight: 700; }
.hr-tabel td.tb-graphoff { background: var(--gray-bg); color: var(--muted); }
.hr-tabel td.tb-cell { text-align: center; cursor: pointer; min-width: 26px; font-variant-numeric: tabular-nums; white-space: nowrap; user-select: none; }
.hr-tabel td.tb-off { background: var(--surface-2); }
.hr-tabel td.tb-mark { color: var(--warn); font-weight: 700; }
.hr-tabel td.tb-over { background: var(--warn-bg); }
.hr-pay td, .hr-pay td.num { white-space: nowrap; }
.hr-pay td.bonus-cell { white-space: normal; min-width: 70px; max-width: 90px; }
/* шапка ведомости: перенос названий колонок в высоту, не в ширину */
.hr-pay thead th { white-space: normal; word-wrap: break-word; overflow-wrap: break-word; hyphens: auto; max-width: 110px; min-width: 64px; vertical-align: middle; line-height: 1.2; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 420px; }
.cal-day { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 0 4px; cursor: pointer; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cal-day span { font-size: 10px; font-weight: 700; }
.cal-day.cal-hol { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.cal-day.cal-work { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.hr-tabel { table-layout: fixed; width: 100%; min-width: max-content; }
.hr-tabel th:first-child, .hr-tabel td:first-child { width: 34px; min-width: 34px; }
.hr-tabel th:nth-child(2), .hr-tabel td:nth-child(2) { width: 210px; max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.hr-tabel th:not(:first-child) { overflow: hidden; }
.hr-tabel td.tb-cell { overflow: hidden; }
.deptrow td { background: var(--surface-2); font-weight: 700; text-align: left; padding: 4px 8px; letter-spacing: .3px; }

/* ===== Печать табеля (сборка 62) =====
   Правила стоят В КОНЦЕ файла и с повышенной специфичностью: раньше экранные правила
   (.hr-tabel th:nth-child(2) { width: 210px } и др.) перебивали печатные, из-за чего итоги
   («Часы» больше 100) налезали на соседнюю колонку, а «10,5» в клетках дня обрезалось.
   Ширины: № 26 | сотрудник 170 | день 20 | Дни 30 | Часы 46 | Пер. 42 | Б, О, У по 24 (px). */
@media print {
  table.t.hr-tabel { table-layout: fixed; width: 100% !important; min-width: 0 !important; font-size: 7pt; }
  table.t.hr-tabel th, table.t.hr-tabel td { padding: 2px 1px; max-width: none; overflow: visible; text-overflow: clip; white-space: nowrap; }
  table.t.hr-tabel thead th { min-width: 0; font-size: 6.5pt; line-height: 1.15; }
  table.t.hr-tabel .tb-wd { display: block; font-size: 5.5pt; white-space: nowrap; }
  table.t.hr-tabel td.tb-cell { min-width: 0; font-size: 6.5pt; letter-spacing: -.1px; }
  table.t.hr-tabel th:nth-child(1), table.t.hr-tabel td:nth-child(1) { width: 26px; min-width: 0; text-align: center; }
  table.t.hr-tabel th:nth-child(2), table.t.hr-tabel td:nth-child(2) { width: 170px; min-width: 0; text-align: left; white-space: normal; padding: 2px 3px; overflow: hidden; }
  table.t.hr-tabel th:nth-child(n+3), table.t.hr-tabel td:nth-child(n+3) { width: 20px; min-width: 0; text-align: center; }
  table.t.hr-tabel th:nth-last-child(6), table.t.hr-tabel td:nth-last-child(6) { width: 30px; }
  table.t.hr-tabel th:nth-last-child(5), table.t.hr-tabel td:nth-last-child(5) { width: 46px; }
  table.t.hr-tabel th:nth-last-child(4), table.t.hr-tabel td:nth-last-child(4) { width: 42px; }
  table.t.hr-tabel th:nth-last-child(3), table.t.hr-tabel td:nth-last-child(3),
  table.t.hr-tabel th:nth-last-child(2), table.t.hr-tabel td:nth-last-child(2),
  table.t.hr-tabel th:nth-last-child(1), table.t.hr-tabel td:nth-last-child(1) { width: 24px; }
  table.t.hr-tabel th:nth-last-child(-n+6) { font-size: 7pt; }
  table.t.hr-tabel td.num { font-size: 8pt; text-align: center; }
  table.t.hr-tabel td.num b { font-size: 8pt; }
  table.t.hr-tabel td:nth-child(1) { font-size: 7pt; }
  table.t.hr-tabel td:nth-child(2), table.t.hr-tabel td:nth-child(2) * { font-size: 7pt; }
  table.t.hr-tabel .deptrow td { text-align: left; white-space: nowrap; padding: 2px 4px; font-size: 7.5pt; }
  table.t.hr-tabel tbody tr { break-inside: avoid; }
}

/* ===== Сборка 65: широкая модалка рецептуры, сетка формы, аналитика ===== */
.modal-box.wide { max-width: min(1180px, 97vw); max-height: 94vh; }
.ing-modal-grid { display: grid; grid-template-columns: minmax(260px, 320px) 1fr; gap: 14px; align-items: start; }
@media (max-width: 899px) { .ing-modal-grid { grid-template-columns: 1fr; } }

/* ===== Сборка 70: высокая модалка рецептуры — на весь экран, без внутреннего скролла ===== */
.modal-box.tall { max-width: min(1180px, 97vw); max-height: 94vh; height: auto; display: flex; flex-direction: column; }
.modal-box.tall #modal-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.modal-box.tall #modal-body > form { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.modal-box.tall .ing-modal-grid { flex: 1 1 auto; min-height: 0; align-items: stretch; }
.modal-box.tall .ing-modal-grid > div:last-child { display: flex; flex-direction: column; min-height: 0; }
.modal-box.tall .tablewrap { flex: 1 1 auto; min-height: 0; max-height: none; }

/* ===== Сборка 72: модалка рецептуры — прокрутка левой колонки, окно выше низа ===== */
.modal-box.tall .ing-modal-grid > div:first-child { overflow-y: auto; min-height: 0; padding-right: 4px; }
.modal.tall-wrap { align-items: flex-start; }
.modal.tall-wrap .modal-box { margin-top: 10px; margin-bottom: 10px; }

/* ===== Сборка 72: ингредиенты сверх рецептуры — светло-красная подсветка ===== */
tr.ing-extra td { background: #ffd2d2; }
tr.ing-extra td:first-child { color: #7a1f1f; font-weight: 600; }
tr.ing-extra input { background: #fff2f2; border-color: #e8a0a0; }
/* сборка 84: тёмная подсветка — только в тёмной теме (раньше включалась и в светлой) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) tr.ing-extra td { background: #6b3434; }
  :root:not([data-theme="light"]) tr.ing-extra td:first-child { color: #ffb3b3; }
}

/* ===== сборка 84 ===== */
/* строка реквизитов записи: без точек-разделителей, элементы через отступ */
.meta { display: inline-flex; flex-wrap: wrap; align-items: center; column-gap: 14px; row-gap: 2px; }
.meta > span { white-space: nowrap; }
/* доп. ингредиент */
.ing-dop { color: #a33; font-weight: 500; font-size: 12.5px; }
tr.ing-extra .ing-dop { color: inherit; opacity: .75; }
.ing-plus { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px; background: var(--warn-bg, #fff3d6); color: var(--warn, #9a6200); font-size: 12px; font-weight: 600; white-space: nowrap; }
/* аналитика «факт против нормы»: во всю ширину, числовые столбцы равной ширины */
table.an-tbl { table-layout: fixed; width: 100%; min-width: 640px; }
table.an-tbl col.c-name { width: 28%; }
table.an-tbl col.c-unit { width: 8%; }
table.an-tbl th:not(:first-child), table.an-tbl td:not(:first-child) { white-space: nowrap; padding-left: 12px; }
table.an-tbl th:first-child, table.an-tbl td:first-child { overflow-wrap: anywhere; }
table.an-tbl.an-days { table-layout: auto; }
/* отчёт по остаткам: во всю ширину, заголовки переносятся */
table.rep-tbl { width: 100%; table-layout: fixed; min-width: 1060px; }
table.rep-tbl th:first-child, table.rep-tbl td:first-child { width: 22%; overflow-wrap: anywhere; }
table.rep-tbl th:nth-child(2), table.rep-tbl td:nth-child(2) { width: 5%; }
table.rep-tbl th, table.rep-tbl td { padding-left: 8px; padding-right: 8px; }
.layout > div { min-width: 0; }
table.rep-tbl th { white-space: normal; vertical-align: bottom; line-height: 1.2; }
table.rep-tbl td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.an-tbl th { white-space: nowrap; vertical-align: bottom; line-height: 1.2; }
table.an-tbl th .small { font-weight: 400; opacity: .75; }
table.an-tbl td.unit { color: var(--muted); white-space: nowrap; }
table.an-tbl td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.an-days td:nth-child(2) { white-space: normal; }
/* справочник ингредиентов внутри рецептуры */
.rc-dir { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.rc-dir summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.rc-dir table td { padding: 4px 6px; }
.rc-dir input, .rc-dir select { min-height: 32px; padding: 4px 8px; }
/* план-факт */
.pf-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.pf-kpi .k { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.pf-kpi .k span { display: block; color: var(--muted); font-size: 12.5px; }
.pf-kpi .k b { font-size: 20px; }
.pf-kpi .k.bad b { color: var(--bad); }
.pf-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.pf-card { cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; text-align: left; font: inherit; color: inherit; }
.pf-card:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(16,24,40,.08); }
.pf-card h3 { margin: 0 0 6px; font-size: 16px; }
.pf-card .big { font-size: 22px; font-weight: 700; }
.pf-card p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.pf-crumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; font-size: 14px; }
.pf-crumbs a { cursor: pointer; color: var(--primary); text-decoration: none; }
.pf-nofact { color: var(--muted); font-style: italic; }

/* ---------- сборка 86: дашборд, компактные карточки, архив ---------- */
.homegrid.compact { max-width: 760px; margin: 14px auto 8px; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.homegrid.compact .homecard { flex-direction: row; text-align: left; padding: 12px 16px; gap: 12px; border-radius: 12px; }
.homegrid.compact .homecard .hc-ic svg { width: 28px; height: 28px; }
.homegrid.compact .homecard h2 { font-size: 16px; }
.homegrid.compact .homecard p { font-size: 12.5px; }
@media (max-width: 640px) { .homegrid.compact { grid-template-columns: 1fr; } }
.arch-sc label { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.arch-sc input[type=checkbox] { width: auto; min-height: 0; }
.prof-sw { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.role-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.swatch { width: 34px; height: 34px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; padding: 0; min-height: 0; }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }

.home-band { margin: 0 0 14px; padding: 14px; background: linear-gradient(100deg, #2f45e6 0%, #2538c4 45%, #1f9e96 100%); border-radius: 14px; }
.home-band .homegrid.compact { margin: 0 !important; max-width: none !important; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.home-band .homecard { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); box-shadow: none; color: #fff; backdrop-filter: blur(2px); }
.home-band .homecard:hover { background: rgba(255,255,255,.2); }
.home-band .homecard h2 { color: #fff; } .home-band .homecard p { color: rgba(255,255,255,.8); }
.home-band .homecard .hc-ic { background: rgba(255,255,255,.18); color: #fff; border-radius: 10px; }
.home-band .homecard .hc-ic svg { color: #fff; fill: currentColor; }
.layout.on-home { background: #1a1c3a; }
.layout.on-home main { max-width: none; padding: 16px 20px calc(var(--nav-h) + 24px); }
/* тёмный дашборд */
.dash { max-width: none; margin: 0; }
.dash.dark { --d-bg: #23264a; --d-p: #2d3159; --d-p2: #363b6b; --d-tx: #e8ebff; --d-mu: #9aa3d6; --d-teal: #27d3b8; --d-blue: #3347e8; --d-yel: #f5b800; --d-red: #ff6b6b; --d-line: #444a82;
  background: var(--d-bg); color: var(--d-tx); border-radius: 0; padding: 0; background: transparent; }
.dash-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dash-head h2 { margin: 0; font-size: 16px; letter-spacing: .08em; text-transform: uppercase; color: var(--d-tx); }
.dash.dark .seg { background: var(--d-p); } .dash.dark .seg button { color: var(--d-mu); } .dash.dark .seg button.on { background: var(--d-blue); color: #fff; box-shadow: none; }
.seg.sm { margin: 0; display: inline-grid; } .seg.sm button { padding: 4px 12px; font-size: 13px; min-height: 30px; }
.dg { display: grid; gap: 12px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.dp { background: var(--d-p); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.dp h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--d-teal); font-weight: 600; border-bottom: 1px solid var(--d-teal); display: inline-block; padding-bottom: 2px; }
.dp-h { display: flex; align-items: center; }
.g-ring { grid-column: span 3; } .g-chart { grid-column: span 6; } .g-fun { grid-column: span 3; }
.g-strip { grid-column: 1 / -1; min-width: 0; } .strip-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; } .strip-h h3 { margin-bottom: 8px; }
.g-art, .g-dn, .g-buy { grid-column: span 3; } .g-tbl { grid-column: 1 / -1; }
@media (max-width: 1000px) { .g-ring, .g-fun, .g-art, .g-buy, .g-dn { grid-column: span 6; } .g-chart { grid-column: 1 / -1; order: -1; }  }
@media (max-width: 640px) { .g-ring, .g-fun, .g-art, .g-buy, .g-dn { grid-column: 1 / -1; }  }
.ringbox { position: relative; width: 130px; height: 130px; margin: 0 auto 8px; }
.ring { width: 100%; height: 100%; } .ring-bg { fill: none; stroke: var(--d-p2); stroke-width: 10; } .ring-fg { fill: none; stroke-width: 10; stroke-linecap: round; }
.ring-n { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--d-yel); }
.ring-n b { font-size: 38px; line-height: 1; } .ring-n small { font-size: 16px; margin: 6px 0 0 2px; }
.dp-rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.dp-rows span { display: block; font-size: 11px; color: var(--d-mu); } .dp-rows b { font-size: 18px; }
.teal { color: var(--d-teal); } .red { color: var(--d-red); } .yel { color: var(--d-yel); }
.dk-d { font-size: 12px; color: var(--d-mu); display: block; margin-top: 6px; } .dk-d.pos { color: var(--d-teal); } .dk-d.neg { color: var(--d-red); }
.dash-chart { width: 100%; height: auto; display: block; }
.dc-grid { stroke: var(--d-line); stroke-width: 1; opacity: .6; } .dc-tx { fill: var(--d-mu); font-size: 15px; }
.dc-line { fill: none; stroke: var(--d-teal); stroke-width: 2.6; } .dc-area { fill: var(--d-teal); opacity: .16; }
.dc-dot { fill: var(--d-teal); stroke: var(--d-p); stroke-width: 1.5; } .dc-dot.z { fill: var(--d-mu); opacity: .4; }
.fun-r { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 8px; margin: 8px 0; font-size: 12px; color: var(--d-mu); }
.fun-r i { display: block; height: 28px; border-radius: 14px; position: relative; } .fun-r i.f1 { background: linear-gradient(90deg, #2f9f9a, var(--d-teal)); } .fun-r i.f2 { background: linear-gradient(90deg, #2538c4, var(--d-blue)); }
.fun-r i b { position: absolute; right: 10px; top: 4px; color: #fff; font-size: 13px; }
.fun-c { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px; color: var(--d-mu); font-size: 12px; } .fun-c b { font-size: 28px; color: var(--d-teal); }
.mc { background: var(--d-p); border-radius: 12px; overflow: hidden; border-top: 4px solid var(--d-blue); } .mc.out, .mc.crit { border-top-color: var(--d-red); } .mc.warn { border-top-color: var(--d-yel); }
.mc-h { display: flex; justify-content: space-between; gap: 6px; padding: 10px 14px 6px; align-items: baseline; } .mc-h b { font-size: 14px; } .mc-t { font-size: 11px; text-transform: uppercase; color: var(--d-mu); }
.segbar { display: flex; gap: 2px; padding: 0 14px; height: 18px; } .segbar i { flex: 1; background: var(--d-p2); border-radius: 1px; } .segbar i.on { background: var(--d-blue); }
.segbar.warn i.on { background: var(--d-yel); } .segbar.out i.on, .segbar.crit i.on { background: var(--d-red); } .segbar.ok i.on { background: var(--d-teal); }
.mc-b { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 10px 14px 12px; } .mc-b span { display: block; font-size: 11px; color: var(--d-mu); } .mc-b b { font-size: 14px; } .mc-b b.big { font-size: 26px; color: var(--d-yel); line-height: 1.1; }
.dash.dark .bar { display: grid; grid-template-columns: minmax(70px, 150px) 1fr auto; gap: 8px; align-items: center; margin: 7px 0; font-size: 13px; }
.bar .bn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bar .bv { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--d-mu); }
.bar .bt { background: var(--d-p2); border-radius: 3px; height: 12px; overflow: hidden; } .bar .bt i { display: block; height: 100%; background: var(--d-blue); } .bar .bt i.alt { background: var(--d-teal); }
.g-buy.hot { box-shadow: inset 0 0 0 1px var(--d-yel); }
.buy { padding: 5px 0; border-bottom: 1px solid var(--d-line); } .buy:last-of-type { border-bottom: 0; } .buy b { display: block; font-size: 14px; } .buy .dk-d { margin-top: 0; }
.dtw { max-height: 300px; overflow: auto; } .dt { width: 100%; border-collapse: collapse; font-size: 13px; } .dt th { text-align: left; color: var(--d-mu); font-weight: 600; padding: 6px 8px; position: sticky; top: 0; background: var(--d-p); }
.dt td { padding: 6px 8px; border-top: 1px solid var(--d-line); font-variant-numeric: tabular-nums; } .dt td:not(:first-child), .dt th:not(:first-child) { text-align: right; }

.dash-ctl { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.dash.dark .dp { min-height: 0; }
.g-chart .dash-chart { min-height: 220px; }

.layout.on-home .topbar { background: #1f2247 !important; border-bottom: 1px solid #343a7a; }
.muted-d { font-size: 12px; color: var(--d-mu); }
.dash-head .muted-d { margin-left: 4px; }
.dp.link, .mc.link, .buy.link, .dt tr.link { cursor: pointer; }
.dp.link:hover, .mc.link:hover { box-shadow: 0 0 0 1px var(--d-teal); }
.dt tr.link:hover td, .buy.link:hover b { color: var(--d-teal); }
.dp-open { color: var(--d-teal); font-size: 12px; cursor: pointer; margin-left: 10px; text-decoration: none; }
.strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.strip .mc { flex: 0 0 calc(25% - 9px); min-width: 250px; scroll-snap-align: start; }
.strip::-webkit-scrollbar, .scr::-webkit-scrollbar, .dtw::-webkit-scrollbar { height: 8px; width: 8px; } .strip::-webkit-scrollbar-thumb, .scr::-webkit-scrollbar-thumb, .dtw::-webkit-scrollbar-thumb { background: #4a52a0; border-radius: 4px; }
.scr { max-height: 290px; overflow-y: auto; padding-right: 4px; }
.donut { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.donut-svg { width: 150px; height: 150px; flex: none; } .dn-b { fill: var(--d-tx); font-size: 12.5px; font-weight: 700; } .dn-s { fill: var(--d-mu); font-size: 10px; }
.dn-leg { width: 100%; font-size: 12.5px; } .dn-leg div { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; padding: 2px 0; }
.dn-leg i { width: 10px; height: 10px; border-radius: 3px; } .dn-leg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dn-leg b { color: var(--d-mu); font-weight: 600; }

/* ---------- сборка 92: единый тёмный стиль всех страниц ---------- */
.layout, .login, .modal {
  --bg: #1a1c3a; --surface: #2d3159; --surface-2: #363b6b; --text: #e8ebff; --muted: #9aa3d6; --line: #444a82;
  --primary: #3347e8; --primary-2: #4a5cff; --on-primary: #ffffff; --shadow: none;
  --ok-bg: #1d3a3a; --ok: #27d3b8; --warn-bg: #3d3a1a; --warn: #f5b800; --bad-bg: #4a2433; --bad: #ff7a7a; --gray-bg: #363b6b;
  background: var(--bg); color: var(--text); color-scheme: dark;
}
.layout .topbar, .layout .topbar { background: #1f2247 !important; border-bottom: 1px solid #343a7a; }
.layout .side, .layout .side { background: #23264a; border-color: #343a7a; }
.layout .side a.active, .layout .side a.active { background: linear-gradient(100deg, #3347e8, #2538c4); }
.layout .homegrid:not(.compact) .homecard { background: var(--surface); border: 1px solid var(--line); }
.layout .homegrid:not(.compact) .homecard:hover { border-color: #27d3b8; box-shadow: 0 0 0 1px #27d3b8; transform: translateY(-2px); }
.layout .homegrid:not(.compact) .homecard h2 { color: #27d3b8; text-transform: uppercase; font-size: 15px; letter-spacing: .05em; }
.layout .hc-ic, .layout .hc-ic { background: linear-gradient(135deg, #3347e8, #27d3b8); }
.layout .card, .layout .pf-card { background: var(--surface); border-color: var(--line); }
.layout .pf-card h3 { color: #27d3b8; text-transform: uppercase; font-size: 14px; letter-spacing: .05em; }
.layout .pf-card:hover { border-color: #27d3b8; }
.layout .tablewrap { border-color: var(--line); background: var(--surface); }
.layout .t th { background: #3347e8; color: #fff; }
.layout input, .layout select { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.layout .pf-crumbs a,.layout .pf-crumbs .cur{color:#5eead4}

.layout .modal, .layout .dlg, .layout .sheet { background: var(--surface); color: var(--text); }
.layout textarea { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.layout .t td { border-color: var(--line); }
.layout .t tr:hover td { background: var(--surface-2); }
.layout .btn:not(.primary) { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.layout { --prod: #3ddc97; --defect: #ff7a7a; --order: #c58bff; --ship: #ffd54f; }
.layout .seg { background: #23264a; }
.layout .seg button.on { background: linear-gradient(100deg, #3347e8, #2538c4); color: #fff; box-shadow: none; }
.layout .seg button.on.prod, .layout .seg button.on.defect, .layout .seg button.on.order, .layout .seg button.on.ship { color: #fff; }
.layout h2, .layout h3 { color: var(--text); }
.layout .card > h2:first-child, .layout .card > h3:first-child { color: #27d3b8; }
.layout .kpi { background: var(--surface); border-color: var(--line); }

body:has(.login) { background: #1a1c3a; }
.login .card, .modal-box { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.login input, .modal input, .modal select, .modal textarea { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.modal .t th { background: #3347e8; color: #fff; }
.modal { --prod: #3ddc97; --defect: #ff7a7a; }
.login .btn.primary, .login button[type=submit] { background: linear-gradient(100deg, #3347e8, #2538c4); color: #fff; }
/* сборка 93: выходной/сверхурочный день в табеле — яркий жёлтый, чёрные цифры */
.hr-tabel td.tb-over, .layout .hr-tabel td.tb-over { background: #ffe600 !important; color: #111 !important; font-weight: 700; }
.hr-tabel td.tb-holwork, .layout .hr-tabel td.tb-holwork { color: #111 !important; }
