:root {
  /* Gemini Shift — італійський стиль: кремовий фон, еспресо */
  --bg: #f6f1e7;
  --surface: #fffdf8;
  --surface-2: #faf5ec;
  --ink: #2a1d14;
  --muted: #7a6a5c;
  --line: #e6dccb;
  --accent: #6f3b1f;
  --accent-ink: #fffaf0;
  --accent-soft: #f2e4d3;
  --font-serif: "Didot", "Bodoni MT", Georgia, "Cambria", "Times New Roman", serif;
  --ok: #16a34a;
  --ok-soft: #e3f6ea;
  --warn: #d97706;
  --warn-soft: #fdf1df;
  --bad: #dc2626;
  --bad-soft: #fde8e8;
  --idle: #98a2b3;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16110d; --surface: #1f1813; --surface-2: #261e18; --ink: #f1e9dd; --muted: #b4a594; --line: #3a2e25;
    --accent: #d9a066; --accent-ink: #1f1813; --accent-soft: #3a2a1c; --ok: #34c06a; --ok-soft: #14301f; --warn: #f0a33a; --warn-soft: #3a2a12;
    --bad: #f26363; --bad-soft: #3a1717; --shadow: 0 1px 3px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16110d; --surface: #1f1813; --surface-2: #261e18; --ink: #f1e9dd; --muted: #b4a594; --line: #3a2e25;
  --accent: #d9a066; --accent-ink: #1f1813; --accent-soft: #3a2a1c; --ok: #34c06a; --ok-soft: #14301f; --warn: #f0a33a; --warn-soft: #3a2a12;
  --bad: #f26363; --bad-soft: #3a1717; --shadow: 0 1px 3px rgba(0, 0, 0, .5); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Верхня панель ---------- */
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-serif); font-style: italic; font-weight: 700; font-size: 21px; letter-spacing: .2px; white-space: nowrap; color: var(--accent); }
.topbar { flex-wrap: wrap; }
.brand-mark { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-serif); font-style: italic; font-weight: 700; font-size: 18px; }
.topbar .spacer { flex: 1; }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); }
.who { display: flex; align-items: center; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.chip.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.chip.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.chip.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }

/* ---------- Кнопки й поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.input, select.input, textarea.input { width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
label.field > .input { color: var(--ink); font-size: 15px; }
label.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
label.check input { width: 18px; height: 18px; }

/* ---------- Екран входу ---------- */
.login-wrap { max-width: 980px; margin: 0 auto; padding: 32px 16px 48px; }
.login-wrap h1 { font-size: 30px; }
.login-wrap .sub { margin: 6px 0 24px; color: var(--muted); }
.user-group { margin: 22px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.user-tile { display: flex; align-items: center; gap: 14px; padding: 18px; min-height: 84px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer; text-align: left; font-size: 18px; font-weight: 600; }
.user-tile:hover { border-color: var(--accent); }
.avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.pin-panel { max-width: 380px; margin: 40px auto; text-align: center; }
.pin-panel h2 { font-size: 24px; margin-bottom: 18px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 10px 0 8px; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots span.on { background: var(--ink); border-color: var(--ink); }
.pin-error { min-height: 24px; color: var(--bad); font-weight: 600; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
.key { height: 78px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); font-size: 30px; font-weight: 600; cursor: pointer; user-select: none; }
.key:active { transform: scale(.97); background: var(--surface-2); }
.key.fn { font-size: 18px; color: var(--muted); }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- Адмінка ---------- */
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 57px); }
.sidenav { background: var(--surface); border-right: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.sidenav a { display: block; padding: 10px 14px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
.sidenav a:hover { background: var(--surface-2); }
.sidenav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.main { padding: 22px 24px 48px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-size: 22px; flex: 1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-pad { padding: 16px 18px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .input { max-width: 360px; }
.note { padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 14px; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.grid th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
table.grid tr.click { cursor: pointer; }
table.grid tr.click:hover td { background: var(--surface-2); }
table.grid tr.off td { color: var(--muted); }
table.grid td:first-child b { white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.center, th.center { text-align: center; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.stat { padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
ul.warn-list { margin: 6px 0 0; padding-left: 18px; color: var(--warn); }

/* Бокова панель деталей */
.drawer-back { position: fixed; inset: 0; background: rgba(15, 19, 26, .35); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100%); background: var(--bg); z-index: 21; overflow-y: auto; box-shadow: -8px 0 24px rgba(0, 0, 0, .15); }
.drawer.wide { width: min(1180px, 100%); }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.drawer-head h2 { font-size: 20px; flex: 1; }
.drawer-body { padding: 18px 20px; display: grid; gap: 16px; }
.visuals { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.visual { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: center; }
.visual h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; text-align: left; }
.visual img { max-width: 100%; max-height: 260px; border-radius: 8px; }
.visual .empty { display: grid; place-items: center; height: 160px; color: var(--muted); background: var(--surface-2); border-radius: 8px; }
dl.kv { display: grid; grid-template-columns: 200px 1fr; gap: 6px 14px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

/* Сповіщення */
.toast-box { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; }
.toast { padding: 10px 18px; border-radius: 10px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-weight: 600; }
.toast.bad { background: var(--bad); color: #fff; }

.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.big { min-height: 56px; padding: 12px 22px; font-size: 17px; border-radius: 12px; }

/* Модальне вікно: якщо вище за екран — прокручується, кнопки лишаються внизу видимими */
.modal-back { position: fixed; inset: 0; background: rgba(15, 19, 26, .45); z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--surface); border-radius: 16px; padding: 20px 22px 0; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.modal > .row-actions { position: sticky; bottom: 0; background: var(--surface); margin: 14px -22px 0; padding: 12px 22px 16px; border-top: 1px solid var(--line); }
.modal h2 { font-size: 20px; margin-bottom: 14px; }
.modal-body { display: grid; gap: 12px; }
.radio-list { display: grid; gap: 8px; }
.radio-list label { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 16px; }
.radio-list label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-list input { width: 20px; height: 20px; }

/* Статуси (колір смуги картки і чіпа) */
.st-draft { --st: var(--idle); }
.st-sent { --st: var(--accent); }
.st-in_progress { --st: var(--ok); }
.st-paused { --st: var(--warn); }
.st-blocked { --st: var(--bad); }
.st-done { --st: var(--ok); }
.st-cancelled { --st: var(--idle); }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--st); background: color-mix(in srgb, var(--st) 14%, transparent); white-space: nowrap; }
.status-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st); }
.net { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.net::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.net.off { color: var(--bad); font-weight: 700; }
.net.off::before { background: var(--bad); }

/* Екран майстра */
.master { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 57px); }
.line-list { background: var(--surface); border-right: 1px solid var(--line); padding: 14px 10px; display: grid; align-content: start; gap: 8px; }
.line-list h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 6px; }
.line-btn { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.line-btn b { font-size: 18px; }
.line-btn.active { border-color: var(--accent); background: var(--accent-soft); }
.queue { display: grid; gap: 10px; }
.task-card { position: relative; display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px 14px 10px; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--st); border-radius: var(--radius); box-shadow: var(--shadow); }
.task-card.dragging { opacity: .9; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); z-index: 3; }
.task-card.placeholder { border-style: dashed; background: transparent; box-shadow: none; }
.drag { cursor: grab; touch-action: none; user-select: none; color: var(--muted); font-size: 20px; text-align: center; padding: 10px 0; }
.drag.off { visibility: hidden; }
.task-main { min-width: 0; cursor: pointer; }
.task-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-sku { font-size: 18px; font-weight: 700; }
.task-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.task-plan { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.task-plan small { font-size: 14px; font-weight: 600; color: var(--muted); }
.task-side { display: grid; gap: 8px; justify-items: end; }
.task-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.task-note { margin-top: 6px; font-size: 14px; padding: 6px 10px; background: var(--warn-soft); border-radius: 8px; }
.recent-row { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

/* Нове завдання */
.nt { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(360px, 1.25fr); gap: 18px; }
.nt h3 { font-size: 15px; margin-bottom: 10px; }
.sku-pick { display: grid; gap: 8px; max-height: calc(100vh - 280px); overflow-y: auto; padding-right: 4px; }
.sku-item { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; text-align: left; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.sku-item.active { border-color: var(--accent); background: var(--accent-soft); }
.sku-item img, .sku-item .ph { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; background: var(--surface-2); }
.plan-input { font-size: 34px; font-weight: 800; text-align: right; min-height: 64px; font-variant-numeric: tabular-nums; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.nt-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; position: sticky; bottom: 0; padding: 14px 0 4px; background: var(--bg); }
.mini-visuals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-visuals .visual img { max-height: 170px; }
.mini-visuals .visual .empty { height: 110px; }
.need { font-weight: 800; font-size: 16px; }

/* Хто працює на лінії */
.crew { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 15px; font-weight: 600; }
.tile-crew { color: var(--ink); font-weight: 600; }
.tile-alert { padding: 6px 10px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-weight: 700; font-size: 13px; }

/* Дашборд плану по днях */
.plan-main { max-width: none; }
.month-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.month-nav b { font-size: 18px; min-width: 150px; text-align: center; }
.plan-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.plan-legend .lg { padding: 4px 10px; border-radius: 8px; font-size: 13px; border: 1px solid var(--line); }
.plan-wrap { overflow: auto; max-height: calc(100vh - 230px); }
table.plan-grid { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.plan-grid th, .plan-grid td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0; text-align: center; }
.plan-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); padding: 6px 4px; min-width: 52px; font-weight: 700; }
.plan-grid thead th small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.plan-grid .sku-col { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 6px 10px; min-width: 230px; max-width: 280px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-grid thead .sku-col { z-index: 3; background: var(--surface-2); }
.plan-grid tfoot td, .plan-grid tfoot th { background: var(--surface-2); font-weight: 700; padding: 6px 4px; position: sticky; bottom: 0; }
.plan-grid tfoot tr:first-child td, .plan-grid tfoot tr:first-child th { bottom: 29px; }
.plan-grid .we { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.plan-grid .today { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); }
.plan-grid thead th.today { color: var(--accent); }
.plan-grid td.sum { padding: 6px 8px; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
td.pc { position: relative; height: 42px; min-width: 52px; cursor: default; font-variant-numeric: tabular-nums; }
td.pc[draggable="true"] { cursor: grab; }
.pc-qty { display: block; font-size: 14px; font-weight: 800; line-height: 1.1; padding-top: 6px; }
.pc-rev { position: absolute; top: 1px; right: 3px; font-size: 10px; font-weight: 700; opacity: .75; }
.pc-fact { display: block; font-size: 10px; line-height: 1.1; opacity: .85; }
td.pc.st-issued, .lg.st-issued { background: #c9f2d4; color: #12512a; }
td.pc.st-accepted, .lg.st-accepted { background: #1f9d55; color: #fff; }
td.pc.st-late, .lg.st-late { background: #e5484d; color: #fff; }
/* Виконано не повністю: навпіл по діагоналі — зелений / червоний */
td.pc.st-partial, .lg.st-partial { background: linear-gradient(135deg, #1f9d55 0 50%, #e5484d 50% 100%); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.pc-carried { position: absolute; top: 1px; left: 3px; font-size: 11px; font-weight: 800; }
td.pc.unplanned, .lg.unplanned { outline: 2px dashed var(--idle); outline-offset: -4px; color: var(--muted); }
td.pc.drop { outline: 3px solid var(--accent); outline-offset: -3px; }
td.pc.dragging { opacity: .45; }
.pc-input { width: 64px; height: 36px; border: 2px solid var(--accent); border-radius: 6px; text-align: center; font: inherit; font-weight: 700; background: var(--surface); color: var(--ink); }

/* Завершено: прийняття майстром / проведення в 1С / списання */
.accept-card { display: grid; gap: 10px; padding: 14px 18px; margin-bottom: 14px; border-radius: var(--radius); background: var(--ok-soft); border: 2px solid var(--ok); box-shadow: var(--shadow); }
.accept-title { font-size: 18px; font-weight: 800; color: var(--ok); }
.accept-nums { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 16px; }
.accept-nums b { font-size: 20px; }
.tile-await { padding: 6px 10px; border-radius: 8px; background: var(--ok-soft); color: var(--ok); font-weight: 700; font-size: 13px; }
tr.wo-wait td { background: var(--warn-soft); }
tr.wo-late td { background: var(--bad-soft); }
tr.wo-done td { color: var(--muted); }
.wo-timer { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wo-late .wo-timer { color: var(--bad); }
.wo-wait .wo-timer { color: var(--warn); }
.wo-who { font-size: 13px; white-space: nowrap; }

/* Невиконаний план */
.sf-text { margin-top: 4px; font-size: 12px; color: var(--muted); max-width: 260px; }
.sf-text.bad { color: var(--bad); font-weight: 700; }
.shortfall-card { display: grid; gap: 10px; padding: 16px 18px; margin-bottom: 14px; border-radius: var(--radius); background: var(--bad-soft); border: 2px solid var(--bad); box-shadow: var(--shadow); animation: sf-pulse 2s ease-in-out 3; }
.shortfall-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.shortfall-title { font-size: 19px; font-weight: 800; color: var(--bad); }
.shortfall-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.shortfall-nums > div { padding: 8px 12px; border-radius: 10px; background: var(--surface); display: grid; }
.shortfall-nums span { font-size: 13px; color: var(--muted); }
.shortfall-nums b { font-size: 22px; font-variant-numeric: tabular-nums; }
.shortfall-nums .bad b { color: var(--bad); }
.shortfall-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.shortfall-actions .btn { flex: 1 1 240px; }
@keyframes sf-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--bad) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .shortfall-card { animation: none; } }

/* Вкладки майстра */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.tabs a:hover { background: var(--surface-2); }
.tabs a.active { background: var(--accent-soft); color: var(--accent); }
.master.no-lines { grid-template-columns: 1fr; }
.master.no-lines .line-list { display: none; }

/* Дошка ліній */
.board-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.tile { display: grid; gap: 6px; align-content: start; text-align: left; min-height: 210px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); border-top: 8px solid var(--st); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; }
.tile:hover { border-color: var(--st); }
.tile-top { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.tile-code { font-size: 30px; font-weight: 800; }
.tile-sku { font-size: 17px; font-weight: 700; margin-top: 4px; }
.tile-plan { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.tile-plan small { font-size: 14px; color: var(--muted); }
.tile-timer { margin-left: auto; font-size: 18px; color: var(--st); }
.tile-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.tile-today { margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 13px; }
.feed { position: sticky; top: 72px; max-height: calc(100vh - 100px); overflow-y: auto; }
.feed-list { display: grid; }
.feed-item { padding: 10px 18px; border-top: 1px solid var(--line); font-size: 14px; border-left: 4px solid transparent; }
.feed-item.bad { border-left-color: var(--bad); }
.feed-item.ok { border-left-color: var(--ok); }
.feed-item.warn { border-left-color: var(--warn); }
.feed-time { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 2px; }

/* Журнал і зміни */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; align-items: end; margin-bottom: 14px; }
.filter-actions { display: flex; gap: 8px; flex-wrap: wrap; grid-column: 1 / -1; }
.shift-list { display: grid; gap: 12px; }
.shift-head { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.shift-head h3 { font-size: 17px; }
.stat.ok b { color: var(--ok); }
.stat.warn b { color: var(--warn); }
.stat.bad b { color: var(--bad); }

/* Цифрова клавіатура */
.np-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.np-field { display: grid; gap: 2px; text-align: left; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); cursor: pointer; }
.np-field.active { border-color: var(--accent); background: var(--accent-soft); }
.np-label { font-size: 13px; color: var(--muted); }
.np-val { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.np-field.empty .np-val { color: var(--muted); }
.np-hint { font-size: 12px; color: var(--muted); }
.modal .keypad .key { height: 64px; font-size: 26px; }
.np-pad { display: grid; gap: 6px; justify-items: center; }
.np-pad .keypad { width: 100%; margin-top: 0; }

/* Повноекранний аркуш (завершення завдання) */
.sheet { position: fixed; inset: 0; z-index: 35; display: flex; flex-direction: column; background: var(--bg); }
.sheet-head { padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 22px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 14px 20px; }
.sheet-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.sheet-foot .btn.huge { min-height: 72px; font-size: 21px; border-radius: 16px; }
.sheet-task { font-size: 17px; margin-bottom: 10px; }
.finish-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 20px; align-items: start; max-width: 1100px; margin: 0 auto; }
.finish-left { display: grid; gap: 10px; }
.finish-right .keypad .key { height: 66px; font-size: 28px; }
.finish-summary { display: grid; gap: 8px; max-width: 640px; margin: 0 auto; }
.sum-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 18px; }
.sum-row b { font-size: 22px; text-align: right; }
.sum-row.big b { font-size: 34px; }
.sum-row.ok b { color: var(--ok); }
.sum-row.warn { border-color: var(--warn); }
.sum-row.warn b { color: var(--warn); }

/* Анімація «Завдання виконано!» */
.celebrate { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 50% 40%, rgba(22, 163, 74, .35), rgba(15, 19, 26, .7)); animation: fade-in .25s ease-out; }
.celebrate.out { animation: fade-out .25s ease-in forwards; }
.celebrate-card { position: relative; width: min(460px, 100%); padding: 26px 24px 22px; border-radius: 22px; background: var(--surface); text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); animation: pop-in .45s cubic-bezier(.2, 1.4, .4, 1); }
.celebrate-card > :not(.burst) { position: relative; z-index: 1; }
.celebrate-card h2 { font-size: 28px; color: var(--ok); margin: 6px 0 10px; }
.celebrate-line { font-size: 18px; margin: 4px 0; }
.celebrate-line:first-of-type { font-weight: 700; }
.celebrate-note { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); font-size: 14px; }
.celebrate-card .btn { margin-top: 16px; width: 100%; }
.burst { position: relative; width: 150px; height: 150px; margin: 0 auto; }
.done-mark { width: 150px; height: 150px; animation: mark-pop .5s .9s ease-out; }
.done-circle { fill: none; stroke: var(--ok); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327; transform: rotate(-90deg); transform-origin: 60px 60px; animation: draw .6s ease-out forwards; }
.done-check { fill: none; stroke: var(--ok); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw .35s .55s ease-out forwards; }
.confetti { position: absolute; left: 50%; top: 50%; width: 10px; height: 16px; margin: -8px 0 0 -5px; border-radius: 2px; opacity: 0; animation: confetti 1.6s cubic-bezier(.15, .7, .3, 1) forwards; }
.confetti:nth-child(3n) { width: 8px; height: 8px; border-radius: 50%; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes mark-pop { 50% { transform: scale(1.12); } }
@keyframes pop-in { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(.6); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .celebrate, .celebrate-card, .done-mark, .confetti { animation: none; }
  .done-circle, .done-check { animation: none; stroke-dashoffset: 0; }
  .confetti { display: none; }
}
@media (max-width: 760px) {
  .finish-grid { grid-template-columns: 1fr; }
  .sheet-foot { grid-template-columns: 1fr 1.6fr; }
}

/* Екран оператора (Shop Floor) */
.op { padding: 14px 18px 40px; display: grid; gap: 14px; max-width: 1400px; margin: 0 auto; }
.op .btn.huge { min-height: 84px; font-size: 22px; border-radius: 16px; width: 100%; }
.btn.go { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.stop { background: var(--surface); border: 2px solid var(--bad); color: var(--bad); }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.alarm { background: var(--bad); border-color: var(--bad); color: #fff; }
.shift-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 16px; }
.shift-bar .who-line { flex: 1; min-width: 220px; }
.shift-bar .who-line b { font-size: 17px; }
.banner { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 16px 20px; border-radius: var(--radius); color: #fff; background: var(--bad); box-shadow: var(--shadow); }
.banner.changeover { background: var(--warn); }
.banner .big { font-size: 22px; font-weight: 800; letter-spacing: .02em; }
.banner .timer { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; margin-left: auto; }
.banner .btn { background: #fff; color: var(--ink); border: 0; min-height: 60px; font-size: 18px; }
.banner.offline { background: var(--ink); color: var(--bg); }
.op-task { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 14px; align-items: start; }
.op-card { padding: 18px 20px; border-left: 8px solid var(--st); }
.op-card.flash { animation: flash 1.2s ease-in-out 3; }
@keyframes flash { 50% { box-shadow: 0 0 0 6px var(--accent); } }
.op-sku { font-size: 30px; font-weight: 800; line-height: 1.15; margin: 6px 0 2px; }
.op-plan-row { display: flex; gap: 28px; align-items: flex-end; flex-wrap: wrap; margin: 12px 0 6px; }
.op-big { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.op-big small { font-size: 18px; color: var(--muted); font-weight: 600; }
.op-label { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.op-notes { display: grid; gap: 8px; margin-top: 10px; }
.op-note { padding: 10px 14px; border-radius: 10px; background: var(--warn-soft); font-size: 16px; }
.op-note.info { background: var(--accent-soft); }
.op-note b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.op-actions { display: grid; gap: 12px; position: sticky; top: 72px; }
.mat-list { display: grid; gap: 8px; }
.mat { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: left; }
.mat.on { border-color: var(--ok); background: var(--ok-soft); }
.mat .box { width: 44px; height: 44px; border-radius: 10px; border: 3px solid var(--line); display: grid; place-items: center; font-size: 28px; font-weight: 900; color: #fff; }
.mat.on .box { background: var(--ok); border-color: var(--ok); }
.mat .qty { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mat .qty small { font-size: 14px; color: var(--muted); }
.op-visuals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.op-visuals .visual img { max-height: 300px; }
.op-empty { text-align: center; padding: 60px 20px; }
.op-empty h2 { font-size: 28px; margin-bottom: 8px; }
.next-list { display: grid; gap: 8px; }
.next-item { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-left: 6px solid var(--st); }
.next-item .task-plan { margin-left: auto; font-size: 20px; }
.pill-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pill { min-height: 64px; min-width: 120px; padding: 10px 18px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font-size: 18px; font-weight: 700; cursor: pointer; }
.pill.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pill small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
.form-block { display: grid; gap: 10px; }
.form-block h3 { font-size: 16px; }
.pending { opacity: .75; }

@media (max-width: 1100px) {
  .board-layout { grid-template-columns: 1fr; }
  .feed { position: static; max-height: 420px; }
}

@media (max-width: 900px) {
  .op-task { grid-template-columns: 1fr; }
  .op-actions { position: static; }
  .op-visuals { grid-template-columns: 1fr; }
  .op-sku { font-size: 24px; }
  .op-big { font-size: 34px; }
}

@media (max-width: 900px) {
  .master { grid-template-columns: 1fr; }
  .line-list { grid-auto-flow: column; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .nt { grid-template-columns: 1fr; }
  .sku-pick { max-height: 320px; }
  .task-card { grid-template-columns: 26px 1fr; }
  .task-side { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; padding-left: 4px; }
  .task-actions { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .sidenav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidenav a { white-space: nowrap; }
  .main { padding: 16px; }
  .visuals { grid-template-columns: 1fr; }
  dl.kv { grid-template-columns: 1fr; }
  .topbar { padding: 10px 16px; }
  .clock { display: none; }
}
/* Перенесений залишок після часткового виконання: «залишок / з N» */
.pc-of { display: block; font-size: 10px; line-height: 1.1; opacity: .8; }
/* План місяця по номенклатурі виконано — рядок зелений */
.plan-grid tr.month-done .sku-col { background: #1f9d55; color: #fff; }
.plan-grid tr.month-done td.sum { background: #d3f5de; color: #12512a; font-weight: 700; }
.plan-grid tr.month-done .md-check { font-weight: 800; }
.lg.lg-month-done { background: #1f9d55; color: #fff; }
.badge.ro-badge { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; font-size: 13px; }
/* План місяця: заголовок групи лінії */
.plan-grid tr.line-grp th, .plan-grid tr.line-grp td { background: var(--surface-2); font-weight: 800; font-size: 13px; padding: 6px 10px; border-top: 2px solid var(--line); }
/* Вибір обладнання (лінії) при відкритті зміни */
.pill.equip { min-width: 220px; text-align: left; }
.pill.equip b { display: block; font-size: 19px; }
.pill.equip small.eq-busy { color: var(--warn); font-weight: 700; }
.pill.equip small.eq-free { color: var(--ok); }
/* План місяця: підсумок плану/факту за день по лінії */
.plan-grid tr.line-sum th, .plan-grid tr.line-sum td { background: var(--surface-2); font-size: 12px; font-weight: 700; }
.plan-grid tr.line-sum.fact th, .plan-grid tr.line-sum.fact td { color: var(--ok); border-bottom: 2px solid var(--line); }
/* Завдання майстра без плану планувальника: колір за станом + пунктирна рамка */
td.pc.no-plan { outline: 2px dashed rgba(0, 0, 0, .45); outline-offset: -4px; }
/* ↪ на клітинці, з якої майстер переніс залишок далі */
.pc-carried-out { position: absolute; bottom: 1px; right: 3px; font-size: 13px; font-weight: 900; line-height: 1; }
/* Адмінка: попередження тестового режиму */
.note.warn-note { background: var(--bad-soft); border: 2px solid var(--bad); font-weight: 600; }

/* ---------- Gemini Shift: італійський стиль ---------- */
/* Шапка: тонка лінія кольору еспресо (без прапора) */
.topbar { border-bottom: 2px solid var(--accent); }
.brand-mark { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
/* Заголовки — з засічками, як на італійських етикетках */
h1, .login-wrap h1, .pin-panel h2, .page-head h1 { font-family: var(--font-serif); font-weight: 700; letter-spacing: .2px; }
.login-wrap h1 { font-size: 36px; font-style: italic; color: var(--accent); }
.login-wrap .sub { font-style: italic; }
.user-group { font-family: var(--font-serif); font-style: italic; letter-spacing: .3px; }
.avatar { font-family: var(--font-serif); font-style: italic; }
/* ---------- План маркетингу ---------- */
.mkt-main { max-width: none; }
.mkt-wrap { max-height: calc(100vh - 230px); overflow: auto; }
.mkt-grid th.mkt-manual { color: var(--accent); background: var(--accent-soft); }
.mkt-grid td { padding: 6px 10px; }
.mkt-grid td.mkt-cell { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.mkt-name { min-width: 260px; }
.mkt-pack { color: var(--muted); font-size: 13px; min-width: 200px; }
.mkt-input { width: 110px; height: 34px; border: 1px solid var(--line); border-radius: 8px; text-align: right; padding: 0 8px; background: var(--surface); font-weight: 700; }
.mkt-input.priority { width: 70px; text-align: center; }
.mkt-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.mkt-input.saved { background: var(--ok-soft); border-color: var(--ok); }
.mkt-grid tr.corrected td.mkt-cell.plan1 { background: #fff1b8; }
.mkt-grid tr.prio-top td.mkt-cell.priority, .mkt-grid tr.prio-top td.mkt-val.priority { background: #fde2c8; }
.mkt-grid tr.line-grp th { background: var(--surface-2); font-family: var(--font-serif); font-style: italic; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--ink); position: static; }
.mkt-grid tr.line-sum th, .mkt-grid tr.line-sum td { background: var(--surface-2); font-weight: 700; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--ink); position: static; }
.mkt-toolbar { flex-wrap: wrap; gap: 8px; align-items: center; }
.mkt-import { gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
/* Обід: планова перерва — спокійний колір, не «тривожний» */
.btn.lunch { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.banner.pause { background: var(--accent); color: var(--accent-ink); }
/* Обладнання ввімкнуто на розігрів: світло-зелений блок з таймером робочого часу (до закриття зміни) */
.work-on { display: inline-flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px 16px; border-radius: 14px; background: #c9f2d4; color: #12512a; border: 2px solid #1f9d55; font-weight: 700; font-size: 17px; }
.work-on small { display: block; font-size: 13px; font-weight: 500; }
.work-on .work-timer { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
/* ---------- Головний інженер: принти по лініях ---------- */
.eng-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.eng-wrap { max-height: calc(100vh - 260px); overflow: auto; }
.eng-grid td { vertical-align: top; }
.eng-grid th.eng-manual { color: var(--accent); background: var(--accent-soft); }
.eng-name { min-width: 240px; }
.eng-pack { color: var(--muted); font-size: 13px; min-width: 180px; }
.eng-thumb img { width: 96px; height: 96px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: block; }
.eng-noimg { display: inline-grid; place-items: center; width: 96px; height: 96px; border-radius: 8px; border: 1px dashed var(--line); color: var(--muted); font-size: 13px; }
.eng-actions { display: flex; gap: 6px; margin-top: 6px; }
.eng-no { min-width: 190px; }
.eng-no-input { width: 120px; height: 40px; border: 2px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 18px; font-weight: 800; background: var(--surface); }
.eng-no-input.ok { border-color: var(--ok); }
.eng-no-input.bad { border-color: var(--bad); background: var(--bad-soft); }
.eng-msg { font-size: 12px; margin-top: 4px; max-width: 220px; }
.bad-text { color: var(--bad); font-weight: 700; }
.ok-text { color: var(--ok); }
/* № принта в блоці «Принт» (оператор, майстер) */
.print-no { margin-top: 6px; font-size: 18px; }
.print-no b { font-size: 24px; }
.print-no.none { color: var(--muted); font-size: 14px; }
/* Майстер: план Овчаренко О. на завтра */
.mplan { margin-bottom: 16px; border-left: 4px solid var(--accent); }
.mplan-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; }
.mplan-head h3 { margin: 0; font-size: 16px; }
.mplan-nav { margin-left: auto; display: flex; gap: 6px; }
.mplan-grid td { vertical-align: middle; }
.mplan-grid tr.mplan-done td { opacity: .6; }
.mplan-task { margin-left: 6px; font-weight: 700; }

/* ----- Алярм оператору: стоп / скасування від майстра ----- */
.alarm-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(120, 0, 0, .82); animation: alarm-flash 1s steps(2, start) infinite; }
.alarm-overlay.is-stop { background: rgba(150, 60, 0, .85); }
@keyframes alarm-flash { 50% { background: rgba(220, 0, 0, .92); } }
.alarm-box { width: min(640px, 100%); background: var(--surface, #fff); color: var(--text, #111); border: 6px solid var(--bad); border-radius: 18px; padding: 22px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.alarm-title { font-size: clamp(24px, 5vw, 38px); font-weight: 800; color: var(--bad); margin-bottom: 12px; }
.alarm-sku { font-size: 22px; font-weight: 700; }
.alarm-qty { font-size: 18px; margin-top: 4px; }
.alarm-why { margin-top: 12px; font-size: 18px; background: var(--bad-soft); border-radius: 10px; padding: 10px; }
.alarm-by { margin-top: 10px; color: var(--muted); }
.alarm-hint { margin-top: 8px; font-size: 16px; }
.alarm-ack { margin-top: 18px; width: 100%; background: var(--bad); border-color: var(--bad); color: #fff; }
.op-note.master-stop, .task-note.master-stop { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.task-card.master-stopped { outline: 3px solid var(--bad); outline-offset: -3px; }

/* ----- Позначка «Р.» керівника цеху в клітинці плану ----- */
.pc-head { position: absolute; top: 1px; right: 3px; font-size: 10px; font-weight: 900; color: #7a1fa2; background: rgba(255, 255, 255, .85); border-radius: 3px; padding: 0 2px; line-height: 12px; }
td.pc.head-mark .pc-rev { right: 22px; }
.lg.head-mark .pc-head-lg { color: #7a1fa2; }

/* ----- Колонки плану маркетингу в таблиці плану цеху ----- */
.plan-grid .mkt-col { min-width: 70px; padding: 4px 6px; background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); font-variant-numeric: tabular-nums; }
.plan-grid thead .mkt-col { font-size: 12px; }
.plan-grid .mkt-col.mkt-off { background: var(--surface-2); color: var(--muted); }
.plan-grid td.mkt-col.priority { font-weight: 700; }

/* ----- Виведена з обігу номенклатура ----- */
tr.sku-out .sku-name, tr.sku-out .nom-input, td.sku-out .sku-name, tr.sku-out .nom-code b { text-decoration: line-through; color: var(--muted); }
.out-chip { font-size: 10px; padding: 0 5px; margin-right: 4px; }
.mkt-handover { flex-wrap: wrap; gap: 8px; }
.mkt-handover .handover-btn { border-color: var(--accent); }
.mkt-grid th.mkt-locked { background: var(--surface-2); }

/* ----- Сторінка «Номенклатури» ----- */
.nom-grid td { vertical-align: middle; }
.nom-input { width: 100%; min-width: 60px; border: 1px solid transparent; background: transparent; padding: 6px; border-radius: 6px; font: inherit; color: inherit; }
.nom-input:hover:not(:disabled), .nom-input:focus { border-color: var(--line); background: var(--surface); }
.nom-cell.f-name .nom-input { min-width: 240px; }
.nom-cell.f-brand .nom-input { min-width: 90px; }
.nom-cell.f-unit .nom-input { min-width: 50px; width: 60px; }
.nom-cell.f-packaging .nom-input { min-width: 200px; }
.nom-cell.edited { box-shadow: inset 3px 0 0 #7a1fa2; }
.nom-who { font-size: 12px; min-width: 180px; }
.nom-who .btn { margin-top: 2px; }
.nom-out-by { color: var(--bad); font-weight: 600; }
.nom-code .chip { font-size: 10px; margin-top: 2px; }
/* Колонки плану маркетингу закріплені поруч із «Номенклатурою» (видно при прокрутці днів) */
.plan-grid.with-mkt .sku-col { width: 260px; min-width: 260px; max-width: 260px; }
.plan-grid.with-mkt .mkt-col { position: sticky; z-index: 1; width: 72px; min-width: 72px; max-width: 72px; }
.plan-grid.with-mkt thead .mkt-col { z-index: 3; }
.plan-grid.with-mkt .mkt-col.c0 { left: 260px; }
.plan-grid.with-mkt .mkt-col.c1 { left: 332px; }
.plan-grid.with-mkt .mkt-col.c2 { left: 404px; box-shadow: inset -2px 0 0 var(--line); }
/* Сторінка «Принти»: упаковка, картинки з «вкласти / викачати / прибрати», хто вклав */
.eng-pack-input { width: 100%; min-width: 180px; font: inherit; font-size: 13px; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--surface); resize: vertical; }
.eng-pack-input.saved { border-color: var(--ok); }
td.eng-pack.edited { box-shadow: inset 3px 0 0 #7a1fa2; }
.eng-img { min-width: 130px; }
.eng-by { font-size: 11px; color: var(--muted); margin-top: 4px; max-width: 150px; }
.eng-actions .btn { padding-inline: 8px; white-space: nowrap; }
.eng-img .eng-actions { flex-wrap: nowrap; }
.eng-pack-input { min-width: 160px; }

/* ----- Мій табель (оператор) ----- */
.ts-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.ts-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ts-tile { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.ts-tile span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ts-tile b { font-size: 20px; font-variant-numeric: tabular-nums; }
.ts-tile.main { background: var(--accent-soft); border-color: var(--accent); grid-column: span 2; }
.ts-tile.main b { font-size: 28px; color: var(--accent); }
.ts-grid td.num, .ts-grid th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ts-grid tfoot th { background: var(--surface-2); }
.ts-grid .ts-sum { color: var(--accent); font-size: 16px; }
.ts-grid tr.ts-open td { background: color-mix(in srgb, var(--warn-soft) 50%, transparent); }
.ts-rates { margin-top: 12px; font-size: 13px; }
.ts { min-width: 0; max-width: 100%; }
.ts .table-wrap { overflow-x: auto; max-width: 100%; }
.ts-grid td:nth-child(2) { white-space: nowrap; }
.ts-grid th { white-space: normal; min-width: 70px; }

/* Черга оператора: взяти в роботу / пропустити; призупинене завдання */
.next-item .next-actions { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.next-item.suspended { border-left: 4px solid var(--warn); }

/* ----- Кінець зміни: прибирання лінії і «Закрити зміну» ----- */
.btn.clean { background: #e3f2fd; border-color: #1e88e5; color: #0d47a1; }
.btn.close-shift { background: var(--surface); border: 3px solid var(--bad); color: var(--bad); font-weight: 800; }
.btn.close-shift.pulse { background: var(--bad); color: #fff; animation: close-pulse 1.2s ease-in-out infinite; }
@keyframes close-pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--bad) 30%, transparent); } }
.close-reminder { margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--bad); }
.banner.shift-end { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.banner.shift-end.soon { background: var(--warn-soft); color: var(--text); border: 2px solid var(--warn); }
.banner.shift-end.over { background: var(--bad); color: #fff; animation: alarm-flash-soft 1.4s steps(2, start) infinite; }
@keyframes alarm-flash-soft { 50% { background: #b71c1c; } }
.end-steps { margin: 6px 0 0 18px; font-size: 16px; }
.end-steps li.done { text-decoration: line-through; opacity: .7; }
.end-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.banner.shift-end.over .btn.close-shift { background: #fff; color: var(--bad); }
.close-check { list-style: none; padding: 0; margin: 0 0 10px; font-size: 16px; }
.close-check li { padding: 6px 0; }
.close-check li.ok { color: var(--ok); }
.close-check li.warn { color: var(--bad); font-weight: 700; }

/* Закриття зміни раніше — з причиною */
.early-box { border: 2px solid var(--warn); background: var(--warn-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.early-title { font-size: 17px; font-weight: 800; }

/* ----- Файли принта для лінії і «Завантажити на USB» ----- */
.eng-files { min-width: 230px; }
.files-count { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.files-count.ok { color: var(--ok); }
.files-count.warn { color: var(--warn); }
.files-count.bad { color: var(--bad); }
.files-list { list-style: none; padding: 0; margin: 0 0 4px; font-size: 13px; }
.files-list li { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.files-list a { color: var(--accent); word-break: break-all; }
.usb-list { list-style: none; padding: 0; }
.usb-list li { padding: 3px 0; }
.print-usb { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.print-missing { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-size: 13px; }
.admin-embed { width: 100%; height: calc(100vh - 150px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
body.embed .eng-main { padding-top: 8px; }

/* ----- Ростер: профіль, сторінка «Завдання на обсмажку» ----- */
.op-profile { display: inline-flex; gap: 10px; align-items: baseline; margin: 6px 0 4px; padding: 6px 12px; border-radius: 10px; background: #fff3e0; border: 2px solid #ef6c00; }
.op-profile span { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.op-profile b { font-size: 26px; color: #bf360c; }
.roast-form { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; align-items: end; }
@media (max-width: 800px) { .roast-form { grid-template-columns: 1fr; } }
.roast-form .profile-box { font-size: 22px; font-weight: 800; color: #bf360c; }
.roast-grid td.num, .roast-grid th.num { text-align: right; white-space: nowrap; }

/* Ростер: номенклатура і профілі */
.roast-nom td { vertical-align: middle; }
.roast-nom .nom-input.f-name { min-width: 320px; }
.roast-nom .nom-input.f-profile { min-width: 150px; font-weight: 800; color: #bf360c; }
.roast-nom .nom-profile { font-weight: 800; color: #bf360c; }
.roast-nom tr.no-profile td { background: var(--warn-soft); }
.hidden { display: none !important; }

/* Ростер: загальний план на зміну */
.plan-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 10px; }
.plan-head h2 { margin: 0 auto 6px 0; }
.plan-row { display: grid; grid-template-columns: 28px minmax(220px, 3fr) minmax(130px, 1fr) minmax(130px, 1fr) 40px; gap: 10px; align-items: start; margin-bottom: 8px; }
.plan-row > .btn { margin-top: 6px; }
.plan-row .field { margin: 0; }
.plan-n { font-weight: 800; color: var(--muted); padding-bottom: 12px; text-align: right; }
.row-batches { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; min-height: 14px; }
.plan-row input.bad { border-color: var(--bad); background: var(--bad-soft); }
@media (max-width: 760px) { .plan-row { grid-template-columns: 24px 1fr 1fr; } .plan-row > .field:nth-child(2) { grid-column: 2 / 4; } }
.plan-totals { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.plan-totals > div { border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; display: flex; flex-direction: column; min-width: 120px; background: var(--surface); }
.plan-totals > div span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.plan-totals > div b { font-size: 22px; }
.plan-totals > div.main { border-color: #ef6c00; background: #fff3e0; }
.plan-totals > div.main b { color: #bf360c; font-size: 26px; }
.banner.roast-plan { background: #fff3e0; border: 2px solid #ef6c00; color: var(--text); }
/* Випадаючий список з прокруткою (номенклатура) */
.combo { position: relative; }
.combo .combo-input { padding-right: 38px; width: 100%; }
.combo-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: transparent; font-size: 18px; color: var(--muted); cursor: pointer; }
.combo-list { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 2px); max-height: 340px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.18); }
.combo-item { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); font-size: 14px; }
.combo-item small { color: #bf360c; font-weight: 700; white-space: nowrap; }
.combo-item:hover, .combo-item.active { background: var(--accent-soft); }
.combo-item.chosen { font-weight: 700; }
.combo-empty { padding: 10px 12px; color: var(--muted); }
.combo-list { min-width: 280px; overflow-x: hidden; }
.combo-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-item small { flex-shrink: 0; font-weight: 600; }

.roast-grid .row-acts { white-space: nowrap; }
.roast-grid .row-acts .btn { margin-left: 4px; }

/* ----- Бег ростера ----- */
.bag-card { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; border: 2px solid #8d6e63; }
.bag-visual { width: 120px; flex-shrink: 0; }
.bag-loops { display: flex; justify-content: space-between; padding: 0 14px; height: 18px; }
.bag-loops span { width: 22px; height: 18px; border: 4px solid #8d6e63; border-bottom: 0; border-radius: 12px 12px 0 0; }
.bag-body { position: relative; height: 130px; border: 4px solid #8d6e63; border-radius: 10px 10px 16px 16px; background: #f5f0e8; overflow: hidden; }
.bag-fill { position: absolute; left: 0; right: 0; bottom: 0; background: repeating-linear-gradient(45deg, #6d4c41 0 8px, #5d4037 8px 16px); transition: height .6s ease; }
.bag-half-line { position: absolute; left: 0; right: 0; bottom: 50%; border-top: 2px dashed #a1887f; }
.bag-info { flex: 1; min-width: 260px; }
.bag-title { display: flex; gap: 10px; align-items: center; font-size: 20px; margin-bottom: 8px; flex-wrap: wrap; }
.bag-code { font-size: 30px; color: #5d4037; }
.bag-part { display: flex; gap: 6px; align-items: baseline; padding: 4px 0; font-size: 16px; }
.bag-part .kg { margin-left: auto; }
.bag-sum { font-size: 20px; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
.bag-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.bag-actions .btn small { display: block; font-size: 12px; font-weight: 400; }
.bag-recent { margin-top: 8px; font-size: 13px; }
.btn.pulse-soft { animation: close-pulse 1.4s ease-in-out infinite; }

.bag-mark { font-size: 72px; font-weight: 900; text-align: center; color: #5d4037; letter-spacing: .04em; border: 4px dashed #8d6e63; border-radius: 16px; padding: 8px 0; margin: 6px 0 12px; }

/* Розрахунок сировини та ТМЦ (адмін) */
.mat-h { font-size: 18px; margin: 20px 0 8px; }
.mat-wrap { max-height: 60vh; overflow: auto; }
.mat-grid thead th { position: sticky; top: 0; z-index: 1; }
.mat-grid tfoot td { position: sticky; bottom: 0; background: var(--surface); border-top: 2px solid var(--line); }
.mat-grid td.mat-up { color: var(--bad); font-weight: 700; }
.mat-grid td.mat-down { color: var(--ok); font-weight: 700; }
.mat-detail > td { background: var(--bg); }
.mat-sub { font-size: 13px; }
.mat-grid > tbody > tr > td:nth-child(2), .mat-grid > thead th:nth-child(2) { min-width: 280px; }
.warn-note { border-color: var(--warn); }

/* Забезпечення матеріалами (адмін): схема витягування, графік, рецептури купажів */
.sup-chain h3 { margin: 0 0 10px; }
.sup-flow { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sup-node { flex: 1 1 150px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.sup-node b { color: var(--accent); }
.sup-node .sup-val { font-size: 20px; font-weight: 800; }
.sup-node small { color: var(--muted); }
.sup-node.pack { border-color: var(--accent); }
.sup-node.roast { border-color: var(--warn); }
.sup-node.tmc { flex: 0 1 320px; border-style: dashed; }
.sup-arrow { align-self: center; font-size: 22px; color: var(--muted); }
.sup-yield { width: 70px; display: inline-block; margin: 0 4px; }
.field-inline { display: inline-flex; align-items: center; gap: 4px; }
.sup-sched tr.sup-today td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.sup-norecipe td { background: color-mix(in srgb, var(--warn) 8%, transparent); }
.sup-parts { margin: 0; padding-left: 16px; }
.sup-recipe { display: flex; flex-direction: column; gap: 8px; }
.modal:has(.sup-recipe) { width: min(760px, 94vw); max-width: 94vw; }
.sup-recipe-row { display: grid; grid-template-columns: 24px 1fr 80px 16px auto; gap: 6px; align-items: center; }
.sup-share { width: 80px; }
.sup-sum { margin-top: 10px; font-weight: 800; }
.sup-sum.ok { color: var(--ok); }
.sup-sum.bad { color: var(--bad); }
.btn.danger-soft { border-color: var(--warn); }

/* Адреса сервера в поточній мережі (дім / робота) */
.net-badge { margin: 24px auto 8px; max-width: 760px; border: 1px dashed var(--line); border-radius: 12px; padding: 12px 16px; background: var(--surface); }
.net-badge.compact { margin: 16px 8px 8px; padding: 10px; font-size: 13px; }
.net-title { font-weight: 700; margin-bottom: 6px; }
.net-addr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.net-url { font-size: 20px; cursor: pointer; color: var(--accent); word-break: break-all; }
.net-badge.compact .net-url { font-size: 15px; }
.net-addr.bad .net-url, .net-addr.bad { color: var(--bad); }
.net-warn { margin-top: 8px; color: var(--bad); font-weight: 600; }
.net-hint { margin-top: 6px; font-size: 13px; }

/* Бібліотека номенклатур */
.lib-lines { margin-bottom: 10px; }
.lib-wrap { max-height: 72vh; overflow: auto; }
.lib-grid thead th { position: sticky; top: 0; z-index: 1; }
.lib-spec-cell { min-width: 320px; }
.lib-spec { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.35; }
.lib-1c { font-size: 12px; }
.lib-code { white-space: nowrap; }
.lib-thumb { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; background: var(--bg); }

/* Картка SKU: специфікація вручну (Excel / скрін) */
.spec-src { font-size: 13px; margin-top: 4px; }
.spec-actions { margin-top: 10px; justify-content: flex-start; flex-wrap: wrap; }
.spec-shot img { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; }
.lib-spec-cell .chip { margin: 4px 4px 0 0; }
.paste-zone { border: 2px dashed var(--line); border-radius: 12px; min-height: 160px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 12px; outline: none; }
.paste-zone:focus { border-color: var(--accent); }
.paste-zone.has { border-style: solid; }
.paste-zone img { max-width: 100%; max-height: 50vh; }
.modal:has(.paste-zone) { width: min(760px, 94vw); max-width: 94vw; }
/* Розпізнавання скріну специфікації */
.modal:has(.ocr-review) { width: min(980px, 96vw); max-width: 96vw; }
.ocr-img img { max-width: 100%; max-height: 240px; border: 1px solid var(--line); border-radius: 8px; display: block; margin-bottom: 8px; }
.ocr-status { font-weight: 600; margin: 6px 0 10px; }
.ocr-status.bad { color: var(--bad); }
.ocr-table td { vertical-align: middle; }
.ocr-name { min-width: 320px; }
.ocr-name .input { width: 100%; }
.ocr-qty { width: 90px; }
.ocr-unit { width: 70px; }
.ocr-state .btn { white-space: normal; text-align: left; max-width: 260px; }
/* Нова версія програми на сервері */
.update-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 12px; background: var(--accent); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-weight: 600; max-width: calc(100vw - 32px); }
.update-bar .btn { background: #fff; color: var(--accent); border-color: #fff; }
/* 4.2 Купаж: маркер лінії призначення */
.blend-dest { white-space: nowrap; }
.line-mark { display: inline-block; margin: 0 4px 2px 0; padding: 2px 8px; border-radius: 8px; font-weight: 700; font-size: 13px; background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.line-mark.manual { background: transparent; color: var(--accent); border-style: dashed; }
.blend-lines { display: flex; flex-direction: column; gap: 8px; }
.ocr-sugg { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; max-width: 360px; }
.ocr-sugg .btn { white-space: normal; text-align: left; }
/* Картка SKU: принт для лінії */
.lib-print-no { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.lib-print-no .eng-no-input { max-width: 160px; }
.eng-open { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--muted); }
.eng-open:hover { color: var(--accent); }
/* 3.1 Fenix: сорти */
.fenix-pct { width: 80px; display: inline-block; }
.fenix-grid td.num { white-space: nowrap; }
.fenix-nosort td { color: var(--muted); }
/* Розрахунок матеріалів: зміна корегування проти плану 25 */
.mat-plus { color: #c62828; }
.mat-minus { color: #1565c0; }
.plan-tabs { margin: 8px 0 12px; }

/* 2.1: «Потреба, кг» = 1 кг × коеф. усмажки — формула під числом в один рядок */
.roast-need { white-space: nowrap; }

/* Зелене зерно: групи колонок «План 25» / «Корег. на 1-ше» (смажена · зелена) */
.mat-green th.mat-grp { text-align: center; border-bottom: 1px solid var(--line, #e5ddd0); }

/* 2.1: ступінь обсмажки (показник колориметра) */
.roast-degree { width: 7.5em; text-align: right; }

/* 4.1: ресурсна специфікація — перемикач 1-й / 2-й сорт */
.sep-pick { display: inline-flex; gap: .45em; align-items: center; cursor: pointer; }
.sep-grade:not(.on) { color: var(--muted, #8a7f72); }
.sep-grade.on span { font-weight: 600; }
.lib-grid th.mat-grp { text-align: center; }

/* «Розподілити по змінах»: клітинка, поставлена розподілом, — позначка «А» в кутку */
.plan-grid td.pc-auto { position: relative; }
.plan-grid td.pc-auto::after { content: 'А'; position: absolute; left: 3px; bottom: 1px; font-size: 9px; font-weight: 700; opacity: .55; }
.lg.pc-auto::before { content: ''; }
.cap-in { width: 7.5em; text-align: right; }
.dist-line { margin: 8px 0; }
.dist-queue { margin: 6px 0 0 18px; font-size: 13px; }

/* План маркетингу: коли що передається */
.mkt-when { margin: 6px 0; }

/* План по днях: день переобліку — смугаста колонка з позначкою в заголовку */
.plan-grid .inv-day { background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, #8d6e63 18%, transparent) 6px 12px); }
.plan-grid th.inv-day { color: #6d4c41; }
.plan-grid th.day-click { cursor: pointer; }
.plan-grid th.day-click:hover { outline: 2px solid color-mix(in srgb, #8d6e63 45%, transparent); outline-offset: -2px; }
.inv-mark { display: block; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.lg.inv-day { background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, #8d6e63 18%, transparent) 6px 12px); }

/* Довнесення в передані «План 25» / «Корег. на 1-ше»: червоне число; клітинку можна клацнути */
.mkt-added, .plan-grid td.mkt-added { color: #c62828; font-weight: 700; }
.mkt-addable { cursor: pointer; }
.mkt-addable:hover { outline: 2px solid color-mix(in srgb, #c62828 35%, transparent); outline-offset: -2px; }
/* Вихідні в заголовку календаря — непрозорий фон (інакше клітинки просвічують крізь закріплений заголовок) */
.plan-grid thead th.we { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }

/* Застосунок на телефоні / планшеті (PWA): кнопка на екрані входу, сторінка інструкції */
.pwa-login { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.pwa-main { max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; }
.pwa-main h1 { margin: 6px 0 8px; }
.pwa-card { margin: 14px 0; }
.pwa-card.pwa-mine { border: 2px solid var(--accent, #6f3b1f); }
.pwa-steps { margin: 8px 0 0; padding-left: 4px; list-style: none; display: grid; gap: 6px; }

/* Зелене зерно: «на складі» / «поставки» в таблиці розрахунку; у плані по днях — нестача (⚠) і день поставки (🚚) */
.green-ok { color: #2e7d32; font-weight: 600; }
.mat-grid .green-stock { background: color-mix(in srgb, #2e7d32 7%, transparent); }
.mat-grid .green-deliv { background: color-mix(in srgb, #00838f 8%, transparent); }
.plan-grid .deliv-day { box-shadow: inset 0 3px 0 #00838f; }
.plan-grid thead th.deliv-day { background: color-mix(in srgb, #00838f 16%, var(--surface-2)); }
.plan-grid td.deliv-day:not([class*="st-"]) { background: color-mix(in srgb, #00838f 7%, transparent); }
.deliv-mark { display: block; font-size: 11px; line-height: 1; }
.plan-grid td.pc-short { outline: 2px solid #c62828; outline-offset: -2px; position: relative; }
.pc-short-mark { position: absolute; right: 2px; bottom: 1px; font-size: 11px; color: #c62828; font-weight: 700; }
.lg.pc-short { outline: 2px solid #c62828; outline-offset: -2px; }
.lg.deliv-day { background: color-mix(in srgb, #00838f 16%, transparent); }

/* Зелене зерно: підказка заміни з вільного на складі */
.mat-grid td.green-subs, .mat-grid th.green-subs { min-width: 230px; font-size: 13px; text-align: left; }
.green-subs > div { white-space: nowrap; }
.green-free-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
