:root {
  --bg: #f4f2f0;
  --paper: #fff;
  --ink: #1b1917;
  --soft: #6e6862;
  --faint: #938c84;
  --line: #e8e3dd;
  --line-firm: #d9d2c9;
  --wash: #efece8;

  /* красный — только бренд и главное действие */
  --red: #c0121b;
  --red-dark: #990d15;
  --red-soft: #fdf0ef;

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

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

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

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

  --shadow: 0 1px 2px rgba(20, 20, 20, 0.04);
  --sans: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  --serif: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
}
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red);
  z-index: 40;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--sans); font-weight: 700; letter-spacing: -0.03em; margin: 0; }
h1 { font-size: 32px; line-height: 1.15; }
h2 { font-size: 18px; line-height: 1.3; }
p { margin: 0; }
::selection { background: #f7d5d3; }
svg.lucide { width: 18px; height: 18px; stroke: currentColor; flex: none; display: block; }
.ico { display: inline-grid; place-items: center; line-height: 0; flex: none; }
.btn svg.lucide, .nav-link svg.lucide, .text-btn svg.lucide { width: 18px; height: 18px; }
.btn.small svg.lucide { width: 14px; height: 14px; }

.app { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background:
    linear-gradient(180deg, #fff 0%, #fbfaf8 100%);
  color: var(--ink);
  border-right: 1px solid var(--line);
  padding: 20px 12px 14px;
}
.brand {
  display: flex; gap: 11px; align-items: center; text-decoration: none; color: inherit;
  padding: 6px 8px 14px; margin: 0 2px; border-bottom: 1px solid var(--line);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-size: 17px; font-weight: 750; letter-spacing: -0.03em; }
.brand em { font-style: normal; color: var(--soft); font-size: 11.5px; letter-spacing: 0.02em; }
.mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #d31a24 0%, var(--red-dark) 100%);
  color: #fff; font-weight: 800; letter-spacing: -0.04em;
  box-shadow: 0 6px 14px rgba(192, 18, 27, 0.22);
}
.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;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); font-weight: 750;
}
.nav-link {
  display: flex; align-items: center; gap: 11px;
  text-decoration: none; color: var(--soft); font-weight: 650;
  padding: 10px 11px; border-radius: 12px;
  transition: background .15s ease, color .15s ease;
}
.nav-ico {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--wash); color: var(--soft);
}
.nav-link svg.lucide { width: 16px; height: 16px; }
.nav-link:hover { background: #f3f1ee; color: var(--ink); }
.nav-link:hover .nav-ico { background: #ebe7e2; 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(192, 18, 27, 0.08);
}
.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: 36px; height: 36px; border-radius: 10px; 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: 36px; height: 36px; border-radius: 10px; padding: 0;
}
.bell:hover { background: var(--wash); color: var(--ink); }
.bell.has-new { color: var(--red); }
.bell b {
  position: absolute; top: 2px; right: 1px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--red); color: #fff;
  font-size: 10.5px; font-weight: 750; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--paper);
}
.note-list { display: flex; flex-direction: column; gap: 2px; margin: -4px -4px 0; }
.note-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px; border-radius: 14px; text-decoration: none;
}
.note-row:hover { background: var(--wash); }
.note-row.is-new { background: var(--red-soft); }
.note-row.is-new:hover { background: #fbe7e5; }
.note-mark {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--wash); color: var(--soft);
}
.note-mark.live { background: var(--live-soft); color: var(--live); }
.note-mark.bad { background: var(--danger-soft); color: var(--danger); }
.note-row strong { display: block; font-size: 14.5px; font-weight: 700; letter-spacing: -0.02em; }
.note-row p { color: var(--soft); font-size: 13px; margin-top: 2px; }
.note-row small { display: block; margin-top: 4px; font-size: 12px; color: var(--faint); }

/* нижняя панель на телефоне */
.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: 36px 40px 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: 12px;
}
.page-head { align-items: flex-end; margin-bottom: 28px; }
.eyebrow { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.sub { color: var(--soft); margin-top: 8px; max-width: 62ch; line-height: 1.45; }
.num { font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px; padding: 10px 16px;
  background: #f3f0ec; font-weight: 650; text-decoration: none;
}
.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 { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: 0.55; cursor: wait; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--soft); font-weight: 600; }
.field.inline { min-width: 160px; }
input, select, textarea {
  width: 100%; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-weight: 500; line-height: 1.4;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192, 18, 27, 0.12);
}
.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: 16px; 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); }
.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: 750; }
.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: 750; }
.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(88px, 120px) 1fr 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: 750; 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: 750; 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: 750; }
.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; }
.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; }
.panel { border-radius: 18px; padding: 22px 24px 24px; }
.panel-head { margin-bottom: 16px; }
.panel-head h2 { font-size: 18px; white-space: nowrap; }
.panel-head .search { flex: 1 1 auto; max-width: 280px; }
.pad { padding: 8px 4px 16px; }
.live-row, .event, .queue-row, .ledger-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px;
  align-items: center; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none;
}
.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); }

/* рабочая зона мастера */
.zone-head { margin-bottom: 20px; }
.work-card {
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  padding: 20px 22px 22px; margin-bottom: 18px; 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-kicker {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 750; color: var(--soft);
}
.work-card.is-live .work-kicker { color: var(--live); }
.work-card h2 { font-size: 28px; line-height: 1.15; margin: 6px 0 4px; }
.work-project {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; font-weight: 700; color: var(--ink);
}
.work-project:hover { color: var(--red); }
.work-timer { font-size: 44px; font-weight: 750; letter-spacing: -0.04em; color: var(--live); line-height: 1.05; margin-top: 10px; }
.work-badge {
  display: inline-block; margin-top: 10px; padding: 4px 11px; 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: 12px 18px; margin: 16px 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: 2px 0 0; font-weight: 650; }
.work-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn.big { padding: 14px 22px; font-size: 15.5px; border-radius: 14px; }
.work-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.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; }
.work-row span { display: block; font-size: 13.5px; color: var(--soft); }
.work-row small { display: block; font-size: 12.5px; color: var(--faint); }
.work-row.late { box-shadow: inset 3px 0 0 var(--red); padding-left: 10px; }
.work-row.is-wait { opacity: 0.72; }
.work-bar, .work-bar-space { display: none; }

.seg { display: inline-flex; align-items: center; background: #fff; border-radius: 999px; 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: 8px 12px; border-radius: 999px; color: var(--soft); font-weight: 650;
  line-height: 1; min-height: 34px;
}
.seg a.active, .seg button.active { background: var(--red); color: #fff; }
.seg svg.lucide, .seg .ico { width: 15px; height: 15px; flex: none; display: block; }
.toolbar { align-items: center; gap: 8px; flex-wrap: wrap; }
.type-select {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 14px; color: var(--ink); font-weight: 650; min-width: 190px; min-height: 40px;
}
.toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 12px; color: var(--soft); font-weight: 650; line-height: 1; min-height: 40px;
}
.toggle:hover { border-color: var(--line-firm); color: var(--ink); }
.toggle.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.toggle svg.lucide, .toggle .ico { width: 15px; height: 15px; flex: none; display: block; }

.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: 750;
  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: #f3f0ec; 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: 750;
  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; margin-bottom: 22px;
}
.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: 18px; 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: 750; padding: 12px 14px;
  border-bottom: 1px solid var(--line); background: #fbfaf8; 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: 750; 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: 750; 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: 750; 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-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-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: 750; 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: 750; 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: 750;
  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: 16px; padding: 12px 14px 12px; 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: 750; 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: 750; 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: 750; 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: 750;
}
.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: 750; }
.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: 18px; font-weight: 750; letter-spacing: -0.03em; }
.chips { display: flex; flex-direction: column; gap: 6px; }
.chip {
  text-decoration: none; border-radius: 12px; 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; }

.route-panel { margin-bottom: 20px; }
.route-pct {
  flex: none; font-size: 13px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--live); background: var(--live-soft);
  padding: 6px 10px; border-radius: 999px; 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: 2px;
}
.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: 14px; }
.stage-item:last-child .stage-rail::before { bottom: calc(100% - 14px); }
.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; padding: 0 0 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.stage-item:last-child .stage-main { padding-bottom: 0; }
.stage-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.stage-title strong {
  font-size: 13.5px; font-weight: 750; letter-spacing: -0.02em; min-width: 0;
}
.stage-title .tkt-tag { display: inline; margin-left: 4px; font-size: 10px; }
.stage-state {
  flex: none; font-size: 10.5px; font-weight: 750; font-style: normal;
  color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em;
}
.stage-item.is-done .stage-state { color: var(--ok); }
.stage-item.is-current .stage-state { color: var(--live); }
.stage-item.is-current .stage-title strong { color: var(--live); }
.stage-info {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px;
  color: var(--soft); font-size: 12px; line-height: 1.3;
}
.stage-info em, .stage-info small { font-style: normal; color: var(--soft); }
.stage-who { color: var(--ink); font-weight: 650; }
.stage-who.muted { color: var(--faint); font-weight: 500; }
.stage-timer { color: var(--live); font-weight: 750; font-size: 13px; }
.stage-info .assignee-btn {
  margin: 0; padding: 4px 8px; gap: 6px;
  width: auto; max-width: 100%; border-radius: 10px;
}
.stage-info .assignee-btn .ico { width: 12px; height: 12px; flex: none; }
.stage-info .assignee-copy strong { font-size: 12.5px; }
.stage-info .assignee-copy small { font-size: 11px; }
.callout, .hero { border-radius: 18px; padding: 22px 24px; margin-bottom: 20px; }
.callout.action, .hero { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.callout.danger { background: var(--danger-soft); border-color: #f1cdd7; }
.callout.ok { background: var(--ok-soft); border-color: #cfe7d8; color: #0f5133; }
.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: #faf9f8; }
.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-list { display: flex; flex-direction: column; }
.history-date { margin: 8px 0 0; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); font-weight: 700; }
.history-item { display: grid; grid-template-columns: 64px 16px minmax(0, 1fr); gap: 12px; padding: 12px 0 0; }
.history-item time { color: var(--soft); font-size: 13px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.history-rail { position: relative; display: flex; justify-content: center; }
.history-rail i { width: 8px; height: 8px; border-radius: 99px; background: var(--ink); display: block; margin-top: 6px; position: relative; z-index: 1; }
.history-rail.is-bad i { background: var(--danger); }
.history-rail::after { content: ""; position: absolute; top: 16px; bottom: -12px; left: 50%; width: 1px; background: var(--line); }
.history-item.is-last .history-rail::after { display: none; }
.history-item p { margin-top: 6px; line-height: 1.45; }
.history-item small { display: block; margin-top: 4px; color: var(--soft); }
.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: 750; 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: 750; letter-spacing: -0.04em; }
.queue-row { grid-template-columns: 1fr auto; }
.ledger-row { grid-template-columns: 140px 1fr auto; }

.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; }


/* кастомные выпадающие списки */
.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: 12px;
  min-height: 48px; text-align: left;
}
.combo-trigger {
  padding: 10px 12px 10px 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: 0 0 0 3px rgba(192, 18, 27, 0.12); }
.combo-value { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.combo-value strong { font-size: 14.5px; font-weight: 700; letter-spacing: -0.02em; }
.combo-value small { color: var(--soft); font-size: 12px; }
.combo-trigger svg.lucide { width: 16px; height: 16px; 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: 12px; flex: 1; min-width: 0;
  padding: 12px 8px 12px 14px;
}
.combo-caret {
  width: 34px; height: 34px; border: 0; border-radius: 10px; 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-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.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 18px; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
.wizard-nav button {
  width: 100%; display: flex; align-items: center; gap: 12px;
  text-align: left; border: 1px solid var(--line); background: var(--paper);
  border-radius: 14px; padding: 12px 14px;
}
.wizard-nav button:disabled { opacity: 0.55; cursor: default; }
.wizard-nav button b {
  width: 28px; height: 28px; border-radius: 999px; flex: none;
  display: grid; place-items: center;
  background: var(--wash); color: var(--soft); font-size: 13px; font-weight: 800;
}
.wizard-nav button strong { display: block; font-size: 14px; font-weight: 750; 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 { border-color: #c9dfd4; background: var(--ok-soft); }
.wizard-nav li.is-done button b { background: var(--ok); color: #fff; }
.wizard-nav li.is-current button {
  border-color: var(--red); background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(192, 18, 27, 0.08);
}
.wizard-nav li.is-current button b { background: var(--red); color: #fff; }
.wizard-panel .panel-head { align-items: flex-start; }
.wizard-panel .panel-head > div h2 { margin-top: 4px; }
.wizard-type-pill {
  display: inline-flex; align-items: center;
  border-radius: 999px; padding: 6px 12px;
  background: var(--wash); font-size: 13px; font-weight: 700;
}
.wizard-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line);
}
.wizard-choice span { display: block; color: var(--soft); font-size: 12px; }
.wizard-choice strong { display: block; font-size: 18px; letter-spacing: -0.03em; }
.wizard-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.wizard-summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  margin-bottom: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.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; }
.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); }

.team-summary article span { display: inline-flex; align-items: center; gap: 6px; }
.team-summary article.is-ok { box-shadow: inset 0 -3px 0 var(--ok); }
.team-summary article.is-live { box-shadow: inset 0 -3px 0 var(--live); }
.team-alert { margin-bottom: 16px; }
.team-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 14px; 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%; }
.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;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 8px; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 750; letter-spacing: 0.02em;
}
.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); }
.team-free { margin-bottom: 16px; }
.team-free .panel-head { margin-bottom: 12px; }
.team-free .panel-head h2 { display: inline-flex; align-items: center; gap: 8px; }
.free-strip {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px;
}
.free-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  background: #fafafa; display: flex; flex-direction: column; gap: 4px;
}
.free-card.has-work { background: var(--ok-soft); border-color: #c9dfd4; }
.free-card strong { font-size: 14px; }
.free-card span, .free-card em { color: var(--soft); font-size: 12px; font-style: normal; }
.free-card a, .free-card em {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 6px; text-decoration: none; font-weight: 650; color: var(--ink);
}
.free-card a:hover { color: var(--live); }
.now-slot .btn { margin-top: 10px; }

.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: #faf9f8;
  border-radius: 14px; padding: 12px 14px;
}
.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(192, 18, 27, 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: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; 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: 16px;
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #fff;
}
.settings-person strong, .settings-person span, .settings-person em { display: block; }
.settings-person span, .settings-person 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(230px, 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); }
.type-card {
  text-align: left; border-radius: 14px; border: 1px solid var(--line); background: #faf9f8; padding: 16px 18px; min-height: 92px;
}
.type-card:hover { border-color: var(--line-firm); }
.type-card.active { border-color: var(--red); background: var(--red-soft); box-shadow: 0 0 0 3px rgba(192, 18, 27, 0.08); }
.type-card span { display: block; color: var(--soft); font-size: 13px; margin-top: 6px; font-weight: 500; line-height: 1.4; }
.type-card em { display: block; margin-top: 8px; font-style: normal; color: var(--faint); font-size: 12px; font-weight: 650; }
.live-search { margin-bottom: 14px; }
.live-search-input { width: 100%; max-width: none; font-size: 16px; padding: 14px 16px; border-radius: 14px; }
.route { display: flex; flex-direction: column; }
.route-row { display: grid; grid-template-columns: 32px minmax(140px, 0.7fr) minmax(240px, 1.3fr); gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.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: 20px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.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%;
  display: flex; align-items: center; gap: 12px;
  text-align: left; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px;
}
.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: 16px; padding: 14px 16px;
  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(192, 18, 27, 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: 750; 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: 750; 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: 20px;
  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: 12px;
  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: 800; flex: none;
  letter-spacing: -0.03em;
}
.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: 20px; padding: 22px 24px 24px;
  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: 24px; }
.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; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 30; }
.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); }
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.profile-head h1 { margin-top: 2px; }
.rate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rate-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #faf9f8; }
.rate-card span { display: block; color: var(--soft); font-size: 13px; margin-bottom: 6px; }
.rate-card strong { display: block; font-size: 20px; font-weight: 700; letter-spacing: -0.03em; }
.months { display: flex; flex-direction: column; }
.month-block { border-top: 1px solid var(--line); }
.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: 14px 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 4px; }
: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); }
  .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; }
  .dash-grid, .dash-grid.three { grid-template-columns: 1fr; }
  .chart-donut { grid-template-columns: 1fr; justify-items: center; }
  .login-aside { padding: 32px; }
  .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; }
  .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; }
  .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 { grid-template-columns: 1fr; }
  .wizard-summary { grid-template-columns: 1fr 1fr; }
  .wizard-foot, .create-foot { align-items: stretch; flex-direction: column; }
  .wizard-actions { width: 100%; }
  .wizard-actions .btn { flex: 1; justify-content: center; }
  .team-toolbar .search-field { max-width: none; }
  .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: 16px;
    padding: 14px; 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: 750;
  }
  .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)); }
  .panel { padding: 16px 14px 18px; }
  .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 { left: 12px; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); }
  .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 {
    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 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: 20px; height: 20px; 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(192, 18, 27, 0.22); }
  .work-bar-space { display: block; height: 76px; }
  .zone-head .head-actions { display: none; }
  .work-card .work-actions .btn.primary { display: none; }
  .work-card h2 { font-size: 24px; }
  .work-timer { font-size: 38px; }
  .work-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .work-row .btn { width: 100%; justify-content: center; }
  .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; }
}
