/* SLAback Design System — Editorial B2B FinOps Palette */
:root {
  --bg: hsl(40, 23%, 97%);
  --surface: hsl(0, 0%, 100%);
  --surface-subtle: hsl(40, 18%, 94%);
  --ink: hsl(215, 28%, 13%);
  --ink-muted: hsl(215, 14%, 42%);
  --border: hsl(35, 14%, 86%);
  --border-strong: hsl(35, 12%, 75%);
  --accent: hsl(158, 64%, 26%);
  --accent-hover: hsl(158, 68%, 21%);
  --accent-soft: hsl(156, 48%, 93%);
  --urgent-bg: hsl(4, 82%, 95%);
  --urgent-ink: hsl(4, 72%, 38%);
  --warn-bg: hsl(38, 92%, 93%);
  --warn-ink: hsl(32, 82%, 32%);
  --ok-bg: hsl(156, 48%, 93%);
  --ok-ink: hsl(158, 64%, 24%);
  --muted-bg: hsl(215, 16%, 92%);
  --muted-ink: hsl(215, 16%, 38%);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.06);
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(249, 248, 245, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.nav-links a:hover {
  color: var(--ink);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-subtle);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.83rem;
}

/* Cards & Surfaces */
.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* Typography */
h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.mono {
  font-family: var(--font-mono);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-urgent {
  background: var(--urgent-bg);
  color: var(--urgent-ink);
}

.badge-due_soon {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.badge-open,
.badge-approved {
  background: var(--ok-bg);
  color: var(--ok-ink);
}

.badge-submitted {
  background: hsl(212, 78%, 94%);
  color: hsl(212, 72%, 32%);
}

.badge-ineligible,
.badge-expired,
.badge-dismissed,
.badge-draft {
  background: var(--muted-bg);
  color: var(--muted-ink);
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
}

.input,
.select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.92rem;
}

.input:focus,
.select:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

/* Landing layout */
.hero {
  padding: 64px 0 48px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: start;
}

.hero h1 {
  font-size: clamp(2.1rem, 3.6vw, 3.1rem);
  margin-bottom: 18px;
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--ink-muted);
  margin: 0 0 28px;
  max-width: 54ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.proof-metric strong {
  display: block;
  font-size: 1.3rem;
  font-family: var(--font-mono);
}

.proof-metric span {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* Calculator */
.calc-card {
  padding: 26px;
  box-shadow: var(--shadow-md);
}

.calc-card h2 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.calc-sub {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin: 0 0 20px;
}

.calc-row {
  margin-bottom: 16px;
}

.calc-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.calc-result {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 18px 0;
}

.calc-result-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  font-weight: 600;
}

.calc-result-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin: 4px 0;
}

.calc-result-note {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* Sections */
.section {
  padding: 52px 0;
  border-top: 1px solid var(--border);
}

.section-head {
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: 1.65rem;
  margin-bottom: 8px;
}

.section-head p {
  margin: 0;
  color: var(--ink-muted);
  max-width: 60ch;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step-card {
  padding: 22px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}

.step-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.step-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 780px;
}

.price-card {
  padding: 26px;
}

.price-card.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.price-amount {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  margin: 10px 0 4px;
}

.price-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

/* Console Layout */
.console-main {
  padding: 28px 0 56px;
}

.console-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-card {
  padding: 16px 18px;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 700;
  margin-top: 4px;
}

.kpi-value.accent {
  color: var(--accent);
}

.kpi-value.urgent {
  color: var(--urgent-ink);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.89rem;
}

th {
  text-align: left;
  padding: 11px 14px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

.tenant-panel {
  margin-top: 24px;
  padding: 20px;
}

.tenant-form {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 1fr 0.8fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
}

.packet-pre {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
  line-height: 1.5;
  margin: 14px 0;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 60;
}

.toast.show {
  opacity: 1;
}

@media (max-width: 900px) {
  .hero,
  .steps-grid,
  .pricing-grid,
  .kpi-grid,
  .tenant-form {
    grid-template-columns: 1fr;
  }
}

/* --- static site additions (web/build.py) --- */
.prose { max-width: 820px; padding-top: 32px; padding-bottom: 48px; }
.prose h1 { font-size: 2rem; line-height: 1.2; margin: 12px 0 16px; }
.prose h2 { font-size: 1.3rem; margin: 32px 0 10px; }
.prose p, .prose li { line-height: 1.65; }
.prose .lead { font-size: 1.1rem; color: var(--ink-muted); }
.prose .note { font-size: 0.9rem; color: var(--ink-muted); }
.crumbs { font-size: 0.85rem; color: var(--ink-muted); }
table.data { border-collapse: collapse; width: 100%; margin: 8px 0 16px; }
table.data th, table.data td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
table.data th { background: var(--surface-subtle); }
details { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; margin: 8px 0; }
summary { cursor: pointer; font-weight: 600; }
.link-list li { margin: 6px 0; }
.site-footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 24px 0; font-size: 0.85rem;
  color: var(--ink-muted); }
.footer-inner p { max-width: 820px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 0.85rem; color: var(--ink-muted); }
.demo-banner { background: var(--warn-bg); color: var(--warn-ink); padding: 10px 16px; text-align: center;
  font-size: 0.9rem; }
.calc-form { display: grid; gap: 12px; padding: 20px; }
.calc-form label { display: grid; gap: 4px; font-weight: 600; font-size: 0.9rem; }
.calc-form input, .calc-form select { padding: 8px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font: inherit; }
.calc-output { display: block; padding: 12px; background: var(--accent-soft); border-radius: var(--radius-sm); }
