:root {
  --bg: #f3f6f8;
  --paper: #fff;
  --ink: #1c2834;
  --soft: #5d6d7c;
  --faint: #8b9aab;
  --line: #e3eaef;
  --line-firm: #d0dbe3;
  --wash: #eef3f6;
  --surface-1: #f7fafb;
  --surface-warm: #f7f4ef;

  /* красный знака RepTrack — акцент, как в клинике */
  --red: #e23b2c;
  --red-dark: #c42e22;
  --red-soft: #fdecea;

  /* работа идёт прямо сейчас */
  --live: #0e7490;
  --live-soft: #e7f4f7;

  /* срок поджимает */
  --warn: #8a5a08;
  --warn-soft: #fcf4e5;

  /* сдано */
  --ok: #126c3f;
  --ok-soft: #e9f3ec;

  /* брак и удержания */
  --danger: #9f1239;
  --danger-soft: #fdf0f3;

  --shadow: 0 1px 2px rgba(22, 36, 48, 0.05);
  --shadow-lift: 0 12px 32px rgba(22, 36, 48, 0.08);
  --focus-ring: 0 0 0 3px rgba(226, 59, 44, 0.12);

  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --display: "Manrope", "Source Sans 3", sans-serif;
  --serif: var(--display);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 16px;
  --radius-2xl: 18px;
  --radius-feature: 20px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;

  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 18px;
  --text-xl: 24px;
  --text-display: 32px;

  --control-h: 44px;
  --control-h-sm: 36px;
  --control-pad-x: 14px;
  --control-radius: var(--radius-md);

  --icon-2xs: 12px;
  --icon-xs: 14px;
  --icon-sm: 16px;
  --icon-md: 18px;
  --icon-lg: 20px;
  --icon-box-sm: 28px;
  --icon-box-md: 32px;
  --icon-box-hit: 36px;

  --page-pad-x: 40px;
  --page-pad-y: 36px;
  --page-head-mb: 24px;
  --panel-pad: 22px 24px 24px;
  --panel-pad-compact: 16px;
  --gap-section: 16px;

  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
}
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--red);
  z-index: 40;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: var(--text-display); line-height: 1.15; }
h2 { font-size: var(--text-lg); line-height: 1.3; }
p { margin: 0; }
::selection { background: #f8d2cd; }
svg.lucide { width: var(--icon-md); height: var(--icon-md); stroke: currentColor; flex: none; display: block; }
.ico { display: inline-grid; place-items: center; line-height: 0; flex: none; }
.btn svg.lucide, .text-btn svg.lucide { width: var(--icon-md); height: var(--icon-md); }
.nav-link svg.lucide, .text-link svg.lucide, .combo-trigger svg.lucide { width: var(--icon-sm); height: var(--icon-sm); }
.btn.small svg.lucide, .icon-btn svg.lucide, .stage-link svg.lucide,
.seg svg.lucide, .seg .ico, .toggle svg.lucide, .toggle .ico { width: var(--icon-xs); height: var(--icon-xs); }

.app { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: #fff;
  color: var(--ink);
  border-right: 1px solid var(--line);
  padding: 20px 12px 14px;
}
.brand {
  display: flex; align-items: center; text-decoration: none; color: inherit;
  padding: 2px 6px 16px; margin: 0 2px; border-bottom: 1px solid var(--line);
}
.brand-logo { display: block; width: 100%; height: auto; }
.brand-logo-login { width: min(440px, 100%); }
.nav {
  display: flex; flex-direction: column; gap: 18px;
  margin-top: 18px; flex: 1; overflow: auto; padding: 0 2px 8px;
}
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { margin: 0 0 4px; padding: 0 12px; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  text-decoration: none; color: var(--soft); font-weight: 650;
  padding: 10px 11px; border-radius: var(--radius-md);
  transition: background .15s ease, color .15s ease;
}
.nav-ico {
  width: var(--icon-box-sm); height: var(--icon-box-sm); border-radius: var(--radius-sm); flex: none;
  display: grid; place-items: center;
  background: var(--wash); color: var(--soft);
}
.nav-link:hover { background: #eef3f6; color: var(--ink); }
.nav-link:hover .nav-ico { background: #e3ebf0; color: var(--ink); }
.nav-link.active, .nav-link.active:hover {
  background: var(--red-soft); color: var(--red);
}
.nav-link.active .nav-ico, .nav-link.active:hover .nav-ico {
  background: #fff; color: var(--red);
  box-shadow: 0 1px 2px rgba(226, 59, 44, 0.08);
}
.nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-mark {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--live-soft); color: var(--live);
  font-size: 11px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.nav-mark.is-hot { background: var(--red); color: #fff; }
[hidden].nav-mark { display: none; }
.nav-link.active .nav-mark:not(.is-hot) { background: #fff; color: var(--red); }
.side-note {
  position: relative;
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  text-align: left; border: 1px solid var(--line); background: var(--paper);
  border-radius: var(--radius-lg); padding: 10px 12px 10px 11px; cursor: pointer; color: inherit;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.side-note::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--red);
}
.side-note.is-live::before { background: var(--live); }
.side-note.is-warn::before { background: var(--warn); }
.side-note.is-bad::before { background: var(--danger); }
.side-note:hover {
  border-color: var(--line-firm); background: #fff;
  box-shadow: 0 4px 14px rgba(22, 36, 48, 0.08);
}
[hidden].side-note { display: none; }
.side-note-copy { min-width: 0; flex: 1; }
.side-note-copy small {
  display: block; font-size: 10.5px; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--faint); font-weight: 700;
}
.side-note-copy strong, .side-note-copy em {
  display: block; overflow: hidden; text-overflow: ellipsis;
}
.side-note-copy strong {
  margin-top: 2px; font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--ink);
}
.side-note-copy em {
  margin-top: 2px; font-style: normal; font-size: 12px; color: var(--soft);
  white-space: normal; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.side-note .note-mark { width: var(--icon-box-sm); height: var(--icon-box-sm); border-radius: var(--radius-sm); }
.side-note .nav-mark { align-self: flex-start; margin-top: 2px; }
.sheet-link .nav-mark { margin-left: auto; }
.side-foot {
  margin-top: auto; display: flex; flex-direction: column; gap: 8px;
  padding: 12px 4px 2px; border-top: 1px solid var(--line);
}
.who-card {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  text-decoration: none; padding: 8px; border-radius: 14px;
}
.who-card:hover { background: var(--wash); }
.who-mini { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.who-mini strong, .who-mini span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-mini span, .muted, .hint, small { color: var(--soft); }
.who-mini span { font-size: 12px; }
.side-tools { display: flex; gap: 4px; align-items: center; padding: 0 4px; }
.text-btn, .icon-btn {
  border: 0; background: transparent; color: var(--soft);
  display: grid; place-items: center;
  width: var(--icon-box-hit); height: var(--icon-box-hit);
  border-radius: var(--radius-sm); padding: 0;
}
.text-btn:hover, .icon-btn:hover { background: var(--red-soft); color: var(--red); }

/* уведомления */
.bell {
  position: relative; flex: none;
  border: 0; background: transparent; color: var(--soft);
  display: grid; place-items: center;
  width: var(--icon-box-hit); height: var(--icon-box-hit);
  border-radius: var(--radius-sm); padding: 0;
  transition: background .15s ease, color .15s ease;
}
.bell:hover { background: var(--wash); color: var(--ink); }
.bell.has-new { color: var(--red); }
.bell.has-new svg.lucide { animation: bell-nudge 1.6s ease infinite; }
.bell b {
  position: absolute; top: 1px; right: 0;
  min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: var(--radius-pill); background: var(--red); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--paper);
}
@keyframes bell-nudge {
  0%, 88%, 100% { transform: rotate(0); }
  92% { transform: rotate(-12deg); }
  96% { transform: rotate(10deg); }
}
.note-mark {
  width: var(--icon-box-md); height: var(--icon-box-md); border-radius: var(--radius-sm); flex: none;
  display: grid; place-items: center;
  background: var(--wash); color: var(--soft);
}
.note-mark svg.lucide { width: var(--icon-sm); height: var(--icon-sm); }
.note-mark.live { background: var(--live-soft); color: var(--live); }
.note-mark.bad { background: var(--danger-soft); color: var(--danger); }
.note-mark.warn { background: var(--warn-soft); color: var(--warn); }
.note-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.note-filter, .shade-tab {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--soft);
  border-radius: var(--radius-pill); min-height: var(--control-h-sm);
  padding: 0 12px; font-size: var(--text-sm); font-weight: 700;
}
.note-filter svg.lucide { width: var(--icon-xs); height: var(--icon-xs); }
.note-filter.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.note-day {
  margin: 14px 4px 6px; font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint); font-weight: 700;
}
.note-day:first-child { margin-top: 2px; }

.modal.notes-modal { width: min(520px, 100%); padding: 18px 18px 16px; }
.modal.notes-modal .modal-head { margin-bottom: 12px; }
.modal.notes-modal .modal-head h3 { font-size: 22px; }
.notes-panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.notes-toolbar {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px; border-radius: var(--radius-xl); background: var(--surface-1);
  border: 1px solid var(--line);
}
.notes-toolbar .note-filters {
  flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: thin;
}
.notes-toolbar .note-filter { flex: none; }
.notes-summary { margin: 0; font-size: var(--text-sm); color: var(--soft); font-weight: 650; }
.notes-summary strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.notes-feed { display: flex; flex-direction: column; gap: 2px; max-height: min(58vh, 560px); overflow: auto; margin: 0 -4px; padding: 0 4px; }
.notes-row {
  position: relative;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px;
  align-items: flex-start; padding: 11px 10px; border-radius: var(--radius-lg);
  text-decoration: none; border: 1px solid transparent; background: transparent;
  transition: background .15s ease;
}
.notes-row:hover { background: var(--wash); }
.notes-row.is-new { background: #fff8f7; }
.notes-row.is-new:hover { background: #fff1ef; }
.notes-row-body { min-width: 0; }
.notes-row-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.notes-row-top strong {
  font-size: 14.5px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); line-height: 1.3;
}
.notes-row-top time {
  flex: none; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.notes-row-body p {
  margin: 4px 0 0; color: var(--soft); font-size: var(--text-sm); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notes-row-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px;
}
.notes-tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--wash); color: var(--soft);
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.notes-tag.live { background: var(--live-soft); color: var(--live); }
.notes-tag.warn { background: var(--warn-soft); color: var(--warn); }
.notes-tag.bad { background: var(--danger-soft); color: var(--danger); }
.notes-code {
  font-size: 12px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.notes-go {
  font-size: 12px; font-weight: 650; color: var(--red); margin-left: auto;
  opacity: 0; transition: opacity .15s ease;
}
.notes-row:hover .notes-go, .notes-row:focus-visible .notes-go { opacity: 1; }
@media (hover: none) {
  .notes-go { opacity: 1; }
}
.notes-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--red);
  margin-top: 8px; box-shadow: 0 0 0 3px rgba(226, 59, 44, 0.12);
}
.notes-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 6px; padding: 36px 20px; border-radius: var(--radius-xl);
  border: 1px dashed var(--line-firm); background: var(--surface-1); color: var(--soft);
}
.notes-empty-ico {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: grid; place-items: center; margin-bottom: 4px;
  background: var(--wash); color: var(--faint);
}
.notes-empty-ico svg.lucide { width: var(--icon-lg); height: var(--icon-lg); }
.notes-empty strong { color: var(--ink); font-size: 15px; }
.notes-empty p { margin: 0; max-width: 32ch; font-size: var(--text-sm); line-height: 1.45; }
.shade-board {
  border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 14px;
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.shade-board legend { font-weight: 700; padding: 0 4px; }
.shade-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.shade-tab.is-on { background: var(--red-soft); color: var(--red); border-color: #f0c2bd; }
.shade-group p { margin: 0 0 6px; font-size: 12px; color: var(--faint); font-weight: 700; }
.shade-row { display: flex; flex-wrap: wrap; gap: 8px; }
.shade-chip {
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 6px 8px 6px 6px; display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; color: var(--ink);
}
.shade-chip i {
  width: 22px; height: 22px; border-radius: 8px; display: block;
  background: var(--chip, #eee); box-shadow: inset 0 0 0 1px rgba(28, 40, 52, 0.12);
}
.shade-chip small { display: block; font-size: 10px; color: var(--faint); font-weight: 650; }
.shade-chip.is-on { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-soft); }
.shade-eq { background: var(--wash); border-radius: 12px; padding: 10px; }
.shade-eq p { margin: 0 0 8px; font-size: 13px; }
.shade-eq-empty { margin: 0; color: var(--soft); font-size: 13px; }
.shade-fact { display: inline-flex; align-items: center; gap: 8px; text-align: left; font-weight: 650; }
.shade-fact i {
  width: 18px; height: 18px; border-radius: 6px; flex: none;
  background: var(--chip, #eee); box-shadow: inset 0 0 0 1px rgba(28, 40, 52, 0.12);
}
.shade-fact strong, .shade-fact small { display: block; }
.shade-fact strong { font-size: 13px; }
.shade-fact small { color: var(--soft); font-weight: 600; font-size: 12px; }

/* нижняя панель на телефоне */
.tabbar { display: none; }
.sheet-list { display: flex; flex-direction: column; gap: 2px; margin: -4px; }
.sheet-link {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 12px; border-radius: 14px; border: 0; background: transparent;
  text-decoration: none; font-weight: 650; text-align: left; width: 100%;
}
.sheet-link:hover { background: var(--wash); }
.main { min-width: 0; padding: var(--page-pad-y) var(--page-pad-x) 88px; }
.page-head, .panel-head, .head-actions, .toolbar, .modal-head, .modal-actions, .ticket-actions, .assignee, .ticket-top, .ticket-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.page-head, .board-head, .zone-head { align-items: flex-end; margin-bottom: var(--page-head-mb); }
.eyebrow, .nav-label, .work-kicker {
  font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); font-weight: 700;
}
.work-kicker { display: inline-flex; align-items: center; gap: 7px; color: var(--soft); margin: 0 0 8px; letter-spacing: 0.06em; }
.sub { color: var(--soft); margin-top: var(--space-2); max-width: 62ch; line-height: 1.45; }
.num { font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  border: 1px solid transparent; border-radius: var(--radius-pill);
  min-height: var(--control-h); padding: 0 16px;
  background: var(--wash); font-weight: 650; text-decoration: none; cursor: pointer;
  line-height: 1.2;
}
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.danger { background: var(--danger); color: white; }
.btn.danger:hover { background: #881337; }
.btn.ghost { background: #fff; border-color: var(--line); }
.btn.ghost:hover { border-color: var(--line-firm); color: var(--ink); }
.btn.small { min-height: var(--control-h-sm); padding: 0 12px; font-size: var(--text-sm); }
.btn.big { min-height: 48px; padding: 0 22px; font-size: var(--text-md); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.field { display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); color: var(--soft); font-weight: 600; }
.field.inline { min-width: 160px; }
.field.is-empty input,
.field.is-empty .combo-input,
.field.is-empty textarea {
  border-color: var(--line);
  background: #fff;
}
.field.is-valid input,
.field.is-valid .combo-input,
.field.is-valid textarea {
  border-color: #9dceb0;
  background: var(--ok-soft);
}
.field.is-invalid input,
.field.is-invalid .combo-input,
.field.is-invalid textarea {
  border-color: #e8a0a6;
  background: var(--danger-soft);
}
.field-tools { display: flex; gap: 10px; margin-top: -2px; }
.field-error { min-height: 1.2em; color: var(--danger); font-size: 13px; margin: 0; }
.field-warn { min-height: 1.2em; color: #9a6b16; font-size: 13px; margin: 0; }
.clinic-create-cta { margin: -6px 0 4px; }
.wizard-panel button.text-link,
.materials-head a.text-link {
  background: none; border: 0; padding: 0; color: var(--red);
  font: inherit; font-weight: 650; cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}
button.text-link[hidden],
a.text-link[hidden] { display: none; }
.materials-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: var(--surface-1);
}
.materials-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin-bottom: 12px;
}
.materials-pick { display: flex; flex-direction: column; gap: 8px; }
.material-row {
  display: grid;
  grid-template-columns: auto 1fr 96px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #fff;
}
.material-row.is-on { border-color: #c9dfd4; background: #f3faf6; }
.material-row.is-short { border-color: #e8a0a6; background: #fff5f5; }
.material-info strong { display: block; color: var(--ink); font-size: 14px; }
.material-info em { display: block; font-style: normal; color: var(--soft); font-size: 12px; margin-top: 2px; }
.materials-total { margin: 10px 0 0; font-size: 14px; }
.materials-box ul { margin: 8px 0 0; padding-left: 18px; }
.materials-box li.is-short { color: var(--danger); }
.mat-search { margin-bottom: 8px; }
.mat-suggest { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.mat-suggest-hint { margin: 0 0 4px; font-size: 13px; }
.materials-pick .material-row {
  grid-template-columns: 1fr 96px auto;
}
.type-materials { margin-top: 8px; }
.patient-picker-list { max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.picker-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; width: 100%; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
}
.picker-row:hover { border-color: var(--line-firm); }
.picker-row strong { color: var(--ink); font-size: 14px; }
.picker-row span { color: var(--soft); font-size: 12px; }
.stock-layout { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.stock-layout > .panel { margin-bottom: 0; }
.stock-side h2 { margin: 0 0 12px; font-size: 18px; }
.stock-folders { display: flex; flex-direction: column; gap: 8px; }
.stock-folder {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 8px;
}
.stock-folder.is-on { border-color: var(--red); background: var(--red-soft); }
.stock-folder > button[data-folder] {
  border: 0; background: transparent; text-align: left; padding: 4px 6px; color: inherit; min-width: 0;
}
.stock-folder strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-folder em { display: block; margin-top: 2px; font-style: normal; color: var(--soft); font-size: 12px; white-space: nowrap; }
.stock-folder-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 0 4px 2px; }
.stock-access { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow: auto; }
.stock-access .check small { display: block; color: var(--soft); font-weight: 500; }
.field select {
  width: 100%; min-height: var(--control-h); border: 1px solid var(--line); border-radius: var(--control-radius);
  background: #fff; padding: 8px 12px; font: inherit; color: inherit;
}
.warehouse-table .row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.warehouse-table tr.is-low td:nth-child(2) { color: var(--danger); font-weight: 700; }
.warehouse-table tr.is-off { opacity: 0.55; }
.pad-top { padding: 0 16px 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); font-weight: 600; }
.check input { width: auto; }
.works-layout {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.works-catalog {
  position: sticky;
  top: 16px;
  padding: 16px;
}
.works-catalog-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.works-catalog-head h2 { font-size: 16px; }
.works-catalog .search { margin-bottom: 10px; }
.works-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.works-cats button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 650;
  color: var(--soft);
}
.works-cats button.active {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--ink);
}
.works-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 260px); overflow: auto; }
.works-card {
  text-align: left;
  border: 1px solid var(--line);
  background: #f5f8fa;
  border-radius: 14px;
  padding: 11px 12px;
}
.works-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.works-card-top strong { font-size: 14px; letter-spacing: -0.02em; }
.works-card-top em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--soft);
  background: var(--wash);
  border-radius: 999px;
  padding: 2px 8px;
  flex: none;
}
.works-card-meta {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  color: var(--faint);
  font-size: 12px;
}
.works-card-meta i { font-style: normal; }
.works-card:hover { border-color: var(--line-firm); }
.works-card.active {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(226, 59, 44, 0.08);
}
.works-detail { padding: 20px; min-height: 420px; }
.works-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.works-detail-head h2 { font-size: 22px; margin-top: 2px; }
.works-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
  color: var(--soft);
  font-size: 13px;
}
.works-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.works-col-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.works-col-head h3 { margin: 0 0 4px; font-size: 15px; }
.works-col-head .hint { margin: 0; font-size: 12px; }
.deadline-default {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.deadline-default input { width: 100%; }
.deadline-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.deadline-presets button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}
.deadline-presets button:hover { border-color: var(--line-firm); background: var(--bg); }
.works-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.works-flow li {
  background: var(--wash);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 650;
}
.works-flow li + li { position: relative; }
.works-mat-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--soft);
}
.works-mat-preview b {
  background: var(--ok-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 650;
  font-size: 12px;
}
.works-mat-preview b.is-off { background: var(--wash); opacity: 0.65; }
.ok-word { color: var(--ok); font-style: normal; }

/* Визуализация 3D */
.main:has(.line-page) {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 0px);
}
.line-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
}
.line-hud-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.line-hud-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.line-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.line-kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 108px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.line-kpi span { font-size: 12px; color: var(--soft); font-weight: 650; }
.line-kpi strong { font-size: 22px; letter-spacing: -0.03em; }
.line-kpi.is-live { border-color: #bcd8d5; background: var(--live-soft); }
.line-kpi.is-live strong { color: var(--live); }
.line-kpi.is-late { border-color: #f0c4c8; background: var(--danger-soft); }
.line-kpi.is-late strong { color: var(--danger); }
.line-kpi.is-free { border-color: #cfe7d8; background: var(--ok-soft); }
.line-kpi.is-free strong { color: var(--ok); }
.line-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 310px);
  gap: 14px;
  flex: 1;
  min-height: 480px;
}
.line-canvas-wrap {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e7eef3;
  min-height: 480px;
  height: calc(100vh - 250px);
  isolation: isolate;
}
.line-stage.is-full {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: block;
  min-height: 0;
  background: #e7eef3;
}
.line-stage:fullscreen { width: 100vw; height: 100vh; }
.line-stage.is-full .line-canvas-wrap {
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
}
.line-stage.is-full .line-drawer {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  width: min(320px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  box-shadow: 0 18px 40px rgba(30, 20, 15, .16);
}
.line-stage.is-full:not(.has-pick) .line-drawer { display: none; }
.line-stage.is-full .line-stage-list { max-height: none; }
html.line-full-lock, html.line-full-lock body { overflow: hidden; }
@media (max-width: 760px) {
  .line-stage.is-full .line-drawer { top: auto; bottom: 12px; max-height: 48%; }
}
.line-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}
.l3-labels { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.l3-labels > * { pointer-events: none; }
.line-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: #e7eef3;
  color: var(--soft);
  font-weight: 650;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.line-loading span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--red);
  animation: line-spin 0.8s linear infinite;
}
.line-canvas-wrap.is-loading .line-loading { opacity: 1; }
@keyframes line-spin { to { transform: rotate(360deg); } }
.line-tools {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(27, 25, 23, 0.06);
}
.line-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  padding: 7px 10px;
  background: transparent;
  color: var(--soft);
  font-size: 13px;
  font-weight: 650;
}
.line-tool svg.lucide { width: 16px; height: 16px; }
.line-tool:hover { background: var(--wash); color: var(--ink); }
.line-tool.on { background: var(--red-soft); color: var(--red); }
.line-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  list-style: none;
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  color: var(--soft);
  font-size: 12px;
  font-weight: 650;
}
.line-legend li { display: inline-flex; align-items: center; gap: 7px; }
.line-legend i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid var(--line-firm);
  background: #fff;
}
.line-legend i.is-live { background: #16897d; border-color: #16897d; }
.line-legend i.is-late { background: #c81e45; border-color: #c81e45; }
.line-legend i.is-hot { background: var(--red); border-color: var(--red); }
.line-legend i.is-wait { background: #e0a326; border-color: #e0a326; }
.line-legend i.is-idle { background: #7a4fb0; border-color: #7a4fb0; }
.line-tip[hidden] { display: none; }
.line-tip[hidden] { display: none; }
.line-tip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  display: grid;
  gap: 2px;
  max-width: 260px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(27, 25, 23, 0.92);
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(27, 25, 23, 0.25);
}
.line-tip b { font-weight: 700; }
.line-tip small { color: rgba(255, 255, 255, 0.7); font-size: 12px; }

/* подписи в 3D */
.l3-station, .l3-tray, .l3-worker, .l3-zone {
  font-family: var(--sans);
  white-space: nowrap;
  user-select: none;
  transition: opacity 0.3s ease;
}
.l3-station {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(27, 25, 23, 0.1);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.l3-station span {
  min-width: 22px;
  text-align: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--wash);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.l3-station.is-live span { background: #16897d; color: #fff; }
.l3-station.is-late { border-color: #f0c4c8; }
.l3-station.is-late span { background: #c81e45; color: #fff; }
.l3-station.is-empty { opacity: 0.6; }
.l3-tray {
  padding: 2px 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(27, 25, 23, 0.08);
}
.l3-tray.is-live { background: #16897d; border-color: #16897d; color: #fff; }
.l3-tray.is-late { background: #c81e45; border-color: #c81e45; color: #fff; }
.l3-tray.is-hot { border-color: var(--red); color: var(--red); }
.l3-worker {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 4px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(27, 25, 23, 0.08);
}
.l3-worker b { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink); }
.l3-worker b i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.l3-worker small { font-size: 10.5px; color: var(--soft); font-weight: 650; }
.l3-worker.is-busy { border-color: #bcd8d5; }
.l3-worker.is-busy small { color: #0d5c57; }
.l3-worker.is-queue small { color: #8a5a08; }
.l3-zone {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(27, 25, 23, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.l3-zone b { margin-left: 4px; }
.l3-zone.is-ok { background: #1f8a55; }
.l3-zone.is-soft { background: rgba(13, 92, 87, 0.85); }
.l3-desk {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 3px 9px 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-top: 3px solid #c9c4bc;
  box-shadow: 0 4px 14px rgba(27, 25, 23, 0.09);
  text-align: center;
  line-height: 1.25;
}
.l3-desk b { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; color: var(--ink); }
.l3-desk b i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.l3-desk span { font-size: 10.5px; font-weight: 700; color: var(--ink); }
.l3-desk span em { font-style: normal; font-weight: 650; color: var(--soft); }
.l3-desk small { font-size: 10px; font-weight: 650; color: var(--soft); }
.l3-desk.is-live { border-top-color: #16897d; }
.l3-desk.is-live small { color: #0d5c57; }
.l3-desk.is-ready { border-top-color: #e0a326; }
.l3-desk.is-ready small { color: #8a5a08; }
.l3-desk.is-free { border-top-color: #1f8a55; }
.l3-desk.is-idle { border-top-color: #7a4fb0; }
.l3-desk.is-idle small { color: #5b3a8a; }
.l3-desk.is-admin { border-top-color: var(--red); }
.l3-desk.is-admin small { color: var(--red); }
.l3-count {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(27, 25, 23, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.l3-count.is-ready { background: #c4870f; }
.l3-count.is-empty { display: none; }
.is-labels-off .l3-tray,
.is-labels-off .l3-desk small,
.is-labels-off .l3-worker small { display: none; }
.line-hints {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 13px;
}
.line-hints b { color: var(--ink); margin-right: 4px; }
.line-stage-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 420px);
  overflow: auto;
}
.line-stage-list li {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f5f8fa;
}
.line-stage-list a { display: flex; gap: 8px; align-items: baseline; text-decoration: none; min-width: 0; }
.line-stage-list a:hover b { color: var(--red); }
.line-stage-list span { color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-stage-list small { font-size: 12px; color: var(--soft); }
.line-stage-list em { font-style: normal; font-weight: 700; }
.line-drawer {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  min-height: 280px;
}
.line-drawer-empty {
  color: var(--soft);
  display: grid;
  gap: 8px;
  align-content: start;
  padding-top: 8px;
}
.line-drawer-empty strong { color: var(--ink); }
.line-drawer-card h3 { font-size: 22px; margin: 4px 0; }
.line-drawer-card h3 a { text-decoration: none; }
.line-drawer-card h3 a:hover { color: var(--red); }
.line-drawer-title { font-size: 16px; font-weight: 650; margin-top: 4px; }
.line-drawer-who {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.line-facts {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}
.line-facts div {
  display: grid;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.line-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); font-weight: 700; }
.line-facts dd { margin: 0; font-weight: 650; }
.line-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.callout-soft {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7f4ef;
  color: var(--soft);
  font-size: 13px;
}
.settings-jump {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: -4px 0 16px;
}
.settings-jump .text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  text-decoration: none;
}
.settings-jump .text-link:hover { color: var(--red); }
input, select, textarea {
  width: 100%; background: #fff;
  border: 1px solid var(--line); border-radius: var(--control-radius);
  min-height: var(--control-h); padding: 10px var(--control-pad-x);
  font-weight: 500; line-height: 1.4;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: var(--focus-ring);
}
.month { min-width: 160px; }
.search { min-width: 220px; }

.kpis, .summary, .stat-row { display: grid; gap: 14px; margin-bottom: 20px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.summary, .stat-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpi, .summary article, .stat-row article, .panel, .callout, .hero, .pay-pill, .station, .ticket {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.kpi, .summary article, .stat-row article {
  border-radius: var(--radius-xl); padding: 18px 20px 16px;
}
.kpi span, .summary span, .stat-row span { display: block; color: var(--soft); font-size: 13px; }
.kpi strong, .summary b, .summary strong, .stat-row strong {
  display: block; font-size: clamp(22px, 2vw, 28px); font-weight: 700;
  letter-spacing: -0.03em; margin: 6px 0 0; white-space: nowrap; color: var(--ink);
}
.kpi em, .summary span { font-style: normal; }
.late-word { color: var(--red); }
.tone-urgent { color: #9a6700; font-style: normal; font-weight: 700; }
.tone-today { color: var(--live); font-style: normal; font-weight: 700; }
.report-hint { margin: 0 0 12px; padding: 0; }
.kpi.warn strong { color: var(--red); }
.neg, .summary strong.neg, .stat-row strong.neg { color: var(--danger); }
.pos { color: var(--ok); }

/* направления: категорий будет много, поэтому сетка подстраивается */
.dirs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.dir { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px 12px; background: #fff; }
.dir header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.dir h3 { font-size: 16.5px; font-weight: 700; }
.dir header b { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.dir-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; font-weight: 650; margin-top: 2px; }
.live-word { color: var(--live); }
.dir-types { display: flex; flex-direction: column; margin-top: 10px; }
.dir-type {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  padding: 9px 0; border-top: 1px solid var(--line); text-decoration: none; font-size: 13.5px;
}
.dir-type:hover { color: var(--red); }
.dir-type b { font-weight: 700; }
.dir-type em { font-style: normal; font-weight: 700; font-size: 12px; }

.dash-grid {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 16px; margin-bottom: 16px;
}
.dash-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chart-panel { min-height: 280px; }
.chart-bars { display: flex; flex-direction: column; gap: 10px; }
.chart-bar, a.chart-bar {
  display: grid; grid-template-columns: minmax(110px, 1.15fr) minmax(0, 1.4fr) auto;
  gap: 10px; align-items: center; text-decoration: none;
}
.chart-bar-label {
  font-size: 13px; font-weight: 650; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chart-bar-track {
  height: 10px; border-radius: 999px; background: var(--wash); overflow: hidden; display: block;
}
.chart-bar-track i { display: block; height: 100%; border-radius: 999px; background: var(--live); }
.chart-bar b { font-size: 14px; font-weight: 700; min-width: 1.5ch; text-align: right; }
a.chart-bar:hover .chart-bar-label { color: var(--red); }
.chart-line-wrap { display: flex; flex-direction: column; gap: 10px; }
.chart-line { width: 100%; height: auto; display: block; }
.chart-grid { stroke: #ebe6e0; stroke-width: 1; }
.chart-axis { fill: var(--faint); font-size: 11px; font-family: var(--sans); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 8px; color: var(--soft); font-size: 13px; font-weight: 650; }
.chart-legend i { width: 10px; height: 10px; border-radius: 99px; display: inline-block; }
.chart-donut {
  display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: center;
}
.donut-svg { width: 180px; height: 180px; }
.donut-total { font-size: 28px; font-weight: 700; fill: var(--ink); font-family: var(--sans); }
.donut-sub { font-size: 12px; fill: var(--soft); font-family: var(--sans); }
.donut-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.donut-legend li {
  display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center;
  font-size: 13px;
}
.donut-legend i { width: 10px; height: 10px; border-radius: 99px; display: block; }
.donut-legend b { font-weight: 700; }
.load-note {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.load-note strong, .load-note span { display: block; }
.load-note span { color: var(--soft); font-size: 12px; margin-top: 2px; }

/* поток по этапам: показываем только занятые этапы */
.flow { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.flow-step {
  position: relative; flex: 1 0 120px; min-width: 120px;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  text-decoration: none; background: #fff; overflow: hidden;
}
.flow-step:hover { border-color: var(--line-firm); }
.flow-step b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.flow-step span { display: block; font-size: 12.5px; color: var(--soft); line-height: 1.25; margin-top: 2px; }
.flow-step i {
  position: absolute; left: 0; bottom: 0; height: 3px;
  width: var(--fill); background: var(--live); border-radius: 0 3px 0 0;
}
.text-link { text-decoration: none; color: var(--soft); font-weight: 650; display: inline-flex; align-items: center; gap: 6px; }
button.text-link { background: none; border: 0; padding: 0; font: inherit; }
.text-link:hover { color: var(--red); }

.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 20px; margin-bottom: 20px; }
.split > :only-child { grid-column: 1 / -1; }
.event p, .live-row span { overflow-wrap: anywhere; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.pay-pick { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pay-pick legend { width: 100%; padding: 0; font-size: 13px; font-weight: 700; color: var(--soft); }
.pay-pick label { position: relative; }
.pay-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pay-pick span {
  display: block; padding: 8px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: #fff; font-weight: 700; cursor: pointer;
}
.pay-pick input:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.pay-pick input:focus-visible + span { box-shadow: var(--focus-ring); }
.panel { border-radius: var(--radius-2xl); padding: var(--panel-pad); margin-bottom: var(--gap-section); }
.panel.compact { padding: var(--panel-pad-compact); }
.split > .panel { margin-bottom: 0; }
.panel-head { margin-bottom: 14px; align-items: baseline; }
.panel-head h2 { font-size: var(--text-lg); white-space: nowrap; }
.panel-head .search { flex: 1 1 auto; max-width: 280px; }
.pad { padding: 4px 2px 8px; }
.live-row, .event, .queue-row, .ledger-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px 14px;
  align-items: center; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none;
}
.panel-head + .live-row,
.panel-head + .work-row,
.panel > .live-row:first-child {
  border-top: 0; padding-top: 2px;
}
.live-row:hover, .queue-row:hover { color: var(--ink); background: var(--wash); }
.timeline .event { align-items: flex-start; }
.event p, .live-row span, .queue-row span { color: var(--soft); }
.live-row strong { display: block; margin-bottom: 4px; }
.live-row span { display: block; line-height: 1.35; }

/* рабочая зона мастера */
.work-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-feature);
  padding: var(--panel-pad); margin-bottom: var(--gap-section); box-shadow: var(--shadow);
}
.work-card.is-live { border-color: #bcd8d5; background: linear-gradient(180deg, var(--live-soft), #fff 120px); }
.work-card.is-next { border-color: var(--line-firm); }
.work-card.is-empty { background: var(--wash); border-style: dashed; }
.work-card.is-live .work-kicker { color: var(--live); }
.work-card h2 { font-size: 28px; line-height: 1.15; margin: 0 0 8px; }
.work-project {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; font-weight: 700; color: var(--ink); margin-bottom: 4px;
}
.work-project:hover { color: var(--red); }
.work-timer { font-size: 44px; font-weight: 700; letter-spacing: -0.04em; color: var(--live); line-height: 1.05; margin: 12px 0 4px; }
.work-badge {
  display: inline-block; margin-top: 10px; padding: 5px 12px; border-radius: 999px;
  background: var(--wash); color: var(--soft); font-size: 12.5px; font-weight: 700;
}
.work-badge.is-late { background: var(--red); color: #fff; }
.work-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px 20px; margin: 18px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line);
}
.work-facts dt { font-size: 12px; color: var(--faint); font-weight: 700; letter-spacing: 0.02em; }
.work-facts dd { margin: 4px 0 0; font-weight: 650; line-height: 1.35; }
.work-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.work-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-top: 1px solid var(--line);
}
.work-row > div {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1;
}
.work-row a { text-decoration: none; }
.work-row a:hover strong { color: var(--red); }
.work-row strong { display: block; font-size: 15.5px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; }
.work-row span { display: block; font-size: 13.5px; color: var(--soft); line-height: 1.35; }
.work-row small { display: block; font-size: 12.5px; color: var(--faint); line-height: 1.35; }
.work-row.late { box-shadow: inset 3px 0 0 var(--red); padding-left: 12px; }
.work-row.is-wait { opacity: 0.78; }
.work-bar, .work-bar-space { display: none; }
.work-card .muted { margin-top: 8px; line-height: 1.45; }
.panel .muted.pad { padding: 2px 0 4px; line-height: 1.45; }

.seg { display: inline-flex; align-items: center; background: #fff; border-radius: var(--radius-pill); padding: 3px; border: 1px solid var(--line); gap: 2px; }
.seg a, .seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; background: transparent; text-decoration: none; white-space: nowrap;
  padding: 0 12px; border-radius: var(--radius-pill); color: var(--soft); font-weight: 650;
  line-height: 1; min-height: var(--control-h-sm);
}
.seg a.active, .seg button.active { background: var(--red); color: #fff; }
.toolbar { align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.type-select {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 0 var(--control-pad-x); color: var(--ink); font-weight: 650; min-width: 190px;
  min-height: var(--control-h);
}
.toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 0 12px; color: var(--soft); font-weight: 650; line-height: 1;
  min-height: var(--control-h);
}
.toggle:hover { border-color: var(--line-firm); color: var(--ink); }
.toggle.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.live-switch {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  position: relative; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; padding: 6px 12px 6px 8px; color: var(--soft); font-weight: 700;
  line-height: 1; min-height: 40px;
}
.live-switch .live-knob {
  width: 34px; height: 20px; border-radius: 999px; background: #e4ddd4;
  position: relative; flex: none; transition: background .18s ease;
}
.live-switch .live-knob::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform .18s ease;
}
.live-switch .live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #c8c0b6; flex: none;
}
.live-switch.on { border-color: #b9d8d4; color: var(--live); background: var(--live-soft); }
.live-switch.on .live-knob { background: var(--live); }
.live-switch.on .live-knob::after { transform: translateX(14px); }
.live-switch.on .live-dot {
  background: var(--live);
  box-shadow: 0 0 0 4px rgba(13, 92, 87, 0.14);
  animation: pulse-dot 1.4s ease-in-out infinite;
}

.board {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 20px;
  align-items: stretch; scroll-snap-type: x proximity;
}
.col {
  width: 292px; flex: 0 0 292px; display: flex; flex-direction: column;
  max-height: calc(100vh - 210px);
  background: #eef3f6; border: 1px solid var(--line); border-radius: 16px; padding: 8px;
  scroll-snap-align: start;
}
.col.is-empty {
  width: 44px; flex: 0 0 44px; min-height: 180px; padding: 12px 0;
  align-items: center; justify-content: flex-start;
  background: transparent; border-style: dashed; border-color: #ddd6cd;
}
.col-rail {
  writing-mode: vertical-rl; transform: none;
  font-size: 12px; font-weight: 700;
  color: var(--faint); white-space: nowrap; letter-spacing: 0.04em;
}
.col.is-focus { border-color: var(--live); background: var(--live-soft); }
.page-head .toolbar { flex-wrap: wrap; justify-content: flex-end; row-gap: 8px; }
.board-head {
  display: flex; flex-direction: column; align-items: stretch;
  gap: 14px;
}
.board-head-top {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.board-head-tools,
.board-head-filters,
.board-toggles {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0;
}
.board-head-filters { justify-content: flex-start; }
.board-head .type-seg { flex: 0 1 auto; max-width: 100%; overflow-x: auto; }
.board-head .type-select {
  flex: 0 1 220px; min-width: 160px; max-width: 100%;
}
.board-search {
  width: 100%; min-width: 0; max-width: none;
}
.board-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.board-toolbar .toolbar-row { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.board-toolbar .search { min-width: 220px; }
.board-empty {
  color: var(--soft); padding: 28px 24px; width: 100%;
  border: 1px dashed var(--line-firm); border-radius: var(--radius-2xl); text-align: center;
}
.board-table { padding-bottom: 18px; }
.projects-table-wrap { overflow-x: auto; padding: 0; }
.projects-table {
  width: 100%; border-collapse: collapse; table-layout: fixed;
}
.projects-table th {
  text-align: left; font-size: 11.5px; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--faint); font-weight: 700; padding: 12px 14px;
  border-bottom: 1px solid var(--line); background: #f5f8fa; white-space: nowrap;
}
.projects-table th:nth-child(1) { width: 118px; }
.projects-table th:nth-child(2) { width: 22%; }
.projects-table th:nth-child(3) { width: 130px; }
.projects-table th:nth-child(4) { width: 150px; }
.projects-table th:nth-child(5) { width: 300px; }
.projects-table th:nth-child(6) { width: 116px; }
.projects-table td {
  padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle;
}
.projects-table tbody tr.project-row { cursor: pointer; transition: background .12s ease; }
.projects-table tbody tr.project-row:hover { background: #faf8f6; }
.projects-table tbody tr.project-row:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.projects-table tr:last-child td { border-bottom: 0; }
.projects-table tr.is-late { background: #fff8f7; }
.projects-table tr.is-late:hover { background: #fff3f1; }
.projects-table tr.is-done-row { opacity: 0.7; }
.code-stack, .stack-cell {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0;
}
.stack-cell strong, .due-text {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.stack-cell span {
  display: block; color: var(--soft); font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.code-link { text-decoration: none; max-width: 100%; }
.code-link b {
  display: block; font-size: 14.5px; letter-spacing: -0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.code-link:hover { color: var(--red); }
.row-tags { display: flex; flex-wrap: wrap; gap: 4px; min-height: 0; }
.row-tags:empty { display: none; }
.projects-table .tkt-tag {
  display: inline-flex; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tkt-tag.is-ok { background: var(--ok-soft); color: var(--ok); }
.due-text { font-size: 13.5px; font-weight: 700; }
.pipe-cell { min-width: 0; }
.projects-cards { display: none; }

/* маршрут: одна сплошная линия через центры точек */
.rx {
  --rx-n: 1;
  --rx-fill: 0%;
  --rx-dot: 14px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0; width: 100%;
  padding: 10px 12px; border-radius: 14px;
  background: #f8f6f3; border: 1px solid var(--line);
}
.rx.is-done { padding: 10px 12px; }
.rx-badge {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ok); font-weight: 700; font-size: 13px;
}
.rx-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0;
}
.rx-now { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.rx-now i {
  width: 8px; height: 8px; border-radius: 99px; background: #cfc7be; flex: none;
}
.rx-now.is-live i {
  background: var(--live);
  box-shadow: 0 0 0 4px rgba(13, 92, 87, 0.14);
  animation: pulse-dot 1.4s ease-in-out infinite;
}
.rx-now strong {
  font-size: 13px; font-weight: 700; letter-spacing: -0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rx-meta {
  display: inline-flex; align-items: baseline; gap: 6px; flex: none;
  font-variant-numeric: tabular-nums;
}
.rx-meta b { font-size: 12px; font-weight: 800; color: var(--ink); }
.rx-meta em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--faint); }
.rx-body { position: relative; min-width: 0; }
.rx-rail {
  position: absolute;
  left: calc(100% / (var(--rx-n) * 2));
  right: calc(100% / (var(--rx-n) * 2));
  top: calc((var(--rx-dot) - 2px) / 2);
  height: 2px;
  border-radius: 99px;
  background: #ddd6cd;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.rx-rail i {
  display: block; height: 100%; width: var(--rx-fill);
  border-radius: inherit;
  background: var(--live);
}
.rx-path {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: flex-start; position: relative; z-index: 1; min-width: 0;
}
.rx-node {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.rx-dot {
  width: var(--rx-dot); height: var(--rx-dot); border-radius: 99px;
  display: grid; place-items: center;
  background: #f8f6f3; border: 2px solid #d2cbc2;
  color: #fff; flex: none; box-sizing: border-box;
}
.rx-dot svg.lucide { width: 9px; height: 9px; stroke-width: 3; display: block; }
.rx-label {
  font-size: 10px; line-height: 1.1; font-weight: 700; color: var(--faint);
  text-align: center; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rx-node.is-done .rx-dot { background: var(--ok); border-color: var(--ok); }
.rx-node.is-done .rx-label { color: #2f6b4a; }
.rx-node.is-live .rx-dot, .rx-node.is-current .rx-dot {
  background: var(--live); border-color: var(--live);
  outline: 3px solid rgba(13, 92, 87, 0.14);
}
.rx-node.is-live .rx-label, .rx-node.is-current .rx-label { color: var(--live); font-weight: 800; }
@keyframes pulse-dot {
  0%, 100% { outline-width: 3px; }
  50% { outline-width: 5px; }
}
.rx-node.is-live .rx-dot { animation: pulse-dot 1.4s ease-in-out infinite; }
.rx-lineup {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px; border-radius: 14px; background: var(--wash); border: 1px solid var(--line);
}
.rx-lineup-label { font-size: 12px; font-weight: 700; color: var(--soft); letter-spacing: 0.04em; text-transform: uppercase; }
.rx-path.is-preview .rx-dot { border-color: #cfc7be; }
.rx-panel-sub { margin-top: 4px; color: var(--soft); font-size: 13px; }
.rx-ring {
  --p: 0;
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background:
    radial-gradient(closest-side, #fff 78%, transparent 79% 100%),
    conic-gradient(var(--live) calc(var(--p) * 1%), #e7e1da 0);
}
.rx-ring b { font-size: 12px; font-weight: 800; letter-spacing: -0.03em; }

.pay-head-tools {
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.pay-head-tools .field.inline { margin: 0; gap: 4px; }
.pay-head-tools .field.inline span { font-size: 12px; line-height: 1.2; }
.pay-head-tools .month,
.pay-head-tools .search,
.pay-head-tools .btn {
  min-height: var(--control-h);
  height: var(--control-h);
  box-sizing: border-box;
}
.pay-head-tools .search {
  min-width: 200px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 14px;
}
.pay-head-tools .btn {
  white-space: nowrap;
  flex: none;
  padding: 0 16px;
}
.pay-summary article span { display: inline-flex; align-items: center; gap: 6px; }
.pay-summary article.is-ok { box-shadow: inset 0 -3px 0 var(--ok); }
.pay-summary article.is-bad { box-shadow: inset 0 -3px 0 var(--danger); }
.pay-summary article.is-live { box-shadow: inset 0 -3px 0 var(--live); }
.pay-list { display: flex; flex-direction: column; gap: 12px; }
.pay-card { padding-bottom: 8px; }
.pay-card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 8px; }
.pay-badge small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
  margin-top: 2px;
}
.pay-meta .pos { color: var(--ok); }
.pay-card-head {
  display: flex; justify-content: space-between; gap: 20px; align-items: flex-start;
  margin-bottom: 8px;
}
.pay-card-head strong { display: block; font-size: 18px; letter-spacing: -0.03em; }
.pay-card-head span { color: var(--soft); font-size: 13px; }
.pay-meta { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.pay-meta em { font-style: normal; font-size: 12px; color: var(--soft); background: var(--wash); padding: 3px 8px; border-radius: 999px; }
.pay-meta em.neg { background: var(--danger-soft); color: var(--danger); }
.pay-totals { text-align: right; min-width: 180px; }
.pay-totals .num { display: block; font-size: 28px; letter-spacing: -0.04em; margin: 4px 0; }
.pay-split { display: flex; gap: 10px; justify-content: flex-end; font-size: 13px; font-weight: 700; }
.pay-split .pos { color: var(--ok); }
.pay-totals .bar { margin: 8px 0; }
.pay-totals .text-link { justify-content: flex-end; }
.pay-details { border-top: 1px solid var(--line); padding-top: 8px; }
.pay-details summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px;
  color: var(--soft); font-weight: 650; padding: 6px 0;
}
.pay-details summary::-webkit-details-marker { display: none; }
.pay-details[open] summary { color: var(--ink); }
.pay-badge {
  display: inline-flex; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 3px 8px; border-radius: 999px; font-size: 13px;
}
.pay-badge.is-ok { background: var(--ok-soft); color: var(--ok); }
.pay-badge.is-bad { background: var(--danger-soft); color: var(--danger); }
.col-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 8px 12px; font-weight: 700; letter-spacing: -0.02em;
}
.count-pill {
  min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 700;
  border: 1px solid var(--line);
}
.tickets { display: flex; flex-direction: column; gap: 10px; min-height: 72px; overflow: auto; padding: 0 2px 4px; }
.ticket {
  border-radius: var(--radius-xl); padding: 12px 14px; cursor: pointer; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ticket:hover { border-color: var(--line-firm); box-shadow: 0 6px 16px rgba(28, 25, 23, 0.06); }
.ticket h3 { font-size: 16.5px; line-height: 1.25; margin: 7px 0 1px; font-weight: 700; letter-spacing: -0.03em; }
.ticket h3 a { text-decoration: none; }
.ticket h3 a:hover { color: var(--red); }
.warn-word { color: var(--warn); }
.ticket-top { align-items: flex-start; gap: 8px; }
.ticket-top b { font-size: 12px; letter-spacing: 0.04em; color: var(--soft); font-weight: 700; padding-top: 2px; }
.ticket-chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.tkt-tag {
  font-size: 11px; letter-spacing: 0.02em; padding: 2px 8px; border-radius: 999px;
  background: #f4f1ee; color: var(--soft); font-weight: 700; white-space: nowrap;
}
.tkt-tag.is-t0 { background: #f1f0ee; color: #5d574f; }
.tkt-tag.is-t1 { background: #eef1f6; color: #3d5a80; }
.tkt-tag.is-t2 { background: #edf3ef; color: #2f5f45; }
.tkt-tag.is-t3 { background: #f4eff5; color: #654069; }
.tkt-tag.is-t4 { background: #f6f1ea; color: #6f5331; }
.tkt-tag.is-hot { background: var(--warn-soft); color: var(--warn); }
.tkt-tag.is-late { background: var(--red); color: #fff; }
.ticket-clinic, .ticket-work {
  margin: 0; font-size: 13px; color: var(--soft); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ticket-meta {
  display: flex; align-items: center; gap: 7px;
  margin-top: 8px; font-size: 12.5px; color: var(--soft); font-weight: 650;
}
.ticket-meta i { width: 3px; height: 3px; border-radius: 50%; background: #cfc8c1; flex: none; }
.ticket-who { display: flex; align-items: center; gap: 8px; margin-top: 10px; min-width: 0; }
.ticket-who span {
  font-size: 13px; color: var(--ink); font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ticket.is-live { border-color: #bcd8d5; }
.ticket.late { box-shadow: inset 3px 0 0 var(--red); }
.live-strip {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding: 6px 10px; border-radius: 999px;
  background: var(--live-soft); color: var(--live); font-size: 12.5px; font-weight: 700;
}
.live-strip b { font-size: 13px; }
.ticket-wait { margin: 8px 0 0; font-size: 12.5px; color: var(--soft); }
.ticket-actions { margin-top: 10px; justify-content: flex-start; flex-wrap: wrap; }
.tag { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; background: #f3f3f3; font-weight: 700; }
.tag-hot { background: var(--warn-soft); color: var(--warn); }
.tag-active { background: var(--live-soft); color: var(--live); }
.tag-completed { background: var(--ok-soft); color: var(--ok); }
.tag-cancelled { background: var(--danger-soft); color: var(--danger); }
.units { font-size: 13px; color: var(--soft); }
.assignee span { display: block; font-size: 13px; color: var(--soft); }
.assignee strong { display: block; }
.empty-col, .empty { color: var(--soft); text-align: center; padding: 22px 10px; }
.empty-col { border: 1px dashed #ddd6cf; border-radius: 14px; background: transparent; }
.empty.standalone { margin-top: 18vh; }
.empty strong { display: block; font-size: 28px; color: var(--ink); letter-spacing: -0.04em; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.station-head, .station {
  display: grid; grid-template-columns: 230px minmax(200px, 1fr) minmax(240px, 1.2fr) 230px; gap: 14px;
}
.station-head { padding: 0 16px 8px; color: var(--soft); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.stations { display: flex; flex-direction: column; gap: 10px; }
.station { border-radius: 16px; padding: 14px; align-items: center; }
.station.free { box-shadow: inset 3px 0 0 var(--ok); }
.station.busy { box-shadow: inset 3px 0 0 var(--live); }
.station.hot { border-color: var(--line-firm); }
.who, .now-slot, .queue, .paybox { min-width: 0; }
.who { display: flex; gap: 10px; align-items: center; }
.who strong, .paybox strong { display: block; }
.who span { color: var(--soft); font-size: 13px; }
.meter { display: flex; gap: 4px; margin-top: 8px; }
.meter i { width: 8px; height: 8px; border-radius: 99px; background: #e6e6e6; display: block; }
.meter i.on { background: var(--live); }
.now-slot, .vacant-hero { border-radius: 14px; padding: 12px 14px; background: var(--live-soft); }
.now-slot.vacant, .vacant-hero { background: #fafafa; border: 1px dashed #ddd; }
.now-slot a, .now-slot strong, .now-slot em { display: block; }
.now-slot a, .hero-link { text-decoration: none; font-weight: 700; }
.now-slot a:hover, .hero-link:hover { color: var(--live); }
.now-slot em, .paybox em { font-style: normal; color: var(--soft); font-size: 13px; }
.timer { font-size: 40px; letter-spacing: -0.04em; font-weight: 700; line-height: 1.1; margin: 8px 0; color: var(--live); }
.timer-sm { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; color: var(--live); }
.chips { display: flex; flex-direction: column; gap: 6px; }
.chip {
  text-decoration: none; border-radius: var(--radius-md); padding: 8px 10px;
  background: #fff; border: 1px solid var(--line); display: grid;
}
.chip:hover { border-color: var(--line-firm); }
.chip.ready { border-color: #bcd8d5; }
.chip.late { border-color: var(--red); }
.chip.rework { background: var(--danger-soft); }
.chip small { color: var(--soft); }
.bar { height: 6px; border-radius: 99px; background: #f0f0f0; margin: 8px 0; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--live); }
.bar.neg span { background: var(--danger); }
.paybox .ticket-actions { margin-top: 8px; }

/* Смена — новый layout */
.team-head { margin-bottom: 18px; }
.team-head .sub { max-width: 46ch; }
.team-head-tools { align-items: flex-end; }
.team-head-tools .month-field { margin: 0; }
.team-head-tools .month-field span { font-size: 12px; color: var(--soft); }
.team-kpis {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.team-kpi {
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 18px; box-shadow: var(--shadow); min-width: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.team-kpi-label {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--soft); font-size: 12.5px; font-weight: 700;
}
.team-kpi-label svg.lucide { width: 14px; height: 14px; }
.team-kpi strong {
  font-size: 28px; letter-spacing: -0.04em; line-height: 1; font-weight: 800;
}
.team-kpi em { font-style: normal; color: var(--soft); font-size: 13px; }
.team-kpi.is-busy { box-shadow: inset 0 -3px 0 var(--live); }
.team-kpi.is-free { box-shadow: inset 0 -3px 0 var(--ok); }
.team-kpi.is-queue { box-shadow: inset 0 -3px 0 var(--warn); }
.team-kpi.is-pay { box-shadow: inset 0 -3px 0 var(--ink); }
.team-alert { margin-bottom: 16px; }
.team-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 18px; flex-wrap: wrap;
}
.team-toolbar .seg b {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px;
  margin-left: 4px; padding: 0 5px; border-radius: 999px;
  background: rgba(0,0,0,0.06); font-size: 11px; font-weight: 800;
}
.team-toolbar .seg button.active b { background: rgba(255,255,255,0.22); }
.team-toolbar .search-field { margin: 0; min-width: 220px; flex: 1; max-width: 280px; }
.team-toolbar .search { width: 100%; }
.team-group { margin-bottom: 22px; }
.team-group-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.team-group-head h2 {
  margin: 0; font-size: 18px; letter-spacing: -0.03em; font-weight: 800;
}
.team-group-head p { margin: 4px 0 0; color: var(--soft); font-size: 13px; }
.team-group-count {
  flex: none; min-width: 28px; height: 28px; padding: 0 8px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--wash); border: 1px solid var(--line);
  font-size: 13px; font-weight: 800;
}
.team-list { display: flex; flex-direction: column; gap: 12px; }
.person-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 18px; box-shadow: var(--shadow);
}
.person-card.is-busy { box-shadow: inset 3px 0 0 var(--live), var(--shadow); }
.person-card.is-ready { box-shadow: inset 3px 0 0 var(--warn), var(--shadow); }
.person-card.is-free { box-shadow: inset 3px 0 0 var(--ok), var(--shadow); }
.person-card-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.person-card-id { min-width: 0; }
.person-card-id strong {
  display: block; font-size: 18px; letter-spacing: -0.03em; font-weight: 800;
}
.person-card-id span { color: var(--soft); font-size: 13px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
.status-pill svg.lucide { width: 13px; height: 13px; }
.status-pill.free { background: var(--ok-soft); color: var(--ok); }
.status-pill.busy { background: var(--live-soft); color: var(--live); }
.status-pill.ready { background: var(--warn-soft); color: var(--warn); }
.person-card-body {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.8fr);
  gap: 14px; align-items: stretch;
}
.person-focus {
  border-radius: 14px; padding: 14px 16px; background: var(--wash); border: 1px solid var(--line);
  min-width: 0;
}
.person-card.is-busy .person-focus { background: var(--live-soft); border-color: #c9dedc; }
.person-card.is-ready .person-focus { background: #fff8ef; border-color: #edd9b8; }
.person-kicker {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px;
  color: var(--soft); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.person-kicker svg.lucide { width: 13px; height: 13px; }
.person-main-link {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 10px;
  text-decoration: none; margin-bottom: 4px;
}
.person-main-link b { font-size: 13px; color: var(--soft); font-weight: 700; }
.person-main-link strong { font-size: 18px; letter-spacing: -0.03em; font-weight: 800; }
.person-main-link:hover strong { color: var(--red); }
.person-meta { margin: 0; color: var(--soft); font-size: 13px; line-height: 1.4; }
.person-empty-title { display: block; font-size: 16px; letter-spacing: -0.02em; margin-bottom: 4px; }
.person-focus-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px;
}
.person-side {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
.person-stat {
  border-radius: 14px; padding: 12px; background: #fff; border: 1px solid var(--line);
  min-width: 0;
}
.person-stat span {
  display: block; color: var(--soft); font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px;
}
.person-stat strong {
  display: block; font-size: 18px; letter-spacing: -0.03em; font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.person-stat strong small { font-size: 13px; color: var(--soft); font-weight: 700; }
.person-queue {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.person-chip {
  display: grid; gap: 2px; min-width: 0; flex: 1 1 140px; max-width: 220px;
  padding: 10px 12px; border-radius: 12px; text-decoration: none;
  border: 1px solid var(--line); background: #fff;
}
.person-chip:hover { border-color: var(--line-firm); }
.person-chip b { font-size: 12.5px; font-weight: 800; }
.person-chip span { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-chip small { color: var(--soft); font-size: 11.5px; }
.person-chip.is-ready { border-color: #c9dfd4; background: var(--ok-soft); }
.person-chip.is-later { background: #f5f8fa; }
.person-chip.is-late { border-color: #f0c2c8; background: var(--danger-soft); }
.person-chip.is-more {
  display: grid; place-items: center; flex: 0 0 auto; max-width: none;
  padding: 10px 14px; color: var(--soft); font-weight: 800;
}
.person-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap;
}
.person-card-foot em { font-style: normal; color: var(--soft); font-size: 12.5px; }
.person-card-foot .ticket-actions { margin: 0; }

.route-panel {
  margin-bottom: 0; border-radius: var(--radius-feature);
  box-shadow: var(--shadow); overflow: hidden;
}
.route-panel .panel-head { margin-bottom: 8px; }
.route-pct {
  flex: none; font-size: 13px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--live); background: var(--live-soft);
  padding: 7px 11px; border-radius: var(--radius-pill); line-height: 1;
}
.stage-list {
  list-style: none; margin: 4px 0 0; padding: 0;
  display: flex; flex-direction: column;
}
.stage-item {
  display: grid; grid-template-columns: 28px 1fr; gap: 0 12px;
  min-width: 0;
}
.stage-rail {
  position: relative; display: flex; justify-content: center;
  padding-top: 18px;
}
.stage-rail::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; transform: translateX(-50%); background: #e7e1da;
}
.stage-item:first-child .stage-rail::before { top: 29px; }
.stage-item:last-child .stage-rail::before { bottom: calc(100% - 29px); }
.stage-item.is-done .stage-rail::before { background: var(--ok); }
.stage-item.is-done + .stage-item.is-done .stage-rail::before { background: var(--ok); }
.stage-item.is-done + .stage-item.is-current .stage-rail::before,
.stage-item.is-done + .stage-item.is-wait .stage-rail::before {
  background: linear-gradient(var(--ok) 0 13px, #e7e1da 13px);
}
.stage-dot {
  position: relative; z-index: 1;
  width: 22px; height: 22px; border-radius: 99px;
  display: grid; place-items: center;
  background: #fff; border: 2px solid #d8d2ca; color: var(--faint);
  font-size: 10px; font-weight: 800; box-shadow: 0 0 0 3px #fff;
}
.stage-dot svg.lucide { width: 11px; height: 11px; }
.stage-item.is-done .stage-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.stage-item.is-current .stage-dot {
  background: var(--live); border-color: var(--live); color: #fff;
  box-shadow: 0 0 0 3px var(--live-soft);
}
.stage-main {
  min-width: 0; margin: 0 0 10px; padding: 14px 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius-feature); background: #fff;
  box-shadow: 0 1px 2px rgba(22, 36, 48, 0.03);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.stage-item:last-child .stage-main { margin-bottom: 0; }
.stage-item.is-done .stage-main { background: #f7fbf8; border-color: #d5e8dc; }
.stage-item.is-current .stage-main {
  border-color: #b7dde6;
  background: linear-gradient(180deg, #f4fbfc 0%, #fff 72%);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.08);
}
.stage-item.is-current .stage-dot { box-shadow: 0 0 0 4px var(--live-soft); }
.stage-title {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.stage-name {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0;
}
.stage-title strong {
  font-size: 15px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3;
}
.stage-state {
  flex: none; font-size: 11px; font-weight: 700; font-style: normal;
  color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 999px; background: var(--wash); line-height: 1.2;
}
.stage-item.is-done .stage-state { color: var(--ok); background: var(--ok-soft); }
.stage-item.is-current .stage-state { color: var(--live); background: var(--live-soft); }
.stage-item.is-current .stage-title strong { color: var(--live); }
.stage-work { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stage-face {
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 0; max-width: 100%;
  padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: inherit; text-align: left;
}
button.stage-face { cursor: pointer; }
button.stage-face:hover { border-color: #e7b4b2; background: #fffafa; }
.stage-face.is-static { background: var(--wash); }
.stage-face-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.stage-face-copy strong {
  font-size: 13px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stage-face-copy small { color: var(--soft); font-size: 11px; font-weight: 600; white-space: nowrap; }
.stage-face .ico { width: 14px; height: 14px; flex: none; color: var(--faint); }
.stage-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
}
.stage-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.stage-chip {
  display: inline-flex; align-items: center; max-width: 100%;
  padding: 4px 8px; border-radius: 999px; background: var(--wash);
  color: var(--ink); font-size: 12px; font-weight: 650; line-height: 1.35;
}
.stage-chip.is-pay, .stage-chip.is-live { background: var(--live-soft); color: #0b5f73; }
.stage-chip.is-warn { background: #fdf3df; color: #8a5a10; }
.stage-chip.is-due { background: var(--red-soft); color: #9f2d24; }
.stage-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-left: auto; }
.stage-timer { color: var(--live); font-weight: 700; font-size: 13px; }
.callout, .hero {
  border-radius: var(--radius-feature); padding: 18px 20px; margin-bottom: 16px;
  border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow);
}
.callout.action, .hero { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.callout.danger {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--danger-soft); border-color: #f1cdd7; color: var(--danger);
}
.callout.danger svg.lucide { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.callout.ok { background: var(--ok-soft); border-color: #cfe7d8; color: #0f5133; }
.callout.warn { background: #fdf3df; border: 1px solid #f0d9a8; color: #5c3d05; }
.case-action {
  background: linear-gradient(135deg, #fff8f7 0%, #fff 55%);
  border-color: #f0c8c3;
}
.case-action-ico {
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  display: grid; place-items: center; background: var(--red-soft); color: var(--red);
}
.case-action-ico.is-live { background: var(--live-soft); color: var(--live); }
.case-action-ico svg.lucide { width: 20px; height: 20px; }
.case-action > div:first-of-type { flex: 1; min-width: 180px; }
.case-action .timer { margin: 4px 0 0; font-size: 28px; }
.return-note { display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px; }
.return-note > svg.lucide { flex: none; width: 22px; height: 22px; margin-top: 2px; color: #b07a10; }
.return-note strong { display: block; font-size: 15px; }
.return-note p { margin: 4px 0; font-size: 15px; color: var(--ink); white-space: pre-wrap; }
.return-note small { color: #8a6a2c; font-weight: 600; }
.work-return {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fdf3df;
  border: 1px solid #f0d9a8;
  color: #5c3d05;
  font-size: 14px;
}
.work-return svg.lucide { flex: none; width: 18px; height: 18px; margin-top: 1px; color: #b07a10; }
.hero { align-items: flex-end; }
.hero h2 { font-size: 28px; margin: 6px 0 8px; }
.workline { font-size: 18px; margin-bottom: 8px; font-weight: 650; }
.notes { color: var(--soft); margin-bottom: 12px; }
.note-list { display: flex; flex-direction: column; gap: 10px; }
.note-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #f5f8fa; }
.note-card.note-fixed { background: var(--wash); border-color: var(--line-firm); }
.note-card header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.note-card header strong { font-size: 14px; }
.note-card header time, .note-card small { margin-left: auto; color: var(--soft); font-size: 12px; }
.note-card p { line-height: 1.5; white-space: pre-wrap; }
.note-form { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.note-form .field, .note-form textarea { width: 100%; }
.history-head { align-items: flex-start; gap: 12px; }
.history-page .case-head { align-items: center; }
.history-back {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 6px; color: var(--soft); font-weight: 700; font-size: 13px; text-decoration: none;
}
.history-back:hover { color: var(--red); }
.history-back svg.lucide { width: 16px; height: 16px; }
.history-lanes { flex-wrap: wrap; }
.history-panel { margin-bottom: 0; }
.history-list { display: flex; flex-direction: column; }
.history-date {
  margin: 14px 0 4px; font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--soft); font-weight: 700;
}
.history-date:first-child { margin-top: 0; }
.history-item { display: grid; grid-template-columns: 52px 16px minmax(0, 1fr); gap: 10px; padding: 8px 0 4px; }
.history-item time { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 8px; }
.history-rail { position: relative; display: flex; justify-content: center; }
.history-rail i {
  width: 9px; height: 9px; border-radius: 99px; background: var(--ink);
  display: block; margin-top: 10px; position: relative; z-index: 1; box-shadow: 0 0 0 3px #fff;
}
.history-item.lane-finance .history-rail i { background: var(--live); }
.history-item.lane-changes .history-rail i { background: #c47b12; }
.history-item.is-bad .history-rail i { background: var(--danger); }
.history-rail::after { content: ""; position: absolute; top: 22px; bottom: -8px; left: 50%; width: 1px; background: var(--line); }
.history-item.is-last .history-rail::after { display: none; }
.history-body { padding: 8px 12px; border-radius: 12px; background: #f8fbfc; }
.history-item.lane-finance .history-body { background: var(--live-soft); }
.history-item.lane-changes .history-body { background: #fff7ea; }
.history-item.is-bad .history-body { background: var(--red-soft); }
.history-kind {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--soft);
}
.history-kind svg { width: 14px; height: 14px; }
.history-item p { margin-top: 4px; line-height: 1.45; }
.history-item small { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--soft); }
.history-item.is-note .history-body { background: var(--live-soft); }
.history-to { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; font-size: 13px; font-weight: 650; }
.history-to span { display: inline-flex; align-items: center; gap: 6px; }
.doctor-line { display: inline-flex; align-items: center; gap: 8px; }
.history-more { display: flex; justify-content: center; padding: 12px 0 4px; }
.modal-back:has(.dl-cal) { padding: 16px; overflow: auto; place-items: safe center; }
.modal:has(.dl-cal) {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 16px 18px 14px;
}
.modal:has(.dl-cal) .lead { margin: 4px 0 10px; }
.modal:has(.dl-cal) .modal-actions { margin-top: 10px; }
.dl-cal { display: flex; flex-direction: column; gap: 12px; }
.dl-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dl-pick {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  text-align: left; border: 1px solid var(--line); background: #fff;
  border-radius: var(--radius-lg); padding: 12px 14px; color: var(--ink); font: inherit; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
div.dl-pick { cursor: default; background: var(--surface-1); }
.dl-pick span {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint);
}
.dl-pick strong { font-family: var(--display); font-size: 16px; letter-spacing: -0.03em; line-height: 1.2; }
.dl-pick.is-start.is-on {
  border-color: #9cc9d3; background: linear-gradient(180deg, var(--live-soft), #fff);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.1);
}
.dl-pick.is-deadline.is-on {
  border-color: #f0b3ac; background: linear-gradient(180deg, var(--red-soft), #fff);
  box-shadow: 0 0 0 3px rgba(226, 59, 44, 0.1);
}
.dl-board {
  border: 1px solid var(--line); border-radius: var(--radius-feature);
  background: linear-gradient(180deg, #fbfcfd 0%, #fff 48px);
  padding: 14px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow);
}
.dl-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.dl-quick button {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); background: #fff; border-radius: var(--radius-pill);
  padding: 0 11px; min-height: 32px; font: inherit; font-size: 12.5px; font-weight: 650;
  color: var(--ink); cursor: pointer;
}
.dl-quick button svg.lucide { width: 14px; height: 14px; color: var(--soft); }
.dl-quick button:hover { border-color: var(--line-firm); background: var(--wash); }
.dl-quick button.is-clear { color: var(--danger); border-color: #e8c4ce; }
.dl-month { display: flex; flex-direction: column; gap: 8px; }
.dl-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dl-nav strong {
  font-family: var(--display); font-size: 18px; letter-spacing: -0.03em;
  text-transform: capitalize; font-weight: 700;
}
.dl-nav button {
  width: 36px; height: 36px; border-radius: var(--radius-md); border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.dl-nav button:hover { background: var(--wash); border-color: var(--line-firm); }
.dl-week, .dl-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dl-week span {
  text-align: center; font-size: 11px; font-weight: 700; color: var(--faint);
  text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 0;
}
.dl-day {
  height: 42px; border: 0; border-radius: var(--radius-md); background: transparent;
  font: inherit; font-weight: 650; color: var(--ink); cursor: pointer;
  display: grid; place-items: center; position: relative;
  transition: background .12s ease, color .12s ease, transform .12s ease;
}
.dl-day span { position: relative; z-index: 1; }
.dl-day:hover { background: var(--wash); }
.dl-day.is-out { color: var(--faint); opacity: 0.55; }
.dl-day.is-weekend:not(.is-start):not(.is-deadline) { color: var(--soft); }
.dl-day.is-today:not(.is-start):not(.is-deadline) {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.dl-day.is-span { background: #fff1ee; border-radius: 8px; }
.dl-day.is-start { background: var(--live); color: #fff; box-shadow: 0 4px 12px rgba(14, 116, 144, 0.28); }
.dl-day.is-deadline { background: var(--red); color: #fff; box-shadow: 0 4px 12px rgba(226, 59, 44, 0.28); }
.dl-day.is-start.is-deadline {
  background: linear-gradient(135deg, var(--live) 48%, var(--red) 52%); color: #fff;
}
.dl-time {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  padding: 12px; border-radius: var(--radius-lg); background: var(--wash);
}
.dl-time-label {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  color: var(--soft); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.dl-time-label svg.lucide { width: 14px; height: 14px; }
.dl-time-controls { display: flex; align-items: center; justify-content: center; gap: 6px; }
.dl-time input {
  width: 112px; min-height: 44px; border: 0; background: #fff; text-align: center;
  font-family: var(--display); font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; color: var(--ink);
  padding: 4px 8px; border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px var(--line);
}
.dl-time input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--red), var(--focus-ring); }
.dl-time-controls button {
  border: 0; background: #fff; border-radius: var(--radius-sm); padding: 0 10px; min-height: 36px;
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.dl-time-controls button:hover { box-shadow: inset 0 0 0 1px var(--line-firm); background: #fff; }
.dl-hint { margin: 0; text-align: center; font-size: 12px; color: var(--faint); }
.dl-note { margin: 0; color: var(--red-dark); font-size: 13px; font-weight: 650; text-align: center; }
.dl-compact .dl-cal {
  margin-top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 196px;
  gap: 8px 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-feature);
  background: #fff;
}
.dl-compact .dl-board {
  display: contents;
  box-shadow: none;
  border: 0;
  padding: 0;
  background: transparent;
}
.dl-compact .dl-month { grid-column: 1; grid-row: 1 / span 2; gap: 4px; }
.dl-compact .dl-picks {
  grid-column: 2; grid-row: 1;
  grid-template-columns: 1fr; gap: 6px;
}
.dl-compact .dl-quick {
  grid-column: 2; grid-row: 2;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.dl-compact .dl-time {
  grid-column: 1 / -1; grid-row: 3;
  flex-direction: row; align-items: center; justify-content: space-between;
}
.dl-compact .dl-note { grid-column: 1 / -1; }
.dl-compact .dl-hint { display: none; }
.dl-compact .dl-pick { padding: 7px 10px; gap: 2px; border-radius: var(--radius-md); }
.dl-compact .dl-pick strong { font-size: 13px; }
.dl-compact .dl-nav strong { font-size: 15px; }
.dl-compact .dl-nav button { width: 28px; height: 28px; }
.dl-compact .dl-week, .dl-compact .dl-grid { gap: 2px; }
.dl-compact .dl-day { height: 30px; font-size: 13px; border-radius: 8px; }
.dl-compact .dl-day.is-start,
.dl-compact .dl-day.is-deadline { box-shadow: none; }
.dl-compact .dl-quick button {
  min-height: 30px; padding: 0 8px; font-size: 12px; justify-content: center;
}
.dl-compact .dl-quick button.is-clear,
.dl-compact .dl-cal.is-deadline-only .dl-quick button:nth-child(5) { grid-column: 1 / -1; }
.dl-compact .dl-time { padding: 6px 8px; gap: 10px; }
.dl-compact .dl-time-controls { flex: 1; flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }
.dl-compact .dl-time input {
  width: 88px; min-height: 34px; font-size: 18px; flex: none;
}
.dl-compact .dl-time-controls button { min-height: 32px; padding: 0 10px; font-size: 12px; flex: none; }
.when-facts { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.pay-choice { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-choice-label { grid-column: 1 / -1; margin: 0; font-size: 13px; font-weight: 700; color: var(--soft); }
.pay-option {
  display: flex; align-items: center; gap: 10px; margin: 0; min-height: 48px; padding: 0 14px;
  border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer;
}
.pay-option:has(input:checked) { border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
.pay-option:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.pay-option input {
  width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; flex: none;
  border: 0; border-radius: 50%; background: transparent; box-shadow: none; accent-color: var(--red);
}
.pay-option input:focus { border: 0; box-shadow: none; }
.pay-option span { font-size: 15px; font-weight: 700; line-height: 1.2; color: var(--ink); }
@media (max-width: 720px) {
  .dl-compact .dl-cal { grid-template-columns: 1fr; }
  .dl-compact .dl-month,
  .dl-compact .dl-picks,
  .dl-compact .dl-quick,
  .dl-compact .dl-time { grid-column: 1; grid-row: auto; }
  .when-facts, .pay-choice { grid-template-columns: 1fr; }
}
.table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.table th { text-align: left; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); font-weight: 700; }
.table td, .table th { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.comment { display: flex; gap: 8px; padding: 8px 0 12px; }
.edit-card { padding-bottom: 16px; margin-top: 16px; }
.edit-card summary { cursor: pointer; font-size: 18px; font-weight: 700; letter-spacing: -0.03em; }
.danger-zone {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 16px; padding: 16px 20px;
  border: 1px dashed #e4c3ce; border-radius: 16px; background: var(--danger-soft);
}
.danger-zone strong { display: block; }
.danger-zone p { color: var(--soft); font-size: 13px; margin-top: 2px; }
.btn.danger-link { color: var(--danger); border-color: #e4c3ce; }
.btn.danger-link:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.pay-pill { border-radius: 16px; padding: 12px 16px; text-align: right; }
.pay-pill strong { font-size: 26px; display: block; font-weight: 700; letter-spacing: -0.04em; }
.queue-row { grid-template-columns: 1fr auto; }
.ledger-row {
  grid-template-columns: 140px 1fr auto; gap: 10px 14px;
  padding: 12px 0; align-items: start;
}
.ledger-row span { line-height: 1.35; }
.ledger-row small { display: block; margin-top: 2px; color: var(--soft); }

.create-shell { max-width: 1120px; }
.create-head h1 { font-size: clamp(28px, 3vw, 36px); }
.create-page { display: flex; flex-direction: column; gap: 20px; }
.create-grid { display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr); gap: 20px; align-items: start; }
.create-when-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.create-when-tip { margin: 0; font-size: 12.5px; color: var(--faint); font-weight: 650; }


/* кастомные выпадающие списки */
.combo { position: relative; width: 100%; }
.combo-trigger, .combo-field {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--control-radius);
  min-height: var(--control-h); text-align: left;
}
.combo-trigger {
  padding: 8px 12px 8px 14px; color: inherit; font: inherit;
  justify-content: space-between;
}
.combo-trigger:hover, .combo.is-open .combo-trigger,
.combo.is-open .combo-field { border-color: var(--red); box-shadow: var(--focus-ring); }
.combo-value { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.combo-value strong { font-size: var(--text-base); font-weight: 700; letter-spacing: -0.02em; }
.combo-value small { color: var(--soft); font-size: var(--text-xs); }
.combo-trigger svg.lucide { color: var(--faint); flex: none; }
.combo-field { padding: 0 6px 0 0; overflow: hidden; }
.combo-input {
  border: 0 !important; box-shadow: none !important; outline: none !important;
  background: transparent; border-radius: var(--control-radius); flex: 1; min-width: 0;
  min-height: calc(var(--control-h) - 2px); padding: 10px 8px 10px 14px;
}
.combo-caret {
  width: var(--icon-box-hit); height: var(--icon-box-hit); border: 0;
  border-radius: var(--radius-sm); background: transparent;
  color: var(--faint); display: grid; place-items: center; padding: 0; flex: none;
}
.combo-caret:hover { background: var(--wash); color: var(--ink); }
.combo-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(28, 25, 23, 0.12);
  padding: 6px; max-height: 260px; overflow: auto;
  animation: rise .14s ease;
}
.combo-option {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 0; background: transparent; border-radius: 10px; padding: 10px 12px;
  text-align: left; color: inherit; font: inherit;
}
.combo-option:hover, .combo-option.is-active { background: var(--wash); }
.combo-option.is-selected { background: var(--red-soft); color: var(--red); }
.combo-option .avatar { flex: none; }
.combo-option-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.combo-option-main strong { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }
.combo-option-main small { color: var(--soft); font-size: 12px; }
.combo-option.is-selected .combo-option-main small { color: #b4534f; }
.combo-option svg.lucide { width: 16px; height: 16px; flex: none; }
.combo-empty { margin: 0; padding: 14px 12px; color: var(--soft); font-size: 13px; }

.wizard-nav {
  list-style: none; margin: 0 0 20px; padding: 6px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-feature);
  box-shadow: var(--shadow);
}
.wizard-nav button {
  width: 100%; display: flex; align-items: center; gap: 12px;
  text-align: left; border: 0; background: transparent;
  border-radius: var(--radius-lg); padding: 12px 14px;
  transition: background .15s ease;
}
.wizard-nav button:disabled { opacity: 0.45; cursor: default; }
.wizard-nav button b {
  width: 34px; height: 34px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--wash); color: var(--soft);
}
.wizard-nav button b svg.lucide { width: 16px; height: 16px; }
.wizard-nav button strong { display: block; font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }
.wizard-nav button em { display: block; font-style: normal; color: var(--soft); font-size: 12px; margin-top: 2px; }
.wizard-nav li.is-done button { background: var(--ok-soft); }
.wizard-nav li.is-done button b { background: var(--ok); color: #fff; }
.wizard-nav li.is-current button {
  background: var(--red-soft);
}
.wizard-nav li.is-current button b { background: var(--red); color: #fff; }
.wizard-panel {
  border: 0; background: transparent; box-shadow: none; padding: 0;
}
.wizard-panel > .panel-head,
.wizard-panel > .live-search,
.wizard-panel > [data-type-list],
.wizard-panel > .wizard-summary,
.wizard-panel > .route,
.wizard-panel > .create-foot {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-feature);
  padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.wizard-panel > .live-search { padding: 14px 16px; }
.wizard-panel > .panel-head { margin-bottom: 14px; }
.wizard-panel > .hint,
.wizard-panel > .field-error { margin: 0 2px 12px; }
.wizard-panel > .route-tools { margin: -6px 0 14px; padding: 0 4px; }
.wizard-panel > .wizard-foot,
.wizard-panel > .create-foot { margin-top: 0; }
.wizard-panel .panel-head { align-items: flex-start; }
.wizard-panel .panel-head > div h2 { margin-top: 4px; font-size: 24px; }
.wizard-panel .panel-head .sub { margin-top: 6px; }
.wizard-type-pill {
  display: inline-flex; align-items: center;
  border-radius: var(--radius-pill); padding: 7px 12px;
  background: var(--red-soft); color: var(--red); font-size: 13px; font-weight: 700;
}
.wizard-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--gap-section);
  margin-top: 4px; padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-feature);
  box-shadow: var(--shadow); position: sticky; bottom: 16px; z-index: 4;
}
.wizard-sections { display: flex; flex-direction: column; gap: 16px; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.wizard-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr); gap: 16px; align-items: start; }
.wizard-block {
  border: 1px solid var(--line); border-radius: var(--radius-feature); padding: 18px 18px 16px;
  background: #fff; display: flex; flex-direction: column; gap: var(--space-3);
  box-shadow: var(--shadow);
}
.wizard-block-head {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 2px;
}
.wizard-block-ico {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; background: var(--wash); color: var(--soft);
}
.wizard-block-ico svg.lucide { width: 18px; height: 18px; }
.wizard-block h3 { margin: 0; font-size: 17px; letter-spacing: -0.03em; }
.wizard-block .grid-2, .wizard-facts { display: grid; gap: 12px; }
.wizard-facts { grid-template-columns: 1fr; }
.wizard-shade .shade-board { border: 0; padding: 0; background: transparent; gap: 12px; }
.wizard-shade .shade-board > legend { display: none; }
.wizard-stock .materials-box { border: 0; padding: 0; background: transparent; }
.wizard-type-pill { gap: 7px; }
.wizard-type-pill svg.lucide { width: 14px; height: 14px; }

/* Шаг 2 · карточка наряда */
.card-flow { gap: 14px; }
.card-flow-top {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
  gap: 14px; align-items: start;
}
.card-flow-mid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px; align-items: start;
}
.card-group {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px; border-radius: var(--radius-lg);
  background: var(--surface-1); border: 1px solid var(--line);
}
.card-group-label {
  margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--faint);
}
.card-facts-row { grid-template-columns: 110px minmax(0, 1fr) !important; }
.card-block-when .create-when { margin-top: 4px; }
.card-block-when .intake-block { margin: 0; }
.card-block-stock .materials-head strong { display: none; }
.card-block-stock .materials-head { justify-content: flex-end; margin-bottom: 4px; }
.card-block-note { padding-top: 14px; padding-bottom: 14px; }
.card-block-note textarea { min-height: 72px; }
.card-block-who .hint { margin: 0; }
@media (max-width: 980px) {
  .card-flow-top, .card-flow-mid { grid-template-columns: 1fr; }
}

.create-board {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 268px;
  gap: 16px;
  align-items: start;
}
.wizard-nav.is-rail {
  grid-template-columns: 1fr;
  margin: 0;
  position: sticky;
  top: 12px;
  max-height: calc(100dvh - 92px);
  overflow: auto;
}
.wizard-nav.is-rail button { padding: 8px 10px; gap: 10px; }
.wizard-nav.is-rail button b { width: 30px; height: 30px; border-radius: 10px; }
.wizard-nav.is-rail button em { display: none; }
.create-summary {
  position: sticky;
  top: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-feature);
  padding: 16px 14px 10px;
  box-shadow: var(--shadow);
}
.create-summary h2 {
  margin: 2px 0 10px;
  font-size: 18px;
  letter-spacing: -0.03em;
}
.sum-list { display: flex; flex-direction: column; gap: 4px; }
.sum-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: var(--radius-md);
  padding: 7px 8px;
}
.sum-row:hover { background: var(--wash); }
.sum-row span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sum-row strong {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sum-row.is-empty strong { color: var(--soft); font-weight: 500; }
@media (max-width: 1100px) {
  .create-board { grid-template-columns: 196px minmax(0, 1fr); }
  .create-summary { grid-column: 1 / -1; position: static; }
  .sum-list { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .create-board { grid-template-columns: 1fr; }
  .wizard-nav.is-rail {
    position: static;
    max-height: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .sum-list { grid-template-columns: 1fr; }
}
.type-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start;
  text-align: left; border-radius: var(--radius-feature); border: 1px solid var(--line);
  background: #fff; padding: 16px; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
}
.type-card:hover { border-color: var(--line-firm); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.type-card.active {
  border-color: #f0b3ac; background: linear-gradient(180deg, #fff8f7, #fff);
  box-shadow: 0 0 0 3px rgba(226, 59, 44, 0.1), var(--shadow);
}
.type-card-ico {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: grid; place-items: center; background: var(--wash); color: var(--soft);
}
.type-card.active .type-card-ico { background: var(--red-soft); color: var(--red); }
.type-card-ico svg.lucide { width: 20px; height: 20px; }
.type-card-copy { min-width: 0; }
.type-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.type-card-top strong { font-size: 16px; letter-spacing: -0.02em; }
.type-card-top b { font-size: 13px; color: var(--soft); font-weight: 700; white-space: nowrap; }
.type-card.active .type-card-top b { color: var(--red); }
.type-card-meta { display: block; color: var(--soft); font-size: 13px; margin-top: 6px; font-weight: 600; }
.type-route { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.type-route em {
  font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink);
  background: var(--surface-1); border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px;
}
.type-card.active .type-route em { background: #fff; border-color: #f0c8c3; }
.wizard-choice span { display: block; color: var(--soft); font-size: 12px; }
.wizard-choice strong { display: block; font-size: 18px; letter-spacing: -0.03em; }
.live-search-shell {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff;
  padding: 0 8px 0 14px; min-height: var(--control-h);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.live-search-shell:focus-within { border-color: var(--red); box-shadow: var(--focus-ring); }
.live-search-shell svg.lucide { width: 18px; height: 18px; color: var(--faint); flex: none; }
.live-search-shell .live-search-input,
.live-search-shell input {
  border: 0 !important; box-shadow: none !important; outline: none !important;
  background: transparent; min-height: calc(var(--control-h) - 2px); padding: 10px 0; flex: 1; min-width: 0;
}
.live-search-clear {
  width: 32px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 10px;
  background: transparent; color: var(--faint); display: grid; place-items: center; flex: none;
}
.live-search-clear:hover { background: var(--wash); color: var(--ink); }
.live-search-block { display: grid; gap: 10px; margin-bottom: 12px; }
.live-search-meta {
  margin: 0; color: var(--soft); font-size: 13px; font-weight: 650;
}
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip {
  margin: 0; min-height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.cat-chip:hover { border-color: var(--line-firm); }
.cat-chip.is-on {
  border-color: var(--red); background: var(--red-soft); color: var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}
.wizard-pick-scroll {
  max-height: min(52vh, 560px); overflow: auto; padding-right: 2px;
  display: grid; gap: 8px;
}
.search-pin {
  margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--warn);
}
.wizard-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.wizard-summary {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px;
  margin-bottom: 8px;
}
.wizard-summary > div { background: var(--wash); border-radius: var(--radius-lg); padding: var(--space-2) var(--space-3); min-width: 0; }
.wizard-summary span { display: block; color: var(--soft); font-size: 12px; }
.wizard-summary strong {
  display: block; margin-top: 2px; font-size: 14px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis;
}
.wizard-summary em { display: block; margin-top: 2px; font-style: normal; color: var(--faint); font-size: 12px; }
.client-kinds { margin: 12px 0 16px; display: inline-flex; }
.client-kinds b {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px;
  margin-left: 4px; padding: 0 5px; border-radius: 999px;
  background: rgba(0,0,0,0.06); font-size: 11px; font-weight: 800;
}
.client-kinds button.active b { background: rgba(255,255,255,0.22); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.settings-tabs { margin-bottom: 18px; display: inline-flex; }
.settings-tabs a { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.settings-grid {
  display: grid; grid-template-columns: minmax(260px, 0.85fr) minmax(420px, 1.15fr);
  gap: 16px; align-items: start;
}
.settings-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; max-height: 70vh; overflow: auto; }
.settings-item {
  text-align: left; border: 1px solid var(--line); background: #f5f8fa;
  border-radius: var(--radius-lg); padding: var(--space-3) var(--control-pad-x);
}
.settings-item strong, .settings-item span { display: block; }
.settings-item span { color: var(--soft); font-size: 13px; margin-top: 4px; }
.settings-item:hover { border-color: var(--line-firm); }
.settings-item.active { border-color: var(--red); background: var(--red-soft); box-shadow: 0 0 0 3px rgba(226, 59, 44, 0.08); }
.settings-stage-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 18px 0 10px;
}
.settings-stage-head h3 { margin: 0; font-size: 16px; }
.settings-stages { display: flex; flex-direction: column; gap: 8px; }
.settings-stage {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-3) var(--control-pad-x); background: #fff;
}
.settings-stage strong, .settings-stage em { display: block; }
.settings-stage em { font-style: normal; color: var(--soft); font-size: 13px; margin-top: 2px; }
.settings-people { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.settings-person {
  display: flex; align-items: center; justify-content: space-between; gap: var(--gap-section);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--control-pad-x) var(--space-4); background: #fff;
}
.settings-person .emp-main > strong,
.settings-person .emp-main > .emp-role,
.settings-person .emp-main > em { display: block; }
.settings-person .emp-main > .emp-role,
.settings-person .emp-main > em { color: var(--soft); font-size: 13px; font-style: normal; margin-top: 2px; }
.settings-person.is-off { opacity: 0.62; }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.type-switch { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.type-group {
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); font-weight: 700; margin: 16px 0 8px;
}
.type-group:first-child { margin-top: 0; }
.route-line {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--soft);
}
.route-line span { font-weight: 650; margin-right: 4px; }
.route-line b { background: var(--wash); border-radius: 999px; padding: 3px 10px; font-weight: 650; color: var(--ink); }
.route-line i { font-style: normal; color: var(--faint); }
.pick-blank { display: inline-flex; align-items: center; gap: 8px; color: var(--soft); font-weight: 650; }
.route-row.is-empty em { color: var(--warn); font-weight: 650; }
.route-row.is-empty .assignee-btn { border-color: #e8d4ad; background: var(--warn-soft); }
.live-search { margin-bottom: 0; }
.live-search-input { width: 100%; max-width: none; font-size: 16px; }
.route { display: flex; flex-direction: column; gap: 8px; }
.route-row.is-dragging { opacity: 0.45; }
.route-row.is-drop-before { box-shadow: inset 0 3px 0 var(--red); }
.route-row.is-drop-after { box-shadow: inset 0 -3px 0 var(--red); }
.route-grip {
  width: 22px; height: 28px; padding: 0; border: 0; background: transparent;
  color: var(--faint); display: grid; place-items: center; cursor: grab; border-radius: 8px;
}
.route-grip:hover { background: var(--wash); color: var(--ink); }
.route-grip:active { cursor: grabbing; }
.route-grip svg.lucide { width: 16px; height: 16px; }
.route-row.is-custom .crew-top { grid-template-columns: 22px 28px minmax(0, 1fr) auto; }
.crew-note { margin: 0 2px 4px; color: var(--soft); font-size: 13px; line-height: 1.35; }
.route-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: #fff;
}
.crew-top {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px; align-items: center;
}
.crew-top .idx {
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 8px; background: var(--wash); color: var(--soft);
  font-size: 12px; font-weight: 700; letter-spacing: 0;
}
.crew-top .route-title strong { font-size: 15px; letter-spacing: -0.02em; }
.crew-mid { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; align-items: center; }
.route-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.route-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.route-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 4px; }
.route-tools .crew-note { flex: 1 1 220px; margin: 0; }
.route-name { width: 100%; font-weight: 700; min-height: 38px; }
.inline-rate { display: flex; align-items: center; gap: 8px; color: var(--soft); font-size: 12px; font-weight: 650; }
.inline-rate input { width: 110px; min-height: 36px; }
.wizard-panel .stage-qty {
  display: flex; flex-direction: row; align-items: center; gap: 2px;
  width: auto; height: 40px; padding: 0 8px 0 2px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--wash);
}
.wizard-panel .stage-qty span { font-size: 12px; color: var(--soft); font-weight: 600; }
.wizard-panel .stage-qty input {
  width: 40px; min-height: 0; height: 36px; padding: 0;
  border: 0; background: transparent; text-align: center; font-weight: 700;
}
.wizard-panel .stage-timing { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.wizard-panel .stage-when { font-size: 13px; font-weight: 600; }
.wizard-panel .assignee-btn { min-height: 40px; padding: 4px 10px; }
.wizard-panel .assignee-copy strong,
.wizard-panel .assignee-copy small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wizard-panel .assignee-copy strong { font-size: 14px; font-weight: 700; }
.wizard-panel > .route { padding: 10px 12px 12px; }
.route-head-tools { display: flex; align-items: center; gap: 10px; }
.create-when { margin-top: var(--gap-section); }
.create-when .hint { margin-top: 8px; }
.stage-timing { display: flex; flex-direction: column; gap: 4px; }
.stage-when { display: block; color: var(--soft); font-size: 12px; font-weight: 650; line-height: 1.35; }
.stage-timing-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.stage-link { font-size: 12.5px; gap: 5px; }
.stage-qty-live {
  display: inline-flex; align-items: center; gap: 2px; height: 38px;
  padding: 0 10px 0 var(--space-1); border: 1px solid var(--line); border-radius: var(--radius-md);
  background: #fff; font-size: 12px; color: var(--soft); font-weight: 650;
}
.stage-qty-live input {
  width: 52px; padding: 6px 4px 6px 8px; border: 0; border-radius: 10px;
  font: inherit; font-weight: 700; color: var(--ink); background: transparent;
}
.stage-qty-read {
  display: inline-flex; align-items: center; height: 38px; padding: 0 var(--space-3);
  border-radius: var(--radius-md); background: var(--wash); font-weight: 700; color: var(--ink);
}
.idx { font-weight: 800; color: var(--faint); letter-spacing: -0.04em; }
.route-row em { font-style: normal; color: var(--ink); font-weight: 700; }
.total-line { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 0; font-size: 13px; color: var(--soft); }
.total-line strong { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); line-height: 1.1; }
.total-line em { font-style: normal; color: var(--soft); }
.create-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-5);
  margin-top: var(--gap-section); padding: var(--space-3) var(--control-pad-x);
  background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-xl);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3-even { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 90px 1fr; gap: 10px; }

.assignee-btn {
  width: 100%; min-height: 48px;
  display: flex; align-items: center; gap: var(--space-3);
  text-align: left; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-2) var(--space-3);
}
.assignee-btn:hover { border-color: #e7b4b2; background: #fffafa; }
.assignee-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.assignee-copy strong { font-size: 14px; font-weight: 650; line-height: 1.25; }
.assignee-copy small { color: var(--soft); font-size: 12px; line-height: 1.35; }

.picker-hint { font-size: 12px; color: var(--soft); margin-top: 8px; }
.picker-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.person {
  width: 100%; text-align: left;
  border: 1px solid var(--line); background: #fff;
  border-radius: var(--radius-xl); padding: var(--control-pad-x) var(--space-4);
  display: flex; flex-direction: column; gap: 10px;
}
.person:hover { border-color: var(--line-firm); }
.person.is-cursor { border-color: var(--red); box-shadow: 0 0 0 3px rgba(226, 59, 44, 0.12); }
.person.is-selected { background: var(--red-soft); }
.person-top { display: flex; gap: 10px; align-items: center; }
.person-id { display: flex; flex-direction: column; min-width: 0; }
.person-id span, .person-status { color: var(--soft); font-size: 13px; }
.person-count { margin-left: auto; text-align: right; }
.person-count b { display: block; font-size: 22px; letter-spacing: -0.04em; font-weight: 700; color: var(--ink); line-height: 1; }
.person-count small { color: var(--soft); }
.person-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.person-now { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.pill {
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #f3f3f3;
}
.pill.free { background: #eef8f2; color: var(--ok); }
.pill.busy { background: var(--danger-soft); color: var(--danger); }

.login { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(380px, 0.95fr); background: var(--bg); }
.login-aside {
  background: #fff; color: var(--ink); padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  border-right: 1px solid var(--line);
}
.login-aside h1 { font-size: 40px; max-width: 11ch; line-height: 1.15; }
.login-lead { max-width: 36ch; margin-top: 16px; color: var(--soft); font-size: 16px; line-height: 1.5; }
.login-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 18px; }
.login-points li { display: flex; gap: 14px; align-items: flex-start; color: var(--soft); }
.login-points svg { margin-top: 2px; color: var(--red); }
.login-points strong { display: block; color: var(--ink); font-weight: 650; margin-bottom: 2px; }
.login-panel {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 40px 32px; gap: 16px;
}
.login-card {
  width: min(420px, 100%);
  display: flex; flex-direction: column; gap: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-feature);
  padding: 28px 28px 24px; box-shadow: var(--shadow);
}
.login-card .sub { margin-top: 6px; }
.login-card .btn { width: 100%; margin-top: 4px; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 46px; }
.password-field .text-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.form-error { color: var(--red); font-weight: 650; margin: 0; }
.demo-box { width: min(420px, 100%); color: var(--soft); }
.demo-box summary { cursor: pointer; font-weight: 650; padding: 8px 4px; }
.demo-box p { margin: 8px 4px 12px; }
.demo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 12px; font-weight: 600; }
.demo-btn:hover { border-color: var(--red); color: var(--red); }

.avatar {
  width: var(--size, 32px); height: var(--size, 32px);
  border-radius: max(8px, calc(var(--size, 32px) * 0.28));
  display: inline-grid; place-items: center;
  background: color-mix(in srgb, var(--av, var(--red)) 18%, #fff);
  color: var(--av, var(--red));
  font-size: calc(var(--size, 32px) * 0.34); font-weight: 700; flex: none;
  letter-spacing: -0.03em;
}
.avatar.has-photo { overflow: hidden; padding: 0; background: var(--wash); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-back {
  position: fixed; inset: 0; background: rgba(20, 20, 20, 0.36);
  display: grid; place-items: center; padding: 20px; z-index: 20;
  backdrop-filter: blur(6px);
  animation: fade .16s ease;
}
.modal {
  width: min(760px, 100%); max-height: min(88vh, 900px); overflow: auto;
  background: #fff; border-radius: var(--radius-feature); padding: var(--panel-pad);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(20, 20, 20, 0.16);
  animation: rise .18s ease;
}
.modal-head h3 { font-size: var(--text-xl); }
.lead { color: var(--soft); margin: 8px 0 12px; }
.preview { background: var(--danger-soft); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.defect-stage { border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 8px; }
.people { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 8px; }
.check { display: flex; gap: 8px; align-items: center; }
.check input, .swatch input { width: auto; }
.swatches { display: flex; gap: 8px; }
.swatch i { width: 22px; height: 22px; border-radius: 50%; display: block; }
.toasts { position: fixed; top: 16px; right: 16px; bottom: auto; width: min(360px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; z-index: 80; pointer-events: none; }
.toasts .toast, .toasts .notice-toast { pointer-events: auto; }
.toast {
  background: #141414; color: #fff; border-radius: 14px; padding: 12px 14px;
  max-width: 360px; box-shadow: 0 12px 30px rgba(20, 20, 20, 0.16);
  animation: rise .18s ease;
}
.toast.bad { background: var(--danger); }
.notice-toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  width: min(380px, calc(100vw - 32px));
  padding: 14px 12px 14px 14px;
  border-radius: var(--radius-xl);
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(22, 36, 48, 0.16);
  text-decoration: none;
  animation: rise .22s ease;
  position: relative;
  overflow: hidden;
}
.notice-toast::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--red);
}
.notice-toast.warn::before { background: var(--warn); }
.notice-toast.live::before { background: var(--live); }
.notice-toast.bad::before { background: var(--danger); }
.notice-toast .note-mark { margin-top: 1px; }
.notice-toast-body { min-width: 0; }
.notice-toast strong { display: block; font-size: 14.5px; line-height: 1.3; letter-spacing: -0.02em; }
.notice-toast p {
  margin: 4px 0 0; font-size: var(--text-sm); color: var(--soft); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.notice-toast small {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--red);
}
.notice-toast-close {
  border: 0; background: transparent; color: var(--soft);
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  display: grid; place-items: center; padding: 0; line-height: 0;
}
.notice-toast-close svg.lucide { width: var(--icon-xs); height: var(--icon-xs); }
.notice-toast-close:hover { background: var(--wash); color: var(--ink); }
.profile-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px 20px; margin-bottom: 24px; flex-wrap: wrap;
}
.profile-head h1 { margin-top: 4px; margin-bottom: 0; }
.profile-head .sub { margin-top: 8px; }
.profile-head .head-actions { margin: 0; }
.profile-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.profile-avatar {
  position: relative; border: 0; padding: 0; background: none; line-height: 0; border-radius: var(--radius-lg);
}
.profile-avatar-edit {
  position: absolute; right: -4px; bottom: -4px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  border: 2px solid #fff;
}
.profile-avatar:hover .profile-avatar-edit { background: var(--red); }
.profile-avatar-edit svg.lucide { width: 14px; height: 14px; }
.modal:has(.profile-form) { width: min(560px, 100%); }
.avatar-setup {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center;
}
.avatar-setup-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.avatar-setup-copy p { color: var(--soft); font-size: 13px; line-height: 1.4; }
.avatar-setup input[type="file"] { display: none; }
.profile-form { display: flex; flex-direction: column; gap: 12px; }
.profile-form .modal-actions { margin-top: 4px; }
.rate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rate-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: #f5f8fa; }
.rate-card span { display: block; color: var(--soft); font-size: 13px; margin-bottom: 8px; line-height: 1.35; }
.rate-card strong { display: block; font-size: 20px; font-weight: 700; letter-spacing: -0.03em; }
.months { display: flex; flex-direction: column; gap: 0; }
.month-block { border-top: 1px solid var(--line); padding-bottom: 4px; }
.month-block:last-child { border-bottom: 1px solid var(--line); }
.month-block summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  cursor: pointer; padding: 16px 0; font-weight: 650; list-style: none;
}
.month-block summary::-webkit-details-marker { display: none; }
.month-block summary strong { font-size: 18px; font-weight: 700; }
.month-meta { color: var(--soft); font-size: 13px; margin: 0 0 10px; line-height: 1.4; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1100px) {
  .kpis, .pipeline, .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stock-layout { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr 1fr; }
  .split, .create-grid, .login, .station, .station-head { grid-template-columns: 1fr; }
  .station-head { display: none; }
  .wizard-summary { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .works-layout, .works-split { grid-template-columns: 1fr; }
  .works-catalog { position: static; }
  .works-list { max-height: 280px; }
  .main:has(.line-page) { padding: 14px 12px 20px; }
  .line-stage { grid-template-columns: 1fr; min-height: 0; }
  .line-canvas-wrap { height: min(58vh, 520px); min-height: 360px; }
  .line-hud-top { align-items: stretch; flex-direction: column; }
  .line-hud-tools { width: 100%; }
  .line-hud-tools .btn { flex: 1; justify-content: center; }
  .line-kpis { gap: 8px; }
  .line-kpi { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .dash-grid, .dash-grid.three { grid-template-columns: 1fr; }
  .chart-donut { grid-template-columns: 1fr; justify-items: center; }
  .login-aside { padding: 32px; justify-content: flex-start; gap: 28px; }
  .login-aside h1 { font-size: 32px; }
}
@media (max-width: 860px) {
  .app { display: block; }
  .sidebar {
    position: sticky; top: 3px; height: auto; z-index: 5;
    flex-direction: row; align-items: center; gap: 10px; padding: 10px 14px;
    background: var(--paper);
  }
  .brand { border-bottom: 0; padding: 0; margin: 0; width: 168px; flex: none; }
  .nav { display: none; }
  .side-foot {
    margin: 0 0 0 auto; padding: 0; border-top: 0;
    flex-direction: row; align-items: center; gap: 6px;
  }
  .who-card { padding: 4px; }
  .who-mini { display: none; }
  .side-tools { padding: 0; }
  .hide-mobile { display: none; }
  .side-note { display: none; }
  .panel-head .search { max-width: none; }
  .page-head { display: flex; flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 18px; }
  .page-head .toolbar, .board-toolbar {
    margin-top: 0; width: 100%;
    display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  }
  .board-head { gap: 12px; margin-bottom: 16px; }
  .board-head-top { align-items: stretch; flex-direction: column; gap: 12px; }
  .board-head-tools { width: 100%; }
  .board-head-tools .seg { flex: 1; }
  .board-head-tools .seg button { flex: 1; justify-content: center; }
  .board-head-filters { width: 100%; }
  .board-head .type-seg,
  .board-head .type-select { flex: 1 1 100%; width: 100%; }
  .board-toggles { flex: 1 1 100%; }
  .board-toggles .toggle { flex: 1; justify-content: center; }
  .board-toolbar .toolbar-row {
    display: flex; width: 100%; gap: 8px;
  }
  .board-toolbar .toolbar-row .seg { flex: 1; }
  .board-toolbar .toolbar-row .seg button { flex: 1; justify-content: center; }
  .board-toolbar .filters { flex-wrap: wrap; }
  .board-toolbar .filters .seg,
  .board-toolbar .filters .type-select { flex: 1 1 100%; min-width: 0; }
  .board-toolbar .filters .toggle { flex: 1 1 calc(50% - 4px); justify-content: center; }
  .board-toolbar .search { width: 100%; min-width: 0; }
  .live-switch { flex: none; }
  .callout.action { display: block; }
  .head-actions { margin-top: 12px; flex-wrap: wrap; }
  h1 { font-size: 26px; }
  .routes, .type-switch, .grid-2, .grid-3, .grid-3-even, .route-row, .rate-grid { grid-template-columns: 1fr; }
  .wizard-nav button { padding: 10px 8px; gap: 8px; }
  .wizard-nav button em { display: none; }
  .wizard-nav button strong { font-size: 13px; }
  .wizard-split { grid-template-columns: 1fr; }
  .wizard-summary { grid-template-columns: 1fr 1fr; }
  .wizard-foot, .create-foot { flex-direction: row; flex-wrap: wrap; padding: 8px; }
  .wizard-foot .btn, .create-foot .btn { flex: 1; justify-content: center; }
  .wizard-actions { width: 100%; }
  .wizard-actions .btn { flex: 1; justify-content: center; }
  .team-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .team-kpi { padding: 14px; }
  .team-kpi strong { font-size: 24px; }
  .team-toolbar { flex-direction: column; align-items: stretch; }
  .team-toolbar .seg { width: 100%; overflow-x: auto; }
  .team-toolbar .search-field { max-width: none; width: 100%; }
  .team-head-tools { width: 100%; }
  .team-head-tools .btn { flex: 1; justify-content: center; }
  .person-card { padding: 14px; }
  .person-card-body { grid-template-columns: 1fr; }
  .person-side { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .person-chip { flex: 1 1 calc(50% - 4px); max-width: none; }
  .person-card-foot { align-items: stretch; }
  .person-card-foot .ticket-actions { width: 100%; }
  .person-card-foot .ticket-actions .btn { flex: 1; justify-content: center; }
  .projects-table-wrap { display: none; }
  .projects-cards {
    display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px;
  }
  .project-card {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-xl);
    padding: var(--control-pad-x); box-shadow: var(--shadow); cursor: pointer;
  }
  .project-card:hover, .project-card:focus-visible { border-color: var(--line-firm); }
  .project-card.is-late { box-shadow: inset 3px 0 0 var(--red); }
  .project-card.is-done-row { opacity: 0.72; }
  .project-card-top {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    margin-bottom: 8px;
  }
  .project-card-top .due-text { flex: none; text-align: right; font-size: 12.5px; }
  .project-card h3 {
    font-size: 18px; letter-spacing: -0.03em; margin: 0 0 2px; font-weight: 700;
  }
  .project-card-meta, .project-card-who {
    color: var(--soft); font-size: 13px; margin: 0;
  }
  .project-card-who { margin-top: 4px; font-weight: 650; color: var(--ink); }
  .project-card-route { margin-top: 12px; }
  .project-card .rx { background: #fff; }
  .pay-card-head { flex-direction: column; }
  .pay-totals { text-align: left; min-width: 0; width: 100%; }
  .pay-split, .pay-totals .text-link { justify-content: flex-start; }
  .main { padding: 16px 14px calc(88px + env(safe-area-inset-bottom)); --page-pad-x: 14px; --page-pad-y: 16px; }
  .panel { padding: 16px 14px 18px; }
  .btn, input, select, .combo-trigger, .combo-field, .toggle, .type-select { min-height: 42px; }
  .btn.small, .seg a, .seg button { min-height: 34px; }
  .board {
    margin: 0 -14px; padding: 4px 14px 18px;
    gap: 10px;
  }
  .col { width: min(86vw, 300px); flex-basis: min(86vw, 300px); max-height: calc(100vh - 220px); }
  .col.is-empty { width: 40px; flex-basis: 40px; }
  .login { grid-template-columns: 1fr; }
  .login-aside { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px; }
  .rx-label { font-size: 9.5px; }
  .stage-main { padding-bottom: 8px; }
  .toasts { top: 64px; left: auto; right: 12px; bottom: auto; width: min(320px, calc(100vw - 24px)); }
  .toast { max-width: none; }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--paper); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tab {
    position: relative;
    flex: 1; min-width: 0; border: 0; background: transparent;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 8px 2px; border-radius: 12px; text-decoration: none;
    color: var(--soft); font-size: 11px; font-weight: 700; line-height: 1;
  }
  .tab .nav-mark {
    position: absolute; top: 2px; left: 50%; margin-left: 6px;
    min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px;
    box-shadow: 0 0 0 2px var(--paper);
  }
  .tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tab.active { color: var(--red); background: var(--red-soft); }
  .tab svg.lucide { width: var(--icon-lg); height: var(--icon-lg); display: block; }

  .work-bar {
    display: block; position: fixed; left: 0; right: 0; z-index: 19;
    bottom: calc(68px + env(safe-area-inset-bottom));
    padding: 10px 14px;
    background: linear-gradient(180deg, rgba(244, 242, 240, 0), var(--bg) 40%);
  }
  .work-bar .btn { width: 100%; justify-content: center; box-shadow: 0 8px 20px rgba(226, 59, 44, 0.22); }
  .work-bar-space { display: block; height: 76px; }
  .zone-head .head-actions { display: none; }
  .work-card { padding: 18px 16px 20px; margin-bottom: 14px; }
  .work-card .work-actions .btn.primary { display: none; }
  .work-card h2 { font-size: 24px; margin-bottom: 6px; }
  .work-timer { font-size: 36px; margin: 10px 0 2px; }
  .work-facts { gap: 12px 14px; margin-top: 14px; padding-top: 14px; }
  .work-row { align-items: flex-start; flex-direction: column; gap: 12px; padding: 14px 0; }
  .work-row .btn { width: 100%; justify-content: center; }
  .profile-head { margin-bottom: 20px; align-items: flex-start; }
  .profile-head .head-actions { width: 100%; }
  .avatar-setup { grid-template-columns: 1fr; }
  .summary { gap: 10px; margin-bottom: 16px; }
  .summary article { padding: 14px 16px; }
  .rate-grid { gap: 10px; }
  .rate-card { padding: 14px 16px; }
  .panel { margin-bottom: 14px; }
  .split { gap: 14px; margin-bottom: 14px; }
  .month-block summary { padding: 14px 0; }
  .ledger-row { grid-template-columns: 1fr; gap: 4px; padding: 12px 0; }
  .modal { max-height: 80vh; width: min(100%, 520px); }
  .kpis, .summary, .stat-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dash-grid, .dash-grid.three { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Доставка */
.dispatch-toolbar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: var(--space-2) 0; margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dispatch-toolbar .seg button { display: inline-flex; align-items: center; gap: 6px; }
.dispatch-toolbar [data-dispatch-extra] { display: contents; }
.dispatch-sheet { width: 100%; }
.dispatch-all { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; color: var(--soft); cursor: pointer; margin-right: auto; }
.dispatch-all[hidden] { display: none; }
.dispatch-all input, .dispatch-row input, .dispatch-group-head input { width: 19px; height: 19px; accent-color: var(--red); cursor: pointer; flex: none; margin: 0; }
.dispatch-group { margin-bottom: 18px; }
.dispatch-group-head { display: flex; align-items: center; gap: 10px; padding: 0 4px 8px; }
.dispatch-clinic { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: 15px; flex-wrap: wrap; }
.dispatch-clinic small { width: 100%; margin-left: 23px; font-weight: 600; font-size: 12.5px; color: var(--soft); }
.dispatch-clinic svg.lucide { width: 16px; height: 16px; color: var(--soft); }
.dispatch-list { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-2xl); overflow: hidden; box-shadow: var(--shadow); }
.dispatch-row {
  display: grid; grid-template-columns: auto minmax(0, 1.4fr) auto minmax(0, 1fr);
  align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line);
  cursor: pointer; transition: background .15s;
}
.dispatch-list > :first-child { border-top: 0; }
.dispatch-row:hover { background: #faf9f7; }
.dispatch-row.is-picked { background: var(--red-soft); }
.dispatch-row.is-late { box-shadow: inset 3px 0 0 var(--red); }
.dispatch-row.is-done, .dispatch-coming .dispatch-row { cursor: default; }
.dispatch-dot { width: 19px; height: 19px; border-radius: 50%; background: var(--wash); display: grid; place-items: center; color: var(--ok); }
.dispatch-row.is-done .dispatch-dot { background: var(--ok-soft); }
.dispatch-dot svg.lucide { width: 12px; height: 12px; }
.dispatch-main { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 2px; min-width: 0; }
.dispatch-code { font-weight: 800; text-decoration: none; color: var(--ink); }
.dispatch-code:hover { color: var(--red); }
.dispatch-patient { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dispatch-main small { grid-column: 1 / -1; color: var(--soft); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dispatch-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.due-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; background: var(--wash); color: var(--soft); font-size: 12px; font-weight: 700; white-space: nowrap; }
.due-chip svg.lucide { width: 12px; height: 12px; }
.due-chip.is-late { background: var(--danger-soft); color: var(--danger); }
.due-chip.is-today, .due-chip.is-urgent { background: var(--warn-soft); color: var(--warn); }
.dispatch-side { display: grid; gap: 3px; justify-items: end; text-align: right; min-width: 0; }
.dispatch-side small { color: var(--soft); font-size: 12.5px; }
.dispatch-who { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13.5px; }
.dispatch-coming { margin: 8px 0 24px; }
.dispatch-coming > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 800; padding: 10px 4px 12px; list-style: none; }
.dispatch-coming > summary::-webkit-details-marker { display: none; }
.dispatch-coming > summary small { font-weight: 600; color: var(--soft); }
.dispatch-coming > summary svg.lucide { width: 16px; height: 16px; color: var(--warn); }
.dispatch-coming .dispatch-list { opacity: .85; }
.dispatch-bar {
  position: sticky; bottom: 16px; z-index: 20; margin: 18px auto 0; max-width: 760px;
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px;
  background: var(--ink); color: #fff; border-radius: var(--radius-2xl); box-shadow: 0 18px 40px rgba(20, 15, 10, .25);
}
.dispatch-bar[hidden] { display: none; }
.dispatch-bar-count { margin-right: auto; font-weight: 600; }
.dispatch-bar-count b { font-size: 18px; font-weight: 800; margin-right: 2px; }
.dispatch-bar .btn.ghost { color: #fff; border-color: transparent; background: transparent; }
.dispatch-bar .btn:not(.primary):not(.ghost) { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.18); }
.dispatch-summary { list-style: none; margin: 0 0 14px; padding: var(--space-3) var(--control-pad-x); display: grid; gap: var(--space-2); background: var(--wash); border-radius: var(--radius-lg); max-height: 220px; overflow: auto; }
.dispatch-summary li { display: grid; gap: 2px; }
.dispatch-summary span { color: var(--soft); font-size: 13px; }
@media (max-width: 860px) {
  .dispatch-row { grid-template-columns: auto minmax(0, 1fr); row-gap: 8px; }
  .dispatch-tags, .dispatch-side { grid-column: 2; justify-content: flex-start; justify-items: start; text-align: left; }
  .dispatch-bar { bottom: 84px; flex-wrap: wrap; }
  .dispatch-bar-count { width: 100%; }
  .dispatch-toolbar .search-field { max-width: none; }
}

/* Сотрудники */
.emp-filters { margin: 4px 0 14px; flex-wrap: wrap; }
.emp-filters b { font-weight: 700; opacity: 0.6; margin-left: 4px; }
.emp-group {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: 18px 0 8px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); font-weight: 700;
}
.emp-group span { color: var(--ink); }
.emp-group em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 500; }
.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; }
.settings-person.emp-card { align-items: flex-start; justify-content: flex-start; gap: 12px; }
.settings-person.emp-card > .avatar { flex: none; margin-top: 2px; }
.settings-person.emp-card .emp-ava {
  flex: none; margin: 0; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px; letter-spacing: 0.02em;
}
.emp-main { flex: 1; min-width: 0; }
.settings-person.emp-card .emp-main strong { font-size: 15px; line-height: 1.25; }
.emp-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.settings-person.emp-card .emp-badge {
  display: inline-flex; align-items: center; gap: 5px; margin: 0;
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: #e7eef3; color: var(--soft); line-height: 1.2;
}
.emp-badge svg.lucide, .emp-badge .ico { width: 12px; height: 12px; flex: none; display: inline-grid; place-items: center; }
.settings-person.emp-card .emp-badge.is-master { background: #e6f0ef; color: #0f5f5c; }
.settings-person.emp-card .emp-badge.is-admin { background: #ece8f3; color: #6b3f69; }
.settings-person.emp-card .emp-badge.is-courier { background: #fbe9e4; color: #8f2f2a; }
.settings-person.emp-card .emp-badge.is-boss { background: #fff3d6; color: #8a5a12; }
.settings-person.emp-card .emp-badge.is-offtime { background: var(--warn-soft); color: var(--warn); }
.emp-facts {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  margin: 10px 0 0; font-size: 12.5px; color: var(--soft); line-height: 1.3;
}
.settings-person.emp-card .emp-facts span,
.settings-person.emp-card .emp-facts a {
  display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: 12.5px;
  white-space: nowrap; max-width: 100%;
}
.settings-person.emp-card .emp-facts b { font-weight: 600; color: var(--soft); }
.emp-facts a { color: inherit; text-decoration: none; }
.emp-facts a:hover, .emp-facts a:hover b { color: var(--red); }
.emp-facts svg.lucide, .emp-facts .ico {
  width: 13px; height: 13px; flex: none; display: inline-grid; place-items: center; color: var(--faint);
}
.emp-actions { flex: none; flex-direction: column; align-items: stretch; margin-top: 0; }

.emp-form { display: flex; flex-direction: column; gap: 14px; }
.emp-section { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.emp-section[hidden] { display: none; }
.emp-section h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
.emp-section h3 svg.lucide, .emp-section h3 .ico { width: 16px; height: 16px; color: var(--red); }
.post-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.post-option input { position: absolute; opacity: 0; pointer-events: none; }
.post-option > span {
  display: flex; flex-direction: column; gap: 4px; height: 100%; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff;
}
.post-option strong { font-size: 14px; }
.post-option em { font-style: normal; font-size: 12px; color: var(--soft); line-height: 1.35; }
.post-option svg.lucide, .post-option .ico { width: 18px; height: 18px; color: var(--soft); }
.post-option input:checked + span { border-color: var(--red); box-shadow: 0 0 0 3px rgba(143, 47, 42, 0.1); }
.post-option input:checked + span svg.lucide, .post-option input:checked + span .ico { color: var(--red); }
.post-option input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.emp-check { align-items: flex-start; }
.emp-check input { margin-top: 3px; }
.emp-check small { display: block; font-weight: 500; color: var(--soft); font-size: 12px; margin-top: 2px; }
.emp-check input:disabled + span { opacity: 0.55; }
.pass-row { display: flex; gap: 6px; }
.pass-row input { flex: 1; min-width: 0; }
.emp-note { margin: 0; font-size: 12px; color: var(--soft); }
.emp-note.is-warn { color: #8a5a12; }
@media (max-width: 640px) {
  .post-options { grid-template-columns: 1fr; }
  .emp-grid { grid-template-columns: 1fr; }
  .settings-person.emp-card { flex-wrap: wrap; }
  .emp-actions { flex-direction: row; width: 100%; }
}
.swatches { flex-wrap: wrap; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch i { width: 26px; height: 26px; transition: box-shadow 0.15s; }
.swatch input:checked + i { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.swatch input:focus-visible + i { outline: 2px solid var(--red); outline-offset: 3px; }

/* Поиск по проектам */
.board-search-row { display: flex; flex-direction: column; gap: 8px; }
.board-search-wrap { position: relative; display: block; }
.board-search-wrap > svg.lucide, .board-search-wrap > .ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--faint); pointer-events: none;
}
.board-search-wrap .board-search { padding-left: 40px; }
.board-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.board-lane b { margin-left: 6px; font-variant-numeric: tabular-nums; }
.board-lane b[hidden] { display: none; }
.board-queue { display: block; }
.board-filters select {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 12px; color: var(--soft); font-weight: 650; min-height: 40px; max-width: 220px; width: auto;
}
.board-filters select.is-set { border-color: var(--ink); color: var(--ink); background: #f6f3ee; }
.board-found { color: var(--soft); font-size: 13px; font-weight: 600; }
.board-found:empty { display: none; }
.board-reset { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; border: 0; background: none; padding: 4px 2px; cursor: pointer; }
.board-reset[hidden] { display: none; }
.board-reset svg.lucide, .board-reset .ico { width: 14px; height: 14px; }
@media (max-width: 640px) {
  .board-filters select { flex: 1 1 calc(50% - 8px); max-width: none; min-width: 0; }
  .board-lane { width: 100%; }
  .board-lane button { flex: 1; }
}
.due-pair { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(88px, 1fr); gap: 6px; }
.due-pair input { min-width: 0; }

/* Настройки — табы */
.settings-nav {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px;
  margin: 0 0 16px;
}
.settings-tab {
  display: flex; align-items: center; gap: var(--space-3); text-decoration: none;
  padding: var(--control-pad-x) var(--space-4); border-radius: var(--radius-xl); border: 1px solid var(--line);
  background: #fff; color: inherit; min-height: 72px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.settings-tab:hover { border-color: var(--line-firm); }
.settings-tab.is-active {
  border-color: var(--red); background: #fff8f6;
  box-shadow: 0 0 0 3px rgba(143, 47, 42, 0.08);
}
.settings-tab-ico {
  flex: none; width: 40px; height: 40px; border-radius: var(--radius-md);
  display: grid; place-items: center; background: #e7eef3; color: var(--soft);
}
.settings-tab.is-active .settings-tab-ico { background: rgba(143, 47, 42, 0.12); color: var(--red); }
.settings-tab-ico svg.lucide, .settings-tab-ico .ico { width: 20px; height: 20px; }
.settings-tab strong { display: block; font-family: var(--display); font-size: 15px; letter-spacing: -0.02em; }
.settings-tab em { display: block; font-style: normal; font-size: 12px; color: var(--soft); margin-top: 2px; }
.settings-jump { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 18px; }

/* Принтеры */
.printers-page {
  position: relative;
}
.printers-page::before {
  content: "";
  position: absolute; inset: -24px -8px auto -8px; height: 220px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 80% at 10% 0%, rgba(226, 59, 44, 0.08), transparent 60%),
    radial-gradient(ellipse 50% 70% at 90% 20%, rgba(13, 92, 87, 0.08), transparent 55%);
}
.printer-kpi {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px;
}
.printer-kpi article {
  background: rgba(255,255,255,0.82); backdrop-filter: blur(10px);
  border: 1px solid rgba(211, 222, 230, 0.9); border-radius: 18px; padding: 14px 16px;
  box-shadow: var(--shadow);
}
.printer-kpi span { display: block; color: var(--soft); font-size: 12px; font-weight: 650; margin-bottom: 4px; }
.printer-kpi strong { font-family: var(--display); font-size: 28px; letter-spacing: -0.04em; line-height: 1; }
.printer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.printer-card {
  position: relative; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-feature); padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.printer-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--ok);
}
.printer-card.is-busy::before { background: var(--red); }
.printer-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.printer-card.is-busy { border-color: #edd0d6; background: linear-gradient(180deg, #fffbfb 0%, #fff 55%); }
.printer-card.is-free { border-color: #d2e4df; background: linear-gradient(180deg, #f7fbfa 0%, #fff 55%); }
.printer-card header { display: flex; align-items: center; gap: 12px; }
.printer-dot {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: grid; place-items: center; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}
.printer-dot svg.lucide, .printer-dot .ico { width: 20px; height: 20px; }
.printer-card header > div { flex: 1; min-width: 0; }
.printer-card header strong { display: block; font-family: var(--display); font-size: 17px; letter-spacing: -0.03em; }
.printer-card header em { display: block; font-style: normal; color: var(--soft); font-size: 13px; margin-top: 3px; }
.printer-state {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--ok-soft); color: var(--ok);
}
.printer-card.is-busy .printer-state { background: var(--red-soft); color: var(--red); }
.printer-state svg.lucide, .printer-state .ico { width: 13px; height: 13px; }
.printer-who { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--radius-xl); background: var(--surface-1); }
.printer-who .ava {
  width: 40px; height: 40px; border-radius: 50%; color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; flex: none;
}
.printer-who strong, .printer-who span, .printer-who em { display: block; }
.printer-who span, .printer-who em { color: var(--soft); font-size: 12.5px; font-style: normal; margin-top: 2px; }
.printer-bar { height: 8px; border-radius: 999px; background: #efe8e0; overflow: hidden; }
.printer-bar i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--red), #e24a3a);
  transition: width .4s ease;
}
.printer-queue { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--soft); }
.printer-queue span { font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.printer-mine { display: flex; flex-direction: column; gap: 8px; }
.printer-mine-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff;
}
.printer-mine-row strong, .printer-mine-row span { display: block; }
.printer-mine-row span { color: var(--soft); font-size: 13px; margin-top: 2px; }
.printer-card .ticket-actions { margin-top: auto; }

/* Длительность брони */
.dur-box { display: flex; flex-direction: column; gap: 10px; }
.dur-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dur-option input { position: absolute; opacity: 0; pointer-events: none; }
.dur-option span {
  display: grid; place-items: center; min-height: 42px; border: 1.5px solid var(--line);
  border-radius: 14px; font-weight: 700; cursor: pointer; background: #fff;
  transition: border-color .15s, box-shadow .15s, background .15s, color .15s;
}
.dur-option:hover span { border-color: var(--line-firm); }
.dur-option input:checked + span {
  border-color: var(--red); color: var(--red); background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(226, 59, 44, 0.1);
}
.dur-option.is-custom span { font-size: 13px; }
.dur-custom {
  display: none; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 12px; border-radius: 16px; background: #f5f8fa; border: 1px solid var(--line);
}
.dur-custom.is-on { display: grid; }
.dur-custom .field { margin: 0; }
.dur-custom .field span { font-size: 12px; }
.dur-preview {
  margin: 0; font-size: 13px; font-weight: 650; color: var(--soft);
}
.dur-preview b { color: var(--ink); font-family: var(--display); font-weight: 700; }
.book-form .hint {
  padding: 10px 12px; border-radius: 14px; background: #f7f4ef; border: 1px solid var(--line);
}
@media (max-width: 720px) {
  .settings-nav { grid-template-columns: 1fr; }
  .dur-options { grid-template-columns: repeat(2, 1fr); }
  .printer-kpi { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .printer-card { transition: none; }
  .printer-card:hover { transform: none; }
}

/* Маршрутный лист */
.route-toolbar { flex-wrap: wrap; gap: 10px; align-items: end; }
.route-toolbar .field { margin: 0; min-width: 140px; }
.route-courier-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-lg); background: var(--paper); border: 1px solid var(--line);
}
.route-alert {
  display: flex; gap: var(--space-3); align-items: flex-start;
  margin: 0 0 var(--gap-section); padding: var(--control-pad-x) var(--space-4); border-radius: var(--radius-xl);
  background: var(--danger-soft); border: 1px solid #f0c4c8; color: var(--danger);
}
.route-alert svg.lucide { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.route-alert strong { display: block; color: var(--ink); margin-bottom: 2px; }
.route-alert p { margin: 0; color: var(--soft); font-size: 13.5px; }
.route-timeline { display: grid; gap: 12px; }
.route-stop {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-2xl);
  padding: var(--control-pad-x) var(--space-4); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.route-stop.is-overlap { border-color: #f0c4c8; box-shadow: inset 3px 0 0 var(--red); }
.route-stop.is-deadline:not(.is-overlap) { border-color: #f0d9a8; box-shadow: inset 3px 0 0 var(--warn); }
.route-stop-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start;
}
.route-num {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 14px;
}
.route-stop-title { display: grid; gap: 4px; min-width: 0; }
.route-stop-title strong { font-size: 16px; }
.route-address, .route-phone {
  display: inline-flex; align-items: center; gap: 6px; color: var(--soft); font-size: 13px; font-weight: 600;
}
.route-address svg.lucide, .route-phone svg.lucide { width: 14px; height: 14px; }
.route-eta { display: flex; gap: 8px; align-items: end; }
.route-eta .field { margin: 0; width: 96px; }
.route-eta .field span { font-size: 11px; }
.route-eta input { padding: 6px 8px; }
.route-lock { color: var(--soft); display: grid; place-items: center; padding-bottom: 8px; }
.route-lock svg.lucide { width: 14px; height: 14px; }
.route-conflicts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.route-orders { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.route-order {
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center;
  padding: var(--space-2) 10px; border-radius: var(--radius-md); background: var(--wash);
}
.route-order span { font-weight: 600; }
.route-stop-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
}
.route-eta-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.route-foot { margin: 16px 0 0; }
@media (max-width: 860px) {
  .route-stop-head { grid-template-columns: auto minmax(0, 1fr); }
  .route-eta { grid-column: 2; }
  .route-stop-actions { flex-wrap: wrap; }
}

/* Планер срочных + intake при создании */
.intake-block {
  margin: 0; padding: 14px; border: 1px solid #f0d9a8; border-radius: 16px;
  background: #fff8ec; display: grid; gap: 8px;
}
.intake-block-label { margin: 0; font-size: 13px; font-weight: 800; color: #8a5a12; }
.intake-option {
  display: flex; gap: 12px; align-items: center; margin: 0; min-height: 56px; padding: 8px 14px;
  border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer;
}
.intake-option.is-on,
.intake-option:has(input:checked) {
  border-color: #e8c07a; background: #fffdf8; box-shadow: inset 0 0 0 1px #e8c07a;
}
.intake-option:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.intake-option input {
  width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; flex: none;
  border: 0; border-radius: 50%; background: transparent; box-shadow: none; accent-color: #8a5a12;
}
.intake-option input:focus { border: 0; box-shadow: none; }
.intake-option span { min-width: 0; }
.intake-option strong { display: block; font-size: 15px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.intake-option em { display: block; font-style: normal; color: var(--soft); font-size: 12.5px; line-height: 1.35; margin-top: 2px; }
.intake-block .hint { margin: 0; }
.bill-list { display: grid; gap: 8px; }
.bill-option {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 2px 12px; align-items: center;
  margin: 0; min-height: 56px; padding: 8px 14px;
  border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer;
}
.bill-option.is-on,
.bill-option:has(input:checked) {
  border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red);
}
.bill-option input {
  grid-column: 1; grid-row: 1 / span 2; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0;
  border: 0; border-radius: 50%; background: transparent; box-shadow: none; accent-color: var(--red);
}
.bill-option input:focus { border: 0; box-shadow: none; }
.bill-option strong { grid-column: 2; grid-row: 1; font-size: 15px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.bill-option em { grid-column: 2; grid-row: 2; font-style: normal; color: var(--soft); font-size: 12.5px; line-height: 1.35; }
.bill-option b { grid-column: 3; grid-row: 1 / span 2; justify-self: end; font-size: 15px; white-space: nowrap; }
.bill-edit { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 12px; margin-top: 12px; }
@media (max-width: 640px) { .bill-edit { grid-template-columns: 1fr; } }
.bill-discount {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
  align-items: end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}
.bill-discount .pay-choice { grid-column: 1 / -1; margin: 0; }
.bill-discount .pay-choice-label { margin: 0 0 6px; }
@media (max-width: 640px) { .bill-discount { grid-template-columns: 1fr; } }
.doc-discount { margin: 8px 0 0; color: var(--muted); font-size: 0.95rem; }
.panel-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.insight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.insight-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.insight-card span { color: var(--soft); font-size: 12.5px; }
.insight-card strong { font-size: 16px; }
.insight-card strong a { color: inherit; text-decoration: none; }
.insight-card strong a:hover { color: var(--red); }
.insight-card b { font-size: 20px; }
.insight-card em { color: var(--soft); font-style: normal; font-size: 13px; line-height: 1.35; }
.rank-scroll { overflow: auto; }
.clinic-rank { width: 100%; border-collapse: collapse; font-size: 14px; }
.clinic-rank th, .clinic-rank td { padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: baseline; }
.clinic-rank th.num, .clinic-rank td.num { text-align: right; }
.clinic-rank th button {
  background: none; border: 0; padding: 0; min-height: 0; font: inherit; font-weight: 700;
  color: var(--soft); cursor: pointer;
}
.clinic-rank th button.is-on { color: var(--ink); }
.clinic-rank a { color: inherit; font-weight: 700; text-decoration: none; }
.clinic-rank a:hover { color: var(--red); }
.clinic-facts { display: grid; gap: 10px; margin: 0; padding: 4px 16px 16px; }
.clinic-facts div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; }
.clinic-facts dt { color: var(--soft); }
.clinic-facts dd { margin: 0; }
.price-sheet { display: grid; gap: 0; padding: 0 8px 12px; }
.price-line {
  display: grid; grid-template-columns: minmax(140px, 1.1fr) 110px minmax(160px, 1.3fr) 130px auto;
  gap: 10px; align-items: center; padding: 8px;
  border-top: 1px solid var(--line);
}
.price-line-head { color: var(--soft); font-size: 12px; font-weight: 700; border-top: 0; }
.price-ours { min-width: 0; }
.price-ours strong, .price-ours span { display: block; }
.price-ours span { color: var(--soft); font-size: 12px; }
.price-line .field { margin: 0; }
.price-line .field em { display: block; margin-top: 2px; font-style: normal; font-size: 12px; }
.price-actions { display: flex; gap: 6px; justify-content: flex-end; }
@media (max-width: 860px) {
  .price-line, .price-line-head { grid-template-columns: 1fr 1fr; }
  .price-line-head { display: none; }
  .price-actions { grid-column: 1 / -1; }
}
.tag-waiting { background: #fff3d6; color: #8a5a12; }
.urgent-section { margin-bottom: 28px; }
.urgent-section-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.urgent-section-head h2 { margin: 0; font-size: 18px; }
.urgent-list { display: grid; gap: 10px; }
.urgent-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: 18px; background: var(--paper);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.urgent-card.is-waiting { border-color: #f0d9a8; box-shadow: inset 3px 0 0 var(--warn); }
.urgent-card.is-late { box-shadow: inset 3px 0 0 var(--red); }
.urgent-card-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.urgent-patient { font-size: 16px; }
.urgent-meta, .urgent-work, .urgent-assignee { margin: 4px 0 0; font-size: 13px; color: var(--soft); }
.urgent-work { color: var(--ink); font-weight: 600; }
.urgent-card-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.urgent-waiting-banner { border-color: #f0d9a8; background: #fff8ec; }
@media (max-width: 720px) {
  .urgent-card { grid-template-columns: 1fr; }
  .urgent-card-actions { flex-direction: row; flex-wrap: wrap; }
}

/* Мессенджер */
.chat-dock { position: fixed; right: 20px; bottom: 24px; z-index: 60; }
.chat-fab {
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--ink); color: #fff; display: grid; place-items: center;
  box-shadow: 0 12px 28px rgba(20, 15, 10, .28); position: relative;
}
.chat-fab svg.lucide { width: 22px; height: 22px; }
.chat-fab b {
  position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: 11px;
  display: grid; place-items: center; font-weight: 800;
}
.chat-pop {
  position: absolute; right: 0; bottom: 68px; width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 120px)); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius-feature); box-shadow: 0 22px 50px rgba(20, 15, 10, .22);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-pop[hidden] { display: none !important; }
.chat-pop-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line); background: #f5f8fa;
}
.chat-pop-title { flex: 1; min-width: 0; }
.chat-pop-title strong { display: block; font-size: 14px; }
.chat-pop-title em { display: block; font-style: normal; font-size: 12px; color: var(--soft); }
.chat-icon-btn {
  width: 34px; height: 34px; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--ink); cursor: pointer; display: grid; place-items: center;
}
.chat-icon-btn:hover { background: var(--wash); }
.chat-pop-tabs {
  display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.chat-pop-tabs button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 11px; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--soft);
}
.chat-pop-tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chat-project-jump {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; text-align: left;
}
.chat-project-jump:hover { background: var(--wash); }
.chat-project-jump svg.lucide { width: 15px; height: 15px; }
.chat-admin-cta { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.chat-admin-cta svg.lucide { width: 13px; height: 13px; }
.inbox-tools { display: flex; gap: 10px; align-items: center; padding: 12px 12px 4px; }
.inbox-search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-2);
  min-height: var(--control-h-sm);
  border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 0 12px; background: #fff;
}
.inbox-search input {
  border: 0; padding: 0; height: var(--control-h-sm); width: 100%;
  background: transparent; font: inherit; font-size: 13.5px; color: var(--ink);
}
.inbox-search input:focus { outline: none; }
.inbox-search:focus-within { border-color: var(--red); box-shadow: var(--focus-ring); }
.inbox-search svg.lucide { width: 16px; height: 16px; color: var(--soft); flex: none; }
.chat-write {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  flex: none; min-height: var(--control-h-sm); height: var(--control-h-sm);
  border: 1px solid var(--line); background: #fff; border-radius: var(--radius-pill);
  padding: 0 14px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; color: var(--ink);
  line-height: 1;
}
.chat-write svg.lucide { width: 14px; height: 14px; flex: none; }
.chat-write.active, .chat-write:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.inbox-find-label {
  margin: 0; padding: 10px 14px 4px; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--soft);
}
.chat-room-list { flex: 1; overflow: auto; }
.inbox-empty-hint {
  margin: 0; padding: 16px 14px 20px; color: var(--soft); font-size: 13.5px; line-height: 1.45;
}
.chat-room-row {
  width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px;
  align-items: center; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; text-align: left; cursor: pointer;
}
.chat-room-row:hover { background: #faf9f7; }
.chat-room-row.has-unread { background: var(--red-soft); }
.chat-room-ico { color: var(--soft); display: grid; place-items: center; }
.chat-room-main strong { display: block; font-size: 13.5px; }
.chat-room-main em {
  display: block; font-style: normal; font-size: 12.5px; color: var(--soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-room-meta { text-align: right; display: grid; gap: 4px; justify-items: end; }
.chat-room-meta b {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 11px; display: grid; place-items: center;
}
.chat-room-meta small { color: var(--faint); font-size: 11px; }
.chat-thread { flex: 1; overflow: auto; padding: 12px; display: grid; gap: 10px; align-content: start; }
.chat-bubble {
  max-width: 88%; padding: var(--space-2) 11px; border-radius: var(--radius-lg); background: var(--wash);
  justify-self: start;
}
.chat-bubble.is-mine { background: #e8f0ee; justify-self: end; }
.chat-bubble-who { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.chat-bubble p { margin: 0; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.chat-bubble time { display: block; margin-top: 4px; font-size: 11px; color: var(--faint); }
.chat-compose {
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: #f5f8fa;
}
.chat-compose-row { display: flex; gap: 8px; align-items: center; }
.chat-compose input[name="text"] {
  flex: 1; border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); font: inherit; min-width: 0;
}
.chat-attach {
  width: var(--control-h-sm); height: var(--control-h-sm); border-radius: var(--radius-md); display: grid; place-items: center;
  color: var(--ink); cursor: pointer; flex: none;
}
.chat-attach:hover { background: var(--wash); }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-chip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  padding: 4px 4px 4px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 12px;
}
.chat-chip em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.chat-chip button { border: 0; background: transparent; color: var(--soft); cursor: pointer; display: grid; place-items: center; padding: 2px; }
.chat-files { display: grid; gap: 6px; margin-top: 6px; }
.chat-shot, .chat-file {
  border: 0; padding: 0; background: transparent; cursor: pointer; text-align: left; color: inherit; font: inherit;
}
.chat-shot img { display: block; max-width: 220px; max-height: 160px; border-radius: 10px; object-fit: cover; }
.photo-view {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center;
  padding: 56px 20px 28px; background: rgba(18, 24, 32, .9);
}
.photo-view figure { margin: 0; display: grid; justify-items: center; gap: 12px; max-width: 100%; }
.photo-view img {
  display: block; max-width: min(1100px, 94vw); max-height: calc(100vh - 140px);
  object-fit: contain; border-radius: 12px; background: #111;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .4);
}
.photo-view figcaption { color: #fff; font-size: 14px; text-align: center; }
.photo-view-close {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px;
  border: 0; border-radius: 12px; background: rgba(255, 255, 255, .16); color: #fff;
  cursor: pointer; display: grid; place-items: center;
}
.photo-view-close:hover { background: rgba(255, 255, 255, .28); }
.chat-file {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: rgba(255,255,255,.72);
}
.chat-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.chat-file small { color: var(--faint); }
body.on-messages .chat-dock { display: none; }
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: var(--gap-section); align-items: stretch; }
.inbox-list, .inbox-thread {
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
  height: calc(100dvh - 250px); min-height: 420px;
}
.inbox-head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--control-pad-x); border-bottom: 1px solid var(--line); }
.inbox-head strong { display: block; }
.inbox-head em { display: block; font-style: normal; font-size: 12px; color: var(--soft); }
.inbox-back { display: none; }
.inbox-empty { margin: auto; text-align: center; padding: 32px 16px; }
.inbox-thread .chat-thread { flex: 1; min-height: 0; overflow: auto; }
.case-shell { max-width: none; }
.case-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 12px 20px; margin-bottom: 12px;
  padding: 14px 16px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-feature); box-shadow: var(--shadow);
}
.case-head-main { min-width: 0; flex: 1; }
.case-code-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px;
}
.case-code {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 700;
  letter-spacing: 0.02em; font-variant-numeric: tabular-nums;
}
.case-product { color: var(--soft); font-size: 13px; font-weight: 650; }
.case-head h1 { font-size: clamp(24px, 2.4vw, 30px); margin: 0; }
.case-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px;
}
.case-meta > span {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--soft); font-size: 13.5px; font-weight: 650;
}
.case-meta svg.lucide { width: 15px; height: 15px; color: var(--faint); flex: none; }
.case-meta em { font-style: normal; color: var(--ink); }
.case-meta a { color: var(--ink); text-decoration: none; }
.case-meta a:hover { color: var(--red); }
.case-head-side {
  display: flex; align-items: center; gap: 10px;
}
.case-progress {
  display: flex; align-items: center; gap: 10px;
  min-width: 168px; padding: 8px 12px; border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--live-soft), #fff);
  border: 1px solid #c5e0e6; text-align: left;
}
.case-progress strong {
  font-family: var(--display); font-size: 22px; letter-spacing: -0.04em;
  color: var(--live); line-height: 1;
}
.case-progress span { display: block; font-size: 11px; color: var(--soft); font-weight: 700; }
.case-progress em { display: block; margin-top: 1px; font-style: normal; font-size: 13px; font-weight: 700; color: var(--ink); }
.case-meter {
  display: block; margin-top: 6px; height: 4px; width: 100%;
  border-radius: 99px; background: #d5e6ea; overflow: hidden;
}
.case-meter b {
  display: block; height: 100%; width: calc(var(--pct, 0) * 1%);
  background: var(--live); border-radius: inherit;
}
.case-steps {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  gap: 4px; list-style: none; margin: 0 0 12px; padding: 8px;
  overflow-x: auto; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-feature); box-shadow: var(--shadow);
}
.case-steps li {
  min-width: 0; display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: var(--radius-md); background: transparent;
}
.case-steps li b {
  width: 22px; height: 22px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: var(--wash); color: var(--faint);
  font-size: 11px; font-weight: 700;
}
.case-steps li b svg.lucide { width: 12px; height: 12px; }
.case-steps li.is-done b { background: var(--ok); color: #fff; }
.case-steps li.is-current { background: var(--red-soft); }
.case-steps li.is-current b { background: var(--red); color: #fff; }
.case-steps em {
  display: block; min-width: 0; font-size: 12.5px; font-style: normal; color: var(--soft);
  line-height: 1.25; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.case-steps li.is-current em { color: var(--ink); }
.case-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr); gap: 12px; align-items: start; }
.case-main > .case-action {
  margin-bottom: 0;
  border-bottom-left-radius: 0; border-bottom-right-radius: 0;
}
.case-main > .case-action + .route-panel {
  border-top-left-radius: 0; border-top-right-radius: 0;
  border-top-color: #f0c8c3;
}
.case-lower {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px; margin-top: 12px; align-items: start;
}
.case-lower > :only-child,
.case-span { grid-column: 1 / -1; }
.case-main, .case-side { display: grid; gap: 16px; }
.case-side .panel { border-radius: var(--radius-feature); box-shadow: var(--shadow); }
.case-facts { padding-bottom: 14px; }
.case-facts-grid {
  display: grid; grid-template-columns: 1fr; gap: 0;
}
.case-fact {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--line);
  background: transparent; min-width: 0;
}
.case-fact-ico {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  display: grid; place-items: center; background: #fff; color: var(--soft);
  border: 1px solid var(--line);
}
.case-fact-ico svg.lucide { width: 14px; height: 14px; }
.case-fact-copy {
  min-width: 0; flex: 1;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.case-fact-copy span {
  color: var(--faint); font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; flex: none;
}
.case-fact-copy strong {
  font-weight: 700; font-size: 13.5px; line-height: 1.3; text-align: right;
}
.case-work {
  margin: 12px 0 0; padding: 12px; border-radius: var(--radius-lg);
  background: var(--wash); font-size: 14px; line-height: 1.45;
}
.case-work span {
  display: block; margin-bottom: 4px; color: var(--faint); font-size: 11px;
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.case-cancel { margin: 12px 0 0; }
.case-cancel .text-link { color: var(--danger); }
@media (max-width: 860px) {
  .case-head { grid-template-columns: 1fr; }
  .case-head-side { align-items: stretch; flex-wrap: wrap; }
  .case-layout, .case-lower { grid-template-columns: 1fr; }
  .case-facts-grid { grid-template-columns: 1fr; }
}
.modal:has(.case-edit) { width: min(920px, 100%); }
.case-edit { display: flex; flex-direction: column; gap: 14px; }
.case-edit .lead { margin: 0; }
.case-edit-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr); gap: 12px; align-items: start; }
.case-edit-block, .case-edit-shade {
  border: 1px solid var(--line); border-radius: var(--radius-xl); padding: var(--control-pad-x) var(--control-pad-x) var(--space-4);
  display: flex; flex-direction: column; gap: 10px; background: #fff;
}
.case-edit-block h4, .case-edit-shade h4 { margin: 0; font-size: 16px; letter-spacing: -0.02em; }
.case-edit [data-doctor-slot], .case-edit [data-patient-slot] { display: block; }
.case-edit-block .hint { margin: -4px 0 0; }
.case-edit-shade .shade-board { border: 0; padding: 0; background: transparent; gap: 12px; }
.case-edit-shade .shade-board > legend { display: none; }
.case-edit-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; bottom: -24px; background: #fff; padding: 10px 0 2px;
}
.case-edit-drop { color: var(--danger); }
@media (max-width: 720px) {
  .case-edit-grid { grid-template-columns: 1fr; }
  .case-edit-foot { align-items: stretch; flex-direction: column; }
  .case-edit-foot .modal-actions { width: 100%; }
}
.case-loading { padding: 28px 8px; }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 0 8px; }
.docs-panel .hint { margin: 0 0 10px; }
.doc-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.doc-list button {
  width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 8px 10px; cursor: pointer; font: inherit;
}
.doc-list button strong { display: block; font-size: 14px; }
.doc-list button em { display: block; font-style: normal; color: var(--soft); font-size: 12.5px; margin-top: 2px; }
.doc-list button:hover { background: var(--wash); }
.doc-lines { display: grid; gap: 8px; margin: 8px 0; }
.doc-line { display: grid; grid-template-columns: minmax(0, 1.6fr) 80px 110px auto; gap: 8px; align-items: end; }
.doc-total { margin: 8px 0 0; font-size: 16px; }
.doc-preview {
  position: fixed; inset: 0; z-index: 100; overflow: auto;
  background: #e7eef3; padding: 24px 16px 40px;
}
.doc-toolbar {
  width: min(210mm, 100%); margin: 0 auto 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #fff; border-radius: 16px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(20, 20, 20, .06);
}
.doc-toolbar div { display: flex; gap: 8px; }
.doc-sheet {
  width: min(210mm, calc(100% - 32px)); max-width: 100%; box-sizing: border-box; margin: 0 auto; background: #fff; color: #1c2834;
  padding: 14mm 12mm; box-shadow: 0 18px 50px rgba(20, 20, 20, .18); overflow: hidden;
}
.doc-brand { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #e23b2c; padding-bottom: 8px; }
.doc-brand strong { font-family: Manrope, sans-serif; font-size: 22px; }
.doc-brand span { color: #5c6b78; font-size: 13px; }
.doc-sheet h1 { font-size: 26px; margin: 18px 0 0; }
.doc-date, .doc-basis, .doc-note { color: #5c6b78; margin: 4px 0; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.doc-party { display: grid; gap: 2px; font-size: 14px; }
.doc-party em { font-style: normal; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #5c6b78; font-weight: 700; }
.doc-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.doc-table { table-layout: fixed; }
.doc-table th, .doc-table td { border: 1px solid #1c2834; padding: 6px 8px; text-align: left; font-size: 13.5px; vertical-align: top; word-break: break-word; }
.doc-table th { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #5c6b78; background: #f4f7f9; }
.doc-table .num { text-align: right; white-space: nowrap; }
.doc-sum { text-align: right; font-size: 18px; margin: 14px 0 4px; }
.doc-sample { margin: 0 0 6px; font-size: 12px; color: #5c6b78; }
.doc-pay { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 13px; table-layout: fixed; }
.doc-pay td { border: 1px solid #1c2834; padding: 4px 8px; vertical-align: top; word-break: break-word; }
.doc-pay small { display: block; color: #5c6b78; font-size: 11px; }
.doc-pay strong { font-weight: 700; }
.doc-pay-label { width: 70px; white-space: nowrap; }
.doc-count { margin: 12px 0 0; }
.doc-words { margin: 2px 0 8px; font-weight: 700; }
.doc-accept { margin-top: 14px; }
.form-section { margin: 16px 0 8px; font-size: 15px; }
.clinic-card {
  border: 1px solid var(--line); border-radius: var(--radius-xl); padding: var(--control-pad-x) var(--space-4); background: #fff; margin-bottom: 10px;
}
.clinic-card header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.clinic-card header strong { display: block; font-size: 16px; }
.clinic-card header span { display: block; color: var(--soft); font-size: 13px; margin-top: 2px; }
.clinic-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 12px 0 0; }
.clinic-card dt { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.clinic-card dd { margin: 2px 0 0; }
.clinic-card dd em { font-style: normal; color: var(--soft); }
.clinic-note { margin: 10px 0 0; color: var(--soft); }
.clinic-pool { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.clinic-pool > span { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin-right: 4px; }
.clinic-pool b, .clinic-pool em {
  font-style: normal; font-weight: 700; font-size: 13px;
  background: var(--wash); border-radius: 999px; padding: 4px 10px;
}
.clinic-pool em { color: var(--soft); font-weight: 600; }
.clinic-price { margin-top: 12px; display: grid; gap: 6px; }
.clinic-price > span { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.clinic-price p { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
.clinic-price p em { grid-column: 1 / -1; color: var(--soft); font-style: normal; font-size: 12.5px; }
.clinic-price > em { color: var(--soft); font-style: normal; font-size: 13px; }
.clinic-price-list { display: grid; gap: 8px; }
.clinic-price-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.clinic-price-row span { display: block; color: var(--soft); font-size: 12.5px; }
.pool-picker, .stage-compose { display: flex; flex-direction: column; gap: 12px; }
.pool-picker .lead, .stage-compose .lead { margin: 0; }
.pool-bar { display: flex; align-items: center; gap: 12px; }
.pool-bar b { white-space: nowrap; font-size: 13px; letter-spacing: -0.01em; }
.pool-search, .stage-crew-search {
  flex: 1; display: flex; align-items: center; gap: var(--space-2);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0 var(--space-3); background: #fff; min-height: var(--control-h);
}
.pool-search input, .stage-crew-search input { border: 0; padding: 10px 0; background: transparent; width: 100%; }
.pool-search input:focus, .stage-crew-search input:focus { border: 0; box-shadow: none; }
.pool-search:focus-within, .stage-crew-search:focus-within {
  border-color: var(--red); box-shadow: var(--focus-ring);
}
.pool-search .ico, .stage-crew-search .ico { color: var(--faint); }
.pool-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  max-height: 420px; overflow: auto; padding: 2px;
}
.pool-card {
  position: relative; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px;
  background: #fff; cursor: pointer; min-width: 0;
}
.pool-card:hover { border-color: var(--line-firm); }
.pool-card input { position: absolute; opacity: 0; pointer-events: none; }
.pool-card span { display: flex; flex-direction: column; min-width: 0; }
.pool-card strong { font-size: 14px; line-height: 1.25; }
.pool-card em { font-style: normal; color: var(--soft); font-size: 12px; }
.pool-card.is-off { display: none; }
.pool-tick, .stage-tick {
  margin-left: auto; width: 22px; height: 22px; border-radius: 999px; flex: none;
  border: 1px solid var(--line); display: grid; place-items: center; color: transparent;
}
.pool-tick .ico, .stage-tick .ico, .pool-tick svg.lucide, .stage-tick svg.lucide { width: 14px; height: 14px; }
.pool-search svg.lucide, .stage-crew-search svg.lucide { width: 16px; height: 16px; color: var(--faint); }
.pool-card:has(input:checked) {
  border-color: var(--red); background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(226, 59, 44, 0.12);
}
.pool-card:has(input:checked) .pool-tick { background: var(--red); border-color: var(--red); color: #fff; }
.pool-none { margin: 0; }
.stage-pay {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: 16px; background: var(--wash);
}
.stage-pay span { display: block; color: var(--soft); font-size: 13px; }
.stage-pay strong { display: block; font-size: 26px; letter-spacing: -0.04em; line-height: 1.1; margin-top: 2px; }
.stage-pay em { font-style: normal; font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.stage-crew { display: flex; flex-direction: column; gap: 8px; }
.stage-crew-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.stage-crew-head span { font-weight: 700; }
.stage-crew-head em { font-style: normal; color: var(--soft); font-size: 13px; }
.stage-people { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow: auto; }
.stage-person {
  width: 100%; text-align: left; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; background: #fff;
}
.stage-person span { display: flex; flex-direction: column; min-width: 0; }
.stage-person strong { font-size: 14px; line-height: 1.25; }
.stage-person small { color: var(--soft); font-size: 12px; }
.stage-person.is-off { display: none; }
.stage-person.is-on {
  border-color: var(--red); background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(226, 59, 44, 0.12);
}
.stage-person.is-on .stage-tick { background: var(--red); border-color: var(--red); color: #fff; }
@media (max-width: 720px) {
  .pool-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) { .clinic-card dl { grid-template-columns: 1fr; } }
.doc-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 36px; }
.doc-signs em { display: block; font-style: normal; color: #5c6b78; font-size: 12px; }
.doc-signs span { display: block; border-bottom: 1px solid #1c2834; height: 28px; margin: 8px 0; }
.doc-signs small { display: block; color: #5c6b78; margin-top: 4px; }
@media (max-width: 720px) {
  .doc-line { grid-template-columns: 1fr 1fr; }
  .doc-parties, .doc-signs { grid-template-columns: 1fr; }
}
@media print {
  body * { visibility: hidden; }
  .doc-preview, .doc-preview * { visibility: visible; }
  .doc-preview { position: absolute; inset: 0; background: #fff; padding: 0; overflow: visible; }
  .doc-toolbar { display: none !important; }
  .doc-sheet { box-shadow: none; width: auto; padding: 0; }
}
@media (max-width: 1100px) {
  .case-layout, .inbox { grid-template-columns: 1fr; }
  .inbox-back { display: grid; }
  .inbox.is-thread .inbox-list { display: none; }
  .inbox:not(.is-thread) .inbox-thread { display: none; }
  .inbox-list, .inbox-thread { height: calc(100dvh - 300px); min-height: 320px; }
}
.chat-locked { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); text-align: center; }
@media (max-width: 720px) {
  .chat-dock { right: 14px; bottom: 88px; }
  .chat-pop { height: min(70vh, 560px); }
}

.ai-setup .ai-provider { display: inline-flex; }
.ai-provider label {
  position: relative; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 14px; border-radius: 999px; color: var(--soft); font-weight: 650; min-height: 34px;
}
.ai-provider input { position: absolute; opacity: 0; pointer-events: none; }
.ai-provider label:has(input:checked) { background: var(--red); color: #fff; }
.ai-setup:has([name="provider"][value="openai"]:checked) [data-ai-pane="deepseek"],
.ai-setup:has([name="provider"][value="deepseek"]:checked) [data-ai-pane="openai"] { display: none; }
.ai-clear { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--soft); font-weight: 650; }
.ai-chat { display: flex; flex-direction: column; min-height: min(68vh, 720px); }
.ai-chat-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.ai-chat-bar strong { display: block; font-size: 15px; }
.ai-chat-bar em { display: block; font-style: normal; color: var(--soft); font-size: 12px; margin-top: 2px; }
.ai-log {
  flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px;
  padding: 14px 2px; min-height: 240px;
}
.ai-log .chat-bubble { max-width: min(640px, 100%); }
.ai-empty { margin: auto; text-align: center; max-width: 460px; padding: 24px 12px; }
.ai-empty strong { display: block; font-size: 18px; letter-spacing: -0.03em; }
.ai-empty p { color: var(--soft); }
.ai-prompts { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ai-prompts button {
  text-align: left; border: 1px solid var(--line); background: #f8fbfc;
  border-radius: 14px; padding: 10px 12px; color: var(--ink); font: inherit; font-weight: 650;
}
.ai-prompts button:hover { border-color: var(--line-firm); }
.ai-compose {
  display: flex; gap: 10px; align-items: flex-end;
  padding-top: 12px; border-top: 1px solid var(--line);
}
.ai-compose textarea { flex: 1; min-height: 52px; max-height: 160px; }
.ai-wait p { color: var(--soft); }
@media (max-width: 720px) {
  .ai-compose { flex-direction: column; align-items: stretch; }
  .ai-chat-bar { align-items: flex-start; flex-direction: column; }
}

.buy-section { margin-bottom: 16px; }
.buy-list { display: flex; flex-direction: column; gap: 10px; }
.buy-card {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff;
}
.buy-card.is-closed { background: #f8fbfc; }
.buy-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.buy-top strong { font-size: 16px; letter-spacing: -0.02em; }
.buy-top b { color: var(--red); font-size: 13px; white-space: nowrap; }
.buy-main p { margin: 6px 0 0; color: var(--soft); }
.buy-who { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.buy-who time { color: var(--faint); }
.buy-done { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.buy-card .ticket-actions { flex: none; }
@media (max-width: 720px) {
  .buy-card { flex-direction: column; }
  .buy-card .ticket-actions { width: 100%; }
}

.service-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.service-row strong, .service-row span { display: block; }
.service-row span { color: var(--soft); font-size: 13px; margin-top: 2px; }
.service-row-actions, .service-paybar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.service-paybar { margin-top: 12px; }
.econ-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.econ-grid div { padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-1); }
.econ-grid span { display: block; color: var(--soft); font-size: 12px; }
.econ-grid strong { display: block; margin-top: 4px; font-size: 18px; }
.pulse-result { padding: 4px 0 16px; }
.pulse-result span { color: var(--soft); font-size: 13px; }
.pulse-result strong { display: block; font-family: var(--display); font-size: 40px; letter-spacing: -0.03em; line-height: 1.1; }
.pulse-result em { display: block; margin-top: 6px; color: var(--soft); font-style: normal; font-size: 14px; }
.pulse-result.is-profit strong { color: var(--ok); }
.pulse-result.is-loss strong { color: var(--danger); }
.pulse-grid { display: grid; grid-template-columns: 1.15fr 1.15fr 0.9fr; gap: 12px; }
.pulse-col { background: var(--surface-1); border-radius: 14px; padding: 14px 16px; }
.pulse-col h3 { margin: 0 0 8px; font-size: 15px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pulse-col h3 .text-link { font-family: var(--sans); letter-spacing: 0; font-size: 13px; text-transform: none; }
.pulse-line { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 14px; }
.pulse-line.is-quiet { color: var(--soft); }
.pulse-year { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; margin-top: 18px; }
.pulse-month { border: 0; background: transparent; padding: 0; cursor: pointer; color: var(--faint); }
.pulse-month em { display: block; margin-top: 6px; font-style: normal; font-size: 12px; text-align: center; }
.pulse-month.is-on em { color: var(--ink); font-weight: 700; }
.pulse-track { display: flex; flex-direction: column; height: 72px; background: var(--wash); border-radius: 8px; overflow: hidden; }
.pulse-up, .pulse-down { flex: 1; display: flex; min-height: 0; }
.pulse-up { align-items: flex-end; }
.pulse-down { align-items: flex-start; border-top: 1px solid var(--line); }
.pulse-up i, .pulse-down i { display: block; width: 100%; }
.pulse-up i { background: var(--ok); border-radius: 6px 6px 0 0; }
.pulse-down i { background: var(--danger); border-radius: 0 0 6px 6px; }
.pulse-year-note { margin: 10px 0 0; }
.pulse-charge { grid-template-columns: minmax(0, 1fr) auto auto; }
.pulse-plan { grid-template-columns: minmax(0, 1fr) auto; }
.pulse-charge.is-skipped { opacity: 0.55; }
.spend-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--wash); }
.spend-bar i { display: block; min-width: 0; flex-basis: 0; }
.spend-bar i.is-labor, .spend-legend i.is-labor, .spend-stack i.is-labor { background: var(--ink); }
.spend-bar i.is-materials, .spend-legend i.is-materials, .spend-stack i.is-materials { background: var(--live); }
.spend-bar i.is-charges, .spend-legend i.is-charges, .spend-stack i.is-charges { background: #c47b12; }
.spend-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.spend-legend p {
  display: flex; align-items: center; gap: 8px; margin: 0;
  padding: 10px 12px; background: var(--surface-1); border-radius: 12px;
}
.spend-legend i { width: 10px; height: 10px; border-radius: 99px; flex: none; }
.spend-legend span { flex: 1; min-width: 0; font-size: 13px; color: var(--soft); }
.spend-legend em { display: block; font-style: normal; color: var(--faint); font-size: 12px; }
.spend-legend b { font-variant-numeric: tabular-nums; }
.spend-note { margin: 12px 0 0; }
.spend-person { grid-template-columns: minmax(0, 1fr) auto; }
.spend-job { padding: 12px 0; border-top: 1px solid var(--line); }
.spend-job-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; row-gap: 2px;
  text-decoration: none; align-items: center;
}
.spend-job-head strong { grid-column: 1; grid-row: 1; }
.spend-job-head span { grid-column: 1; grid-row: 2; color: var(--soft); font-size: 13px; }
.spend-job-head b { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.spend-line {
  display: flex; justify-content: space-between; gap: 12px;
  margin: 4px 0 0; padding-left: 14px; color: var(--soft); font-size: 13px;
}
.spend-line span { min-width: 0; }
.spend-line b { color: var(--ink); font-weight: 650; flex: none; }
.spend-year { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.spend-month { border: 0; background: transparent; padding: 0; cursor: pointer; color: var(--faint); }
.spend-month em { display: block; margin-top: 6px; font-style: normal; font-size: 12px; text-align: center; }
.spend-month.is-on em { color: var(--ink); font-weight: 700; }
.spend-stack {
  display: flex; flex-direction: column; justify-content: flex-end;
  height: 72px; background: var(--wash); border-radius: 8px; overflow: hidden;
}
.spend-stack i { display: block; width: 100%; min-height: 0; }
.spend-basis { margin: 4px 2px 0; }
@media (max-width: 800px) {
  .spend-legend { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .pulse-grid { grid-template-columns: 1fr; }
}
.finance-sums { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.finance-sums em { font-style: normal; font-weight: 700; font-size: 12px; }
.clinic-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.clinic-pay { margin: 8px 0 0; font-weight: 700; }
.clinic-search { flex-direction: row; align-items: center; gap: 8px; min-width: min(360px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; }
.clinic-search input { border: 0; background: transparent; width: 100%; outline: none; }
.clinic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 14px; }
.clinic-card {
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--line); border-radius: var(--radius-xl); padding: var(--space-4); background: #fff;
}
.clinic-card header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.clinic-card header .ticket-actions { margin-top: 0; flex-wrap: nowrap; }
.clinic-card dd { overflow-wrap: anywhere; }
.clinic-card h2 { font-size: 18px; }
.clinic-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 13px; font-weight: 650; margin: 4px 0 8px; }
.statement table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.statement th, .statement td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
.statement small { display: block; color: var(--soft); }
.statement-total { margin-top: 12px; font-weight: 700; }
.statement .modal-actions { margin-top: 14px; }
.tpl-list { display: grid; gap: 8px; }
.tpl-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-2) var(--space-3); background: #fff;
}
.tpl-row strong { display: block; }
.tpl-row em { display: block; font-style: normal; color: var(--soft); font-size: 13px; margin-top: 2px; }
.tpl-mark {
  flex: none; font-size: 12px; font-weight: 700; color: var(--live); background: var(--live-soft);
  border-radius: 999px; padding: 4px 8px;
}
.diary-nav { display: flex; align-items: center; gap: 6px; }
.diary-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 12px; color: var(--soft); font-size: 12px; font-weight: 650; }
.diary-legend i { width: 10px; height: 10px; border-radius: 99px; display: inline-block; background: var(--line-firm); }
.diary-legend i.is-live { background: var(--live); }
.diary-legend i.is-deadline { background: #c47b12; }
.diary-legend i.is-late { background: var(--red); }
.diary { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.diary-day {
  min-height: 168px; border: 1px solid var(--line); border-radius: var(--radius-xl); padding: var(--space-2);
  background: var(--surface-1); display: flex; flex-direction: column; gap: 6px;
}
.diary-slots { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.diary-day.is-weekend { background: #f3f6f8; }
.diary-day.is-today { border-color: var(--red); background: #fff; box-shadow: 0 0 0 3px rgba(226, 59, 44, 0.08); }
.diary-day h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin: 0 0 4px; }
.diary-day h3 b { font-family: var(--display); font-size: 22px; letter-spacing: -0.04em; line-height: 1; }
.diary-day.is-today h3 b { color: var(--red); }
.diary-day h3 span { color: var(--soft); font-size: 12px; font-weight: 700; text-transform: capitalize; }
.diary-empty { margin: auto 0; color: var(--faint); text-align: center; }
.diary-card {
  display: flex; flex-direction: column; gap: 2px;
  text-decoration: none; border-radius: var(--radius-md); padding: var(--space-2) var(--space-2) 7px;
  background: #fff; border: 1px solid var(--line); color: inherit;
}
.diary-card time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px; letter-spacing: -0.01em; }
.diary-card strong { font-size: 13px; line-height: 1.25; }
.diary-card span { color: var(--soft); font-size: 12px; }
.diary-card em {
  align-self: flex-start; margin-top: 4px; font-style: normal; font-size: 11px; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase; color: var(--soft);
  background: var(--wash); border-radius: 999px; padding: 2px 6px;
}
.diary-card.is-live { border-color: #b7d5de; background: var(--live-soft); }
.diary-card.is-live em { color: var(--live); background: #fff; }
.diary-card.is-deadline { border-color: #ead7b2; background: #fff7ea; }
.diary-card.is-deadline em { color: #8a5a12; background: #fff; }
.diary-card.is-late { background: var(--red-soft); border-color: #f0c2bc; }
.diary-card.is-late em { color: var(--red); background: #fff; }
.diary-later { margin-top: 14px; }
.diary-later h3 { font-size: 14px; margin: 0 0 8px; }
.diary-later-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
@media (max-width: 1100px) {
  .diary { grid-template-columns: 1fr; }
  .diary-day { min-height: 0; display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: start; gap: 8px; }
  .diary-day:not(.has-items):not(.is-today) { display: none; }
  .diary-day h3 { flex-direction: column; align-items: flex-start; margin: 0; }
  .diary-empty { margin: 8px 0 0; text-align: left; }
}
.printer-queue em { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-style: normal; }
@media (max-width: 720px) {
  .econ-grid { grid-template-columns: 1fr; }
  .service-row { flex-direction: column; }
}

.people-approver {
  display: flex; align-items: center; gap: 10px;
  margin: -8px 0 16px; color: var(--soft); font-size: var(--text-sm);
}
.people-approver em { font-style: normal; color: var(--ink); font-weight: 700; }
.people-approver-faces { display: flex; }
.people-approver-faces .avatar { margin-left: -8px; box-shadow: 0 0 0 2px #fff; }
.people-approver-faces .avatar:first-child { margin-left: 0; }
.people-work {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start;
  margin-bottom: 20px;
}
.people-work > .panel { margin-bottom: 0; }
.offcal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.offcal-title { text-align: center; min-width: 0; }
.offcal-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.03em; }
.off-key { display: flex; justify-content: center; gap: 12px; margin: 4px 0 0; color: var(--soft); font-size: 12px; font-weight: 700; }
.off-key span { display: inline-flex; align-items: center; gap: 6px; }
.off-key span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--live); }
.off-key .is-wait::before { background: var(--warn); }
.offcal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.offcal-dow { text-align: center; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding-bottom: 2px; }
.offcal-empty { min-height: 72px; }
.offcal-day {
  min-height: 72px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  padding: 8px 6px; text-align: left; color: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 6px;
}
.offcal-day:hover { border-color: var(--line-firm); }
.offcal-day b { font-family: var(--display); font-size: 15px; line-height: 1; font-weight: 700; }
.offcal-day.is-weekend { background: var(--surface-1); }
.offcal-day.is-off { background: var(--live-soft); border-color: #b7d5de; }
.offcal-day.is-wait { background: var(--warn-soft); border-color: #ead9b4; }
.offcal-day.is-off.is-wait { background: linear-gradient(180deg, var(--live-soft) 0 46%, var(--warn-soft) 54% 100%); }
.offcal-day.is-today b { color: var(--red); }
.offcal-day.is-picked { box-shadow: inset 0 0 0 2px var(--red); }
.off-faces { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.off-faces b { font-size: 11px; color: var(--soft); font-family: var(--sans); }
.off-face.is-mine .avatar { box-shadow: 0 0 0 2px var(--red); }
.off-face.is-wait .avatar { box-shadow: 0 0 0 2px var(--warn); }
.off-face.is-mine.is-wait .avatar { box-shadow: 0 0 0 2px var(--warn); }
.off-request { display: flex; flex-direction: column; gap: 16px; }
.off-day h3 { margin: 2px 0 10px; font-size: 22px; letter-spacing: -0.03em; }
.off-people, .off-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.off-people li, .off-list li { display: flex; align-items: center; gap: 10px; }
.off-people li > span, .off-list li > span { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.off-people em, .off-list em, .off-chip { font-style: normal; }
.off-people em, .off-list em { color: var(--soft); font-size: 12px; }
.off-state { font-weight: 700; }
.off-state.is-ok { color: var(--live); }
.off-state.is-wait { color: var(--warn); }
.off-wait-note { margin: 8px 0 0; color: var(--warn); font-size: 13px; font-weight: 700; }
.off-form { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.off-form > p, .off-mine p { margin: 0; font-size: 13px; font-weight: 700; }
.off-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.off-hint { margin: 0; color: var(--soft); font-size: 13px; font-weight: 500; }
.off-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.off-chip {
  display: inline-flex; align-items: center; gap: 4px; background: var(--live-soft); color: var(--live);
  border-radius: var(--radius-pill); padding: 4px 4px 4px 10px; font-size: 12px; font-weight: 700;
}
.off-chip.is-wait { background: var(--warn-soft); color: var(--warn); }
.off-chip i { font-style: normal; font-weight: 700; opacity: 0.8; }
.off-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; line-height: 1; padding: 0 4px; }
.off-queue-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.off-queue-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; }
.off-queue-head span { color: var(--warn); font-size: 13px; font-weight: 700; }
.off-queue ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.off-queue li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid #ead9b4; border-radius: 14px; background: var(--warn-soft);
}
.off-queue li > .avatar { flex: none; }
.off-queue li > span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.off-queue li > .off-queue-actions { display: flex; flex-direction: row; flex: none; width: auto; gap: 8px; }
.off-queue li em { font-style: normal; color: var(--soft); font-size: 13px; }
.people-roster { margin-top: 4px; }
.people-roster-head { margin-bottom: 12px; }
.people-roster-head h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.03em; }
.people-roster-head p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: var(--soft); font-size: 13px; }
.people-roster-head .ico { color: var(--live); }
.mate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.mate-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: #fff;
  text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
.mate-card:hover { border-color: var(--line-firm); box-shadow: var(--shadow-lift); }
.mate-face { position: relative; display: inline-flex; grid-row: span 2; }
.presence {
  position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%;
  background: #c5d0da; border: 2px solid #fff;
}
.presence.is-on { background: #1f9d55; }
.mate-copy { display: flex; flex-direction: column; min-width: 0; }
.mate-copy strong { font-size: 16px; letter-spacing: -0.02em; }
.mate-copy em { font-style: normal; color: var(--soft); font-size: 13px; }
.mate-status { color: var(--faint); font-size: 12px; font-weight: 700; }
.mate-status.is-on { color: var(--ok); }
.mate-tenure { color: var(--soft); font-size: 12px; grid-column: 2; }
.award-pip {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px 0 6px;
  border-radius: var(--radius-pill); background: var(--live-soft); color: var(--live);
  font-size: 12px; font-weight: 700;
}
.award-pip em { font-style: normal; }
.mate-awards { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.people-back { margin-bottom: 12px; }
.mate-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(180px, 280px); gap: 16px; align-items: center; }
.mate-hero h1 { margin: 0; font-size: 28px; }
.tenure-block { background: var(--surface-1); border-radius: var(--radius-lg); padding: 14px 16px; }
.tenure-block strong { display: block; font-family: var(--display); font-size: 22px; letter-spacing: -0.03em; }
.tenure-block span { color: var(--soft); font-size: 13px; }
.people-split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; }
.award-list { display: flex; flex-direction: column; gap: 10px; }
.award {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-1);
}
.award.is-on { background: var(--live-soft); border-color: #b7d5de; }
.award-ico {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  background: #fff; color: var(--faint);
}
.award.is-on .award-ico { color: var(--live); }
.award strong { display: block; }
.award p, .award em { margin: 2px 0 0; color: var(--soft); font-size: 13px; }
.award em { font-style: normal; font-weight: 700; color: var(--ink); }
.hire-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.hire-form .field { flex: 1 1 180px; }
@media (max-width: 1100px) {
  .people-work, .people-split, .mate-hero { grid-template-columns: 1fr; }
  .off-queue li { flex-wrap: wrap; }
  .off-queue li > .off-queue-actions { width: 100%; justify-content: flex-end; }
}
