/* Shared CaliberData palette + base styles for the three pages.
   Copied from pages/index.html v1; centralized so future tweaks land everywhere. */
:root {
  color-scheme: light dark;
  --paper:        #FAF7F2;
  --paper-2:      #F3EEE5;
  --paper-3:      #EBE5DA;
  --ink:          #1F5A33;
  --ink-soft:     rgba(31,90,51,0.55);
  --ink-faint:    rgba(31,90,51,0.22);
  --ink-vfaint:   rgba(31,90,51,0.08);
  --accent:       #EE7733;
  --accent-hover: #D86A2A;
  --accent-soft:  rgba(238,119,51,0.55);
  --accent-tint:  rgba(238,119,51,0.10);
  --danger:       #B73A2A;
  --warning:      #C28200;
  --success:      #2C7A4A;
  --info:         #2A6FB7;
  --shadow-card:  0 12px 32px -16px rgba(31,90,51,0.25);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #10301B;
    --paper-2:    #163E25;
    --paper-3:    #1B4A2C;
    --ink:        #FAF7F2;
    --ink-soft:   rgba(250,247,242,0.6);
    --ink-faint:  rgba(250,247,242,0.22);
    --ink-vfaint: rgba(250,247,242,0.08);
    --accent-tint: rgba(238,119,51,0.18);
  }
}
* { box-sizing: border-box; }
html, body { background: var(--paper); }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.55; font-weight: 400;
  max-width: 960px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem;
  color: var(--ink);
}
code, pre, .mono { font-family: 'Geist Mono', ui-monospace, "SF Mono", Menlo, monospace; }

.nav-logo { display: flex; align-items: center; gap: 4px; text-decoration: none; }
.nav-logo img { height: 32px; width: auto; display: block; }
.nav-logo .wordmark { font-family: 'Geist', system-ui, -apple-system, sans-serif;
                      font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.brand { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 2rem; }
.brand .divider { color: var(--ink-faint); font-size: 18px; line-height: 1; }
.brand .product { font-family: 'Geist Mono', ui-monospace, Menlo, monospace;
                   font-weight: 400; font-size: 13px; color: var(--ink-soft); letter-spacing: 0.02em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.625rem; font-weight: 700; margin: 0 0 0.375rem; letter-spacing: -0.01em; color: var(--ink); }
h2 { font-size: 1.125rem; font-weight: 600; margin: 2rem 0 0.75rem; letter-spacing: -0.01em; color: var(--ink); }
p.lede { margin: 0 0 1.75rem; color: var(--ink-soft); font-size: 14px; }
p.lede code { background: var(--paper-2); padding: 1px 0.35rem; border-radius: 4px; font-size: 12px; color: var(--ink); }

.card { padding: 1.25rem 1.5rem; border: 1px solid var(--ink-faint); border-radius: 12px;
        background: var(--paper); box-shadow: var(--shadow-card); margin-bottom: 1.25rem; }
.card.tight { padding: 0.875rem 1rem; }

.field { display: grid; gap: 0.5rem; margin-bottom: 1.25rem; }
.label { font-weight: 500; font-size: 13px; display: flex; align-items: baseline; gap: 0.5rem; color: var(--ink); }
.label .hint { font-weight: 400; color: var(--ink-soft); font-size: 12px; }

input[type=text], select {
  width: 100%; padding: 0.6rem 0.7rem; border: 1px solid var(--ink-faint); border-radius: 8px;
  font-size: 14px; background: var(--paper); color: var(--ink); font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

button.primary {
  padding: 0.7rem 1.25rem; border: 1px solid var(--accent-hover); border-radius: 8px;
  background: var(--accent); color: white; cursor: pointer; font-weight: 600; font-size: 14px;
  font-family: inherit; letter-spacing: 0.01em; transition: background 120ms ease;
}
button.primary:hover:not(:disabled) { background: var(--accent-hover); }
button.primary:disabled { opacity: 0.5; cursor: not-allowed; }

button.secondary {
  padding: 0.6rem 1rem; border: 1px solid var(--ink-faint); border-radius: 8px;
  background: var(--paper); color: var(--ink); cursor: pointer; font-weight: 500; font-size: 13px;
  font-family: inherit;
}
button.secondary:hover:not(:disabled) { border-color: var(--ink-soft); }

/* State badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px;
         font-weight: 600; letter-spacing: 0.02em; border: 1px solid transparent; }
.badge.pending,
.badge.prepping,
.badge.running   { background: var(--info);    color: white; }
.badge.prepared  { background: var(--warning); color: white; }
.badge.approved  { background: var(--accent);  color: white; }
.badge.completed { background: var(--success); color: white; }
.badge.failed    { background: var(--danger);  color: white; }

/* Tables (asset list, run list) */
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th { text-align: left; font-weight: 500; color: var(--ink-soft);
                border-bottom: 1px solid var(--ink-faint); padding: 0.5rem 0.75rem; }
table.list td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--ink-vfaint); }
table.list tr:hover td { background: var(--paper-2); }
table.list td.mono { font-family: 'Geist Mono', ui-monospace, Menlo, monospace; font-size: 12px; }

.kv-grid { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem;
           font-size: 13px; }
.kv-grid .k { color: var(--ink-soft); }
.kv-grid .v { color: var(--ink); }
.kv-grid .v.mono { font-family: 'Geist Mono', ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin: 0.75rem 0 1.25rem; }
.kpi { background: var(--paper-2); border: 1px solid var(--ink-faint); border-radius: 8px; padding: 0.75rem 0.875rem; }
.kpi .v { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); line-height: 1.1; }
.kpi .k { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

iframe.report { width: 100%; min-height: 600px; border: 1px solid var(--ink-faint); border-radius: 8px; background: white; }

.err { color: var(--danger); font-weight: 500; }
.ok  { color: var(--success); font-weight: 500; }
.muted { color: var(--ink-soft); }

.row-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

/* Stage progress (run page) */
.stages { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.stage { padding: 0.4rem 0.7rem; border-radius: 6px; border: 1px solid var(--ink-faint);
         background: var(--paper-2); font-size: 12px; color: var(--ink-soft); }
.stage.completed { background: var(--success); color: white; border-color: transparent; }
.stage.running   { background: var(--info);    color: white; border-color: transparent; }
.stage.failed    { background: var(--danger);  color: white; border-color: transparent; }

/* 1-2-3 stepper at the top of every page. Inspired by clawjournal's
   review/configure/confirmed/done progression. */
.stepper { display: flex; align-items: center; gap: 0; margin: 0 0 1.75rem;
           padding: 0; user-select: none; }
.stepper .step {
  flex: 0 0 auto; display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.75rem; border-radius: 8px;
  background: var(--paper-2); color: var(--ink-soft); border: 1px solid var(--ink-faint);
  font-size: 13px; font-weight: 500; text-decoration: none;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.stepper .step .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--paper-3); color: var(--ink-soft);
  font-size: 12px; font-weight: 700; line-height: 1;
}
.stepper .step .icon { display: inline-flex; align-items: center; line-height: 0; }
.stepper .step .icon svg { width: 16px; height: 16px; stroke: currentColor; }
.stepper .step.done {
  background: var(--success); color: white; border-color: transparent;
}
.stepper .step.done .num { background: rgba(255,255,255,0.2); color: white; }
.stepper .step.active {
  background: var(--accent); color: white; border-color: transparent;
  box-shadow: 0 6px 16px -10px rgba(238,119,51,0.7);
}
.stepper .step.active .num { background: rgba(255,255,255,0.25); color: white; }
.stepper .step.upcoming { /* default state */ }
.stepper .step.failed {
  background: var(--danger); color: white; border-color: transparent;
}
.stepper .step.failed .num { background: rgba(255,255,255,0.25); color: white; }
.stepper a.step:hover { border-color: var(--accent-soft); }
.stepper .arr {
  flex: 0 0 auto; color: var(--ink-faint); font-size: 18px; line-height: 1;
  padding: 0 0.4rem;
}
