/* ═══════════════════════════════════════════════════════════════
   AGENT HUB — Style Sheet
   ═══════════════════════════════════════════════════════════════ */

/* ─── Tokens ─────────────────────────────────────────────────── */
:root {
  --teal:       #1D9E75;
  --teal-dark:  #158a63;
  --teal-light: #e6f7f1;
  --bg:         #F0F4F8;
  --surface:    #FFFFFF;
  --border:     #E2E8F0;
  --text:       #1E293B;
  --text-2:     #64748B;
  --text-3:     #94A3B8;
  --red:        #EF4444;
  --red-light:  #FEF2F2;
  --green:      #22C55E;
  --green-light:#F0FDF4;
  --amber:      #F59E0B;
  --amber-light:#FFFBEB;
  --blue:       #3B82F6;
  --blue-light: #EFF6FF;
  --purple:     #8B5CF6;
  --teal-evt:   #0D9488;
  --radius:     10px;
  --sidebar-w:  220px;
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 12px rgba(0,0,0,.1);
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Ensure the HTML `hidden` attribute always wins over any display: rule */
[hidden] { display: none !important; }
html { height: 100%; font-size: 15px; }
body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  overflow: hidden;
}
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, select, textarea {
  font: inherit;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  width: 100%;
  background: var(--surface);
  transition: border-color .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); }
textarea { resize: vertical; min-height: 80px; }
a { color: var(--teal); text-decoration: none; }
svg { display: block; flex-shrink: 0; }

/* ─── Layout ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.view-container {
  flex: 1;
  margin-left: var(--sidebar-w);
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden; /* prevent any unconstrained element from causing horizontal scroll */
  padding: 24px;
}


.bottom-nav { display: none; }

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--teal);
  border-bottom: 1px solid var(--border);
}
.brand-icon { width: 24px; height: 24px; stroke: var(--teal); }

.sidebar-nav {
  list-style: none;
  padding: 10px 8px;
  flex: 1;
}
.sidebar-nav li { margin-bottom: 2px; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: .92rem;
  font-weight: 500;
  color: var(--text-2);
  transition: background .15s, color .15s;
  position: relative;
}
.nav-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-btn:hover { background: var(--bg); color: var(--text); }
.nav-btn.active { background: var(--teal-light); color: var(--teal); font-weight: 600; }

.sidebar-footer {
  padding: 8px 8px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
}
.sidebar-footer .nav-btn { flex: 1; width: auto; }
.settings-btn { color: var(--text-2); }

/* ─── Sidebar legal links ────────────────────────────────────── */
.sidebar-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px 12px;
  font-size: .72rem;
  color: var(--text-3);
}
.sidebar-legal a {
  color: var(--text-3);
  text-decoration: none;
  transition: color .15s;
}
.sidebar-legal a:hover { color: var(--teal); }
.sidebar-legal-sep { color: var(--border); }

/* ─── Dark mode toggle button (sidebar) ─────────────────────── */
.dark-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text-2);
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.dark-toggle-btn:hover { background: var(--bg); color: var(--text); }
.dark-toggle-btn svg { width: 18px; height: 18px; }

/* ─── Sync button (sidebar) ─────────────────────────────────── */
.sync-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--teal);
  flex-shrink: 0;
  transition: background .15s, color .15s, opacity .15s;
}
.sync-btn:hover { background: var(--teal-light); }
.sync-btn svg { width: 18px; height: 18px; }

/* Warn state — amber when disconnected */
.sync-btn[data-sync-status="warn"] { color: var(--amber); }
.sync-btn[data-sync-status="warn"]:hover { background: var(--amber-light); }

/* Spinning animation while manually refreshing */
@keyframes spin-ccw {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}
.sync-btn.syncing { opacity: .6; pointer-events: none; }
.sync-btn.syncing .sync-icon { animation: spin-ccw .8s linear infinite; }

/* ─── Bottom Nav ─────────────────────────────────────────────── */
/* ─── Mobile layout (≤600px): hamburger drawer replaces bottom nav ─── */
.mobile-header       { display: none; }
.mobile-nav-overlay  { display: none; }
.mobile-nav-drawer   { display: none; }

@media (max-width: 600px) {
  body { flex-direction: column; overflow: auto; }

  .sidebar     { display: none; }
  .bottom-nav  { display: none; }

  /* Push content below the fixed mobile header */
  .view-container {
    margin-left: 0;
    height: auto;
    min-height: 100svh;
    overflow-y: visible;
    padding: 16px 14px;
    padding-top: calc(72px + env(safe-area-inset-top));
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  /* ── Mobile header bar ── */
  .mobile-header {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: calc(56px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 200;
    gap: 0;
  }
  .mobile-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 56px;
    color: var(--text);
    flex-shrink: 0;
  }
  .mobile-header-brand {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--teal);
  }
  .mobile-header-actions {
    display: flex;
    align-items: center;
    padding-right: 8px;
  }
  .mobile-header-dark-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 8px;
    color: var(--text-2);
    transition: background .15s, color .15s;
  }
  .mobile-header-dark-btn:hover { background: var(--bg); color: var(--text); }

  /* ── Tap-outside overlay ── */
  .mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 250;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  .mobile-nav-overlay.open { display: block; }

  /* ── Slide-out drawer ── */
  .mobile-nav-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(280px, 85vw);
    background: var(--surface);
    z-index: 300;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, .15);
    overflow-y: auto;
  }
  .mobile-nav-drawer.open { transform: translateX(0); }

  body.drawer-open { overflow: hidden; }

  .mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px 16px;
    padding-top: calc(20px + env(safe-area-inset-top));
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .mobile-drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--teal);
  }
  .mobile-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 8px;
    color: var(--text-2);
    transition: background .15s, color .15s;
  }
  .mobile-drawer-close:hover { background: var(--bg); color: var(--text); }

  .mobile-drawer-nav {
    list-style: none;
    padding: 8px 0;
    flex: 1;
  }
  .mobile-drawer-nav li { padding: 2px 10px; }
  .mobile-nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 12px;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 500;
    color: var(--text-2);
    text-align: left;
    position: relative;
    transition: background .15s, color .15s;
  }
  .mobile-nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
  .mobile-nav-item .badge {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
  }
  .mobile-nav-item.active {
    color: var(--teal);
    background: var(--teal-light);
    font-weight: 600;
  }

  .mobile-drawer-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }
  .mobile-drawer-footer .sync-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-2);
    background: var(--bg);
    transition: background .15s, color .15s;
  }
  .mobile-drawer-footer .sync-btn:hover { color: var(--teal); }
  .mobile-drawer-footer .sync-btn .sync-icon { width: 16px; height: 16px; }

  .drawer-legal {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    color: var(--text-3);
  }
  .drawer-legal a {
    color: var(--text-3);
    text-decoration: none;
    transition: color .15s;
  }
  .drawer-legal a:hover { color: var(--teal); }
  .drawer-legal span { color: var(--border); }
}

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
  background: var(--red);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.5;
}

/* ─── Page Header ────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--red-light); color: var(--red); }
.btn-danger:hover { background: #fecaca; }
.btn-ghost { color: var(--teal); padding: 6px 10px; }
.btn-ghost:hover { background: var(--teal-light); border-radius: 6px; }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn svg { width: 15px; height: 15px; }

/* ─── Stats Bar ──────────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: .75rem; color: var(--text-2); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text); margin-top: 4px; }
.stat-value.teal { color: var(--teal); }

/* ─── Search / Filter Bar ────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-bar input,
.filter-bar select {
  flex: 1;
  min-width: 140px;
}
.filter-bar select { max-width: 180px; }

/* ─── Lead Cards ─────────────────────────────────────────────── */
.leads-list { display: flex; flex-direction: column; gap: 10px; }

.lead-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  border-left: 4px solid transparent;
}
.lead-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.lead-card.priority-high { border-left-color: var(--red); }
.lead-card.priority-normal { border-left-color: var(--amber); }
.lead-card.priority-low { border-left-color: var(--text-3); }

.lead-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--teal-light);
  color: var(--teal);
  font-weight: 700;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.lead-info { flex: 1; min-width: 0; }
.lead-name { font-weight: 600; font-size: .95rem; }
.lead-meta { font-size: .78rem; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

/* ─── Stage Pills ────────────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.pill-new-inquiry  { background: #ede9fe; color: #6d28d9; }
.pill-contacted    { background: var(--amber-light); color: #92400e; }
.pill-showing      { background: var(--blue-light); color: #1d4ed8; }
.pill-offer-made   { background: var(--red-light); color: #b91c1c; }
.pill-closed       { background: var(--green-light); color: #166534; }

/* ─── Lead Detail ────────────────────────────────────────────── */
.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.detail-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--teal-light);
  color: var(--teal);
  font-weight: 700;
  font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.detail-name { font-size: 1.3rem; font-weight: 700; }
.detail-sub  { font-size: .85rem; color: var(--text-2); margin-top: 2px; }

.detail-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.detail-card h3 { font-size: .8rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.detail-item label { font-size: .75rem; color: var(--text-2); display: block; margin-bottom: 2px; }
.detail-item span  { font-size: .9rem; font-weight: 500; }
.detail-inline-select {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 6px;
  cursor: pointer;
  width: 100%;
}
.detail-inline-select:focus { outline: none; border-color: var(--teal); }

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

/* ─── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 12px; stroke: var(--text-3); }
.empty-state h3 { font-size: 1rem; color: var(--text); margin-bottom: 6px; }
.empty-state p  { font-size: .88rem; }

/* ─── Reminders ──────────────────────────────────────────────── */
.section-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 0;
  margin-bottom: 8px;
  margin-top: 16px;
}
.section-label.overdue { color: var(--red); }
.section-label.today   { color: var(--teal); }
.section-label.upcoming{ color: var(--text-2); }

.reminder-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  transition: opacity .2s;
}
.reminder-card.done { opacity: .45; }
.reminder-card.overdue-card { border-left: 3px solid var(--red); }
.reminder-card.today-card   { border-left: 3px solid var(--teal); }

.reminder-check {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.reminder-check.checked { background: var(--teal); border-color: var(--teal); }
.reminder-check.checked::after {
  content: '';
  display: block;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg) translateY(-1px);
}
.reminder-info { flex: 1; min-width: 0; }
.reminder-title { font-weight: 600; font-size: .9rem; }
.reminder-meta  { font-size: .77rem; color: var(--text-2); margin-top: 2px; }
.reminder-actions { display: flex; gap: 6px; }

/* ─── Calendar ───────────────────────────────────────────────── */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cal-month-label { font-size: 1.1rem; font-weight: 700; }
.cal-nav-btns { display: flex; gap: 6px; }
.cal-nav-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.cal-nav-btn:hover { background: var(--teal-light); border-color: var(--teal); }
.cal-nav-btn svg { width: 16px; height: 16px; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.cal-day-header {
  background: var(--surface);
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  padding: 8px 0;
  letter-spacing: .05em;
}
.cal-cell {
  background: var(--surface);
  min-height: 80px;
  padding: 6px;
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.cal-cell.empty { background: var(--bg); cursor: default; }
.cal-cell:hover:not(.empty) { background: var(--teal-light); }
.cal-cell.today .cal-day-num {
  background: var(--teal); color: #fff;
  border-radius: 50%; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.cal-cell.selected { background: var(--teal-light); }

.cal-day-num {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  display: inline-block;
  line-height: 1;
  padding: 2px;
}
.cal-events { display: flex; flex-direction: column; gap: 2px; }
.cal-evt-pill {
  font-size: .65rem;
  font-weight: 600;
  color: #fff;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-evt-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Day Events Panel ───────────────────────────────────────── */
.day-events-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.day-events-panel h3 { font-size: .9rem; font-weight: 700; margin-bottom: 12px; }
.event-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.event-item:last-child { border-bottom: none; }
.event-color-bar { width: 4px; border-radius: 2px; min-height: 40px; flex-shrink: 0; }
.event-info { flex: 1; }
.event-title { font-weight: 600; font-size: .9rem; }
.event-meta  { font-size: .78rem; color: var(--text-2); margin-top: 2px; }
.event-actions { flex-shrink: 0; }

/* ─── Calendar Day View ──────────────────────────────────────── */
.cal-day-view {
  animation: fadeSlideUp .18s ease;
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cdv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cdv-date-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}
.cdv-weekday {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cdv-today-badge {
  font-size: .7rem;
  font-weight: 700;
  background: var(--teal);
  color: #fff;
  border-radius: 20px;
  padding: 2px 9px;
  letter-spacing: .03em;
}
.cdv-full-date {
  font-size: .88rem;
  color: var(--text-2);
  font-weight: 500;
}
.cdv-event-count {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 14px;
  min-height: 1em;
}

/* Timeline list */
.cdv-events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cdv-event-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.cdv-time-col {
  width: 64px;
  flex-shrink: 0;
  padding-top: 14px;
  text-align: right;
}
.cdv-time {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.cdv-card-body {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius);
  border-left: 4px solid var(--teal);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.cdv-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.cdv-event-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
/* Clickable card — shows edit affordance on hover */
.cdv-card-body[role="button"] {
  cursor: pointer;
  transition: background .12s, box-shadow .12s;
}
.cdv-card-body[role="button"]:hover {
  background: var(--teal-light);
  box-shadow: 0 2px 8px rgba(13,148,136,.12);
}
.cdv-card-body[role="button"]:hover .cdv-edit-icon { opacity: .8 !important; }
.cdv-card-body[role="button"]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* Edit event modal — Delete on the left, Cancel+Save on the right */
.edit-event-actions {
  justify-content: space-between !important;
}

.cdv-del-btn {
  flex-shrink: 0;
  opacity: .55;
  transition: opacity .15s;
}
.cdv-del-btn:hover { opacity: 1; color: var(--danger); }

.cdv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.cdv-type-chip {
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .02em;
}
.cdv-lead-chip {
  font-size: .75rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}
.cdv-notes {
  font-size: .8rem;
  color: var(--text-2);
  margin-top: 6px;
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}

/* Empty state */
.cdv-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-2);
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cdv-empty p {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-2);
  margin: 0;
}

/* Mobile: tighten up the time column */
@media (max-width: 500px) {
  .cdv-time-col { width: 48px; }
  .cdv-time { font-size: .72rem; }
  .cdv-card-body { padding: 10px 11px; }
  .cdv-event-title { font-size: .88rem; }
  .cdv-weekday { font-size: 1.1rem; }
}

/* ─── Commission Calculator ──────────────────────────────────── */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.calc-field label { font-size: .82rem; font-weight: 600; color: var(--text-2); display: block; margin-bottom: 5px; }

.calc-results {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.calc-results h3 { font-size: .85rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 16px; }

.calc-result-rows { display: flex; flex-direction: column; gap: 8px; }
.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .9rem;
}
.calc-row.divider { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.calc-row.net {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--teal);
  /* Separator above Net to You — defined here so the row never needs
     the generic .divider class (which sets height:1px + background that
     paints a gray line through the text) */
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 6px;
  background: none;
  text-decoration: none;
  border-bottom: none;
}
.calc-row-label { color: var(--text-2); }
.calc-row-value { font-weight: 600; }

/* ─── AI Assistant ───────────────────────────────────────────── */
.ai-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-top: 14px;
}
.ai-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
}
.ai-box-header svg { width: 18px; height: 18px; stroke: var(--teal); }
.ai-input-row { display: flex; gap: 8px; }
.ai-input-row input { flex: 1; }
.ai-response {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: .87rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text);
  min-height: 0;
}
.ai-response:empty { display: none; }
.ai-thinking { color: var(--text-2); font-style: italic; }

/* ─── Earnings ───────────────────────────────────────────────── */
.chart-wrapper {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.chart-wrapper h3 { font-size: .85rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 14px; }
.chart-canvas-wrap { position: relative; height: 220px; }

.deal-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.deal-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}
.deal-info { flex: 1; }
.deal-name { font-weight: 600; font-size: .9rem; }
.deal-meta { font-size: .78rem; color: var(--text-2); margin-top: 2px; }
.deal-net  { font-weight: 700; color: var(--teal); font-size: 1rem; }

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
  /* Respect iPhone home indicator so modal isn't flush with screen edge */
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  /* Extra inner breathing room at bottom of modal content */
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--surface);
  z-index: 1;
}
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  transition: background .15s;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 20px; }

/* ─── Forms ──────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field label { font-size: .8rem; font-weight: 600; color: var(--text-2); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ─── Priority dots ──────────────────────────────────────────── */
.priority-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.p-high   { background: var(--red); }
.p-normal { background: var(--amber); }
.p-low    { background: var(--text-3); }

/* ─── Misc helpers ───────────────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 16px;
  padding: 5px 0;
}
.back-btn:hover { color: var(--teal); }
.back-btn svg { width: 16px; height: 16px; }

.divider { height: 1px; background: var(--border); margin: 20px 0; }

.type-badge {
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.overdue-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--red);
  background: var(--red-light);
  padding: 2px 8px;
  border-radius: 20px;
}

.notes-text {
  font-size: .88rem;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  background: var(--bg);
  padding: 10px 12px;
  border-radius: 8px;
}

.detail-card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.detail-card-header-row h3 { margin-bottom: 0; }

.lead-notes-ta {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  font-size: .88rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color .15s;
}
.lead-notes-ta:focus {
  outline: none;
  border-color: var(--teal);
}
body.dark-mode .lead-notes-ta { background: var(--surface); }

.saved-indicator {
  font-size: .78rem;
  font-weight: 600;
  color: var(--teal);
  opacity: 0;
  transition: opacity .3s;
}
.saved-indicator.show { opacity: 1; }

.source-tag {
  font-size: .72rem;
  background: var(--blue-light);
  color: var(--blue);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  /* Tab bar scrolls horizontally — no need to shrink font or padding */
}

/* ─── Tabs ───────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  /* Horizontal scroll on mobile so all tabs are reachable */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;        /* Firefox */
  scroll-behavior: smooth;
}
.tab-bar::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.tab-btn {
  flex: 0 0 auto;               /* don't shrink — let the bar scroll instead */
  padding: 8px 14px;
  border-radius: 7px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: pointer;
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); background: var(--surface); }
.tab-btn.active {
  background: var(--surface);
  color: var(--teal);
  box-shadow: var(--shadow);
}
.tab-progress {
  font-size: .68rem;
  font-weight: 700;
  background: var(--teal-light);
  color: var(--teal);
  padding: 1px 6px;
  border-radius: 10px;
}
.tab-btn.active .tab-progress {
  background: var(--teal);
  color: #fff;
}

/* ─── Checklist ──────────────────────────────────────────────── */
.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.checklist-count {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-2);
}
.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 16px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 3px;
  transition: width .3s ease;
}
.checklist-items { display: flex; flex-direction: column; gap: 2px; }
.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
  user-select: none;
}
.checklist-item:hover { background: var(--bg); }
.checklist-item.done .check-label {
  color: var(--text-2);
  text-decoration: line-through;
}
.check-box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}
.check-box.checked {
  background: var(--teal);
  border-color: var(--teal);
}
.check-box.checked::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}
.check-label {
  font-size: .9rem;
  color: var(--text);
  flex: 1;
  transition: color .15s;
}

/* New button-based checklist rows (mobile-friendly tap targets) */
.checklist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 2px 4px;
  border-radius: 8px;
  transition: background .12s;
}
.checklist-row:hover { background: var(--bg); }
.checklist-row.done .check-label {
  color: var(--text-2);
  text-decoration: line-through;
}
.checklist-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.checklist-toggle:active .check-box { opacity: .7; }
.checklist-del {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  font-size: 1.2rem;
  line-height: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .12s, background .12s;
  flex-shrink: 0;
}
.checklist-del:hover { color: var(--danger); background: var(--bg); }
.checklist-add-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.checklist-add-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: .9rem;
  min-width: 0;
}
.checklist-add-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,148,136,.15);
}

/* ─── Documents ──────────────────────────────────────────────── */
.doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.doc-row:last-child { border-bottom: none; }
.doc-icon-glyph { font-size: 1.4rem; flex-shrink: 0; line-height: 1; }
.doc-info { flex: 1; min-width: 0; }
.doc-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-name:hover { text-decoration: underline; }
.doc-meta { font-size: .75rem; color: var(--text-2); margin-top: 2px; }
.doc-btns { display: flex; gap: 4px; flex-shrink: 0; }

/* ─── Tappable contact links ─────────────────────────────────── */
.contact-link {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
}
.contact-link:hover { text-decoration: underline; }

/* ─── Settings toggle switch ─────────────────────────────────── */
/* ─── Settings — Profile grid ────────────────────────────────── */
.settings-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 500px) {
  .settings-profile-grid { grid-template-columns: 1fr; }
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
.settings-toggle-info { flex: 1; }
.settings-toggle-label { font-size: .92rem; font-weight: 600; color: var(--text); }
.settings-toggle-desc  { font-size: .78rem; color: var(--text-2); margin-top: 2px; }

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s;
}
.toggle-track::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  left: 3px;
  top: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.toggle-switch input:checked + .toggle-track { background: var(--teal); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(20px); }

/* ═══════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════ */
body.dark-mode {
  --bg:         #0A0A0A;
  --surface:    #1A1A1A;
  --border:     #2A2A2A;
  --text:       #FFFFFF;
  --text-2:     #A0A0A0;
  --text-3:     #555555;
  --teal-light: #0c3326;
  --red-light:  #2d1515;
  --green-light:#0d2d1a;
  --amber-light:#2d2010;
  --blue-light: #0f1f3a;
  --shadow:     0 1px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
  --shadow-md:  0 4px 12px rgba(0,0,0,.6);
}

body.dark-mode .sidebar,
body.dark-mode .bottom-nav,
body.dark-mode .mobile-header,
body.dark-mode .mobile-nav-drawer { background: #111111; }

body.dark-mode .modal,
body.dark-mode .modal-header { background: #111111; }

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea { background: #111111; }

body.dark-mode .pill-new-inquiry  { background: #2e1a5e; color: #a78bfa; }
body.dark-mode .pill-contacted    { background: #2d2010; color: #fbbf24; }
body.dark-mode .pill-showing      { background: #0f1f3a; color: #60a5fa; }
body.dark-mode .pill-offer-made   { background: #2d1515; color: #f87171; }
body.dark-mode .pill-closed       { background: #0d2d1a; color: #4ade80; }

body.dark-mode .source-tag { background: #0f1f3a; color: #60a5fa; }
body.dark-mode .type-badge { background: #111111; }

body.dark-mode .search-panel { background: #111111; }
body.dark-mode .search-input-wrap input { background: transparent; }
body.dark-mode .search-item:hover { background: #1a1a1a; }
body.dark-mode .mobile-search-fab { box-shadow: 0 4px 14px rgba(0,0,0,.6); }

/* ─── Pipeline Value Card ────────────────────────────────────── */
.pipeline-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1.5px solid var(--border);
  margin-bottom: 20px;
  overflow: hidden;
}

.pipeline-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
  transition: background .12s;
}
.pipeline-card-header:hover { background: var(--bg); }

.pipeline-card-meta { flex: 1; min-width: 0; }

.pipeline-card-label {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-2);
}
.pipeline-card-subtitle {
  font-size: .78rem;
  color: var(--text-3);
  margin-top: 1px;
}

.pipeline-card-total {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: -.02em;
  flex-shrink: 0;
}

.pipeline-toggle-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform .25s cubic-bezier(.4,0,.2,1), background .12s, color .12s;
}
.pipeline-toggle-btn:hover { background: var(--bg); color: var(--text-2); }
.pipeline-toggle-btn.open { transform: rotate(180deg); }

/* Body — animated collapse */
.pipeline-card-body {
  padding: 0 18px 16px;
  border-top: 1px solid var(--border);
}

/* Stacked progress bar */
.pipeline-bar {
  display: flex;
  height: 9px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg);
  margin: 14px 0;
  gap: 2px;
}
.pipeline-bar-seg {
  height: 100%;
  min-width: 2px;
  border-radius: 2px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}

/* Stage breakdown rows */
.pipeline-stage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}
.pipeline-stage-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pipeline-stage-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  min-width: 100px;
}
.pipeline-stage-count {
  font-size: .74rem;
  color: var(--text-3);
  flex-shrink: 0;
  min-width: 48px;
}
/* Mini bar per stage */
.pipeline-stage-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.pipeline-stage-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
  opacity: .75;
}
.pipeline-stage-value {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  min-width: 72px;
  text-align: right;
  flex-shrink: 0;
}

.pipeline-note {
  font-size: .72rem;
  color: var(--text-3);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.btn-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: var(--teal);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}
.btn-link:hover { text-decoration-style: solid; }

/* Mobile: tighten pipeline header */
@media (max-width: 600px) {
  .pipeline-card-total { font-size: 1.4rem; }
  .pipeline-stage-name { min-width: 80px; font-size: .78rem; }
  .pipeline-stage-value { min-width: 60px; font-size: .78rem; }
  .pipeline-card-header { padding: 13px 14px; gap: 10px; }
  .pipeline-card-body { padding: 0 14px 14px; }
}

/* ─── Resources (Scripts & Templates) ───────────────────────── */
.resource-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow .15s;
}
.resource-card:hover { box-shadow: var(--shadow-md); }

.resource-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.resource-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.resource-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
}

/* Tag pills */
.resource-tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.rtag-call      { background: var(--teal-light);  color: var(--teal); }
.rtag-voicemail { background: #ede9fe;             color: #6d28d9;     }
.rtag-in-person { background: var(--green-light);  color: #166534;     }
.rtag-email     { background: var(--blue-light);   color: var(--blue); }
.rtag-text      { background: var(--amber-light);  color: #92400e;     }

/* Dark-mode adjustments for tag pills */
body.dark-mode .rtag-voicemail { background: #2e1a5e; color: #a78bfa; }

.resource-builtin-badge {
  font-size: .63rem;
  font-weight: 600;
  color: var(--text-3);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}

.resource-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
}

/* Script / template body — scrollable if very long */
.resource-body {
  font-family: inherit;
  font-size: .84rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  padding: 14px 16px;
  margin: 0;
  background: none;
  max-height: 260px;
  overflow-y: auto;
}

/* ─── Property Wishlist ──────────────────────────────────────── */
.wish-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .82rem;
  font-weight: 600;
  padding: 9px 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 18px;
}
.wish-sum-sep { color: var(--text-3); font-weight: 400; }
.wish-sum-must { color: var(--teal); }
.wish-sum-deal { color: var(--red); }

.wish-section { padding: 4px 0; }

.wish-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.wish-section-title {
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.wish-section-title.must { color: var(--teal); }
.wish-section-title.nice { color: var(--blue); }
.wish-section-title.deal { color: var(--red);  }
.wish-section-count {
  font-size: .72rem;
  color: var(--text-3);
}

/* Added item pills */
.wish-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  min-height: 4px; /* keeps layout stable when empty */
}
.wish-empty-hint {
  font-size: .78rem;
  color: var(--text-3);
  font-style: italic;
  margin: 0;
}
.wish-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 4px 11px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.3;
}
.wish-item.must { background: var(--teal-light); color: var(--teal); }
.wish-item.nice { background: var(--blue-light); color: var(--blue); }
.wish-item.deal { background: var(--red-light);  color: var(--red);  }

.wish-item-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1;
  opacity: .55;
  transition: opacity .15s;
  flex-shrink: 0;
  cursor: pointer;
}
.wish-item-del:hover { opacity: 1; }

/* Suggestion chips */
.wish-sugg-wrap { margin-bottom: 10px; }
.wish-sugg-label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  margin-bottom: 6px;
}
.wish-sugg-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.wish-sugg-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .74rem;
  font-weight: 600;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.wish-sugg-pill:hover,
.wish-sugg-pill:active {
  background: var(--teal-light);
  color: var(--teal);
  border-color: var(--teal);
}

/* Custom item input row */
.wish-custom-row {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.wish-custom-input {
  flex: 1;
  min-width: 0;
  font-size: .82rem;
  padding: 7px 10px;
  border-radius: 8px;
}

/* ─── Communication Log ──────────────────────────────────────── */
.comms-summary {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-2);
  padding: 9px 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.comms-summary.comms-warning {
  color: var(--red);
  background: var(--red-light);
}
.comms-warn-icon {
  font-size: .78rem;
  font-weight: 700;
}

/* Vertical guide line */
.comms-timeline {
  position: relative;
  padding-left: 2px;
}
.comms-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
  border-radius: 1px;
}

.comms-entry {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  position: relative;
}
.comms-entry:last-child { margin-bottom: 0; }

.comms-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
  position: relative;
  z-index: 1;
  border: 2.5px solid var(--surface);
  box-shadow: 0 0 0 1.5px var(--border);
}

.comms-body {
  flex: 1;
  min-width: 0;
}
.comms-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.comms-type {
  font-size: .84rem;
  font-weight: 700;
  flex-shrink: 0;
}
.comms-datetime {
  font-size: .75rem;
  color: var(--text-2);
  flex-shrink: 0;
}
.comms-duration {
  font-size: .7rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-2);
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.comms-del {
  margin-left: auto;
  color: var(--text-3);
  padding: 3px 6px;
}
.comms-del:hover { color: var(--red); }
.comms-notes {
  font-size: .85rem;
  color: var(--text);
  line-height: 1.55;
  background: var(--bg);
  padding: 8px 10px;
  border-radius: 6px;
  white-space: pre-wrap;
}

/* ─── Calendar — mobile: all 7 days always visible ──────────── */
@media (max-width: 600px) {
  .cal-grid {
    width: 100%;
    overflow: hidden;
    /* force equal columns — no cell can stretch beyond its 1/7 share */
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  .cal-day-header {
    font-size: 9px;
    padding: 5px 0;
    letter-spacing: 0;
  }
  .cal-cell {
    padding: 2px;
    min-height: 56px;
  }
  .cal-day-num {
    font-size: 10px;
    padding: 1px;
    margin-bottom: 2px;
  }
  /* today circle: shrink to fit the smaller cell */
  .cal-cell.today .cal-day-num {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }
  .cal-evt-pill {
    font-size: 9px;
    padding: 1px 2px;
    border-radius: 3px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL SEARCH
   ═══════════════════════════════════════════════════════════════ */

/* ─── Sidebar search trigger button ──────────────────────────── */
.search-sidebar-btn {
  margin-left: auto;
  flex-shrink: 0;
  padding: 5px 6px;
  border-radius: 6px;
  color: var(--text-2);
  transition: background .15s, color .15s;
  line-height: 0;
}
.search-sidebar-btn:hover { background: var(--bg); color: var(--teal); }

/* ─── Full-screen overlay backdrop ───────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 800;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 72px;
}
.search-overlay[hidden] { display: none !important; }

/* ─── Search panel card ───────────────────────────────────────── */
.search-panel {
  width: 100%;
  max-width: 620px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
  overflow: hidden;
  margin: 0 16px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.search-input-wrap > svg {
  width: 20px; height: 20px;
  stroke: var(--text-2);
  flex-shrink: 0;
}
.search-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 1.05rem;
  color: var(--text);
  outline: none;
}
.search-esc-btn {
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-3);
  border: 1.5px solid var(--border);
  border-radius: 5px;
  padding: 2px 8px;
  flex-shrink: 0;
  transition: color .15s, border-color .15s;
  letter-spacing: .04em;
}
.search-esc-btn:hover { color: var(--text-2); border-color: var(--text-3); }

/* ─── Results area ───────────────────────────────────────────── */
.search-results {
  overflow-y: auto;
  flex: 1;
}
.search-hint {
  padding: 28px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: .9rem;
}
.search-no-results {
  padding: 28px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: .9rem;
}
.search-no-results strong { color: var(--text-2); }

.search-group { padding: 6px 0 2px; }
.search-group + .search-group { border-top: 1px solid var(--border); }

.search-group-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 4px 18px 6px;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  cursor: pointer;
  transition: background .12s;
}
.search-item:hover { background: var(--bg); }

.search-item-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.search-item-icon svg { width: 16px; height: 16px; }

.search-item-text { flex: 1; min-width: 0; }
.search-item-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-item-sub {
  font-size: .76rem;
  color: var(--text-2);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-item-arrow {
  color: var(--text-3);
  flex-shrink: 0;
}

/* ─── Mobile search FAB ──────────────────────────────────────── */
.mobile-search-fab { display: none; }

@media (max-width: 600px) {
  .search-sidebar-btn { display: none; }

  .mobile-search-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: 14px;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 4px 14px rgba(29, 158, 117, .45);
    z-index: 50;
    transition: transform .15s, box-shadow .15s;
  }
  .mobile-search-fab:active { transform: scale(.93); }
  .mobile-search-fab svg {
    width: 20px; height: 20px;
    stroke: #fff;
  }

  .search-overlay { padding-top: 40px; }
  /* Account for home indicator so results don't get clipped */
  .search-panel { max-height: calc(100vh - 60px - env(safe-area-inset-bottom)); }
}

/* ═══════════════════════════════════════════════════════════════
   NOTIFICATION PERMISSION BANNER
   ═══════════════════════════════════════════════════════════════ */
.notif-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  transform: translateY(-110%);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
  /* Push down behind sidebar on desktop */
  padding-left: var(--sidebar-w);
}
@media (max-width: 768px) {
  .notif-banner { padding-left: 0; }
}
.notif-banner--visible {
  transform: translateY(0);
}
.notif-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--teal);
  color: #fff;
  padding: 12px 16px;
  box-shadow: 0 4px 16px rgba(29,158,117,.35);
}
.notif-banner-icon {
  flex-shrink: 0;
  opacity: .9;
}
.notif-banner-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.notif-banner-text strong {
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.2;
}
.notif-banner-text span {
  font-size: .8rem;
  opacity: .88;
  line-height: 1.3;
}
.notif-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.notif-banner-btn-enable {
  padding: 6px 16px;
  border-radius: 20px;
  border: 2px solid rgba(255,255,255,.8);
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.notif-banner-btn-enable:hover { background: rgba(255,255,255,.28); }
.notif-banner-btn-dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.15);
  color: #fff;
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}
.notif-banner-btn-dismiss:hover { background: rgba(255,255,255,.28); }

/* ═══════════════════════════════════════════════════════════════
   PUSH NOTIFICATIONS — Settings section
   ═══════════════════════════════════════════════════════════════ */
.notif-perm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.notif-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
}
.notif-status-chip.granted  { background: var(--green-light); color: #15803d; }
.notif-status-chip.denied   { background: var(--red-light);   color: var(--red); }
.notif-status-chip.default  { background: var(--amber-light); color: #92400e; }
.notif-status-chip.unsupported { background: var(--bg); color: var(--text-3); }

/* ═══════════════════════════════════════════════════════════════
   MORNING BRIEFING BUTTON (Leads page)
   ═══════════════════════════════════════════════════════════════ */
.morning-briefing-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--teal);
  color: #fff;
  border-radius: var(--radius);
  font-size: .98rem;
  font-weight: 700;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(29, 158, 117, .32);
  transition: background .15s, transform .1s, box-shadow .15s;
  letter-spacing: .01em;
}
.morning-briefing-btn svg { width: 18px; height: 18px; stroke: #fff; flex-shrink: 0; }
.morning-briefing-btn:hover  { background: var(--teal-dark); box-shadow: 0 6px 18px rgba(29,158,117,.4); }
.morning-briefing-btn:active { transform: scale(.98); }

/* ═══════════════════════════════════════════════════════════════
   MORNING BRIEFING OVERLAY
   ═══════════════════════════════════════════════════════════════ */
.briefing-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  /* push it behind the search overlay (z-index 800) and modal (z-index 1000) */
}
.briefing-overlay[hidden] { display: none !important; }

/* ─── Header ─────────────────────────────────────────────────── */
.briefing-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.briefing-title-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--teal);
  flex: 1;
  min-width: 0;
}
.briefing-title-wrap svg { width: 20px; height: 20px; stroke: var(--teal); flex-shrink: 0; }

.briefing-header-btns { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.briefing-regen-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: .84rem;
  font-weight: 600;
  background: var(--teal-light);
  color: var(--teal);
  transition: background .15s;
  white-space: nowrap;
}
.briefing-regen-btn:hover  { background: var(--border); }
.briefing-regen-btn:disabled { opacity: .45; pointer-events: none; }

.briefing-close-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--text-2);
  transition: background .15s, color .15s;
}
.briefing-close-btn:hover { background: var(--bg); color: var(--text); }

/* ─── Body / scroll area ─────────────────────────────────────── */
.briefing-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  /* Ensure last card clears the iPhone home indicator */
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

/* ─── Loading state ──────────────────────────────────────────── */
.briefing-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  gap: 18px;
}
.briefing-spinner {
  width: 42px; height: 42px;
  border: 3.5px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: briefing-spin .75s linear infinite;
}
@keyframes briefing-spin { to { transform: rotate(360deg); } }

#briefing-status {
  font-size: .9rem;
  color: var(--text-2);
  text-align: center;
  max-width: 280px;
  line-height: 1.5;
}

/* ─── Error state ────────────────────────────────────────────── */
.briefing-error {
  background: var(--red-light);
  color: var(--red);
  padding: 16px 18px;
  border-radius: var(--radius);
  font-size: .9rem;
  line-height: 1.55;
  margin-top: 20px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.briefing-no-key {
  background: var(--amber-light);
  color: #92400e;
  padding: 20px;
  border-radius: var(--radius);
  font-size: .9rem;
  line-height: 1.6;
  text-align: center;
  max-width: 480px;
  margin: 30px auto 0;
}
.briefing-no-key strong { display: block; font-size: 1rem; margin-bottom: 8px; }

/* ─── Section cards ──────────────────────────────────────────── */
.briefing-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 740px;
  margin: 0 auto;
}
.briefing-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.briefing-card-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  background: var(--teal);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.briefing-card-header svg { width: 14px; height: 14px; flex-shrink: 0; opacity: .9; }
.briefing-card-body {
  padding: 14px 16px;
  font-size: .9rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}

/* Greeting card — slightly larger text, gradient header */
.briefing-card.greeting .briefing-card-header {
  background: linear-gradient(135deg, var(--teal) 0%, #0f7a57 100%);
  padding: 13px 16px;
  font-size: .8rem;
}
.briefing-card.greeting .briefing-card-body {
  font-size: .97rem;
  font-weight: 500;
  padding: 16px;
}

/* Motivation card — italic closer */
.briefing-card.motivation .briefing-card-body {
  font-style: italic;
  font-size: .95rem;
  color: var(--teal);
  font-weight: 600;
  padding: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD VIEW
   ═══════════════════════════════════════════════════════════════ */
.dashboard-briefing-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  background: linear-gradient(135deg, var(--teal) 0%, #0f7a57 100%);
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  margin-bottom: 20px;
  box-shadow: 0 4px 18px rgba(29, 158, 117, .38);
  transition: opacity .15s, transform .1s;
  width: 100%;
  text-align: left;
}
.dashboard-briefing-card:hover  { opacity: .92; transform: translateY(-1px); }
.dashboard-briefing-card:active { transform: scale(.99); }
.dashboard-briefing-card > svg        { width: 44px; height: 44px; stroke: rgba(255,255,255,.88); flex-shrink: 0; }
.dashboard-briefing-card-text         { flex: 1; }
.dashboard-briefing-card-text h2      { font-size: 1.15rem; font-weight: 700; }
.dashboard-briefing-card-text p       { font-size: .84rem; opacity: .82; margin-top: 3px; line-height: 1.4; }
.dashboard-briefing-card .dash-arrow  { width: 20px; height: 20px; stroke: rgba(255,255,255,.7); flex-shrink: 0; }

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.dashboard-stat {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.dashboard-stat-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-2);
  margin-bottom: 7px;
}
.dashboard-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.dashboard-stat-value.teal { color: var(--teal); }
.dashboard-stat-value.red  { color: var(--red);  }

/* Agent name greeting */
.dashboard-greeting {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
}
.dashboard-date {
  font-size: .85rem;
  color: var(--text-2);
  margin-top: 3px;
}

/* ─── Responsive tweaks ──────────────────────────────────────── */
@media (max-width: 600px) {
  .briefing-header      { padding: 12px 14px; }
  .briefing-body        { padding: 12px; }
  .briefing-regen-btn span { display: none; }  /* icon only on mobile */

  .dashboard-briefing-card { padding: 18px; }
  .dashboard-briefing-card > svg { width: 34px; height: 34px; }
  .dashboard-briefing-card-text h2 { font-size: 1.05rem; }

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

/* Dark-mode overrides */
body.dark-mode .briefing-regen-btn { background: #1a1a1a; color: var(--teal); }
body.dark-mode .briefing-regen-btn:hover { background: #222; }

/* ═══════════════════════════════════════════════════════════════
   DAILY DASHBOARD — full layout
   ═══════════════════════════════════════════════════════════════ */

/* ─── Header row ─────────────────────────────────────────────── */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.dash-greeting {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.dash-subdate {
  font-size: .84rem;
  color: var(--text-2);
  margin-top: 3px;
}
.dash-briefing-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: var(--teal);
  color: #fff;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(29,158,117,.3);
  transition: background .15s, box-shadow .15s;
}
.dash-briefing-btn:hover  { background: var(--teal-dark); box-shadow: 0 4px 14px rgba(29,158,117,.4); }
.dash-briefing-btn:active { transform: scale(.97); }

/* ─── 4-tile stats row ───────────────────────────────────────── */
.dash-stats-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.dash-stat-tile {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.dash-stat-tile-label {
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-2);
  margin-bottom: 8px;
}
.dash-stat-tile-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}
.dash-stat-tile-value.teal { color: var(--teal); }
.dash-stat-tile-value.red  { color: var(--red);  }

/* ─── Generic section card ───────────────────────────────────── */
.dash-section {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.dash-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-2);
}
/* ── Dashboard SVG lockdown ──────────────────────────────────────
   SVGs without explicit inline width/height default to 300×150px
   in the browser, causing a giant-icon blowout. These rules pin
   every icon in the dashboard UI to safe, explicit dimensions.
   ────────────────────────────────────────────────────────────── */
.dash-section-head svg {
  width: 16px;
  height: 16px;
  min-width: 16px;
  max-width: 16px;
  stroke: var(--teal);
  flex-shrink: 0;
}
/* Also constrain the sun icon inside the Morning Briefing button */
.dash-briefing-btn svg {
  width: 16px;
  height: 16px;
  min-width: 16px;
  max-width: 16px;
  flex-shrink: 0;
}
.dash-section-count {
  margin-left: auto;
  background: var(--bg);
  color: var(--text-2);
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* ─── Schedule rows ──────────────────────────────────────────── */
.dash-event-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.dash-event-row:last-child { border-bottom: none; }
.dash-event-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dash-event-time { font-size: .78rem; font-weight: 700; color: var(--text-2); width: 40px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.dash-event-title { font-size: .88rem; font-weight: 600; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-event-type  { font-size: .72rem; color: var(--text-3); flex-shrink: 0; }

/* ─── Reminder rows ──────────────────────────────────────────── */
.dash-reminder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.dash-reminder-row:last-child { border-bottom: none; }
.dash-reminder-indicator { width: 3px; border-radius: 2px; align-self: stretch; flex-shrink: 0; min-height: 32px; }
.dash-reminder-text { flex: 1; min-width: 0; }
.dash-reminder-client { font-size: .87rem; font-weight: 700; color: var(--text); }
.dash-reminder-note   { font-size: .77rem; color: var(--text-2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-done-btn {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  color: var(--text-2);
  background: var(--bg);
  transition: border-color .12s, color .12s, background .12s;
}
.dash-done-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-light); }

/* ─── All-clear / empty states ───────────────────────────────── */
.dash-all-clear {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-size: .87rem;
  color: #15803d;
  font-weight: 600;
}
.dash-empty {
  padding: 14px 16px;
  font-size: .85rem;
  color: var(--text-3);
  font-style: italic;
}

/* ─── Hot lead cards ─────────────────────────────────────────── */
.dash-lead-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.dash-lead-card:last-child { border-bottom: none; }
.dash-lead-card:hover { background: var(--bg); }
.dash-lead-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--teal-light);
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800;
  flex-shrink: 0;
}
.dash-lead-info  { flex: 1; min-width: 0; }
.dash-lead-name  { font-size: .88rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dash-lead-meta  { font-size: .76rem; color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-lead-badge {
  font-size: .68rem; font-weight: 700;
  padding: 2px 7px; border-radius: 10px; flex-shrink: 0;
}
.dash-lead-badge.offer { background: #fef2f2; color: var(--red); }
.dash-lead-badge.cold  { background: var(--amber-light); color: #92400e; }
.dash-lead-open-btn {
  flex-shrink: 0;
  padding: 6px 11px;
  border-radius: 7px;
  font-size: .77rem; font-weight: 700;
  background: var(--bg);
  color: var(--text-2);
  border: 1.5px solid var(--border);
  transition: border-color .12s, color .12s;
}
.dash-lead-open-btn:hover { border-color: var(--teal); color: var(--teal); }

/* ─── Pipeline mini snapshot ─────────────────────────────────── */
.dash-pipeline-value {
  font-size: 1.5rem; font-weight: 800;
  color: var(--teal);
  padding: 14px 16px 4px;
}
.dash-pipeline-sub {
  font-size: .78rem; color: var(--text-2);
  padding: 0 16px 12px;
}
.dash-pipeline-bar {
  height: 12px;
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  margin: 0 16px 12px;
  background: var(--border);
  gap: 1px;
}
.dash-pipeline-bar-seg { height: 100%; min-width: 2px; }
.dash-pipeline-legend {
  display: flex; flex-wrap: wrap;
  gap: 8px 16px;
  padding: 0 16px 14px;
}
.dash-pipeline-legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: .75rem; color: var(--text-2);
}
.dash-pipeline-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 700px) {
  .dash-stats-4 { grid-template-columns: repeat(2, 1fr); }
  .dash-greeting { font-size: 1.25rem; }
  .dash-briefing-btn { padding: 9px 14px; font-size: .82rem; }
}
@media (max-width: 420px) {
  .dash-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .dash-briefing-btn { width: 100%; justify-content: center; }
}

/* ─── Dark-mode tweaks ───────────────────────────────────────── */
body.dark-mode .dash-lead-badge.offer { background: #2d1515; }
body.dark-mode .dash-lead-badge.cold  { background: #2d2010; }

/* ═══════════════════════════════════════════════════════════════
   GOAL TRACKER
   ═══════════════════════════════════════════════════════════════ */

/* ─── Section wrapper ────────────────────────────────────────── */
.goals-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 20px;
  overflow: hidden;
}
.goals-section-head {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

/* ─── Progress bars ──────────────────────────────────────────── */
.goal-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}
.goal-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .35s ease;
  min-width: 2px;
}
.goal-bar-fill-green { background: var(--teal); }
.goal-bar-fill-amber { background: #F59E0B; }
.goal-bar-fill-red   { background: var(--red); }

/* ─── Annual goals grid ──────────────────────────────────────── */
.goals-annual-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
}
.goals-annual-card {
  background: var(--surface);
  padding: 16px;
}
.goals-annual-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}
.goals-annual-icon   { font-size: 1.1rem; }
.goals-annual-metric { font-size: .78rem; font-weight: 600; color: var(--text-2); flex: 1; }
.goals-edit-btn      { flex-shrink: 0; font-size: .72rem !important; padding: 3px 8px !important; }
.goals-annual-nums   { display: flex; align-items: baseline; gap: 3px; margin-bottom: 2px; }
.goals-actual        { font-size: 1.3rem; font-weight: 800; color: var(--text-1); }
.goals-target        { font-size: .82rem; color: var(--text-3); }
.goals-annual-sub    { font-size: .71rem; color: var(--text-3); margin-top: 5px; }

/* ─── Monthly goals ──────────────────────────────────────────── */
.goals-month-current {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.goals-month-cur-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.goals-month-cur-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
  display: block;
}
.goals-month-cur-sub {
  font-size: .74rem;
  color: var(--teal);
  font-weight: 600;
}
.goals-month-cur-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.goals-month-cur-cell {}
.goals-month-cur-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-1);
}
.goals-month-cur-tgt {
  font-size: .75rem;
  font-weight: 400;
  color: var(--text-3);
  margin-left: 2px;
}
.goals-month-cur-metric {
  font-size: .73rem;
  color: var(--text-2);
  margin-bottom: 3px;
}

/* Past months list */
.goals-past-months { padding: 8px 16px 12px; }
.goals-past-month-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
}
.goals-past-month-row:last-child { border-bottom: none; }
.goals-past-month-name  { font-weight: 600; color: var(--text-1); min-width: 70px; }
.goals-past-month-stat  { color: var(--text-2); flex: 1; }
.goals-past-month-badge { font-size: .9rem; flex-shrink: 0; }
.goals-hit {}
.goals-miss {}

/* ─── Milestones grid ────────────────────────────────────────── */
.goals-milestones-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
}
.goals-milestone-badge {
  background: var(--surface);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  transition: background .15s;
}
.goals-milestone-icon  { font-size: 1.7rem; }
.goals-milestone-label {
  font-size: .72rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-2);
  line-height: 1.3;
}
.goals-milestone-check {
  position: absolute;
  top: 7px; right: 7px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.goals-milestone-unlocked {
  background: var(--teal-light, #f0fdfa);
  border: 1.5px solid rgba(29,158,117,.35);
  box-shadow: 0 2px 8px rgba(29,158,117,.12);
}
.goals-milestone-unlocked .goals-milestone-icon {
  filter: none;
}
.goals-milestone-label-earned {
  color: var(--teal-dark);
  font-weight: 700;
}
.goals-milestone-locked {
  opacity: .4;
  filter: grayscale(1);
}

/* ─── Insights grid ──────────────────────────────────────────── */
.goals-insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
}
.goals-insight-tile {
  background: var(--surface);
  padding: 16px 12px;
  text-align: center;
}
.goals-insight-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 4px;
}
.goals-insight-lbl {
  font-size: .72rem;
  color: var(--text-2);
  line-height: 1.3;
}

/* ─── Milestone unlock toast ─────────────────────────────────── */
.milestone-toast {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  background: var(--surface);
  border: 1.5px solid var(--teal);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  min-width: 220px;
}
.milestone-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.milestone-toast-icon  { font-size: 1.8rem; }
.milestone-toast-title { font-size: .75rem; color: var(--teal); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.milestone-toast-label { font-size: .95rem; font-weight: 700; color: var(--text-1); }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .goals-annual-grid    { grid-template-columns: 1fr; }
  .goals-milestones-grid{ grid-template-columns: repeat(3, 1fr); }
  .goals-insights-grid  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .goals-milestones-grid{ grid-template-columns: repeat(2, 1fr); }
}

/* ─── Dark mode ──────────────────────────────────────────────── */
body.dark-mode .goals-milestone-unlocked {
  background: #0d2926;
  border-color: rgba(29,158,117,.4);
  box-shadow: 0 2px 8px rgba(29,158,117,.08);
}
body.dark-mode .milestone-toast { box-shadow: 0 8px 32px rgba(0,0,0,.5); }

/* ─── Error toast ────────────────────────────────────────────── */
.error-toast {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  background: #FEF2F2;
  border: 1.5px solid #EF4444;
  color: #991B1B;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(239,68,68,.2);
  padding: 12px 18px;
  font-size: .9rem;
  font-weight: 600;
  z-index: 99999;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  max-width: min(90vw, 360px);
  text-align: center;
}
.error-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
body.dark-mode .error-toast {
  background: #3b1010;
  border-color: #EF4444;
  color: #FCA5A5;
}

/* ═══════════════════════════════════════════════════════════════
   VENDOR CONTACT BOOK
   ═══════════════════════════════════════════════════════════════ */

/* ─── Page header ────────────────────────────────────────────── */
.vendor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.vendor-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}
.vendor-subtitle {
  font-size: .82rem;
  color: var(--text-2);
  margin-top: 3px;
}
.vendor-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: var(--teal);
  color: #fff;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(29,158,117,.3);
  transition: background .15s, box-shadow .15s;
}
.vendor-add-btn:hover  { background: var(--teal-dark); box-shadow: 0 4px 14px rgba(29,158,117,.4); }
.vendor-add-btn:active { transform: scale(.97); }

/* ─── Search ─────────────────────────────────────────────────── */
.vendor-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 14px;
  margin-bottom: 14px;
}
.vendor-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: .9rem;
  color: var(--text);
  outline: none;
}
.vendor-search-input::placeholder { color: var(--text-3); }
.vendor-search-clear {
  font-size: 1.1rem;
  color: var(--text-3);
  line-height: 1;
  padding: 0 2px;
  transition: color .15s;
}
.vendor-search-clear:hover { color: var(--text); }

/* ─── Category filter tabs ───────────────────────────────────── */
.vendor-cat-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.vendor-cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1.5px solid var(--border);
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
  cursor: pointer;
}
.vendor-cat-tab:hover { border-color: var(--teal); color: var(--teal); }
.vendor-cat-tab.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.vendor-cat-count {
  background: rgba(255,255,255,.28);
  border-radius: 10px;
  padding: 0 6px;
  font-size: .7rem;
  font-weight: 700;
}
.vendor-cat-tab:not(.active) .vendor-cat-count {
  background: var(--bg);
  color: var(--text-3);
}

/* ─── Card grid ──────────────────────────────────────────────── */
.vendor-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* ─── Individual card ────────────────────────────────────────── */
.vendor-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, border-color .15s;
}
.vendor-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.1); }
.vendor-card.is-fav { border-color: var(--teal); }

/* ─── Card top row ───────────────────────────────────────────── */
.vendor-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.vendor-card-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.vendor-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: .8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.vendor-name-wrap { min-width: 0; }
.vendor-name {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vendor-company {
  font-size: .76rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vendor-card-top-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

/* ─── Category pill ──────────────────────────────────────────── */
.vendor-cat-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: .68rem;
  font-weight: 700;
  background: var(--vcp-bg);
  color: var(--vcp-text);
  white-space: nowrap;
  letter-spacing: .02em;
}

/* ─── Favorite button ────────────────────────────────────────── */
.vendor-fav-btn {
  color: var(--text-3);
  transition: color .15s, transform .15s;
  padding: 2px;
}
.vendor-fav-btn:hover  { transform: scale(1.2); }
.vendor-fav-btn.active { color: var(--teal); }

/* ─── Contact links row ──────────────────────────────────────── */
.vendor-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.vendor-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.vendor-contact-link:hover { text-decoration: underline; }

/* ─── Star ratings ───────────────────────────────────────────── */
.vendor-stars-row {
  display: flex;
  gap: 2px;
}
.vendor-star {
  font-size: 1rem;
  color: var(--border);
  line-height: 1;
  transition: color .1s, transform .1s;
  padding: 0 1px;
}
.vendor-star:hover,
.vendor-star.filled { color: #F59E0B; }
.vendor-star:hover  { transform: scale(1.2); }

/* ─── Notes ──────────────────────────────────────────────────── */
.vendor-notes {
  font-size: .78rem;
  color: var(--text-2);
  line-height: 1.5;
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--teal);
}

/* ─── Quick action buttons ───────────────────────────────────── */
.vendor-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.vendor-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: .74rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--border);
  color: var(--text-2);
  background: var(--surface);
  transition: background .13s, color .13s, border-color .13s;
  cursor: pointer;
  white-space: nowrap;
}
.vendor-action-btn:hover      { background: var(--bg); color: var(--text); }
.vendor-action-btn.call:hover { border-color: var(--teal); color: var(--teal); background: #f0fdf9; }
.vendor-action-btn.email:hover{ border-color: #3B82F6;     color: #3B82F6;    background: #EFF6FF; }
.vendor-action-btn.delete:hover{ border-color: var(--red); color: var(--red); background: #fef2f2; }

/* ─── Empty state ────────────────────────────────────────────── */
.vendor-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--text-2);
  font-size: .95rem;
  font-weight: 600;
}
.vendor-empty-sub {
  font-size: .82rem;
  font-weight: 400;
  color: var(--text-3);
}

/* ─── Dark mode ──────────────────────────────────────────────── */
body.dark-mode .vendor-cat-pill {
  background: var(--vcp-dark-bg, #1a1a1a);
}
body.dark-mode .vendor-action-btn.call:hover  { background: #0a2922; }
body.dark-mode .vendor-action-btn.email:hover { background: #0d1e3d; }
body.dark-mode .vendor-action-btn.delete:hover{ background: #2d0a0a; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .vendor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .vendor-header { gap: 10px; }
  .vendor-add-btn { width: 100%; justify-content: center; }
  .vendor-grid { grid-template-columns: 1fr; gap: 12px; }
  .vendor-cat-tabs { gap: 5px; }
}

/* ═══════════════════════════════════════════════════════════════
   ONBOARDING FLOW
   ═══════════════════════════════════════════════════════════════ */

/* ─── Full-screen backdrop ───────────────────────────────────── */
.ob-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.ob-overlay[hidden] { display: none !important; }

/* ─── Card ───────────────────────────────────────────────────── */
.ob-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.13);
  width: 100%;
  max-width: 500px;
  padding: 40px 40px 36px;
  animation: ob-in .3s cubic-bezier(.22,1,.36,1);
}
@keyframes ob-in {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Progress indicator ─────────────────────────────────────── */
.ob-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
}
.ob-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background .25s, transform .25s;
  flex-shrink: 0;
}
.ob-dot.active {
  background: var(--teal);
  transform: scale(1.25);
}
.ob-dot.done {
  background: var(--teal);
  opacity: .45;
}
.ob-step-label {
  margin-left: auto;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: .04em;
}

/* ─── Logo ───────────────────────────────────────────────────── */
.ob-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.ob-logo-wordmark {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: -.02em;
}

/* ─── Typography ─────────────────────────────────────────────── */
.ob-headline {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 8px;
}
.ob-sub {
  font-size: .9rem;
  color: var(--text-2);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ─── Form fields ────────────────────────────────────────────── */
.ob-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}
.ob-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ob-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ob-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.ob-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: .95rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.ob-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(29,158,117,.15);
}
.ob-input::placeholder { color: var(--text-3); }
.ob-select { cursor: pointer; appearance: auto; }

/* ─── Actions ────────────────────────────────────────────────── */
.ob-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.ob-btn-primary {
  padding: 12px 28px;
  background: var(--teal);
  color: #fff;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 700;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 2px 12px rgba(29,158,117,.3);
  min-width: 130px;
}
.ob-btn-primary:hover  { background: var(--teal-dark); box-shadow: 0 4px 16px rgba(29,158,117,.4); }
.ob-btn-primary:active { transform: scale(.97); }
.ob-btn-secondary {
  padding: 12px 20px;
  background: var(--bg);
  color: var(--text-2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
}
.ob-btn-secondary:hover { background: var(--surface); color: var(--text); border-color: var(--text-3); }

/* ─── Step 3: live calc preview ──────────────────────────────── */
.ob-calc-preview {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ob-calc-title {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}
.ob-calc-row {
  display: flex;
  justify-content: space-between;
  font-size: .88rem;
  color: var(--text-2);
}
.ob-calc-net {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--teal);
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 2px;
}

/* ─── Success screen ─────────────────────────────────────────── */
.ob-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0 8px;
}
.ob-success-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 12px rgba(29,158,117,.15);
  animation: ob-pop .5s cubic-bezier(.22,1,.36,1);
}
@keyframes ob-pop {
  0%   { transform: scale(0); opacity: 0; }
  70%  { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

/* ─── Dark mode ──────────────────────────────────────────────── */
body.dark-mode .ob-card { box-shadow: 0 24px 64px rgba(0,0,0,.4); }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 540px) {
  .ob-card { padding: 28px 20px 24px; border-radius: 16px; }
  .ob-headline { font-size: 1.25rem; }
  .ob-row { grid-template-columns: 1fr; gap: 16px; }
  .ob-btn-primary { min-width: 0; flex: 1; }
  .ob-actions { flex-direction: row; }
}

/* ═══════════════════════════════════════════════════════════════
   AUTH SCREEN
   ═══════════════════════════════════════════════════════════════ */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}

.auth-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 40px 36px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,.12);
  animation: ob-slide-up .4s cubic-bezier(.22,1,.36,1);
}

/* ─── Logo / wordmark ─────────────────────────────────────────── */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}
.auth-wordmark {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.3px;
}

/* ─── Tabs ───────────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.auth-tab:hover:not(.active) { color: var(--text); }

/* ─── Alert banners ──────────────────────────────────────────── */
.auth-error,
.auth-info {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .85rem;
  line-height: 1.45;
  margin-bottom: 16px;
}
.auth-error { background: var(--red-light);  color: var(--red); }
.auth-info  { background: var(--teal-light); color: var(--teal-dark); }

/* ─── Inputs ─────────────────────────────────────────────────── */
.auth-fields { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.auth-field { display: flex; flex-direction: column; gap: 4px; }
.auth-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.auth-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(29,158,117,.12);
}

/* ─── Submit button ──────────────────────────────────────────── */
.auth-submit-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, opacity .15s, transform .1s;
  margin-bottom: 16px;
}
.auth-submit-btn:hover  { background: var(--teal-dark); }
.auth-submit-btn:active { transform: scale(.98); }
.auth-submit-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

/* ─── Switch link ────────────────────────────────────────────── */
.auth-switch {
  text-align: center;
  font-size: .84rem;
  color: var(--text-2);
  margin: 0;
}
.auth-switch-link {
  color: var(--teal);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-switch-link:hover { color: var(--teal-dark); }

/* ─── Dark mode ──────────────────────────────────────────────── */
body.dark-mode .auth-card  { box-shadow: 0 24px 64px rgba(0,0,0,.4); }
body.dark-mode .auth-tab.active { background: var(--surface); }
body.dark-mode .auth-input { background: var(--surface); }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 420px) {
  .auth-card { padding: 28px 20px 24px; border-radius: 16px; }
  .auth-wordmark { font-size: 1.15rem; }
}

/* ═══════════════════════════════════════════════════════════════
   PRICING / PAYWALL PAGE
   ═══════════════════════════════════════════════════════════════ */

#pricing-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: var(--bg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pricing-page {
  width: 100%;
  max-width: 480px;
  padding: 24px 16px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ─── Header row ─────────────────────────────────────────────── */
.pricing-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.pricing-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
}

.pricing-signout-link {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: .82rem;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pricing-signout-link:hover { color: var(--text); }

/* ─── Main card ──────────────────────────────────────────────── */
.pricing-card {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,.07);
}

.pricing-badge {
  display: inline-block;
  background: var(--teal-light);
  color: var(--teal-dark);
  border: 1.5px solid rgba(29,158,117,.25);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.pricing-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -.5px;
}

.pricing-subtitle {
  font-size: .92rem;
  color: var(--text-2);
  margin: 0 0 28px;
  line-height: 1.5;
}

/* ─── Price display ──────────────────────────────────────────── */
.pricing-amount {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  margin-bottom: 8px;
  line-height: 1;
}

.pricing-currency {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 8px;
}

.pricing-number {
  font-size: 4rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -2px;
}

.pricing-period {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-2);
  align-self: flex-end;
  margin-bottom: 10px;
}

.pricing-trial-note {
  font-size: .82rem;
  color: var(--text-2);
  margin: 0 0 28px;
}

/* ─── CTA button ─────────────────────────────────────────────── */
.pricing-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 24px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 4px 16px rgba(29,158,117,.3);
  margin-bottom: 14px;
}

.pricing-cta:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(29,158,117,.4);
}

.pricing-cta:active { transform: translateY(0); box-shadow: none; }
.pricing-cta:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── Secure note ────────────────────────────────────────────── */
.pricing-secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--text-2);
  margin: 0 0 10px;
}

/* ─── Legal consent text (below secure note) ─────────────────── */
.pricing-legal-consent {
  font-size: .75rem;
  color: var(--text-3);
  text-align: center;
  margin: 0 0 24px;
}
.pricing-legal-consent a {
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
  transition: color .15s;
}
.pricing-legal-consent a:hover { color: var(--teal); }

/* ─── Feature list ───────────────────────────────────────────── */
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  border-top: 1.5px solid var(--border);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: .88rem;
  color: var(--text);
  line-height: 1.45;
}

.pricing-features li svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--teal);
  stroke: var(--teal);
  margin-top: 1px;
}

/* ─── Dark mode adjustments ──────────────────────────────────── */
body.dark-mode .pricing-card {
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
}
body.dark-mode .pricing-cta {
  box-shadow: 0 4px 16px rgba(29,158,117,.2);
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 420px) {
  .pricing-card { padding: 28px 20px 24px; border-radius: 16px; }
  .pricing-title { font-size: 1.5rem; }
  .pricing-number { font-size: 3.2rem; }
}
