/* План производства — вид «производственной ведомости»: линованные таблицы, моноширинное время,
   один сигнальный цвет для «сейчас» и опозданий. */

@font-face { font-family: "Plex Sans"; font-weight: 400; font-display: swap;
  src: url(/static/fonts/ibm-plex-sans-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Sans"; font-weight: 400; font-display: swap;
  src: url(/static/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF, U+2212; }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-display: swap;
  src: url(/static/fonts/ibm-plex-sans-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-display: swap;
  src: url(/static/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF, U+2212; }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap;
  src: url(/static/fonts/ibm-plex-mono-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap;
  src: url(/static/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF, U+2212; }

:root {
  --bg: #f2f0ec;
  --surface: #ffffff;
  --sunken: #f7f6f3;
  --ink: #1b1a17;
  --muted: #6b6760;
  --line: #dcd8d0;
  --signal: #d4440c;
  --signal-soft: #fdebe3;
  --ok: #2b7a3d;
  --warn: #9a5a00;
  --hi: #fff3bf;
  --sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121110;
    --surface: #1b1a18;
    --sunken: #161513;
    --ink: #ecebe6;
    --muted: #9c978d;
    --line: #34312c;
    --signal: #ff6a3a;
    --signal-soft: #3a1f15;
    --ok: #7ccb8d;
    --warn: #e9b25c;
    --hi: #39331a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 var(--sans); background: var(--bg); color: var(--ink); }
main { max-width: 1120px; margin: 0 auto; padding: 20px 16px 48px; }
body.narrow main { max-width: 620px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1 { font-size: 1.75rem; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 6px; }
h2 { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted);
  margin: 32px 0 10px; }
h3 { font-size: 1rem; font-weight: 600; margin: 0; }
p { margin: 8px 0; }
code { font-family: var(--mono); font-size: 0.9em; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono, td.num, th.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.num, th.num { text-align: right; }
.nowrap { white-space: nowrap; }
.eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* шапка */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: stretch; height: 48px;
  background: var(--ink); color: var(--bg); padding: 0 8px 0 16px; }
.brand { display: flex; align-items: center; font-family: var(--mono); font-weight: 500; letter-spacing: 0.12em;
  text-decoration: none; margin-right: 16px; }
.topbar nav { display: flex; align-items: stretch; flex: 1; }
.topbar nav > a, .more > summary { display: flex; align-items: center; padding: 0 12px; text-decoration: none;
  color: inherit; opacity: 0.72; cursor: pointer; border-bottom: 3px solid transparent; }
.topbar nav > a:hover, .more > summary:hover { opacity: 1; }
.topbar nav > a.active { opacity: 1; border-bottom-color: var(--signal); }
.clock { display: flex; align-items: center; font-family: var(--mono); padding: 0 8px; opacity: 0.85; }
.more { position: relative; display: flex; margin-left: auto; }
.more > summary { list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.menu { position: absolute; right: 0; top: 100%; min-width: 240px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--ink); display: flex; flex-direction: column; }
.menu a { padding: 11px 14px; text-decoration: none; border-bottom: 1px solid var(--line); }
.menu a:last-child { border-bottom: 0; }
.menu a:hover { background: var(--sunken); }

/* заголовок страницы */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; }
.page-head { border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 14px; }
.meta { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
.nav-days { display: flex; gap: 6px; align-items: center; }
.nav-days > * { flex: 0 0 auto; }
/* Safari на iPhone рисует поле даты шире, чем отдаёт ему строка, и оно наезжало на стрелку: ширина — явно */
.nav-days input { width: 10.5em; min-width: 10.5em; box-sizing: border-box; }
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; min-width: 0; }
input[type=date]::-webkit-date-and-time-value { text-align: left; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.toolbar form { display: flex; gap: 6px; align-items: center; margin: 0; }
.toolbar details { position: relative; }
.toolbar details > summary { list-style: none; }
.toolbar details > summary::-webkit-details-marker { display: none; }
.toolbar details[open] > form { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; background: var(--surface);
  border: 1px solid var(--ink); padding: 8px; margin: 0; }

/* блоки */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 2px; padding: 14px 16px; margin: 12px 0; }
.alert { border-left: 4px solid var(--signal); background: var(--signal-soft); padding: 10px 12px; }
.warn, .info { border-left: 3px solid var(--warn); padding: 4px 0 4px 12px; margin: 4px 0; }
.info { border-left-color: var(--line); color: var(--muted); }
.ok { border-left: 3px solid var(--ok); padding: 4px 0 4px 12px; color: var(--ok); }
.notes { list-style: none; margin: 14px 0; padding: 0; }

/* штамп статуса */
.badge { display: inline-block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 1px 6px; border: 1.5px solid var(--muted); color: var(--muted); border-radius: 2px; vertical-align: 2px;
  white-space: nowrap; }
.badge.ok { border-color: var(--ok); color: var(--ok); padding: 1px 6px; }
.badge.late { border-color: var(--signal); color: var(--signal); }
.dot { display: inline-block; flex: none; width: 9px; height: 9px; margin-right: 7px; vertical-align: 1px; }

/* формы */
label { display: flex; flex-direction: column; gap: 5px; font-size: 0.85rem; font-weight: 600; }
input, select, textarea, button, .button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-bottom-color: var(--muted);
  border-radius: 2px; background: var(--surface); font-weight: 400; font-size: 15px; }
input[type=time], input[type=date], input[name$=duration], input[name=interval], input[name=line_interval],
input[name=batches], input.pieces { font-family: var(--mono); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px;
  padding: 0 14px; border: 1.5px solid var(--ink); border-radius: 2px; background: transparent; text-decoration: none;
  cursor: pointer; white-space: nowrap; font-weight: 600; }
button:hover, .button:hover { background: var(--sunken); }
.primary { background: var(--ink); color: var(--bg); }
.primary:hover { background: var(--ink); opacity: 0.88; }
.danger { border-color: var(--signal); color: var(--signal); }
.big { min-height: 52px; padding: 0 22px; font-size: 1.02rem; }
.icon { min-width: 40px; padding: 0 10px; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; font-size: 0.95rem; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }

/* сводка дня */
.summary { display: flex; flex-wrap: wrap; margin: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary > div { padding: 10px 18px 10px 0; margin-right: 18px; border-right: 1px solid var(--line); }
.summary > div:last-child { border-right: 0; }
.summary b { display: block; font-family: var(--mono); font-weight: 500; font-size: 1.35rem; line-height: 1.2; }
.summary span { font-size: 0.82rem; color: var(--muted); }

/* таблицы */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1.5px solid var(--ink); white-space: nowrap; background: var(--surface); }
tr:last-child td { border-bottom: 0; }
td.time { font-family: var(--mono); white-space: nowrap; }
tr.done td { color: var(--muted); }
tr.active td { background: var(--hi); }
.editor td { padding: 6px; vertical-align: middle; }
.editor input, .editor select { min-height: 36px; padding: 6px 8px; }
.row-actions { display: flex; gap: 4px; }
.row-actions button { min-height: 36px; min-width: 36px; padding: 0; border-width: 1px; border-color: var(--line); }

/* блок цеха */
.ws { margin: 18px 0 26px; }
.ws-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 0 8px; }
.ws-head h3 { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.ws-head .swatch { flex: none; width: 14px; height: 14px; }
.ws .table-wrap { border-top: 2px solid var(--ink); }

/* диаграмма дня */
.gantt { --label: 150px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); }
.gantt-inner { min-width: 780px; position: relative; padding-bottom: 6px; }
.g-row { position: relative; z-index: 1; display: grid; grid-template-columns: var(--label) 1fr; align-items: center;
  min-height: 26px; border-bottom: 1px solid var(--sunken); }
.g-label { position: sticky; left: 0; z-index: 2; background: var(--surface); padding: 0 10px; font-size: 0.85rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 100%; display: flex; align-items: center; }
.g-track { position: relative; height: 20px; margin-right: 12px; }
.g-bar { position: absolute; top: 3px; height: 14px; }
.g-bar.wait { opacity: 0.8; background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--surface) 3px 6px); }
.g-bar.done { box-shadow: inset 0 -3px 0 var(--ok); }
.g-bar.active { outline: 2px solid var(--ink); }
.g-hours { position: relative; height: 26px; margin: 0 12px 0 var(--label); border-bottom: 1.5px solid var(--ink); }
.g-hour { position: absolute; bottom: 4px; font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  transform: translateX(-50%); }
.g-lines { position: absolute; top: 26px; bottom: 0; left: var(--label); right: 12px; pointer-events: none; }
.g-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.g-now { position: absolute; top: -26px; bottom: 0; width: 2px; background: var(--signal); z-index: 3; }
.g-now span { position: absolute; top: 2px; left: 5px; font-family: var(--mono); font-size: 0.68rem; color: var(--signal);
  background: var(--surface); padding: 0 3px; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.82rem; color: var(--muted); margin: 8px 0; }
.legend .hatch { display: inline-block; width: 22px; height: 10px; margin-right: 6px; vertical-align: 0;
  background: repeating-linear-gradient(135deg, var(--muted) 0 3px, transparent 3px 6px); }

/* экран цеха: сигнал «скоро / пора» */
.signal { position: sticky; top: 48px; z-index: 15; margin: 0 -16px 10px; padding: 14px 16px; font-weight: 600;
  font-size: 1.1rem; cursor: pointer; }
.signal.soon { background: var(--hi); color: var(--ink); border-bottom: 2px solid var(--warn); }
.signal.due, .signal.late { background: var(--signal); color: #fff; animation: pulse 1s steps(2, start) infinite; }
@keyframes pulse { 50% { filter: brightness(1.25); } }
@media (prefers-reduced-motion: reduce) { .signal.due, .signal.late { animation: none; } }
.task.soon .time { color: var(--warn); }
.task.due { box-shadow: inset 4px 0 0 var(--signal); }
.task.due .time { color: var(--signal); }

/* экран цеха: лента заданий */
.tasks { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--ink); }
.task { display: grid; grid-template-columns: 80px 1fr auto; gap: 2px 14px; align-items: center;
  padding: 12px 6px 12px 0; border-bottom: 1px solid var(--line); background: var(--surface); }
.task .time { font-family: var(--mono); font-size: 1.25rem; font-weight: 500; padding-left: 12px;
  border-left: 5px solid var(--line); align-self: stretch; display: flex; align-items: center; }
.task .what b { display: block; font-weight: 600; }
.task .what span { color: var(--muted); font-size: 0.88rem; }
.task .act { display: flex; gap: 6px; }
.task .act form { display: flex; gap: 6px; margin: 0; }
.task .act .primary { min-height: 48px; min-width: 120px; }
.task .act .delay { min-height: 48px; border-color: var(--warn); color: var(--warn); }
.task .fact { grid-column: 2 / 4; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.task.done { background: var(--sunken); }
.hide-done .task.done { display: none; }
.task.done .what b { font-weight: 400; color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted); }
.task.active { background: var(--hi); }
.task.overdue .time { color: var(--signal); }
.task.wait { padding: 6px 6px 6px 0; background: var(--sunken); }
.task.wait .time { font-size: 0.95rem; color: var(--muted); }
.task.wait .what span { font-size: 0.86rem; }
.task.wait .what b { display: inline; color: var(--ink); }
.now-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--signal); font-family: var(--mono);
  font-size: 0.78rem; letter-spacing: 0.06em; }
.now-line::after { content: ""; flex: 1; height: 2px; background: var(--signal); }
@media (max-width: 560px) {
  h1 { font-size: 1.45rem; }
  main { padding-top: 14px; }
  .task { grid-template-columns: 70px 1fr; }
  .task .act { grid-column: 1 / 3; }
  .task .act form, .task .act .primary { flex: 1; }
  .task .fact { grid-column: 1 / 3; padding-left: 17px; }
  .gantt { --label: 112px; }
  .summary > div { padding-right: 12px; margin-right: 12px; }
  .topbar { padding-left: 12px; }
  .brand { margin-right: 4px; }
  .topbar nav > a, .more > summary { padding: 0 9px; }
  .clock { display: none; }
}

/* подовая печь: плитки подов */
.oven .next { padding: 4px 0 12px; margin-bottom: 14px; }
/* все печи на одном экране: на планшете рядом (ширина по числу мест), на телефоне — друг под другом */
.ovens-grid { display: flex; flex-wrap: wrap; gap: 0 28px; align-items: flex-start; }
.oven-block { min-width: 0; margin-bottom: 20px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.ovens-grid .decks { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
/* компактно: на 8-дюймовом планшете обе печи и очередь видны без прокрутки */
.ovens-head { margin-bottom: 6px; padding-bottom: 6px; }
.ovens-head h1 { font-size: 1.3rem; margin: 0; }
.oven-block > h2 { margin: 6px 0 2px; }
.ovens-grid .oven .next { padding: 0; margin-bottom: 8px; }
.ovens-grid .oven .next .eyebrow { margin-bottom: 0; }
.ovens-grid .next-what { font-size: 1.1rem; }
.ovens-grid .oven .blocked, .ovens-grid .oven .oven-msg { margin: 4px 0; padding-top: 2px; padding-bottom: 2px; }
.ovens-grid .deck { min-height: 0; padding: 8px 10px; gap: 2px; }
.ovens-grid .deck-time { font-size: 2.1rem; }
.ovens-grid .oven .after-title { margin: 8px 0 4px; }
.ovens-grid .oven .after li { padding-top: 2px; padding-bottom: 2px; font-size: 0.85rem; }
.ovens-grid .oven .next-meta { font-size: 0.78rem; }
.ovens-grid .oven .after li:nth-child(n+3) { display: none; }
.oven-block > h2 { margin-bottom: 4px; }
/* подсказка «как пользоваться» по кнопке «?» */
/* окно подсказки — от края блока кнопок, а не от самой «?»: на телефоне «?» переносится влево и окно уходило за экран */
.page-head .toolbar { position: relative; }
.help, .toolbar details.help { position: static; }
.help > summary { list-style: none; min-width: 44px; text-align: center; font-weight: 700; }
.help > summary::-webkit-details-marker { display: none; }
.help[open] > summary { background: var(--ink); color: var(--surface); }
.help-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(440px, 90vw);
  padding: 10px 14px; background: var(--surface); border: 2px solid var(--ink); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15); }
.help-body p { margin: 6px 0; }
@media (max-width: 560px) { .help-body { left: 0; right: 0; width: auto; } }
/* подовая печь: поды крупными полосами друг над другом, как в самой печи */
.decks.stack, .ovens-grid .decks.stack { grid-template-columns: 1fr; gap: 10px; }
.decks.stack .deck { display: grid; grid-template-columns: 5.5em auto 1fr; grid-template-rows: auto auto;
  align-items: center; column-gap: 18px; row-gap: 2px; min-height: 100px; padding: 10px 18px; }
.decks.stack .deck-no { grid-row: 1 / 3; font-size: 1rem; }
.decks.stack .deck-time { grid-row: 1 / 3; font-size: 3.2rem; min-width: 3.6em; }
.decks.stack .deck-what { align-self: end; font-size: 1.15rem; }
.decks.stack .deck-hint { align-self: start; font-size: 0.95rem; }
.decks.stack .deck.free .deck-time { font-size: 1.6rem; }
.decks.stack .deck-time { white-space: nowrap; }
.decks.stack .deck.done .deck-hint { font-size: 1.3rem; font-weight: 700; color: #fff; }
@media (max-width: 560px) {
  .decks.stack .deck { grid-template-columns: 4em 1fr; min-height: 96px; padding: 10px 12px; column-gap: 12px; }
  .decks.stack .deck-time { grid-row: 1; font-size: 2.6rem; min-width: 0; }
  .decks.stack .deck-what, .decks.stack .deck-hint { grid-column: 2; }
}
/* ротационная: что пора закатить в шокер */
.shock { margin-top: 14px; }
.shock-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.shock-list li.item { display: grid; grid-template-columns: 7.5em 1fr auto; align-items: center; gap: 12px;
  padding: 10px 12px; border: 2px solid var(--line); background: var(--surface); }
.shock-list li.item.due { border-color: var(--signal); background: var(--signal-soft); }
.shock-list .when { font-family: var(--mono); font-weight: 600; }
.shock-list li.item.due .when { color: var(--signal); }
.shock-list button { min-height: 48px; }
/* «Дальше по плану» справа от плиток, если по ширине хватает места, иначе снизу */
.oven-body { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: flex-start; }
.oven-body .decks { min-width: 0; }
.oven-body .after-box { flex: 1 1 220px; min-width: 0; }
.oven .after-box > .after-title:first-child, .ovens-grid .oven .after-box > .after-title:first-child { margin-top: 0; }
.oven .after-box .next { margin-bottom: 12px; }
.oven .after-title { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.next-what { font-size: 1.4rem; font-weight: 600; margin: 2px 0; }
.decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.deck { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px;
  min-height: 170px; padding: 14px; border: 2px solid var(--line); border-radius: 2px; background: var(--surface);
  text-align: left; white-space: normal; font-weight: 400; }
.deck:disabled { cursor: default; opacity: 1; }
.deck-cell { display: flex; flex-direction: column; gap: 6px; }
.deck-cell .deck { flex: 1; width: 100%; }
.deck-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border: 2px solid var(--ink); }
.deck-ask[hidden], .deck-ask button[hidden] { display: none; }
.deck-ask-q { flex: 1 1 100%; font-weight: 600; }
.deck-ask button { flex: 1 1 auto; min-height: 48px; }
.deck-no { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.deck-time { font-family: var(--mono); font-size: 2.6rem; line-height: 1.1; font-weight: 500; }
.deck-what { font-weight: 600; }
.deck-hint { font-size: 0.85rem; color: var(--muted); }
/* пустой под: серый «свободно»; можно грузить — белый, сплошная рамка, «Загрузить» */
.deck.free { background: var(--sunken); border-color: var(--line); }
.deck.free .deck-time { font-family: var(--sans); font-size: 1.2rem; font-weight: 500; color: var(--muted); }
.deck.ready { background: var(--surface); border-color: var(--ink); }
.deck.ready .deck-time { color: var(--ink); font-weight: 600; }
.deck.ready .deck-what { color: var(--ink); }
.deck.ready:active { background: var(--hi); }
.deck.busy { border-color: var(--ink); background: var(--hi); }
.deck.done { border-color: var(--signal); background: var(--signal); color: #fff; animation: pulse 1s steps(2, start) infinite; }
.deck.done .deck-no, .deck.done .deck-hint { color: #fff; }
@media (prefers-reduced-motion: reduce) { .deck.done { animation: none; } }
@media (max-width: 560px) {
  .deck { min-height: 0; padding: 10px 12px; }
  .deck-time { font-size: 2rem; }
}

/* цвета продукта */
.swatches { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatches legend { font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; padding: 0; }
.swatches label { display: block; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 30px; height: 30px; border: 2px solid var(--surface); outline: 1px solid var(--line); cursor: pointer; }
.swatches input:checked + span { outline: 2.5px solid var(--ink); }
.swatches input:focus-visible + span { outline: 2.5px solid var(--signal); }

/* печать */
/* табель: все по графику, мастер отмечает отличия */
.ot-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); }
.ot { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "who sum" "times times"; align-items: center;
  gap: 8px 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ot:last-child { border-bottom: 0; }
.ot.on { background: var(--hi); }
.ot-who { grid-area: who; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ot-times { grid-area: times; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.ot-times label { font-weight: 400; font-size: 0.78rem; color: var(--muted); min-width: 0; }
.ot-times input, .ot-times select { width: 100%; padding-left: 6px; padding-right: 4px; }
/* значок часов съедает место — время выбирают нажатием на само поле */
.ot-times input[type=time]::-webkit-calendar-picker-indicator { display: none; }
.ot-times input[type=time] { text-align: center; }
.ot.absent .ot-in { visibility: hidden; }
.ot-sum { grid-area: sum; font-family: var(--mono); font-size: 1.05rem; text-align: right; white-space: nowrap; }
.ot-sum b, .ot-sum em, .ot-sum i { display: block; }
.ot-sum i { font-style: normal; font-size: 0.85rem; color: var(--warn); }
@media (min-width: 760px) {
  .ot { grid-template-columns: minmax(200px, 1fr) 400px 8em; grid-template-areas: "who times sum"; }
}
.ot-sum b { color: var(--ok); }
.ot-sum em { font-style: normal; font-size: 0.85rem; color: var(--signal); }
.ot.absent .ot-sum { font-weight: 600; color: var(--warn); }
.ot-save { position: sticky; bottom: 0; padding: 10px 0; margin: 0; background: var(--bg); }
.staff-days { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; }
.timesheet { font-size: 8.5pt; }
.timesheet th, .timesheet td { padding: 3px 3px; }
.timesheet .weekend { background: #eee; }
.timesheet td.code { font-family: var(--sans); color: #666; } /* «В», «Б» моноширинным похожи на 8 и 6 */
body.print { background: #fff; color: #000; font-size: 11pt; }
body.print main { max-width: none; padding: 0; }
.sheet { break-after: page; }
.sheet h2 { color: #000; font-size: 13pt; letter-spacing: 0; text-transform: none; border-bottom: 2px solid #000; padding-bottom: 4px; }
.sheet th, .sheet td { border: 1px solid #777; padding: 4px 6px; color: #000; }
@media print { .no-print { display: none !important; } }

/* неделя: выпуск продукции */
.output tr.total td { border-top: 2px solid var(--ink); }
.staff-list { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px solid var(--line); }
.staff-list li a { display: flex; flex-direction: column; gap: 2px; padding: 12px 4px; border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none; }
.staff-list li a:hover { background: var(--surface); }
.staff-list.gone li a { opacity: .6; }
