:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-soft: #fbfcfd;
  --nav: #ffffff;
  --ink: #172026;
  --muted: #66737d;
  --line: #dce3e8;
  --field: #ffffff;
  --field-line: #c8d2d9;
  --accent: #176b87;
  --accent-dark: #0d4f63;
  --action: #f47b20;
  --action-dark: #c95d0d;
  --warn: #a45a00;
  --danger: #a13030;
  --ok: #2d7047;
  --shadow: rgba(23, 32, 38, .08);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11181d;
  --panel: #182229;
  --panel-soft: #141d23;
  --nav: #131b21;
  --ink: #edf3f6;
  --muted: #a5b3bd;
  --line: #2d3a43;
  --field: #101820;
  --field-line: #3b4a54;
  --accent: #65b8d1;
  --accent-dark: #9fd3e3;
  --action: #f47b20;
  --action-dark: #ff9a49;
  --warn: #f0b45d;
  --danger: #ff8b84;
  --ok: #7fce9b;
  --shadow: rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

nav {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--nav);
}

nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-right: 8px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

nav a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 600;
}

.theme-toggle {
  margin-left: auto;
  min-height: 34px;
  gap: 7px;
  border: 1px solid var(--line);
  padding: 0 11px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: none;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--panel-soft);
}

.theme-toggle-icon {
  font-size: 17px;
  line-height: 1;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 9px;
  object-fit: cover;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px;
}

h1, h2, p { margin-top: 0; }
h1 { font-size: 34px; margin-bottom: 8px; }
h2 { font-size: 20px; }

.hero, .page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.splash {
  min-height: calc(100vh - 112px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .85fr);
  gap: 34px;
  align-items: center;
}

.splash-copy h1 {
  max-width: 680px;
  font-size: 62px;
  line-height: 1;
  margin-bottom: 16px;
}

.splash-copy p:not(.eyebrow) {
  max-width: 630px;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.45;
}

.wordmark {
  display: block;
  width: min(660px, 100%);
  height: auto;
  margin: 0 0 22px;
  mix-blend-mode: multiply;
}

html[data-theme="dark"] .wordmark,
html[data-theme="dark"] .brand-mark {
  filter: none;
  mix-blend-mode: normal;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button.secondary {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent-dark);
}

.button.compact {
  min-height: 34px;
  padding: 0 11px;
  font-size: 14px;
}

.button.secondary:hover {
  border-color: var(--accent);
  background: var(--panel-soft);
}

.splash-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  box-shadow: 0 18px 42px var(--shadow);
}

.business-grid,
.profile-list {
  display: grid;
  gap: 12px;
}

.business-tile,
.profile-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
  color: inherit;
  text-decoration: none;
}

.business-tile span,
.profile-card span {
  color: var(--muted);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.profile-actions form {
  margin: 0;
}

.profile-card.disabled {
  opacity: .72;
}

.status-pill {
  justify-self: start;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-pill.enabled {
  background: #e6f4ea;
  color: var(--ok);
}

.status-pill.disabled {
  background: #eceff3;
  color: #52606a;
}

.business-logo {
  max-width: 150px;
  max-height: 90px;
  object-fit: contain;
}

.flow-step {
  display: grid;
  gap: 5px;
  border-left: 4px solid var(--action);
  padding: 14px 14px 14px 16px;
  background: var(--panel-soft);
  border-radius: 6px;
}

.flow-step strong {
  font-size: 17px;
}

.flow-step span {
  color: var(--muted);
  line-height: 1.4;
}

.hero {
  min-height: 170px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 2px var(--shadow);
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 700;
}

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

input, textarea, select {
  width: 100%;
  border: 1px solid var(--field-line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--field);
}

textarea { resize: vertical; }

button, .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--action);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button:hover, .button:hover { background: var(--action-dark); }

button.secondary-action {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent-dark);
}

button.secondary-action:hover {
  border-color: var(--accent);
  background: var(--panel-soft);
}

button.compact {
  min-height: 34px;
  padding: 0 11px;
  font-size: 14px;
}

button.danger-action {
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  background: var(--panel);
  color: var(--danger);
}

button.danger-action:hover {
  background: color-mix(in srgb, var(--danger) 12%, var(--panel));
}

.lead-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.lead-card {
  display: grid;
  gap: 8px;
  min-height: 190px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
}

.lead-card span, .lead-card small { color: var(--muted); }

.lead-card.closed {
  background: var(--panel-soft);
}

.lead-list.archived .lead-card {
  min-height: 170px;
}

.badge {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e8eef2;
  color: #24323a;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.emergency { background: #ffe6e4; color: var(--danger); }
.badge.high { background: #fff2d8; color: var(--warn); }
.badge.normal { background: #e6f4ea; color: var(--ok); }
.badge.junk { background: #eceff3; color: #52606a; }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

dl {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px 14px;
}

dt {
  color: var(--muted);
  font-weight: 800;
}

dd { margin: 0; }

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: var(--panel-soft);
  font-family: Consolas, "Courier New", monospace;
}

.timeline {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
}

.timeline time {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.timeline p { margin: 4px 0 0; }

.lifecycle-actions {
  display: grid;
  gap: 16px;
}

.lifecycle-actions form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.closed-note {
  margin-top: 0;
  color: var(--muted);
}

.notice {
  margin-bottom: 18px;
  border-left: 4px solid var(--ok);
  padding: 12px 14px;
  background: color-mix(in srgb, var(--ok) 14%, var(--panel));
  font-weight: 700;
}

.section-title {
  margin-top: 30px;
}

.pending {
  color: var(--warn);
  font-weight: 800;
}

.verified {
  color: var(--ok);
  font-weight: 800;
}

.empty {
  color: var(--muted);
  margin: 0;
}

@media (max-width: 760px) {
  nav, main { padding-left: 16px; padding-right: 16px; }
  .form-grid, .two-col, .splash { grid-template-columns: 1fr; }
  .hero, .page-head { display: block; }
  .splash { min-height: auto; }
  .splash-copy h1 { font-size: 42px; }
  .splash-copy p:not(.eyebrow) { font-size: 18px; }
  h1 { font-size: 28px; }
}
