/* Illum Digital. Brand tokens come from brand.css (npm run brand); everything else lives here. */

:root {
  --navy: var(--brand-dark, #081b35);
  --navy-2: var(--brand-dark-2, #162a45);
  --navy-3: var(--brand-dark-3, #223753);
  --primary: var(--brand-accent-ink, #1856ed);
  --primary-hover: #1247c9;
  --primary-soft: var(--brand-accent-soft, #eef4ff);
  --wordmark: #4d84ff;
  --on-navy: #ffffff;
  --on-navy-2: rgba(255, 255, 255, 0.78);
  --on-navy-3: rgba(255, 255, 255, 0.6);

  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --border: #dfe6f0;
  --border-strong: #c9d3e1;
  --text: #0b1b33;
  --text-2: #3f4f66;
  --muted: #5a6a82;
  --grid: #e6ecf4;

  --good: #0e7a3c;
  --good-soft: #e7f6ed;
  --good-line: #bfe5cc;
  --warn: #8a5300;
  --warn-soft: #fff4dc;
  --warn-line: #f2b233;
  --bad: #c0262d;
  --bad-soft: #fdecec;
  --bad-line: #f5c2c4;
  --info: #1856ed;
  --info-soft: #eaf1ff;
  --neutral-soft: #eef2f7;
  --violet: #6d3fd6;
  --violet-soft: #f1ebff;

  --radius: 10px;
  --radius-sm: 8px;
  --header-h: 76px;
  --sidebar-w: 256px;
  --gutter: 24px;
  --shadow: 0 1px 2px rgba(11, 27, 51, 0.05), 0 1px 3px rgba(11, 27, 51, 0.04);
  --shadow-lg: 0 18px 50px rgba(8, 27, 53, 0.22);
  --font: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--primary);
}

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

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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

.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.neg { color: var(--bad); }
.ml { margin-left: 6px; }
.pad { padding: 20px; }
.note { color: var(--text-2); font-size: 13px; }
.stack { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 16px; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------ boot + login */

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.boot-error {
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
  padding: 24px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--navy);
  background-image: radial-gradient(circle at 18% 12%, var(--navy-3), transparent 55%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 14px;
  padding: 28px 26px 22px;
  display: grid;
  gap: 14px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  margin-top: 6px;
}

.login-note {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.form-error {
  color: var(--bad);
  background: var(--bad-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 14px;
}

.field-error {
  color: var(--bad);
  font-size: 13px;
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.is-busy { cursor: progress; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

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

.btn-danger {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}

.btn-danger:hover { background: #9e1d23; border-color: #9e1d23; }

.btn-warn {
  background: #ffd873;
  border-color: #f2b233;
  color: #3a2600;
}

.btn-warn:hover { background: #ffcd4d; border-color: #e0a015; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  flex: none;
}

.icon-btn:hover { background: var(--neutral-soft); color: var(--text); }
.icon-btn.on-dark { color: var(--on-navy-2); }
.icon-btn.on-dark:hover { background: var(--navy-2); color: var(--on-navy); }

.link-btn {
  border: 0;
  background: none;
  padding: 4px 0;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.link-btn:hover { text-decoration: underline; }
.danger-link,
.btn.danger-link { color: var(--bad); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.row-actions {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ forms */

.field {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
}

.field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.field-hint {
  font-size: 13px;
  color: var(--muted);
}

.input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.input::placeholder { color: #8391a6; }

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.input:disabled,
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
.input[aria-invalid='true'] { border-color: var(--bad); }

.textarea { resize: vertical; min-height: 76px; }
.select { padding-right: 32px; }
.input-state { max-width: 90px; text-transform: uppercase; }
.input-money { max-width: 180px; }

.input-icon {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.input-icon > .icon {
  position: absolute;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
}

.input-icon > .input { padding-left: 38px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.check input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
.check-right { justify-content: flex-end; }

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.switch input {
  appearance: none;
  width: 44px;
  height: 26px;
  margin: 0;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  flex: none;
}

.switch input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}

.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }

.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-form .input { width: auto; flex: 1 1 200px; }

.inline-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-2);
}

.inline-label .input { width: auto; }

.custom-range {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filters .input-icon { flex: 1 1 280px; }
.filters .select-icon { flex: 0 1 240px; }
.page-actions .select-icon { min-width: 200px; }
.filters .input[type='search'] { flex: 1 1 280px; width: auto; }
.filters .select { width: auto; flex: 0 1 220px; }

.date-quick { display: grid; gap: 8px; }
.quick-row { display: flex; gap: 6px; flex-wrap: wrap; }

.quick {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
}

.quick:hover { background: var(--surface-2); }

.readonly-value {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
}

/* ------------------------------------------------------------------ badges, dots, chips */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge.has-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-warn.has-dot::before { background: #e39a0b; }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-good.has-dot::before { background: #19a557; }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-bad.has-dot::before { background: #e5383f; }
.badge-info,
.badge-brand { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--neutral-soft); color: var(--text-2); }
.badge-neutral.has-dot::before { background: #8a97aa; }
.badge-dim { background: transparent; color: var(--muted); border-color: var(--border); }
.badge-new { background: var(--navy); color: #fff; letter-spacing: 0.04em; }
.badge-violet { background: var(--violet-soft); color: var(--violet); }

.badge-stack { display: flex; flex-wrap: wrap; gap: 4px; }

.count-pill {
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--neutral-soft);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.brand-mark { border-radius: 8px; object-fit: cover; flex: none; background: var(--navy-2); }
.brand-dot { display: inline-block; border-radius: 8px; background: var(--primary); flex: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  min-height: 34px;
}

.chip-label { color: var(--muted); }
.chip-name { font-weight: 600; }

.chip-x {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: var(--neutral-soft);
  cursor: pointer;
}

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

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
}

.filter-chip:hover { border-color: var(--muted); }
.filter-chip[aria-pressed='true'] { background: var(--primary); border-color: var(--primary); color: #fff; }

.gmb-chip {
  padding: 2px 10px;
  border-radius: 6px;
  background: var(--neutral-soft);
  font-size: 13px;
  white-space: nowrap;
}

.gmb-chip.is-faded { opacity: 0.55; }

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.avatar-sm { width: 40px; height: 40px; font-size: 16px; }

/* ------------------------------------------------------------------ segmented control + tabs */

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: #e8edf5;
}

.seg-btn {
  border: 0;
  background: transparent;
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  min-height: 34px;
}

.seg-btn:hover { color: var(--text); }

.seg-btn[aria-pressed='true'] {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(11, 27, 51, 0.12);
}

.seg-sm .seg-btn { padding: 5px 12px; font-size: 13px; min-height: 30px; }

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--text-2);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text); }
.tab-btn[aria-selected='true'] { color: var(--primary); border-bottom-color: var(--primary); }

.view-tabs { display: flex; flex-wrap: wrap; gap: 8px; }

.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

.view-tab:hover { background: var(--neutral-soft); }
.view-tab[aria-pressed='true'] { background: var(--primary); color: #fff; }
.view-tab[aria-pressed='true'] .count-pill { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* ------------------------------------------------------------------ toast */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 1000;
  width: max-content;
  max-width: calc(100vw - 32px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  transition: opacity 0.3s, transform 0.3s;
}

.toast-bad { background: var(--bad); }
.toast-out { opacity: 0; transform: translateY(6px); }
.has-tabbar .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }

/* ------------------------------------------------------------------ modal + drawer */

.modal {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  color: var(--text);
  background: var(--surface);
}

.modal[open] { display: flex; flex-direction: column; }
.modal-wide { width: min(780px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(8, 27, 53, 0.45); }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 16px 10px 22px;
}

.modal-title { font-size: 20px; font-weight: 700; }

.modal-body {
  padding: 4px 22px 20px;
  overflow: auto;
  display: grid;
  gap: 14px;
  align-content: start;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 14px 14px;
}

.modal-text { color: var(--text-2); }

.drawer {
  margin: 0 0 0 auto;
  width: min(480px, 100vw);
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  animation: drawer-in 0.18s ease-out;
}

.drawer .modal-foot { border-radius: 0; }
.drawer .modal-title { font-size: 24px; }

@keyframes drawer-in {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

.secret-row { display: flex; gap: 8px; align-items: center; }

.secret {
  flex: 1;
  font: 600 18px/1.4 ui-monospace, 'Cascadia Mono', Consolas, monospace;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--navy);
  user-select: all;
}

/* ------------------------------------------------------------------ shell */

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
  padding: 0 24px;
  background: var(--navy);
  color: var(--on-navy);
  border-bottom: 1px solid var(--navy-2);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  width: calc(var(--sidebar-w) - 40px);
  flex: none;
}

.wordmark { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; color: var(--on-navy); }
.wordmark-1 { color: var(--wordmark); }

.header-crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 20px;
  border-left: 1px solid var(--navy-3);
  color: var(--on-navy-2);
  font-size: 15px;
  min-width: 0;
}

.header-crumbs a { color: var(--on-navy-2); text-decoration: none; }
.header-crumbs a:hover { color: #fff; text-decoration: underline; }
.header-crumbs .current { color: #fff; font-weight: 600; }
.header-spacer { flex: 1; }
.menu-btn { display: none; }

.app-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px 12px;
  background: var(--navy);
  color: var(--on-navy);
}

.nav { display: grid; gap: 4px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  color: var(--on-navy);
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
}

.nav-link:hover { background: var(--navy-2); }
.nav-link[aria-current='page'] { background: var(--primary); color: #fff; font-weight: 600; }

.side-divider { height: 1px; background: var(--navy-3); margin: 12px 8px; flex: none; }

.scope { display: grid; gap: 8px; padding: 0 4px; }

.scope-label {
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-navy-3);
}

.scope-current {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--navy-2);
  font-weight: 600;
}

.scope-current .dot { outline: 2px solid rgba(255, 255, 255, 0.25); }
.scope-current-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.scope-clear {
  border: 0;
  background: transparent;
  color: var(--on-navy-2);
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
}

.scope-clear:hover { background: var(--navy-3); color: #fff; }
.scope-note { padding: 0 10px; font-size: 13px; color: var(--on-navy-3); }
.scope-review { padding: 0 10px; font-size: 13px; color: var(--on-navy-2); text-decoration: none; }
.scope-review:hover { color: #fff; text-decoration: underline; }
.scope-review strong { color: #ffd873; }

.scope-search { position: relative; }

.scope-search .input {
  background: transparent;
  border-color: var(--navy-3);
  color: #fff;
  padding-left: 38px;
}

.scope-search .input::placeholder { color: var(--on-navy-3); }
.scope-search .input:focus { border-color: var(--wordmark); box-shadow: 0 0 0 3px rgba(77, 132, 255, 0.25); }
.scope-search > .icon { position: absolute; left: 12px; top: 11px; color: var(--on-navy-3); pointer-events: none; }

.scope-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  list-style: none;
  margin: 0;
}

.scope-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.scope-option[aria-selected='true'],
.scope-option:hover { background: var(--primary-soft); }
.scope-empty { padding: 10px; color: var(--muted); }

.client-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--on-navy);
  text-decoration: none;
  font-size: 15px;
}

.client-link:hover { background: var(--navy-2); }
.client-link[aria-current='page'] { background: var(--navy-2); }
.client-link-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.view-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  color: var(--wordmark);
  text-decoration: none;
  font-weight: 600;
}

.view-all:hover { text-decoration: underline; }

.user-card {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 4px 4px 8px;
  border-top: 1px solid var(--navy-3);
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  flex: none;
}

.user-text { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta { font-size: 13px; color: var(--on-navy-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.scrim { display: none; }
.app-main { min-width: 0; }
.page { padding: 22px var(--gutter) 40px; }
.page-inner { max-width: 1400px; margin: 0 auto; display: grid; gap: 18px; align-content: start; }

/* ------------------------------------------------------------------ page parts */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.page-head-text { min-width: 0; }
.page-eyebrow { display: inline-block; margin-bottom: 6px; padding: 2px 8px; border-radius: 4px; background: var(--neutral-soft); color: var(--text-2); font-size: 13px; font-weight: 600; }
.page-title { font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.page-sub { margin-top: 4px; font-size: 16px; color: var(--text-2); }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 6px; color: var(--text-2); font-size: 15px; }
.page-meta .sep { width: 1px; height: 16px; background: var(--border-strong); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.page-count { text-align: right; }
.page-count strong { display: block; font-size: 30px; line-height: 1.1; }
.page-count span { color: var(--text-2); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 18px 20px 14px;
}

.panel-head.with-line { border-bottom: 1px solid var(--border); }
.panel-title { font-size: 20px; font-weight: 700; line-height: 1.3; }
.panel-sub { margin-top: 2px; color: var(--text-2); font-size: 14px; }
.panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.panel-body { padding: 0 20px 20px; }
.panel-body.flush { padding: 0; }
.panel > .panel-body:first-child:not(.flush) { padding-top: 20px; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Old card API, still used by a few screens. */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 18px; font-weight: 700; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.toolbar-right { margin-left: auto; }

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

.tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

a.tile:hover { border-color: var(--primary); }
.tile-flat { box-shadow: none; }
.tile-text { min-width: 0; }
.tile-value { font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.tile-value-sm { font-size: 24px; }
.tile-label { font-size: 15px; color: var(--text-2); }
.tile-sub { font-size: 13px; color: var(--muted); }
.tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tile-stack { flex-direction: column; align-items: stretch; gap: 8px; }

.icon-circle {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex: none;
}

.icon-circle-sm { width: 44px; height: 44px; }
.icon-square { border-radius: 10px; width: 44px; height: 44px; }
.tone-blue { background: var(--info-soft); color: var(--info); }
.tone-green { background: var(--good-soft); color: var(--good); }
.tone-amber { background: var(--warn-soft); color: #b56d00; }
.tone-red { background: var(--bad-soft); color: var(--bad); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.tone-neutral { background: var(--neutral-soft); color: var(--text-2); }

.section-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.empty { padding: 32px 20px; text-align: center; }
.empty-title { font-weight: 600; font-size: 15px; }
.empty-sub { color: var(--muted); margin-top: 4px; }

.loading { display: flex; align-items: center; gap: 10px; padding: 24px; color: var(--muted); }

.spin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.callout {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.callout-row { display: flex; align-items: flex-start; gap: 14px; }
.callout-title { font-weight: 700; font-size: 15px; }
.callout-warn { background: var(--warn-soft); border-color: #f5dca5; }
.callout-bad { background: var(--bad-soft); border-color: var(--bad-line); }
.callout-info { background: var(--info-soft); border-color: #cdddfc; }
.callout-good { background: var(--good-soft); border-color: var(--good-line); }
.quote { margin: 0; font-style: italic; color: var(--text); }

.info-line { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.info-line .icon { color: var(--primary); flex: none; }

/* ------------------------------------------------------------------ tables */

.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }

.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-compact td, .table-compact th { padding: 8px 12px; }
.table .num { text-align: right; white-space: nowrap; }
.table .cell-title { font-weight: 700; font-size: 15px; }
.table .cell-sub { color: var(--muted); font-size: 13px; }
.table-hover tbody tr.clickable { cursor: pointer; }
.table-hover tbody tr.clickable:hover,
.table-hover tbody tr.clickable:focus-visible,
.table tbody tr.is-selected { background: var(--primary-soft); }
.table tr.is-faded td { color: var(--muted); }
.table .check-col { width: 44px; }
.sr-col { font-size: 0 !important; }

.cell-client { display: inline-flex; align-items: center; gap: 8px; }
.load-more { display: flex; justify-content: center; padding: 12px; }
.load-more:empty { display: none; }

/* ------------------------------------------------------------------ overview */

.ov-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.ov-chart .chart { padding: 0; }
.ov-chart .axis-label { font-size: 12px; fill: var(--text-2); }

.queue { list-style: none; margin: 0; padding: 0; }

.queue-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

.queue-title { font-weight: 700; }
.queue-sub { color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-when { color: var(--text-2); font-size: 14px; white-space: nowrap; }

/* ------------------------------------------------------------------ chart */

.chart { padding: 12px 16px 14px; display: grid; gap: 8px; }
.chart-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; font-size: 14px; color: var(--text-2); }
.chart-legend .link-btn { margin-left: auto; font-size: 13px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 11px; height: 11px; border-radius: 50%; }
.swatch-1 { background: var(--series-1); }
.swatch-2 { background: var(--series-2); }
.swatch-neutral { background: #c8d0cd; }
.swatch-brand { background: var(--primary); }
.swatch-green { background: #19a557; }
.chart-body { position: relative; }
.chart-plot { width: 100%; min-height: 240px; }
.chart-svg { display: block; overflow: visible; }
.grid-line { stroke: var(--grid); stroke-width: 1; }
.grid-zero { stroke: var(--border-strong); stroke-width: 1; }
.axis-label { fill: var(--muted); font-size: 11px; }
.bar-1 { fill: var(--series-1); }
.bar-2 { fill: var(--series-2); }
.bar-neutral { fill: #c8d0cd; }
.bar-brand { fill: var(--primary); }
.bar-green { fill: #19a557; }
.band-wash { fill: var(--text); opacity: 0; }
.band-wash.on { opacity: 0.045; }
.band-hit { fill: transparent; cursor: default; }
.band-hit:focus { outline: none; }
.band-hit:focus-visible { stroke: var(--primary); stroke-width: 1.5; }

.chart-tip {
  position: absolute;
  pointer-events: none;
  min-width: 190px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(11, 27, 51, 0.14);
  font-size: 13px;
  display: grid;
  gap: 3px;
  z-index: 5;
}

.tip-date { font-weight: 700; margin-bottom: 2px; }
.tip-row { display: flex; align-items: center; gap: 7px; }
.tip-name { flex: 1; color: var(--text-2); white-space: nowrap; }
.tip-key { width: 12px; height: 3px; border-radius: 2px; }
.tip-key-1 { background: var(--series-1); }
.tip-key-2 { background: var(--series-2); }
.tip-key-neutral { background: #c8d0cd; }
.tip-key-brand { background: var(--primary); }
.tip-key-green { background: #19a557; }
.chart-table { max-height: 320px; overflow: auto; }

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

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cal-shell { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }

.cal-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.cal-range { font-size: 18px; font-weight: 600; margin: 0 6px; }
.cal-toolbar .grow { flex: 1; }
.cal-tz { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text-2); font-size: 14px; }
.cal-head { display: flex; align-items: center; gap: 4px; }
.cal-title { font-size: 17px; font-weight: 700; flex: 1; text-align: center; }
.cal-count { text-align: right; margin: 2px 2px 8px; }

.month-grid { display: grid; border-top: 1px solid var(--border); }
.cal-card .month-grid,
.c-cal .month-grid { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.month-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-row + .month-row { border-top: 1px solid var(--border); }

.month-dow {
  padding: 8px 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface-2);
}

.month-cell {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 4px;
  min-height: 84px;
  padding: 6px 2px;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.month-cell:last-child { border-right: 0; }
.month-cell:hover { background: var(--surface-2); }
.month-cell.out { background: var(--surface-2); }
.month-cell.out .month-num { color: var(--muted); }
.month-cell.is-selected { box-shadow: inset 0 0 0 2px var(--primary); }

.month-num {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 600;
}

.month-cell.is-today .month-num { background: var(--primary); color: #fff; }
.month-dots { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 3px; max-width: 100%; padding: 0 2px; }
.cal-dot { width: 8px; height: 8px; border-radius: 50%; }
.cal-dot-brand { background: var(--primary); }
.month-more { font-size: 12px; font-weight: 700; color: var(--text-2); }

.week { overflow-x: auto; }

.week-grid {
  display: grid;
  grid-template-columns: 64px repeat(7, minmax(96px, 1fr));
  min-width: 760px;
  position: relative;
}

.week-dayhead {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 4px;
  text-align: center;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  font-weight: 600;
  cursor: pointer;
}

.week-dayhead .d { display: block; font-weight: 400; color: var(--text-2); font-size: 14px; }
.week-dayhead.is-today { color: var(--primary); }
.week-dayhead.is-today .d { color: var(--primary); font-weight: 600; }
.week-corner { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.week-hours { position: relative; }
.week-hour { height: 64px; padding: 0 8px 0 0; text-align: right; font-size: 13px; color: var(--text-2); transform: translateY(-8px); }
.week-col { position: relative; border-left: 1px solid var(--border); }
.week-col.is-today { background: #f2f7ff; }
.week-line { height: 64px; border-top: 1px solid var(--grid); }

.week-event {
  position: absolute;
  left: 3px;
  right: 3px;
  overflow: hidden;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid #b9cdfb;
  border-left: 4px solid var(--primary);
  background: #eaf1ff;
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.week-event.tone-good { background: #e8f7ee; border-color: #bfe5cc; border-left-color: #19a557; }
.week-event.tone-warn { background: #fff6e3; border-color: #f5dca5; border-left-color: #e39a0b; }
.week-event.tone-dim { background: #f1f4f8; border-color: var(--border); border-left-color: #9aa6b8; color: var(--text-2); }
.week-event.is-selected { box-shadow: 0 0 0 2px var(--primary); }
.week-event .t { font-size: 11px; color: var(--text-2); }
.week-event .n { font-weight: 700; }
.week-event.is-slot { cursor: default; }

.day-card { overflow: hidden; }
.day-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.day-title { font-size: 18px; font-weight: 700; }
.day-list { list-style: none; margin: 0; padding: 0; }
.day-row { border-bottom: 1px solid var(--border); }
.day-row:last-child { border-bottom: 0; }

.day-btn,
.day-row.is-slot {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 12px 18px;
  border: 0;
  border-left: 3px solid var(--primary);
  background: none;
  text-align: left;
  cursor: pointer;
}

.day-row.is-slot { cursor: default; border-left-color: var(--border-strong); color: var(--text-2); }
.day-btn:hover { background: var(--surface-2); }
.day-row.is-faded .day-btn { opacity: 0.6; border-left-color: var(--border-strong); }
.day-time { font-weight: 700; }
.day-name { font-weight: 600; }
.day-sub { font-size: 13px; color: var(--text-2); }
.day-client { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); margin-top: 2px; }
.empty-day { padding: 24px 16px; color: var(--muted); text-align: center; }
.legend-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
}

.appt-panel { padding: 20px; display: grid; gap: 16px; }
.appt-panel-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-2); }
.appt-panel-name { font-size: 24px; font-weight: 700; line-height: 1.2; }
.appt-panel-job { font-size: 18px; color: var(--text-2); }
.facts { display: grid; gap: 14px; list-style: none; margin: 0; padding: 0; }
.facts li { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; }
.facts li > .icon { color: var(--text-2); flex: none; margin-top: 2px; }

/* ------------------------------------------------------------------ lead drawer */

.lead-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.lead-client { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.lead-section { display: grid; gap: 8px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--text); }

.details { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }

.value-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow-wrap: anywhere;
}

.value-box > .icon { color: var(--text-2); flex: none; margin-top: 1px; }
.value-box.is-muted { background: var(--surface-2); color: var(--text-2); }

.status-row { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.status-row > div { display: grid; gap: 4px; }
.status-row .k { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }

.edit-details summary { cursor: pointer; }
.edit-details[open] summary { margin-bottom: 10px; }
.inline-book { display: grid; gap: 12px; padding-top: 4px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); display: grid; gap: 10px; }
.timeline li { position: relative; }

.timeline li::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
}

.timeline-when { font-size: 13px; color: var(--muted); }
.timeline-what { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.timeline-move { font-weight: 600; }

/* ------------------------------------------------------------------ log a call */

.log-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.log-form { display: grid; gap: 14px; }
.step { display: grid; gap: 14px; padding: 20px; }
.step-title { font-size: 20px; font-weight: 700; }
.step-title .n { margin-right: 8px; }
.step-sub { color: var(--text-2); margin-top: -8px; }

.outcome-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.outcome-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

.outcome-btn:hover { border-color: var(--muted); }
.outcome-btn[aria-pressed='true'] { border-color: var(--primary); background: var(--info-soft); color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.submit-note { color: var(--text-2); }
.today-list { list-style: none; margin: 0; padding: 0; max-height: 720px; overflow-y: auto; }

.today-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.today-name { font-weight: 700; font-size: 16px; }
.today-sub { color: var(--text-2); }
.today-time { color: var(--text-2); white-space: nowrap; }
.today-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.today-stats { display: flex; gap: 18px; }
.today-stats > div { display: grid; justify-items: end; }
.today-stats > div strong { font-size: 22px; line-height: 1.1; }
.today-stats > div span { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------------ clients */

.client-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.client-card { padding: 20px; display: grid; gap: 14px; align-content: start; }
.client-card-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.client-card-name { font-size: 19px; font-weight: 700; line-height: 1.25; }
.client-card-meta { color: var(--text-2); }
.client-card-meta .icon { vertical-align: -3px; margin-right: 4px; }
.client-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; align-items: center; margin: 0; }
.client-facts dt { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.client-facts dd { margin: 0; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--text-2); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }

.swatch-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border-strong);
  cursor: pointer;
}

.swatch-btn[aria-checked='true'] { box-shadow: 0 0 0 2px var(--text); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }

.split-callouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.big-figure { font-size: 30px; font-weight: 700; line-height: 1.15; }

/* ------------------------------------------------------------------ billing, settings, calls */

.billing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.billing-sub { color: var(--text-2); }
.owed { color: var(--bad); font-weight: 700; }
.select-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 20px; background: var(--info-soft); border-top: 1px solid #cdddfc; }
.review-lines { display: grid; gap: 8px; margin: 0; }
.review-lines > div { display: flex; justify-content: space-between; gap: 10px; }
.review-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px; border-top: 1px solid var(--border); font-size: 18px; font-weight: 700; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.setting-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); align-items: center; gap: 14px; }
.setting-toggle { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.save-bar { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.save-state { color: var(--text-2); }
.save-state.is-dirty { color: var(--warn); font-weight: 600; }
.logo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-frame { width: 72px; height: 72px; display: grid; place-items: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); flex: none; }
.logo-preview { max-width: 64px; max-height: 64px; object-fit: contain; border-radius: 8px; }
.logo-wordmark { font-size: 28px; font-weight: 700; color: var(--navy); }
.logo-wordmark .wordmark-1 { color: var(--primary); }

.list-card { overflow: hidden; }
.call-list { list-style: none; margin: 0; padding: 0; }
.call-row { display: flex; justify-content: space-between; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.call-row:last-child { border-bottom: 0; }
.call-main { display: grid; gap: 4px; min-width: 0; }
.call-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.call-notes { color: var(--text-2); background: var(--surface-2); border-radius: 6px; padding: 4px 8px; white-space: pre-wrap; }
.call-side { display: grid; justify-items: end; align-content: start; gap: 6px; flex: none; }

/* ------------------------------------------------------------------ contractor app */

.c-app { min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

.c-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--navy);
  color: #fff;
}

.c-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.c-brand-name { font-weight: 700; font-size: 20px; line-height: 1.2; }
.c-client { font-size: 15px; color: var(--on-navy-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-column { max-width: 720px; margin: 0 auto; padding: 22px 16px 28px; }
.c-main { display: grid; gap: 16px; }
.c-profile { width: 44px; height: 44px; color: #fff; }
.c-stats { display: grid; gap: 10px; }
.c-stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.c-stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.c-stat { padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.c-stat .stat-value { font-size: 24px; }
.c-stat-warn { background: var(--warn-soft); border-color: #f5dca5; }
.c-stat-warn .stat-value { color: var(--warn); }
.stat-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1.2; margin-top: 4px; }
.stat-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.install-hint { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border-radius: var(--radius); background: var(--primary-soft); font-size: 14px; }
.install-hint > span { flex: 1; }
.day-group { display: grid; gap: 10px; }
.day-heading { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); margin-top: 6px; }
.day-heading strong { color: var(--text); }

.appt { display: grid; gap: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.appt.is-new { border-color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
.appt.is-faded { opacity: 0.6; }
.appt-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.appt-time { font-size: 17px; font-weight: 800; margin-right: 2px; }
.appt-name { font-size: 18px; font-weight: 700; line-height: 1.25; }
.appt-service { color: var(--text-2); }
.appt-contact { display: flex; flex-wrap: wrap; gap: 6px; }

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--neutral-soft);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.pill-link:hover { background: #e2e8f1; }
.appt-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.appt-links { display: flex; align-items: center; gap: 16px; }
.appt-compact { padding: 10px 12px; gap: 4px; }
.appt-compact .appt-time { font-size: 13px; font-weight: 700; }
.appt-compact .appt-name { font-size: 15px; }
.appt-compact .appt-links { justify-content: space-between; }
.compact-list { display: grid; gap: 8px; }
.c-cal { padding: 12px; }

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.tab { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; margin: 0 4px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.tabbar { max-width: 100%; }
@media (min-width: 900px) {
  .tabbar { padding-left: calc(50% - 480px); padding-right: calc(50% - 480px); }
}

/* Contractor pages */
.cv-head { display: grid; gap: 2px; }
.cv-title { font-size: 30px; font-weight: 700; line-height: 1.2; }
.cv-sub { color: var(--text-2); font-size: 17px; }
.cv-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cv-tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cv-tile { min-width: 0; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.cv-tile-label { color: var(--text-2); font-size: 15px; }
.cv-tile-value { color: var(--primary); font-size: 30px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.cv-tile-sub { color: var(--muted); font-size: 13px; }
.cv-group { display: grid; gap: 10px; }
.cv-day { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 6px; }
.cv-day h2 { font-size: 20px; font-weight: 700; }
.cv-day-suffix { font-size: 15px; font-weight: 400; color: var(--text-2); }
.cv-tz { color: var(--text-2); font-size: 15px; white-space: nowrap; }
.cv-empty { color: var(--muted); padding: 4px 2px; }
.cv-list { display: grid; gap: 12px; }
.cv-card { display: grid; gap: 6px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.cv-card.is-new { border-color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
.cv-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cv-time { font-size: 19px; font-weight: 700; }
.cv-name { font-size: 18px; font-weight: 700; line-height: 1.3; }
.cv-service { color: var(--text-2); }
.cv-line { display: flex; align-items: flex-start; gap: 10px; color: var(--text-2); overflow-wrap: anywhere; }
.cv-line .icon { flex: none; margin-top: 2px; }
.cv-notes { color: var(--text-2); }
.cv-notes strong { color: var(--text-2); }
.cv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.cv-actions .btn { min-height: 42px; }
.cv-details { font-weight: 600; font-size: 15px; }
.btn-outline { background: var(--surface); border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
a.btn { text-decoration: none; }
.cv-compact { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.cv-compact-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.cv-compact .cv-time { font-size: 17px; }
.cv-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.cv-row .cv-time { font-size: 17px; }
.cv-hist { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.cv-hist-left { display: grid; gap: 4px; min-width: 0; }
.cv-hist-date, .cv-hist-time { font-weight: 700; font-size: 17px; }
.cv-hist-right { display: grid; justify-items: end; align-content: space-between; gap: 10px; text-align: right; }
.cv-amount { color: var(--text-2); }
.cv-cal { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cv-cal-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
.cv-cal-head h2 { flex: 1; text-align: center; font-size: 20px; font-weight: 700; }
.cv-nav { min-width: 44px; padding: 0 10px; }
.cv-today { padding: 0 16px; }
.cv-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.cv-dow { padding: 8px 0; text-align: center; color: var(--text-2); border-bottom: 1px solid var(--border); }
.cv-cell { min-height: 60px; display: grid; align-content: center; justify-items: center; gap: 2px; padding: 4px 0; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); font-size: 17px; cursor: pointer; }
.cv-cell:nth-child(7n) { border-right: 0; }
.cv-cell:hover { background: var(--surface-2); }
.cv-cell.is-blank { cursor: default; background: var(--surface); }
.cv-cell.is-today .num { color: var(--primary); font-weight: 700; }
.cv-cell[aria-pressed='true'] { background: var(--primary); color: #fff; border-radius: 6px; }
.cv-cell[aria-pressed='true'] .num { color: #fff; font-weight: 700; }
.cv-cell .cnt { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--primary); }
.cv-cell[aria-pressed='true'] .cnt { color: #fff; }
.cnt-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cv-opts { display: grid; gap: 8px; }
.cv-opt { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; }
.cv-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.cv-opt input { flex: none; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); }
.cv-opt > span { display: grid; gap: 2px; }
.cv-opt-title { font-weight: 700; }
.cv-opt-sub { color: var(--text-2); font-size: 14px; }

@media (max-width: 560px) {
  .cv-title { font-size: 26px; }
  .cv-tiles { gap: 8px; }
  .cv-tile { padding: 10px 12px; }
  .cv-tile-value { font-size: 26px; }
  .cv-tiles-2 .cv-tile-value { font-size: 22px; }
  .cv-card { padding: 14px; }
  .cv-actions .btn { flex: 1 1 auto; }
  .cv-cell { min-height: 52px; font-size: 16px; }
  .cv-day h2 { font-size: 18px; }
}
.tab[aria-current='page'] { background: var(--primary-soft); color: var(--primary); }

/* ------------------------------------------------------------------ VA screens */

.nav-badge {
  margin-left: auto;
  flex: none;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.nav-link[aria-current='page'] .nav-badge { background: #fff; color: var(--primary); }
.nav-link > span:not(.nav-badge):not(.sr-only) { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step > .seg { justify-self: start; }
.grow { flex: 1; }
.center { text-align: center; }
.btn-lg { min-height: 52px; font-size: 17px; }

.req-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--info-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  vertical-align: 1px;
}

.biz-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px 16px; align-items: start; }

/* Business picker */
.bpick { position: relative; }

.bpick-btn {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.bpick-btn:hover { border-color: var(--muted); }
.bpick-btn[aria-expanded='true'] { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24, 86, 237, 0.15); }
.bpick-btn:disabled { background: var(--surface-2); cursor: default; color: var(--text-2); }
.bpick-btn > .icon { flex: none; color: var(--text-2); }
.bpick-text { flex: 1; min-width: 0; display: grid; }
.bpick-name { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bpick.is-empty .bpick-name { color: #8391a6; font-weight: 400; }
.bpick-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bpick-pop {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  width: max(100%, 320px);
  max-width: calc(100vw - 32px);
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 6px;
}

.bpick-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; }
.bpick-option { display: grid; gap: 1px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.bpick-option[aria-selected='true'],
.bpick-option:hover { background: var(--primary-soft); }
.bpick-option[data-current='true'] .bpick-o-name { color: var(--primary); }
.bpick-o-name { font-weight: 600; }
.bpick-o-sub { font-size: 13px; color: var(--muted); }
.bpick-empty { padding: 10px; color: var(--muted); }

.instructions { border: 1px solid #cdddfc; border-radius: var(--radius-sm); background: var(--info-soft); }
.instructions summary { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; font-weight: 600; color: var(--primary); }
.instructions summary .icon { flex: none; }
.instructions-text { padding: 0 12px 12px 38px; white-space: pre-line; color: var(--text); }

/* Book appointment */
.book-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.book-steps { display: grid; gap: 14px; min-width: 0; }
.appt-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr); gap: 14px 16px; align-items: start; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot-grid-side { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }

.slot-chip {
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
}

.slot-chip:hover { border-color: var(--primary); color: var(--primary); }
.slot-chip[aria-pressed='true'] { background: var(--primary); border-color: var(--primary); color: #fff; }
.slot-empty { padding: 8px 0; }
.your-time { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
.your-time .icon { color: var(--primary); flex: none; }

.review { position: sticky; top: calc(var(--header-h) + 16px); padding: 20px; display: grid; gap: 14px; }
.review-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.review-head .panel-sub { flex-basis: 100%; }
.review-rows { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.review-row {
  display: grid;
  grid-template-columns: 24px 110px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.review-row:first-child { border-top: 0; }
.review-row > .icon { color: var(--text-2); margin-top: 1px; }
.review-k { font-weight: 600; }
.review-v { min-width: 0; overflow-wrap: anywhere; }
.review-sub { color: var(--muted); font-size: 13px; }
a.review-sub { color: var(--primary); display: inline-block; }
.review-tip .callout-row { align-items: center; }
.review-tip .icon { color: var(--primary); flex: none; }
.review-delivery { text-align: center; margin-top: -6px; }
.draft-state { display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 20px; color: var(--text-2); font-size: 14px; }
.draft-state .icon { color: var(--good); }

/* My appointments */
.banner .callout-row { align-items: center; }
.banner .icon { color: #e39a0b; flex: none; }
.banner .link-btn { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.appts-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.appts-main { display: grid; gap: 12px; min-width: 0; }
.seg-lg { background: var(--surface); border: 1px solid var(--border); padding: 3px; }
.seg-lg .seg-btn { min-height: 44px; padding: 0 22px; font-size: 15px; }
.appts-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.appts-filters .input-icon .input { min-height: 52px; }
.appt-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.appt-card {
  width: 100%;
  display: grid;
  grid-template-columns: 76px minmax(150px, 0.9fr) minmax(0, 1.2fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}

.appt-card:hover { border-color: var(--border-strong); }
.appt-card.is-selected { border-color: var(--primary); background: #f3f7ff; box-shadow: 0 0 0 1px var(--primary); }
.appt-date { display: grid; justify-items: center; padding-right: 14px; border-right: 1px solid var(--border); }
.appt-date .dow { font-size: 13px; font-weight: 600; color: var(--text-2); }
.appt-date .md { font-size: 19px; font-weight: 700; line-height: 1.25; }
.appt-date .y { font-size: 13px; color: var(--muted); }
.appt-when { display: grid; gap: 8px; color: var(--text-2); font-size: 14px; min-width: 0; }
.appt-when > div { display: flex; align-items: center; gap: 8px; }
.appt-when .icon { flex: none; }
.appt-main { display: grid; gap: 2px; justify-items: start; min-width: 0; }
.appt-name { font-size: 17px; font-weight: 700; }
.appt-biz { color: var(--text); }
.appt-con { color: var(--muted); font-size: 14px; }
.appts-details { position: sticky; top: calc(var(--header-h) + 16px); padding: 20px; display: grid; gap: 14px; }

/* Calendar */
.cal-biz { padding: 16px 20px; }
.cal-nav { display: inline-flex; align-items: center; gap: 4px; }
.cal-zone { display: flex; align-items: center; gap: 8px; padding: 10px 16px 0; color: var(--text-2); font-size: 14px; }
.cal-zone .icon { color: var(--primary); flex: none; }
.cal-notice { margin: 10px 16px 0; }
.va-grid { margin-top: 10px; }
.va-grid.is-day { min-width: 0; }
.va-grid .week-dayhead.is-focus { box-shadow: inset 0 -3px 0 var(--primary); }
.va-grid .week-col { cursor: pointer; }
.va-grid .week-col.is-closed { background: #f1f4f8; }
.cal-open { position: absolute; left: 0; right: 0; background: var(--surface); }
.va-grid .week-col.is-today .cal-open { background: #f7faff; }
.va-grid .week-line { position: relative; z-index: 1; pointer-events: none; }

.cal-blocked {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  overflow: hidden;
  padding: 4px 6px;
  background: repeating-linear-gradient(135deg, #eef1f6, #eef1f6 6px, #e2e7ef 6px, #e2e7ef 12px);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.va-grid .week-event { z-index: 2; display: grid; align-content: start; gap: 1px; }
.va-grid .week-event > .icon { position: absolute; top: 5px; right: 5px; color: var(--muted); }
.week-event.is-mine { background: #dfe9ff; border-color: #a9c2fb; border-left-color: var(--primary); }
.week-event.is-other { background: #eceff4; border-color: var(--border-strong); border-left-color: #8a97aa; color: var(--text-2); }
.week-event.is-other .n { font-weight: 600; }

.cal-pick {
  position: absolute;
  left: 3px;
  right: 3px;
  z-index: 3;
  padding: 4px 6px;
  border: 2px solid var(--primary);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(24, 86, 237, 0.2);
  font-size: 12px;
  line-height: 1.3;
  pointer-events: none;
}

.cal-pick .n { font-weight: 700; color: var(--primary); }
.cal-pick .t { color: var(--text-2); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 12px 16px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.cal-legend > span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 18px; height: 14px; border-radius: 3px; border: 1px solid var(--border-strong); }
.sw-mine { background: #dfe9ff; border-color: #a9c2fb; }
.sw-other { background: #eceff4; }
.sw-open { background: #fff; }
.sw-blocked { background: repeating-linear-gradient(135deg, #eef1f6, #eef1f6 3px, #d7dde7 3px, #d7dde7 6px); }
.cal-side { position: sticky; top: calc(var(--header-h) + 16px); }
.cal-side-body { padding: 20px; display: grid; gap: 14px; }
.cal-side .review-row, .appts-details .review-row { grid-template-columns: 22px 92px minmax(0, 1fr); gap: 10px; padding: 11px 12px; }
.cal-side-slots { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.cal-privacy { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.cal-privacy .icon { flex: none; color: var(--muted); }

/* Admin: contractor working hours */
.avail-grid { align-items: start; }
.hours-grid { display: grid; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.hours-day { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); }
.hours-day:first-child { border-top: 0; }
.hours-name { font-weight: 600; }
.hours-body { display: grid; gap: 6px; }
.hours-ranges { display: grid; gap: 6px; }
.hours-ranges:empty { display: none; }
.hours-range { display: flex; align-items: center; gap: 8px; }
.hours-range .input { width: 130px; }
.hours-add { white-space: nowrap; }
.block-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.block-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }

@media (max-width: 1280px) {
  .book-layout { grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr); }
}

@media (max-width: 1100px) {
  .book-layout, .appts-layout { grid-template-columns: minmax(0, 1fr); }
  .review, .appts-details, .cal-side { position: static; }
}

@media (max-width: 760px) {
  .biz-grid, .appt-grid, .appts-filters { grid-template-columns: minmax(0, 1fr); }
  .hours-day { grid-template-columns: minmax(0, 1fr) auto; }
  .hours-body { grid-column: 1 / -1; grid-row: 2; }
  .hours-range .input { width: auto; flex: 1 1 0; min-width: 0; }
  .appt-card { grid-template-columns: 64px minmax(0, 1fr); gap: 10px 12px; align-items: start; }
  .appt-date { grid-row: span 2; padding-right: 10px; }
  .appt-when { grid-column: 2; grid-row: 2; }
  .appt-main { grid-column: 2; grid-row: 1; }
  .appt-view { display: none; }
  .review-row { grid-template-columns: 22px minmax(0, 1fr); }
  .review-row .review-v { grid-column: 2; }
  .seg-lg { width: 100%; }
  .seg-lg .seg-btn { flex: 1 1 0; padding: 0 8px; }
  .slot-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .cal-toolbar .seg { width: auto; }
  .va-grid.is-day { grid-template-columns: 56px minmax(0, 1fr) !important; }
}

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1280px) {
  .cal-shell, .billing-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-grid, .detail-grid, .settings-grid, .log-layout { grid-template-columns: minmax(0, 1fr); }
  .client-cards { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  :root { --header-h: 64px; --gutter: 16px; }
  .app-header { padding: 0 12px; gap: 8px; }
  .header-brand { width: auto; }
  .wordmark { font-size: 20px; }
  .header-crumbs { display: none; }
  .menu-btn { display: inline-grid; color: #fff; }
  .menu-btn:hover { background: var(--navy-2); color: #fff; }
  .app-body { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    width: min(var(--sidebar-w), 86vw);
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .drawer-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }

  .drawer-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(8, 27, 53, 0.45);
  }

  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .page-title { font-size: 26px; }
}

@media (max-width: 760px) {
  .form-grid, .form-grid-3, .split-callouts { grid-template-columns: minmax(0, 1fr); }
  .details { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .details dd { margin-bottom: 8px; }
  .outcome-btns { grid-template-columns: minmax(0, 1fr); }
  .setting-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .header-action span { display: none; }
  .month-cell { min-height: 56px; }
  .day-btn, .day-row.is-slot { grid-template-columns: 64px minmax(0, 1fr); }
  .day-side { grid-column: 2; }
  .tile { padding: 14px; gap: 12px; }
  .tile-value { font-size: 24px; }
  .icon-circle { width: 44px; height: 44px; }
  .queue-item { grid-template-columns: auto minmax(0, 1fr) auto; }
  .queue-when { grid-column: 2; grid-row: 2; }
  .client-card-top { grid-template-columns: auto minmax(0, 1fr); }
  .client-card-top .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .today-row { grid-template-columns: minmax(0, 1fr) auto; }
  .today-row .today-time { grid-column: 2; grid-row: 1; }
}

@media (max-width: 560px) {
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .seg { width: 100%; }
  .seg-btn { flex: 1 1 auto; padding: 6px 8px; }
  .call-row { flex-direction: column; }
  .call-side { justify-items: start; }
  .c-stats-3 { gap: 8px; }
  .c-stat { padding: 10px 12px; }
  .c-stat .stat-value { font-size: 21px; }
  .modal { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .modal-body { padding: 4px 16px 16px; }
  .page-actions { width: 100%; }
  .page-actions > * { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- Stripe invoices (Billing) */
.inv-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.inv-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.table tr.is-focus td { background: var(--info-soft); }
.sel-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 240px; overflow-y: auto; font-size: 14px; }
.sel-lines li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: baseline; }
.sel-lines .sel-what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backup-list li { align-items: center; }
.assign-amount { width: 104px; text-align: right; padding-top: 4px; padding-bottom: 4px; }
.assign-box { border-top: 1px solid var(--border); padding-top: 10px; }
.manual-pay { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--border); }
.manual-pay > .stack { margin-top: 8px; }
.manual-pay .link-btn { justify-self: start; }

/* ---------- Sandbox app (fake data): a strip above everything */
.sandbox-banner { padding: 6px 16px; background: #f5b83d; color: #2a1d00; font-size: 13px; font-weight: 600; text-align: center; }
.quote-cell { font-style: italic; max-width: 280px; }
