/* Self-hosted fonts (work offline; no Google Fonts requests) */
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/jost-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/jost-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 600; font-display: swap; src: url("assets/fonts/jost-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/jost-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/plus-jakarta-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("assets/fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 800; font-display: swap; src: url("assets/fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2"); }

/* ==========================================================================
   Delivery Dashboard Demo — styles
   Palette: navy / slate + one accent (blue). Font: Inter.
   ========================================================================== */

:root {
  --navy: #0b1526;
  --navy-2: #132239;
  --navy-3: #1c2f4d;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --accent: #2f7cf6;
  --accent-600: #1f66dc;
  --accent-50: #eaf2ff;
  --accent-100: #d6e6ff;
  --green: #15803d;
  --green-50: #ecfdf3;
  --amber: #b45309;
  --amber-50: #fff7e6;
  --red: #b91c1c;
  --red-50: #fef2f2;
  --purple: #6d28d9;
  --purple-50: #f3eeff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 18px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .18);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Jost', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button:focus:not(:focus-visible) { outline: none; }
html, body { margin: 0; padding: 0; }
html.locked, html.locked body { overscroll-behavior: none; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--slate-800);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--slate-900); letter-spacing: -0.01em; }
h1 { font-size: 24px; font-weight: 600; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--accent-600); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.small svg, .tiny svg { width: 13px; height: 13px; color: var(--slate-400); }
.muted { color: var(--slate-500); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 600; color: var(--slate-900); }
.mono { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.g-main-side { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.grid.g-side-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.grid.g-three { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); }
.grid > * { min-width: 0; }
.fade-in { animation: fadeIn .25s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-out { opacity: 0; transition: opacity .25s ease; }
.hidden { display: none !important; }
hr.sep { border: 0; border-top: 1px solid var(--slate-200); margin: 16px 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--slate-200); background: var(--surface); color: var(--slate-800);
  font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s; white-space: nowrap; line-height: 1.3;
}
.btn:hover { background: var(--slate-50); border-color: var(--slate-300); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-600); border-color: var(--accent-600); }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.navy:hover { background: var(--navy-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--slate-600); }
.btn.ghost:hover { background: var(--slate-100); color: var(--slate-900); }
.btn.danger { background: var(--red-50); border-color: #fecaca; color: var(--red); }
.btn.danger:hover { background: #fee2e2; }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.success:hover { filter: brightness(.95); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.lg { padding: 12px 18px; font-size: 15px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.icon { padding: 7px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards / KPIs ---------- */
.card { background: var(--surface); border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px 20px; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--slate-600); font-weight: 600; }
.kpi { padding: 16px 18px; }
.kpi .label { font-size: 12px; color: var(--slate-500); font-weight: 500; }
.kpi .value { font-size: 24px; font-weight: 800; color: var(--slate-900); margin-top: 4px; letter-spacing: -0.02em; }
.kpi .delta { font-size: 12px; margin-top: 4px; color: var(--slate-500); }
.kpi .delta.up { color: var(--green); }
.kpi .delta.warn { color: var(--amber); }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px;
  font-weight: 600; background: var(--slate-100); color: var(--slate-700); white-space: nowrap; line-height: 1.4;
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip.draft, .chip.expired, .chip.unpaid { background: var(--slate-100); color: var(--slate-600); }
.chip.sent, .chip.scheduled { background: var(--accent-50); color: var(--accent-600); }
.chip.viewed { background: var(--purple-50); color: var(--purple); }
.chip.approved, .chip.delivered, .chip.paid, .chip.active { background: var(--green-50); color: var(--green); }
.chip.declined, .chip.failed, .chip.overdue { background: var(--red-50); color: var(--red); }
.chip.enroute, .chip.partial, .chip.pending { background: var(--amber-50); color: var(--amber); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; background: var(--slate-100); color: var(--slate-600); }
.tag.biz { background: var(--navy); color: #fff; }
.tag.auto { background: var(--amber-50); color: var(--amber); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label, .label { font-size: 11px; font-weight: 600; color: var(--slate-500); text-transform: uppercase; letter-spacing: .08em; }
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: 13.5px; padding: 8px 11px; border: 1px solid var(--slate-300); border-radius: var(--radius-sm);
  background: #fff; color: var(--slate-900); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-50); }
.textarea { min-height: 70px; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.input.sm, .select.sm { padding: 5px 8px; font-size: 12.5px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { min-width: 0; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .addon { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--slate-300); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--slate-50); color: var(--slate-500); font-size: 12.5px; font-weight: 600; }
.segmented { display: inline-flex; background: var(--slate-100); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; padding: 6px 12px; font-size: 12.5px; font-weight: 600; border-radius: 7px; color: var(--slate-600); cursor: pointer; }
.segmented button.active { background: #fff; color: var(--slate-900); box-shadow: var(--shadow-sm); }
.toggle { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--slate-300); border: 0; cursor: pointer; transition: background .15s; flex-shrink: 0; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(16px); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--slate-300); border-radius: var(--radius-sm); overflow: hidden; }
.stepper button { border: 0; background: var(--slate-50); width: 30px; height: 32px; cursor: pointer; font-size: 16px; color: var(--slate-700); }
.stepper button:hover { background: var(--slate-100); }
.stepper span { min-width: 34px; text-align: center; font-weight: 600; font-size: 13px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--slate-500); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--slate-200); background: var(--slate-50); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--slate-50); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--slate-100); }
.list-item:first-child { border-top: 0; }
.list-item.clickable { cursor: pointer; margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }
.list-item.clickable:hover { background: var(--slate-50); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-50); color: var(--accent-600); font-weight: 700; font-size: 12px; display: grid; place-items: center; flex-shrink: 0; }
.avatar.navy { background: var(--navy); color: #fff; }
.empty { padding: 28px; text-align: center; color: var(--slate-500); font-size: 13px; }

/* ---------- Tabs / filters ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--slate-200); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--slate-500); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--accent-600); border-bottom-color: var(--accent); }
.tabs button .count { font-size: 11px; background: var(--slate-100); border-radius: 999px; padding: 1px 6px; margin-left: 4px; color: var(--slate-600); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .input { max-width: 260px; }
.pill-filter { border: 1px solid var(--slate-200); background: #fff; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--slate-600); cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.pill-filter.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Owner layout ---------- */
.owner { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
.owner.collapsed { grid-template-columns: 72px minmax(0, 1fr); }
.owner > div { min-width: 0; }
.sidebar { background: var(--navy); color: #fff; padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.collapsed .sidebar { padding: 20px 12px; align-items: center; }
.collapsed .brand-text, .collapsed .nav a span, .collapsed .side-cta span, .collapsed .foot span, .collapsed .nav a .badge { display: none; }
.collapsed .nav a, .collapsed .side-cta, .collapsed .foot .btn { justify-content: center; padding: 10px; width: 44px; }
.collapsed .brand { padding: 6px 0 18px; }
.side-cta { margin: 0 4px 10px; justify-content: flex-start; gap: 8px; background: var(--accent) !important; border-color: var(--accent) !important; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px; margin-top: auto; }
.side-user .avatar { background: var(--accent); color: #fff; width: 32px; height: 32px; }
.side-user .su-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.side-user b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user small { font-size: 11px; color: rgba(255,255,255,.55); }
.collapsed .side-user .su-text { display: none; }
.collapsed .side-user { padding: 10px 0; }
.side-cta svg { width: 16px; height: 16px; }
.sidebar .foot { display: flex; flex-direction: column; gap: 4px; }
.sidebar .foot .btn { color: rgba(255,255,255,.65); justify-content: flex-start; }
.sidebar .foot .btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
.brand .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.brand .logo svg { width: 20px; height: 20px; }
.brand b { font-size: 13.5px; display: block; line-height: 1.2; }
.brand span { font-size: 11px; color: rgba(255,255,255,.55); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: rgba(255,255,255,.72); font-weight: 500; font-size: 13.5px; text-decoration: none; transition: background .15s, color .15s; }
.nav a svg { width: 17px; height: 17px; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav a .badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.nav a { position: relative; }
.sidebar .foot { margin-top: 0; padding: 12px 0 0; font-size: 11.5px; color: rgba(255,255,255,.45); border-top: 1px solid rgba(255,255,255,.08); }
.owner-main { padding: 66px 32px 60px; max-width: 1400px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--slate-500); font-size: 13px; margin-top: 3px; }
.breadcrumb { font-size: 12.5px; color: var(--slate-500); margin-bottom: 8px; }
.breadcrumb a { color: var(--slate-500); }
.mobile-topbar, .mobile-nav, .m-nav { display: none; }
.topbar-gear { margin-left: auto; color: rgba(255,255,255,.8); }
.topbar-gear.active { background: rgba(255,255,255,.14); color: #fff; }

/* Quote builder */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.builder .pricing { position: sticky; top: 20px; }
.pricing-lines { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.pricing-lines .line { display: flex; justify-content: space-between; gap: 12px; }
.pricing-lines .line .lbl { color: var(--slate-600); }
.pricing-lines .line .amt { font-variant-numeric: tabular-nums; font-weight: 500; }
.pricing-lines .line.sub { border-top: 1px solid var(--slate-200); padding-top: 8px; margin-top: 4px; font-weight: 600; }
.pricing-lines .line.total { border-top: 2px solid var(--slate-900); padding-top: 10px; margin-top: 6px; font-size: 18px; font-weight: 800; color: var(--slate-900); }
.pricing-lines .line.total .amt { font-weight: 800; }
.pricing-lines .line.tax .lbl { color: var(--slate-500); }
.pricing-lines .line.adj .amt { color: var(--amber); }
.pricing-lines .line.deposit { background: var(--accent-50); padding: 8px 10px; border-radius: 8px; color: var(--accent-600); font-weight: 600; margin-top: 8px; }
.pricing-lines .group-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-400); font-weight: 700; margin-top: 8px; }
.stop-card { border: 1px solid var(--slate-200); border-radius: 10px; padding: 14px; background: var(--slate-50); }
.stop-card .stop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.stop-num { width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.stop-num.pickup { background: var(--accent); }
.stop-num.dropoff { background: var(--green); }
.access-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.item-row { display: grid; grid-template-columns: 1.4fr .6fr .8fr 1.4fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.preset-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.preset-chips button { border: 1px dashed var(--slate-300); background: #fff; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--slate-600); cursor: pointer; }
.preset-chips button:hover { border-color: var(--accent); color: var(--accent-600); background: var(--accent-50); }
.addon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.addon-tile { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--slate-200); border-radius: 9px; padding: 10px 12px; cursor: pointer; background: #fff; font-size: 13px; }
.addon-tile.on { border-color: var(--accent); background: var(--accent-50); }
.addon-tile .price { font-size: 12px; color: var(--slate-500); }

/* Timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--slate-200); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--slate-300); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--slate-300); }
.tl-item.done::before { background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.tl-item.blue::before { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tl-item.red::before { background: var(--red); box-shadow: 0 0 0 1px var(--red); }
.tl-item .when { font-size: 11.5px; color: var(--slate-500); }
.tl-item .what { font-weight: 600; color: var(--slate-900); font-size: 13px; }
.tl-item .note { font-size: 12.5px; color: var(--slate-600); margin-top: 2px; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; min-width: 860px; }
.cal-wrap { overflow-x: auto; }
.cal-day { background: var(--slate-50); border: 1px solid var(--slate-200); border-radius: 10px; padding: 8px; min-height: 240px; }
.cal-day.today { background: var(--accent-50); border-color: var(--accent-100); }
.cal-day .dhead { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; padding: 2px 4px; }
.cal-day .dhead b { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--slate-500); }
.cal-day .dhead span { font-size: 16px; font-weight: 800; color: var(--slate-900); }
.cal-day.today .dhead span { color: var(--accent-600); }
.cal-job { background: #fff; border: 1px solid var(--slate-200); border-left: 3px solid var(--accent); border-radius: 7px; padding: 7px 9px; margin-bottom: 6px; cursor: pointer; font-size: 12px; box-shadow: var(--shadow-sm); transition: box-shadow .15s; }
.cal-job:hover { box-shadow: var(--shadow); }
.cal-job.delivered { border-left-color: var(--green); }
.cal-job.enroute { border-left-color: var(--amber); }
.cal-job.failed { border-left-color: var(--red); }
.cal-job.unassigned { border-left-color: var(--slate-300); border-style: dashed; }
.cal-job b { display: block; font-size: 12.5px; color: var(--slate-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-job .meta { color: var(--slate-500); font-size: 11px; display: flex; justify-content: space-between; margin-top: 2px; }
.cal-day .add { display: block; width: 100%; border: 1px dashed var(--slate-300); background: transparent; color: var(--slate-500); font-size: 11.5px; padding: 5px; border-radius: 7px; cursor: pointer; margin-top: 4px; }

/* Day planner route */
.route-list { display: flex; flex-direction: column; gap: 8px; transition: opacity .3s; }
.route-stop { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--slate-200); border-radius: 10px; background: #fff; transition: transform .35s ease, opacity .3s ease; }
.route-stop .idx { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center; flex-shrink: 0; }
.route-stop.p .idx { background: var(--accent); }
.route-stop.d .idx { background: var(--green); }
.route-banner { background: var(--green-50); border: 1px solid #bbf7d0; color: var(--green); border-radius: 10px; padding: 12px 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; }

/* Map placeholder */
.map { width: 100%; border-radius: 10px; overflow: hidden; background: #e8edf3; border: 1px solid var(--slate-200); aspect-ratio: 16/9; position: relative; }
.map svg { width: 100%; height: 100%; display: block; }
.map.tall { aspect-ratio: 4/3; }
.map-label { position: absolute; left: 10px; bottom: 8px; font-size: 10.5px; color: var(--slate-500); background: rgba(255,255,255,.85); padding: 2px 7px; border-radius: 5px; }

/* Signature pad */
.sigpad { border: 1px dashed var(--slate-300); border-radius: 10px; background: #fff; position: relative; touch-action: none; }
.sigpad canvas { width: 100%; height: 150px; display: block; border-radius: 10px; cursor: crosshair; }
.sigpad .hint { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 11px; color: var(--slate-400); pointer-events: none; }
.sigpad .clear { position: absolute; top: 6px; right: 6px; }
.sig-img { max-height: 70px; border: 1px solid var(--slate-200); border-radius: 8px; background: #fff; padding: 4px; }
.pod-photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; border: 1px solid var(--slate-200); background: var(--slate-100); }
.pod-photo.sm { width: 84px; aspect-ratio: 1; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo-grid figure { margin: 0; }
.photo-grid figcaption { font-size: 11px; color: var(--slate-500); margin-top: 4px; }
.photo-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1px dashed var(--slate-300); border-radius: 10px; padding: 18px; background: var(--slate-50); cursor: pointer; color: var(--slate-600); font-weight: 600; font-size: 13px; }
.photo-btn:hover { border-color: var(--accent); background: var(--accent-50); }
.photo-btn input { display: none; }
.photo-btn svg { width: 24px; height: 24px; }

/* Steps (tracking) */
.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 12px; align-items: flex-start; position: relative; padding-bottom: 18px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--slate-200); }
.step:last-child::before { display: none; }
.step .ic { width: 28px; height: 28px; border-radius: 50%; background: var(--slate-100); color: var(--slate-400); display: grid; place-items: center; flex-shrink: 0; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--slate-200); }
.step .ic svg { width: 14px; height: 14px; }
.step.done .ic { background: var(--green); color: #fff; box-shadow: 0 0 0 1px var(--green); }
.step.done::before { background: var(--green); }
.step.current .ic { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-50); }
.step.failed .ic { background: var(--red); color: #fff; box-shadow: 0 0 0 1px var(--red); }
.step b { display: block; font-size: 13.5px; color: var(--slate-900); }
.step span { font-size: 12px; color: var(--slate-500); }
.step.pending b { color: var(--slate-400); }

/* Message bubbles */
.msgs { display: flex; flex-direction: column; gap: 8px; }
.bubble { background: var(--slate-100); border-radius: 14px 14px 14px 4px; padding: 9px 12px; font-size: 12.5px; max-width: 92%; color: var(--slate-800); animation: fadeIn .25s ease both; }
.bubble .from { font-size: 10.5px; color: var(--slate-500); font-weight: 600; margin-bottom: 2px; display: flex; gap: 6px; align-items: center; }
.bubble .from .ch { background: #fff; padding: 0 5px; border-radius: 4px; font-size: 9.5px; letter-spacing: .04em; }
.bubble a { font-weight: 600; }
.bubble.email { background: var(--accent-50); }
.bubble .time { font-size: 10px; color: var(--slate-400); text-align: right; margin-top: 2px; }

/* ---------- Phone frame ---------- */
.phone-stage { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 60px 16px 40px; background: radial-gradient(1200px 600px at 50% -10%, #e4ebf7, var(--bg)); }
.phone { width: 390px; height: 800px; max-height: calc(100vh - 80px); background: #0a0a0a; border-radius: 46px; padding: 12px; box-shadow: 0 30px 70px rgba(15,23,42,.35), inset 0 0 0 2px #2a2a2a; position: relative; flex-shrink: 0; }
.phone::before { content: ''; position: absolute; top: 22px; left: 50%; transform: translateX(-50%); width: 110px; height: 26px; background: #0a0a0a; border-radius: 999px; z-index: 5; }
.screen { background: var(--bg); border-radius: 36px; height: 100%; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.statusbar { height: 46px; flex-shrink: 0; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 26px 6px; font-size: 12px; font-weight: 600; color: var(--slate-900); }
.statusbar .sig { display: flex; gap: 4px; align-items: center; }
.screen-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px 28px; }
.screen-body::-webkit-scrollbar { width: 0; }
.app-head { display: flex; align-items: center; gap: 10px; padding: 6px 0 12px; }
.app-head .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--navy); display: grid; place-items: center; flex-shrink: 0; }
.app-head .logo svg { width: 20px; height: 20px; }
.app-head b { display: block; font-size: 14px; }
.app-head span { font-size: 11.5px; color: var(--slate-500); }
.app-head .back { margin-right: 2px; }
.m-card { background: #fff; border: 1px solid var(--slate-200); border-radius: 14px; padding: 14px; box-shadow: var(--shadow-sm); }
.m-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--slate-900); }
.m-total { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--slate-900); }
.m-lines { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.m-lines .line { display: flex; justify-content: space-between; gap: 10px; }
.m-lines .line .lbl { color: var(--slate-600); }
.m-lines .line.total { border-top: 1px solid var(--slate-200); padding-top: 8px; margin-top: 4px; font-weight: 700; font-size: 14px; }
.m-route { display: flex; flex-direction: column; gap: 10px; }
.m-route .rs { display: flex; gap: 10px; align-items: flex-start; }
.m-route .rs .pin { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.m-route .rs .pin.p { background: var(--accent); }
.m-route .rs .pin.d { background: var(--green); }
.m-route .rs b { display: block; font-size: 13px; }
.m-route .rs span { font-size: 12px; color: var(--slate-500); }
.m-tabbar { flex-shrink: 0; display: flex; border-top: 1px solid var(--slate-200); background: #fff; padding: 8px 6px 18px; }
.m-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--slate-400); text-decoration: none; }
.m-tabbar a svg { width: 20px; height: 20px; }
.m-tabbar a.active { color: var(--accent-600); }
.success-hero { text-align: center; padding: 30px 10px 10px; }
.success-hero .ring { width: 72px; height: 72px; border-radius: 50%; background: var(--green-50); color: var(--green); display: grid; place-items: center; margin: 0 auto 14px; animation: pop .35s ease both; }
.success-hero .ring svg { width: 34px; height: 34px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.stop-tile { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--slate-200); border-radius: 14px; padding: 14px; }
.stop-tile .n { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; font-size: 13px; }
.stop-tile.p .n { background: var(--accent); }
.stop-tile.d .n { background: var(--green); }
.stop-tile.done { opacity: .6; }
.access-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.access-tags span { font-size: 10.5px; font-weight: 600; background: var(--slate-100); color: var(--slate-600); padding: 2px 7px; border-radius: 5px; }
.driver-step { border-left: 3px solid var(--slate-200); padding-left: 14px; margin-left: 6px; padding-bottom: 18px; }
.driver-step.active { border-left-color: var(--accent); }
.driver-step.done { border-left-color: var(--green); }
.driver-step h4 { font-size: 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.big-action { display: flex; gap: 8px; }
.big-action .btn { flex: 1; padding: 12px; font-size: 14px; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Login (portal) */
.login-stage { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--navy) 0%, var(--navy-3) 100%); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 32px; box-shadow: var(--shadow-lg); }
.portal { min-height: 100vh; }
.portal-top { background: var(--navy); color: #fff; padding: 0 380px 0 32px; height: 60px; display: flex; align-items: center; gap: 24px; }
.portal-top .brand { padding: 0; }
.portal-top nav { display: flex; gap: 4px; margin-left: 12px; }
.portal-top nav a { color: rgba(255,255,255,.7); font-weight: 600; font-size: 13.5px; padding: 8px 12px; border-radius: 8px; text-decoration: none; }
.portal-top nav a.active, .portal-top nav a:hover { color: #fff; background: rgba(255,255,255,.1); }
.portal-top .user { margin-left: auto; font-size: 12.5px; color: rgba(255,255,255,.75); display: flex; align-items: center; gap: 10px; }
.portal-main { padding: 28px 32px 60px; max-width: 1100px; margin: 0 auto; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 18, 35, .55); z-index: 1000; display: grid; place-items: center; padding: 16px; animation: fadeIn .15s ease both; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; overscroll-behavior: contain; box-shadow: var(--shadow-lg); padding: 22px 24px; }
.modal.wide { max-width: 760px; }
.modal h3 { margin-bottom: 6px; font-size: 16px; }
.modal .modal-body { margin: 12px 0 18px; font-size: 13.5px; color: var(--slate-700); }
.modal .modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.modal .ok-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--green-50); color: var(--green); display: grid; place-items: center; margin-bottom: 10px; }
.crm-badge { display: inline-flex; align-items: center; gap: 5px; background: var(--purple-50); color: var(--purple); padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; }

/* Statement / invoice doc preview */
.doc { border: 1px solid var(--slate-200); border-radius: 10px; padding: 24px; background: #fff; font-size: 13px; }
.doc .doc-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.doc .doc-head h2 { font-size: 20px; }
.doc table { width: 100%; border-collapse: collapse; }
.doc th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--slate-500); padding: 6px 0; border-bottom: 1px solid var(--slate-300); }
.doc td { padding: 7px 0; border-bottom: 1px solid var(--slate-100); }
.doc td.num, .doc th.num { text-align: right; font-variant-numeric: tabular-nums; }
.doc .totals { margin-left: auto; width: 240px; margin-top: 12px; }
.doc .totals .line { display: flex; justify-content: space-between; padding: 3px 0; }
.doc .totals .line.total { border-top: 2px solid var(--slate-900); font-weight: 800; font-size: 15px; padding-top: 6px; margin-top: 4px; }

/* ---------- Toast ---------- */
.toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 1100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--slate-900); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 8px; animation: fadeIn .2s ease both; max-width: 90vw; }
.toast svg { width: 16px; height: 16px; color: #4ade80; flex-shrink: 0; }
.toast.info svg { color: #93c5fd; }

/* Attention items */
.attn { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--slate-200); background: #fff; }
.attn .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.attn .ic svg { width: 16px; height: 16px; }
.attn .ic.warn { background: var(--amber-50); color: var(--amber); }
.attn .ic.bad { background: var(--red-50); color: var(--red); }
.attn > svg { color: var(--slate-400); flex-shrink: 0; }
.attn b { display: block; font-size: 13px; color: var(--slate-900); }
.attn span { font-size: 12px; color: var(--slate-500); }

/* Templates */
.tpl { border: 1px solid var(--slate-200); border-radius: 10px; padding: 14px; background: var(--slate-50); }
.tpl .tpl-body { background: #fff; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; margin-top: 8px; border: 1px solid var(--slate-200); white-space: pre-wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid.g-three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid.g-three > :first-child { grid-column: span 2; }
  .grid.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .builder { grid-template-columns: 1fr; }
  .builder .pricing { position: static; }
}
@media (max-width: 900px) {
  .owner { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .mobile-topbar { display: flex; align-items: center; gap: 10px; background: var(--navy); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 50; }
  .m-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #fff; border-top: 1px solid var(--slate-200); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(15,23,42,.06); }
  .m-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--slate-500); text-decoration: none; padding: 4px 0; border-radius: 8px; position: relative; }
  .m-nav a svg { width: 21px; height: 21px; }
  .m-nav a.active { color: var(--accent-600); }
  .m-nav a .badge { position: absolute; top: 0; left: calc(50% + 6px); background: var(--accent); color: #fff; font-size: 9.5px; padding: 0 5px; border-radius: 999px; }
  .mobile-topbar .brand { padding: 0; }

  .owner-main { padding: 18px 16px 90px; }
  .login-stage { padding-bottom: 90px; }
  body { overflow-x: hidden; }
  .grid.cols-3, .grid.cols-2, .grid.g-main-side, .grid.g-side-main, .grid.g-three { grid-template-columns: minmax(0, 1fr); }
  .grid.g-three > :first-child { grid-column: auto; }
  .grid.cols-5, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-nav a .badge { background: var(--accent); color: #fff; font-size: 10px; padding: 0 6px; border-radius: 999px; margin-left: 4px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .item-row { grid-template-columns: 1fr 1fr; }
  .item-row .full { grid-column: span 2; }
  .portal-top { padding: 10px 16px 8px; height: auto; flex-wrap: wrap; padding-bottom: 8px; padding-top: 10px; }
  .portal-top nav { width: 100%; margin: 0; order: 3; overflow-x: auto; }
  .portal-main { padding: 18px 16px 90px; }
  .toast-root { bottom: 76px; }
  .portal-top { padding-right: 16px !important; }
  .portal-top nav { display: none; }
  .portal-main { padding-bottom: 90px; }
  .screen-body { padding-top: 10px; }

}
@media (max-width: 600px) {
  .phone-stage { padding: 0; min-height: 100vh; align-items: stretch; }
  .phone { width: 100%; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; padding: 0; box-shadow: none; }
  .phone-stage { min-height: 100dvh; }
  .phone::before { display: none; }
  .screen { border-radius: 0; }
  .statusbar { display: block; flex-shrink: 0; height: env(safe-area-inset-top, 0px); padding: 0; background: var(--navy); }
  .statusbar > * { display: none !important; }
  .screen-body { padding-bottom: 24px; }
  .m-tabbar { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .modal { padding: 18px; }
  .quick-actions { grid-template-columns: 1fr; }
}

/* ---------- Address autocomplete ---------- */
.addr-wrap { position: relative; }
.addr-ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--slate-400); pointer-events: none; display: flex; }
.addr-input { padding-left: 32px; }
.addr-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--slate-200); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 30; padding: 4px; }
.addr-opt { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 13px; color: var(--slate-800); }
.addr-opt:hover { background: var(--accent-50); }
.addr-opt svg { color: var(--slate-400); flex-shrink: 0; }
.addr-opt > span { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.addr-opt b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addr-opt .muted { font-size: 11.5px; }

/* ---------- Month calendar ---------- */
.mcal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.mcal-head span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-500); font-weight: 700; padding: 0 8px; }
.mcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mcal-day { min-height: 112px; background: var(--slate-50); border: 1px solid var(--slate-200); border-radius: 10px; padding: 6px; cursor: pointer; transition: border-color .15s, background .15s; min-width: 0; }
.mcal-day:hover { border-color: var(--accent); background: #fff; }
.mcal-day.other { background: transparent; border-color: transparent; cursor: default; }
.mcal-day.today { background: var(--accent-50); border-color: var(--accent-100); }
.mcal-day.past { opacity: .72; }
.dnum { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 4px; }
.dnum span { font-weight: 700; font-size: 13px; color: var(--slate-900); }
.mcal-day.today .dnum span { background: var(--accent); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; }
.dnum em { font-style: normal; font-size: 10.5px; color: var(--slate-500); font-weight: 600; }
.mcal-job { font-size: 11px; font-weight: 600; padding: 3px 6px; border-radius: 5px; background: #fff; border-left: 3px solid var(--accent); box-shadow: var(--shadow-sm); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--slate-800); }
.mcal-job:hover { background: var(--accent-50); }
.mcal-job .tm { color: var(--slate-500); font-weight: 500; }
.mcal-job.delivered { border-left-color: var(--green); }
.mcal-job.enroute { border-left-color: var(--amber); }
.mcal-job.failed { border-left-color: var(--red); }
.mcal-job.unassigned { border-left-color: var(--slate-300); border-left-style: dashed; }
.mcal-more { font-size: 10.5px; color: var(--slate-500); margin-top: 3px; padding-left: 6px; }
.mcal-dots { display: none; gap: 3px; flex-wrap: wrap; margin-top: 4px; }
.mcal-dots .dot { background: var(--accent); }
.mcal-dots .dot.delivered { background: var(--green); }
.mcal-dots .dot.enroute { background: var(--amber); }
.mcal-dots .dot.failed { background: var(--red); }
@media (max-width: 900px) {
  .mcal, .mcal-head { gap: 4px; }
  .mcal-legend { display: none; }
  .mcal-day { min-height: 60px; padding: 4px; border-radius: 8px; }
  .mcal-jobs { display: none; }
  .mcal-dots { display: flex; }
  .mcal-head span { padding: 0; text-align: center; font-size: 10px; }
  .dnum { padding: 0 0 2px; justify-content: center; }
  .dnum em { display: none; }
}

/* ---------- Dashboard: tiles, charts, today list ---------- */
.tile { display: flex; gap: 14px; align-items: center; padding: 16px 18px; }
.tile-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-50); color: var(--accent-600); display: grid; place-items: center; flex-shrink: 0; }
.tile-ic svg { width: 19px; height: 19px; }
.tile-ic.warn { background: var(--amber-50); color: var(--amber); }
.tile-ic.bad { background: var(--red-50); color: var(--red); }
.tile-ic.up { background: var(--green-50); color: var(--green); }
.tile-body { min-width: 0; flex: 1; }
.tile .label { font-size: 11px; color: var(--slate-500); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.tile .value { font-size: 24px; font-weight: 700; color: var(--slate-900); letter-spacing: -0.02em; margin-top: 2px; line-height: 1.15; white-space: nowrap; }
.tile .value .of { font-size: 15px; color: var(--slate-400); font-weight: 600; }
.tile .delta { font-size: 12px; color: var(--slate-500); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tile .delta.up { color: var(--green); } .tile .delta.warn { color: var(--amber); } .tile .delta.bad { color: var(--red); }
.tile .delta svg { width: 13px; height: 13px; }
.meter { display: inline-block; width: 70px; height: 6px; border-radius: 999px; background: var(--accent-100); overflow: hidden; vertical-align: middle; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.viz { width: 100%; height: auto; display: block; font-family: var(--font); }
.viz.bar { height: 14px; border-radius: 4px; overflow: hidden; }
.viz-mark { cursor: default; }
.viz-mark:hover path, .viz-mark:hover rect:not([fill="transparent"]) { filter: brightness(.92); }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--slate-600); }
.viz-legend span { display: inline-flex; align-items: center; gap: 5px; }
.viz-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.viz-legend svg { width: 12px; height: 12px; color: var(--slate-400); }
.viz-legend b { color: var(--slate-900); }
.viz-tip { position: fixed; z-index: 1200; background: var(--slate-900); color: #fff; font-size: 12px; font-weight: 500; padding: 6px 9px; border-radius: 7px; pointer-events: none; box-shadow: var(--shadow-lg); max-width: 220px; }
.pipe { display: flex; flex-direction: column; gap: 10px; }
.pipe-row { display: grid; grid-template-columns: 64px 1fr 28px; align-items: center; gap: 10px; font-size: 12.5px; }
.pipe-label { color: var(--slate-600); }
.pipe-track { height: 12px; background: var(--slate-100); border-radius: 4px; overflow: hidden; }
.pipe-fill { height: 100%; border-radius: 0 4px 4px 0; transition: width .3s ease; }
.pipe-row b { text-align: right; color: var(--slate-900); }
.today-list { display: flex; flex-direction: column; }
.today-row { display: grid; grid-template-columns: 54px 4px 1fr 32px auto; gap: 12px; align-items: center; padding: 10px 6px; border-radius: 10px; cursor: pointer; }
.today-row:hover { background: var(--slate-50); }
.tr-time { display: flex; flex-direction: column; line-height: 1.2; }
.tr-time b { font-size: 13px; color: var(--slate-900); }
.tr-time span { font-size: 11px; color: var(--slate-500); }
.tr-line { width: 4px; height: 34px; border-radius: 4px; background: var(--accent); }
.tr-line.delivered { background: var(--green); } .tr-line.enroute { background: var(--amber); } .tr-line.failed { background: var(--red); }
.tr-body { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.tr-body b { font-size: 13.5px; color: var(--slate-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-body span { font-size: 12px; color: var(--slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-driver { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.tr-driver.me { background: var(--accent); }
.tr-driver.none { background: var(--slate-100); color: var(--slate-400); border: 1px dashed var(--slate-300); }
.attn .btn { flex-shrink: 0; }
@media (max-width: 900px) {
  .today-row { grid-template-columns: 46px 4px 1fr auto; }
  .today-row .tr-driver { display: none; }
  .tile { padding: 14px; gap: 10px; }
  .tile .value { font-size: 20px; }
  .tile-ic { width: 34px; height: 34px; }
}

/* ---------- Revenue chart (HTML) ---------- */
.rev-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.rev-summary > div { background: var(--slate-50); border: 1px solid var(--slate-100); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; line-height: 1.25; }
.rev-summary span { font-size: 11.5px; color: var(--slate-500); font-weight: 500; }
.rev-summary b { font-size: 17px; font-weight: 800; color: var(--slate-900); letter-spacing: -0.01em; margin-top: 2px; }
.rev-summary em { font-style: normal; font-size: 11px; color: var(--slate-500); }
.rev-chart { position: relative; height: 210px; padding-left: 38px; }
.rev-grid { position: absolute; inset: 22px 0 26px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.rev-grid > div { border-top: 1px solid var(--slate-200); position: relative; height: 0; }
.rev-grid > div:last-child { border-top-color: var(--slate-300); }
.rev-grid span { position: absolute; left: 0; top: -7px; font-size: 10.5px; color: var(--slate-500); font-variant-numeric: tabular-nums; width: 32px; text-align: right; }
.rev-cols { position: absolute; inset: 0 0 0 38px; display: flex; align-items: stretch; gap: 6px; padding: 0 4px; }
.rev-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; border: 0; background: transparent; padding: 0; cursor: pointer; font: inherit; position: relative; min-width: 0; border-radius: 8px; }
.rev-col:hover { background: var(--slate-50); }
.rev-col .rev-val { font-size: 11.5px; font-weight: 700; color: var(--slate-800); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.rev-col .rev-bar { width: 100%; max-width: 28px; background: var(--accent-100); border-radius: 5px 5px 0 0; transition: height .35s ease, background .15s; min-height: 2px; }
.rev-col.cur .rev-bar { background: #86b6ef; }
.rev-col.sel .rev-bar { background: var(--accent); }
.rev-col.sel .rev-val { color: var(--accent-600); }
.rev-col .rev-lbl { font-size: 10.5px; color: var(--slate-500); height: 26px; display: flex; align-items: center; white-space: nowrap; }
.rev-col.cur .rev-lbl { color: var(--slate-900); font-weight: 700; }
.rev-col.sel .rev-lbl { color: var(--accent-600); font-weight: 700; }
.rev-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; background: var(--accent-50); border-radius: 10px; font-size: 12.5px; color: var(--slate-700); }
.rev-detail b { color: var(--slate-900); }
.rev-detail .dot { width: 4px; height: 4px; background: var(--slate-300); }
@media (max-width: 600px) {
  .rev-summary { gap: 6px; }
  .rev-summary > div { padding: 8px 9px; }
  .rev-summary b { font-size: 14px; }
  .rev-chart { height: 190px; padding-left: 30px; }
  .rev-cols { left: 30px; gap: 3px; padding: 0; }
  .rev-col .rev-val { font-size: 10px; }
  .rev-col .rev-lbl { font-size: 9.5px; }
  .rev-grid span { width: 26px; font-size: 9.5px; }
}

/* ---------- Expenses ---------- */
.segmented a { border: 0; background: transparent; padding: 6px 12px; font-size: 12.5px; font-weight: 600; border-radius: 7px; color: var(--slate-600); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.segmented a svg { width: 14px; height: 14px; }
.segmented a.active { background: #fff; color: var(--slate-900); box-shadow: var(--shadow-sm); }
.segmented a:hover { text-decoration: none; color: var(--slate-900); }
.rev-col.pair { cursor: default; }
.pair-bars { display: flex; align-items: flex-end; gap: 3px; width: 100%; max-width: 40px; height: 100%; }
.pair-bars .rev-bar { flex: 1; max-width: none; }
.pair-bars .rev-bar.rev { background: #2a78d6; }
.pair-bars .rev-bar.exp { background: #eb6834; }
.rev-col.cur .pair-bars .rev-bar.rev { background: #86b6ef; }
.rev-col.cur .pair-bars .rev-bar.exp { background: #f4b59b; }
.rev-col .rev-val.pos { color: var(--green); }
.rev-col .rev-val.neg { color: var(--red); }
.pipe-row.cat { cursor: pointer; border-radius: 6px; }
@media (max-width: 600px) { .rev-col.pair .rev-val { display: none; } .rev-col.pair.cur .rev-val { display: block; } }
.pipe-row.cat:hover { background: var(--slate-50); }

.run-card .m-card { background: var(--slate-50); box-shadow: none; }

/* ---------- Global search ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(243,245,249,.92); backdrop-filter: blur(8px); padding: 12px 32px 8px; padding-right: 380px; display: flex; align-items: center; gap: 12px; }
.topsearch { position: relative; flex: 1; max-width: 560px; }
.topsearch .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--slate-400); display: flex; pointer-events: none; }
.topsearch input { width: 100%; font: inherit; font-size: 14px; padding: 10px 40px 10px 38px; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); outline: none; }
.topsearch input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-50); }
.topsearch kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 600 10.5px var(--font); color: var(--slate-400); border: 1px solid var(--slate-200); border-radius: 5px; padding: 1px 6px; background: var(--slate-50); }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--slate-200); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 45; padding: 6px; max-height: 70vh; overflow: auto; }
.sr-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--slate-400); font-weight: 700; padding: 8px 10px 4px; }
.sr-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--slate-800); }
.sr-item:hover, .sr-item.active { background: var(--accent-50); }
.sr-item .sr-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--slate-100); color: var(--slate-500); display: grid; place-items: center; flex-shrink: 0; }
.sr-item .sr-ic svg { width: 14px; height: 14px; }
.sr-item .sr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.sr-item b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-item span { font-size: 11.5px; color: var(--slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-item mark { background: var(--accent-100); color: inherit; border-radius: 3px; padding: 0 1px; }
.sr-empty { padding: 14px; font-size: 13px; color: var(--slate-500); text-align: center; }
.owner-main { padding-top: 16px !important; }
@media (max-width: 900px) {
  .topbar { padding: 8px 12px; top: 58px; background: var(--navy-2); }
  .topsearch { max-width: none; }
  .topsearch kbd { display: none; }
  .topsearch input { padding: 9px 12px 9px 36px; }
}

/* ---------- Floating create button ---------- */
.fab-wrap { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab { width: 56px; height: 56px; border-radius: 50%; border: 0; outline: none; -webkit-appearance: none; appearance: none; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 24px rgba(47,124,246,.38), var(--shadow); transition: transform .2s ease, background .15s; }
.fab svg { width: 24px; height: 24px; stroke-width: 2.4; }
.fab:hover { background: var(--accent-600); }
.fab.open { transform: rotate(45deg); background: var(--navy); box-shadow: var(--shadow-lg); }
.fab-menu { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; animation: fadeIn .18s ease both; }
.fab-menu[hidden] { display: none; }
[hidden] { display: none !important; }
.fab-item { display: flex; align-items: center; gap: 12px; width: 196px; border: 0; background: #fff; color: var(--slate-900); font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px 8px 8px; border-radius: 999px; cursor: pointer; box-shadow: var(--shadow-lg); outline: none; }
.fab-item.d .fab-ic { background: var(--navy); color: #fff; }
.fab-item.q .fab-ic { background: var(--accent); color: #fff; }
.fab-item.i .fab-ic { background: var(--green); color: #fff; }
.fab-item.e .fab-ic { background: var(--amber); color: #fff; }
.fab-item.c .fab-ic { background: var(--purple); color: #fff; }
.fab-backdrop { position: fixed; inset: 0; z-index: 79; background: rgba(11, 21, 38, .38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .18s ease both; }
.fab-item:hover { background: var(--accent-50); border-color: var(--accent-100); }
.fab-ic { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-50); color: var(--accent-600); display: grid; place-items: center; flex-shrink: 0; }
.fab-ic svg { width: 15px; height: 15px; }
@media (max-width: 900px) {
  .fab-wrap { right: 14px; bottom: calc(78px + env(safe-area-inset-bottom)); }
  .fab { width: 54px; height: 54px; }
}

/* ---------- Home (driver-first) ---------- */
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.home-head .sub { color: var(--slate-500); font-size: 13px; margin-top: 2px; }
.route-card { margin-bottom: 16px; }
.rt-list { display: flex; flex-direction: column; }
.rt-row { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--slate-100); cursor: pointer; }
.rt-row:first-child { border-top: 0; }
.rt-row:hover { background: var(--slate-50); }
.rt-n { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 12.5px; display: grid; place-items: center; }
.rt-n svg { width: 14px; height: 14px; }
.rt-row.enroute .rt-n { background: var(--amber); }
.rt-row.delivered .rt-n { background: var(--green); }
.rt-row.failed .rt-n { background: var(--red); }
.rt-row.delivered .rt-body, .rt-row.failed .rt-body { opacity: .6; }
.rt-body { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.rt-body b { font-size: 14px; color: var(--slate-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-body span { font-size: 12px; color: var(--slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-call { color: var(--slate-500); }
.route-map { margin-top: 12px; aspect-ratio: 16/10; }
.route-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 20px; align-items: start; }
.route-grid .route-map { margin-top: 0; aspect-ratio: 4/3; }
@media (max-width: 1100px) { .route-grid { grid-template-columns: minmax(0, 1fr); } .route-grid .route-map { margin-top: 12px; aspect-ratio: 16/10; } }
.card .card-head + .rt-list { margin-top: -4px; }
/* client rows */
.c-list { display: flex; flex-direction: column; }
.c-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--slate-100); cursor: pointer; }
.card:not(.pad-0) .c-row { padding-left: 4px; padding-right: 4px; }
.c-row:first-child { border-top: 0; }
.c-row:hover { background: var(--slate-50); }
.c-main { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.c-main b { font-size: 14px; color: var(--slate-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-main span { font-size: 12px; color: var(--slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-right { text-align: right; display: flex; flex-direction: column; line-height: 1.2; }
.c-right b { font-size: 14px; color: var(--slate-900); font-variant-numeric: tabular-nums; }
.c-right b.owing-late { color: var(--red); }
.c-right span { font-size: 11px; color: var(--slate-500); }
/* quote rows */
.q-list { display: flex; flex-direction: column; }
.q-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--slate-100); cursor: pointer; }
.q-row:first-child { border-top: 0; }
.q-row:hover { background: var(--slate-50); }
.q-num { font-weight: 700; font-size: 14px; color: var(--slate-900); font-variant-numeric: tabular-nums; }
.q-main { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.q-main b { font-size: 14px; color: var(--slate-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-main span { font-size: 12px; color: var(--slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.q-right b { font-size: 14px; color: var(--slate-900); font-variant-numeric: tabular-nums; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.pill-filter span { opacity: .7; font-weight: 500; margin-left: 2px; }
/* calendar nav + bigger cells */
.mcal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.mcal-nav h2 { flex: 1; text-align: center; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--slate-900); font-weight: 700; }
.mcal-nav .today-btn { position: absolute; right: 20px; }
.mcal-nav { position: relative; }
.mcal-day { min-height: 124px; }
.mcal-job .short { display: none; }
/* drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(11,21,38,.5); z-index: 94; display: none; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.drawer-backdrop.open { display: block; animation: fadeIn .2s ease both; }
.drawer { overscroll-behavior: contain; position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 84vw); background: var(--navy); color: #fff; z-index: 95; transform: translateX(-104%); transition: transform .25s ease; padding: 18px 14px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 4px; overflow-y: auto; box-shadow: var(--shadow-lg); }
.drawer.open { transform: none; }
.drawer .brand { padding: 0 6px 10px; }
.drawer-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.45); font-weight: 700; padding: 14px 12px 4px; }
.drawer .side-user { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.drawer .nav a .badge { background: var(--accent); color: #fff; }
@media (min-width: 901px) { .drawer, .drawer-backdrop { display: none !important; } }
@media (max-width: 900px) {
  .home-head .btn.lg { width: 100%; justify-content: center; }
  .rt-row { grid-template-columns: 28px 1fr auto auto; gap: 8px; padding: 10px 0; }
  .mcal-day { min-height: 108px; padding: 4px 2px; }
  .mcal-jobs { display: block; }
  .mcal-dots { display: none; }
  .mcal-job { font-size: 8px; padding: 2px 2px; margin-top: 2px; border-left-width: 2px; white-space: normal; overflow-wrap: anywhere; line-height: 1.15; letter-spacing: -0.02em; }
  .mcal-job .full { display: none; }
  .mcal-job .short { display: inline; }
  .mcal-more { font-size: 9.5px; padding-left: 3px; }
  .dnum { justify-content: space-between; padding: 0 2px 2px; }
  .dnum em { display: inline; }
  .mcal-nav .today-btn { right: 0; }
  .topbar-gear { display: none; }
  .m-nav a[data-action] svg { width: 22px; height: 22px; }
  .fab-wrap { bottom: calc(82px + env(safe-area-inset-bottom)); }
  .tile .value { font-size: 19px; }
  .tile .delta { font-size: 11.5px; }
}

/* Standalone (home-screen) mode: respect the notch and home indicator */
@media (display-mode: standalone) {
  .mobile-topbar { padding-top: calc(12px + env(safe-area-inset-top)); }
  .m-nav { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .drawer { padding-top: calc(18px + env(safe-area-inset-top)); }
  .topbar { top: calc(58px + env(safe-area-inset-top)); }
  .portal-top { padding-top: calc(10px + env(safe-area-inset-top)) !important; }
  .login-stage { padding-top: calc(20px + env(safe-area-inset-top)); }
  .sticky-bar { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}

/* ---------- Quote editor (line items + sticky bar) ---------- */
.qe-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.qe-head h1 { font-size: 20px; }
.qe-num { color: var(--slate-500); font-weight: 600; font-variant-numeric: tabular-nums; }
.qe-title { font-size: 16px; font-weight: 600; padding: 11px 12px; }
.qe-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.qe-meta > div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.qe-meta b { font-size: 14px; color: var(--slate-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qe-meta span { font-size: 12px; color: var(--slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qe-h2 { font-size: 17px; font-weight: 700; color: var(--slate-900); text-transform: none; letter-spacing: 0; }
.li-card { background: var(--surface); border: 1px solid var(--slate-200); border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.li-top { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, .7fr) minmax(0, 1fr) 28px; gap: 10px; align-items: end; }
.li-top .input { padding: 10px 11px; font-size: 15px; }
.li-qty .input { text-align: center; }
.li-price .input { text-align: right; font-variant-numeric: tabular-nums; }
.li-x { width: 28px; height: 28px; border: 0; background: transparent; color: var(--red); border-radius: 8px; cursor: pointer; display: grid; place-items: center; align-self: start; opacity: .75; }
.li-x:hover { background: var(--red-50); opacity: 1; }
.li-x svg { width: 15px; height: 15px; }
.li-bottom { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; margin-top: 10px; align-items: start; }
.li-bottom .textarea { min-height: 54px; font-size: 14px; }
.li-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-top: 4px; }
.li-total { font-size: 15px; color: var(--slate-900); font-variant-numeric: tabular-nums; }
.sticky-bar { position: fixed; left: 232px; right: 0; bottom: 0; z-index: 70; display: flex; gap: 10px; align-items: center; padding: 12px 32px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-top: 1px solid var(--slate-200); box-shadow: 0 -6px 20px rgba(15,23,42,.08); }
.owner.collapsed .sticky-bar { left: 72px; }
.owner.bare .owner-main { padding-bottom: 110px; }
.sticky-bar .split { max-width: 420px; margin-left: auto; }
.sticky-bar > .btn { flex: 0 0 auto; }
.split { position: relative; display: flex; flex: 1; }
.split-main { flex: 1; border-radius: 10px 0 0 10px; justify-content: flex-start; }
.split-caret { border-radius: 0 10px 10px 0; border-left: 1px solid rgba(255,255,255,.3) !important; padding: 12px 14px; }
.split-menu { position: absolute; right: 0; bottom: calc(100% + 8px); min-width: 220px; background: #fff; border: 1px solid var(--slate-200); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; animation: fadeIn .15s ease both; }
.split-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 11px 12px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 500; color: var(--slate-800); cursor: pointer; text-align: left; }
.split-menu button:hover { background: var(--slate-50); }
.split-menu button svg { width: 16px; height: 16px; color: var(--slate-500); }
.split-menu button.danger { color: var(--red); border-top: 1px solid var(--slate-100); border-radius: 0 0 8px 8px; margin-top: 4px; }
.split-menu button.danger svg { color: var(--red); }
.owner.bare .fab-wrap, .owner.bare .fab-backdrop { display: none !important; }
@media (max-width: 900px) {
  .owner.bare .m-nav { display: none; }
  .owner.bare .topbar { display: none; }
  .owner.bare .owner-main { padding-bottom: 110px; }
  .sticky-bar, .owner.collapsed .sticky-bar { left: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .sticky-bar .split { max-width: none; margin-left: 0; }
  .sticky-bar .btn.lg { padding: 13px 14px; font-size: 14.5px; }
  .li-top { grid-template-columns: minmax(0, 1.5fr) minmax(0, .7fr) minmax(0, 1fr) 24px; gap: 8px; }
  .li-card { padding: 12px; }
}

/* ---------- Branded dropdown (bottom sheet) ---------- */
.csel-btn { text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: inherit; display: block; }
.csel-btn.placeholder { color: var(--slate-400); }
.csel-btn:disabled { opacity: .6; cursor: not-allowed; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 1150; background: rgba(11,21,38,.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fadeIn .15s ease both; }
.sheet { position: fixed; z-index: 1151; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); max-height: min(560px, 80vh); background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: fadeIn .18s ease both; }
.sheet-grab { display: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px 18px; }
.sheet-head b { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--slate-500); font-weight: 700; }
.sheet-search { position: relative; padding: 0 14px 10px; }
.sheet-search .ic { position: absolute; left: 26px; top: 11px; color: var(--slate-400); display: flex; pointer-events: none; }
.sheet-search .input { padding-left: 36px; }
.sheet-list { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 8px 10px; }
.sheet-opt { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; padding: 12px 12px; border-radius: 10px; font: inherit; text-align: left; cursor: pointer; color: var(--slate-900); }
.sheet-opt:hover { background: var(--slate-50); }
.sheet-opt.sel { background: var(--accent-50); }
.sheet-opt.none .so-text b { color: var(--slate-500); font-weight: 500; }
.so-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.so-text b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-text span { font-size: 12.5px; color: var(--slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-check { width: 20px; color: var(--accent-600); display: flex; flex-shrink: 0; }
.so-check svg { width: 18px; height: 18px; stroke-width: 2.6; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@media (max-width: 900px) {
  .sheet { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: auto; max-height: 76vh; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: sheetUp .22s ease both; }
  .sheet-grab { display: block; width: 40px; height: 4px; border-radius: 999px; background: var(--slate-200); margin: 8px auto 0; }
  .sheet-opt { padding: 13px 12px; }
}

/* ---------- Unified quote editor layout ---------- */
.qe-wrap { max-width: 820px; }
.qe-stop { display: flex; align-items: center; gap: 10px; }
.qe-stop .stop-num { flex-shrink: 0; }
.qe-add { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qe-add .btn, .qe-add .csel-btn { width: 100%; justify-content: center; text-align: center; padding: 11px 12px; font-weight: 600; }
.qe-add .csel-btn { background-image: none; padding-right: 12px; color: var(--accent-600); border-style: dashed; }

/* iOS zooms the page when a focused field's text is under 16px. Keep every field at 16px on touch-size screens. */
@media (max-width: 900px) {
  input, select, textarea, .input, .select, .textarea, .csel-btn, .input.sm, .select.sm, .topsearch input, .li-top .input, .li-bottom .textarea { font-size: 16px !important; }
}

/* ---------- Save pill (one piece) ---------- */
.sticky-bar > .btn { border-radius: 999px; padding-left: 18px; padding-right: 18px; }
.split-pill { display: flex; flex: 1; background: var(--accent); border-radius: 999px; overflow: hidden; box-shadow: 0 6px 16px rgba(47,124,246,.3); }
.split-pill button { border: 0; background: transparent; color: #fff; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.split-pill .split-main { flex: 1; padding: 13px 8px 13px 20px; justify-content: flex-start; border-radius: 0; }
.split-pill .split-caret { padding: 13px 18px 13px 14px; border-left: 1px solid rgba(255,255,255,.35) !important; border-radius: 0; }
.split-pill button:hover { background: rgba(255,255,255,.1); }
.split-pill svg { width: 16px; height: 16px; }

/* ---------- Line item card: name row, then qty / price / total ---------- */
.li-row1 { display: grid; grid-template-columns: minmax(0, 1fr) 28px; gap: 8px; align-items: start; }
.li-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.csel-btn.preset { width: auto; background-image: none; padding: 2px 10px; font-size: 12px !important; font-weight: 600; color: var(--accent-600); border: 1px solid var(--accent-100); background-color: var(--accent-50); border-radius: 999px; line-height: 1.6; }
.csel-btn.preset::after { content: " ▾"; }
.li-row1 .input { padding: 10px 11px; }
.li-row2 { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 10px; align-items: end; }
.li-row2 .input { padding: 10px 11px; }
.li-row2 .li-qty .input { text-align: center; }
.li-row2 .li-price .input { text-align: right; font-variant-numeric: tabular-nums; }
.li-tot { text-align: right; }
.li-tot .li-total { display: block; padding: 10px 0; font-size: 16px; }
.li-bottom { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }

/* ---------- Inline calendar ---------- */
.mini-cal { border: 1px solid var(--slate-200); border-radius: 12px; padding: 10px; background: var(--slate-50); }
.mc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mc-head b { font-size: 14px; color: var(--slate-900); }
.mc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.mc-dow { text-align: center; font-size: 10.5px; font-weight: 700; color: var(--slate-400); padding: 4px 0; }
.mc-day { border: 0; background: transparent; height: 38px; border-radius: 10px; font: inherit; font-size: 14px !important; font-weight: 500; color: var(--slate-800); cursor: pointer; }
.mc-day:hover { background: #fff; }
.mc-day.past { color: var(--slate-300); }
.mc-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent-600); font-weight: 700; }
.mc-day.sel { background: var(--accent); color: #fff; font-weight: 700; box-shadow: none; }
.mc-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--slate-200); font-size: 13px; font-weight: 600; color: var(--slate-700); }
.mc-foot svg { width: 14px; height: 14px; color: var(--slate-400); }
.map-empty { display: flex; align-items: center; justify-content: center; gap: 8px; height: 90px; border: 1px dashed var(--slate-300); border-radius: 10px; color: var(--slate-400); font-size: 13px; background: var(--slate-50); }
.map-empty svg { width: 16px; height: 16px; }
.sheet-head { padding: 12px 18px 10px; }
.sheet-grab { cursor: grab; }
@media (max-width: 900px) { .sheet-grab { width: 44px; height: 5px; margin: 10px auto 2px; } }

/* ---------- Search overlay: above everything, page locked behind it ---------- */
.search-backdrop { position: fixed; inset: 0; z-index: 1040; background: rgba(11,21,38,.4); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fadeIn .15s ease both; }
.topbar.searching { z-index: 1050; }
.search-results { max-height: min(70vh, 520px); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
@media (max-width: 900px) { .search-results { max-height: 55vh; } }

/* ---------- Client quote view (title + quote + approve only) ---------- */
.screen-body.plain { padding: 0 0 12px; background: #f8f8f8; }
.cq { --q-brand: var(--accent-600); --q-ink: #1a2b3c; --q-muted: #6b6b73; --q-faint: #a1a1aa; --q-line: #e6e6ea; font-family: 'Plus Jakarta Sans', var(--font); color: #333; padding: 12px 12px 8px; }
.cq-top { display: flex; gap: 8px; padding: 6px 2px 12px; }
.cq-back { border: 1px solid #d9d9de; background: #fff; color: var(--q-ink); font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 10px; text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }
.cq-back:hover { text-decoration: none; background: #fff; }
.cq-card { background: #fff; border: 1px solid var(--q-line); border-radius: 14px; padding: 20px 16px 18px; }
.cq-rule { height: 3px; background: var(--q-brand); border-radius: 3px; margin-bottom: 22px; }
.cq-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.cq-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--q-brand); display: grid; place-items: center; }
.cq-mark svg { width: 22px; height: 22px; }
.cq-brand { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--q-brand); font-size: 14px; line-height: 1.2; }
.cq-title { font-size: 30px; line-height: 1.08; font-weight: 800; letter-spacing: -0.6px; text-transform: uppercase; color: var(--q-ink); margin: 0 0 14px; overflow-wrap: anywhere; }
.cq-viewing { font-size: 14px; font-weight: 600; color: var(--q-brand); margin-bottom: 18px; }
.cq-approve { display: block; text-align: center; background: var(--q-brand); color: #fff; font-weight: 600; font-size: 16px; padding: 17px 24px; border-radius: 40px; text-decoration: none; }
.cq-approve:hover { text-decoration: none; filter: brightness(.95); }
.cq-approve.ghost { background: #fff; color: var(--q-brand); border: 1.5px solid var(--q-brand); margin-top: 10px; }
.cq-approve.sm { display: inline-block; padding: 12px 20px; font-size: 14.5px; font-weight: 700; white-space: nowrap; }
.cq-approve.off { background: #e9e9ee; color: var(--q-muted); }
.cq-approved { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--green-50); color: var(--green); font-weight: 700; font-size: 15px; padding: 15px; border-radius: 40px; }
.cq-approved.muted { background: #f1f1f4; color: var(--q-muted); }
.cq-approved svg { width: 18px; height: 18px; }
.cq-info { border: 1px solid var(--q-line); border-radius: 16px; padding: 20px 20px 6px; margin-top: 22px; }
.cq-qno { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--q-ink); letter-spacing: -0.3px; }
.cq-qno i { width: 8px; height: 8px; border-radius: 50%; background: var(--q-brand); }
.cq-qno i.approved { background: var(--green); } .cq-qno i.declined, .cq-qno i.expired { background: var(--red); } .cq-qno i.draft { background: var(--q-faint); }
.cq-name { font-size: 20px; font-weight: 700; color: var(--q-ink); margin: 14px 0 12px; }
.cq-row { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; color: #555; margin-bottom: 12px; line-height: 1.4; }
.cq-row svg { width: 16px; height: 16px; color: var(--q-brand); flex-shrink: 0; margin-top: 3px; }
.cq-row.link span { color: var(--q-brand); font-weight: 600; overflow-wrap: anywhere; }
.cq-meta { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--q-line); margin-top: 16px; }
.cq-meta > div { padding: 13px 0; }
.cq-meta > div + div { border-left: 1px solid var(--q-line); padding-left: 16px; }
.cq-meta label { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--q-faint); margin-bottom: 6px; }
.cq-meta b { font-size: 15px; font-weight: 600; color: var(--q-ink); }
.cq-total { border-top: 1px solid var(--q-line); margin-top: 22px; padding: 24px 0 20px; }
.cq-total label { display: block; font-size: 16px; font-weight: 700; letter-spacing: 1.44px; text-transform: uppercase; color: var(--q-brand); margin-bottom: 6px; }
.cq-total b { font-size: 34px; font-weight: 800; letter-spacing: -0.8px; color: var(--q-ink); }
.cq-h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.21px; text-transform: uppercase; color: var(--q-ink); margin: 6px 0 12px; }
.cq-line { border-top: 1px solid var(--q-line); }
.cq-line summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; align-items: center; gap: 12px; padding: 18px 2px; cursor: pointer; list-style: none; }
.cq-line summary::-webkit-details-marker { display: none; }
.cq-lname { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--q-brand); line-height: 1.35; }
.cq-lamt { font-size: 17px; font-weight: 800; color: var(--q-ink); font-variant-numeric: tabular-nums; }
.cq-chev { display: flex; color: var(--q-faint); transform: rotate(-90deg); transition: transform .15s ease; }
.cq-line[open] .cq-chev { transform: rotate(90deg); }
.cq-chev svg { width: 14px; height: 14px; }
.cq-lbody { padding: 0 2px 16px; }
.cq-calc { font-size: 13px; font-weight: 600; color: var(--q-muted); margin-bottom: 6px; }
.cq-desc { font-size: 14px; color: #333; line-height: 1.5; }
.cq-sums { border-top: 1px solid var(--q-line); margin-top: 2px; }
.cq-sums > div { display: flex; justify-content: space-between; padding: 11px 0; font-size: 14px; font-weight: 500; color: var(--q-muted); border-bottom: 1px solid #f0f0f3; }
.cq-sums > div.t { color: var(--q-ink); font-weight: 800; font-size: 17px; border-bottom: 0; padding-top: 14px; }
.cq-note { font-size: 12.5px; color: var(--q-muted); margin-top: 10px; line-height: 1.5; }
.cq-bar { flex-shrink: 0; display: flex; align-items: center; gap: 10px; background: #fff; border-top: 1px solid var(--q-line); padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); font-family: 'Plus Jakarta Sans', var(--font); }
.cq-bar-total { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.cq-bar-total label { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #a1a1aa; }
.cq-bar-total b { font-size: 18px; font-weight: 800; color: #1a2b3c; font-variant-numeric: tabular-nums; }
.cq-call { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #d9d9de; display: grid; place-items: center; color: #1a2b3c; flex-shrink: 0; }
.cq-call svg { width: 17px; height: 17px; }
.cq-bar .cq-approve { --q-brand: var(--accent-600); background: var(--accent-600); }
.cq-bar .cq-approve.off { background: #e9e9ee; }

/* ---------- Plus button: speed dial (labels left, round icons stacked above the button) ---------- */
.fab { background: var(--navy); box-shadow: 0 10px 24px rgba(11,21,38,.35), var(--shadow); }
.fab:hover { background: var(--navy-3); }
.fab-wrap.open .fab { transform: rotate(45deg); background: var(--navy); }
.fab-menu, .fab-menu[hidden] { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; padding-right: 4px; margin-bottom: 2px; pointer-events: none; animation: none; }
.fab-item { width: auto; background: transparent; border: 0; padding: 0; box-shadow: none; gap: 12px; opacity: 0; transform: translateY(26px) scale(.45); transform-origin: right bottom; transition: opacity .16s ease, transform .22s cubic-bezier(.2, .8, .25, 1); }
.fab-item:hover { background: transparent; }
.fab-wrap.open .fab-menu { pointer-events: auto; }
.fab-wrap.open .fab-item { opacity: 1; transform: none; }
.fab-wrap.open .fab-item:nth-last-child(1) { transition-delay: 0ms; }
.fab-wrap.open .fab-item:nth-last-child(2) { transition-delay: 30ms; }
.fab-wrap.open .fab-item:nth-last-child(3) { transition-delay: 60ms; }
.fab-wrap.open .fab-item:nth-last-child(4) { transition-delay: 90ms; }
.fab-wrap.open .fab-item:nth-last-child(5) { transition-delay: 120ms; }
.fab-label { background: #fff; color: var(--slate-900); font-weight: 600; font-size: 14px; padding: 7px 12px; border-radius: 10px; box-shadow: 0 4px 14px rgba(11,21,38,.18); white-space: nowrap; }
.fab-item .fab-ic { width: 48px; height: 48px; border-radius: 50%; color: #fff; box-shadow: 0 6px 16px rgba(11,21,38,.25); }
.fab-item .fab-ic svg { width: 20px; height: 20px; }
.fab-item.e .fab-ic { background: #16a34a; }
.fab-item.i .fab-ic { background: #2563eb; }
.fab-item.q .fab-ic { background: #b4174f; }
.fab-item.d .fab-ic { background: #6f8a2a; }
.fab-item.c .fab-ic { background: var(--navy); }
.fab-backdrop, .fab-backdrop[hidden] { display: none !important; }
.fab-backdrop.open { display: block !important; }

/* ---------- Client profile ---------- */
.cp { max-width: 760px; }
.cp-crumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--slate-500); margin-bottom: 8px; }
.cp-crumb a { color: var(--slate-500); text-decoration: none; }
.cp-crumb b { color: var(--slate-900); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-name { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.cp-sub { font-size: 13.5px; color: var(--slate-500); margin: 2px 0 14px; }
.cp-sub .owe { color: var(--red); font-weight: 600; }
.cp-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.cp-btn { display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 13px 10px; font: inherit; font-size: 15px; font-weight: 600; color: #fff; cursor: pointer; text-decoration: none; }
.cp-btn:hover { text-decoration: none; filter: brightness(.95); }
.cp-btn svg { width: 16px; height: 16px; }
.cp-btn.edit { background: var(--navy); }
.cp-btn.email { background: #059669; }
.cp-btn.call { background: var(--accent); }
.cp-card { padding: 16px; margin-bottom: 12px; }
.cp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; min-height: 34px; }
.cp-head h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--slate-500); font-weight: 600; }
.cp-head-actions { display: flex; gap: 8px; }
.cp-mini { border: 0; background: var(--slate-100); color: var(--slate-800); font: inherit; font-size: 13px !important; font-weight: 600; padding: 8px 12px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cp-mini svg { width: 14px; height: 14px; }
.cp-mini.outline { background: var(--accent-50); color: var(--accent-600); box-shadow: inset 0 0 0 1px var(--accent-100); }
.cp-addr { display: flex; align-items: center; gap: 12px; padding: 6px 0; cursor: pointer; }
.cp-pin { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-50); color: var(--accent-600); display: grid; place-items: center; flex-shrink: 0; }
.cp-pin svg { width: 18px; height: 18px; }
.cp-addr b { display: block; font-size: 15px; font-weight: 600; color: var(--accent-600); text-decoration: underline dotted; text-underline-offset: 3px; }
.cp-addr span { font-size: 13px; color: var(--slate-500); }
.cp-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 2px; border-top: 1px solid var(--slate-100); cursor: pointer; }
.cp-row:hover { background: var(--slate-50); }
.cp-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--slate-300); }
.cp-dot.approved, .cp-dot.delivered, .cp-dot.paid { background: #059669; }
.cp-dot.sent, .cp-dot.viewed, .cp-dot.scheduled { background: var(--accent); }
.cp-dot.enroute, .cp-dot.partial { background: #d97706; }
.cp-dot.declined, .cp-dot.failed, .cp-dot.overdue, .cp-dot.expired { background: var(--red); }
.cp-main { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cp-main b { font-size: 14.5px; font-weight: 600; color: var(--slate-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-main span { font-size: 12.5px; color: var(--slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-amt { text-align: right; display: flex; flex-direction: column; line-height: 1.25; }
.cp-amt b { font-size: 15px; font-weight: 700; color: var(--slate-900); font-variant-numeric: tabular-nums; }
.cp-amt .paid { font-size: 12px; font-weight: 600; color: #059669; }
.cp-amt .owe { font-size: 12px; font-weight: 600; color: var(--red); }
.cp-empty { font-size: 14px; color: var(--slate-500); padding: 6px 0 2px; }
.cp-more { display: block; font-size: 12.5px; color: var(--slate-500); padding: 8px 2px 0; border-top: 1px solid var(--slate-100); }
@media (max-width: 900px) { .cp-head-actions .cp-mini { padding: 8px 10px; } }

/* ---------- Line item card: Name dropdown, Qty + Unit price, Total row ---------- */
.li-name-btn { width: 100%; padding: 12px 34px 12px 12px; font-size: 16px; font-weight: 500; color: var(--slate-900); border-radius: 10px; }
.li-name-btn.placeholder { color: var(--slate-400); font-weight: 400; }
.li-row2 { grid-template-columns: minmax(0, .8fr) minmax(0, 1.9fr); }
.li-totalrow { display: flex; justify-content: flex-end; align-items: baseline; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--slate-200); }
.li-totalrow span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-600); }
.li-totalrow .li-total { font-size: 17px; font-weight: 700; color: var(--slate-900); font-variant-numeric: tabular-nums; display: inline; padding: 0; }
.li-bottom { margin-top: 12px; }
.qe-addline { padding: 12px; font-weight: 600; border-style: dashed; color: var(--accent-600); }
.sheet-opt.custom .so-text b { color: var(--accent-600); }
.sheet-opt.custom .so-check svg { width: 16px; height: 16px; }

/* ---------- Line item: × on the label row, Name spans the card ---------- */
.li-card .li-label { display: flex; align-items: center; justify-content: space-between; }
.li-card .li-label .li-x { margin: -6px -4px 0 0; }

/* ---------- Notifications: top-right, slide in from the right ---------- */
.toast-root { position: fixed; top: calc(12px + env(safe-area-inset-top)) !important; right: 12px; left: auto !important; bottom: auto !important; transform: none !important; z-index: 1300; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; max-width: min(360px, calc(100vw - 24px)); }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; background: #0f9d6c; color: #fff; padding: 12px 10px 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); animation: toastIn .34s cubic-bezier(.2, .8, .2, 1) both; max-width: 100%; font-weight: 400; }
.toast.info { background: var(--navy); }
.toast.out { animation: toastOut .25s ease forwards; }
.toast .t-text { min-width: 0; }
.toast b { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.toast .t-text span { display: block; font-size: 13px; opacity: .92; margin-top: 2px; line-height: 1.35; }
.toast .t-x { border: 0; background: transparent; color: #fff; opacity: .8; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; flex-shrink: 0; }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }

/* ---------- Schedule: day-grid calendar ---------- */
.owner.sched-mode .fab-wrap, .owner.sched-mode .fab-backdrop { display: none !important; }
.sched { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--slate-200); border-radius: 14px; overflow: hidden; height: calc(100dvh - 130px); min-height: 460px; position: relative; }
.sc-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 8px 16px; flex-shrink: 0; }
.sc-title { border: 0; background: transparent; font: inherit; color: var(--slate-900); display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 0; }
.sc-title b { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.sc-title svg { width: 15px; height: 15px; color: var(--slate-400); transform: rotate(-90deg); transition: transform .25s ease; margin-top: 4px; }
.sc-title.open svg { transform: rotate(90deg); }
.sc-today { min-width: 34px; height: 32px; border-radius: 9px; border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 700; font-size: 14px !important; cursor: pointer; }
.sc-month { max-height: 0; opacity: 0; overflow: hidden; padding: 0 10px; transition: max-height .32s cubic-bezier(.2, .8, .2, 1), opacity .2s ease, padding .2s ease; flex-shrink: 0; }
.sc-month.open { max-height: 320px; opacity: 1; padding-bottom: 8px; }
.scm-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; }
.scm-dow { text-align: center; font-size: 11px; color: var(--slate-400); padding: 4px 0 6px; }
.scm-day { height: 38px; border: 0; background: transparent; font: inherit; font-size: 14px !important; color: var(--slate-800); position: relative; border-radius: 10px; cursor: pointer; }
.scm-day.out { color: var(--slate-300); }
.scm-day.vis { background: var(--slate-100); font-weight: 700; }
.scm-day.today { background: var(--accent); color: #fff; font-weight: 700; }
.scm-day i { position: absolute; bottom: 4px; left: 50%; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); transform: translateX(-50%); }
.scm-day.today i { background: #fff; }
#sc-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.sc-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; will-change: transform; }
.sc-pane.from-right { animation: scInR .28s cubic-bezier(.2, .8, .2, 1) both; }
.sc-pane.from-left { animation: scInL .28s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes scInR { from { transform: translateX(45%); opacity: .25; } to { transform: none; opacity: 1; } }
@keyframes scInL { from { transform: translateX(-45%); opacity: .25; } to { transform: none; opacity: 1; } }
.sc-days { display: grid; grid-template-columns: 46px repeat(var(--cols), minmax(0, 1fr)); border-bottom: 1px solid var(--slate-200); padding: 4px 0 8px; font-size: 13px; color: var(--slate-500); flex-shrink: 0; }
.sc-tz { font-size: 9.5px; text-align: center; align-self: center; color: var(--slate-400); letter-spacing: .04em; }
.sc-dl { padding-left: 8px; }
.sc-dl b { color: var(--slate-900); font-weight: 600; }
.sc-dl.today b { background: var(--accent); color: #fff; border-radius: 6px; padding: 1px 6px; }
.sc-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sc-grid { position: relative; display: grid; grid-template-columns: 46px repeat(var(--cols), minmax(0, 1fr)); }
.sc-hours { position: relative; }
.sc-hours span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 10.5px; color: var(--slate-400); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-col { position: relative; border-left: 1px solid var(--slate-100); background-image: linear-gradient(to bottom, var(--slate-100) 1px, transparent 1px); background-size: 100% var(--hour, 64px); }
.sc-col.today { background-color: rgba(47, 124, 246, .035); }
.sc-ev { position: absolute; border: 0; text-align: left; font: inherit; border-radius: 9px; padding: 7px 8px; background: var(--accent-50); color: var(--slate-900); border-left: 3px solid var(--accent); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: transform .12s ease, box-shadow .12s ease; }
.sc-ev b { font-size: 13.5px !important; font-weight: 600; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sc-ev span { font-size: 11.5px !important; color: var(--slate-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-ev.delivered { background: var(--green-50); border-left-color: var(--green); }
.sc-ev.enroute { background: var(--amber-50); border-left-color: var(--amber); }
.sc-ev.failed { background: var(--red-50); border-left-color: var(--red); }
.sc-ev.unassigned { border-left-style: dashed; border-left-color: var(--slate-400); }
.sc-ev.sel { box-shadow: 0 0 0 2px var(--accent), var(--shadow); z-index: 3; }
.sc-ev:active { transform: scale(.97); }
.sc-now { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px solid var(--red); z-index: 4; pointer-events: none; }
.sc-now span { position: absolute; left: 1px; top: -8px; font-size: 9px; font-weight: 700; color: var(--red); background: var(--surface); padding: 0 2px; white-space: nowrap; }
.sc-peek { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 16px 14px 12px 18px; border-top: 1px solid var(--slate-200); background: var(--surface); position: relative; }
.sc-grab { position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; border-radius: 999px; background: var(--slate-200); transform: translateX(-50%); }
.sc-next { flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; font: inherit; display: flex; flex-direction: column; line-height: 1.3; cursor: pointer; padding: 0; color: var(--slate-900); }
.sc-next span { font-size: 11px !important; text-transform: uppercase; letter-spacing: .08em; color: var(--slate-500); font-weight: 600; }
.sc-next b { font-size: 14.5px !important; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-plus { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.sc-plus svg { width: 18px; height: 18px; }

/* Event sheet */
.jsheet { position: fixed; right: 24px; bottom: 0; width: 400px; height: 78vh; z-index: 96; background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(11, 21, 38, .22); transform: translateY(104%); transition: transform .34s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; }
.jsheet.open { transform: translateY(44%); }
.jsheet.open.full { transform: translateY(0); }
.js-grab { width: 40px; height: 5px; border-radius: 999px; background: var(--slate-200); margin: 9px auto 2px; flex-shrink: 0; cursor: grab; }
.js-head { display: flex; align-items: center; gap: 8px; padding: 4px 14px 2px 18px; flex-shrink: 0; }
.js-kind { font-size: 13px; font-weight: 600; color: var(--slate-500); }
.js-ic { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--slate-100); color: var(--slate-700); display: grid; place-items: center; cursor: pointer; }
.js-ic svg { width: 15px; height: 15px; }
.js-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 18px 22px; overscroll-behavior: contain; }
.jsheet:not(.full) .js-body { overflow: hidden; }
.js-title { font-size: 20px; font-weight: 700; margin: 4px 0 12px; color: var(--slate-900); }
.js-time { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--slate-900); }
.js-time svg { width: 16px; height: 16px; color: var(--slate-400); }
.js-time b { font-weight: 600; }
.js-time span { color: var(--slate-400); }
.js-time em { font-style: normal; color: var(--slate-400); font-size: 13px; }
.js-date { margin: 6px 0 0 26px; font-size: 14px; color: var(--slate-600); }
.js-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; align-items: center; font-size: 13.5px; color: var(--slate-600); }
.js-tags b { color: var(--slate-900); }
.js-primary { width: 100%; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; font-size: 15px !important; padding: 13px; display: flex; justify-content: center; align-items: center; gap: 8px; cursor: pointer; }
.js-primary svg { width: 17px; height: 17px; }
.js-primary.ghost { background: var(--slate-100); color: var(--slate-900); }
.js-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.js-sec { border-top: 1px solid var(--slate-100); padding: 14px 0 2px; margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.js-line { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.js-line svg { width: 16px; height: 16px; color: var(--slate-400); margin-top: 2px; flex-shrink: 0; }
.js-line b { display: block; font-weight: 600; color: var(--slate-900); }
.js-line span { color: var(--slate-600); }
@media (max-width: 900px) {
  .owner.sched-mode .topbar { display: none; }
  .owner.sched-mode .owner-main { padding: 0 !important; }
  .sched { border: 0; border-radius: 0; min-height: 0; height: calc(100dvh - 58px - 62px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .sc-arrow { display: none; }
  .jsheet { left: 0; right: 0; width: auto; height: 86dvh; padding-bottom: env(safe-area-inset-bottom); }
  .toast-root { right: 10px; }
}

/* ---------- Delivery sheet: background is inert, the sheet owns every touch ---------- */
html { overscroll-behavior-y: none; }
.jsheet-backdrop { position: fixed; inset: 0; z-index: 95; background: rgba(11, 21, 38, 0); transition: background .25s ease; touch-action: none; }
.jsheet-backdrop.open { background: rgba(11, 21, 38, .14); }
.jsheet { touch-action: none; overscroll-behavior: contain; }
.jsheet.full .js-body { touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.js-grab { width: 44px; margin: 10px auto 4px; }
.js-head { padding-top: 6px; padding-bottom: 6px; }

/* ---------- Month picker: arrows when open, swipe animation ---------- */
.sc-month { touch-action: none; }
.sc-arrow.show { display: inline-flex !important; }
.scm-grid.from-below { animation: scmUp .26s cubic-bezier(.2, .8, .2, 1) both; }
.scm-grid.from-above { animation: scmDown .26s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes scmUp { from { transform: translateY(46px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes scmDown { from { transform: translateY(-46px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Job page (client-profile style) ---------- */
.cp-btn.blue { background: var(--accent); }
.cp-btn.green { background: #059669; }
.cp-btn.navy { background: var(--navy); }
.cp-btn.off { background: var(--slate-200); color: var(--slate-600); cursor: default; }
a.jp-name { display: block; color: var(--slate-900); text-decoration: none; }
a.jp-name:hover { text-decoration: none; color: var(--accent-600); }
.jp-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.jp-sub b { color: var(--slate-900); }
.cp-pin.drop { background: var(--green-50); color: var(--green); }
.jp .cp-pin { font-weight: 700; font-size: 15px; }
.jp .cp-addr b { text-decoration: none; color: var(--slate-900); }
.jp-map { margin-top: 10px; }
.jp-map .map { aspect-ratio: 16 / 7; }
.cp-row.static { cursor: default; }
.cp-row.static:hover { background: transparent; }
.jp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jp-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--slate-600); padding: 10px 2px 0; border-top: 1px solid var(--slate-100); }
.jp-note svg { width: 15px; height: 15px; color: var(--slate-400); flex-shrink: 0; margin-top: 2px; }
.jp-ev { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center; padding: 9px 2px; border-top: 1px solid var(--slate-100); font-size: 14px; }
.jp-ev:first-of-type { border-top: 0; }
.jp-ev b { font-weight: 600; color: var(--slate-900); }
.jp-ev span { font-size: 12.5px; color: var(--slate-500); }
.jp-pod { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.jp-pod img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--slate-200); background: #fff; }
.jp-pod img.sig { object-fit: contain; padding: 6px; }
/* current step */
.jp-step { border: 1.5px solid var(--accent-100); }
.jp-step-head { display: flex; gap: 12px; align-items: center; }
.jp-step-n { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; flex-shrink: 0; }
.jp-step-head b { display: block; font-size: 17px; font-weight: 700; color: var(--slate-900); }
.jp-step-head div span { font-size: 13px; color: var(--slate-500); }
.jp-progress { height: 4px; background: var(--slate-100); border-radius: 999px; margin: 12px 0 14px; overflow: hidden; }
.jp-progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.jp-photo-btns { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.jp-shot { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px dashed var(--slate-300); border-radius: 12px; padding: 14px; font-weight: 600; color: var(--slate-700); cursor: pointer; background: var(--slate-50); }
.jp-shot svg { width: 18px; height: 18px; }
.jp-photo { position: relative; }
.jp-photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; border: 1px solid var(--slate-200); display: block; }
.jp-photo .cp-mini { position: absolute; right: 8px; bottom: 8px; background: rgba(255,255,255,.92); }
.jp-count { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 14px; color: var(--slate-700); }
.jp-go { width: 100%; margin-top: 14px; border: 0; border-radius: 12px; padding: 14px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; font-size: 15.5px !important; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.jp-go.green { background: #059669; }
.jp-go svg { width: 18px; height: 18px; }
.jp-fail { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 8px; border: 0; background: transparent; color: var(--red); font: inherit; font-size: 13.5px !important; font-weight: 600; padding: 8px; cursor: pointer; }
.jp-fail svg { width: 14px; height: 14px; }
.jp .sigpad canvas { height: 130px; }

.build-tag { font-size: 11px; color: rgba(255,255,255,.4); padding: 8px 12px 0; letter-spacing: .04em; }
.build-tag.side { padding: 4px 10px 0; }
.collapsed .build-tag.side { display: none; }

/* ---------- Client editor ---------- */
.ce .cp-head .segmented { flex-shrink: 0; }
.ce-addr { border: 1px solid var(--slate-200); border-radius: 12px; padding: 12px; margin-top: 10px; background: var(--slate-50); }
.ce-addr-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ce-labels { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; min-width: 0; }
.ce-labels::-webkit-scrollbar { display: none; }
.ce-labels .pill-filter { padding: 5px 11px; }
.ce-city { font-size: 12.5px; color: var(--slate-500); margin: 6px 2px 0; }
.ce-bar .ce-save { flex: 1; justify-content: center; border-radius: 999px; }
.ce-bar > .btn { border-radius: 999px; }
.ce-bar .btn.danger { background: transparent; border-color: #fecaca; }
@media (max-width: 900px) { .ce-bar .btn.danger { padding-left: 14px; padding-right: 14px; } }

/* ---------- Invoices: one row everywhere (number | Amount | Balance) ---------- */
.inv-list { display: flex; flex-direction: column; }
.inv-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 2px; border-top: 1px solid var(--slate-100); cursor: pointer; }
.inv-list > .inv-row:first-child { border-top: 0; }
.card.pad-0 .inv-row { padding: 12px 14px; }
.inv-row:hover { background: var(--slate-50); }
.inv-row .cp-main em { font-style: normal; color: var(--red); font-weight: 600; }
.inv-figs { display: grid; grid-template-columns: auto auto; gap: 14px; text-align: right; }
.inv-figs label, .inv-big label, .inv-sum label { display: block; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-400); line-height: 1.2; }
.inv-figs b { font-size: 14.5px; font-weight: 700; color: var(--slate-900); font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-figs .owe b, .inv-big .owe b { color: var(--amber); }
.inv-figs .late b, .inv-big .late b, .inv-sum .late b { color: var(--red); }
.inv-figs .zero b, .inv-big .zero b { color: var(--slate-400); }
.inv-big { display: grid; grid-template-columns: 1fr 1fr; padding: 0; margin-bottom: 12px; overflow: hidden; }
.inv-big > div { padding: 16px 18px; }
.inv-big > div + div { border-left: 1px solid var(--slate-100); }
.inv-big b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; color: var(--slate-900); font-variant-numeric: tabular-nums; }
.inv-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; margin: 12px 0; overflow: hidden; }
.inv-sum > div { padding: 12px 14px; min-width: 0; }
.inv-sum > div + div { border-left: 1px solid var(--slate-100); }
.inv-sum b { display: block; font-size: 17px; font-weight: 700; color: var(--slate-900); margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-tot { border-top: 1px solid var(--slate-200); margin-top: 4px; padding-top: 8px; }
.inv-tot > div { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--slate-500); padding: 3px 2px; }
.inv-tot > div.t { font-size: 15.5px; font-weight: 700; color: var(--slate-900); padding-top: 6px; }
.inv-sent { border-top: 0; padding: 0 2px 12px; }
.jp-sub a { font-size: 13.5px; font-weight: 600; }
@media (max-width: 420px) { .inv-figs { gap: 10px; } .inv-figs b { font-size: 13.5px; } .inv-sum b { font-size: 15px; } }

/* ---------- Client approve: draw to sign ---------- */
.ap-total { border-top: 0; margin-top: 4px; padding-top: 4px; }
.ap-total span { display: block; font-size: 13px; color: var(--q-muted); margin-top: 6px; }
.ap-sig { border: 1.5px dashed #c9c9d1; border-radius: 16px; background: #fff; touch-action: none; }
.ap-sig canvas { height: 200px; border-radius: 16px; }
.ap-sig .hint { font-size: 13px; bottom: 14px; color: #a1a1aa; }
.ap-sig.nudge { animation: apNudge .35s ease; border-color: var(--red); }
@keyframes apNudge { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.ap-terms { font-size: 12.5px; color: var(--q-muted); text-align: center; margin: 10px 0 16px; }
.ap-btn { width: 100%; border: 0; cursor: pointer; font-family: inherit; }

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

/* Delivery sheet buttons match the job page's action buttons */
.js-primary { border-radius: 12px; padding: 14px; font-size: 15.5px !important; font-weight: 600; background: var(--accent); }
.js-primary.ghost { background: var(--navy); color: #fff; }
.js-row2 .cp-btn { padding: 13px 10px; }

/* ---------- Home: bigger route section, call-only rows ---------- */
.rt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.rt-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--slate-900); text-transform: none; }
.rt-head span { font-size: 13.5px; color: var(--slate-500); font-weight: 500; white-space: nowrap; }
.route-card .rt-row { grid-template-columns: 38px minmax(0, 1fr) 46px; gap: 12px; padding: 14px 2px; }
.route-card .rt-n { width: 36px; height: 36px; font-size: 15px; }
.route-card .rt-n svg { width: 17px; height: 17px; }
.route-card .rt-body b { font-size: 16.5px; }
.route-card .rt-body span { font-size: 13.5px; margin-top: 2px; }
.route-card .rt-call { width: 44px; height: 44px; border-radius: 50%; background: #059669; color: #fff; display: grid; place-items: center; text-decoration: none; }
.route-card .rt-call:hover { filter: brightness(.95); text-decoration: none; }
.route-card .rt-call svg { width: 19px; height: 19px; }
.route-card .rt-row.delivered .rt-call, .route-card .rt-row.failed .rt-call { background: var(--slate-100); color: var(--slate-500); }
.home-head { margin-bottom: 14px; }

/* ---------- Home: monthly money donut ---------- */
.money-card { margin-top: 16px; }
.mo-head { align-items: center; }
.mo-nav { display: flex; gap: 6px; }
.mo-body { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 18px; align-items: center; margin-top: 6px; }
.mo-donut { width: 140px; height: 140px; display: block; }
.mo-donut .viz-mark { cursor: pointer; }
.mc-k { font: 600 11px var(--font); fill: var(--slate-500); letter-spacing: .06em; text-transform: uppercase; }
.mc-v { font: 700 22px var(--font); fill: var(--slate-900); }
.mc-v.neg { fill: var(--red); }
.mo-figs { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mo-fig label { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-500); }
.mo-fig label i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.mo-fig b { display: block; font-size: 18px; font-weight: 700; color: var(--slate-900); font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }
.mo-fig.rev b { font-size: 22px; }
.mo-fig b.neg { color: var(--red); }
.mo-links { display: flex; gap: 22px; justify-content: flex-start; border-top: 1px solid var(--slate-100); margin-top: 16px; padding-top: 12px; font-size: 14px; font-weight: 600; }
@media (max-width: 380px) { .mo-body { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; } .mo-donut { width: 120px; height: 120px; } }

/* ---------- Schedule embedded on Home ---------- */
.sched.home-sched { height: 520px; min-height: 0; margin-top: 16px; border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.home-sched .sc-title b { font-size: 22px; }
.home-sched .sc-scroll { overscroll-behavior: auto; }
@media (max-width: 900px) {
  .sched.home-sched { height: 500px; border: 1px solid var(--slate-200); border-radius: var(--radius); }
  .home-sched .sc-arrow { display: none; }
  .home-sched .sc-arrow.show { display: inline-flex !important; }
}

/* Home calendar: a normal card (no inner scrolling) so vertical swipes always scroll the page */
.sched.home-sched { height: auto !important; overflow: hidden; }
.home-sched #sc-body, .home-sched .sc-pane { flex: none; }
.home-sched .sc-scroll { overflow: visible; flex: none; }
.home-sched .sc-month { touch-action: auto; }
.home-sched .sc-ev { padding: 6px 8px; }
.home-sched .sc-ev span:last-child { display: none; }

/* iPhone Safari only sends taps to elements that look clickable: mark every action target. */
[data-action], [data-href], label.check, .sc-col, .scm-day { cursor: pointer; }
/* Calendar: vertical pans belong to the page/scroller, horizontal swipes belong to the day pager. */
.sc-pane { touch-action: pan-y; }
.home-sched .sc-month { touch-action: pan-y; }

/* Sheet close: inert the moment it starts closing; backdrop needs no touch-action (scroll lock is JS) */
.jsheet.closing { pointer-events: none; }
.jsheet-backdrop { touch-action: auto; }
.sc-pane { touch-action: pan-y; }

/* Quote editor: bold, dark section titles and field labels */
.qe-wrap .card-head h2, .qe-wrap .card-head h3, .qe-wrap .qe-h2 { font-size: 17px; font-weight: 700; color: var(--slate-900); text-transform: none; letter-spacing: -.005em; }
.qe-wrap .field label, .qe-wrap .field .li-label label { font-size: 14px; font-weight: 700; color: var(--slate-800); text-transform: none; letter-spacing: 0; }
.qe-wrap .field { gap: 7px; }
.qe-wrap .li-totalrow span { font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--slate-800); }
.qe-wrap .check { font-weight: 600; color: var(--slate-800); }

/* Quotes list: minimal rows */
.ql-head { margin-bottom: 12px; }
.ql-filters { margin-bottom: 12px; }
.q-row { grid-template-columns: 1fr auto; gap: 12px; padding: 14px 16px; }
.q-main { gap: 3px; }
.q-main b { font-size: 15.5px; font-weight: 700; }
.q-main span { font-size: 13px; color: var(--slate-500); }
.q-right { gap: 5px; }
.q-right b { font-size: 15.5px; font-weight: 700; }

/* More drawer: large, easy-to-hit buttons, no close X */
.drawer { width: min(330px, 86vw); gap: 6px; padding-left: 12px; padding-right: 12px; }
.drawer .brand { padding: 4px 8px 14px; }
.drawer .nav { gap: 6px; }
.drawer .nav a { padding: 15px 16px; gap: 14px; font-size: 17px; font-weight: 600; border-radius: 13px; color: rgba(255,255,255,.88); background: transparent; min-height: 54px; }
.drawer .nav a svg { width: 22px; height: 22px; opacity: 1; }
.drawer .nav a.active { background: rgba(255,255,255,.16); color: #fff; }
.drawer .nav a:active { background: rgba(255,255,255,.2); }
.drawer .nav a .badge { font-size: 12.5px; padding: 2px 9px; }
.drawer-sec { font-size: 12px; padding: 18px 12px 6px; color: rgba(255,255,255,.55); }
.drawer .side-user .avatar { width: 40px; height: 40px; font-size: 14px; }
.drawer .side-user b { font-size: 16px; }
.drawer .side-user small { font-size: 13px; }

/* Home: day strip + agenda (replaces the time-grid calendar on Home) */
.up-card { margin-top: 16px; padding: 16px 0 8px; }
.up-head { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 12px; }
.up-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--slate-900); text-transform: none; }
.up-all { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; color: var(--accent-600); text-decoration: none; }
.up-all svg { width: 15px; height: 15px; }
.up-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain; }
.up-strip::-webkit-scrollbar { display: none; }
.up-strip::after { content: ""; flex: 0 0 8px; }
.up-day { flex: 0 0 auto; width: 56px; padding: 9px 0 8px; border-radius: 14px; border: 1px solid var(--slate-200); background: #fff; color: var(--slate-900); display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; font-family: inherit; -webkit-tap-highlight-color: transparent; }
.up-day small { font-size: 12px; font-weight: 600; color: var(--slate-500); }
.up-day b { font-size: 20px; font-weight: 700; line-height: 1.15; }
.up-day i { display: flex; gap: 3px; height: 6px; }
.up-day em { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.up-day.today:not(.on) { border-color: var(--accent); }
.up-day.today:not(.on) small { color: var(--accent-600); }
.up-day.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.up-day.on small { color: rgba(255,255,255,.75); }
.up-day.on em { background: #fff; }
.up-label { padding: 12px 16px 4px; font-size: 14px; font-weight: 700; color: var(--slate-700); }
.up-list { display: flex; flex-direction: column; }
.up-row { display: grid; grid-template-columns: 54px 4px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 16px; border: 0; border-top: 1px solid var(--slate-100); background: none; text-align: left; font-family: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.up-row:first-child { border-top: 0; }
.up-row:active { background: var(--slate-50); }
.up-time { display: flex; flex-direction: column; line-height: 1.2; }
.up-time b { font-size: 14px; font-weight: 700; color: var(--slate-900); }
.up-time small { font-size: 12px; color: var(--slate-500); }
.up-bar { align-self: stretch; border-radius: 4px; background: var(--accent); }
.up-row.enroute .up-bar { background: var(--amber); }
.up-row.delivered .up-bar { background: var(--green); }
.up-row.failed .up-bar { background: var(--red); }
.up-row.delivered .up-main, .up-row.failed .up-main { opacity: .6; }
.up-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.up-main b { font-size: 15.5px; font-weight: 700; color: var(--slate-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-main small { font-size: 13px; color: var(--slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-empty { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; color: var(--slate-500); font-size: 14px; }

/* Drop-off signature: big tile + full-screen sideways pad */
.sig-tile { width: 100%; margin-top: 12px; border: 1.5px dashed var(--slate-300); background: var(--slate-50); border-radius: 14px; min-height: 124px; padding: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font: inherit; color: var(--slate-800); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sig-tile:active { background: var(--slate-100); }
.sig-tile b { font-size: 17px; font-weight: 700; color: var(--slate-900); }
.sig-tile small { font-size: 13px; color: var(--slate-500); }
.sig-tile-ic { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; margin-bottom: 6px; }
.sig-tile-ic svg { width: 21px; height: 21px; }
.sig-tile.signed { background: #fff; border-style: solid; border-color: var(--slate-200); position: relative; }
.sig-tile.signed img { max-width: 100%; max-height: 104px; display: block; }
.sig-tile.signed span { position: absolute; right: 10px; bottom: 8px; display: inline-flex; gap: 5px; align-items: center; font-size: 13px; font-weight: 700; color: var(--accent-600); background: rgba(255,255,255,.9); padding: 2px 6px; border-radius: 8px; }
.sig-tile.signed span svg { width: 14px; height: 14px; }

.sigfull { position: fixed; inset: 0; z-index: 500; background: #fff; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; animation: fadeIn .15s ease both; }
.sf-stage { position: absolute; top: 0; left: 0; transform-origin: 50% 50%; display: flex; flex-direction: column; background: #fff; box-sizing: border-box; padding: 10px max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
.sf-stage.rot { padding: 12px max(14px, env(safe-area-inset-bottom)) 14px max(14px, env(safe-area-inset-top)); }
.sf-bar { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; flex-shrink: 0; }
.sf-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.sf-title b { font-size: 18px; font-weight: 700; color: var(--slate-900); }
.sf-title span { font-size: 13.5px; color: var(--slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-btn { border: 1px solid var(--slate-200); background: #fff; color: var(--slate-800); font: inherit; font-weight: 600; font-size: 15.5px; border-radius: 12px; padding: 10px 16px; min-height: 46px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; flex-shrink: 0; }
.sf-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; padding: 10px 24px; }
.sf-btn svg { width: 18px; height: 18px; }
.sf-pad { position: relative; flex: 1; min-height: 0; border: 1.5px dashed var(--slate-300); border-radius: 16px; background: #fff; overflow: hidden; }
.sf-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; display: block; }
.sf-line { position: absolute; left: 6%; right: 6%; bottom: 28%; border-bottom: 2px solid var(--slate-200); pointer-events: none; }
.sf-line span { position: absolute; left: 2px; bottom: 6px; font-size: 22px; line-height: 1; color: var(--slate-400); }
.sf-hint { position: absolute; left: 0; right: 0; bottom: 14%; text-align: center; font-size: 14px; color: var(--slate-400); pointer-events: none; transition: opacity .2s; }

/* New delivery page */
.nd-stop { display: flex; flex-direction: column; gap: 8px; }
.nd-stop-lbl { display: flex; align-items: center; gap: 10px; }
.nd-stop-lbl b { font-size: 15px; font-weight: 700; color: var(--slate-900); flex: 1; }
.nd-stop-lbl .stop-num { width: 24px; height: 24px; font-size: 12px; }
.nd-addpick { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px dashed var(--slate-300); background: var(--slate-50); color: var(--accent-600); border-radius: 12px; padding: 12px; min-height: 48px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.nd-addpick svg { width: 17px; height: 17px; }
.nd-addpick:active { background: var(--slate-100); }
.nd-item { display: flex; align-items: center; gap: 8px; }
.nd-item-btn { flex: 1; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-qty { display: inline-flex; align-items: center; border: 1px solid var(--slate-300); border-radius: 12px; overflow: hidden; flex-shrink: 0; background: #fff; height: 48px; }
.nd-qty button { border: 0; background: var(--slate-50); width: 40px; height: 100%; font-size: 20px; color: var(--slate-700); cursor: pointer; }
.nd-qty input { width: 46px; height: 100%; border: 0; text-align: center; font: inherit; font-size: 16px; font-weight: 700; color: var(--slate-900); -moz-appearance: textfield; background: #fff; }
.nd-qty input::-webkit-outer-spin-button, .nd-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.nd .addr-menu { z-index: 40; }
.nd .addr-opt { font-size: 15px; padding: 11px 10px; }

/* Login / boot */
.auth-stage, .boot { min-height: 100dvh; display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); background: var(--bg, #f4f6fa); }
.auth-card { width: min(400px, 100%); background: #fff; border: 1px solid var(--slate-200); border-radius: 18px; padding: 28px 22px; box-shadow: var(--shadow-sm); }
.auth-card h1 { font-size: 24px; margin: 18px 0 16px; color: var(--slate-900); }
.auth-card .field label { font-size: 14px; font-weight: 700; color: var(--slate-800); text-transform: none; letter-spacing: 0; }
.auth-logo { display: block; width: 180px; max-width: 70%; height: auto; margin: 0 auto; }
.auth-msg { color: var(--red); font-size: 14px; font-weight: 600; }
.auth-note { margin: 0 0 16px; color: var(--slate-600); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.auth-note strong { color: var(--slate-900); }
.auth-code { font-size: 22px; font-weight: 700; letter-spacing: .18em; font-variant-numeric: tabular-nums; }
.auth-code::placeholder { color: var(--slate-300); }
.boot { display: flex; flex-direction: column; gap: 14px; color: var(--slate-500); text-align: center; }
.boot img { width: 160px; height: auto; }

/* Sync status (outbox) */
.sync-status { font-size: 12.5px; font-weight: 600; color: #fde68a; margin-left: auto; white-space: nowrap; padding-left: 10px; }
.sync-status[data-state="offline"] { color: #fca5a5; }
.sync-status[hidden] { display: none !important; }
.topbar .sync-status { color: var(--amber, #b45309); margin-right: 12px; }
.sync-badge { display: inline-flex; align-items: center; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #fff4e5; color: #92400e; font-size: 11.5px; font-weight: 700; white-space: nowrap; vertical-align: middle; }

/* The full-screen signature sits above notifications, so a toast can never swallow part of a signature.
   Messages raised while it's open (e.g. "Please sign first") show inside the stage instead. */
.sigfull { z-index: 1400; }
.sf-hint.sf-hint-warn { color: var(--red); font-weight: 700; font-size: 16px; }
.img-missing { background: var(--slate-100); min-height: 80px; }
.nd-split { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--slate-600); }
.nd-split b { color: var(--slate-900); font-variant-numeric: tabular-nums; }

/* Tanco logo in the header, sidebar, drawer and quote preview */
.brand-logo { height: 30px; width: auto; display: block; flex-shrink: 0; }
.mobile-topbar .brand-logo { height: 28px; }
.owner.collapsed .sidebar .brand-logo, .collapsed .brand-logo { height: auto; width: 44px; }
.cq-logo img.brand-logo { height: 44px; }

/* Address rows open Google Maps (real links) */
a.cp-addr { text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }

/* Download PDF = print just the open document (invoice / statement); iPhone can save it as a PDF */
@media print {
  body * { visibility: hidden !important; }
  #modal-root .modal-body, #modal-root .modal-body * { visibility: visible !important; }
  #modal-root .modal-body { position: absolute; left: 0; top: 0; width: 100%; margin: 0; padding: 0; overflow: visible; }
  #modal-root .modal, #modal-root .modal-backdrop { position: static; max-height: none; overflow: visible; box-shadow: none; background: #fff; }
}

/* Update + offline bars (installable app) */
.update-bar, .offline-bar { position: fixed; left: 12px; right: 12px; z-index: 650; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); }
.update-bar { bottom: calc(140px + env(safe-area-inset-bottom)); background: var(--navy); color: #fff; }
.offline-bar { bottom: calc(84px + env(safe-area-inset-bottom)); background: #334155; color: #fff; justify-content: center; text-align: center; }
.update-bar[hidden], .offline-bar[hidden] { display: none !important; }
@media (min-width: 901px) { .update-bar, .offline-bar { left: auto; right: 24px; width: 360px; } .offline-bar { bottom: 24px; } .update-bar { bottom: 84px; } }
