/* Запись на отгрузку — склад «Корона»
   Шрифт: IBM Plex Sans (SIL Open Font License), хранится локально. */
@font-face { font-family: 'Plex'; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Plex'; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Plex'; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Plex'; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Plex'; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Plex'; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --ink: #1b2430;
  --ink-2: #4a5566;
  --ink-3: #7c8696;
  --concrete: #eef1ee;
  --surface: #ffffff;
  --line: #d8ddd7;
  --line-2: #e7ebe6;
  --steel: #2c5a86;
  --steel-ink: #ffffff;
  --steel-soft: #e4edf6;
  --dock: #f2c230;          /* жёлтая разметка погрузочной зоны — выбор и «сейчас» */
  --dock-soft: #fdf3cf;
  --dock-ink: #3a2f05;
  --pending: #9a6410; --pending-bg: #fcf0d6;
  --ok: #24704a;      --ok-bg: #e1f1e7;
  --bad: #ad3434;     --bad-bg: #f9e3e3;
  --busy: #c9cfc8;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(27, 36, 48, .06), 0 6px 24px rgba(27, 36, 48, .08);
  --font: 'Plex', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--concrete); color: var(--ink);
  font: 400 15px/1.5 var(--font); font-feature-settings: 'tnum' 0;
}
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
a { color: var(--steel); }
.num, .time { font-feature-settings: 'tnum' 1; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--steel); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- каркас ---------- */
.top {
  background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20;
}
.top-in { max-width: 1240px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; white-space: nowrap; }
.brand-mark { width: 26px; height: 26px; border-radius: 5px; background: var(--dock); display: grid; place-items: center; color: var(--dock-ink); font-size: 14px; font-weight: 600; }
.brand small { font-weight: 400; color: #aeb7c4; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: #c9d1dc; text-decoration: none; padding: 7px 12px; border-radius: var(--radius); white-space: nowrap; font-weight: 500; font-size: 14px;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav a.on { color: #fff; background: rgba(255, 255, 255, .13); }
.nav .badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--dock); color: var(--dock-ink); font-size: 12px; text-align: center; line-height: 18px; }
.user-btn { background: none; border: 1px solid rgba(255,255,255,.2); color: #fff; border-radius: var(--radius); padding: 6px 10px; font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.user-btn:hover { background: rgba(255,255,255,.08); }
.menu { position: absolute; right: 16px; top: 52px; background: var(--surface); color: var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-width: 220px; padding: 6px; border: 1px solid var(--line); }
.menu button, .menu a { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; font: inherit; color: inherit; text-decoration: none; border-radius: var(--radius); cursor: pointer; }
.menu button:hover, .menu a:hover { background: var(--concrete); }
.menu .who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; font-size: 13px; color: var(--ink-3); }

.page { max-width: 1240px; margin: 0 auto; padding: 22px 16px 80px; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { flex: 1; min-width: 200px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.panel-pad { padding: 18px; }
.panel-head { padding: 14px 18px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { flex: 1; }

/* ---------- элементы форм ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 500 14px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #b9c1b8; background: #fafbfa; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--steel); border-color: var(--steel); color: var(--steel-ink); }
.btn.primary:hover { background: #244c72; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { background: #1d5c3c; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); border-color: #e5bcbc; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: rgba(27,36,48,.05); }
.btn.big { height: 46px; font-size: 15px; padding: 0 22px; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; }
.icon-btn { width: 38px; padding: 0; }
.icon-btn.sm { width: 30px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field > span em { font-style: normal; color: var(--ink-3); font-weight: 400; }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink); font: 400 15px var(--font);
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--steel); box-shadow: 0 0 0 3px var(--steel-soft); }
.input.sm { height: 34px; font-size: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--steel); flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.err { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: var(--radius); font-size: 14px; }
.note { background: var(--dock-soft); color: var(--dock-ink); padding: 11px 14px; border-radius: var(--radius); font-size: 14px; border-left: 3px solid var(--dock); }
.info { background: var(--steel-soft); color: #1d3b58; padding: 11px 14px; border-radius: var(--radius); font-size: 14px; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.pending { background: var(--pending-bg); color: var(--pending); }
.chip.confirmed { background: var(--ok-bg); color: var(--ok); }
.chip.cancelled { background: var(--bad-bg); color: var(--bad); }
.chip.plain { background: var(--concrete); color: var(--ink-2); }
.chip.plain::before { display: none; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 9px 14px; font: 500 14px var(--font); color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.tabs button .n { color: var(--ink-3); font-weight: 400; margin-left: 4px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 0 14px; height: 36px; font: 500 14px var(--font); color: var(--ink-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: #fff; }

/* ---------- модальные окна и уведомления ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 26, 34, .45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px 12px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); width: 100%; max-width: 560px; animation: pop .14s ease-out; }
.modal.wide { max-width: 760px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.modal-head h2 { flex: 1; font-size: 18px; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 640px) {
  .overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 94vh; overflow-y: auto; }
}

.toasts { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 24px); max-width: 460px; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--radius); box-shadow: var(--shadow); font-size: 14px; pointer-events: auto; animation: pop .16s ease-out; }
.toast.bad { background: var(--bad); }

.empty { text-align: center; padding: 42px 16px; color: var(--ink-3); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--steel); border-radius: 50%; animation: spin .7s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- календарь ---------- */
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.cal-head h3 { flex: 1; text-align: center; font-size: 16px; text-transform: lowercase; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .wd { text-align: center; font-size: 12px; color: var(--ink-3); padding: 4px 0; }
.day {
  border: 1px solid transparent; background: none; border-radius: var(--radius); padding: 8px 2px 7px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font: 500 15px var(--font); color: var(--ink); font-feature-settings: 'tnum' 1;
}
.day:hover:not(:disabled) { background: var(--concrete); }
.day:disabled { cursor: default; color: #b8bfc7; }
.day.other { visibility: hidden; }
.day.today .d { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.day.sel { background: var(--ink); color: #fff; }
.day.sel .meter { background: rgba(255,255,255,.25); }
.meter { width: 70%; height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; display: flex; }
.meter i { display: block; height: 100%; }
.meter .f { background: #3f8f6a; }
.meter .b { background: var(--busy); }
.day.sel .meter .b { background: rgba(255,255,255,.45); }
.day.full .meter .f { display: none; }

/* ---------- запись: доска слотов ---------- */
.book { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
.book-side { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 900px) {
  .book { grid-template-columns: 1fr; }
  .book-side { display: contents; }
  .book .b-cal { order: 1; }
  .book .b-slots { order: 2; }
  .book .b-sum { order: 3; }
  .book .b-note { order: 4; }
}

.slots { display: flex; flex-direction: column; }
.slot {
  display: grid; grid-template-columns: 112px 1fr auto; align-items: center; gap: 12px;
  min-height: 46px; padding: 0 14px; border: 0; border-bottom: 1px solid var(--line-2); background: #fff;
  font: inherit; color: inherit; text-align: left; cursor: pointer; position: relative;
}
.slot:last-child { border-bottom: 0; }
.slot .t { font-weight: 600; font-size: 16px; font-feature-settings: 'tnum' 1; }
.slot .s { font-size: 13.5px; color: var(--ink-3); }
.slot .box { width: 20px; height: 20px; border-radius: 4px; border: 1.5px solid #b5bdb4; display: grid; place-items: center; }
.slot:hover:not(:disabled) { background: #fbfcfb; }
.slot:disabled { cursor: default; background: repeating-linear-gradient(-45deg, #f6f7f5, #f6f7f5 6px, #f1f3f0 6px, #f1f3f0 12px); }
.slot:disabled .t { color: #9aa3ad; font-weight: 500; }
.slot.mine:disabled { background: var(--steel-soft); }
.slot.mine:disabled .t { color: var(--steel); }
.slot.on { background: var(--dock); color: var(--dock-ink); border-bottom-color: rgba(58,47,5,.12); }
.slot.on .s { color: var(--dock-ink); }
.slot.on .box { background: var(--dock-ink); border-color: var(--dock-ink); color: var(--dock); }
.slot.on.join-up { border-top-left-radius: 0; }
.slot.gap { margin-top: 10px; border-top: 1px solid var(--line-2); }
.slot-break { padding: 6px 14px; font-size: 12.5px; color: var(--ink-3); background: var(--concrete); border-bottom: 1px solid var(--line-2); }

.summary { border-top: 3px solid var(--dock); }
.summary .when { font-size: 22px; font-weight: 600; font-feature-settings: 'tnum' 1; line-height: 1.25; }
.more-toggle { background: none; border: 0; padding: 0; font: 500 14px var(--font); color: var(--steel); cursor: pointer; text-align: left; }
.sticky-cta { display: none; }
@media (max-width: 900px) {
  .sticky-cta { display: flex; position: sticky; bottom: 0; z-index: 10; background: var(--ink); color: #fff; padding: 12px 16px; gap: 12px; align-items: center; margin: 0 -16px; }
  .sticky-cta .grow { font-weight: 500; }
}

/* ---------- список записей ---------- */
.olist { display: flex; flex-direction: column; }
.orow { display: grid; grid-template-columns: 150px 1fr auto; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); align-items: start; }
.orow:last-child { border-bottom: 0; }
.orow.click { cursor: pointer; }
.orow.click:hover { background: #fafbfa; }
.orow .when-d { font-weight: 600; }
.orow .when-t { font-size: 18px; font-weight: 600; font-feature-settings: 'tnum' 1; }
.orow .who { font-weight: 600; }
.orow .ref { margin-top: 3px; color: var(--ink-2); font-size: 14px; white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.orow .meta { margin-top: 4px; display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.orow .side { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.orow.cancelled .when-t, .orow.cancelled .who { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
@media (max-width: 700px) {
  .orow { grid-template-columns: 1fr; gap: 8px; }
  .orow .side { flex-direction: row; align-items: center; flex-wrap: wrap; }
}

/* ---------- склад: доска дня ---------- */
.board { display: flex; flex-direction: column; }
.brow { display: grid; grid-template-columns: 96px 1fr; border-bottom: 1px solid var(--line-2); min-height: 52px; position: relative; }
.brow:last-child { border-bottom: 0; }
.brow .bt { padding: 13px 0 0 18px; font-weight: 600; font-feature-settings: 'tnum' 1; color: var(--ink-2); font-size: 15px; }
.brow .bt small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.brow .bc { padding: 8px 14px 8px 0; }
.brow.free .bc { display: flex; align-items: center; color: #a3abb4; font-size: 14px; }
.brow.past { opacity: .62; }
.brow.now { background: var(--dock-soft); }
.brow.now::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--dock); }
.brow.now .bt { color: var(--dock-ink); }
.bcard { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 9px 12px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.bcard:hover { border-color: #aeb7ad; }
.bcard.pending { border-left: 4px solid #e2a63b; }
.bcard.confirmed { border-left: 4px solid #3f8f6a; }
.bcard .who { font-weight: 600; }
.bcard .ref { color: var(--ink-2); font-size: 14px; white-space: pre-wrap; word-break: break-word; grid-column: 1; }
.bcard .meta { font-size: 13px; color: var(--ink-3); display: flex; gap: 4px 12px; flex-wrap: wrap; grid-column: 1; }
.bcard .acts { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.cont { padding: 8px 12px; color: var(--ink-3); font-size: 13.5px; border-left: 4px solid var(--line); margin-left: 0; }
@media (max-width: 640px) {
  .brow { grid-template-columns: 64px 1fr; }
  .brow .bt { padding-left: 12px; font-size: 14px; }
  .bcard { grid-template-columns: 1fr; }
  .bcard .acts { grid-column: 1; grid-row: auto; flex-direction: row; align-items: center; }
}

.daynav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.daynav .d { font-weight: 600; min-width: 190px; text-align: center; }
.kpis { display: flex; gap: 24px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.kpis b { font-size: 20px; color: var(--ink); font-feature-settings: 'tnum' 1; margin-right: 4px; }

/* ---------- склад: неделя ---------- */
.week-wrap { overflow-x: auto; }
.week { display: grid; min-width: 760px; }
.week .wh { padding: 10px 8px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--line); text-align: center; }
.week .wh.today { background: var(--dock-soft); }
.week .wh small { display: block; font-weight: 400; color: var(--ink-3); }
.week .wt { padding: 6px 10px; font-size: 13px; color: var(--ink-3); border-bottom: 1px solid var(--line-2); font-feature-settings: 'tnum' 1; white-space: nowrap; }
.week .wc { border-bottom: 1px solid var(--line-2); border-left: 1px solid var(--line-2); padding: 3px; min-height: 34px; }
.week .wc.none { background: #f6f7f5; }
.wcell { display: block; width: 100%; height: 100%; border: 0; border-radius: 4px; padding: 3px 6px; font: 500 12.5px var(--font); text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcell.pending { background: var(--pending-bg); color: var(--pending); }
.wcell.confirmed { background: var(--ok-bg); color: var(--ok); }
.wcell.free { background: none; color: #b2bac3; font-weight: 400; cursor: default; }

/* ---------- таблицы админки ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #fafbfa; }

.admin { display: grid; grid-template-columns: 210px 1fr; gap: 20px; align-items: start; }
.side-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 76px; }
.side-nav a { padding: 9px 12px; border-radius: var(--radius); color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14.5px; }
.side-nav a:hover { background: rgba(27,36,48,.05); }
.side-nav a.on { background: var(--surface); color: var(--ink); box-shadow: inset 3px 0 0 var(--steel); }
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .side-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .side-nav a { white-space: nowrap; }
  .side-nav a.on { box-shadow: inset 0 -2px 0 var(--steel); }
}

/* расписание */
.wd-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); align-items: center; }
.wd-row:last-child { border-bottom: 0; }
.wd-row .name { font-weight: 600; }
.wd-row .ranges { display: flex; flex-wrap: wrap; gap: 6px; }
.rng { background: var(--concrete); border-radius: 4px; padding: 3px 9px; font-size: 14px; font-feature-settings: 'tnum' 1; }
.rng.off { background: none; color: var(--ink-3); padding-left: 0; }
@media (max-width: 640px) { .wd-row { grid-template-columns: 1fr auto; } .wd-row .ranges { grid-column: 1 / -1; grid-row: 2; } }
.slot-edit { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.gen { background: var(--concrete); border-radius: var(--radius); padding: 12px; }

/* авторизация */
.auth { max-width: 440px; margin: 5vh auto 0; }
.auth .panel { padding: 26px; }
.auth h1 { margin-bottom: 6px; }
.auth .sub { color: var(--ink-3); margin-bottom: 20px; }
.doc { max-width: 760px; }
.doc .pre { font-size: 14.5px; line-height: 1.65; }

.dl { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; font-size: 14.5px; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 560px) { .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: 8px; } }
.hist { font-size: 13px; color: var(--ink-3); display: flex; flex-direction: column; gap: 3px; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--concrete); padding: 1px 6px; border-radius: 4px; }
hr.sep { border: 0; border-top: 1px solid var(--line-2); margin: 16px 0; }
.foot { text-align: center; color: var(--ink-3); font-size: 13px; padding: 24px 16px 40px; }
.foot a { color: var(--ink-3); }
.slot.on:hover:not(:disabled) { background: #ebb919; }
.slot:disabled .box { visibility: hidden; }
@media (max-width: 640px) {
  .top-in { gap: 10px; padding: 0 12px; }
  .brand > span:last-child { display: none; }
  .page { padding: 16px 12px 80px; }
  h1 { font-size: 22px; }
}

/* лист ожидания: занятый слот с кнопкой */
.slot.busy { cursor: default; background: repeating-linear-gradient(-45deg, #f6f7f5, #f6f7f5 6px, #f1f3f0 6px, #f1f3f0 12px); }
.slot.busy .t { color: #9aa3ad; font-weight: 500; }
.slot.busy .watch-btn { color: var(--steel); font-weight: 500; }
.slot.busy.watching { background: var(--steel-soft); }
.slot.busy.watching .s { color: var(--steel); }
.slot.busy.watching .watch-btn { color: var(--ink-3); }
@media (max-width: 520px) {
  .slot.busy { grid-template-columns: 1fr auto; padding-top: 6px; padding-bottom: 6px; }
  .slot.busy .s { grid-column: 1; grid-row: 2; font-size: 12.5px; }
  .slot.busy .watch-btn { grid-column: 2; grid-row: 1 / span 2; white-space: normal; max-width: 130px; height: auto; padding: 4px 8px; line-height: 1.25; }
}
.tg-row { display: flex; gap: 12px; align-items: center; }
.tg-mark { width: 40px; height: 40px; border-radius: 50%; background: #e3f0fa; color: #2a8bd0; display: grid; place-items: center; flex: none; }

/* ---------- лист отгрузок (печать) ---------- */
.sheet { background: #fff; color: #000; padding: 28px 32px; border: 1px solid var(--line); border-radius: var(--radius-lg); max-width: 1000px; }
.sheet-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 14px; }
.sheet-title { font-size: 20px; font-weight: 600; }
.sheet-sub, .sheet-meta { font-size: 12.5px; color: #333; }
.sheet-meta { text-align: right; white-space: nowrap; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sheet-table th { text-align: left; font-weight: 600; font-size: 12px; padding: 6px 8px; border-bottom: 1.5px solid #000; }
.sheet-table td { padding: 8px; border-bottom: 1px solid #999; vertical-align: top; }
.sheet-table tr { break-inside: avoid; }
.sheet-small { font-size: 11.5px; color: #333; margin-top: 2px; }
.sheet-box { display: inline-block; width: 18px; height: 18px; border: 1.5px solid #000; }
.sheet-free td { color: #777; }
.sheet-foot { display: flex; justify-content: space-between; margin-top: 36px; font-size: 13px; }
@media (max-width: 700px) { .sheet { padding: 16px; overflow-x: auto; } .sheet-table { min-width: 640px; } }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .top, .foot, .no-print, .toasts { display: none !important; }
  .page { padding: 0; max-width: none; }
  .sheet { border: 0; padding: 0; max-width: none; border-radius: 0; }
}

/* ---------- аналитика ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; }
.stat-v { font-size: 28px; font-weight: 600; line-height: 1.1; }
.stat-l { font-weight: 500; margin-top: 2px; }
.stat-s { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.4; }
.bars { display: grid; grid-template-columns: 34px 1fr; gap: 6px; }
.bars-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); text-align: right; height: 180px; font-feature-settings: 'tnum' 1; }
.bars-plot { display: flex; align-items: stretch; gap: 2px; border-bottom: 1px solid var(--line); min-width: 0; overflow: hidden; }
.bar-col { flex: 1; min-width: 3px; display: flex; flex-direction: column; cursor: default; }
.bar-area { height: 180px; position: relative; }
.bar-track, .bar { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 4px 4px 0 0; }
.bar-track { background: var(--line-2); }
.bar { background: var(--steel); }
.bar-col:hover .bar { background: #1f4a72; }
.bar-col.today .bar-track { background: var(--dock-soft); }
.bar-x { height: 18px; font-size: 11px; color: var(--ink-3); text-align: center; padding-top: 3px; font-feature-settings: 'tnum' 1; }
table.heat { border-collapse: separate; border-spacing: 2px; font-size: 12px; font-feature-settings: 'tnum' 1; }
table.heat th { font-weight: 500; color: var(--ink-3); padding: 2px 6px; white-space: nowrap; }
table.heat tbody th { text-align: left; color: var(--ink-2); }
table.heat td { min-width: 52px; height: 34px; text-align: center; border-radius: 4px; font-weight: 500; }
table.heat td.heat-none { background: repeating-linear-gradient(-45deg, #f6f7f5, #f6f7f5 4px, #eef0ed 4px, #eef0ed 8px); }
.tip { position: fixed; z-index: 90; background: var(--ink); color: #fff; font-size: 13px; padding: 6px 10px; border-radius: var(--radius); pointer-events: none; max-width: 280px; box-shadow: var(--shadow); }

/* ---------------- видеоинструкция ---------------- */
.page-head:has(+ .guide-banner) .guide-btn { display: none; }
.guide-btn { gap: 8px; }
.guide-play { width: 22px; height: 22px; border-radius: 50%; background: var(--dock); color: var(--dock-ink); display: inline-grid; place-items: center; padding-left: 2px; }
.modal.video-modal { max-width: 980px; }
.video-modal .modal-body { padding: 0; }
.video-wrap { background: var(--ink); aspect-ratio: 16 / 9; }
.video-wrap video { display: block; width: 100%; height: 100%; background: var(--ink); }
.video-note { padding: 12px 20px 16px; margin: 0; }
.guide-thumb { position: relative; flex: none; width: 128px; aspect-ratio: 16 / 9; border: 0; padding: 0; border-radius: var(--radius); overflow: hidden; background: var(--ink); cursor: pointer; }
.guide-thumb.big { width: 248px; }
.guide-thumb img, .guide-thumb-fill { display: block; width: 100%; height: 100%; object-fit: cover; }
.guide-thumb-play { position: absolute; left: 74%; top: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: var(--dock); color: var(--dock-ink); display: grid; place-items: center; padding-left: 3px; box-shadow: 0 2px 10px rgba(0,0,0,.35); transition: transform .15s; }
.guide-thumb.big .guide-thumb-play { width: 56px; height: 56px; }
.guide-thumb:hover .guide-thumb-play { transform: translate(-50%, -50%) scale(1.08); }
.guide-thumb-time { position: absolute; right: 6px; bottom: 6px; background: rgba(27,36,48,.85); color: #fff; font-size: 11px; line-height: 1; padding: 3px 5px; border-radius: 3px; }
.guide-banner { position: relative; display: flex; gap: 20px; align-items: center; padding: 16px; margin-bottom: 18px; border-left: 3px solid var(--dock); }
.guide-banner-text { flex: 1; min-width: 0; }
.guide-banner-text h3 { font-size: 17px; margin-bottom: 4px; }
.guide-banner-text p { color: var(--ink-2); margin: 0 0 12px; max-width: 560px; }
.guide-banner-text .btn svg { margin-right: 2px; }
.guide-close { position: absolute; top: 8px; right: 8px; }
.guide-card { display: flex; gap: 14px; align-items: center; padding: 12px; margin-top: 14px; }
.guide-card-title { font-weight: 600; }
.link-btn { background: none; border: 0; padding: 0; margin-top: 4px; color: var(--steel); font: inherit; font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
@media (max-width: 640px) {
  .guide-banner { flex-direction: column; align-items: stretch; gap: 12px; padding: 12px; }
  .guide-thumb.big { width: 100%; }
  .guide-close { display: none; }
  .guide-btn .muted { display: none; }
}
