:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-strong: #eef3ef;
  --ink: #15211b;
  --muted: #617068;
  --line: #dbe3dc;
  --green: #1f7a4d;
  --green-dark: #0f4f37;
  --gold: #b7791f;
  --red: #bd3b3b;
  --blue: #2b5c9e;
  --shadow: 0 18px 50px rgba(35, 49, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(245, 247, 244, 0.96)),
    repeating-linear-gradient(90deg, rgba(31, 122, 77, 0.06) 0 1px, transparent 1px 72px);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #10231a;
  color: #eef8f0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: #e6f0e9;
  color: #10231a;
  font-weight: 800;
  border-radius: 8px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: rgba(238, 248, 240, 0.66);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(238, 248, 240, 0.78);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  text-align: left;
}

.nav-item span {
  width: 22px;
  text-align: center;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(238, 248, 240, 0.12);
  color: #ffffff;
}

.sidebar-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(238, 248, 240, 0.16);
  border-radius: 8px;
  background: rgba(238, 248, 240, 0.08);
}

.sidebar-panel p,
.sidebar-panel strong {
  margin: 0;
}

.sidebar-panel p {
  color: rgba(238, 248, 240, 0.65);
  font-size: 12px;
}

.sidebar-panel strong {
  display: block;
  margin-top: 8px;
  line-height: 1.45;
}

.workspace {
  padding: 28px;
  min-width: 0;
}

.topbar,
.panel-heading,
.detail-header,
.review-row,
.top-actions,
.panel-actions,
.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-actions {
  justify-content: flex-end;
  gap: 8px;
}

.topbar {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.primary-button,
.secondary-button,
.icon-button,
.segment,
.step-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.primary-button {
  padding: 10px 14px;
  background: var(--green-dark);
  color: #ffffff;
  border-color: var(--green-dark);
  font-weight: 700;
}

.secondary-button {
  padding: 10px 14px;
  background: #ffffff;
  color: var(--green-dark);
  border-color: rgba(31, 122, 77, 0.28);
  font-weight: 800;
}

.secondary-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.evidence-trail {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.evidence-item strong {
  color: var(--ink);
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.lead-list-panel,
.detail-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
}

.metric-card span,
.metric-card small,
.label {
  color: var(--muted);
  font-size: 12px;
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 30px;
}

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

.search-box {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.segmented,
.stepper {
  display: flex;
  padding: 4px;
  background: #e7eee8;
  border-radius: 8px;
  gap: 4px;
}

.segment {
  height: 34px;
  padding: 0 12px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.segment.active,
.step-button.active {
  background: var(--surface);
  color: var(--green-dark);
  border-color: var(--line);
  box-shadow: 0 4px 14px rgba(32, 45, 38, 0.08);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(480px, 1.25fr);
  gap: 18px;
  align-items: start;
}

.lead-list-panel,
.detail-panel {
  padding: 18px;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf3ee;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.lead-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.lead-card {
  width: 100%;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 14px;
  border-radius: 8px;
  text-align: left;
}

.lead-card.active {
  border-color: rgba(31, 122, 77, 0.7);
  background: #f3faf5;
}

.lead-card-top,
.lead-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.lead-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.lead-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tag {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 7px;
  background: #eef3ef;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.lead-score {
  color: var(--gold);
  font-weight: 900;
}

.lead-card-bottom {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.score-badge {
  min-width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--score, 0) * 1%), #e7eee8 0);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  position: relative;
}

.score-badge::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--green-dark);
}

.score-badge span {
  position: relative;
}

.radar-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f3faf5, #ffffff);
}

.radar-visual {
  position: relative;
  width: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: #10231a;
}

.radar-ring {
  position: absolute;
  border: 1px solid rgba(133, 210, 155, 0.45);
  border-radius: 50%;
  inset: 14px;
}

.ring-two {
  inset: 30px;
}

.ring-three {
  inset: 46px;
}

.radar-sweep {
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, rgba(118, 204, 138, 0), rgba(118, 204, 138, 0.42), rgba(118, 204, 138, 0));
  animation: sweep 4s linear infinite;
}

.radar-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #eac15f;
}

.dot-one {
  top: 31px;
  left: 68px;
}

.dot-two {
  top: 65px;
  left: 42px;
}

.dot-three {
  top: 48px;
  left: 82px;
}

@keyframes sweep {
  to {
    transform: rotate(360deg);
  }
}

.detail-section {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.detail-section p,
.radar-card p,
.contact-card p,
.message-box p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.ai-status {
  margin-top: 8px;
  font-size: 12px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.clean-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.clean-list li {
  padding-left: 16px;
  position: relative;
  color: var(--muted);
  line-height: 1.45;
}

.clean-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
}

.source-list a {
  color: var(--blue);
  text-decoration: none;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 16px;
  background: #10231a;
  color: #ffffff;
  border-radius: 8px;
}

.contact-card h3 {
  margin-bottom: 4px;
}

.contact-card .label,
.contact-card p {
  color: rgba(255, 255, 255, 0.68);
}

.compliance-badge {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 800;
}

.conversation-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.compact {
  align-items: flex-start;
}

.step-button {
  width: 32px;
  height: 32px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.message-box {
  margin: 14px 0;
  padding: 16px;
  border-radius: 8px;
  background: var(--surface-strong);
}

.message-meta {
  margin-bottom: 10px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .nav-list {
    display: flex;
    flex-wrap: wrap;
  }

  .sidebar-panel {
    margin-top: 0;
    margin-left: auto;
    max-width: 260px;
  }

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

  .detail-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 18px;
  }

  .topbar,
  .tool-strip,
  .review-row,
  .contact-card,
  .detail-header {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics-grid,
  .content-grid,
  .two-col,
  .radar-card {
    grid-template-columns: 1fr;
  }

  .segmented {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .segment {
    flex: 0 0 auto;
  }

  .score-badge {
    align-self: flex-start;
  }

  .sidebar {
    padding: 18px;
  }

  h1 {
    font-size: 22px;
  }
}
