/* ----------------------------------------
   MEDSPA AI — BLUSH + GOLD LUXURY THEME
   Light, premium, logo-matched palette
----------------------------------------- */

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

/* ----------------------------------------
   THEME TOKENS (LOGO-MATCHED)
----------------------------------------- */

:root {
  /* Backgrounds – soft blush gradient */
  --bg-main: #fff6f2;
  --bg-gradient-top: #ffe9df;
  --bg-gradient-bottom: #f9d6c4;

  --bg-card: #ffffff;
  --bg-card-soft: #fff8f4;
  --bg-soft: #fce4d8;

  /* Text – warm browns/rose */
  --text-main: #3e2a25;
  --text-soft: #7b5f57;
  --text-muted: #a1867f;
  --text-faint: #c4afa8;

  /* Brand – blush + gold from logo */
  --accent-blush: #f9b7a5;
  --accent-blush-soft: rgba(249, 183, 165, 0.3);

  --accent-gold: #d6a054;
  --accent-gold-soft: rgba(214, 160, 84, 0.26);

  /* Status */
  --status-new: #3b82f6;
  --status-engaged: #a855f7;
  --status-follow-up: #d97706;
  --status-booked: #16a34a;
  --status-no-show: #e11d48;
  --status-closed-won: #0d9488;

  /* Other */
  --danger: #e11d48;
  --shadow-soft: 0 18px 40px rgba(173, 117, 84, 0.25);
  --shadow-subtle: 0 10px 26px rgba(173, 117, 84, 0.2);

  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-pill: 999px;

  --border-subtle: rgba(214, 160, 84, 0.26);
  --border-strong: rgba(214, 160, 84, 0.48);

  --transition-fast: 0.16s ease-out;
  --transition-med: 0.22s ease-out;

  /* Prevent mobile browsers from “helping” with dark mode */
  color-scheme: light;
}

/* ----------------------------------------
   BASE
----------------------------------------- */

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 0 0, rgba(249, 183, 165, 0.35), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(243, 209, 179, 0.4), transparent 60%),
    linear-gradient(145deg, var(--bg-gradient-top), var(--bg-gradient-bottom));
  background-attachment: fixed;
}

body {
  line-height: 1.5;
}

/* iOS Safari often renders fixed backgrounds weirdly */
@media (max-width: 768px) {
  html, body { background-attachment: scroll; }
}

/* ----------------------------------------
   LAYOUT: APP SHELL
----------------------------------------- */

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

/* ----------------------------------------
   SIDEBAR
----------------------------------------- */

.sidebar {
  width: 260px;
  padding: 22px 22px 26px;
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.65), transparent 55%),
    linear-gradient(180deg, #fce4d8, #f6d1bf);
  border-right: 1px solid rgba(214, 160, 84, 0.24);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 10;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.9), transparent 55%),
    radial-gradient(circle at 0 100%, rgba(249, 183, 165, 0.35), transparent 60%);
  opacity: 0.8;
  pointer-events: none;
}

/* Mobile Sidebar (Off-canvas) */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
  z-index: 1100;
}

body.sidebar-open {
  overflow: hidden;
}

body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu-btn {
  display: none;
  appearance: none;
  border: 1px solid rgba(214, 160, 84, 0.38);
  background: rgba(255, 247, 242, 0.92);
  border-radius: 14px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(173, 117, 84, 0.18);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.mobile-menu-icon {
  width: 18px;
  height: 12px;
  position: relative;
  display: inline-block;
}

.mobile-menu-icon::before,
.mobile-menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: rgba(62, 42, 37, 0.85);
}

.mobile-menu-icon::before {
  top: 0;
  box-shadow: 0 5px 0 rgba(62, 42, 37, 0.85);
}

.mobile-menu-icon::after {
  bottom: 0;
}

/* Sidebar logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 74px;
  padding: 0 0 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  position: relative;
  z-index: 1;
  border-bottom: 1px solid rgba(214, 160, 84, 0.22);
}

/*
  Dashboard brand mark:
  Uses a dashboard-only transparent crop of the original logo so only the
  circular mark is visible. No CSS tile, extra border, shadow, or blush square
  is added around it.
*/
.sidebar-brand-mark {
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  display: block;
  position: relative;
  overflow: visible;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
}

.sidebar-brand-logo {
  width: 74px;
  height: 74px;
  max-width: none;
  display: block;
  object-fit: contain;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  image-rendering: auto;
  transform: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar-brand-name {
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: 0.105em;
  text-transform: uppercase;
  color: #2f2321;
  line-height: 1.08;
  white-space: nowrap;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.sidebar-brand-tagline {
  font-size: 0.9rem;
  font-weight: 500;
  color: #7b5f57;
  line-height: 1.16;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
}

/* Sidebar nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  position: relative;
  z-index: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(214, 160, 84, 0.4);
  color: var(--text-main);
  transform: translateX(2px);
}

.nav-link-active {
  background:
    radial-gradient(circle at 0 0, rgba(249, 183, 165, 0.5), transparent 65%),
    #ffffff;
  border-color: rgba(214, 160, 84, 0.85);
  color: var(--text-main);
  box-shadow: 0 10px 26px rgba(186, 116, 72, 0.28);
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  border: 1px solid rgba(214, 160, 84, 0.4);
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.9), transparent 60%),
    rgba(252, 228, 216, 0.85);
  color: var(--text-soft);
}

/* ----------------------------------------
   MAIN COLUMN + TOPBAR
----------------------------------------- */

.main-column {
  flex: 1;
  padding: 22px 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-left-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-title {
  font-size: 1.1rem;
}

.topbar-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
}

.topbar-chip {
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(214, 160, 84, 0.75);
  background:
    radial-gradient(circle at 0 0, rgba(249, 183, 165, 0.35), transparent 60%),
    rgba(255, 250, 245, 0.98);
  color: var(--accent-gold);
}

/* ----------------------------------------
   PAGE WRAPPER + HEADER
----------------------------------------- */

.page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.page-title {
  margin: 0;
  font-size: 1.4rem;
}

.page-subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ----------------------------------------
   BUTTONS
----------------------------------------- */

.btn,
.btn-outline,
.btn-small {
  font-size: 0.82rem;
  border-radius: var(--radius-pill);
  padding: 7px 13px;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  text-decoration: none;
}

.btn {
  background: linear-gradient(135deg, var(--accent-blush), var(--accent-gold));
  border-color: rgba(214, 160, 84, 0.65);
  box-shadow: var(--shadow-subtle);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(186, 116, 72, 0.42);
}

.btn-outline {
  border-color: rgba(214, 160, 84, 0.6);
  background: rgba(255, 249, 245, 0.9);
  color: var(--text-soft);
}

.btn-outline:hover {
  border-color: rgba(214, 160, 84, 0.9);
  color: var(--text-main);
  background:
    radial-gradient(circle at 0 0, rgba(249, 183, 165, 0.35), transparent 60%),
    #ffffff;
}

.btn-small {
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 249, 245, 0.95);
  border-color: rgba(214, 160, 84, 0.45);
  color: var(--text-muted);
}

.btn-small:hover {
  border-color: rgba(214, 160, 84, 0.9);
}

/* ----------------------------------------
   CARDS & GRID
----------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card-wide {
  grid-column: 1 / -1;
}

.metric-grid,
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.metric-card,
.metric-card-primary {
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  background:
    radial-gradient(circle at 0 0, rgba(249, 183, 165, 0.24), transparent 65%),
    var(--bg-card-soft);
  border: 1px solid rgba(214, 160, 84, 0.25);
  box-shadow: var(--shadow-subtle);
}

.metric-card-primary {
  border-color: rgba(214, 160, 84, 0.85);
}

.metric-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

.metric-value {
  margin-top: 6px;
  font-size: 1.5rem;
  font-weight: 600;
}

.metric-subtext {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* ----------------------------------------
   HOME: ACCOUNTS
----------------------------------------- */

.account-card {
  border-radius: var(--radius-xl);
  padding: 16px 18px;
  background:
    radial-gradient(circle at 0 0, rgba(249, 183, 165, 0.25), transparent 65%),
    var(--bg-card);
  border: 1px solid rgba(214, 160, 84, 0.28);
  box-shadow: var(--shadow-subtle);
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.account-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(214, 160, 84, 0.85);
}

.account-pill {
  align-self: flex-start;
  font-size: 0.76rem;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(214, 160, 84, 0.45);
  background: rgba(255, 248, 242, 0.98);
  color: var(--text-soft);
}

.account-name {
  font-size: 1.1rem;
  margin: 2px 0;
}

.account-meta {
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* ----------------------------------------
   TABLES (Leads, Analytics, Settings)
----------------------------------------- */

table {
  border-collapse: collapse;
  width: 100%;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-xl);
  position: relative;
}

/* Scroll affordance fades */
.table-wrap::before,
.table-wrap::after {
  content: "";
  position: sticky;
  top: 0;
  width: 18px;
  height: 100%;
  pointer-events: none;
  display: block;
  z-index: 2;
}
.table-wrap::before {
  left: 0;
  background: linear-gradient(90deg, rgba(255, 246, 242, 1), rgba(255, 246, 242, 0));
}
.table-wrap::after {
  right: 0;
  background: linear-gradient(270deg, rgba(255, 246, 242, 1), rgba(255, 246, 242, 0));
}

.table-wrap table {
  min-width: 760px;
}

.leads-table,
.data-table {
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid rgba(214, 160, 84, 0.3);
  box-shadow: var(--shadow-subtle);
  font-size: 0.86rem;
}

.leads-table thead,
.data-table thead {
  background:
    radial-gradient(circle at 0 0, rgba(249, 183, 165, 0.26), transparent 70%),
    #fff5ec;
}

.leads-table th,
.data-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(214, 160, 84, 0.28);
}

.leads-table td,
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(214, 160, 84, 0.16);
}

.leads-table tbody tr:hover,
.data-table tbody tr:hover {
  background: #fff8f4;
}

.table-empty {
  text-align: center;
  padding: 18px 12px;
  font-size: 0.88rem;
  color: var(--text-soft);
}

/* ----------------------------------------
   BADGES & STATUS
----------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  border: 1px solid rgba(214, 160, 84, 0.35);
  background: rgba(255, 249, 245, 0.96);
  color: var(--text-soft);
}

.badge-soft {
  background: rgba(255, 244, 236, 0.96);
}

.badge-status-new { border-color: rgba(59,130,246,0.8); color: #1d4ed8; }
.badge-status-engaged { border-color: rgba(168,85,247,0.8); color: #7e22ce; }
.badge-status-follow_up { border-color: rgba(217,119,6,0.85); color: #92400e; }
.badge-status-booked { border-color: rgba(22,163,74,0.85); color: #166534; }
.badge-status-no_show { border-color: rgba(225,29,72,0.85); color: #9f1239; }
.badge-status-closed_won { border-color: rgba(13,148,136,0.85); color: #115e59; }

/* Handling badges: workflow/control state, intentionally separate from business Outcome. */
.badge-status-ai_handling { border-color: rgba(168,85,247,0.75); color: #7e22ce; }
.badge-status-booking_active { border-color: rgba(217,119,6,0.78); color: #92400e; }
.badge-status-human_review { border-color: rgba(225,29,72,0.85); color: #9f1239; }
.badge-status-manual_takeover { border-color: rgba(225,29,72,0.85); color: #9f1239; }
.badge-status-completed { border-color: rgba(22,163,74,0.85); color: #166534; }

.campaign-text {
  font-size: 0.82rem;
  color: var(--text-soft);
}

/* ----------------------------------------
   TIMELINE
----------------------------------------- */

.timeline-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.timeline-layout {
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  background:
    radial-gradient(circle at 0 0, rgba(249, 183, 165, 0.2), transparent 65%),
    var(--bg-card-soft);
  border: 1px solid rgba(214, 160, 84, 0.3);
  box-shadow: var(--shadow-subtle);
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 5px;
  background:
    radial-gradient(circle at 30% 0, #ffffff, transparent 70%),
    linear-gradient(135deg, var(--accent-blush), var(--accent-gold));
  box-shadow: 0 8px 20px rgba(186, 116, 72, 0.5);
}

.timeline-item.timeline-created .timeline-dot {
  background: linear-gradient(135deg, var(--status-new), var(--accent-blush));
}
.timeline-item.timeline-appointment .timeline-dot {
  background: linear-gradient(135deg, var(--status-booked), var(--accent-gold));
}
.timeline-item.timeline-payment .timeline-dot {
  background: linear-gradient(135deg, var(--status-closed-won), var(--accent-gold));
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-title { font-size: 0.9rem; }
.timeline-summary { font-size: 0.82rem; color: var(--text-soft); }
.timeline-time { font-size: 0.78rem; color: var(--text-faint); }
.timeline-empty { font-size: 0.88rem; color: var(--text-soft); }

/* ----------------------------------------
   FORMS (new appointment / payment)
----------------------------------------- */

.form-card {
  margin-top: 12px;
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid rgba(214, 160, 84, 0.32);
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.form-card label { font-size: 0.85rem; }

.form-card input,
.form-card select,
.form-card textarea {
  margin-top: 4px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(214, 160, 84, 0.26);
  background: #fff9f5;
  color: var(--text-main);
  padding: 8px 10px;
  font-size: 0.9rem;
  outline: none;
}

.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
  border-color: rgba(214, 160, 84, 0.9);
  box-shadow: 0 0 0 1px rgba(214, 160, 84, 0.35);
}

/* ----------------------------------------
   ANALYTICS: CHART GRID (Single Source of Truth)
----------------------------------------- */

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 22px;
  margin-top: 12px;
}

.small-chart {
  background: var(--bg-card);
  border: 1px solid rgba(214, 160, 84, 0.25);
  border-radius: 20px;
  padding: 18px 18px 16px;
  box-shadow:
    0 10px 26px rgba(173, 117, 84, 0.15),
    inset 0 0 16px rgba(255, 255, 255, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
}

.small-chart:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 32px rgba(173, 117, 84, 0.22),
    inset 0 0 18px rgba(255, 255, 255, 0.42);
}

.chart-title {
  margin: 0 0 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

/* IMPORTANT:
   - Do NOT use pixelated/crisp-edges for Chart.js on mobile.
   - Explicit height is required so Chart.js has a stable box to fit into.
*/
.small-chart canvas {
  width: 100% !important;
  height: 190px !important;
  display: block !important;
  image-rendering: auto !important;
  border-radius: 14px;
}

/* Cards that also wrap tables/charts */
.chart-card,
.table-card {
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid rgba(214, 160, 84, 0.3);
  box-shadow: var(--shadow-subtle);
}

.chart-placeholder {
  border-radius: var(--radius-xl);
  border: 1px dashed rgba(214, 160, 84, 0.45);
  background:
    radial-gradient(circle at 0 0, rgba(249, 183, 165, 0.24), transparent 65%),
    #fff8f4;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 0.82rem;
}

/* ----------------------------------------
   TYPOGRAPHY / MISC
----------------------------------------- */

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
  background: #fff0e7;
  padding: 2px 5px;
  border-radius: 6px;
  border: 1px solid rgba(214, 160, 84, 0.45);
}

em { color: var(--text-soft); }
.muted-text { color: var(--text-muted); }

/* ----------------------------------------
   OVERLAY MODALS (Appointment • Payment)
----------------------------------------- */

.overlay-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.overlay-card {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 0 0, rgba(249, 183, 165, 0.25), transparent 70%),
    #fff8f4;
  padding: 24px 28px;
  box-shadow:
    0 20px 60px rgba(186, 116, 72, 0.35),
    0 12px 25px rgba(214, 160, 84, 0.18);
  border: 1px solid rgba(214, 160, 84, 0.35);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.overlay-title {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-main);
  text-align: center;
  letter-spacing: 0.02em;
}

.overlay-subtitle {
  margin-top: -4px;
  text-align: center;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-label {
  display: flex;
  flex-direction: column;
  font-size: 0.88rem;
  color: var(--text-main);
  gap: 6px;
}

.form-input {
  padding: 10px 12px;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(214, 160, 84, 0.35);
  background: #fff5ef;
  color: var(--text-main);
  transition: border var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  border-color: rgba(214, 160, 84, 0.85);
  box-shadow: 0 0 0 2px rgba(214, 160, 84, 0.35);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.form-actions .btn,
.form-actions .btn-outline {
  flex: 1;
  text-align: center;
}

/* ----------------------------------------
   LEAD DETAIL HEADER
----------------------------------------- */

.lead-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 0 0, rgba(249, 183, 165, 0.22), transparent 65%),
    #fff8f4;
  border: 1px solid rgba(214, 160, 84, 0.28);
  box-shadow: var(--shadow-subtle);
  margin-bottom: 18px;
}

.lead-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lead-avatar {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-blush), var(--accent-gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  box-shadow: 0 12px 26px rgba(186, 116, 72, 0.35);
}

.lead-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lead-header-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-main);
}

.lead-header-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.lead-header-status { margin-top: 4px; }

.lead-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ----------------------------------------
   LEAD SUMMARY METRICS
----------------------------------------- */

.lead-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.lead-metric {
  background: #fffdfc;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  border: 1px solid rgba(214, 160, 84, 0.28);
  box-shadow: 0 10px 20px rgba(186, 116, 72, 0.15);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lead-metric-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.lead-metric-value {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-main);
}

.lead-metric-sub {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 2px;
}

.lead-metric-wide { grid-column: 1 / -1; }

.lead-metric-followup {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--text-main);
  font-style: italic;
}

.lead-metric-followup.muted-text {
  font-style: normal;
  color: var(--text-muted);
}

/* ----------------------------------------
   LEAD ROW – Hybrid Card/Table Style
----------------------------------------- */

.lead-row {
  background: #fffdfc;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(214, 160, 84, 0.18);
  box-shadow: 0 12px 24px rgba(186, 116, 72, 0.12);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.lead-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(186, 116, 72, 0.22);
}

.lead-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lead-info {
  display: flex;
  flex-direction: column;
}

.lead-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.lead-sub {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.leads-table td {
  vertical-align: middle;
  padding: 14px 12px;
}

/* ---- Leads: mobile card list ---- */
.leads-mobile { display: none; }
.leads-desktop { display: block; }

.lead-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px solid rgba(214, 160, 84, 0.28);
  box-shadow: 0 10px 26px rgba(173, 117, 84, 0.15);
  text-decoration: none;
  color: inherit;
}

.lead-card:active { transform: translateY(1px); }

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

.lead-card-main {
  flex: 1;
  min-width: 0;
}

.lead-card-name {
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text-main);
  line-height: 1.15;
}

.lead-card-sub {
  margin-top: 3px;
  font-size: 0.86rem;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-card-chevron {
  font-size: 1.5rem;
  color: var(--text-faint);
  line-height: 1;
}

.lead-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(214, 160, 84, 0.18);
}

.lead-card-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
}

/* ----------------------------------------
   RESPONSIVE
----------------------------------------- */

@media (max-width: 1024px) {
  .mobile-menu-btn { display: inline-flex; }

  .sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: min(86vw, 320px);
    max-width: 320px;
    transform: translateX(-110%);
    transition: transform var(--transition-med);
    z-index: 1200;
    border-right: 1px solid rgba(214, 160, 84, 0.26);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .main-column { padding: 16px; }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .page { gap: 14px; }
}

@media (max-width: 640px) {
  .page-header-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-grid { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; gap: 18px; }

  .small-chart canvas { height: 160px !important; }

  /* Switch leads to card list */
  .leads-mobile { display: flex; flex-direction: column; gap: 14px; }
  .leads-desktop { display: none; }

  /* Make buttons stack cleanly */
  .page-header-actions { width: 100%; flex-wrap: wrap; gap: 10px; }
  .btn, .btn-outline, .btn-small, .btn-pill {
    width: 100%;
    justify-content: center;
  }

  .lead-header-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 14px;
  }

  .lead-header-right {
    width: 100%;
    justify-content: space-between;
  }

  .metric-card, .metric-card-primary, .table-card {
    padding: 16px 16px;
  }
}

@media (max-width: 480px) {
  .small-chart canvas { height: 150px !important; }
}

/* ----------------------------------------
   SINGLE ENVIRONMENT STATUS BADGE
----------------------------------------- */

.environment-status-badge {
  position: fixed;
  left: calc(env(safe-area-inset-left, 0px) + 16px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(214, 160, 84, 0.4);
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.9), transparent 60%),
    rgba(252, 228, 216, 0.9);
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow:
    0 10px 22px rgba(173, 117, 84, 0.16),
    0 4px 10px rgba(0, 0, 0, 0.05);
  z-index: 2000;
  pointer-events: none;
  user-select: none;
  backdrop-filter: blur(6px);
}
/* Pilot Control Center */
.lead-control-card {
    margin: 18px 0 22px;
    padding: 22px;
    border-radius: 24px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(255,247,250,0.96));
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.07);
}

.lead-control-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.lead-control-title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #24141b;
}

.lead-control-subtitle {
    margin: 0;
    color: #6b5b63;
    font-size: 0.92rem;
    line-height: 1.45;
}

.lead-control-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

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

.mini-input {
    min-width: 150px;
    padding: 9px 11px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255,255,255,0.92);
    font-size: 0.88rem;
}

.manual-reply-form {
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    padding-top: 16px;
}

.manual-reply-input {
    width: 100%;
    resize: vertical;
}

.btn-outline.danger {
    border-color: rgba(225, 29, 72, 0.35);
    color: #9f1239;
}

.badge-status-paused,
.badge-status-human_active,
.badge-status-needs_front_desk {
    border-color: rgba(225,29,72,0.85);
    color: #9f1239;
}

@media (max-width: 780px) {
    .lead-control-main,
    .lead-control-actions,
    .inline-control-form {
        flex-direction: column;
        align-items: stretch;
    }

    .mini-input {
        width: 100%;
    }
}


/* ----------------------------------------
   Pilot Snapshot + Conversation Polish
----------------------------------------- */
.pilot-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0 20px;
}

.pilot-snapshot-card {
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(212, 175, 55, 0.24);
    background: rgba(255,255,255,0.94);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
}

.pilot-snapshot-wide {
    grid-column: span 1;
}

.pilot-snapshot-label,
.quick-status-title {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8a6a55;
    font-weight: 800;
    margin-bottom: 8px;
}

.pilot-snapshot-value {
    font-size: 1.45rem;
    line-height: 1;
    font-weight: 900;
    color: #24141b;
}

.pilot-snapshot-note,
.pilot-snapshot-action {
    margin-top: 8px;
    color: #6b5b63;
    font-size: 0.9rem;
    line-height: 1.35;
}

.pilot-snapshot-action {
    font-weight: 700;
    color: #3e2a25;
}

.quick-status-panel {
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    padding-top: 16px;
    margin-top: 4px;
    margin-bottom: 16px;
}

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

.btn-pill.muted {
    opacity: 0.78;
}

.btn-pill.danger {
    border-color: rgba(225, 29, 72, 0.35);
    color: #9f1239;
    background: rgba(255, 241, 242, 0.92);
}

.timeline-message-inbound .timeline-content,
.timeline-message-outbound .timeline-content {
    max-width: 780px;
}

.timeline-message-inbound .timeline-body,
.timeline-message-outbound .timeline-body {
    display: inline-block;
    padding: 13px 15px;
    border-radius: 18px;
    line-height: 1.45;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.timeline-message-inbound .timeline-body {
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.timeline-message-outbound .timeline-body {
    background: linear-gradient(135deg, rgba(255,247,250,0.98), rgba(255,255,255,0.98));
    border: 1px solid rgba(212, 175, 55, 0.28);
}

.badge-status-interested,
.badge-status-booking_attempted,
.badge-status-ghosted,
.badge-status-closed_lost {
    border-color: rgba(214,160,84,0.65);
    color: #7a4d1d;
}

@media (max-width: 980px) {
    .pilot-snapshot-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .pilot-snapshot-grid {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------------
   Pilot Control Polish Fixes
   - Makes the new control center feel native to the premium blush/gold UI
   - Separates manual staff replies from AI replies visually
----------------------------------------- */
.lead-control-card {
    position: relative;
    border: 1px solid rgba(224, 181, 127, 0.32);
    background:
        radial-gradient(circle at top left, rgba(255, 228, 214, 0.45), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 249, 247, 0.94));
    box-shadow: 0 24px 55px rgba(132, 73, 42, 0.10);
}

.lead-control-card::before {
    content: none;
}

.lead-control-title {
    letter-spacing: -0.02em;
}

.lead-control-actions,
.quick-status-actions,
.form-actions {
    gap: 10px;
}

.inline-control-form .mini-input,
.manual-reply-input {
    border: 1px solid rgba(214, 160, 84, 0.30);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

.inline-control-form .mini-input:focus,
.manual-reply-input:focus {
    outline: none;
    border-color: rgba(214, 160, 84, 0.70);
    box-shadow: 0 0 0 4px rgba(244, 178, 125, 0.18);
}

.manual-reply-form {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(224, 181, 127, 0.25);
    border-radius: 22px;
    background: rgba(255, 250, 247, 0.72);
}

.manual-reply-input {
    min-height: 96px;
    border-radius: 18px;
    font-family: inherit;
    line-height: 1.5;
}

.manual-reply-form .btn {
    min-width: 168px;
    justify-content: center;
}

.pilot-snapshot-card {
    border: 1px solid rgba(224, 181, 127, 0.28);
    background:
        radial-gradient(circle at top right, rgba(255, 228, 214, 0.38), transparent 40%),
        rgba(255,255,255,0.94);
}

.pilot-snapshot-label,
.quick-status-title {
    color: #9a6a42;
}

.timeline-message-staff .timeline-content {
    max-width: 780px;
}

.timeline-message-staff .timeline-title {
    color: #7a4d1d;
}

.timeline-message-staff .timeline-summary {
    color: #9a6a42;
}

.timeline-message-staff .timeline-body {
    display: inline-block;
    padding: 13px 15px;
    border-radius: 18px;
    line-height: 1.45;
    background: linear-gradient(135deg, rgba(255, 244, 235, 0.98), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(214, 160, 84, 0.34);
    box-shadow: 0 10px 22px rgba(132, 73, 42, 0.06);
}

.timeline-message-staff .timeline-dot {
    background: linear-gradient(135deg, #f4b27d, #d7a24b);
    box-shadow: 0 0 0 4px rgba(244, 178, 125, 0.18);
}

.btn-pill,
.btn-outline,
.btn {
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.btn-pill:hover,
.btn-outline:hover,
.btn:hover {
    transform: translateY(-1px);
}

@media (max-width: 780px) {
    .manual-reply-form {
        padding: 14px;
    }

    .manual-reply-form .btn {
        width: 100%;
    }
}


/* ----------------------------------------
   Pilot UI Refinement Patch
   - Removes the vertical gold accent line
   - Calms button colors into blush/gold brand hierarchy
   - Keeps destructive/escalation actions distinct without looking off-brand
----------------------------------------- */
.lead-control-card {
    overflow: hidden;
    border-color: rgba(224, 181, 127, 0.24);
    box-shadow: 0 22px 48px rgba(132, 73, 42, 0.08);
}

.lead-control-card::before {
    content: none !important;
    display: none !important;
}

.lead-control-actions .btn,
.lead-control-actions .btn-outline,
.quick-status-actions .btn-pill,
.manual-reply-form .btn,
.timeline-actions .btn,
.timeline-actions .btn-outline {
    border-radius: 999px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 31px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(214, 160, 84, 0.34);
    background: rgba(255, 250, 247, 0.92);
    color: #5f4639;
    font-size: 0.82rem;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(132, 73, 42, 0.045);
}

.btn-pill:hover {
    border-color: rgba(214, 160, 84, 0.62);
    background: rgba(255, 246, 242, 0.98);
    box-shadow: 0 12px 24px rgba(132, 73, 42, 0.07);
}

.btn-pill.muted {
    color: #766a64;
    border-color: rgba(130, 112, 102, 0.20);
    background: rgba(255,255,255,0.72);
}

.btn-pill.danger,
.btn-outline.danger {
    border-color: rgba(232, 108, 133, 0.48);
    color: #b4234b;
    background: rgba(255, 247, 249, 0.94);
}

.btn-pill.danger:hover,
.btn-outline.danger:hover {
    border-color: rgba(232, 108, 133, 0.78);
    background: rgba(255, 240, 244, 0.98);
}

.lead-control-actions .btn-outline,
.timeline-actions .btn-outline {
    background: rgba(255, 252, 249, 0.92);
    border-color: rgba(224, 181, 127, 0.42);
    color: #6b5043;
}

.lead-control-actions .btn-outline:hover,
.timeline-actions .btn-outline:hover {
    background: rgba(255, 247, 242, 0.98);
    border-color: rgba(214, 160, 84, 0.66);
}

.lead-control-actions .btn,
.manual-reply-form .btn,
.timeline-actions .btn {
    color: #3b241d;
    background: linear-gradient(135deg, #f8b8a3, #e0a64f);
    border-color: rgba(214, 160, 84, 0.50);
    box-shadow: 0 12px 24px rgba(183, 115, 70, 0.16);
}

.manual-reply-form .btn {
    width: min(100%, 68%);
}

.muted-text {
    color: #9b8175;
}

.timeline-time {
    white-space: nowrap;
}

/* ----------------------------------------
   HOME: VERTICAL MEDSPA ACCOUNT LIST
----------------------------------------- */

.accounts-header {
  margin-bottom: 18px;
}

.account-list {
  width: min(100%, 980px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.account-row {
  width: 100%;
  min-height: 118px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  background:
    radial-gradient(circle at 0 0, rgba(249, 183, 165, 0.22), transparent 58%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 249, 246, 0.96));
  border: 1px solid rgba(214, 160, 84, 0.24);
  box-shadow: 0 14px 34px rgba(173, 117, 84, 0.16);
}

.account-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 46px rgba(173, 117, 84, 0.22);
  border-color: rgba(214, 160, 84, 0.58);
}

.account-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.account-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  background:
    radial-gradient(circle at 30% 20%, #fac5b4, transparent 42%),
    linear-gradient(135deg, var(--accent-blush), var(--accent-gold));
  box-shadow: 0 14px 28px rgba(214, 160, 84, 0.26);
}

.account-topline {
  min-height: 26px;
  display: flex;
  align-items: center;
}

.account-name {
  margin: 2px 0 2px;
  font-size: 1.12rem;
  line-height: 1.2;
  color: var(--text-main);
}

.account-meta {
  margin: 0;
  max-width: 520px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.account-pill {
  font-size: 0.76rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 248, 244, 0.96);
}

.account-state-active {
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(240, 253, 244, 0.86);
}

.account-state-review {
  color: #be123c;
  border-color: rgba(225, 29, 72, 0.35);
  background: rgba(255, 241, 242, 0.88);
}

.account-state-mixed {
  color: #a16207;
  border-color: rgba(214, 160, 84, 0.42);
  background: rgba(255, 251, 235, 0.9);
}

.account-state-setup {
  color: var(--text-soft);
  border-color: rgba(214, 160, 84, 0.34);
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(78px, 1fr));
  gap: 8px;
  min-width: 380px;
}

.account-stat {
  min-height: 62px;
  padding: 9px 10px;
  border-radius: 16px;
  border: 1px solid rgba(214, 160, 84, 0.18);
  background: rgba(255, 250, 247, 0.76);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.account-stat strong {
  font-size: 1.05rem;
  line-height: 1;
  color: var(--text-main);
}

.account-stat span {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.account-open {
  min-width: 138px;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(214, 160, 84, 0.36);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.84rem;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.account-row:hover .account-open {
  color: var(--text-main);
  border-color: rgba(214, 160, 84, 0.7);
  background: rgba(255, 248, 243, 0.98);
}

@media (max-width: 1180px) {
  .account-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .account-stats {
    min-width: 0;
  }

  .account-open {
    justify-self: start;
  }
}

@media (max-width: 700px) {
  .account-list {
    width: 100%;
  }

  .account-row {
    padding: 16px;
    gap: 16px;
  }

  .account-main {
    align-items: flex-start;
  }

  .account-avatar {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    border-radius: 16px;
  }

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

  .account-open {
    width: 100%;
  }
}

/* ==============================
   Pilot Setup Wizard
   ============================== */
.setup-hero { margin-bottom: 18px; }

.setup-progress-card {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr auto;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  background: var(--bg-card);
  box-shadow: var(--shadow-soft);
}

.setup-kicker {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.setup-progress-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(184, 130, 105, 0.14);
}

.setup-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-blush), var(--accent-gold));
}

.setup-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.setup-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.84rem;
}

.setup-check-done {
  color: var(--text-main);
  background: var(--bg-card-soft);
}

.setup-alert {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.setup-alert-success { color: #355c43; }
.setup-alert-error { color: #8f3434; }

.setup-form {
  display: grid;
  gap: 18px;
}

.setup-section {
  padding: 20px;
}

.setup-section-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.setup-section-header h2 {
  margin: 0 0 4px;
  font-size: 1.08rem;
}

.setup-section-header p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.setup-step {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-card-soft);
  border: 1px solid var(--border-subtle);
  font-weight: 800;
  flex: 0 0 auto;
}

.setup-grid {
  display: grid;
  gap: 14px;
}

.setup-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.setup-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.setup-span-2 { grid-column: 1 / -1; }

.setup-grid label {
  display: grid;
  gap: 7px;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.setup-grid input,
.setup-grid select,
.setup-grid textarea {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 13px;
  font: inherit;
  color: var(--text-main);
  background: #fff;
  outline: none;
}

.setup-grid textarea { resize: vertical; min-height: 120px; }

.setup-grid input:focus,
.setup-grid select:focus,
.setup-grid textarea:focus {
  border-color: var(--accent-blush);
  box-shadow: 0 0 0 3px rgba(184, 130, 105, 0.12);
}

.setup-sticky-actions {
  position: sticky;
  bottom: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
  z-index: 5;
}

@media (max-width: 760px) {
  .setup-progress-card { grid-template-columns: 1fr; }
  .setup-grid.two,
  .setup-grid.three { grid-template-columns: 1fr; }
  .setup-sticky-actions { position: static; flex-direction: column; }
}

/* ==============================
   Setup Wizard usability pass
   Wide desktop layout + compact cards
   ============================== */
.setup-form {
  width: 100%;
  gap: 16px;
}

.setup-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "business intake"
    "booking booking"
    "services services"
    "compliance voice";
  gap: 18px;
  align-items: stretch;
}

.setup-section.form-card {
  max-width: none;
  width: 100%;
  margin-top: 0;
  padding: 20px;
  gap: 16px;
}

.setup-card-business { grid-area: business; }
.setup-card-intake { grid-area: intake; }
.setup-card-booking { grid-area: booking; }
.setup-card-services { grid-area: services; }
.setup-card-compliance { grid-area: compliance; }
.setup-card-voice { grid-area: voice; }

.setup-card-services .setup-grid.two,
.setup-card-compliance .setup-grid.two {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}


.setup-checkbox-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.setup-checkbox-card input[type="checkbox"] {
  width: auto;
  min-width: 0;
}

.setup-help-text {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.setup-section-header {
  margin-bottom: 4px;
}

.setup-section-header p {
  max-width: 58ch;
}

.setup-grid input,
.setup-grid select,
.setup-grid textarea {
  min-width: 0;
  box-sizing: border-box;
}

.setup-grid textarea {
  min-height: 112px;
}

.setup-card-services textarea,
.setup-card-compliance textarea {
  min-height: 150px;
}

.setup-card-voice .setup-grid.three {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.setup-card-voice .setup-grid.three label:first-child {
  grid-column: span 1;
}

.setup-sticky-actions {
  margin-top: 2px;
  bottom: 12px;
}

@media (min-width: 1280px) {
  .setup-card-grid {
    grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.15fr) minmax(320px, 0.95fr);
    grid-template-areas:
      "business intake voice"
      "booking booking compliance"
      "services services services";
  }

  .setup-card-services .setup-grid.two,
  .setup-card-compliance .setup-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .setup-card-voice .setup-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .setup-card-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "business"
      "booking"
      "services"
      "compliance"
      "voice";
  }
}

@media (max-width: 760px) {
  .setup-section.form-card {
    padding: 16px;
  }

  .setup-card-services .setup-grid.two,
  .setup-card-compliance .setup-grid.two,
  .setup-card-voice .setup-grid.three {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------
   Pilot Outcomes Engine
----------------------------------------- */
.pilot-proof-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin: 18px 0 22px;
}

.pilot-proof-card {
    border: 1px solid rgba(214, 160, 84, 0.28);
    border-radius: 22px;
    padding: 16px 18px;
    background:
        radial-gradient(circle at 0 0, rgba(249,183,165,0.20), transparent 62%),
        rgba(255,255,255,0.94);
    box-shadow: 0 16px 36px rgba(132, 73, 42, 0.09);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pilot-proof-primary {
    border-color: rgba(214, 160, 84, 0.72);
    background:
        radial-gradient(circle at 0 0, rgba(214,160,84,0.20), transparent 62%),
        rgba(255,255,255,0.96);
}

.pilot-proof-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    font-weight: 800;
}

.pilot-proof-card strong {
    font-size: 1.7rem;
    line-height: 1.05;
    color: var(--text-main);
}

.pilot-proof-card span:last-child {
    color: var(--text-soft);
    font-size: 0.84rem;
}

.pilot-proof-panel {
    margin: 18px 0 20px;
    border: 1px solid rgba(214, 160, 84, 0.28);
    border-radius: 24px;
    padding: 18px;
    background:
        radial-gradient(circle at 0 0, rgba(249,183,165,0.18), transparent 62%),
        rgba(255,255,255,0.82);
    box-shadow: var(--shadow-subtle);
}

.pilot-proof-panel-header,
.queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.analytics-proof-grid {
    margin-bottom: 0;
}

.needs-review-queue {
    margin: 6px 0 22px;
    padding: 16px;
}

.queue-title {
    margin: 0;
    font-size: 1.05rem;
}

.queue-subtitle {
    margin: 2px 0 0;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.review-list {
    display: grid;
    gap: 10px;
}

.review-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(214, 160, 84, 0.22);
    background: rgba(255, 249, 245, 0.92);
    color: inherit;
    text-decoration: none;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.review-item:hover {
    transform: translateY(-1px);
    border-color: rgba(214, 160, 84, 0.72);
    box-shadow: 0 12px 26px rgba(132, 73, 42, 0.10);
}

.review-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blush), var(--accent-gold));
}

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

.review-main span,
.outcome-reason-mini {
    color: var(--text-soft);
    font-size: 0.78rem;
    line-height: 1.32;
}

.outcome-reason-mini {
    margin-top: 5px;
    max-width: 260px;
}

.badge-status-ai_responded { border-color: rgba(168,85,247,0.75); color: #7e22ce; }
.badge-status-qualified { border-color: rgba(59,130,246,0.75); color: #1d4ed8; }
.badge-status-booking_link_sent { border-color: rgba(217,119,6,0.78); color: #92400e; }
.badge-status-appointment_requested { border-color: rgba(214,160,84,0.88); color: #7a4d1d; }
.badge-status-needs_review { border-color: rgba(225,29,72,0.85); color: #9f1239; }
.badge-status-lost { border-color: rgba(100,116,139,0.7); color: #475569; }

.timeline-outcome-qualified .timeline-dot,
.timeline-outcome-booking_link_sent .timeline-dot,
.timeline-outcome-appointment_requested .timeline-dot,
.timeline-outcome-appointment_booked .timeline-dot,
.timeline-outcome-payment_logged .timeline-dot {
    background: linear-gradient(135deg, #fff, var(--accent-gold));
}

.timeline-outcome-needs_review .timeline-dot,
.timeline-outcome-lead_lost .timeline-dot {
    background: linear-gradient(135deg, #fff, #fb7185);
}

.pilot-snapshot-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.pilot-snapshot-outcome {
    border-color: rgba(214, 160, 84, 0.66);
}

.pilot-snapshot-outcome .pilot-snapshot-value {
    font-size: 1.15rem;
    line-height: 1.2;
}

@media (max-width: 700px) {
    .pilot-proof-panel-header,
    .queue-header,
    .review-item {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .review-item {
        display: flex;
        flex-direction: column;
    }
}


/* ----------------------------------------
   Human Review Inbox + Manual Takeover
----------------------------------------- */
.review-proof-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin: 18px 0 24px;
}

.review-inbox-grid {
    display: grid;
    gap: 18px;
}

.review-inbox-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(214, 160, 84, 0.28);
    border-radius: 28px;
    padding: 20px;
    background:
        radial-gradient(circle at 0 0, rgba(249,183,165,0.16), transparent 58%),
        rgba(255,255,255,0.94);
    box-shadow: 0 18px 44px rgba(132, 73, 42, 0.08);
}

.review-inbox-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, var(--accent-gold), var(--accent-blush));
}

.review-urgency-urgent::before { background: linear-gradient(180deg, #fb7185, #b91c1c); }
.review-urgency-high::before { background: linear-gradient(180deg, #f59e0b, var(--accent-gold)); }

.review-card-top,
.review-actions-row,
.review-card-badges {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.review-card-badges {
    justify-content: flex-end;
}

.review-reason-box {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(225,29,72,0.20);
    background: rgba(255, 241, 242, 0.72);
}

.review-reason-box strong {
    display: block;
    margin-top: 4px;
    color: #4a1d27;
    line-height: 1.35;
}

.review-mini-label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.10em;
    font-size: 0.68rem;
    font-weight: 800;
}

.review-context-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.review-context-grid > div,
.review-note-preview {
    border: 1px solid rgba(214, 160, 84, 0.20);
    border-radius: 18px;
    padding: 12px 13px;
    background: rgba(255, 250, 247, 0.82);
    min-width: 0;
}

.review-context-grid strong {
    display: block;
    color: var(--text-main);
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.review-context-grid p,
.review-note-preview p {
    margin: 3px 0 0;
    color: var(--text-soft);
    font-size: 0.84rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.review-note-preview {
    margin-top: 14px;
}

.review-note-preview small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.review-actions-row {
    justify-content: flex-start;
    margin-top: 16px;
}

.review-actions-row form,
.review-mini-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.review-quick-forms {
    display: grid;
    grid-template-columns: 0.85fr 1.1fr 1.1fr;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.review-note-form {
    display: grid;
    gap: 8px;
}

.review-note-form textarea {
    min-height: 72px;
    resize: vertical;
}

.review-empty-state {
    text-align: center;
    padding: 52px 24px;
    border-radius: 28px;
    border: 1px solid rgba(34,197,94,0.28);
    background:
        radial-gradient(circle at 50% 0, rgba(187,247,208,0.32), transparent 55%),
        rgba(255,255,255,0.92);
    box-shadow: var(--shadow-subtle);
}

.review-empty-icon {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    background: rgba(34,197,94,0.12);
    color: #15803d;
    border: 1px solid rgba(34,197,94,0.40);
    font-weight: 900;
    font-size: 1.4rem;
}

.review-empty-state h2 {
    margin: 0 0 8px;
    color: var(--text-main);
}

.review-empty-state p {
    max-width: 620px;
    margin: 0 auto 18px;
    color: var(--text-soft);
    line-height: 1.45;
}

.review-resolution-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 14px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.internal-note-form,
.resolve-review-form {
    min-width: 0;
}

.internal-notes-panel {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.internal-notes-list {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.internal-note-item {
    border: 1px solid rgba(214, 160, 84, 0.20);
    border-radius: 16px;
    padding: 10px 12px;
    background: rgba(255, 250, 247, 0.86);
}

.internal-note-meta {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.internal-note-text {
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
    .review-context-grid,
    .review-quick-forms,
    .review-resolution-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .review-context-grid,
    .review-quick-forms,
    .review-resolution-grid {
        grid-template-columns: 1fr;
    }

    .review-card-top,
    .review-actions-row,
    .review-mini-form {
        align-items: stretch;
    }

    .review-actions-row .btn,
    .review-actions-row .btn-outline,
    .review-actions-row .btn-pill,
    .review-quick-forms .btn,
    .review-quick-forms .btn-outline {
        width: 100%;
        justify-content: center;
    }
}


/* =========================================================
   Pilot Launch Control Center
   ========================================================= */
.launch-alert {
    border-radius: 18px;
    padding: 14px 16px;
    margin: 0 0 18px;
    font-weight: 700;
    border: 1px solid rgba(156, 107, 80, 0.14);
}
.launch-alert-warning {
    background: #fff7ed;
    color: #9a5b16;
}
.launch-alert-success {
    background: #f0fdf4;
    color: #166534;
}
.launch-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(220px, 0.75fr) minmax(220px, 0.75fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}
.launch-hero-card,
.launch-side-card,
.launch-action-card,
.launch-check-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(222, 190, 168, 0.58);
    box-shadow: 0 18px 45px rgba(115, 74, 56, 0.08);
    border-radius: 26px;
}
.launch-hero-primary { padding: 24px; }
.launch-hero-topline,
.launch-go-live-row,
.launch-check-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.launch-score-row {
    display: flex;
    gap: 22px;
    align-items: center;
    margin: 22px 0;
}
.launch-score-row h2 {
    margin: 0 0 8px;
    font-size: 1.65rem;
    color: #553225;
}
.launch-score-row p {
    margin: 0;
    color: #8f6d5f;
    line-height: 1.5;
    max-width: 620px;
}
.launch-score-ring {
    --score: 0;
    width: 128px;
    height: 128px;
    flex: 0 0 128px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at center, #fff 0 58%, transparent 59%),
        conic-gradient(#cf8f77 calc(var(--score) * 1%), #f5ded4 0);
    box-shadow: inset 0 0 0 1px rgba(222, 190, 168, 0.72);
    text-align: center;
}
.launch-score-ring strong {
    display: block;
    font-size: 1.55rem;
    color: #5f3528;
    line-height: 1;
}
.launch-score-ring span {
    display: block;
    font-size: 0.78rem;
    color: #9a7466;
    margin-top: 4px;
}
.launch-disabled { opacity: 0.58; cursor: not-allowed; }
.launch-side-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}
.launch-side-card strong { font-size: 2rem; color: #5c3327; }
.launch-side-card span:not(.pilot-proof-label) { color: #8f6d5f; }
.launch-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.launch-action-card {
    padding: 18px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.launch-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 50px rgba(115, 74, 56, 0.11);
}
.launch-action-card > span {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #fff4ef;
}
.launch-action-card strong { color: #5c3327; }
.launch-action-card p { margin: 0; color: #8f6d5f; line-height: 1.45; }
.launch-action-form { border: 1px dashed rgba(207, 143, 119, 0.55); }
.launch-checklist {
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(222, 190, 168, 0.44);
    border-radius: 28px;
    padding: 18px;
}
.launch-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.launch-check-card {
    padding: 18px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
}
.launch-check-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 900;
}
.launch-check-ok .launch-check-icon { background: #eefbf1; color: #166534; }
.launch-check-needed .launch-check-icon { background: #fff7ed; color: #b45309; }
.launch-check-body h3 { margin: 0; color: #553225; font-size: 1rem; }
.launch-check-detail,
.launch-check-why { margin: 9px 0; color: #846559; line-height: 1.45; }
.launch-check-why { font-size: 0.92rem; }
.account-state-ready { background: #ecfdf5; color: #047857; border-color: rgba(4, 120, 87, 0.18); }
@media (max-width: 1180px) {
    .launch-hero-grid,
    .launch-actions-grid,
    .launch-check-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .launch-score-row { flex-direction: column; align-items: flex-start; }
    .launch-score-ring { width: 112px; height: 112px; flex-basis: 112px; }
    .launch-check-card { grid-template-columns: 1fr; }
}

/* =========================================================
   Auth + Public Demo Sandbox
   ========================================================= */
.auth-shell {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
  padding: 36px 12px;
}
.auth-card {
  width: min(560px, 100%);
  border-radius: 28px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(214, 160, 84, 0.36);
  box-shadow: var(--shadow-soft);
}
.auth-card-wide { width: min(760px, 100%); }
.auth-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--accent-gold);
}
.auth-card h1 { margin: 0 0 10px; font-size: 2rem; }
.auth-copy { margin: 0 0 22px; color: var(--text-soft); line-height: 1.6; }
.auth-form { display: grid; gap: 14px; }
.auth-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-weight: 800;
  font-size: 0.85rem;
}
.auth-form input {
  width: 100%;
  border: 1px solid rgba(214, 160, 84, 0.38);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  padding: 12px 13px;
  color: var(--text-main);
  font: inherit;
  font-weight: 700;
  outline: none;
}
.auth-form input:focus {
  border-color: rgba(214, 160, 84, 0.88);
  box-shadow: 0 0 0 4px rgba(214, 160, 84, 0.14);
}
.auth-submit { grid-column: 1 / -1; justify-content: center; }
.auth-alert {
  border-radius: 18px;
  padding: 13px 15px;
  margin: 0 0 16px;
  border: 1px solid rgba(214, 160, 84, 0.28);
  font-weight: 750;
}
.auth-alert-error { background: #fff1f2; color: #9f1239; }
.auth-alert-info { background: #fff8ed; color: #8a5a22; }
.auth-footer-row {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-soft);
  flex-wrap: wrap;
}
.auth-footer-row a { color: var(--text-main); font-weight: 800; }
.auth-mini {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}
.demo-sandbox-banner { margin-bottom: 18px; }
.timeline-status-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
@media (max-width: 720px) {
  .auth-form-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 22px; }
}

/* Public demo showcase refinements */
.pilot-proof-grid a.pilot-proof-card,
.account-list a.account-card {
    color: inherit;
    text-decoration: none;
}
.demo-readonly-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}
.demo-readonly-fieldset input,
.demo-readonly-fieldset textarea,
.demo-readonly-fieldset select {
    opacity: 1;
    background: rgba(255, 255, 255, 0.72);
    cursor: default;
}
.demo-sandbox-banner {
    margin-bottom: 22px;
}


/* ----------------------------------------
   Public Demo Test Center
----------------------------------------- */
.demo-test-layout {
    display: grid;
    grid-template-columns: minmax(240px, 0.8fr) minmax(0, 2fr);
    gap: 18px;
    align-items: start;
    margin-top: 18px;
}

.demo-test-info-card,
.demo-scenario-card {
    border: 1px solid rgba(214, 160, 84, 0.26);
    border-radius: 24px;
    background:
        radial-gradient(circle at 0 0, rgba(249,183,165,0.18), transparent 64%),
        rgba(255,255,255,0.94);
    box-shadow: 0 16px 36px rgba(132, 73, 42, 0.08);
}

.demo-test-info-card {
    padding: 20px;
    position: sticky;
    top: 18px;
}

.demo-test-info-card h2,
.demo-scenario-card h3 {
    margin: 0 0 8px;
    color: var(--text-main);
}

.demo-test-info-card p,
.demo-scenario-card p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.55;
}

.demo-test-checks,
.demo-scenario-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.demo-test-checks span,
.demo-scenario-tags span {
    border: 1px solid rgba(214,160,84,0.24);
    background: rgba(255, 249, 245, 0.82);
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 700;
}

.demo-scenario-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.demo-scenario-card {
    padding: 18px;
    display: flex;
    flex-direction: column;
    min-height: 236px;
}

.demo-scenario-topline {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 10px;
}

.demo-scenario-card form {
    margin-top: auto;
    padding-top: 16px;
}

.demo-scenario-card .btn-pill {
    text-decoration: none;
    cursor: pointer;
    background: rgba(255,255,255,0.92);
}

@media (max-width: 980px) {
    .demo-test-layout {
        grid-template-columns: 1fr;
    }
    .demo-test-info-card {
        position: static;
    }
}

@media (max-width: 680px) {
    .demo-scenario-grid {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------------
   Lead Pipeline Table Polish
   - Keeps source, handling, and timeline actions from wrapping awkwardly
   - Makes the table read cleaner while preserving the same data model
----------------------------------------- */
.leads-desktop .table-wrap table {
    min-width: 1120px;
}

.leads-table th:nth-child(2),
.leads-table td:nth-child(2),
.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    width: 160px;
}

.leads-table th:nth-child(4),
.leads-table td:nth-child(4) {
    width: 132px;
}

.leads-table th:last-child,
.leads-table td:last-child,
.data-table th:last-child,
.data-table td:last-child {
    width: 146px;
}

.lead-source-badge,
.next-action-badge,
.handling-badge,
.outcome-badge {
    min-height: 30px;
    padding: 6px 10px;
    line-height: 1;
    font-weight: 650;
    letter-spacing: -0.01em;
    white-space: nowrap;
    vertical-align: middle;
}

.lead-source-badge {
    max-width: 168px;
    overflow: visible;
    text-overflow: clip;
    background: rgba(255, 247, 241, 0.94);
    border-color: rgba(214, 160, 84, 0.36);
}

.next-action-badge {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(255, 249, 245, 0.94);
}

.handling-badge {
    min-width: 94px;
    justify-content: center;
    background: rgba(255, 253, 251, 0.95);
}

.outcome-badge {
    justify-content: center;
    background: rgba(255, 253, 251, 0.95);
}

.table-actions {
    text-align: right;
    white-space: nowrap;
}

.timeline-link-pill,
.timeline-link-pill:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 124px;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(214, 160, 84, 0.38);
    color: #5c3d2f;
    font-weight: 700;
}

.timeline-link-pill:hover {
    text-decoration: none;
    background: rgba(255, 247, 241, 0.98);
    border-color: rgba(214, 160, 84, 0.66);
}

.timeline-link-pill span {
    text-decoration: none;
}

.timeline-link-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(214, 160, 84, 0.13);
    font-size: 0.78rem;
    line-height: 1;
}

.outcome-reason-mini {
    max-width: 230px;
    margin-top: 5px;
    line-height: 1.35;
}


/* ----------------------------------------
   Public Demo Lead Data Polish
   - Test Center scenarios now display realistic source/campaign values
   - Keeps source badges readable without truncating normal labels
----------------------------------------- */
.leads-table .lead-source-badge {
    max-width: 168px;
}

.leads-table .campaign-text {
    line-height: 1.35;
}


/* ----------------------------------------
   Outcome Tooltip Cleanup
   - Keeps the lead table aligned by showing only the outcome badge
   - Preserves the outcome reason on hover/focus for quick context
----------------------------------------- */
.leads-table td,
.data-table td {
    vertical-align: middle;
}

.leads-table th:nth-child(5),
.leads-table td:nth-child(5) {
    width: 178px;
}

.outcome-cell {
    position: relative;
    vertical-align: middle;
}

.outcome-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    outline: none;
}

.outcome-tooltip .outcome-badge {
    cursor: help;
}

.outcome-tooltip:focus-visible .outcome-badge {
    box-shadow: 0 0 0 3px rgba(214, 160, 84, 0.22);
}

.outcome-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    z-index: 50;
    width: max-content;
    max-width: 270px;
    min-width: 190px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(214, 160, 84, 0.34);
    background: rgba(255, 252, 249, 0.98);
    box-shadow: 0 16px 34px rgba(132, 73, 42, 0.16);
    color: var(--text-soft);
    font-size: 0.78rem;
    line-height: 1.35;
    white-space: normal;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

.outcome-tooltip::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%) rotate(45deg);
    z-index: 51;
    width: 10px;
    height: 10px;
    background: rgba(255, 252, 249, 0.98);
    border-right: 1px solid rgba(214, 160, 84, 0.25);
    border-bottom: 1px solid rgba(214, 160, 84, 0.25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.outcome-tooltip:hover::after,
.outcome-tooltip:focus::after,
.outcome-tooltip:hover::before,
.outcome-tooltip:focus::before {
    opacity: 1;
    visibility: visible;
}

.outcome-tooltip:hover::after,
.outcome-tooltip:focus::after {
    transform: translateX(-50%) translateY(0);
}

/* The old inline reason text is intentionally hidden in lead tables;
   it remains available in timelines and hover/focus tooltips. */
.leads-table .outcome-reason-mini {
    display: none;
}

@media (max-width: 920px) {
    .outcome-tooltip::after {
        left: 0;
        transform: translateX(0) translateY(4px);
    }

    .outcome-tooltip:hover::after,
    .outcome-tooltip:focus::after {
        transform: translateX(0) translateY(0);
    }

    .outcome-tooltip::before {
        left: 18px;
        transform: rotate(45deg);
    }
}

/* ----------------------------------------
   Workspace Settings + Pilot Onboarding v1
----------------------------------------- */
.settings-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.settings-summary-card {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 249, 245, 0.92);
  border: 1px solid rgba(214, 160, 84, 0.3);
  box-shadow: var(--shadow-subtle);
}

.settings-summary-card span,
.settings-summary-card small {
  color: var(--text-soft);
  font-size: 0.84rem;
}

.settings-summary-card strong {
  color: var(--text-main);
  font-size: 1rem;
}

.settings-summary-card code {
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(214, 160, 84, 0.22);
  color: var(--text-muted);
}

.workspace-settings-grid {
  grid-template-areas:
    "business business"
    "booking booking"
    "services services"
    "compliance followups"
    "intake voice";
}

.setup-card-followups { grid-area: followups; }

@media (min-width: 1280px) {
  .workspace-settings-grid {
    grid-template-areas:
      "business booking booking"
      "services services services"
      "compliance followups intake"
      "voice voice voice";
  }
}

@media (max-width: 1100px) {
  .workspace-settings-grid {
    grid-template-areas:
      "business"
      "booking"
      "services"
      "compliance"
      "followups"
      "intake"
      "voice";
  }
}

/* Setup Wizard now includes follow-up rules without duplicating Workspace Settings. */
.setup-card-grid:not(.workspace-settings-grid) {
  grid-template-areas:
    "business intake"
    "booking booking"
    "services services"
    "compliance followups"
    "voice voice";
}

@media (min-width: 1280px) {
  .setup-card-grid:not(.workspace-settings-grid) {
    grid-template-areas:
      "business intake voice"
      "booking booking followups"
      "services services compliance";
  }
}

@media (max-width: 1100px) {
  .setup-card-grid:not(.workspace-settings-grid) {
    grid-template-areas:
      "business"
      "intake"
      "booking"
      "services"
      "compliance"
      "followups"
      "voice";
  }
}

/* Live Pilot Polish v1 */
.timeline-filter-card {
  margin-bottom: 18px;
}

.timeline-filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  align-items: end;
}

.timeline-filter-form label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.timeline-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

@media (max-width: 900px) {
  .timeline-filter-form {
    grid-template-columns: 1fr;
  }
}
