:root {
  --ink: #1e2230;
  --muted: #667085;
  --line: #d9deea;
  --paper: #ffffff;
  --brand: #0f766e;
  --brand-dark: #134e4a;
  --accent: #b45309;
  --warn: #f59e0b;
  --danger: #c2410c;
  --healthy: #15803d;
  --bg-top: #f3f8f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.1), transparent 32%),
    linear-gradient(180deg, var(--bg-top), #ffffff 340px);
  line-height: 1.5;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 800;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid rgba(15, 118, 110, 0.14);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), #14b8a6);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 900;
}

.brand strong,
.brand-sub {
  display: block;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.85rem;
}

.nav,
.actions,
.filters,
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav form {
  margin: 0;
}

.button,
.nav a,
.nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--brand-dark);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.wrap {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 26px 0 56px;
}

.hero-row,
.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  margin-bottom: 22px;
}

.login-shell {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  min-height: 72vh;
  align-items: center;
}

.eyebrow {
  width: fit-content;
  margin: 0 0 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(180, 83, 9, 0.12);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: #102a43;
  line-height: 1.08;
}

h1 {
  max-width: 900px;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

h2 {
  font-size: 1.35rem;
}

.lede,
.muted,
.tiny,
.empty {
  color: var(--muted);
}

.lede {
  max-width: 780px;
  margin: 10px 0 0;
  font-size: 1.04rem;
}

.panel,
.metric,
.notice {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 34px rgba(30, 34, 48, 0.06);
}

.panel {
  padding: clamp(18px, 3vw, 26px);
  margin-bottom: 20px;
}

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

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

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

.metric.warn {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), #fff);
}

.metric.danger {
  background: linear-gradient(180deg, rgba(194, 65, 12, 0.08), #fff);
}

.metric.money {
  background: linear-gradient(180deg, rgba(21, 128, 61, 0.08), #fff);
}

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

.stack-list,
.timeline {
  display: grid;
  gap: 12px;
}

.lead-card,
.timeline-item,
.callout {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfe;
}

.active-step {
  border-color: rgba(15, 118, 110, 0.35);
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.08), #fbfcfe);
}

.callout.subtle {
  background: #f7fafc;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field span {
  font-size: 0.88rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c8d2df;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(15, 118, 110, 0.14);
  border-color: var(--brand);
}

.compact {
  min-width: 180px;
}

.notice {
  margin-bottom: 18px;
  padding: 13px 15px;
  color: var(--brand-dark);
  font-weight: 800;
}

.notice.danger {
  color: var(--danger);
  background: #fff4ed;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #e9edf4;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 900;
}

.pill.healthy {
  background: rgba(21, 128, 61, 0.12);
  color: var(--healthy);
}

.pill.at-risk {
  background: rgba(245, 158, 11, 0.16);
  color: #a16207;
}

.pill.stalled {
  background: rgba(194, 65, 12, 0.14);
  color: var(--danger);
}

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

.detail-list div {
  padding: 12px 0;
  border-bottom: 1px solid #eef2f6;
}

dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.suggestions {
  margin: 0;
  padding-left: 20px;
}

.subsection {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #ecf0f5;
}

@media (max-width: 900px) {
  .metrics,
  .dashboard-grid,
  .detail-grid,
  .hero-row,
  .login-shell,
  .fields {
    grid-template-columns: 1fr;
  }

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