:root {
  --ink: #14223a;
  --muted: #63728a;
  --line: #d9e4ef;
  --panel: #ffffff;
  --wash: #f3f8fc;
  --teal: #166f78;
  --teal-dark: #0f4c5a;
  --orange: #f47721;
  --gold: #f5b82e;
  --green: #16a46b;
  --red: #ef4444;
  --shadow: 0 18px 44px rgba(21, 34, 58, .08);
}

* { box-sizing: border-box; }
body {
  background: linear-gradient(180deg, #eef6fb 0%, #f8fbfe 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
}
a { color: inherit; }
.topbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(20,34,58,.06);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 78px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  align-items: center;
  display: inline-flex;
  gap: 12px;
  text-decoration: none;
}
.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--teal), var(--orange));
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-weight: 950;
  height: 46px;
  justify-content: center;
  letter-spacing: .02em;
  width: 46px;
}
.brand strong { display: block; font-size: 18px; line-height: 1; }
.brand small { color: var(--muted); display: block; font-size: 12px; font-weight: 850; margin-top: 4px; }
.main-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.main-nav a,
.btn,
.nav-toggle {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 900;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  text-decoration: none;
}
.main-nav a { color: #344156; }
.main-nav a.active,
.main-nav a:hover {
  background: #e9f6f7;
  color: var(--teal-dark);
}
.main-nav a.nav-alert.hot {
  background: #fff4ce;
  border-color: #f8d36a;
  color: #8a5a00;
  position: relative;
}
.main-nav a.nav-alert.hot::after {
  background: var(--red);
  border: 2px solid #fff;
  border-radius: 999px;
  content: "";
  height: 10px;
  position: absolute;
  right: 7px;
  top: 6px;
  width: 10px;
}
.nav-toggle { display: none; background: #fff; border-color: var(--line); }
.page-shell {
  margin: 0 auto;
  max-width: 1520px;
  padding: 28px;
}
.page-title {
  align-items: flex-end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 22px;
}
.eyebrow {
  color: var(--orange);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .22em;
  margin: 0 0 8px;
  text-transform: uppercase;
}
h1 { font-size: clamp(34px, 5vw, 58px); line-height: .96; margin: 0; }
h2 { font-size: 24px; margin: 0; }
h3 { margin: 0 0 8px; }
.user-chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 190px;
  padding: 14px 16px;
}
.user-chip span { color: var(--muted); display: block; font-size: 13px; font-weight: 800; text-transform: capitalize; }
.panel,
.metric-card,
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.panel { margin-bottom: 22px; padding: 22px; }
.panel-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin: -2px 0 20px;
  padding-bottom: 14px;
}
.panel-head span { color: var(--muted); font-weight: 850; }
.dashboard-hero {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(22,111,120,.97), rgba(20,34,58,.97)),
    radial-gradient(circle at top right, rgba(244,119,33,.24), transparent 34%);
  border-color: rgba(255,255,255,.16);
  color: #fff;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .72fr);
  overflow: hidden;
}
.dashboard-hero .eyebrow { color: #ffd18a; }
.dashboard-hero h2 {
  font-size: clamp(32px, 4vw, 54px);
  letter-spacing: 0;
  line-height: .96;
}
.dashboard-hero p:not(.eyebrow) {
  color: rgba(255,255,255,.82);
  font-size: 17px;
  font-weight: 750;
  line-height: 1.55;
  max-width: 760px;
}
.hero-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.hero-stats a {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  color: #fff;
  min-height: 116px;
  padding: 16px;
  text-decoration: none;
}
.hero-stats strong {
  display: block;
  font-size: 42px;
  line-height: 1;
}
.hero-stats span {
  color: rgba(255,255,255,.76);
  display: block;
  font-weight: 900;
  margin-top: 8px;
}
.metric-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}
.metric-card {
  color: var(--ink);
  display: block;
  min-height: 136px;
  overflow: hidden;
  padding: 20px;
  position: relative;
  text-decoration: none;
}
.metric-card::before {
  background: var(--card-accent, var(--teal));
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  top: 0;
  width: 8px;
}
.metric-card::after {
  background: var(--card-soft, rgba(22,111,120,.1));
  border-radius: 999px;
  content: "";
  height: 88px;
  position: absolute;
  right: -32px;
  top: -32px;
  width: 88px;
}
.metric-card span { color: var(--muted); font-weight: 900; text-transform: uppercase; }
.metric-card strong {
  display: block;
  font-size: clamp(34px, 4vw, 48px);
  line-height: .95;
  margin: 10px 0;
  position: relative;
  z-index: 1;
}
.metric-card small { color: var(--muted); font-weight: 750; }
.metric-card.total { --card-accent: var(--teal); --card-soft: rgba(22,111,120,.12); }
.metric-card.hot { --card-accent: var(--red); --card-soft: rgba(239,68,68,.12); }
.metric-card.warn { --card-accent: var(--gold); --card-soft: rgba(245,184,46,.18); }
.metric-card.offer { --card-accent: #7c3aed; --card-soft: rgba(124,58,237,.12); }
.metric-card.value { --card-accent: #16a34a; --card-soft: rgba(22,163,74,.12); }
.metric-card.call { --card-accent: #0284c7; --card-soft: rgba(2,132,199,.12); }
.metric-card.message { --card-accent: #14b8a6; --card-soft: rgba(20,184,166,.14); }
.metric-card.status-change { --card-accent: #f97316; --card-soft: rgba(249,115,22,.14); }
.dashboard-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .7fr);
}
.dashboard-grid-wide { grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr); }
.stage-list { display: grid; gap: 12px; }
.stage-row {
  align-items: center;
  color: var(--ink);
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto auto;
  padding: 8px 0;
  text-decoration: none;
}
.stage-row span { font-size: 18px; font-weight: 950; }
.stage-row strong { font-size: 20px; }
.stage-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 950;
}
.stage-row i {
  background: #e7eef5;
  border-radius: 999px;
  grid-column: 1 / -1;
  height: 12px;
  overflow: hidden;
}
.stage-row i b {
  background: linear-gradient(90deg, var(--stage-accent, var(--teal)), var(--orange));
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 18px;
}
.status-panel {
  display: grid;
}
.status-donut {
  align-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  justify-items: center;
  margin: 4px auto 18px;
  max-width: 260px;
  position: relative;
  width: min(78%, 260px);
}
.status-donut::after {
  background: #fff;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line);
  content: "";
  height: 62%;
  position: absolute;
  width: 62%;
}
.status-donut strong,
.status-donut span {
  position: relative;
  z-index: 1;
}
.status-donut strong { font-size: 52px; line-height: .9; }
.status-donut span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}
.status-legend {
  display: grid;
  gap: 8px;
}
.status-dot {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr auto;
  min-height: 44px;
  padding: 9px 10px;
  text-decoration: none;
}
.status-dot i {
  background: #64748b;
  border-radius: 999px;
  display: block;
  height: 12px;
  width: 12px;
}
.status-dot.status-hot i { background: var(--red); }
.status-dot.status-warm i { background: var(--gold); }
.status-dot.status-nurture i { background: var(--green); }
.status-dot.status-cold i { background: #0ea5e9; }
.status-dot span,
.status-dot strong { font-weight: 950; }
.county-chart {
  display: grid;
  gap: 14px;
}
.county-chart a {
  color: var(--ink);
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  text-decoration: none;
}
.county-chart span,
.county-chart strong { font-weight: 950; }
.county-chart i {
  background: #e7eef5;
  border-radius: 999px;
  grid-column: 1 / -1;
  height: 14px;
  overflow: hidden;
}
.county-chart b {
  background: linear-gradient(90deg, var(--teal), #22c55e);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 18px;
}
.source-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.source-grid.upgraded { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.source-grid a {
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
}
.source-grid strong { display: block; font-size: 30px; }
.source-grid span { color: var(--muted); font-weight: 850; }
.activity-grid,
.offer-flow {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.activity-grid a,
.offer-flow a {
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 98px;
  padding: 16px;
  text-decoration: none;
}
.activity-grid strong,
.offer-flow strong {
  display: block;
  font-size: 36px;
  line-height: 1;
}
.activity-grid span,
.offer-flow span {
  color: var(--muted);
  display: block;
  font-weight: 900;
  margin-top: 8px;
}
.offer-flow a:nth-child(1) { border-top: 5px solid #14b8a6; }
.offer-flow a:nth-child(2) { border-top: 5px solid #22c55e; }
.offer-flow a:nth-child(3) { border-top: 5px solid #2563eb; }
.offer-flow a:nth-child(4) { border-top: 5px solid #16a34a; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; min-width: 980px; width: 100%; }
th {
  background: #edf4f8;
  color: #59697f;
  font-size: 12px;
  letter-spacing: .14em;
  text-align: left;
  text-transform: uppercase;
}
td, th { border-bottom: 1px solid var(--line); padding: 14px 12px; }
td span { color: var(--muted); display: block; font-weight: 750; }
.lead-row { cursor: pointer; }
.lead-row:hover { background: #f8fbfd; }
.lead-row a { text-decoration: none; }
.filter-bar {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1fr) repeat(4, minmax(160px, .55fr)) auto;
  margin-bottom: 18px;
}
input, select, textarea {
  background: #fff;
  border: 1px solid #c9d8e6;
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  min-height: 46px;
  padding: 10px 12px;
  width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
label { color: var(--ink); display: grid; gap: 7px; font-weight: 900; }
.check-row {
  align-items: center;
  display: flex;
  font-size: 14px;
  gap: 10px;
}
.check-row input {
  height: 18px;
  min-height: 18px;
  width: 18px;
}
.form-grid,
.quick-form {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.lead-form { display: grid; gap: 16px; }
.btn {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}
.btn-primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.btn-danger {
  background: #fff5f5;
  border-color: #fecaca;
  color: #b91c1c;
}
.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
.btn-small { font-size: 13px; min-height: 34px; padding: 7px 10px; }
.inline-form { display: inline; }
.autosave-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  margin: 0;
  min-height: 18px;
}
.autosave-status.is-saving { color: #8a5a00; }
.autosave-status.is-saved { color: #166534; }
.autosave-status.is-error { color: #b91c1c; }
.pill,
.stage-pill,
.status {
  border-radius: 999px;
  display: inline-flex;
  font-weight: 950;
  padding: 7px 12px;
}
.stage-pill {
  background: var(--stage-bg, #e9f6f7);
  border: 1px solid var(--stage-border, #bee3e5);
  color: var(--stage-ink, var(--teal-dark));
}
.status { background: #eef3f7; color: #4c5d73; }
.status.hot { background: #fee2e2; color: #991b1b; }
.status.warm { background: #fff4ce; color: #8a5a00; }
.status.nurture { background: #dcfce7; color: #166534; }
.status.cold { background: #e0f2fe; color: #075985; }
.status.do-not-call,
.status.dead { background: #f1f5f9; color: #64748b; }
.deal-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), #fff),
    linear-gradient(90deg, var(--stage-accent, var(--orange)), transparent 50%);
  border-top: 8px solid var(--stage-accent, var(--muted));
  overflow: hidden;
  position: relative;
}
.deal-panel.status-hot,
.lead-hero.status-hot { border-color: #ef4444; }
.deal-panel.status-warm,
.lead-hero.status-warm { border-color: #f59e0b; }
.deal-panel.status-nurture,
.lead-hero.status-nurture { border-color: #16a46b; }
.deal-panel.status-cold,
.lead-hero.status-cold { border-color: #0ea5e9; }
.deal-panel.status-do-not-call,
.lead-hero.status-do-not-call,
.deal-panel.status-dead,
.lead-hero.status-dead { border-color: #64748b; }
.stage-new-lead {
  --stage-bg: #e0f2fe;
  --stage-border: #93c5fd;
  --stage-ink: #075985;
  --stage-accent: #0284c7;
}
.stage-attempting-contact {
  --stage-bg: #fef3c7;
  --stage-border: #facc15;
  --stage-ink: #854d0e;
  --stage-accent: #eab308;
}
.stage-contacted {
  --stage-bg: #ede9fe;
  --stage-border: #c4b5fd;
  --stage-ink: #5b21b6;
  --stage-accent: #7c3aed;
}
.stage-property-info-needed {
  --stage-bg: #ffedd5;
  --stage-border: #fdba74;
  --stage-ink: #9a3412;
  --stage-accent: #f97316;
}
.stage-offer-review {
  --stage-bg: #ccfbf1;
  --stage-border: #5eead4;
  --stage-ink: #115e59;
  --stage-accent: #14b8a6;
}
.stage-offer-sent {
  --stage-bg: #dcfce7;
  --stage-border: #86efac;
  --stage-ink: #166534;
  --stage-accent: #22c55e;
}
.stage-follow-up {
  --stage-bg: #fae8ff;
  --stage-border: #f0abfc;
  --stage-ink: #86198f;
  --stage-accent: #d946ef;
}
.stage-under-contract {
  --stage-bg: #dbeafe;
  --stage-border: #93c5fd;
  --stage-ink: #1d4ed8;
  --stage-accent: #2563eb;
}
.stage-closed-won {
  --stage-bg: #dcfce7;
  --stage-border: #4ade80;
  --stage-ink: #14532d;
  --stage-accent: #16a34a;
}
.stage-closed-lost {
  --stage-bg: #f1f5f9;
  --stage-border: #cbd5e1;
  --stage-ink: #334155;
  --stage-accent: #64748b;
}
.deal-panel[class*="stage-"] {
  border-top-color: var(--stage-accent);
}
.deal-head { margin-bottom: 16px; }
.deal-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}
.deal-chip {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72), 0 10px 20px rgba(15,35,60,.05);
  min-height: 78px;
  overflow: hidden;
  padding: 12px;
  position: relative;
}
.deal-chip::before {
  background: var(--chip-accent, var(--teal));
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  top: 0;
  width: 6px;
}
.deal-chip span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .12em;
  margin-bottom: 7px;
  text-transform: uppercase;
}
.deal-chip strong {
  display: block;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.05;
}
.stage-chip,
.stage-mini,
.stage-select {
  background: var(--stage-bg, #e9f6f7);
  border-color: var(--stage-border, #bee3e5);
  color: var(--stage-ink, var(--teal-dark));
}
.stage-chip { --chip-accent: var(--stage-accent, var(--teal)); padding-left: 18px; }
.status-chip.status-hot,
.status-badge.status-hot,
.status-select.status-hot { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.status-chip.status-warm,
.status-badge.status-warm,
.status-select.status-warm { background: #fff4ce; border-color: #f8d778; color: #8a5a00; }
.status-chip.status-nurture,
.status-badge.status-nurture,
.status-select.status-nurture { background: #dcfce7; border-color: #9be7b7; color: #166534; }
.status-chip.status-cold,
.status-badge.status-cold,
.status-select.status-cold { background: #e0f2fe; border-color: #93c5fd; color: #075985; }
.status-chip.status-do-not-call,
.status-badge.status-do-not-call,
.status-select.status-do-not-call,
.status-chip.status-dead,
.status-badge.status-dead,
.status-select.status-dead { background: #f1f5f9; border-color: #cbd5e1; color: #334155; }
.status-chip { --chip-accent: currentColor; padding-left: 18px; }
.disposition-chip { --chip-accent: #f97316; background: #fff7ed; color: #9a3412; padding-left: 18px; }
.offer-chip { --chip-accent: #16a34a; background: #ecfdf5; color: #166534; padding-left: 18px; }
.pipeline-meter {
  background: #e7eef5;
  border-radius: 999px;
  height: 12px;
  margin: 0 0 18px;
  overflow: hidden;
}
.pipeline-meter i {
  background: linear-gradient(90deg, var(--stage-accent, var(--teal)), var(--orange));
  border-radius: inherit;
  display: block;
  height: 100%;
}
.deal-form {
  align-items: end;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.control-field { gap: 8px; }
.control-field select,
.control-field input { font-weight: 950; }
.lead-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}
.status-badge,
.mini-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 950;
  padding: 7px 11px;
}
.mini-badge {
  background: #f8fbfd;
  color: var(--muted);
}
.lead-layout {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(340px, min(440px, 36vw));
  max-width: 100%;
  overflow-x: clip;
}
.lead-main,
.lead-side,
.panel,
.timeline,
.timeline article {
  min-width: 0;
}
.lead-main,
.lead-side {
  max-width: 100%;
}
.lead-hero {
  align-items: flex-start;
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(248,251,253,.98));
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 20px;
}
.lead-hero > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}
.lead-hero h2 {
  font-size: clamp(32px, 3.8vw, 46px);
  line-height: 1;
  margin-bottom: 4px;
}
.lead-address-highlight {
  background:
    linear-gradient(135deg, rgba(244,119,33,.13), rgba(22,111,120,.06)),
    #fffaf4;
  border: 1px solid rgba(244,119,33,.38);
  border-left: 6px solid var(--orange);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(244,119,33,.1);
  display: grid;
  gap: 5px;
  margin-top: 12px;
  max-width: 760px;
  padding: 12px 14px;
}
.lead-address-highlight span {
  color: #a64f0f;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.lead-address-highlight strong {
  color: var(--ink);
  display: block;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.18;
}
.lead-actions {
  align-content: flex-start;
  align-items: center;
  display: grid;
  flex: 0 0 min(420px, 42%);
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.lead-actions .btn {
  min-height: 48px;
  padding: 10px 12px;
  width: 100%;
}
.lead-actions form {
  margin: 0;
}
.lead-actions form .btn {
  height: 100%;
}
.deal-autosave-status {
  align-self: center;
  grid-column: 1 / -1;
}
.comm-form,
.task-form {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}
.comm-form {
  grid-template-columns: 140px 140px 1fr;
}
.comm-form textarea,
.comm-form button { grid-column: 1 / -1; }
.timeline {
  display: grid;
  gap: 14px;
}
.timeline article,
.task-item,
.queue-card,
.user-row {
  background: #fbfdff;
  border: 1px solid var(--line);
  border-left: 6px solid var(--teal);
  border-radius: 8px;
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 14px;
  text-decoration: none;
}
.timeline article span,
.task-item span,
.queue-card span,
.fine-print {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.timeline article p { color: #53647a; font-weight: 700; line-height: 1.55; }
.timeline article a { color: var(--teal); display: inline-flex; font-weight: 950; margin-left: 10px; }
.dialer-card iframe,
.wide-dialer {
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 620px;
  width: 100%;
}
.justcall-station { display: grid; gap: 14px; }
.quick-action-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.quick-action-row.compact {
  grid-template-columns: minmax(0, 1fr) auto;
}
.dialer-status {
  background: #edf4f8;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #4c5d73;
  font-size: 13px;
  font-weight: 950;
  padding: 10px 12px;
}
.dialer-status[data-tone="ready"] { background: #dcfce7; border-color: #9be7b7; color: #166534; }
.dialer-status[data-tone="warn"] { background: #fff4ce; border-color: #f8d778; color: #8a5a00; }
.justcall-sdk-mount {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 620px;
  overflow: hidden;
}
.justcall-sdk-mount iframe {
  border: 0;
  display: block;
  height: 620px;
  width: 100%;
}
.sms-box {
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}
.whatsapp-box {
  border-color: #b7e6c7;
  background: #f7fff9;
}
.whatsapp-box .sms-message.outbound {
  background: #dcfce7;
  border-color: #9be7b7;
}
.whatsapp-box .sms-message.inbound {
  border-color: #b7e6c7;
}
.sms-box-head {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}
.sms-box-head h3 { margin: 0; }
.sms-box-head span { color: var(--muted); font-size: 13px; font-weight: 850; }
.sms-api-state {
  border-radius: 8px;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 950;
  padding: 7px 9px;
  text-transform: uppercase;
}
.sms-api-state.ready { background: #dcfce7; color: #166534; }
.sms-api-state.needs-setup { background: #fff4ce; color: #8a5a00; }
.sms-thread {
  background: #f5f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  max-height: 360px;
  overflow-y: auto;
  padding: 12px;
}
.sms-empty {
  color: var(--muted);
  font-weight: 850;
  padding: 12px;
  text-align: center;
}
.sms-message {
  border-radius: 8px;
  margin: 6px 0;
  max-width: 86%;
  padding: 10px 12px;
}
.sms-message span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 850;
  margin-bottom: 5px;
}
.sms-message p { font-weight: 800; line-height: 1.45; margin: 0; }
.sms-message.inbound {
  background: #fff;
  border: 1px solid var(--line);
  justify-self: start;
}
.sms-message.outbound {
  background: #dff8f8;
  border: 1px solid #9edfe2;
  justify-self: end;
}
.sms-form {
  display: grid;
  gap: 8px;
}
.empty-state {
  background: #f6fafc;
  border: 1px dashed #bad0e0;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  padding: 22px;
}
.snapshot {
  display: grid;
  gap: 10px;
  grid-template-columns: 120px 1fr;
}
.snapshot dt { color: var(--muted); font-weight: 900; }
.snapshot dd { font-weight: 800; margin: 0; }
.task-item { margin-bottom: 10px; }
.task-item.done { opacity: .55; }
.queue-card { margin-bottom: 12px; }
.user-tools {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto auto;
  margin-top: 12px;
}
code {
  background: #0f172a;
  border-radius: 8px;
  color: #dff8f8;
  display: block;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: auto;
  padding: 14px;
}
.login-page {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.login-card {
  max-width: 460px;
  padding: 34px;
  width: 100%;
}
.login-card h1 { margin-top: 22px; }
.login-card form { display: grid; gap: 14px; }
.alert {
  border-radius: 8px;
  font-weight: 850;
  margin: 14px 0;
  padding: 12px;
}
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }
.alerts-panel {
  border-color: #cfe0ec;
}
.dashboard-alerts {
  background:
    linear-gradient(135deg, rgba(255,255,255,.99), rgba(255,250,242,.96));
}
.alerts-head {
  align-items: center;
}
.alerts-head > div {
  display: grid;
  gap: 4px;
}
.alerts-list {
  display: grid;
  gap: 12px;
}
.alerts-list.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.alert-card {
  align-items: center;
  background: #fff8f2;
  border: 1px solid #f3c79d;
  border-left: 7px solid var(--orange);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(20,34,58,.07);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px;
}
.alert-card.alert-read {
  background: #f8fafc;
  border-color: var(--line);
  border-left-color: #94a3b8;
  opacity: .76;
}
.alert-card-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 7px;
}
.alert-card-meta span {
  background: #ffedd5;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  color: #9a3412;
  font-size: 11px;
  font-weight: 950;
  padding: 5px 8px;
  text-transform: uppercase;
}
.alert-card-meta time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.alert-card h3 {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
  margin: 0 0 6px;
}
.alert-card strong {
  display: block;
  font-size: 14px;
}
.alert-card p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
  margin: 6px 0 0;
}
.alert-card-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.alert-card-actions form {
  margin: 0;
}
.read-label {
  background: #e2e8f0;
  border-radius: 999px;
  color: #475569;
  font-size: 12px;
  font-weight: 950;
  padding: 7px 10px;
}
.mini { font-size: 13px; }
.retell-page-hero {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(22,111,120,.95), rgba(15,76,90,.92)),
    #0f4c5a;
  color: #fff;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) auto;
}
.retell-page-hero .eyebrow { color: #ffd18a; }
.retell-page-hero h2 {
  font-size: clamp(34px, 4vw, 54px);
  line-height: .96;
  margin: 0 0 10px;
}
.retell-page-hero p:not(.eyebrow) {
  color: rgba(255,255,255,.84);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.45;
  margin: 0;
  max-width: 760px;
}
.retell-hero-stats {
  align-items: stretch;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  min-width: min(420px, 100%);
}
.retell-hero-stats a,
.retell-hero-stats form {
  margin: 0;
}
.retell-hero-stats a {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px;
  color: #fff;
  padding: 14px;
  text-decoration: none;
}
.retell-hero-stats strong {
  display: block;
  font-size: 34px;
  line-height: 1;
}
.retell-hero-stats span {
  color: rgba(255,255,255,.82);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}
.retell-hero-stats form {
  grid-column: 1 / -1;
}
.retell-hero-stats .btn {
  min-height: 52px;
  width: 100%;
}
.retell-toolbar-card {
  padding: 18px;
}
.retell-filter-grid {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.35fr) minmax(140px, .65fr) minmax(150px, .65fr) auto auto;
}
.retell-inbox-grid {
  display: grid;
  gap: 14px;
}
.retell-record-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
  border: 1px solid #d8e5ef;
  border-left: 8px solid var(--teal);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.retell-record-card.retell-chat { border-left-color: #7c3aed; }
.retell-record-card.retell-converted { border-left-color: #16a46b; }
.retell-record-head {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}
.retell-record-head h2 {
  color: var(--ink);
  font-size: 26px;
  line-height: 1.05;
  margin: 8px 0 4px;
}
.retell-record-head p {
  color: var(--muted);
  font-weight: 850;
  margin: 0;
}
.retell-record-head p span { color: var(--muted); }
.retell-pill {
  align-items: center;
  background: #e9f6f7;
  border: 1px solid #bee3e5;
  border-radius: 999px;
  color: var(--teal-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  padding: 5px 10px;
  text-transform: uppercase;
}
.retell-record-meta {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0;
}
.retell-record-meta div,
.retell-preview,
.retell-debug-help {
  background: #fff;
  border: 1px solid #dbe7f0;
  border-radius: 8px;
  min-width: 0;
  padding: 10px;
}
.retell-record-meta span,
.retell-config-status span {
  color: #64748b;
  display: block;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .06em;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.retell-record-meta strong,
.retell-config-status strong {
  color: var(--ink);
  display: block;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.retell-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.retell-actions form {
  margin: 0;
}
.retell-preview {
  background: #f8fbfe;
  margin: 10px 0;
  padding: 12px;
}
.retell-preview strong {
  color: var(--ink);
  display: block;
  margin-bottom: 5px;
}
.retell-preview p {
  color: #42526a;
  font-weight: 750;
  line-height: 1.5;
  margin: 0;
}
.retell-record-foot {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.retell-record-foot span,
.recording-link,
.retell-converted-note {
  background: #eef6fb;
  border: 1px solid #dbe7f0;
  border-radius: 999px;
  color: #0f4c5a;
  font-size: 12px;
  font-weight: 950;
  padding: 7px 10px;
  text-decoration: none;
}
.retell-converted-note {
  background: #dcfce7;
  border-color: #9be7b7;
  color: #166534;
}
.retell-details {
  border-top: 1px solid #dbe7f0;
  margin-top: 12px;
  padding-top: 10px;
}
.retell-details summary,
.retell-debug-table details summary {
  color: var(--teal-dark);
  cursor: pointer;
  font-weight: 950;
}
.retell-details pre,
.retell-debug-table pre {
  background: #081f3a;
  border-radius: 8px;
  color: #eaf6fb;
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}
.retell-debug-card {
  align-items: start;
  border-left: 8px solid var(--gold);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, .85fr) minmax(260px, 1.15fr);
}
.retell-debug-help {
  background: #f8fbfe;
  display: grid;
  gap: 8px;
}
.retell-debug-help code {
  background: #081f3a;
  border-radius: 8px;
  color: #eaf6fb;
  display: block;
  overflow-wrap: anywhere;
  padding: 10px;
}
.retell-config-status {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 0;
}
.retell-config-status div {
  background: #f8fbfe;
  border: 1px solid #dbe7f0;
  border-radius: 8px;
  min-width: 0;
  padding: 9px 10px;
}
.retell-config-status strong.ok { color: #166534; }
.retell-config-status strong.bad { color: #991b1b; }
.retell-debug-table-wrap {
  grid-column: 1 / -1;
  overflow-x: auto;
}
.retell-debug-table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}
.retell-debug-table th,
.retell-debug-table td {
  border-bottom: 1px solid #dbe7f0;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}
.retell-debug-table small {
  color: #64748b;
  display: block;
  font-weight: 800;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.retell-log-status {
  background: #e2e8f0;
  border-radius: 999px;
  color: #0f172a;
  display: inline-flex;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .05em;
  padding: 4px 9px;
  text-transform: uppercase;
}
.retell-log-accepted .retell-log-status,
.retell-log-test-ok .retell-log-status,
.retell-log-sync-ok .retell-log-status {
  background: #dcfce7;
  color: #166534;
}
.retell-log-forbidden .retell-log-status,
.retell-log-sync-error .retell-log-status {
  background: #fee2e2;
  color: #991b1b;
}
.retell-log-invalid .retell-log-status,
.retell-log-sync-partial .retell-log-status {
  background: #fef3c7;
  color: #92400e;
}

@media (max-width: 1100px) {
  .metric-grid,
  .dashboard-grid,
  .dashboard-grid-wide,
  .dashboard-hero,
  .lead-layout,
  .form-grid,
  .quick-form,
	  .retell-page-hero {
	    grid-template-columns: 1fr 1fr;
	  }
	  .lead-layout {
	    grid-template-columns: minmax(0, 1fr);
	  }
	  .dashboard-hero { align-items: stretch; }
  .hero-stats,
  .source-grid.upgraded,
  .activity-grid,
  .offer-flow { grid-template-columns: 1fr 1fr; }
  .lead-side { grid-column: 1 / -1; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .deal-summary { grid-template-columns: 1fr 1fr; }
  .alerts-list.compact { grid-template-columns: 1fr; }
  .retell-filter-grid,
  .retell-record-meta,
  .retell-debug-card {
    grid-template-columns: 1fr 1fr;
  }
  .retell-config-status { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 16px; }
  .nav-toggle { display: inline-flex; position: absolute; right: 16px; top: 18px; }
  .main-nav { display: none; width: 100%; }
  .main-nav.open { display: grid; }
  .page-shell { padding: 18px; }
  .page-title { align-items: flex-start; flex-direction: column; }
  .metric-grid,
  .dashboard-grid,
  .dashboard-grid-wide,
  .dashboard-hero,
  .lead-layout,
  .form-grid,
  .quick-form,
  .filter-bar,
  .comm-form,
  .retell-page-hero,
  .retell-filter-grid,
  .retell-record-meta,
  .retell-debug-card,
  .retell-config-status {
    grid-template-columns: 1fr;
  }
  .hero-stats,
  .source-grid,
  .source-grid.upgraded,
  .activity-grid,
  .offer-flow { grid-template-columns: 1fr; }
  .dashboard-hero h2 { font-size: 34px; }
  .metric-card { min-height: 118px; }
  .deal-summary { grid-template-columns: 1fr; }
  .deal-form { padding: 12px; }
  .lead-hero { align-items: flex-start; flex-direction: column; }
  .lead-actions {
    flex: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .lead-address-highlight {
    padding: 14px;
    width: 100%;
  }
  .lead-address-highlight strong {
    font-size: clamp(20px, 5.6vw, 26px);
  }
  .user-tools { grid-template-columns: 1fr; }
  .quick-action-row,
  .quick-action-row.compact { grid-template-columns: 1fr; }
  .alert-card {
    align-items: stretch;
    grid-template-columns: 1fr;
  }
  .alert-card-actions {
    justify-content: flex-start;
  }
  .alert-card-actions .btn,
  .alert-card-actions button {
    width: 100%;
  }
.retell-record-head {
    flex-direction: column;
  }
  .retell-actions,
  .retell-actions form,
  .retell-actions .btn,
  .retell-actions button,
  .retell-filter-grid .btn,
  .retell-filter-grid button {
    width: 100%;
  }
}

.blog-crm-hero {
  align-items: stretch;
  border-left: 8px solid var(--orange);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
}
.blog-crm-hero h2 {
  font-size: clamp(36px, 4vw, 62px);
  line-height: .95;
  margin-bottom: 12px;
}
.blog-crm-hero p {
  color: var(--muted);
  font-size: 19px;
  font-weight: 800;
  max-width: 760px;
}
.blog-crm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.blog-crm-status {
  display: grid;
  gap: 12px;
}
.blog-crm-status div {
  background: #f8fbfe;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.blog-crm-status span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.blog-crm-status strong {
  color: var(--ink);
  display: block;
  font-size: 26px;
  line-height: 1.05;
  margin-top: 5px;
}
.blog-crm-status strong.ok { color: #166534; }
.blog-crm-status strong.bad { color: #991b1b; }
.blog-crm-panel p {
  color: var(--muted);
  font-weight: 800;
}
.blog-crm-list {
  color: var(--muted);
  display: grid;
  gap: 10px;
  font-weight: 850;
  margin: 0;
  padding-left: 22px;
}
.blog-crm-panel code {
  background: #081f3a;
  border-radius: 8px;
  color: #eaf6fb;
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 6px 8px;
}

@media (max-width: 1100px) {
  .blog-crm-hero {
    grid-template-columns: 1fr;
  }
}

.admin-settings-hero {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(20,34,58,.98), rgba(15,76,90,.96)),
    radial-gradient(circle at top right, rgba(244,119,33,.24), transparent 38%);
  color: #fff;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  overflow: hidden;
}
.admin-settings-hero .eyebrow { color: #ffd18a; }
.admin-settings-hero h2 {
  font-size: clamp(34px, 4vw, 58px);
  line-height: .95;
  margin: 0 0 12px;
}
.admin-settings-hero p:not(.eyebrow) {
  color: rgba(255,255,255,.82);
  font-size: 18px;
  font-weight: 800;
  max-width: 760px;
}
.admin-settings-summary {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  padding: 22px;
}
.admin-settings-summary span {
  color: rgba(255,255,255,.72);
  display: block;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.admin-settings-summary strong {
  display: block;
  font-size: 42px;
  line-height: 1;
  margin-top: 8px;
}
.admin-settings-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.admin-settings-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--ink);
  display: grid;
  gap: 10px;
  min-height: 228px;
  padding: 20px;
  position: relative;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.admin-settings-card:hover {
  border-color: rgba(244,119,33,.5);
  box-shadow: 0 22px 54px rgba(21, 34, 58, .12);
  transform: translateY(-2px);
}
.admin-settings-code {
  align-items: center;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 950;
  height: 48px;
  justify-content: center;
  letter-spacing: .08em;
  width: 58px;
}
.admin-settings-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.05;
}
.admin-settings-card em {
  color: var(--orange);
  font-style: normal;
  font-weight: 950;
}
.admin-settings-card p {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
  margin: 0;
}
.admin-settings-card::after {
  color: var(--teal);
  content: "Open";
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .12em;
  margin-top: auto;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .admin-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .admin-settings-hero,
  .admin-settings-grid {
    grid-template-columns: 1fr;
  }
}
