:root {
  color-scheme: dark;
  --ink: #e8ecf4;
  --muted: #93a0b4;
  --faint: #5d6880;
  --bg: #07090d;
  --line: rgba(255, 255, 255, 0.055);
  --line-strong: rgba(255, 255, 255, 0.14);
  --panel: #12161f;
  --brand: #f0820f;
  --brand-dark: #f59a3d;
  --brand-deep: #d97008;
  --brand-soft: rgba(240, 130, 15, 0.14);
  --morning: #d4a843;
  --morning-soft: rgba(212, 168, 67, 0.15);
  --afternoon: #38bdf8;
  --afternoon-soft: rgba(56, 189, 248, 0.13);
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, 0.13);
  --warning: #d4a843;
  --warning-soft: rgba(212, 168, 67, 0.15);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --note: #6ea8e8;
  --note-soft: rgba(110, 168, 232, 0.13);
  --phone: #8b5cf6;
  --phone-soft: rgba(139, 92, 246, 0.18);
  --sidebar: #0b0e14;
  --sidebar-panel: #12161f;
  --sidebar-line: rgba(255, 255, 255, 0.07);
  --row: #161b26;
  --row-hover: #1b2230;
  --hairline: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --glow: 0 0 0 1px rgba(240, 130, 15, 0.18), 0 10px 30px rgba(240, 130, 15, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.28);
  --shadow-lift: 0 24px 60px rgba(0, 0, 0, 0.6);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.09);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
  background-clip: padding-box;
}

::selection {
  background: rgba(240, 130, 15, 0.3);
  color: #fff;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* ---------- Layout ---------- */

.app-shell {
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100vh;
  padding: 22px 18px;
  overflow-y: auto;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  color: #f2f5f3;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 22px 28px 32px;
}

/* ---------- Brand ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 4px 8px;
}

.brand-mark {
  display: grid;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(140deg, #f0820f, var(--brand-deep));
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-logo {
  display: block;
  object-fit: contain;
  background: none;
  border-radius: 0;
}

.brand h1 {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.brand p {
  font-size: 12px;
  color: rgba(242, 245, 243, 0.55);
}

/* ---------- Panels ---------- */

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow), var(--hairline);
}

.sidebar .panel {
  border-color: var(--sidebar-line);
  background: var(--sidebar-panel);
  box-shadow: none;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar .section-title {
  color: rgba(242, 245, 243, 0.5);
}

.section-title strong {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
}

.sidebar .section-title strong {
  color: #f2f5f3;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Inputs and buttons ---------- */

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.sidebar label {
  color: rgba(242, 245, 243, 0.6);
}

input,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #0d1118;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(240, 130, 15, 0.2);
}

.sidebar input {
  border-color: var(--sidebar-line);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.sidebar input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(240, 130, 15, 0.25);
}

.sidebar input::placeholder {
  color: rgba(242, 245, 243, 0.35);
}

#zipInput {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.rush-toggle {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid var(--sidebar-line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-weight: 500;
}

.rush-toggle input {
  width: auto;
  margin-top: 2px;
  accent-color: #d9952f;
}

.rush-toggle span {
  font-size: 11.5px;
  line-height: 1.45;
  color: rgba(242, 245, 243, 0.6);
}

.rush-toggle strong {
  color: #f0b95c;
}

.rush-toggle:has(input:checked) {
  border-color: #d9952f;
  background: rgba(217, 149, 47, 0.12);
}

.primary-btn {
  width: 100%;
  margin-top: 10px;
  padding: 11px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(140deg, #f0820f, var(--brand-deep));
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  transition: filter 0.15s, transform 0.05s;
}

.primary-btn:hover {
  filter: brightness(1.08);
}

.primary-btn:active {
  transform: translateY(1px);
}

.ghost-btn {
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s;
}

.ghost-btn:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}

.sidebar .ghost-btn {
  border-color: var(--sidebar-line);
  background: rgba(255, 255, 255, 0.06);
  color: #f2f5f3;
}

.sidebar .ghost-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.sidebar .ghost-btn.subtle {
  background: transparent;
  color: rgba(242, 245, 243, 0.55);
}

.full-width {
  width: 100%;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.copy-btn {
  padding: 5px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  transition: background 0.15s;
}

.copy-btn:hover:not(:disabled) {
  background: var(--brand-soft);
}

.copy-btn:disabled {
  color: var(--faint);
  cursor: not-allowed;
}

.icon-btn {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
}

.icon-btn:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.form-error {
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
}

/* ---------- Login ---------- */

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(240, 130, 15, 0.22), transparent 60%),
    radial-gradient(700px 420px at 10% 110%, rgba(240, 130, 15, 0.1), transparent 55%),
    var(--bg);
}

.login-card {
  display: flex;
  width: min(380px, 100%);
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-lift);
}

.login-card .brand-mark {
  width: 48px;
  height: 48px;
}

.login-card h2 {
  font-size: 24px;
  line-height: 1.1;
}

.login-card .primary-btn {
  margin-top: 0;
}

/* ---------- Route card ---------- */

.status-chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px !important;
}

.status-chip.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.route-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--sidebar-line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.route-card span {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.route-card p {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(242, 245, 243, 0.6);
}

/* ---------- Daily load ---------- */

.day-panel input[type="date"] {
  width: auto;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
}

.daily-board {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.load-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.load-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(242, 245, 243, 0.65);
}

.load-head strong {
  font-size: 13px;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
  transition: width 0.35s ease;
}

.bar span.warning {
  background: #d9952f;
}

.bar span.hot {
  background: #d65745;
}

.total-load {
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px dashed var(--sidebar-line);
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}

.topbar h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.last-updated {
  font-size: 12px;
  color: var(--faint);
}

.alert-banner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px 16px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
  background: var(--danger-soft);
}

.alert-banner-head strong {
  font-size: 13px;
  color: var(--danger);
}

.alert-item {
  display: flex;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
}

.alert-when {
  flex-shrink: 0;
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.alert-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.alert-body strong {
  font-size: 13px;
  color: var(--ink);
}

.alert-body span {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.alert-body .alert-addr {
  font-size: 11.5px;
  color: var(--faint);
}

.overload-banner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px 16px;
  border: 1px solid rgba(212, 168, 67, 0.4);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius);
  background: var(--warning-soft);
}

.overload-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.overload-head strong {
  font-size: 13px;
  color: var(--warning);
}

.overload-head span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.overload-days {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overload-day {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
}

.ovd-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.ovd-head b {
  color: var(--danger);
  font-variant-numeric: tabular-nums;
}

.ovd-head i,
.ovd-zone i {
  font-style: normal;
  font-weight: 500;
  color: var(--faint);
}

.ovd-zone {
  margin-top: 3px;
  padding-left: 12px;
  font-size: 12px;
  color: var(--muted);
}

.ovd-zone b {
  color: var(--warning);
  font-variant-numeric: tabular-nums;
}

.overload-more {
  font-size: 11.5px;
  color: var(--faint);
}

.import-age {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.import-age.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.import-age.stale {
  background: var(--warning-soft);
  color: var(--warning);
}

/* ---------- Metrics ---------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(165deg, #181d29, #11151d);
  box-shadow: var(--shadow), var(--hairline);
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(var(--brand), var(--brand-deep));
  opacity: 0.85;
}

.metric strong {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
}

.metric span {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- Content grid ---------- */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Recommendations ---------- */

.recommendations {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 2px;
}

.empty-state {
  display: grid;
  min-height: 120px;
  place-items: center;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--faint);
  text-align: center;
}

.small-empty {
  min-height: 70px;
}

.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--row);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.option:hover {
  border-color: rgba(240, 130, 15, 0.4);
  background: var(--row-hover);
}

.option.best {
  border-color: rgba(240, 130, 15, 0.55);
  background: linear-gradient(120deg, rgba(240, 130, 15, 0.12), rgba(240, 130, 15, 0.02));
  box-shadow: var(--glow);
}

.option h3 {
  font-size: 14px;
  font-weight: 700;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.option.best .score-pill {
  border-color: rgba(240, 130, 15, 0.4);
  background: rgba(240, 130, 15, 0.12);
  color: var(--brand);
}

.option.best h3 {
  color: #fff;
}

.option p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.option .score-reasons {
  margin-top: 2px;
  color: var(--faint);
  font-size: 11.5px;
}

.option-actions {
  flex-shrink: 0;
}

.cluster-note {
  color: var(--ok);
  font-weight: 700;
}

.option.override {
  border-color: rgba(185, 119, 24, 0.45);
  background: var(--warning-soft);
}

.option.override.best {
  border-color: var(--warning);
}

.override-note {
  color: var(--warning);
  font-weight: 700;
}

.override-note.soft {
  font-weight: 600;
}

.board-rush {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--warning-soft);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--warning);
  white-space: nowrap;
}

.board-pending {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed var(--line-strong);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.board-row.pending-window {
  opacity: 0.72;
}

.cal-chip.pending {
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--line-strong);
  border-left: 3px dashed var(--faint);
  color: var(--faint);
}

.shift-btn {
  padding: 8px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}

.shift-btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.shift-btn:active {
  transform: translateY(1px);
}

.option.best .shift-btn {
  background: linear-gradient(140deg, #f0820f, var(--brand-deep));
  border-color: transparent;
  color: #fff;
}

.option.best .shift-btn:hover {
  filter: brightness(1.08);
}

/* ---------- Email copy ---------- */

.email-panel textarea {
  resize: vertical;
  min-height: 110px;
  border-color: var(--line);
  background: var(--row);
  font-size: 13px;
  line-height: 1.6;
}

/* Internal-only "best for us" marker — shown in the office UI, never in the copied text. */
.best-for-us {
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(245, 200, 66, 0.14);
  border: 1px solid rgba(245, 200, 66, 0.45);
  color: var(--ink, #5a4a00);
  font-size: 12px;
  font-weight: 600;
}

.offer-ref {
  width: 100%;
  margin-bottom: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--row);
  font-size: 12px;
}
.offer-note {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted, #8a8a8a);
}
.pending-offers { margin-top: 10px; }
.pending-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #8a8a8a);
  margin-bottom: 6px;
}
.pending-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(120, 160, 255, 0.10);
  border: 1px solid rgba(120, 160, 255, 0.30);
  font-size: 12px;
  margin-bottom: 6px;
}
.release-btn {
  border: none;
  background: transparent;
  color: var(--danger, #d65a5a);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* Inspector ETAs — embedded board (same engine as the standalone /eta-board.html) */
.eta-dialog { width: min(1120px, 95vw); max-width: 1120px; }
.eta-frame {
  width: 100%;
  height: min(74vh, 780px);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: block;
}

/* ---------- Insights ---------- */

.insight-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.insight {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 12px;
}

.insight strong {
  font-size: 12.5px;
}

.insight span {
  color: var(--muted);
  line-height: 1.5;
}

.insight.ok {
  background: var(--ok-soft);
  border-color: rgba(31, 138, 85, 0.25);
}

.insight.ok strong {
  color: var(--ok);
}

.insight.warning {
  background: var(--warning-soft);
  border-color: rgba(185, 119, 24, 0.3);
}

.insight.warning strong {
  color: var(--warning);
}

.insight.danger {
  background: var(--danger-soft);
  border-color: rgba(192, 57, 43, 0.3);
}

.insight.danger strong {
  color: var(--danger);
}

.insight.note {
  background: var(--note-soft);
  border-color: rgba(59, 95, 192, 0.25);
}

.insight.note strong {
  color: var(--note);
}

/* ---------- Nearby zones ---------- */

.nearby-zones {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nearby-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  transition: border-color 0.15s, background 0.15s;
}

.nearby-chip:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}

.nearby-chip strong {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.nearby-chip span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
}

.nearby-chip.paired strong {
  color: var(--brand);
}

.nearby-chip.near strong {
  color: var(--afternoon);
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted);
  white-space: nowrap;
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--row-hover);
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.morning {
  background: var(--morning-soft);
  color: var(--morning);
}

.pill.afternoon {
  background: var(--afternoon-soft);
  color: var(--afternoon);
}

.work-link {
  padding: 0;
  border: none;
  background: none;
  font-weight: 700;
  color: var(--brand);
  text-decoration: underline;
  text-decoration-color: rgba(240, 130, 15, 0.3);
  text-underline-offset: 3px;
}

.work-link:hover {
  text-decoration-color: var(--brand);
}

.delete-btn {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-size: 14px;
  line-height: 1;
  color: var(--faint);
  transition: all 0.15s;
}

.delete-btn:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

/* ---------- Appointments board ---------- */

.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.board-toolbar input {
  flex: 1;
  min-width: 220px;
}

.board-filter-group {
  display: flex;
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  overflow: hidden;
}

.board-filter-group button {
  padding: 8px 14px;
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.board-filter-group button:hover {
  color: var(--ink);
}

.board-filter-group button.active {
  background: var(--brand);
  color: #ffffff;
}

.appointments-board {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 580px;
  overflow-y: auto;
  padding-right: 4px;
}

.board-day-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 4px;
  background: var(--panel);
  border-bottom: 2px solid var(--line-strong);
}

.board-day-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
}

.day-tag {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.day-tag.soft {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.pill.neutral {
  background: var(--row-hover);
  color: var(--muted);
}

.board-day-chips {
  display: flex;
  gap: 6px;
}

.board-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}

.board-row:last-child {
  border-bottom: none;
}

.board-row:hover {
  background: var(--row-hover);
}

.board-row.no-appointment {
  background: var(--row);
}

.board-row.no-appointment .work-link {
  color: #334155;
}

.board-zone {
  flex-shrink: 0;
  width: 42px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.board-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.board-main .work-link {
  align-self: flex-start;
  font-size: 13.5px;
}

.board-address {
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-source {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.board-source.import {
  background: var(--note-soft);
  color: var(--note);
}

.board-source.manual {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.board-source.hub {
  background: var(--ok-soft);
  color: var(--ok);
}

.board-source.phone {
  background: var(--phone-soft);
  color: var(--phone);
}

.board-source.job {
  background: var(--row-hover);
  color: var(--muted);
}

.ghost-delete {
  visibility: hidden;
}

.board-row .delete-btn {
  opacity: 0;
}

.board-row:hover .delete-btn,
.board-row .delete-btn:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .board-row .delete-btn {
    opacity: 1;
  }
}

@media (max-width: 540px) {
  .board-source {
    display: none;
  }

  .board-toolbar input {
    min-width: 100%;
  }
}

/* ---------- Overlays ---------- */

.overlay[hidden] {
  display: none;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
}

.dialog {
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-lift);
}

.table-dialog {
  width: min(1080px, 100%);
}

.work-detail-dialog {
  width: min(560px, 100%);
}

/* ---------- Booking dialog ---------- */

.booking-summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 14px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  border: 1px solid rgba(240, 130, 15, 0.25);
}

.booking-summary strong {
  font-size: 15px;
  color: var(--brand-dark);
}

.booking-summary span {
  font-size: 12px;
  color: var(--muted);
}

.job-suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.job-suggestion {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--row);
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.job-suggestion:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}

.job-suggestion strong {
  font-size: 13px;
}

.job-suggestion span {
  font-size: 11.5px;
  color: var(--muted);
}

.selected-job-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 10px;
  padding: 11px 13px;
  border: 1px solid rgba(240, 130, 15, 0.3);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  font-size: 12px;
  color: var(--muted);
}

.selected-job-card strong {
  font-size: 13px;
  color: var(--brand-dark);
}

/* ---------- Work detail ---------- */

.work-detail-hero {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 14px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  border: 1px solid rgba(240, 130, 15, 0.25);
}

.work-detail-hero strong {
  font-size: 16px;
  color: var(--brand-dark);
}

.work-detail-hero span {
  font-size: 12px;
  color: var(--muted);
}

.work-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
}

.work-detail-grid dt {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
}

.work-detail-grid dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: break-word;
}

/* ---------- Admin ---------- */

.admin-dialog {
  width: min(680px, 100%);
}

.admin-key-dialog {
  width: min(380px, 100%);
}

.admin-key-dialog .primary-btn {
  margin-top: 0;
}

.compact-title {
  margin-bottom: 8px;
}

.admin-hub-box,
.admin-import-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-hub-box {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.hub-login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.hub-login-grid .ghost-btn {
  height: 42px;
}

.hub-sync-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(180px, 1fr);
  align-items: end;
  gap: 10px;
}

.hub-sync-row .primary-btn {
  height: 42px;
  margin-top: 0;
}

@media (max-width: 720px) {
  .hub-login-grid,
  .hub-sync-row {
    grid-template-columns: 1fr;
  }
}

.admin-import-box input[type="file"] {
  padding: 8px;
  font-size: 13px;
}

.import-status {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.import-preview {
  padding: 11px 13px;
  border: 1px solid rgba(240, 130, 15, 0.3);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.7;
}

.preview-warning {
  font-weight: 700;
  color: var(--danger);
}

.admin-snapshots {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.snapshot-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.snapshot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--row);
}

.snapshot-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.snapshot-info strong {
  font-size: 12.5px;
}

.snapshot-info span {
  font-size: 11px;
  color: var(--faint);
}

.snapshot-restore {
  padding: 5px 12px;
  font-size: 12px;
}

/* ---------- Month calendar ---------- */

.appointments-board[hidden],
.calendar-wrap[hidden] {
  display: none;
}

.calendar-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-x: auto;
}

.calendar-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calendar-nav-group {
  display: flex;
  gap: 6px;
}

.calendar-nav-group .ghost-btn {
  padding: 6px 12px;
}

#calTitle {
  font-size: 16px;
  font-weight: 800;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.calendar-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-dot.import { background: var(--note); }
.legend-dot.hub { background: var(--ok); }
.legend-dot.manual { background: var(--brand); }
.legend-dot.phone { background: var(--phone); }

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(88px, 1fr));
  min-width: 640px;
  gap: 6px;
}

.calendar-weekdays span {
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(88px, 1fr));
  min-width: 640px;
  gap: 6px;
}

.cal-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 96px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--row);
}

.cal-cell.out {
  border-color: transparent;
  background: transparent;
}

.cal-cell.weekend {
  background: var(--bg);
}

.cal-cell.today {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.cal-daynum {
  align-self: flex-start;
  padding: 1px 7px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.cal-daynum:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.cal-cell.today .cal-daynum {
  background: var(--brand);
  color: #ffffff;
}

.cal-chip {
  display: block;
  overflow: hidden;
  width: 100%;
  padding: 3px 7px;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.cal-chip.import { background: var(--note-soft); color: var(--note); border-left-color: var(--note); }
.cal-chip.hub { background: var(--ok-soft); color: var(--ok); border-left-color: var(--ok); }
.cal-chip.manual { background: var(--brand-soft); color: var(--brand-dark); border-left-color: var(--brand); }
.cal-chip.phone { background: var(--phone); color: #ffffff; border-left-color: var(--phone); }

.cal-chip:hover {
  filter: brightness(0.94);
}

.cal-more {
  align-self: flex-start;
  padding: 2px 7px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--faint);
}

.cal-more:hover {
  background: var(--bg);
  color: var(--ink);
}

.day-detail-dialog {
  width: min(640px, 100%);
}

.day-detail-list {
  display: flex;
  flex-direction: column;
  max-height: 62vh;
  overflow-y: auto;
}

/* ---------- Phone calls inbox ---------- */

.calls-badge {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.phone-calls-dialog {
  width: min(680px, 100%);
}

.phone-calls-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 2px;
}

.call-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--row);
}

.call-row.pending {
  border-left: 3px solid var(--brand);
}

.call-row.done,
.call-row.dismissed {
  opacity: 0.6;
}

.call-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.call-head strong {
  font-size: 13px;
}

.call-status {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.call-status.pending {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.call-status.done {
  background: var(--ok-soft);
  color: var(--ok);
}

.call-status.dismissed {
  background: var(--bg);
  color: var(--faint);
}

.call-outcome {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.call-summary {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.call-summary.muted,
.call-meta {
  color: var(--faint);
}

.call-meta {
  font-size: 11.5px;
  font-weight: 700;
}

.call-details {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.call-details strong {
  color: var(--ink);
  font-size: 12.5px;
}

.call-details span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.call-transcript {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.call-transcript summary {
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.call-transcript p {
  padding: 0 10px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.call-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.call-chip {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--note-soft);
  font-size: 11px;
  font-weight: 700;
  color: var(--note);
}

.call-chip.none {
  background: var(--bg);
  color: var(--faint);
}

.call-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.call-actions .primary-btn {
  width: auto;
  margin-top: 0;
  padding: 7px 18px;
  font-size: 12.5px;
}

.call-actions .ghost-btn {
  padding: 7px 14px;
  font-size: 12.5px;
}

.call-filter {
  margin-bottom: 12px;
}

.call-filter button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-count {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.call-filter button.active .filter-count {
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

.call-note {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.call-note-input {
  resize: vertical;
  min-height: 42px;
  padding: 8px 11px;
  font-size: 12.5px;
  line-height: 1.45;
}

.call-note-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.call-note-stamp {
  font-size: 11px;
  color: var(--faint);
}

.call-note-save {
  padding: 5px 13px;
  font-size: 12px;
}

/* ---------- Fit-in finder ---------- */

.fitin-dialog {
  width: min(760px, 100%);
}

.fitin-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.fitin-steps span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--row);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.fitin-steps strong {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #ffffff;
  font-size: 11.5px;
}

#fitInSearch {
  margin-bottom: 10px;
}

.fitin-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.fitin-stat {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.fitin-stat strong {
  font-weight: 800;
  color: inherit;
}

.fitin-stat.same {
  background: var(--ok-soft);
  color: var(--ok);
}

.fitin-stat.close {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.fitin-stat.area {
  background: var(--note-soft);
  color: var(--note);
}

.fitin-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 56vh;
  overflow-y: auto;
  padding-right: 4px;
}

.fitin-tier-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 4px 6px;
  background: var(--panel);
  border-bottom: 2px solid var(--line-strong);
  margin-bottom: 8px;
}

.fitin-tier-head h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.fitin-tier-head h4 span {
  margin-left: 6px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 11px;
  color: var(--muted);
}

.fitin-tier.same .fitin-tier-head h4 {
  color: var(--ok);
}

.fitin-tier.close .fitin-tier-head h4 {
  color: var(--brand-dark);
}

.fitin-tier-head p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--faint);
}

.fitin-tier {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fitin-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--row);
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.fitin-row:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}

.fitin-tier.same .fitin-row {
  border-left: 3px solid var(--ok);
}

.fitin-tier.close .fitin-row {
  border-left: 3px solid var(--brand);
}

.fitin-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.fitin-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fitin-title strong {
  font-size: 13.5px;
}

.fitin-zone {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fitin-due-chip {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--danger-soft);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--danger);
}

.fitin-address {
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fitin-meta {
  font-size: 11.5px;
  color: var(--faint);
}

.fitin-overdue {
  font-weight: 700;
  color: var(--danger);
}

.fitin-anchor {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
  min-width: 118px;
  text-align: right;
}

.fitin-anchor strong {
  font-size: 15px;
  color: var(--ok);
  font-variant-numeric: tabular-nums;
}

.fitin-anchor span {
  font-size: 11px;
  color: var(--faint);
}

.fitin-cta {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .fitin-row {
    flex-wrap: wrap;
  }

  .fitin-main {
    flex-basis: 100%;
  }

  .fitin-anchor {
    align-items: flex-start;
    text-align: left;
  }
}

/* ---------- Reference table ---------- */

.route-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.route-chip {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid rgba(240, 130, 15, 0.2);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
}

.route-chip.fit-in {
  background: var(--afternoon-soft);
  border-color: rgba(59, 95, 192, 0.25);
  color: var(--afternoon);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 100;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: #1a2535;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar-footer {
    flex-direction: row;
    margin-top: 4px;
  }

  .workspace {
    padding: 18px 16px 28px;
  }

  .topbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 540px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .metric span {
    font-size: 19px;
  }

  .option {
    flex-direction: column;
    align-items: stretch;
  }

  .shift-btn {
    width: 100%;
  }

  .work-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
