:root {
  --bg: #101c1e;
  --panel: #182528;
  --panel-2: #1e2f32;
  --text: #eef4f7;
  --muted: #a9b7c2;
  --line: #243e42;
  --accent: #2ecfcf;
  --accent-2: #0d3535;
  --danger: #b84a4a;
  --success: #1f7a45;
  --radius: 16px;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #0d141b 0%, #121b24 100%);
  color: var(--text);
  line-height: 1.45;
}

a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 16, 22, 0.85);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
}

.brand {
  font-size: 1.2rem;
  font-weight: 700;
}

.topnav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.main-wrap {
  width: min(920px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 16px;
}

.page-head h1, .card h1, .card h2 { margin-top: 0; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.auth-card {
  max-width: 460px;
  margin: 48px auto 0;
}

.muted { color: var(--muted); }
.stack-form,
.stack-list {
  display: grid;
  gap: 14px;
}

label span {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}

textarea {
  resize: vertical;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #23303c;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  text-decoration: none;
  filter: brightness(1.08);
}

.button-primary {
  background: var(--accent);
  color: #0e1a0c;
  border-color: transparent;
  font-weight: 700;
}

.button-request-pay {
  background: #1a3a2a;
  color: var(--accent);
  border-color: var(--accent-2);
  font-weight: 600;
}

.flash {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
}

.flash-success {
  background: rgba(31, 122, 69, 0.18);
  border-color: rgba(31, 122, 69, 0.5);
}

.flash-error {
  background: rgba(184, 74, 74, 0.18);
  border-color: rgba(184, 74, 74, 0.5);
}

.client-card h2,
.compact-card h2,
.stat-card h2 {
  margin-bottom: 8px;
}

.card h2 {
  color: var(--accent);
}

.search-form {
  display: flex;
  gap: 10px;
}

.search-form input {
  flex: 1;
}

.two-col-form {
  grid-template-columns: 1fr 1fr;
}

.full-width {
  grid-column: 1 / -1;
}

.detail-grid,
.stats-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
}

.visit-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.visit-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: auto;
}

@media (max-width: 700px) {
  .search-form,
  .detail-grid,
  .stats-grid,
  .two-col-form,
  .topbar {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topnav {
    gap: 10px;
  }

  .main-wrap {
    width: min(100% - 16px, 920px);
  }
}

/* ── Overdue visit card ─────────────────────────────────────────────── */
.card-overdue {
  border-color: #6b3a1f;
  background: #1c1610;
}

.client-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.client-card-header h2 {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Calendar quick-schedule icon on client list */
.client-cal-icon {
  font-size: 0.9rem;
  line-height: 1;
  opacity: 0.75;
  flex-shrink: 0;
  transition: opacity 0.15s;
  background: none;
  border: none;
  padding: 0 2px;
  margin: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.client-cal-icon:hover,
.client-cal-icon:active { opacity: 0.9; }

/* ── Badges ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-warning {
  background: rgba(180, 100, 30, 0.25);
  color: #e8a46a;
  border: 1px solid rgba(180, 100, 30, 0.4);
}

.badge-danger {
  background: rgba(184, 74, 74, 0.2);
  color: #e07070;
  border: 1px solid rgba(184, 74, 74, 0.4);
}

.badge-pending {
  background: rgba(120, 120, 140, 0.2);
  color: #a9b7c2;
  border: 1px solid rgba(120, 120, 140, 0.35);
}

.badge-accepted {
  background: rgba(127, 209, 111, 0.15);
  color: #2ecfcf;
  border: 1px solid rgba(127, 209, 111, 0.35);
}

.badge-declined {
  background: rgba(184, 74, 74, 0.2);
  color: #e07070;
  border: 1px solid rgba(184, 74, 74, 0.4);
}

.badge-time {
  background: rgba(46, 207, 207, 0.12);
  color: var(--accent);
  border: 1px solid rgba(46, 207, 207, 0.3);
  font-weight: 600;
}

/* Appointment time picker — sits in form grid like a label but isn't one */
.stack-form-field {
  display: flex;
  flex-direction: column;
}
.stack-form-field .field-label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

/* ── Custom appointment time picker ────────────────────────────────── */
.time-picker-wrap {
  position: relative;
}

.time-picker-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.15s;
}
.time-picker-display:hover {
  border-color: var(--accent);
}

.time-picker-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  display: flex;
  flex-direction: column;
  min-width: 220px;
}

.time-picker-cols {
  display: flex;
  flex-direction: row;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.time-col {
  flex: 1;
  border-right: 1px solid var(--border);
}
.time-col:last-of-type {
  border-right: none;
}

.time-cell {
  padding: 7px 0;
  text-align: center;
  font-size: 0.93rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  user-select: none;
}

@media (max-width: 600px) {
  .time-cell {
    padding: 5px 0;
    font-size: 0.88rem;
  }
  .time-picker-dropdown {
    min-width: 200px;
  }
}
.time-cell:hover {
  background: var(--panel-2);
  color: var(--accent);
}
.time-cell.time-selected {
  background: var(--accent);
  color: #0a1a1a;
  font-weight: 700;
}

.time-picker-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  background: var(--panel);
}
  background: var(--panel);
}


  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 3px;
}

/* ── Next-visit schedule pills (clients.php) ────────────────────────── */
.nv-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(120, 120, 140, 0.18);
  color: var(--muted);
  border: 1px solid rgba(120, 120, 140, 0.28);
}

.nv-pill-overdue {
  background: rgba(184, 74, 74, 0.2);
  color: #e07070;
  border-color: rgba(184, 74, 74, 0.4);
}

.nv-pill-today {
  background: rgba(90, 160, 220, 0.18);
  color: #7ab8e8;
  border-color: rgba(90, 160, 220, 0.35);
}

.nv-pill-tomorrow {
  background: rgba(127, 209, 111, 0.15);
  color: #2ecfcf;
  border-color: rgba(127, 209, 111, 0.35);
}

/* ── Secondary button (Log Payment) ────────────────────────────────── */
.button-secondary {
  background: #1e3a5f;
  color: #a8cef0;
  border-color: #2a4f7a;
  font-weight: 700;
}

/* ── Payment history ────────────────────────────────────────────────── */
.payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.payment-amount {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}

/* ── Today page — warning text in subtitle ──────────────────────────── */
.muted-warning {
  color: #e8a46a;
  font-weight: 600;
}

/* ── Stats grid — 3-up variant ──────────────────────────────────────── */
.stats-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ── Stat card alert state (late payments > 0) ──────────────────────── */
.stat-card-alert {
  border-color: rgba(184, 74, 74, 0.5);
  background: rgba(184, 74, 74, 0.07);
}

.stat-number-alert {
  color: var(--danger);
}

/* ── Monthly pulse bar ──────────────────────────────────────────────── */
.pulse-label {
  margin: 0 0 10px;
  font-weight: 600;
}

.pulse-bar-track {
  width: 100%;
  height: 14px;
  background: var(--panel-2);
  border-radius: 99px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.pulse-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s ease;
  min-width: 4px;
}

/* ── Needs Attention items ──────────────────────────────────────────── */
.attention-item {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.attention-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.attention-item a {
  color: var(--text);
}

.attention-item a:hover {
  color: var(--accent);
}

@media (max-width: 700px) {
  .stats-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ── Edit client subtle link ────────────────────────────────────────── */
.edit-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.edit-link:hover {
  color: var(--text);
}

/* ── Contact button (Call / Text) ───────────────────────────────────── */
.button-contact {
  background: #1a4a3a;
  color: #2ecfcf;
  border-color: #2a6a50;
  font-weight: 700;
}

/* ── Pencil edit icon inline with h1 ────────────────────────────────── */
.edit-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  color: var(--accent);
  vertical-align: middle;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.edit-icon:hover {
  opacity: 1;
  color: var(--accent);
  text-decoration: none;
}

.client-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.client-name-row h1 {
  margin: 0;
}

/* ── Copy button ─────────────────────────────────────────────────────── */
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 2px 5px;
  background: transparent;
  border: 1px solid rgba(127, 209, 111, 0.35);
  border-radius: 6px;
  color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
  transition: color 0.15s, border-color 0.15s;
  line-height: 1;
}

.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.copy-btn-success {
  color: var(--accent);
  border-color: var(--accent);
}

.copy-confirm {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ── Needs Attention — grouped by client ────────────────────────────── */
.attention-name {
  display: block;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.attention-name:hover {
  color: var(--accent);
  text-decoration: none;
}

.attention-issues {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.attention-issues li {
  font-size: 0.88rem;
  color: var(--muted);
  padding-left: 12px;
  position: relative;
}

.attention-issues li::before {
  content: '·';
  position: absolute;
  left: 2px;
  color: var(--accent);
}

/* ── Today page header ──────────────────────────────────────────────── */
.today-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 4px;
}

/* On mobile the Add Client button goes full width below the title */
@media (max-width: 700px) {
  .today-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .today-add {
    width: 100%;
    justify-content: center;
  }

  /* Dashboard stat cards: 2-up on mobile instead of stacking 3 */
  .stats-grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  /* Expected This Month spans full width — it's the biggest number */
  .stats-grid-3 .stat-card:nth-child(2) {
    grid-column: 1 / -1;
  }
}

/* ── Visit photo max height ─────────────────────────────────────────── */
/* Prevents a portrait iPhone photo from consuming the whole screen */
.visit-photo {
  max-width: 100%;
  max-height: 320px;
  width: auto;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 6px;
  display: block;
}

/* ── Dashboard stat grid — full width stack on mobile ───────────────── */
/* Overrides the 2-up rule added earlier — full width reads cleaner */
@media (max-width: 700px) {
  .stats-grid-3 {
    grid-template-columns: 1fr;
  }

  .stats-grid-3 .stat-card:nth-child(2) {
    grid-column: 1;
  }
}

/* ── Tab toggle (Active / Inactive) ─────────────────────────────────── */
.tab-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  width: fit-content;
}

.tab-btn {
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.tab-btn:hover {
  color: var(--text);
  text-decoration: none;
}

.tab-btn-active {
  background: var(--panel-2);
  color: var(--accent);
}

/* ── Status badges ───────────────────────────────────────────────────── */
.badge-hold {
  background: rgba(59, 100, 140, 0.25);
  color: #7ab8e0;
  border: 1px solid rgba(59, 100, 140, 0.4);
}

.badge-suspended {
  background: rgba(184, 74, 74, 0.2);
  color: #e07a7a;
  border: 1px solid rgba(184, 74, 74, 0.4);
}

.badge-archived {
  background: rgba(100, 100, 100, 0.2);
  color: var(--muted);
  border: 1px solid rgba(100, 100, 100, 0.3);
}

/* ── Status action buttons ───────────────────────────────────────────── */
.button-hold {
  background: rgba(59, 100, 140, 0.2);
  color: #7ab8e0;
  border-color: rgba(59, 100, 140, 0.4);
}

.button-suspended {
  background: rgba(184, 74, 74, 0.15);
  color: #e07a7a;
  border-color: rgba(184, 74, 74, 0.4);
}

.status-actions {
  padding: 14px 16px;
}

/* ── Warning flash ───────────────────────────────────────────────────── */
.flash-warning {
  background: rgba(180, 120, 30, 0.18);
  border-color: rgba(180, 120, 30, 0.5);
  color: #e8c46a;
}

/* ── Quick Add client flow ───────────────────────────────────────────── */
.step-indicator {
  font-size: 0.85rem;
  margin-top: 2px;
}

.req {
  color: var(--accent);
  font-weight: 700;
  display: inline;
  vertical-align: super;
  font-size: 0.7em;
  line-height: 0;
}

.field-label {
  display: block;
  font-weight: 700;
  margin-bottom: 10px;
}

/* City + State side by side */
.city-state-row {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 10px;
}

/* Full-width button */
.button-full {
  width: 100%;
  justify-content: center;
  min-height: 52px;
  font-size: 1.05rem;
}

/* Frequency tap grid */
.freq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.freq-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.freq-option input[type="radio"] {
  display: none;
}

.freq-option:hover {
  border-color: var(--accent);
  color: var(--text);
}

.freq-selected {
  border-color: var(--accent);
  background: var(--accent-2);
  color: var(--accent);
}

/* "Use full form" link */
.quick-add-detail-link {
  text-align: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

.quick-add-detail-link a {
  color: var(--muted);
  text-decoration: underline;
}

/* ── Color system cleanup ────────────────────────────────────────────── */
/* Lift base button to readable mid-grey, visible against dark panels */
.button {
  background: #2e3f4f;
  border-color: #3d5060;
  color: var(--text);
}

/* Collapse all secondary/contact/hold buttons to neutral grey */
/* Only teal (primary) and red (danger/suspend) carry color meaning */
.button-secondary,
.button-contact,
.button-hold {
  background: #2e3f4f;
  border-color: #3d5060;
  color: var(--text);
  font-weight: 600;
}

/* Suspend stays red — it's a warning action */
.button-suspended {
  background: rgba(184, 74, 74, 0.18);
  color: #e07a7a;
  border-color: rgba(184, 74, 74, 0.45);
}

/* ── State field alignment fix ───────────────────────────────────────── */
/* Prevent browser autofill from making the state taller than the city */
.city-state-row {
  align-items: end;
}

.state-field input {
  height: 48px;
}

/* ── Auth pages ──────────────────────────────────────────────────────── */
.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-switch a {
  color: var(--accent);
  font-weight: 600;
}

/* ── Onboarding tap targets ──────────────────────────────────────────── */
.onboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.onboard-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 10px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.onboard-option input[type="radio"] {
  display: none;
}

.onboard-option:hover {
  border-color: var(--accent);
  color: var(--text);
}

.onboard-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-2);
  color: var(--accent);
}

.onboard-icon {
  font-size: 1.6rem;
  line-height: 1;
}

/* ══════════════════════════════════════════════════════════════════════
   v17–v19 additions
   ══════════════════════════════════════════════════════════════════════ */

/* ── Brand logo in topbar ────────────────────────────────────────────── */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: block;
  flex-shrink: 0;
}

/* ── Global + add client button in topnav ────────────────────────────── */
/* Sized and aligned to sit flush with the text links */
.topnav-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  flex-shrink: 0;
  /* Optical correction — the + glyph sits slightly high in most fonts */
  padding-bottom: 1px;
  transition: background 0.15s;
}

.topnav-add:hover {
  background: rgba(127, 209, 111, 0.15);
  text-decoration: none;
}

/* ── Active nav link ─────────────────────────────────────────────────── */
.topnav-active {
  color: var(--accent) !important;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ── Inline client search ────────────────────────────────────────────── */
.client-search-input {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  margin-bottom: 14px;
}

.client-search-input::placeholder { color: var(--muted); }

/* ── Utility: smaller text ───────────────────────────────────────────── */
.small { font-size: 0.875rem; }

/* ── Smaller buttons for client list and status actions ──────────────── */
.button-sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.875rem;
  border-radius: 10px;
}

/* ── Status actions moved into Service section ───────────────────────── */
.status-actions-inline { margin-top: 4px; }

/* ── detail-action-row — data label left, action button right ────────── */
.detail-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 4px 0;
}

.detail-action-row p {
  margin: 0;
  flex: 1;
  min-width: 0;
}

/* ── Visit photo: thumbnail + full expand ────────────────────────────── */
.visit-photo-wrap { margin: 8px 0 4px; }

.visit-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--line);
  cursor: pointer;
  display: block;
  transition: border-color 0.15s;
}

.visit-thumb:hover { border-color: var(--accent); }

.visit-photo-expanded {
  max-width: 100%;
  max-height: 320px;
  width: auto;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  cursor: pointer;
}

/* ── Visit show-more button ──────────────────────────────────────────── */
.visit-show-more {
  width: 100%;
  justify-content: center;
  color: var(--muted);
  font-size: 0.875rem;
  border-style: dashed;
}

.visit-show-more:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ── Follow-up resolve button in Needs Attention ─────────────────────── */
.issue-followup {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.issue-text { flex: 1; }

.resolve-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(127, 209, 111, 0.12);
  border: 1px solid rgba(127, 209, 111, 0.35);
  border-radius: 50%;
  color: var(--accent);
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}

.resolve-btn:hover {
  background: rgba(127, 209, 111, 0.28);
  border-color: var(--accent);
}

.resolve-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ══════════════════════════════════════════════════════════════════════
   Quick Flags — toggle checkboxes in client form
   ══════════════════════════════════════════════════════════════════════ */

.flag-toggle-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
  margin-bottom: 20px;
}

.flag-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.flag-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
  order: 2;
}

.flag-toggle:has(input:checked),
.flag-toggle.flag-on {
  background: rgba(127, 209, 111, 0.1);
  border-color: rgba(127, 209, 111, 0.45);
  color: var(--text);
}

/* ── Flag badges — displayed on cards and client view ───────────────── */

.badge-flag {
  background: rgba(127, 209, 111, 0.12);
  color: var(--accent);
  border: 1px solid rgba(127, 209, 111, 0.3);
}

.flag-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 10px;
}

/* ── Address as a Maps link ─────────────────────────────────────────── */

a.address-maps-link {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255,255,255,0.2);
  transition: color 0.15s, border-color 0.15s;
}

a.address-maps-link:hover,
a.address-maps-link:focus {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ══════════════════════════════════════════════════════════════════════
   Admin Panel
   ══════════════════════════════════════════════════════════════════════ */

/* 4-column stats grid — always 4 on desktop, 2x2 on mobile */
.stats-grid-4 {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .stats-grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Alerts box */
.admin-alerts {
  margin-bottom: 16px;
}

.admin-alert-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 6px;
}

.admin-alert-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.admin-alert-list li {
  font-size: 0.9rem;
}

/* User rows */
.admin-user-row {
  border-bottom: 1px solid var(--line);
}

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

.admin-user-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.admin-user-summary:hover {
  background: rgba(255,255,255,0.04);
}

.admin-user-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}

.admin-user-email {
  font-size: 0.92rem;
  font-weight: 600;
  word-break: break-all;
}

.admin-user-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.admin-chevron {
  font-size: 1.3rem;
  color: var(--text);
  line-height: 1;
  display: inline-block;
  opacity: 0.5;
  margin-left: 4px;
}

/* Status badges */
.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.admin-status-active  { background: rgba(127,209,111,0.15); color: var(--accent); border: 1px solid rgba(127,209,111,0.3); }
.admin-status-trial   { background: rgba(100,160,255,0.15); color: #7ab4f5;       border: 1px solid rgba(100,160,255,0.3); }
.admin-status-warn    { background: rgba(220,160,40,0.15);  color: #e8b84b;       border: 1px solid rgba(220,160,40,0.3);  }
.admin-status-lapsed  { background: rgba(200,60,60,0.15);   color: #e87a7a;       border: 1px solid rgba(200,60,60,0.3);   }
.admin-status-stripe  { background: rgba(99,91,255,0.2);    color: #a89eff;       border: 1px solid rgba(99,91,255,0.35);  font-size: 0.65rem; }
.admin-status-unknown { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.admin-status-annual  { background: rgba(74,222,128,0.15);  color: #4ade80; border: 1px solid rgba(74,222,128,0.35); font-size: 0.65rem; }
.admin-status-monthly { background: rgba(148,163,184,0.15); color: #94a3b8; border: 1px solid rgba(148,163,184,0.3); font-size: 0.65rem; }
.admin-status-flagged { background: rgba(239,68,68,0.15);   color: #f87171;  border: 1px solid rgba(239,68,68,0.35);  font-size: 0.65rem; }

.admin-warn-text {
  color: #e87a7a;
}

/* Expanded panel */
.admin-user-panel {
  padding: 0 20px 18px;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.12);
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px 0 12px;
  font-size: 0.88rem;
}

.admin-detail-grid p {
  margin: 0 0 6px;
}

@media (max-width: 500px) {
  .admin-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Action row */
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.admin-action-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-action-form .button {
  white-space: nowrap;
}

.admin-select {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
  height: 36px;
}

.admin-btn-danger {
  background: rgba(200,60,60,0.2);
  color: #e87a7a;
  border-color: rgba(200,60,60,0.4);
}

.admin-btn-danger:hover {
  background: rgba(200,60,60,0.35);
}

/* Note field */
.admin-note-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-note-field {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
  padding: 10px 12px;
  resize: vertical;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.admin-note-field:focus {
  outline: none;
  border-color: var(--accent);
}

.button-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  min-height: 36px;
}

/* ══════════════════════════════════════════════════════════════════════
   Seasonal Hold date form
   ══════════════════════════════════════════════════════════════════════ */

.hold-date-form {
  margin-top: 14px;
  padding: 16px;
  background: rgba(255, 193, 80, 0.06);
  border: 1px solid rgba(255, 193, 80, 0.2);
  border-radius: 10px;
}

.hold-date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hold-date-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
}



.hold-date-field input[type="date"] {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  height: 44px;
}

.hold-date-field input[type="date"]:focus {
  outline: none;
  border-color: rgba(255, 193, 80, 0.5);
}

@media (max-width: 480px) {
  .hold-date-row {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   Contextual flag extras — HOA notes, winterization date
   ══════════════════════════════════════════════════════════════════════ */

.flag-expandable {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Extra field — hidden by default */
.flag-extra {
  display: none;
  padding: 12px 14px;
  background: rgba(127, 209, 111, 0.05);
  border: 1px solid rgba(127, 209, 111, 0.2);
  border-top: none;
  border-radius: 0 0 10px 10px;
  margin-bottom: 2px;
}

/* Show via PHP class when flag is already checked (edit mode) */
.flag-extra-visible {
  display: block;
}

/* Show via CSS when checkbox inside the sibling toggle is checked */
.flag-expandable:has(input[type="checkbox"]:checked) .flag-extra {
  display: block;
}

/* Round the toggle bottom corners only when extra is hidden */
.flag-expandable .flag-toggle {
  border-radius: 10px;
}

.flag-expandable:has(input[type="checkbox"]:checked) .flag-toggle {
  border-radius: 10px 10px 0 0;
  border-bottom-color: transparent;
}

.flag-extra label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
}

.flag-extra textarea,
.flag-extra input[type="date"] {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
  padding: 8px 10px;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}

.flag-extra textarea:focus,
.flag-extra input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
}

.flag-extra input[type="date"] {
  height: 40px;
  resize: none;
}

/* ── Detail grid — label/value pairs ───────────────────────────────── */
/* Makes "Label: Value" scannable by putting the label on its own line  */
.detail-grid p {
  margin: 0 0 12px;
  line-height: 1.3;
}

.detail-grid p:last-child {
  margin-bottom: 0;
}

.detail-grid p strong {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

/* ── Export buttons ─────────────────────────────────────────────────── */
.export-btn {
  color: var(--muted);
  border-color: var(--line);
  background: var(--panel-2);
  font-size: 0.92rem;
  justify-content: center;
}
.export-btn:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ── Expense list ────────────────────────────────────────────────────── */
.expense-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.expense-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.expense-item:last-child {
  border-bottom: none;
}

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

.expense-desc {
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expense-client {
  font-size: 0.78rem;
  color: var(--muted);
}

.expense-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.expense-amount {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.expense-date {
  font-size: 0.78rem;
}

.expense-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.expense-header-btn {
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════════════
   v60 — Client view redesign: glance strip, tab layout (mobile),
         note strips, visit note preview, overdue billing, muted-val
   ══════════════════════════════════════════════════════════════════════ */

/* ── At-a-glance strip ──────────────────────────────────────────────── */
.cv-glance-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
}

.cv-glance-cell {
  background: var(--panel-2);
  padding: 11px 14px;
}

.cv-glance-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.cv-glance-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.cv-glance-val.accent { color: var(--accent); }

.cv-glance-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 3px;
}

/* ── Note strips ────────────────────────────────────────────────────── */
.cv-note-group {
  margin-bottom: 14px;
}

.cv-note-strip {
  background: rgba(46, 207, 207, 0.06);
  border: 1px solid rgba(46, 207, 207, 0.18);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 8px;
}

.cv-note-strip:last-child { margin-bottom: 0; }

.cv-note-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ── Visit note preview ─────────────────────────────────────────────── */
.visit-note-preview {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 5px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
  line-height: 1.4;
}

/* ── Overdue billing inline badge ───────────────────────────────────── */
.badge-overdue-pay {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(184, 74, 74, 0.18);
  border: 1px solid rgba(184, 74, 74, 0.45);
  color: #e07070;
  vertical-align: middle;
  margin-left: 8px;
}

/* ── Muted value ────────────────────────────────────────────────────── */
.muted-val {
  color: var(--muted);
  font-style: italic;
  font-size: 0.88rem;
}

/* ══════════════════════════════════════════════════════════════════════
   Mobile tab bar — client view (≤700px only)
   ══════════════════════════════════════════════════════════════════════ */

/* Hidden on desktop — panels all visible */
.cv-tab-bar { display: none; }
.cv-tab-panel { display: block; }

@media (max-width: 700px) {

  .cv-tab-bar {
    display: flex;
    border-bottom: 1px solid var(--line);
    margin: 0 0 14px;
    position: sticky;
    top: 57px;
    background: var(--bg);
    z-index: 5;
  }

  .cv-tab {
    flex: 1;
    text-align: center;
    padding: 10px 4px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    border-top: none;
    border-left: none;
    border-right: none;
    background: none;
    transition: color 0.15s, border-color 0.15s;
    letter-spacing: 0.02em;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
  }

  .cv-tab.cv-tab-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
  }

  .cv-tab-dot {
    position: absolute;
    top: 7px;
    right: 6px;
    width: 6px;
    height: 6px;
    background: #e07070;
    border-radius: 50%;
    border: 1px solid var(--bg);
  }

  /* Hide all panels; JS shows active one */
  .cv-tab-panel { display: none; }
  .cv-tab-panel.cv-tab-active { display: block; }

  /* Glance strip tighter on mobile */
  .cv-glance-cell { padding: 10px 10px; }
  .cv-glance-val  { font-size: 0.88rem; }

  /* Client name smaller */
  .cv-client-name {
    font-size: 1.5rem;
    line-height: 1.15;
  }

  /* Action buttons smaller */
  .cv-action-btn {
    min-height: 36px;
    padding: 7px 16px;
    font-size: 0.88rem;
    border-radius: 10px;
  }
}

/* Desktop: glance strip slightly more padding */
@media (min-width: 701px) {
  .cv-glance-cell { padding: 12px 16px; }
}

/* ══════════════════════════════════════════════════════════════════════
   v61 — Polish: inline edit, balance-due strip
   ══════════════════════════════════════════════════════════════════════ */

/* Desktop also gets smaller action buttons */
.cv-action-btn {
  min-height: 36px;
  padding: 7px 16px;
  font-size: 0.88rem;
  border-radius: 10px;
}

/* ── Pencil edit button ─────────────────────────────────────────────── */
.cv-pencil {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0 0 0 4px;
  color: var(--muted);
  opacity: 0.65;
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1;
  vertical-align: middle;
  transition: color 0.15s, opacity 0.15s;
}
.cv-pencil:hover { color: var(--accent); opacity: 1; }

/* ── Inline inputs ──────────────────────────────────────────────────── */
.cv-inline-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
  resize: vertical;
  margin-top: 5px;
  box-shadow: 0 0 0 2px rgba(46, 207, 207, 0.12);
}
.cv-inline-input:focus { box-shadow: 0 0 0 3px rgba(46, 207, 207, 0.2); }

.cv-inline-input-rate {
  width: 110px;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 5px 9px;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  outline: none;
  box-shadow: 0 0 0 2px rgba(46, 207, 207, 0.12);
}
.cv-inline-input-rate:focus { box-shadow: 0 0 0 3px rgba(46, 207, 207, 0.2); }

.cv-inline-actions {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}
.cv-inline-save {
  background: var(--accent);
  color: #0a1a1a;
  border: none;
  border-radius: 7px;
  padding: 5px 13px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.cv-inline-cancel {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
}
.cv-inline-save-flash {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin-left: 4px;
}

/* ── Balance-due strip ──────────────────────────────────────────────── */
.cv-balance-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(184, 74, 74, 0.1);
  border: 1px solid rgba(184, 74, 74, 0.4);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.cv-balance-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #e07070;
}
.cv-balance-amount {
  font-size: 1.05rem;
  font-weight: 700;
  color: #e07070;
}
.cv-balance-request-btn {
  background: rgba(184, 74, 74, 0.18);
  border: 1px solid rgba(184, 74, 74, 0.5);
  border-radius: 8px;
  color: #e07070;
  padding: 5px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.cv-balance-request-btn:hover { background: rgba(184, 74, 74, 0.28); }


/* ══════════════════════════════════════════════════════════════════════
   v62 — Glance strip date sizing, billing stacked rows
   ══════════════════════════════════════════════════════════════════════ */

/* ── Glance strip: Next Visit date — keep it compact ───────────────── */
/* The teal accent button inherits body font-size and can run large.
   Lock the glance cell values to a fixed size and prevent cell growth. */
.cv-glance-cell {
  /* Prevent any cell from growing taller than its neighbours */
  align-self: stretch;
  /* Stop content from inflating the grid row */
  overflow: hidden;
}

/* The tappable date button inside the glance cell */
.cv-glance-date-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-align: left;
  line-height: 1.2;
}

/* Rate edit: prevent the input from blowing out the cell width */
#glance-rate-cell .cv-inline-input-rate {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 0.88rem;
}

/* ── Billing stacked field rows ─────────────────────────────────────── */
/* Replace the detail-action-row "Label: Value  [Button]" with:
   LABEL (muted small caps)
   Value
   [Button] floated right in same block, or on its own row           */

.cv-billing-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.cv-billing-row:last-of-type {
  border-bottom: none;
}

.cv-billing-field {
  flex: 1;
  min-width: 0;
}

.cv-billing-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 2px;
}

.cv-billing-value {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.3;
}

.cv-billing-value.muted-val {
  color: var(--muted);
  font-style: italic;
  font-size: 0.88rem;
}

.cv-billing-btn {
  flex-shrink: 0;
  align-self: center;
}


/* ══════════════════════════════════════════════════════════════════════
   v63 — Estimates own block, dashboard balances section
   ══════════════════════════════════════════════════════════════════════ */

/* ── Estimates block in billing panel ───────────────────────────────── */
.cv-estimates-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.cv-estimates-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}

.cv-estimates-btns {
  display: flex;
  gap: 8px;
}

.cv-estimates-btns .button {
  flex: 1;
  justify-content: center;
}

/* ── Dashboard: balances-due section ────────────────────────────────── */
.dash-balance-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.dash-balance-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dash-balance-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
}

.dash-balance-name:hover { color: var(--accent); text-decoration: none; }

.dash-balance-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1px;
}

.dash-balance-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.dash-balance-amount {
  font-size: 1rem;
  font-weight: 700;
  color: #e07070;
}

.dash-balance-request {
  background: rgba(184, 74, 74, 0.15);
  border: 1px solid rgba(184, 74, 74, 0.4);
  border-radius: 8px;
  color: #e07070;
  padding: 4px 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.dash-balance-request:hover {
  background: rgba(184, 74, 74, 0.25);
  text-decoration: none;
  color: #e07070;
}

/* Total row */
.dash-balance-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.dash-balance-total span:last-child {
  color: #e07070;
}


/* ══════════════════════════════════════════════════════════════════════
   v63b — Flag single row, glance strip alignment, no change-status label
   ══════════════════════════════════════════════════════════════════════ */

/* ── Flag badges: single row, compact ──────────────────────────────── */
/* Reduce badge padding so all 3 fit on one line even on small screens */
.flag-badge-row .badge {
  padding: 2px 7px;
  font-size: 0.7rem;
  white-space: nowrap;
}

/* ── Glance strip: align values to same row ─────────────────────────── */
/* All cells start content at the top; values sit right below the label */
.cv-glance-strip {
  align-items: stretch;
}

.cv-glance-cell {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* The label row is always the same height */
.cv-glance-label {
  min-height: 18px;
}

/* Value and sub sit directly under label — no extra spacing */
.cv-glance-val {
  margin-top: 2px;
}


/* ══════════════════════════════════════════════════════════════════════
   v66 — Today card note label colors, balance-due badge
   ══════════════════════════════════════════════════════════════════════ */

/* Colored label prefixes on today cards ("Notes:" teal, "Access:" amber) */
.card-note-label {
  font-weight: 700;
  color: var(--accent);
  margin-right: 2px;
}

.card-note-label-access {
  color: #f0c060;
}

/* Balance owed badge on today cards */
.today-balance-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(220, 100, 60, 0.15);
  color: #f0956a;
  border: 1px solid rgba(220, 100, 60, 0.35);
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 2px;
}

/* ── v66b: Visit history edit/delete action buttons ─────────────────── */
.visit-action-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 3px 8px;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.visit-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-2);
}
.visit-action-delete:hover {
  border-color: #e07070;
  color: #e07070;
  background: rgba(184, 74, 74, 0.1);
}

/* ══════════════════════════════════════════════════════════════════════
   v67 — Route optimization bar + navigate button
   ══════════════════════════════════════════════════════════════════════ */

.today-route-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 10px;
  margin-bottom: 4px;
}

.today-route-hint {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.3;
}

/* ── v67b: Restore teal Optimize button ─────────────────────────────── */
.button-route {
  background: #0d3535;
  color: var(--accent);
  border: 1px solid var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.button-route:hover {
  background: var(--accent);
  color: #101c1e;
  filter: none;
}

/* ── v68: Route optimize done state ────────────────────────────────── */
.button-route-done {
  background: #0d3535;
  color: var(--accent);
  border-color: var(--accent);
  opacity: 0.7;
  cursor: default;
}

/* ── v69: Account settings page ─────────────────────────────────────── */
.field-hint {
  font-size: 0.78rem;
  margin-top: 4px;
}

.card-section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 12px;
}

.form-actions {
  padding: 0 0 24px;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-success {
  background: #0d3535;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.alert-error {
  background: #3a1a1a;
  color: #ff6b6b;
  border: 1px solid #ff6b6b;
}

/* ============================================================
   Route Desq styles.css — v69 additions
   Append these rules to the bottom of public/assets/css/styles.css
   ============================================================ */

/* ── Sample data banner ─────────────────────────────────────── */
.sample-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    background: #0d3535;
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: .65rem 1rem;
    margin: 0 1rem .75rem;
    font-size: .88rem;
    color: var(--accent);
}
.sample-banner-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.sample-banner-btn:hover {
    opacity: .8;
}

/* ── Quick-start two-path screen ────────────────────────────── */
.qs-choices {
    display: grid;
    gap: 1rem;
    padding: 0 1rem 2rem;
    max-width: 640px;
    margin: 0 auto;
}
@media (min-width: 560px) {
    .qs-choices { grid-template-columns: 1fr 1fr; }
}
.qs-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.qs-card-demo {
    border-color: var(--accent);
}
.qs-icon {
    font-size: 2rem;
    line-height: 1;
}
.qs-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.qs-desc {
    font-size: .88rem;
    color: var(--muted);
    margin: 0;
    flex: 1;
}
.button-full {
    width: 100%;
    text-align: center;
    display: block;
    box-sizing: border-box;
}
