:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #17202a;
  --muted: #667085;
  --line: #d7dde5;
  --accent: #126a6f;
  --accent-2: #8b4e2f;
  --danger: #9f2f2f;
  --ok: #28714d;
  --shadow: 0 14px 38px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 700;
}

button.secondary {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(18px, 4vw, 48px);
  background: #13282b;
  color: #fff;
}

.app-header h1 {
  margin: 3px 0 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: #acd6d4;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
}

.header-actions {
  display: grid;
  gap: 8px;
  min-width: min(260px, 100%);
}

.header-actions label {
  color: #d7f0ee;
  font-size: 13px;
  font-weight: 700;
}

.app-shell {
  padding: 24px clamp(14px, 3vw, 36px) 48px;
}

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

.metrics article,
.panel,
.main-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metrics article {
  padding: 18px;
}

.metrics span {
  display: block;
  font-size: 32px;
  font-weight: 850;
}

.metrics p {
  margin: 2px 0 0;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.workspace.lower {
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
}

.panel,
.main-panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading.with-space {
  margin-top: 24px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 18px;
}

.stack {
  display: grid;
  gap: 10px;
}

.compact-form {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

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

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.stage {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
}

.stage h3 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #dcebea;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.lead-card,
.property-card,
.review-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  margin-bottom: 10px;
}

.lead-card,
.property-card {
  cursor: pointer;
}

.lead-card:hover,
.property-card:hover {
  border-color: var(--accent);
}

.lead-card.selected,
.property-card.selected {
  outline: 2px solid rgba(18, 106, 111, 0.28);
  border-color: var(--accent);
}

.lead-card strong,
.property-card strong,
.review-card strong {
  display: block;
  margin-bottom: 4px;
}

.meta-line {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.status {
  display: inline-block;
  margin-top: 8px;
  border-radius: 999px;
  padding: 5px 8px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status.good {
  background: #e5f4ec;
  color: var(--ok);
}

.status.review {
  background: #fff0e8;
  color: var(--accent-2);
}

.status.danger {
  background: #fce8e8;
  color: var(--danger);
}

.list {
  display: grid;
  gap: 10px;
}

.detail-pane {
  display: grid;
  gap: 12px;
}

.detail-pane h3 {
  margin: 4px 0 8px;
  font-size: 15px;
}

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

.detail-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
  min-height: 64px;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-item {
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  padding: 8px 10px;
}

.timeline-item p {
  margin: 2px 0 0;
}

.empty {
  margin: 0;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
}

@media (max-width: 1080px) {
  .metrics,
  .pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace,
  .workspace.lower {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .app-header {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics,
  .pipeline,
  .grid-two,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
