:root {
  --bg: #f4f1eb;
  --bg-warm: #fbf8f2;
  --bg-cool: #edf1ea;
  --surface: rgba(255, 255, 255, 0.4);
  --surface-strong: rgba(255, 255, 255, 0.6);
  --surface-soft: rgba(255, 255, 255, 0.28);
  --surface-tint: rgba(247, 244, 236, 0.5);
  --surface-selected: rgba(219, 234, 223, 0.52);
  --surface-selected-strong: rgba(198, 226, 207, 0.72);
  --ink: #172018;
  --ink-soft: rgba(23, 32, 24, 0.76);
  --muted: rgba(56, 72, 60, 0.62);
  --line: rgba(255, 255, 255, 0.62);
  --line-soft: rgba(106, 118, 110, 0.16);
  --line-strong: rgba(255, 255, 255, 0.85);
  --accent: #2d6d4b;
  --accent-soft: rgba(45, 109, 75, 0.14);
  --accent-strong: rgba(45, 109, 75, 0.22);
  --danger: #a34a3c;
  --danger-soft: rgba(163, 74, 60, 0.14);
  --warn: #8a6a28;
  --warn-soft: rgba(138, 106, 40, 0.14);
  --good: #21684f;
  --good-soft: rgba(33, 104, 79, 0.14);
  --glass-blur: 28px;
  --glass-blur-strong: 36px;
  --radius-sm: 18px;
  --radius-md: 24px;
  --radius-lg: 32px;
  --radius-pill: 999px;
  --shadow-soft: 0 24px 50px rgba(99, 106, 92, 0.1);
  --shadow-panel: 0 28px 70px rgba(116, 121, 107, 0.12);
  --shadow-pressed: 0 10px 24px rgba(104, 111, 95, 0.12);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --highlight-soft: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  --focus-ring: 0 0 0 4px rgba(45, 109, 75, 0.12);
  --sidebar-width: 390px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 14% 12%, rgba(199, 225, 207, 0.5), transparent 20%),
    radial-gradient(circle at 82% 8%, rgba(240, 225, 205, 0.45), transparent 24%),
    radial-gradient(circle at 78% 78%, rgba(225, 233, 220, 0.52), transparent 26%),
    linear-gradient(180deg, #faf7f1 0%, #f2efe8 46%, #ecefe8 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Avenir Next", sans-serif;
  color: var(--ink);
  background: transparent;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  z-index: -1;
  pointer-events: none;
  filter: blur(16px);
  opacity: 0.9;
}

body::before {
  top: -120px;
  right: -40px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(209, 231, 214, 0.95) 0%, rgba(209, 231, 214, 0) 70%);
}

body::after {
  left: -120px;
  bottom: 8vh;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 231, 214, 0.85) 0%, rgba(245, 231, 214, 0) 72%);
}

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

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  position: relative;
}

.sidebar,
.toolbar-card,
.count-tile,
.hubspot-tile,
.lead-row,
.detail-grid section,
.score-badge {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.24)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.1));
  border: 1px solid var(--line);
  box-shadow: var(--highlight), var(--shadow-panel);
  backdrop-filter: blur(var(--glass-blur)) saturate(165%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(165%);
}

.sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.45);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.16)),
    linear-gradient(160deg, rgba(253, 251, 246, 0.52), rgba(238, 243, 235, 0.24));
  padding: 22px 18px 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.4),
    30px 0 50px rgba(138, 141, 130, 0.07);
}

.sidebar::-webkit-scrollbar {
  width: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(132, 145, 132, 0.24);
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.sidebar-header {
  padding: 6px 4px 0;
}

.sidebar-header h1,
.detail-header h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(2rem, 2.8vw, 2.75rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.sidebar-header p,
#company-meta {
  color: var(--muted);
  word-break: break-word;
  margin: 8px 0 0;
  line-height: 1.55;
}

.filters,
.toggle-list,
.actions,
.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-filters {
  margin: 22px 0 18px;
}

.filter-button,
.actions button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: var(--ink);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.28)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 10px 18px rgba(128, 132, 121, 0.1);
  backdrop-filter: blur(18px) saturate(155%);
  -webkit-backdrop-filter: blur(18px) saturate(155%);
}

.filter-button {
  padding: 10px 16px;
}

.filter-button:hover,
.actions button:hover,
.lead-row:hover,
.download-link:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 24px rgba(119, 125, 111, 0.12);
}

.filter-button.active {
  background:
    linear-gradient(180deg, rgba(215, 235, 223, 0.86), rgba(181, 216, 194, 0.54)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.45), rgba(196, 223, 204, 0.22));
  color: var(--accent);
  border-color: rgba(147, 187, 161, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 0 0 1px rgba(45, 109, 75, 0.05),
    0 18px 28px rgba(121, 153, 133, 0.16);
}

.filter-button:focus-visible,
.actions button:focus-visible,
.search-input:focus-visible,
.select-input:focus-visible,
#review-notes:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 14px 24px rgba(119, 125, 111, 0.12);
}

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

.counts {
  margin-bottom: 16px;
}

.control-card,
.toolbar-card,
.export-card {
  margin-bottom: 16px;
}

.count-tile,
.toolbar-card,
.hubspot-tile {
  border-radius: var(--radius-md);
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.count-tile::before,
.toolbar-card::before,
.hubspot-tile::before,
.detail-grid section::before,
.score-badge::before,
.lead-row::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
}

.count-tile strong,
.hubspot-tile strong {
  display: block;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.count-tile span,
.hubspot-tile span,
.count-tile small,
.hubspot-tile small {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.control-copy,
.export-copy {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.field-label,
.section-title,
.pitch-label,
.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 600;
}

.section-title {
  margin-bottom: 14px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
}

.search-input,
.select-input,
#review-notes {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 18px;
  padding: 13px 15px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.22)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.08));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.28),
    0 10px 18px rgba(124, 129, 118, 0.08);
  backdrop-filter: blur(18px) saturate(155%);
  -webkit-backdrop-filter: blur(18px) saturate(155%);
}

.search-input::placeholder,
#review-notes::placeholder {
  color: rgba(60, 74, 63, 0.42);
}

.toolbar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.toggle-list {
  flex-direction: column;
  margin-top: 14px;
}

.toggle-row {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--ink-soft);
}

.toggle-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.hubspot-strip {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.export-actions {
  align-items: center;
}

.download-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hubspot-tile.subtle {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.2)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08));
}

.lead-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}

.lead-row {
  border-radius: var(--radius-md);
  padding: 16px 15px 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.lead-row.active {
  background:
    linear-gradient(180deg, rgba(228, 240, 232, 0.72), rgba(208, 227, 215, 0.42)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(218, 233, 223, 0.18));
  border-color: rgba(157, 192, 170, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 18px 34px rgba(116, 145, 125, 0.16);
}

.lead-row-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.lead-row h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.25;
}

.lead-row p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.row-score {
  min-width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background:
    linear-gradient(180deg, rgba(220, 236, 226, 0.92), rgba(186, 220, 198, 0.54)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(205, 227, 214, 0.22));
  color: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 14px 22px rgba(115, 141, 124, 0.14);
  font-weight: 700;
}

.row-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.mini-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(155%);
  -webkit-backdrop-filter: blur(14px) saturate(155%);
}

.mini-chip {
  background: rgba(255, 255, 255, 0.34);
  color: var(--muted);
}

.mini-chip.good {
  background: rgba(214, 233, 224, 0.64);
  color: var(--good);
}

.mini-chip.muted {
  background: rgba(240, 233, 222, 0.72);
  color: rgba(104, 88, 64, 0.82);
}

.lead-detail {
  padding: 28px 28px 36px;
  position: relative;
}

.lead-detail::before {
  content: "";
  position: absolute;
  inset: 16px 18px 20px 8px;
  border-radius: 40px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
  z-index: 0;
}

.lead-detail > * {
  position: relative;
  z-index: 1;
}

.detail-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
}

.status-chip {
  background:
    linear-gradient(180deg, rgba(221, 237, 227, 0.88), rgba(197, 224, 206, 0.5)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.45), rgba(202, 226, 210, 0.18));
  color: var(--accent);
  text-transform: capitalize;
}

.status-chip.approved {
  background:
    linear-gradient(180deg, rgba(220, 239, 229, 0.92), rgba(189, 221, 203, 0.52)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.45), rgba(204, 228, 215, 0.18));
  color: var(--good);
}

.status-chip.rejected {
  background:
    linear-gradient(180deg, rgba(247, 226, 222, 0.92), rgba(235, 198, 190, 0.56)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.45), rgba(234, 203, 196, 0.18));
  color: var(--danger);
}

.status-chip.later {
  background:
    linear-gradient(180deg, rgba(247, 236, 214, 0.92), rgba(235, 213, 170, 0.54)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.45), rgba(236, 217, 180, 0.18));
  color: var(--warn);
}

.score-badge {
  min-width: 116px;
  text-align: center;
  border-radius: 30px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.score-badge span {
  display: block;
  font-size: 2.15rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.score-badge small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.detail-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.15fr 0.85fr;
}

.detail-grid section {
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.preview-stage {
  min-height: 380px;
  border-radius: 26px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.04)),
    linear-gradient(135deg, rgba(45, 109, 75, 0.08), rgba(255, 255, 255, 0)),
    rgba(247, 244, 236, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    inset 0 0 0 1px rgba(114, 121, 108, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.preview-stage img {
  display: block;
  width: 100%;
  height: auto;
}

.preview-placeholder {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  line-height: 1.55;
}

.preview-placeholder strong {
  color: var(--ink);
  display: block;
  margin-bottom: 8px;
}

.preview-actions {
  margin-top: 14px;
}

.preview-review {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(112, 121, 109, 0.12);
}

.preview-actions-bar {
  margin-top: 14px;
}

.open-link {
  display: inline-flex;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(45, 109, 75, 0.22);
  transition: color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.open-link:hover {
  color: #214f36;
  border-color: rgba(33, 79, 54, 0.4);
}

.open-link.subtle {
  color: var(--muted);
  border-bottom-color: rgba(76, 89, 78, 0.18);
}

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

.facts div {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(110, 120, 108, 0.12);
}

.facts dt {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.facts dd {
  margin: 0;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.pitch-label {
  margin: 0 0 8px;
}

.pitch-value {
  font-size: 1.18rem;
  line-height: 1.35;
  margin: 0 0 20px;
}

.message,
.issues {
  line-height: 1.6;
  color: var(--ink-soft);
}

.issues-hint {
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

#review-notes {
  resize: vertical;
  margin-top: 10px;
  min-height: 132px;
}

.actions {
  margin-top: 18px;
}

.actions button {
  padding: 12px 16px;
  font-weight: 600;
}

.actions .approve {
  background:
    linear-gradient(180deg, rgba(220, 239, 229, 0.96), rgba(187, 220, 201, 0.62)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.48), rgba(203, 226, 212, 0.2));
  color: var(--accent);
}

.actions .later {
  background:
    linear-gradient(180deg, rgba(248, 238, 216, 0.96), rgba(235, 214, 172, 0.62)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.48), rgba(237, 219, 185, 0.2));
  color: var(--warn);
}

.actions .reject {
  background:
    linear-gradient(180deg, rgba(247, 227, 223, 0.96), rgba(234, 199, 191, 0.62)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.48), rgba(234, 205, 197, 0.2));
  color: var(--danger);
}

@media (max-width: 1220px) {
  :root {
    --sidebar-width: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.44);
    box-shadow:
      inset 0 -1px 0 rgba(255, 255, 255, 0.4),
      0 26px 42px rgba(137, 141, 129, 0.08);
  }

  .lead-detail::before {
    inset: 10px 14px 18px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .toolbar-grid,
  .facts,
  .counts,
  .control-stats {
    grid-template-columns: 1fr;
  }

  .detail-header,
  .header-right {
    flex-direction: column;
    align-items: start;
  }

  .lead-detail {
    padding: 20px 16px 28px;
  }

  .sidebar {
    padding: 18px 14px 22px;
  }

  .detail-grid section,
  .toolbar-card,
  .count-tile,
  .hubspot-tile,
  .lead-row {
    border-radius: 24px;
  }

  .preview-stage {
    min-height: 260px;
  }
}
