:root {
  --ink: #17201c;
  --muted: #61736a;
  --line: #d9e3dc;
  --paper: #f7faf8;
  --panel: #ffffff;
  --green: #1f8a5b;
  --green-dark: #10633f;
  --mint: #dff5e8;
  --amber: #d9871c;
  --red: #ca3f35;
  --blue: #2c6fbd;
  --violet: #7057c9;
  --shadow: 0 18px 45px rgba(23, 32, 28, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(223, 245, 232, 0.62), rgba(247, 250, 248, 0) 360px),
    var(--paper);
  letter-spacing: 0;
}

body.admin-locked {
  overflow: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(217, 227, 220, 0.9);
  background: rgba(247, 250, 248, 0.94);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 15px;
}

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

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  white-space: nowrap;
}

.nav a.active {
  color: var(--ink);
  background: var(--mint);
  font-weight: 800;
}

.primary,
.ghost,
.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 800;
}

.primary {
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(31, 138, 91, 0.24);
}

.primary:hover {
  background: var(--green-dark);
}

.ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.danger {
  color: #fff;
  background: var(--red);
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 60px;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  min-height: 100vh;
  overflow: auto;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(223, 245, 232, 0.88), rgba(247, 250, 248, 0.94) 360px),
    var(--paper);
}

.login-panel {
  width: min(460px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-copy {
  margin: 26px 0 18px;
}

.login-copy h1 {
  margin: 0 0 10px;
  font-size: 36px;
  line-height: 1;
}

.login-copy p,
.login-error {
  color: var(--muted);
  line-height: 1.5;
}

.login-panel .primary {
  width: 100%;
  margin-top: 16px;
}

.login-error {
  min-height: 24px;
  margin-top: 12px;
  color: var(--red);
  font-weight: 700;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 34px;
  align-items: center;
  min-height: calc(100vh - 145px);
  padding-bottom: 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green-dark);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

h1 {
  margin: 18px 0 18px;
  max-width: 760px;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 30px;
}

h3 {
  margin: 0 0 10px;
}

.lead {
  max-width: 680px;
  color: #405149;
  font-size: 20px;
  line-height: 1.52;
}

.hero-actions,
.tool-row,
.modal-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  margin-top: 28px;
}

.metric-strip,
.summary-grid {
  display: grid;
  gap: 12px;
}

.metric-strip {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 28px;
}

.summary-grid {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 14px;
}

.metric,
.summary,
.panel,
.card,
.plan,
.feature,
.setup-step,
.lead-card,
.group-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(23, 32, 28, 0.05);
}

.metric,
.summary,
.panel,
.card,
.plan,
.feature,
.setup-step {
  padding: 18px;
}

.metric strong,
.summary strong {
  display: block;
  font-size: 25px;
}

.metric span,
.summary span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.radar-visual {
  position: relative;
  min-height: 500px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(31, 138, 91, 0.13), rgba(44, 111, 189, 0.09)),
    #fff;
  box-shadow: var(--shadow);
}

.radar-visual canvas {
  width: 100%;
  height: 100%;
  min-height: 500px;
  display: block;
}

.visual-caption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(217, 227, 220, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
}

.visual-caption strong {
  display: block;
}

.visual-caption span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 10px 0 18px;
}

.section-title p,
.card p,
.feature p,
.setup-step p,
.plan p {
  color: var(--muted);
  line-height: 1.5;
}

.plans,
.feature-grid,
.setup-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.plan.featured {
  border-color: rgba(31, 138, 91, 0.42);
  box-shadow: 0 18px 42px rgba(31, 138, 91, 0.13);
}

.price {
  margin: 18px 0 10px;
  font-size: 36px;
  font-weight: 900;
}

.price span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.ticks {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  color: #405149;
}

.ticks li {
  margin: 10px 0;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(340px, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
  align-items: start;
}

label {
  display: block;
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 300px;
  resize: vertical;
  padding: 14px;
  line-height: 1.45;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 138, 91, 0.12);
}

.lead-list,
.group-list,
.activity-list {
  display: grid;
  gap: 12px;
}

.lead-card,
.group-card {
  padding: 16px;
}

.lead-head,
.group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.lead-name,
.group-name {
  min-width: 0;
}

.lead-name strong,
.group-name strong {
  display: block;
  overflow-wrap: anywhere;
}

.lead-name span,
.group-name span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.score,
.status-pill {
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
}

.score {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  font-size: 22px;
}

.status-pill {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.hot,
.active-status {
  background: var(--red);
}

.warm,
.pending-status {
  background: var(--amber);
}

.cold,
.assigned-status {
  background: var(--blue);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.badge {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--paper);
  color: #405149;
  font-size: 12px;
  font-weight: 800;
}

.quote {
  margin: 0;
  padding: 12px;
  border-left: 3px solid var(--green);
  border-radius: 6px;
  background: #f2f7f4;
  color: #34483d;
  font-size: 14px;
  line-height: 1.45;
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
}

.activation-band {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 0.55fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
  padding: 22px;
  border: 1px solid rgba(31, 138, 91, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(223, 245, 232, 0.82), rgba(255, 255, 255, 0.92)),
    #fff;
  box-shadow: var(--shadow);
}

.activation-band h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.activation-band p {
  margin: 0;
  color: #405149;
  line-height: 1.5;
}

.number-box {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.number-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.number-box strong {
  font-size: 28px;
  overflow-wrap: anywhere;
}

.code {
  display: block;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  color: #dff5e8;
  background: #17201c;
  overflow-wrap: anywhere;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(23, 32, 28, 0.44);
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  width: min(560px, 100%);
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(23, 32, 28, 0.22);
}

.modal p {
  color: var(--muted);
  line-height: 1.52;
}

.modal-kicker,
.selected-plan {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.modal-kicker {
  margin-bottom: 10px;
  color: var(--green-dark);
  background: var(--mint);
}

.selected-plan {
  margin: 4px 0 8px;
  color: #fff;
  background: var(--ink);
}

.modal-actions {
  justify-content: end;
  margin-top: 18px;
}

.iframe-body {
  background: #fff;
}

.iframe-body .container {
  width: min(1100px, calc(100% - 24px));
  padding: 18px 0 34px;
}

.compact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.client-help {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.client-help strong {
  display: block;
  margin-bottom: 6px;
}

.client-help p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.hidden-control {
  display: none;
}

.client-radar-map {
  position: relative;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #eaf5ef;
  box-shadow: 0 8px 28px rgba(23, 32, 28, 0.05);
}

.client-radar-map canvas {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
}

.map-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid rgba(217, 227, 220, 0.9);
  background: rgba(255, 255, 255, 0.92);
}

.map-caption strong,
.map-caption span {
  display: block;
}

.map-caption span {
  color: var(--muted);
  font-size: 13px;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-weight: 800;
}

.map-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-hot {
  background: var(--red);
}

.legend-warm {
  background: var(--amber);
}

.legend-cold {
  background: var(--blue);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  align-items: start;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.activity-item span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 960px) {
  .topbar-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    overflow-x: auto;
  }

  .hero,
  .dashboard,
  .activation-band,
  .admin-layout,
  .plans,
  .feature-grid,
  .setup-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .summary-grid,
  .metric-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 22px, 1180px);
    padding-top: 18px;
  }

  h1 {
    font-size: 42px;
  }

  .lead {
    font-size: 17px;
  }

  .summary-grid,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .visual-caption,
  .section-title,
  .lead-head,
  .group-head,
  .compact-header {
    flex-direction: column;
    align-items: stretch;
  }

  .score {
    width: 100%;
    height: 48px;
  }
}
