/* ============================================================================
   OARFlow design system — premium, modern, fast. Token-driven so each tenant
   can re-skin via --brand. Used by the admin suite, booking flow, and pay page.
   ========================================================================== */
/* Smooth cross-fade between same-origin page loads (Chrome/Edge); ignored
   gracefully elsewhere. Combined with the cached admin shell, navigation
   no longer flashes/blanks. */
@view-transition { navigation: auto; }

:root {
  --brand: #0e7c4b;
  --brand-600: #0c6e43;
  --brand-700: #0a5c38;
  --brand-tint: #e7f5ee;
  --brand-tint-2: #f1faf5;

  --bg: #f3f6f4;
  --surface: #ffffff;
  --card: #ffffff;
  --surface-2: #f6f8f7;
  --ink: #132019;
  --ink-2: #3f5047;
  --muted: #68776f;
  --muted-2: #94a29b;
  --line: #dfe6e2;
  --line-2: #ebf0ed;
  --nav: #0d2118;
  --attention: #e9a923;

  --ok: #16a34a;     --ok-tint: #e8f6ec;
  --warn: #d97706;   --warn-tint: #fdf2e3;
  --danger: #dc2626; --danger-tint: #fdecec;
  --info: #2563eb;   --info-tint: #e8effd;
  --purple: #7c3aed; --purple-tint: #f1e9fe;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(13,33,24,.05), 0 5px 14px rgba(13,33,24,.04);
  --shadow: 0 12px 32px rgba(13,33,24,.08);
  --shadow-lg: 0 24px 64px rgba(13,33,24,.16);
  --ring: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
  --duration-fast: 120ms;
  --duration: 180ms;
  --ease-out: cubic-bezier(.2,.8,.2,1);

  --sidebar-w: 248px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 85% -10%, color-mix(in srgb,var(--brand) 7%,transparent), transparent 34rem),
    var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.hidden { display: none !important; }

/* --- App shell ----------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background:linear-gradient(180deg,color-mix(in srgb,var(--nav) 92%,#153a2a),var(--nav));
  color: #cbd5e1;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 19px 13px; gap: 4px;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.35) transparent;
}
.sidebar > * { flex-shrink: 0; }
.sidebar::-webkit-scrollbar { width: 7px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(148,163,184,.3); border-radius: 999px; }
.sidebar .brand {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px 18px; color: #fff;
}
.sidebar .brand .logo {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #34d399));
  display: grid; place-items: center; color: #fff; font-weight: 800; flex: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16),0 9px 24px color-mix(in srgb,var(--brand) 25%,transparent);
}
.sidebar .brand .name { font-weight: 700; font-size: 15px; line-height: 1.15; }
.sidebar .brand .name small { display:block; color:#7c8aa0; font-weight:500; font-size:11px; }
.nav-section { color: #5b6b82; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; padding: 14px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border:1px solid transparent; border-radius: 11px; color: #aab6c6; font-weight: 600;
  cursor: pointer; transition: background var(--duration-fast), color var(--duration-fast),transform var(--duration-fast),border-color var(--duration-fast); text-decoration: none;
}
.nav-link svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-link:hover { transform:translateX(2px); background: rgba(255,255,255,.055); color: #fff; text-decoration: none; }
.nav-link.active { background:linear-gradient(135deg,var(--brand),var(--brand-600)); border-color:rgba(255,255,255,.1); color: #fff; box-shadow:0 9px 24px color-mix(in srgb,var(--brand) 25%,transparent); }
.nav-link.active svg { opacity: 1; }
.nav-link .badge-count { margin-left: auto; background: rgba(255,255,255,.16); color:#fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight:700; }
.sidebar .spacer { flex: 1 0 12px; }
.sidebar .user {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 8px;
}
.sidebar .user .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color:#fff; display:grid; place-items:center; font-weight:700; font-size: 13px; }
.sidebar .user .meta { font-size: 13px; color:#e2e8f0; line-height:1.2; }
.sidebar .user .meta small { color:#7c8aa0; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 30px; background: color-mix(in srgb,var(--surface) 88%,transparent); border-bottom: 1px solid color-mix(in srgb,var(--line) 82%,transparent);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter:blur(18px) saturate(1.2);
}
.topbar h1 { font-size: 23px; letter-spacing:-.025em; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.topbar .actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.topbar .page-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.content { padding: 28px 30px 64px; max-width: 1400px; width: 100%; }
.view-root { animation:view-enter .18s var(--ease-out) both; }
@keyframes view-enter { from { opacity:.45; transform:translateY(4px); } to { opacity:1; transform:none; } }
.menu-toggle { display: none; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; align-items: center; justify-content: center; flex: none; }

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content:center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  padding: 10px 16px; border-radius: 11px; border: 1px solid transparent;
  cursor: pointer; transition: background var(--duration-fast),border-color var(--duration-fast),color var(--duration-fast),box-shadow var(--duration-fast),transform var(--duration-fast); white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background:linear-gradient(135deg,var(--brand),var(--brand-600)); color: #fff; box-shadow:0 7px 16px color-mix(in srgb,var(--brand) 19%,transparent); }
.btn-primary:hover { transform:translateY(-1px); background:linear-gradient(135deg,var(--brand-600),var(--brand-700)); box-shadow:0 9px 20px color-mix(in srgb,var(--brand) 24%,transparent); }
.btn-secondary { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); border-color: #d3dae3; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-soft { background: var(--danger-tint); color: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-xs { padding: 4px 9px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:active:not(:disabled) { transform:translateY(1px); }
.btn:focus-visible,.nav-link:focus-visible,.menu-toggle:focus-visible { outline:none; box-shadow:var(--ring); }

@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; }
}

/* --- Cards & panels ------------------------------------------------------ */
.card { background:color-mix(in srgb,var(--surface) 96%,transparent); border: 1px solid color-mix(in srgb,var(--line) 90%,transparent); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display:flex; align-items:center; gap:12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-size: 15px; }
.card-head .actions { margin-left: auto; display:flex; gap:8px; }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.between { justify-content: space-between; }

/* Stat tiles */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 600; display:flex; align-items:center; gap:8px; }
.stat .value { font-size: 28px; font-weight: 800; margin-top: 8px; letter-spacing: -0.02em; }
.stat .delta { font-size: 12px; font-weight: 600; margin-top: 6px; }
.stat .ic { width: 30px; height: 30px; border-radius: 9px; display:grid; place-items:center; background: var(--brand-tint); color: var(--brand); }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }

/* --- Tables -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background .1s; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl tr.clickable { cursor: pointer; }
.cell-strong { font-weight: 600; color: var(--ink); }

/* --- Badges & chips ------------------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; opacity:.9; }
.badge.no-dot::before { display:none; }
.badge.ok { background: var(--ok-tint); color: #15803d; border-color: transparent; }
.badge.warn { background: var(--warn-tint); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-tint); color: var(--danger); border-color: transparent; }
.badge.info { background: var(--info-tint); color: var(--info); border-color: transparent; }
.badge.purple { background: var(--purple-tint); color: var(--purple); border-color: transparent; }
.badge.neutral { background: var(--surface-2); color: var(--muted); }
.chip { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:999px; border:1px solid var(--line); background:var(--surface); font-size:13px; font-weight:600; color:var(--ink-2); cursor:pointer; }
.chip.active { background: var(--brand); border-color: var(--brand); color:#fff; }
.chip .n { opacity:.7; font-weight:600; }

/* --- Forms --------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  font-family: inherit; font-size: 14.5px; color: var(--ink); line-height: 1.3;
  padding: 11px 13px; border: 1px solid #d5dce4; border-radius: 10px; background: #fff; width: 100%;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  color-scheme: light;
  transition: border-color .12s, box-shadow .12s, background .12s;
  -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:hover, select:hover, textarea:hover { border-color: #b9c4d1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); background: #fff; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent); }
input[type=date], input[type=time], input[type=datetime-local] { cursor: pointer; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
input[type=date]::-webkit-calendar-picker-indicator:hover, input[type=time]::-webkit-calendar-picker-indicator:hover { opacity: .9; }
input[type=checkbox], input[type=radio] { -webkit-appearance: auto; appearance: auto; width: auto; box-shadow: none; accent-color: var(--brand); cursor: pointer; }
select {
  padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
textarea { resize: vertical; min-height: 84px; }
input[type=color] { padding: 4px; height: 42px; cursor: pointer; }
.input-prefix { position: relative; }
.input-prefix span { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--muted); font-size:14px; }
.input-prefix input { padding-left: 26px; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex:none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position:absolute; inset:0; background:#cbd5e1; border-radius:999px; transition:.2s; cursor:pointer; }
.switch .track::before { content:""; position:absolute; width:18px; height:18px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.2s; box-shadow: var(--shadow-sm); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 28%, transparent); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::before { transform: translateX(18px); }
.segmented { display:inline-flex; background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:3px; gap:3px; }
.segmented button { border:none; background:transparent; padding:7px 14px; border-radius:8px; font-weight:600; font-size:13px; color:var(--muted); cursor:pointer; }
.segmented button.active { background:var(--surface); color:var(--ink); box-shadow: var(--shadow-sm); }

/* Appointment creation --------------------------------------------------- */
.appointment-create-grid { display:grid; grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr); gap:24px; align-items:start; }
.appointment-when { padding:16px; margin-bottom:16px; border:1px solid color-mix(in srgb, var(--brand) 18%, var(--line)); border-radius:16px; background:linear-gradient(145deg, var(--brand-tint-2), #fff 58%); }
.appointment-when.has-error { border-color:color-mix(in srgb, var(--danger) 62%, var(--line)); box-shadow:0 0 0 3px color-mix(in srgb, var(--danger) 9%, transparent); }
.appointment-when-head { display:flex; gap:11px; align-items:flex-start; margin-bottom:15px; }
.appointment-when-head h4 { font-size:15px; }
.appointment-when-head p { margin:2px 0 0; color:var(--muted); font-size:12px; line-height:1.4; }
.appointment-when-icon { width:36px; height:36px; flex:none; display:grid; place-items:center; border-radius:11px; color:var(--brand); background:#fff; border:1px solid color-mix(in srgb, var(--brand) 16%, var(--line)); box-shadow:var(--shadow-sm); }
.appointment-date-field { margin-bottom:8px; }
.appointment-date-control { min-height:50px; display:flex; align-items:center; gap:10px; padding:0 12px; border:1px solid #cfd8e3; border-radius:12px; background:#fff; box-shadow:var(--shadow-sm); cursor:pointer; transition:border-color .12s, box-shadow .12s, transform .12s; }
.appointment-date-control:hover { border-color:color-mix(in srgb, var(--brand) 45%, #cfd8e3); transform:translateY(-1px); }
.appointment-date-control:focus-within { border-color:var(--brand); box-shadow:var(--ring); transform:none; }
.appointment-date-control.invalid { border-color:var(--danger); box-shadow:0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent); transform:none; }
.appointment-date-control .appointment-date-icon { display:grid; color:var(--brand); }
.appointment-date-control input[type=date] { flex:1; min-width:0; padding:12px 0; border:0; border-radius:0; box-shadow:none; background:transparent; font-weight:650; font-size:15px; }
.appointment-date-control input[type=date]:hover, .appointment-date-control input[type=date]:focus { border:0; box-shadow:none; background:transparent; }
.appointment-date-control input[type=date][aria-invalid=true] { color:var(--danger); }
.appointment-date-action { color:var(--brand); font-size:11px; font-weight:750; white-space:nowrap; }
.appointment-date-shortcuts { display:flex; flex-wrap:wrap; gap:6px; margin:9px 0 16px; }
.appointment-date-shortcut { border:1px solid var(--line); border-radius:999px; padding:5px 10px; color:var(--ink-2); background:#fff; font:inherit; font-size:11.5px; font-weight:650; cursor:pointer; transition:.12s; }
.appointment-date-shortcut:hover, .appointment-date-shortcut:focus-visible { border-color:var(--brand); color:var(--brand); outline:none; box-shadow:0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.appointment-time-heading { display:flex; justify-content:space-between; align-items:flex-end; gap:10px; margin-bottom:9px; }
.appointment-time-heading > div { display:flex; flex-direction:column; }
.appointment-time-heading label { color:var(--ink-2); font-size:13px; font-weight:650; }
.appointment-time-heading span { color:var(--muted); font-size:11px; }
.appointment-custom-time { display:inline-flex; align-items:center; gap:5px; border:0; padding:5px 8px; border-radius:8px; color:var(--brand); background:transparent; font:inherit; font-size:11.5px; font-weight:700; cursor:pointer; }
.appointment-custom-time:hover, .appointment-custom-time.active { background:var(--brand-tint); }
.appointment-custom-time:focus-visible { outline:none; box-shadow:0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.appointment-time-slots { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; max-height:183px; overflow:auto; padding:2px 3px 3px 2px; scrollbar-width:thin; }
.appointment-time-slots.invalid { border-radius:11px; outline:2px solid var(--danger); outline-offset:2px; }
.appointment-time-slots:focus-visible { border-radius:11px; outline:2px solid var(--brand); outline-offset:2px; }
.appointment-time-slot { min-height:39px; border:1px solid var(--line); border-radius:10px; color:var(--ink-2); background:#fff; font:inherit; font-size:12.5px; font-weight:650; cursor:pointer; box-shadow:0 1px 2px rgba(15,23,42,.03); transition:transform .1s, border-color .1s, background .1s, color .1s, box-shadow .1s; }
.appointment-time-slot:hover { border-color:color-mix(in srgb, var(--brand) 50%, var(--line)); color:var(--brand); transform:translateY(-1px); }
.appointment-time-slot:focus-visible { outline:none; border-color:var(--brand); box-shadow:var(--ring); }
.appointment-time-slot.active { border-color:var(--brand); color:#fff; background:var(--brand); box-shadow:0 5px 12px color-mix(in srgb, var(--brand) 24%, transparent); }
.appointment-time-empty { grid-column:1 / -1; min-height:78px; display:flex; align-items:center; justify-content:center; gap:8px; padding:14px; border:1px dashed color-mix(in srgb, var(--brand) 28%, var(--line)); border-radius:11px; color:var(--muted); background:rgba(255,255,255,.68); text-align:center; font-size:12.5px; }
.appointment-manual-time { margin-top:10px; padding:12px; border:1px solid color-mix(in srgb, var(--brand) 22%, var(--line)); border-radius:11px; background:#fff; }
.appointment-manual-time > label { display:block; margin-bottom:6px; color:var(--ink-2); font-size:12.5px; font-weight:650; }
.appointment-manual-control { display:flex; align-items:center; gap:9px; color:var(--brand); }
.appointment-manual-control input[type=time] { padding:9px 11px; }
.appointment-schedule-error { margin:10px 0 0; padding:8px 10px; border-radius:9px; color:#991b1b; background:var(--danger-tint); font-size:12px; font-weight:650; }
.appointment-notify { padding:10px 12px; border-radius:10px; color:var(--ink-2); background:var(--surface-2); font-size:13px; }

/* --- Modal & drawer ------------------------------------------------------ */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px); z-index: 100; display:flex; align-items:flex-start; justify-content:center; padding: 6vh 16px; overflow:auto; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; animation: pop .16s ease; }
.modal.wide { max-width: 860px; }
.modal-head { display:flex; align-items:center; padding: 20px 24px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 17px; }
.modal-head .x { margin-left:auto; cursor:pointer; color:var(--muted); background:none; border:none; font-size:22px; line-height:1; }
.modal-body { padding: 22px 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line-2); display:flex; gap:10px; justify-content:flex-end; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity:0; } to { transform:none; opacity:1; } }

/* drawer (right side) */
.drawer-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 100; }
.drawer { position: fixed; top:0; right:0; height:100vh; width: 480px; max-width: 94vw; background: var(--surface); box-shadow: var(--shadow-lg); z-index: 101; display:flex; flex-direction:column; animation: slidein .2s ease; }
.drawer.wide { width: 640px; }
@keyframes slidein { from { transform: translateX(20px); opacity:.6; } to { transform:none; opacity:1; } }

/* --- Toast --------------------------------------------------------------- */
#toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display:flex; flex-direction:column; gap:10px; }
.toast { background: #0c1726; color:#fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; display:flex; gap:10px; align-items:center; animation: pop .16s ease; max-width: 360px; }
.toast.ok { background: #14532d; } .toast.err { background: #7f1d1d; }

/* --- Misc ---------------------------------------------------------------- */
.empty { text-align:center; padding: 48px 20px; color: var(--muted); }
.empty .ic { width:52px; height:52px; border-radius:14px; background:var(--surface-2); display:grid; place-items:center; margin:0 auto 14px; color:var(--muted-2); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display:inline-block; }
.loading-page { display:grid; place-items:center; min-height: 60vh; }
@keyframes spin { to { transform: rotate(360deg); } }
.divider { height:1px; background: var(--line-2); margin: 16px 0; border: none; }
.kbd { font-size:12px; background:var(--surface-2); border:1px solid var(--line); border-bottom-width:2px; border-radius:6px; padding:1px 6px; color:var(--muted); }
.dot-sep::before { content:"·"; margin:0 7px; color: var(--muted-2); }
.avatar-sm { width:30px;height:30px;border-radius:50%;background:var(--brand-tint);color:var(--brand);display:grid;place-items:center;font-weight:700;font-size:12px;flex:none; }
.link-btn { background:none;border:none;color:var(--brand);font-weight:600;cursor:pointer;font-size:14px;padding:0; }
.list-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 2px 0; flex-wrap:wrap; }
.picker-row { display:flex; flex-direction:column; gap:2px; padding:9px 12px; cursor:pointer; border-bottom:1px solid var(--line-2); background:var(--surface); }
.picker-row:last-child { border-bottom:none; }
.picker-row:hover { background:var(--surface-2); }
.picker-row span { font-weight:700; color:var(--ink); }
.picker-row small { color:var(--muted); font-size:12px; }
.scrim { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 110; }
.tabbar { display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom: 18px; }
.tabbar button { background:none; border:none; padding:11px 14px; font-weight:600; font-size:14px; color:var(--muted); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; }
.tabbar button.active { color:var(--brand); border-bottom-color:var(--brand); }
.li-row { display:grid; grid-template-columns:minmax(0,1fr) 72px 142px 54px 28px; gap:8px; align-items:center; padding:8px 0; border-bottom:1px solid var(--line-2); }
.li-row:last-child { border-bottom:none; }
.li-row .input-prefix { min-width:0; }
.tx { display:inline-flex; align-items:center; justify-content:center; gap:5px; color:var(--muted); font-size:11px; font-weight:700; text-transform:uppercase; }
.tx::before { content:"Tax"; }
.totline { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:4px 0; font-size:14px; }
.totline.grand { margin-top:6px; padding-top:10px; border-top:1px solid var(--line); font-size:16px; font-weight:800; color:var(--ink); }
.preset-pill { display:inline-flex; align-items:center; justify-content:center; min-height:32px; padding:6px 11px; border:1px solid var(--line); border-radius:999px; background:var(--surface); color:var(--ink-2); font:inherit; font-size:13px; font-weight:700; cursor:pointer; box-shadow:var(--shadow-sm); }
.preset-pill:hover { background:var(--brand-tint-2); border-color:color-mix(in srgb, var(--brand) 28%, var(--line)); color:var(--brand-700); }
.plan-card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-sm); padding:18px; min-height:188px; transition:border-color .12s, box-shadow .12s, transform .12s; }
button.plan-card { font:inherit; text-align:left; width:100%; appearance:none; }
.plan-card:hover { border-color:#d3dae3; box-shadow:var(--shadow); transform:translateY(-1px); }
.plan-card .price { font-size:26px; font-weight:800; letter-spacing:-0.01em; color:var(--ink); }
.plan-card .per { color:var(--muted); font-size:13px; font-weight:600; }
.daygrid { display:grid; grid-template-columns:minmax(120px,1fr) 132px 132px auto; gap:10px; align-items:center; padding:8px 0; border-bottom:1px solid var(--line-2); }
.daygrid:last-child { border-bottom:none; }
.convo-item { background:var(--surface); transition:background .12s, box-shadow .12s; }
.convo-item:hover { background:var(--surface-2); }
.convo-item.active { background:var(--brand-tint-2); box-shadow:inset 3px 0 0 var(--brand); }
/* Reports bar chart (no external lib) */
.rep-chart { display:flex; align-items:flex-end; gap:10px; height:150px; padding-top:8px; overflow-x:auto; }
.rep-bar { display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:6px; min-width:34px; flex:1; }
.rep-bar-fill { width:60%; min-width:18px; max-width:46px; background:linear-gradient(180deg,var(--brand),color-mix(in srgb,var(--brand) 60%,#86efac)); border-radius:6px 6px 0 0; transition:height .3s ease; }
.rep-bar-lbl { font-size:11px; color:var(--muted); white-space:nowrap; }
/* Job photos / files grid */
.filegrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(86px,1fr)); gap:8px; }
.filecard { position:relative; border-radius:10px; overflow:hidden; border:1px solid var(--line); aspect-ratio:1; background:var(--surface-2); }
.filecard img { width:100%; height:100%; object-fit:cover; display:block; }
.filecard.doc .doclink { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; height:100%; padding:8px; text-align:center; color:var(--ink-2); text-decoration:none; }
.filecard.doc span { font-size:10px; line-height:1.2; word-break:break-word; max-height:30px; overflow:hidden; }
.filedel { position:absolute; top:3px; right:3px; width:20px; height:20px; border-radius:50%; border:none; background:rgba(15,23,42,.66); color:#fff; cursor:pointer; font-size:12px; line-height:1; display:grid; place-items:center; }
/* --- Schedule (day / week / month) ------------------------------------- */
.sched-toolbar { display:flex; flex-direction:column; margin-bottom:12px; overflow:hidden; border-radius:16px; }
.sched-nav { display:flex; align-items:center; gap:14px; min-width:0; padding:14px 16px; border-bottom:1px solid var(--line-2); background:linear-gradient(180deg,var(--surface),var(--surface-2)); }
.sched-nav-buttons { display:flex; align-items:center; gap:6px; flex:none; }
.sched-toolbar .arrow { width:34px; height:34px; border-radius:9px; border:1px solid var(--line); background:var(--surface); font-size:18px; line-height:1; cursor:pointer; color:var(--ink-2); }
.sched-toolbar .arrow:hover { background:var(--surface-2); }
.sched-title { flex:1; min-width:180px; font-weight:800; font-size:19px; letter-spacing:-.025em; }
.sched-jump { display:flex; align-items:center; gap:8px; flex:none; color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.sched-controls { display:flex; align-items:flex-end; gap:16px; min-width:0; padding:12px 16px; background:var(--surface); }
.sched-control { display:flex; flex-direction:column; align-items:flex-start; gap:4px; min-width:0; }
.sched-control-label { color:var(--muted); font-size:9px; font-weight:800; letter-spacing:.075em; line-height:1; text-transform:uppercase; }
.sched-tech-control select { width:180px; min-height:34px; padding-block:6px; font-size:12px; font-weight:650; }
.sched-route-button { align-self:flex-end; margin-left:auto; min-height:34px; }
.sched-help { display:flex; align-items:flex-start; gap:7px; margin:0 2px 14px; color:var(--muted); font-size:12px; line-height:1.45; }
.sched-help svg { flex:none; margin-top:1px; color:var(--brand); }

.week-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:12px; }
.week-col { display:flex; flex-direction:column; min-width:0; border:1px solid var(--line); border-radius:14px; background:var(--surface); min-height:360px; overflow:hidden; box-shadow:var(--shadow-sm); }
.week-col.today { border-color:var(--brand); box-shadow:inset 0 0 0 1px var(--brand); }
.week-col.closed { background:var(--surface-2); }
.wc-head { display:flex; align-items:center; gap:6px; padding:9px 9px 9px 13px; border-bottom:1px solid var(--line-2); background:linear-gradient(180deg,#fff,var(--surface-2)); }
.wc-day-button { display:flex; align-items:baseline; justify-content:space-between; gap:6px; min-width:0; flex:1; padding:3px 0; border:0; background:transparent; color:inherit; font:inherit; cursor:pointer; }
.wc-day-button span { color:var(--muted); font-size:12px; font-weight:750; letter-spacing:.02em; }
.wc-day-button strong { display:grid; place-items:center; min-width:29px; height:25px; padding:0 7px; border-radius:999px; background:var(--brand-tint); color:var(--brand-700); font-size:12px; font-weight:850; }
.wc-day-button:hover span,.wc-day-button:hover strong { color:var(--brand-700); }
.wc-add-button { display:grid; place-items:center; width:26px; height:26px; flex:none; padding:0; border:0; border-radius:7px; background:transparent; color:var(--muted); cursor:pointer; }
.wc-add-button:hover { background:var(--brand-tint); color:var(--brand-700); }
.wc-body { flex:1; padding:8px; display:flex; flex-direction:column; gap:7px; }
.wc-job { border:1px solid var(--line-2); border-left:3px solid var(--brand); background:var(--surface-2); border-radius:10px; padding:7px 9px; font-size:12px; line-height:1.35; cursor:pointer; transition:background .12s,box-shadow .12s,transform .12s; }
.wc-job:hover { transform:translateY(-1px); background:var(--surface); box-shadow:var(--shadow-sm); }
.wc-job b { display:block; font-size:11px; color:var(--brand-700); font-weight:700; }
.wc-job-top { display:flex; align-items:center; justify-content:space-between; gap:5px; }
.schedule-drag-hint { color:var(--muted-2); font-size:10px; font-weight:700; letter-spacing:.03em; text-transform:uppercase; }
.schedule-job-actions { display:inline-flex; align-items:center; gap:5px; flex:none; }
.schedule-details-button { display:inline-flex; align-items:center; gap:3px; min-height:24px; padding:3px 7px; border:1px solid var(--line); border-radius:7px; background:var(--surface); color:var(--muted); font:inherit; font-size:10px; font-weight:750; line-height:1; cursor:pointer; }
.schedule-details-button:hover { border-color:color-mix(in srgb,var(--brand) 25%,var(--line)); background:var(--brand-tint); color:var(--brand-700); }
.schedule-details-button svg { flex:none; }
.wc-foot { display:flex; align-items:center; justify-content:space-between; gap:6px; padding:8px 10px; border-top:1px solid var(--line-2); font-size:11px; color:var(--muted); }
.wc-more { width:100%; min-height:34px; margin-top:auto; border:1px dashed color-mix(in srgb,var(--brand) 28%,var(--line)); border-radius:9px; background:var(--brand-tint-2); color:var(--brand-700); font:inherit; font-size:11px; font-weight:750; cursor:pointer; }
.wc-more:hover { border-style:solid; background:var(--brand-tint); }
.wc-unassigned { color:var(--warn); font-weight:750; }
.wc-ready { color:var(--ok); font-weight:750; }
.cap-pill { display:inline-block; padding:2px 9px; border-radius:999px; font-size:11px; font-weight:700; }

.month-grid { display:grid; grid-template-columns:repeat(7, minmax(0,1fr)); gap:6px; }
.month-dow { text-align:center; font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; padding:4px 0; }
.m-cell { display:block; width:100%; min-height:88px; border:1px solid var(--line); border-radius:10px; background:var(--surface); padding:6px 8px; color:inherit; font:inherit; text-align:left; cursor:pointer; transition:background .12s,box-shadow .12s; }
.m-cell:hover { background:var(--surface-2); }
.m-cell.out { opacity:.4; }
.m-cell.closed { background:var(--surface-2); }
.m-cell.today { border-color:var(--brand); box-shadow:inset 0 0 0 1px var(--brand); }
.m-num { font-weight:800; font-size:13px; }
.m-dots { display:flex; flex-wrap:wrap; gap:3px; margin-top:8px; }
.m-dot { width:7px; height:7px; border-radius:50%; background:var(--brand); }

.agenda { display:flex; flex-direction:column; }
.slot-row { display:flex; gap:14px; padding:10px 0; border-bottom:1px solid var(--line-2); }
.slot-row:last-child { border-bottom:none; }
.slot-row .time { width:78px; flex:none; font-weight:700; font-size:13px; color:var(--brand-700); }
.slot-row .job { flex:1; min-width:0; border-left:3px solid var(--brand); background:var(--surface-2); border-radius:8px; padding:9px 11px; cursor:pointer; transition:background .12s,box-shadow .12s,transform .12s; }
.slot-row .job:hover { transform:translateY(-1px); background:var(--surface); box-shadow:var(--shadow-sm); }
.schedule-customer-link { display:block; min-width:0; max-width:100%; overflow:hidden; padding:0; border:0; background:transparent; color:var(--ink); font:inherit; font-weight:750; line-height:1.3; text-align:left; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; }
.schedule-customer-link:hover { color:var(--brand-700); text-decoration:underline; text-underline-offset:2px; }
.schedule-customer-link:focus-visible,.schedule-details-button:focus-visible,.wc-day-button:focus-visible,.wc-add-button:focus-visible,.m-cell:focus-visible { outline:none; box-shadow:var(--ring); }
.schedule-day-card .card-head { padding:14px 16px; }

/* Guided daily scheduling ------------------------------------------------ */
#schedulePlanning { display:flex; flex-direction:column; gap:10px; margin-bottom:12px; }
.daily-planner { overflow:hidden; border-color:color-mix(in srgb,var(--brand) 22%,var(--line)); background:linear-gradient(125deg,color-mix(in srgb,var(--brand-tint-2) 74%,#fff),#fff 62%); }
.daily-planner.is-open { border-color:color-mix(in srgb,var(--brand) 34%,var(--line)); box-shadow:0 16px 40px color-mix(in srgb,var(--brand) 10%,transparent); }
.daily-plan-kicker { display:block; margin-bottom:3px; color:var(--brand-700); font-size:10px; font-weight:850; letter-spacing:.09em; text-transform:uppercase; }
.daily-plan-launch { display:grid; grid-template-columns:auto minmax(280px,1fr) auto; align-items:center; gap:16px; padding:18px 20px; }
.daily-plan-launch-icon { display:grid; place-items:center; width:46px; height:46px; border:1px solid color-mix(in srgb,var(--brand) 18%,var(--line)); border-radius:14px; background:#fff; color:var(--brand); box-shadow:var(--shadow-sm); }
.daily-plan-launch h2,.daily-plan-head h2 { font-size:19px; letter-spacing:-.025em; }
.daily-plan-launch p { max-width:680px; margin:3px 0 4px; color:var(--ink-2); font-size:13px; }
.daily-plan-launch small { color:var(--muted); font-size:11px; }
.daily-plan-launch-stats { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.daily-plan-launch-stats>span { display:inline-flex; align-items:baseline; gap:4px; padding:7px 10px; border:1px solid var(--line); border-radius:10px; background:rgba(255,255,255,.74); color:var(--muted); font-size:11px; }
.daily-plan-launch-stats>span b { color:var(--ink); font-size:13px; }
.daily-plan-launch-stats>span.needs-work b { color:var(--warn); }
.daily-plan-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding:18px 20px 14px; }
.daily-plan-head p { margin:3px 0 0; color:var(--muted); font-size:11px; }
.daily-plan-close { display:grid; place-items:center; width:34px; height:34px; flex:none; border:1px solid var(--line); border-radius:10px; background:#fff; color:var(--muted); font:inherit; font-size:22px; line-height:1; cursor:pointer; }
.daily-plan-close:hover { color:var(--ink); background:var(--surface-2); }
.daily-plan-stepper { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:0 20px 14px; }
.daily-plan-step { position:relative; display:flex; align-items:center; justify-content:center; gap:7px; min-height:38px; padding:7px 10px; border:0; border-bottom:2px solid var(--line); background:transparent; color:var(--muted); font:inherit; font-size:11px; font-weight:750; cursor:pointer; }
.daily-plan-step span { display:grid; place-items:center; width:22px; height:22px; border-radius:50%; background:var(--surface-2); color:var(--muted); font-size:10px; }
.daily-plan-step.active { border-color:var(--brand); color:var(--brand-700); }
.daily-plan-step.active span { background:var(--brand); color:#fff; }
.daily-plan-step.complete { border-color:color-mix(in srgb,var(--brand) 45%,var(--line)); color:var(--ink-2); }
.daily-plan-step.complete span { background:var(--brand-tint); color:var(--brand-700); }
.daily-plan-content { min-height:230px; padding:20px; border-top:1px solid var(--line-2); background:rgba(255,255,255,.84); }
.daily-plan-copy { max-width:780px; margin-bottom:16px; }
.daily-plan-copy h3 { margin-top:4px; font-size:18px; letter-spacing:-.02em; }
.daily-plan-copy p { margin:5px 0 0; color:var(--muted); font-size:13px; }
.daily-plan-status-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.daily-plan-status { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; min-height:78px; padding:13px 14px; border:1px solid var(--line); border-radius:13px; background:#fff; color:var(--ink); text-decoration:none; }
.daily-plan-status:hover { text-decoration:none; border-color:color-mix(in srgb,var(--brand) 30%,var(--line)); }
.daily-plan-status>span { display:grid; place-items:center; width:34px; height:34px; border-radius:10px; background:var(--ok-tint); color:var(--ok); }
.daily-plan-status.needs-work>span { background:var(--warn-tint); color:var(--warn); }
.daily-plan-status div { display:flex; flex-direction:column; }
.daily-plan-status b { font-size:20px; line-height:1.1; }
.daily-plan-status small { color:var(--muted); font-size:11px; }
.daily-plan-status em { color:var(--brand-700); font-size:11px; font-style:normal; font-weight:750; }
.schedule-horizon-rail { display:grid; grid-template-columns:repeat(7,minmax(110px,1fr)); gap:8px; overflow-x:auto; padding:2px 2px 6px; }
.schedule-horizon-day { display:flex; flex-direction:column; align-items:flex-start; min-width:110px; padding:11px 12px; border:1px solid var(--line); border-radius:12px; background:#fff; color:var(--ink); font:inherit; text-align:left; cursor:pointer; transition:border-color .12s,box-shadow .12s,transform .12s; }
.schedule-horizon-day:hover { transform:translateY(-1px); border-color:color-mix(in srgb,var(--brand) 28%,var(--line)); box-shadow:var(--shadow-sm); }
.schedule-horizon-day.active { border-color:var(--brand); box-shadow:0 0 0 2px color-mix(in srgb,var(--brand) 12%,transparent); }
.schedule-horizon-day>span { color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.schedule-horizon-day strong { margin:2px 0 6px; font-size:14px; }
.schedule-horizon-day em { color:var(--ink-2); font-size:11px; font-style:normal; font-weight:750; }
.schedule-horizon-day small { margin-top:2px; color:var(--ok); font-size:10px; }
.schedule-horizon-day.needs-work small { color:var(--warn); }
.daily-plan-selected { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-top:12px; padding:14px 15px; border:1px solid var(--line); border-radius:13px; background:var(--surface-2); }
.daily-plan-selected h3 { margin-top:3px; font-size:16px; }
.daily-plan-selected p { margin:3px 0 0; color:var(--muted); font-size:11px; }
.daily-plan-loads { display:flex; align-items:center; justify-content:flex-end; gap:6px; flex-wrap:wrap; }
.daily-plan-load { display:inline-flex; align-items:center; gap:6px; padding:6px 8px; border:1px solid var(--line); border-radius:999px; background:#fff; color:var(--ink-2); font-size:11px; }
.daily-plan-load i { width:8px; height:8px; border-radius:50%; }
.daily-plan-load b { min-width:18px; padding:1px 5px; border-radius:999px; background:var(--surface-2); text-align:center; }
.daily-plan-route-grid { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(240px,.7fr); gap:14px; }
.daily-plan-queue,.daily-plan-route-actions { padding:14px; border:1px solid var(--line); border-radius:13px; background:var(--surface-2); }
.daily-plan-queue>.row { margin-bottom:8px; }
.daily-plan-job { display:grid; grid-template-columns:4px minmax(0,1fr) auto; align-items:center; gap:9px; padding:8px 0; border-top:1px solid var(--line); }
.daily-plan-job>span { width:4px; height:32px; border-radius:999px; }
.daily-plan-job>div { display:flex; flex-direction:column; min-width:0; }
.daily-plan-job b { overflow:hidden; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.daily-plan-job small { overflow:hidden; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.daily-plan-empty { display:flex; align-items:center; justify-content:center; gap:7px; min-height:90px; color:var(--ok); font-size:12px; font-weight:750; }
.daily-plan-route-actions { display:flex; flex-direction:column; gap:9px; justify-content:center; background:#fff; }
.daily-plan-map-key { display:flex; flex-direction:column; gap:8px; margin-bottom:3px; color:var(--muted); font-size:11px; }
.daily-plan-map-key span { display:flex; align-items:center; gap:8px; }
.daily-plan-map-key i { display:inline-grid; place-items:center; width:20px; height:20px; border-radius:6px; background:var(--brand); color:#fff; font-size:9px; font-style:normal; font-weight:850; }
.daily-plan-map-key i.striped { border:1px dashed var(--brand); background:repeating-linear-gradient(135deg,var(--brand-tint) 0 4px,#fff 4px 8px); }
.daily-plan-checklist { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.daily-plan-check { display:flex; align-items:center; gap:10px; min-height:66px; padding:11px 12px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.daily-plan-check>span { display:grid; place-items:center; width:32px; height:32px; flex:none; border-radius:10px; background:var(--ok-tint); color:var(--ok); }
.daily-plan-check.needs-work>span { background:var(--warn-tint); color:var(--warn); }
.daily-plan-check div { display:flex; flex-direction:column; }
.daily-plan-check b { font-size:12px; }
.daily-plan-check small { color:var(--muted); font-size:10px; }
.daily-plan-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 20px; border-top:1px solid var(--line-2); background:var(--surface-2); }
.daily-plan-footer>span { color:var(--muted); font-size:11px; }
.schedule-week-ribbon { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:13px; padding:9px 10px 9px 14px; overflow:hidden; }
.schedule-week-ribbon-copy { display:flex; flex-direction:column; min-width:150px; }
.schedule-week-ribbon-copy>b { margin-top:2px; font-size:12px; }
.schedule-week-ribbon-copy>small { color:var(--muted); font-size:9px; }
.schedule-week-ribbon-days { display:grid; grid-template-columns:repeat(7,minmax(56px,1fr)); gap:5px; min-width:0; }
.schedule-week-day { position:relative; display:grid; grid-template-columns:auto auto; grid-template-rows:auto auto; align-items:center; justify-content:center; column-gap:5px; min-height:48px; padding:5px 7px; border:1px solid transparent; border-radius:10px; background:transparent; color:var(--ink); font:inherit; cursor:pointer; }
.schedule-week-day:hover { background:var(--surface-2); }
.schedule-week-day.active { border-color:color-mix(in srgb,var(--brand) 30%,var(--line)); background:var(--brand-tint); color:var(--brand-700); }
.schedule-week-day>span { color:var(--muted); font-size:9px; font-weight:800; text-transform:uppercase; }
.schedule-week-day>b { font-size:14px; }
.schedule-week-day>em { grid-column:1/-1; color:var(--muted); font-size:9px; font-style:normal; }
.schedule-week-day>i { position:absolute; top:3px; right:3px; display:grid; place-items:center; min-width:16px; height:16px; padding:0 4px; border-radius:999px; background:var(--warn-tint); color:var(--warn); font-size:8px; font-style:normal; font-weight:850; }

/* Full-width dispatch workspace. Applied and removed by the Schedule view so
   data-heavy routing can use the viewport without widening other admin pages. */
.content.schedule-content-wide { max-width:none; padding:18px 20px 42px; }
.schedule-view-root { min-width:0; }
.sched-mode { box-shadow:var(--shadow-sm); }
.sched-mode button { display:inline-flex; align-items:center; justify-content:center; gap:6px; }
.sched-mode .dispatch-mode-button.active { background:var(--brand); color:#fff; }
.sched-toolbar input.sched-date-jump { width:142px; min-height:34px; padding:6px 9px; border-radius:9px; background:var(--surface); font-size:13px; font-weight:650; letter-spacing:normal; text-transform:none; }
.dispatch-board { display:flex; flex-direction:column; gap:12px; min-width:0; }
.dispatch-sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.dispatch-eyebrow { display:block; color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.075em; line-height:1.2; text-transform:uppercase; }
.dispatch-filterbar { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 16px; border-radius:14px; }
.dispatch-rep-chips { display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-top:6px; }
.dispatch-rep-chip { display:inline-flex; align-items:center; gap:7px; min-height:40px; padding:8px 13px; border:1px solid var(--line); border-radius:999px; background:var(--surface); color:var(--ink-2); font:inherit; font-size:13px; font-weight:700; cursor:pointer; transition:border-color .12s,background .12s,color .12s,box-shadow .12s; }
.dispatch-rep-chip:hover { border-color:color-mix(in srgb,var(--brand) 32%,var(--line)); background:var(--brand-tint-2); }
.dispatch-rep-chip span { width:8px; height:8px; flex:none; border-radius:50%; box-shadow:0 0 0 2px var(--surface); }
.dispatch-rep-chip.active { border-color:color-mix(in srgb,var(--brand) 38%,var(--line)); background:var(--brand-tint); color:var(--brand-700); box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--brand) 12%,transparent); }
.dispatch-rep-chip.all.active { background:var(--brand); border-color:var(--brand); color:#fff; }
.dispatch-clear { padding:4px 7px; border:0; background:transparent; color:var(--muted); font:inherit; font-size:11px; font-weight:700; cursor:pointer; }
.dispatch-clear:hover { color:var(--danger); }
.dispatch-rep-chip:focus-visible,.dispatch-clear:focus-visible,.dispatch-map-fit:focus-visible,.dispatch-job:focus-visible { outline:none; box-shadow:var(--ring); }
.dispatch-filter-note { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; color:var(--muted); font-size:12px; text-align:right; }
.dispatch-surfacebar { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:10px 12px 10px 14px; }
.dispatch-surfacebar>div:first-child { display:flex; flex-direction:column; }
.dispatch-surfacebar>div:first-child>b { margin-top:2px; font-size:13px; }
.dispatch-surfacebar .segmented button { display:inline-flex; align-items:center; gap:6px; min-height:36px; }
.dispatch-workspace { display:block; min-width:0; }
.dispatch-map-panel,.dispatch-calendar-panel { min-width:0; min-height:0; overflow:hidden; border-radius:16px; }
.dispatch-map-panel { display:flex; flex-direction:column; min-height:640px; }
.dispatch-calendar-panel { display:flex; flex-direction:column; height:clamp(650px,calc(100dvh - 260px),900px); }
.dispatch-panel-head { display:flex; align-items:center; justify-content:space-between; gap:14px; min-height:62px; padding:12px 14px; border-bottom:1px solid var(--line-2); background:linear-gradient(180deg,var(--surface),var(--surface-2)); }
.dispatch-panel-head h3 { margin-top:3px; font-size:15px; }
.dispatch-map-metrics { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.dispatch-route-summary { display:flex; flex-direction:column; align-items:flex-end; line-height:1.25; }
.dispatch-route-summary b { font-size:14px; }
.dispatch-route-summary span { color:var(--muted); font-size:11px; }
.dispatch-metric { display:inline-flex; flex-direction:column; align-items:flex-start; min-width:48px; padding:4px 7px; border:1px solid var(--line-2); border-radius:8px; background:var(--surface); color:var(--muted); font-size:9px; font-weight:700; line-height:1.15; }
.dispatch-metric b { color:var(--ink); font-size:11px; font-variant-numeric:tabular-nums; }
.dispatch-metric-quality { display:inline-flex; align-items:center; min-height:23px; padding:3px 7px; border-radius:999px; background:var(--info-tint); color:var(--info); font-size:10px; font-weight:800; white-space:nowrap; }
.dispatch-metric-quality.partial { background:var(--warn-tint); color:var(--warn); }
.dispatch-metric-quality.unavailable { background:var(--surface-2); color:var(--muted); }
.dispatch-map-guide { display:flex; align-items:center; gap:8px 14px; flex-wrap:wrap; padding:9px 14px; border-bottom:1px solid var(--line-2); background:var(--brand-tint-2); color:var(--ink-2); font-size:11px; }
.dispatch-map-guide span { display:inline-flex; align-items:center; gap:6px; font-weight:700; }
.dispatch-map-guide span b { display:grid; place-items:center; width:20px; height:20px; border-radius:50%; background:var(--brand); color:#fff; font-size:9px; }
.dispatch-map-guide em { margin-left:auto; color:var(--muted); font-size:10px; font-style:normal; }
.dispatch-map-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(290px,330px); min-height:520px; height:clamp(520px,calc(100dvh - 330px),720px); }
.dispatch-map-stage { position:relative; min-width:0; min-height:420px; overflow:hidden; isolation:isolate; background:linear-gradient(145deg,#edf3f6,#e4ebef); }
.dispatch-stop-panel { display:flex; flex-direction:column; min-width:0; min-height:0; border-left:1px solid var(--line); background:var(--surface); }
.dispatch-stop-panel-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:12px 13px; border-bottom:1px solid var(--line-2); background:var(--surface-2); }
.dispatch-stop-panel-head>div { display:flex; flex-direction:column; }
.dispatch-stop-panel-head>div>b { margin-top:2px; font-size:13px; }
.dispatch-stop-panel-head>small { max-width:120px; color:var(--muted); font-size:9px; text-align:right; }
.dispatch-stop-list { flex:1; min-height:0; overflow:auto; scrollbar-color:#cbd5e1 transparent; }
.dispatch-stop-group { padding-bottom:5px; border-bottom:1px solid var(--line); }
.dispatch-stop-group:last-child { border-bottom:0; }
.dispatch-stop-group>p { margin:10px 13px; }
.dispatch-stop-group-head { display:grid; grid-template-columns:4px minmax(0,1fr) auto; align-items:center; gap:8px; position:sticky; top:0; z-index:2; padding:9px 11px; background:rgba(246,248,247,.96); border-bottom:1px solid var(--line-2); backdrop-filter:blur(8px); }
.dispatch-stop-group-head>span { width:4px; height:31px; border-radius:999px; }
.dispatch-stop-group-head>div { display:flex; flex-direction:column; min-width:0; }
.dispatch-stop-group-head b { overflow:hidden; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.dispatch-stop-group-head small { overflow:hidden; color:var(--muted); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.dispatch-stop-group-head a { font-size:9px; font-weight:800; white-space:nowrap; }
.dispatch-stop-row { display:grid; grid-template-columns:30px minmax(0,1fr) auto; align-items:center; gap:8px; width:100%; min-height:54px; padding:7px 10px; border:0; border-bottom:1px solid var(--line-2); background:#fff; color:var(--ink); font:inherit; text-align:left; cursor:pointer; transition:background .12s,box-shadow .12s; }
.dispatch-stop-row:hover,.dispatch-stop-row.is-selected { position:relative; z-index:1; background:var(--brand-tint-2); box-shadow:inset 3px 0 var(--brand); }
.dispatch-stop-row:focus-visible { outline:none; box-shadow:inset 3px 0 var(--brand),var(--ring); }
.dispatch-stop-number { display:grid; place-items:center; width:27px; height:27px; border:2px solid #fff; border-radius:50%; background:var(--stop-color); color:#fff; box-shadow:0 0 0 1px color-mix(in srgb,var(--stop-color) 30%,transparent); font-size:10px; font-weight:900; }
.dispatch-stop-copy { display:flex; flex-direction:column; min-width:0; }
.dispatch-stop-copy b { overflow:hidden; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.dispatch-stop-copy small { overflow:hidden; color:var(--muted); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.dispatch-stop-row>em { padding:2px 5px; border-radius:999px; background:var(--ok-tint); color:var(--ok); font-size:8px; font-style:normal; font-weight:850; text-transform:uppercase; }
.dispatch-stop-row.proposed { background:repeating-linear-gradient(135deg,color-mix(in srgb,var(--brand-tint) 45%,#fff) 0 7px,#fff 7px 14px); }
.dispatch-stop-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; min-height:180px; padding:20px; color:var(--muted); font-size:11px; text-align:center; }
.dispatch-stop-empty b { color:var(--ink); font-size:12px; }
.dispatch-leaflet-map { position:absolute; inset:0; z-index:1; width:100%; height:100%; background:#e8eef1; font-family:inherit; }
.dispatch-leaflet-map .leaflet-tile-pane { filter:saturate(.72) contrast(.96) brightness(1.035); }
.dispatch-leaflet-map .leaflet-control-zoom { overflow:hidden; border:1px solid rgba(148,163,184,.45); border-radius:11px; box-shadow:0 5px 18px rgba(15,23,42,.13); }
.dispatch-leaflet-map .leaflet-control-zoom a { display:grid; place-items:center; width:34px; height:34px; border-color:var(--line-2); color:var(--ink-2); font-family:inherit; font-size:20px; font-weight:600; line-height:1; }
.dispatch-leaflet-map .leaflet-control-zoom a:hover { background:var(--surface-2); color:var(--brand-700); }
.dispatch-leaflet-map .leaflet-control-attribution { padding:3px 7px; border-radius:8px 0 0 0; background:rgba(255,255,255,.82); color:#64748b; font-size:8px; backdrop-filter:blur(5px); }
.dispatch-leaflet-map .leaflet-control-attribution a { color:#475569; }
.dispatch-map-div-icon { border:0!important; background:transparent!important; }
.dispatch-map-div-icon:focus { outline:3px solid color-mix(in srgb,var(--brand) 55%,transparent); outline-offset:4px; }
.dispatch-map-pin { display:grid; place-items:center; width:31px; height:31px; border:2px solid #fff; border-radius:50% 50% 50% 7px; transform:rotate(-45deg); background:var(--marker); color:#fff; box-shadow:0 5px 12px rgba(15,23,42,.29),0 0 0 1px rgba(15,23,42,.1); font-size:11px; font-weight:900; font-variant-numeric:tabular-nums; text-shadow:0 1px 1px rgba(15,23,42,.25); }
.dispatch-map-pin span { transform:rotate(45deg); }
.dispatch-map-pin.proposed { border-style:dashed; background:color-mix(in srgb,var(--marker) 74%,#fff); }
.dispatch-map-pin.is-selected { transform:rotate(-45deg) scale(1.14); box-shadow:0 0 0 4px rgba(255,255,255,.92),0 0 0 7px color-mix(in srgb,var(--marker) 46%,transparent),0 8px 18px rgba(15,23,42,.32); }
.dispatch-map-start { display:flex; align-items:center; gap:6px; width:max-content; min-width:42px; height:34px; padding:4px 7px 4px 5px; border:2px solid #fff; border-radius:18px 18px 18px 6px; background:#0f172a; color:#fff; box-shadow:0 5px 14px rgba(15,23,42,.28),0 0 0 1px rgba(15,23,42,.08); }
.dispatch-map-start>span { display:grid; place-items:center; width:21px; height:21px; border-radius:50%; background:rgba(255,255,255,.12); }
.dispatch-map-start>span b { color:inherit; font-size:10px; font-weight:900; }
.dispatch-map-start.custom { border-color:var(--start-color); background:#fff; color:var(--start-color); }
.dispatch-map-start.custom>span { background:var(--start-color); color:#fff; }
.dispatch-map-start.custom em b { color:var(--ink-2); }
.dispatch-map-start.mixed { background:linear-gradient(135deg,#0f172a 0 51%,var(--start-color) 52% 100%); }
.dispatch-map-start em { display:flex; align-items:center; gap:3px; font-style:normal; }
.dispatch-map-start em i { width:8px; height:8px; border:1px solid rgba(255,255,255,.75); border-radius:50%; }
.dispatch-map-start em b { color:#fff; font-size:9px; }
.leaflet-tooltip.dispatch-map-tooltip { padding:0; overflow:hidden; border:1px solid rgba(148,163,184,.34); border-radius:10px; background:rgba(255,255,255,.97); box-shadow:0 8px 24px rgba(15,23,42,.15); color:var(--ink); }
.leaflet-tooltip.dispatch-map-tooltip::before { border-top-color:rgba(255,255,255,.97); }
.leaflet-tooltip.dispatch-map-tooltip.compact { padding:6px 9px; border-radius:999px; color:var(--ink-2); font-size:10px; font-weight:750; }
.dispatch-map-tooltip { display:flex; flex-direction:column; gap:2px; max-width:240px; padding:8px 10px; line-height:1.25; }
.dispatch-map-tooltip strong { overflow:hidden; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.dispatch-map-tooltip span { overflow:hidden; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.dispatch-map-tooltip small { margin-top:2px; color:var(--brand-700); font-size:9px; font-weight:750; }
.leaflet-popup.dispatch-map-stop-popup .leaflet-popup-content-wrapper { overflow:hidden; border:1px solid rgba(148,163,184,.34); border-radius:12px; background:rgba(255,255,255,.985); box-shadow:0 12px 32px rgba(15,23,42,.2); color:var(--ink); }
.leaflet-popup.dispatch-map-stop-popup .leaflet-popup-content { margin:0; font-family:inherit; line-height:1.3; }
.leaflet-popup.dispatch-map-stop-popup .leaflet-popup-tip { background:rgba(255,255,255,.985); box-shadow:3px 3px 8px rgba(15,23,42,.12); }
.dispatch-leaflet-map .leaflet-popup.dispatch-map-stop-popup .leaflet-popup-close-button { z-index:2; top:5px; right:5px; display:grid; place-items:center; width:28px; height:28px; border-radius:8px; color:var(--muted); font-family:inherit; font-size:20px; line-height:1; }
.dispatch-leaflet-map .leaflet-popup.dispatch-map-stop-popup .leaflet-popup-close-button:hover,.dispatch-leaflet-map .leaflet-popup.dispatch-map-stop-popup .leaflet-popup-close-button:focus { background:var(--surface-2); color:var(--ink); }
.dispatch-map-popup { display:flex; flex-direction:column; gap:7px; width:250px; padding:12px; text-align:left; }
.dispatch-map-popup-title { display:flex; align-items:center; gap:9px; min-width:0; padding-right:24px; }
.dispatch-map-popup-title>span { display:grid; place-items:center; width:27px; height:27px; flex:none; border:2px solid #fff; border-radius:50%; background:var(--marker); color:#fff; box-shadow:0 0 0 1px color-mix(in srgb,var(--marker) 35%,transparent); font-size:10px; font-weight:900; }
.dispatch-map-popup-title>div { display:flex; flex-direction:column; min-width:0; }
.dispatch-map-popup-title strong { overflow:hidden; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.dispatch-map-popup-title small { overflow:hidden; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.dispatch-map-popup-meta { display:flex; align-items:center; gap:5px; color:var(--ink-2); font-size:11px; font-weight:750; }
.dispatch-map-popup-address { display:-webkit-box; overflow:hidden; color:var(--muted); font-size:10px; line-height:1.35; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.dispatch-map-popup-actions { display:flex; gap:7px; margin-top:3px; }
.dispatch-map-popup-actions .btn { flex:1; min-height:32px; padding:7px 8px; font-size:11px; }
.dispatch-map-popup-actions .btn:focus-visible { outline:none; box-shadow:var(--ring); }
.dispatch-map-fit { position:absolute; z-index:7; top:12px; left:12px; display:inline-flex; align-items:center; gap:5px; min-height:34px; padding:6px 10px; border:1px solid rgba(148,163,184,.42); border-radius:10px; background:rgba(255,255,255,.94); color:var(--ink-2); box-shadow:0 5px 18px rgba(15,23,42,.12); font:inherit; font-size:10px; font-weight:800; cursor:pointer; backdrop-filter:blur(7px); transition:opacity .12s,transform .12s,background .12s,color .12s; }
.dispatch-map-fit:hover { background:#fff; color:var(--brand-700); }
.dispatch-map-stage.has-stop-popup .dispatch-map-fit { opacity:0; pointer-events:none; transform:translateY(-4px); }
.dispatch-map-status { position:absolute; z-index:8; display:flex; align-items:center; justify-content:center; gap:8px; color:var(--muted); font-size:11px; font-weight:700; }
.dispatch-map-status[hidden] { display:none; }
.dispatch-map-status.is-loading { inset:0; background:linear-gradient(145deg,rgba(248,250,252,.84),rgba(239,246,243,.84)); backdrop-filter:blur(2px); }
.dispatch-map-status.is-loading .spinner { width:18px; height:18px; }
.dispatch-map-status.is-error { top:12px; right:58px; left:112px; justify-content:flex-start; min-height:34px; padding:6px 9px; border:1px solid color-mix(in srgb,var(--warn) 24%,transparent); border-radius:10px; background:rgba(255,251,235,.96); color:#92400e; box-shadow:0 5px 18px rgba(15,23,42,.12); backdrop-filter:blur(7px); }
.dispatch-map-status.is-error button { margin-left:auto; padding:2px 5px; border:0; background:transparent; color:#92400e; font:inherit; font-size:10px; font-weight:850; cursor:pointer; text-decoration:underline; }
.dispatch-map-empty { position:absolute; inset:0; z-index:4; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:28px; text-align:center; background:linear-gradient(145deg,rgba(248,250,252,.94),rgba(241,250,245,.94)); }
.dispatch-map-empty .ic { display:grid; place-items:center; width:42px; height:42px; margin-bottom:8px; border-radius:12px; background:var(--brand-tint); color:var(--brand); }
.dispatch-map-empty h3 { font-size:15px; }
.dispatch-map-empty p { max-width:340px; margin:5px 0 12px; color:var(--muted); font-size:12px; }
.dispatch-map-warning { display:flex; align-items:center; gap:6px; padding:7px 12px; border-top:1px solid color-mix(in srgb,var(--warn) 18%,transparent); background:var(--warn-tint); color:#9a5b05; font-size:11px; }
.dispatch-route-list { max-height:142px; overflow:auto; border-top:1px solid var(--line-2); background:var(--surface); }
.dispatch-route-list>p { margin:11px 13px; }
.dispatch-route-row { display:grid; grid-template-columns:8px minmax(0,1fr) auto; align-items:center; gap:8px; padding:8px 12px; border-bottom:1px solid var(--line-2); }
.dispatch-route-row:last-child { border-bottom:0; }
.dispatch-route-color { width:8px; height:28px; border-radius:999px; }
.dispatch-route-row div { display:flex; flex-direction:column; min-width:0; line-height:1.25; }
.dispatch-route-row b { overflow:hidden; color:var(--ink-2); font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.dispatch-route-row span { overflow:hidden; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.dispatch-route-row a { display:inline-flex; align-items:center; gap:3px; font-size:11px; font-weight:750; white-space:nowrap; }
.dispatch-map-credit { padding:5px 10px; border-top:1px solid var(--line-2); background:var(--surface-2); color:var(--muted-2); font-size:9px; text-align:center; }
.dispatch-timeline-scroll { flex:1; min-height:0; overflow:auto; background:var(--surface); scrollbar-color:#cbd5e1 transparent; }
.dispatch-timeline { display:grid; grid-template-columns:62px repeat(var(--lane-count),minmax(174px,1fr)); grid-template-rows:auto var(--timeline-height); align-items:start; }
.dispatch-time-head,.dispatch-lane-head { position:sticky; top:0; z-index:8; min-height:54px; border-bottom:1px solid var(--line); background:rgba(255,255,255,.96); backdrop-filter:blur(8px); }
.dispatch-time-head { left:0; z-index:10; display:flex; align-items:flex-end; padding:9px; color:var(--muted); font-size:10px; font-weight:800; text-transform:uppercase; }
.dispatch-lane-head { display:flex; align-items:center; gap:8px; min-width:0; padding:8px 10px; border-left:1px solid var(--line-2); }
.dispatch-lane-head>div { display:flex; flex-direction:column; min-width:0; line-height:1.25; }
.dispatch-lane-head b { overflow:hidden; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.dispatch-lane-head span:last-child { overflow:hidden; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.dispatch-lane-dot { width:9px; height:28px; flex:none; border-radius:999px; }
.dispatch-time-axis { position:sticky; left:0; z-index:6; grid-row:2; background:var(--surface); border-right:1px solid var(--line); }
.dispatch-time-axis span { position:absolute; left:0; right:0; padding-right:8px; transform:translateY(-50%); color:var(--muted); font-size:10px; font-weight:700; text-align:right; white-space:nowrap; }
.dispatch-time-axis span:first-child { transform:none; }
.dispatch-lane { position:relative; grid-row:2; min-width:0; overflow:hidden; border-right:1px solid var(--line-2); background-color:var(--surface); background-image:linear-gradient(to bottom,var(--line) 1px,transparent 1px),linear-gradient(to bottom,color-mix(in srgb,var(--line-2) 75%,transparent) 1px,transparent 1px); background-size:100% 72px,100% 36px; }
.dispatch-lane::before { content:""; position:absolute; inset:0 auto 0 0; width:2px; background:color-mix(in srgb,var(--lane-color) 38%,transparent); }
.dispatch-lane-empty { position:absolute; top:15px; left:10px; color:var(--muted-2); font-size:10px; }
.dispatch-job { position:absolute; z-index:2; left:6px; right:6px; display:flex; flex-direction:column; min-height:30px; overflow:hidden; padding:5px 7px 5px 9px; border:1px solid color-mix(in srgb,var(--job-color) 35%,var(--line)); border-left:3px solid var(--job-color); border-radius:7px; background:color-mix(in srgb,var(--job-color) 9%,#fff); color:var(--ink); box-shadow:0 1px 2px rgba(15,23,42,.08); line-height:1.17; text-decoration:none; cursor:pointer; transition:transform .12s,box-shadow .12s,z-index .12s; }
.dispatch-job:hover { z-index:5; transform:translateY(-1px); box-shadow:0 5px 14px rgba(15,23,42,.14); text-decoration:none; }
.dispatch-job:target { z-index:6; outline:3px solid color-mix(in srgb,var(--job-color) 40%,transparent); outline-offset:2px; }
.dispatch-job-time { display:flex; align-items:center; justify-content:space-between; gap:5px; color:color-mix(in srgb,var(--job-color) 72%,#0f172a); font-size:10px; font-weight:850; font-variant-numeric:tabular-nums; }
.dispatch-job-time em { padding:1px 4px; border-radius:999px; background:var(--ok-tint); color:#15803d; font-size:9px; font-style:normal; letter-spacing:.02em; text-transform:uppercase; }
.dispatch-job .schedule-customer-link { margin-top:2px; font-size:11px; }
.dispatch-job small { overflow:hidden; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.dispatch-job.suggested { border-style:dashed; background:repeating-linear-gradient(135deg,color-mix(in srgb,var(--job-color) 11%,#fff) 0 8px,color-mix(in srgb,var(--job-color) 5%,#fff) 8px 16px); }
.dispatch-job.status-completed { opacity:.68; filter:saturate(.55); }
.dispatch-job.status-no_show { --job-color:var(--danger)!important; }
.dispatch-job.map-selected { z-index:6; outline:2px solid color-mix(in srgb,var(--job-color) 72%,#fff); outline-offset:1px; background:color-mix(in srgb,var(--job-color) 16%,#fff); }
.dispatch-job.map-focus { z-index:7; animation:dispatch-map-focus 1.35s ease both; }
@keyframes dispatch-map-focus { 0%,100% { box-shadow:0 1px 2px rgba(15,23,42,.08); } 22%,70% { box-shadow:0 0 0 4px color-mix(in srgb,var(--job-color) 22%,transparent),0 7px 20px rgba(15,23,42,.18); } }

@media (max-width: 1250px) {
  .dispatch-workspace { height:auto; }
  .dispatch-map-panel { min-height:600px; }
  .dispatch-calendar-panel { min-height:680px; }
}
@media (max-width: 940px) {
  .daily-plan-launch { grid-template-columns:auto minmax(0,1fr); }
  .daily-plan-launch-stats { grid-column:1/-1; justify-content:flex-start; }
  .dispatch-map-layout { grid-template-columns:minmax(0,1fr); height:auto; }
  .dispatch-map-stage { min-height:460px; }
  .dispatch-stop-panel { max-height:380px; border-top:1px solid var(--line); border-left:0; }
}
@media (max-width: 760px) {
  .content.schedule-content-wide { padding:14px 12px 36px; }
  .sched-nav { flex-wrap:wrap; }
  .sched-title { order:-1; flex-basis:100%; min-width:0; }
  .sched-controls { flex-wrap:wrap; }
  .sched-route-button { margin-left:0; }
  .dispatch-filterbar { align-items:flex-start; flex-direction:column; }
  .dispatch-filter-note { justify-content:flex-start; text-align:left; }
  .dispatch-rep-chips { flex-wrap:nowrap; width:calc(100vw - 54px); overflow-x:auto; padding-bottom:3px; }
  .dispatch-rep-chip,.dispatch-clear { flex:none; min-height:42px; }
  .dispatch-panel-head { align-items:flex-start; flex-direction:column; }
  .dispatch-map-metrics { justify-content:flex-start; }
  .dispatch-route-summary { align-items:flex-start; }
  .dispatch-map-panel { min-height:440px; }
  .dispatch-map-fit span { display:none; }
  .dispatch-map-status.is-error { left:54px; }
  .dispatch-route-list { max-height:126px; }
  .dispatch-calendar-panel { min-height:650px; }
  .dispatch-timeline { grid-template-columns:58px repeat(var(--lane-count),minmax(164px,1fr)); }
  .daily-plan-head { padding:16px 15px 12px; }
  .daily-plan-stepper { grid-template-columns:repeat(4,minmax(105px,1fr)); overflow-x:auto; padding:0 15px 12px; }
  .daily-plan-content { padding:16px 15px; }
  .daily-plan-status-grid,.daily-plan-checklist { grid-template-columns:1fr; }
  .daily-plan-route-grid { grid-template-columns:1fr; }
  .daily-plan-selected { align-items:flex-start; flex-direction:column; }
  .daily-plan-loads { justify-content:flex-start; }
  .daily-plan-footer { padding:11px 15px; }
  .schedule-week-ribbon { grid-template-columns:1fr; }
  .schedule-week-ribbon-copy { display:grid; grid-template-columns:auto auto; align-items:end; gap:2px 8px; }
  .schedule-week-ribbon-copy .dispatch-eyebrow,.schedule-week-ribbon-copy small { grid-column:1/-1; }
  .schedule-week-ribbon-days { min-width:500px; }
  .schedule-week-ribbon { overflow-x:auto; }
  .dispatch-map-guide em { flex-basis:100%; margin-left:0; }
}

@media (max-width: 1000px) {
  .week-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .appointment-create-grid { grid-template-columns:1fr; gap:4px; }
  .appointment-time-slots { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .appointment-date-action { display:none; }
  .sched-nav { gap:9px; padding:11px; }
  .sched-nav-buttons { flex:1; }
  .sched-nav-buttons #today { flex:1; }
  .sched-jump { margin-left:auto; }
  .sched-jump>span { display:none; }
  .sched-toolbar input.sched-date-jump { width:132px; }
  .sched-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:10px 11px; }
  .sched-control .segmented { display:grid; width:100%; }
  .sched-control:not(.sched-tech-control) .segmented { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .sched-control:not(.sched-tech-control) .sched-mode { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .sched-tech-control { grid-column:1 / -1; }
  .sched-tech-control select { width:100%; }
  .sched-route-button { grid-column:1 / -1; width:100%; margin:0; }
  .sched-toolbar .segmented button { padding-inline:8px; }
  .week-grid { grid-template-columns:minmax(0,1fr); }
  .daily-plan-launch { grid-template-columns:1fr; padding:16px; }
  .daily-plan-launch-icon { display:none; }
  .daily-plan-launch-stats { grid-column:auto; }
  .daily-plan-launch-stats>span { flex:1; justify-content:center; }
  .daily-plan-launch-stats .btn { width:100%; }
  .daily-plan-footer>span { display:none; }
  .daily-plan-footer .btn { flex:1; }
  .dispatch-surfacebar { align-items:flex-start; flex-direction:column; }
  .dispatch-surfacebar .segmented { display:grid; grid-template-columns:1fr 1fr; width:100%; }
  .dispatch-map-stage { min-height:390px; }
  .month-grid { gap:4px; }
  .m-cell { min-height:64px; }
  .m-cell { padding:5px 4px; border-radius:8px; }
  .m-cell .cap-pill { padding:1px 5px; font-size:10px; }
  .m-dots { gap:2px; margin-top:6px; }
  .m-dot { width:6px; height:6px; }
  .slot-row { gap:8px; }
  .slot-row .time { width:62px; font-size:12px; }
  .slot-row .job .row.between { align-items:flex-start; gap:8px; }
}

/* Customer PDF shortcuts */
.customer-doc-card { overflow:hidden; border:1px solid color-mix(in srgb,var(--brand) 18%,var(--line)); border-radius:14px; background:linear-gradient(145deg,var(--surface) 0%,color-mix(in srgb,var(--brand-tint) 42%,var(--surface)) 100%); box-shadow:var(--shadow-sm); }
.customer-doc-card-head { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 16px 11px; border-bottom:1px solid color-mix(in srgb,var(--brand) 10%,var(--line-2)); }
.customer-doc-card-head h4 { margin:2px 0 0; font-size:15px; }
.customer-doc-kicker { display:block; color:var(--brand-700); font-size:9px; font-weight:850; letter-spacing:.09em; line-height:1.2; text-transform:uppercase; }
.customer-doc-ready { display:inline-flex; align-items:center; gap:5px; padding:4px 8px; border-radius:999px; background:var(--ok-tint); color:var(--ok); font-size:10px; font-weight:800; white-space:nowrap; }
.customer-doc-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; padding:11px; }
.customer-doc-button { display:grid; grid-template-columns:34px minmax(0,1fr) 18px; align-items:center; gap:10px; min-height:86px; padding:12px; border:1px solid var(--line); border-radius:12px; background:rgba(255,255,255,.9); color:var(--ink); font:inherit; text-align:left; cursor:pointer; transition:transform .14s,border-color .14s,box-shadow .14s,background .14s; }
.customer-doc-button:hover { transform:translateY(-1px); border-color:color-mix(in srgb,var(--brand) 35%,var(--line)); background:#fff; box-shadow:0 8px 20px rgba(15,23,42,.08); }
.customer-doc-button:focus-visible { outline:none; box-shadow:var(--ring); }
.customer-doc-button:disabled { transform:none; opacity:.72; cursor:wait; }
.customer-doc-button>.spinner { justify-self:center; grid-column:1; }
.customer-doc-icon { display:grid; place-items:center; width:34px; height:34px; border-radius:10px; background:var(--brand-tint); color:var(--brand-700); }
.customer-doc-icon.agreement { background:var(--info-tint); color:var(--info); }
.customer-doc-button strong,.customer-doc-button small { display:block; }
.customer-doc-button strong { margin-bottom:3px; font-size:12px; line-height:1.25; }
.customer-doc-button small { color:var(--muted); font-size:10px; line-height:1.35; }
.customer-doc-arrow { color:var(--muted-2); font-size:17px; text-align:center; transition:color .14s,transform .14s; }
.customer-doc-button:hover .customer-doc-arrow { transform:translateX(2px); color:var(--brand); }
.customer-doc-modal-head { align-items:flex-start; }
.customer-doc-modal-head h3 { margin-top:3px; }
.customer-doc-modal-head p { max-width:570px; margin:4px 0 0; color:var(--muted); font-size:11px; }
.customer-doc-modal { display:flex; flex-direction:column; max-height:88vh; }
.customer-doc-modal>.modal-body { min-height:0; overflow-y:auto; }
.customer-doc-modal>.modal-foot { flex:none; }
.customer-doc-form { display:flex; flex-direction:column; gap:3px; }
.doc-frequency { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.doc-frequency label { position:relative; display:block; cursor:pointer; }
.doc-frequency input { position:absolute; opacity:0; pointer-events:none; }
.doc-frequency span { display:flex; flex-direction:column; min-height:60px; justify-content:center; padding:10px 13px; border:1px solid var(--line); border-radius:11px; background:var(--surface); color:var(--ink-2); font-size:13px; font-weight:800; transition:border-color .12s,background .12s,box-shadow .12s; }
.doc-frequency small { margin-top:3px; color:var(--muted); font-size:10px; font-weight:500; }
.doc-frequency input:checked+span { border-color:var(--brand); background:var(--brand-tint); color:var(--brand-700); box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--brand) 16%,transparent); }
.doc-frequency input:focus-visible+span { box-shadow:var(--ring); }
.money-input { display:flex; align-items:center; overflow:hidden; border:1px solid var(--line); border-radius:10px; background:var(--surface); transition:border-color .12s,box-shadow .12s; }
.money-input:focus-within { border-color:var(--brand); box-shadow:var(--ring); }
.money-input>span { padding-left:12px; color:var(--muted); font-size:13px; font-weight:750; }
.money-input input { border:0; box-shadow:none!important; }
.doc-total-preview { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 12px; padding:10px 13px; border:1px solid color-mix(in srgb,var(--brand) 16%,var(--line)); border-radius:11px; background:var(--brand-tint-2); color:var(--ink-2); font-size:11px; }
.doc-total-preview strong { color:var(--brand-700); font-size:16px; font-variant-numeric:tabular-nums; }
.doc-autofill-note { display:flex; align-items:flex-start; gap:8px; padding:10px 12px; border-radius:10px; background:var(--surface-2); color:var(--muted); font-size:10px; line-height:1.45; }
.doc-autofill-note svg { flex:none; margin-top:1px; color:var(--brand); }
@media (max-width: 620px) {
  .customer-doc-grid,.doc-frequency { grid-template-columns:1fr; }
  .customer-doc-button { min-height:80px; }
}

/* Drag-and-drop reschedule (week view) */
.wc-job.movable { cursor: grab; }
.wc-job.dragging { opacity:.45; cursor:grabbing; }
.week-col.drop-target { outline:2px dashed var(--brand); outline-offset:-3px; background:var(--brand-tint); }
.week-col.drop-target .wc-body { min-height:40px; }
@media print {
  .sidebar, .topbar, .app-actions, #picker, #printBtn, #csvBtn { display:none !important; }
  .app-main, .content { margin:0 !important; padding:0 !important; }
  .card { box-shadow:none !important; border:1px solid #e2e8f0 !important; }
  body { background:#fff !important; }
}

@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; z-index: 120; width: 260px; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-toggle { display: inline-flex; }
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .content { padding: 18px 16px 60px; }
  .topbar { padding: 14px 16px; }
  .li-row { grid-template-columns:minmax(0,1fr) 64px 122px 48px 24px; }
  .daygrid { grid-template-columns:minmax(120px,1fr) 1fr 1fr; }
  .daygrid label { grid-column:2 / 4; }
}
@media (max-width: 560px) {
  .appointment-when { padding:13px; }
  .appointment-time-heading { align-items:flex-start; flex-direction:column; }
  .appointment-custom-time { padding-left:0; }
  .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .grid[style] { grid-template-columns: 1fr !important; }
  .topbar h1 { font-size: 17px; }
  .modal-foot { flex-wrap: wrap; }
  .li-row { grid-template-columns:1fr 70px 1fr 46px 24px; }
  .li-row .l_label { grid-column:1 / -1; }
  .daygrid { grid-template-columns:1fr 1fr; }
  .daygrid > span { grid-column:1 / -1; }
  .daygrid label { grid-column:1 / -1; }
}
