:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #64717c;
  --line: #dbe2e8;
  --panel: #ffffff;
  --soft: #f4f7f9;
  --accent: #1b7f6b;
  --accent-2: #b5532f;
  --accent-3: #4f6f9f;
  --shadow: 0 18px 40px rgba(25, 39, 52, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #edf2f4;
}

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

button {
  border: 0;
  border-radius: 6px;
  min-height: 38px;
  padding: 0 14px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

.ghost {
  background: #e6ecef;
  color: var(--ink);
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.sales-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 18px;
  max-width: 1380px;
  margin: 0 auto 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.offer-copy {
  display: grid;
  align-content: center;
  gap: 10px;
}

.offer-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: 38px;
  line-height: 1.04;
  letter-spacing: 0;
}

.offer-lede {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.48;
}

.offer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 750;
}

.primary-link {
  background: var(--ink);
  color: #fff;
}

.secondary-link {
  background: #e6ecef;
  color: var(--ink);
}

.offer-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.price-block {
  display: grid;
  gap: 4px;
}

.price-block span,
.price-block small,
.payment-note {
  color: var(--muted);
}

.price-block strong {
  font-size: 42px;
  line-height: 1;
}

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

.deliverables li {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.payment-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1380px;
  margin: 0 auto;
}

.sidebar,
.main-panel,
.entry-band,
.panel,
.board {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
}

.brand-block h1,
.toolbar h2,
.entry-band h3,
.panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand-block h1 {
  font-size: 28px;
  line-height: 1.08;
}

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

.muted {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.metric {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

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

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

.compact-panel {
  padding: 14px;
  box-shadow: none;
}

.panel-heading,
.toolbar,
.entry-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading h2,
.toolbar h2 {
  font-size: 20px;
}

.icon-button {
  min-width: 58px;
}

.scan-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}

.scan-list li {
  padding: 10px;
  border-radius: 6px;
  background: #f8fafb;
  border-left: 4px solid var(--accent-3);
  color: var(--ink);
  line-height: 1.35;
}

.scan-list li.risk {
  border-left-color: var(--accent-2);
}

.main-panel {
  min-width: 0;
  padding: 18px;
}

.toolbar {
  margin-bottom: 18px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entry-band {
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: none;
}

.lead-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  width: min(100%, 980px);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

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

.wide-field {
  min-width: 210px;
}

.board {
  overflow: hidden;
  box-shadow: none;
}

.board-header,
.lead-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(130px, 0.8fr) minmax(180px, 0.9fr) minmax(190px, 0.9fr);
  gap: 12px;
  align-items: center;
}

.board-header {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  background: #f8fafb;
  border-bottom: 1px solid var(--line);
}

.lead-rows {
  display: grid;
}

.lead-row {
  position: relative;
  min-height: 104px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.lead-row:last-child {
  border-bottom: 0;
}

.lead-cell {
  display: grid;
  gap: 4px;
}

.lead-cell span,
.row-note {
  color: var(--muted);
  font-size: 13px;
}

.date-cell {
  display: grid;
  gap: 6px;
}

.age-pill {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eaf4f1;
  color: #116251;
  font-size: 12px;
  font-weight: 750;
}

.age-pill.risk {
  background: #fff0e8;
  color: #9a3d1d;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.square-button {
  width: 38px;
  padding: 0;
}

.row-note,
.lead-row textarea {
  grid-column: 1 / -1;
}

.row-note {
  margin: -2px 0 0;
}

.lead-row textarea {
  display: none;
  min-height: 86px;
  resize: vertical;
  background: #fbfcfd;
}

.lead-row textarea.visible {
  display: block;
}

@media (max-width: 1040px) {
  .sales-hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .entry-band {
    align-items: stretch;
    flex-direction: column;
  }

  .lead-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .sales-hero {
    padding: 16px;
  }

  .offer-copy h1 {
    font-size: 30px;
  }

  .metric-grid,
  .lead-form,
  .board-header,
  .lead-row {
    grid-template-columns: 1fr;
  }

  .board-header {
    display: none;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions,
  .row-actions {
    width: 100%;
  }

  .toolbar-actions button,
  .row-actions button {
    flex: 1;
  }
}
