/* ============================================================================
   Kobalt AIPE — AI post-editing
   Same visual system as Parla / metrics.kobalt.es: warm editorial "ledger"
   aesthetic. Geist / Geist Mono / Newsreader, paper background, navy accent.
   Tokens and component patterns copied verbatim from kobalt-vox's
   ui/static/style.css so this tool reads as part of the same suite.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400;1,6..72,500&display=swap");

:root {
  --bg: #faf9f5;          /* warm paper */
  --panel: #ffffff;       /* card surface */
  --line: #e8e6df;        /* hairline */
  --ink: #111111;         /* primary text */
  --muted: #807e76;       /* warm gray */
  --accent: #0e2a5b;      /* deep navy */
  --ok: #1f6b3a;          /* forest green */
  --warn: #b06f1a;        /* paper ochre */
  --bad: #a33b2a;         /* rust */
  --radius: 10px;

  --ink-2: #3a3a38;
  --hairline-strong: #d8d5cc;
  --accent-soft: #e5e9f1;
  --surface-sunken: #fbfaf7;
  --radius-sm: 7px;
  --radius-pill: 999px;

  --ok-soft: #e6efe8;
  --bad-soft: #f3e6e2;
  --warn-soft: #f3ebde;

  --shadow-card: 0 1px 2px rgba(17, 17, 17, .03), 0 1px 1px rgba(17, 17, 17, .02);
  --shadow-pop: 0 8px 24px -12px rgba(17, 17, 17, .18);

  --sans: "Geist", "Helvetica Neue", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
  --serif: "Newsreader", Georgia, serif;

  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono  { font-family: var(--mono); font-feature-settings: "tnum" 1; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; }

.eyebrow {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .09em; color: var(--muted);
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 17px; }
h3 { font-size: 14.5px; }

/* ---------- header + brand ---------- */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 27px; height: 27px; border-radius: 8px; background: var(--accent);
  display: inline-flex; align-items: flex-end; justify-content: center;
  gap: 2.5px; padding: 6px 6px 7px; flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(14, 42, 91, .28);
}
.brand-mark i { width: 2.5px; border-radius: 2px; background: #fff; opacity: .95; }
.brand-mark i:nth-child(1) { height: 6px; }
.brand-mark i:nth-child(2) { height: 13px; }
.brand-mark i:nth-child(3) { height: 9px; }
.brand-word {
  font-size: 18px; font-weight: 600; letter-spacing: -.02em; color: var(--ink);
}
.brand-sep { width: 1px; height: 16px; background: var(--hairline-strong); }
.brand-sub { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 15px; }

/* ---------- layout — views & panels ---------- */
.view {
  max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px;
  display: grid; gap: 22px;
}
.hidden { display: none !important; }

.view-intro { display: grid; gap: 6px; padding: 6px 2px 2px; }
.view-intro h1 { font-size: 30px; font-weight: 600; letter-spacing: -.025em; }
.view-lede { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 16px; }

.list-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 22px; align-items: start; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.panel-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.panel-head h3 { margin: 0; }
.spacer { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  padding: 8px 13px; cursor: pointer; font: inherit; font-weight: 500;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  line-height: 1; white-space: nowrap;
  transition: border-color .15s var(--ease), background-color .15s var(--ease),
              color .15s var(--ease), box-shadow .15s var(--ease), transform .05s var(--ease);
}
.btn:hover { border-color: var(--muted); background: var(--surface-sunken); }
.btn:active { transform: translateY(.5px); }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(14, 42, 91, .25);
}
.btn.primary:hover { background: #0b2149; border-color: #0b2149; }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-sunken); border-color: var(--line); color: var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- chips (single-select guideline picker) ---------- */
.lang-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 4px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px; font: inherit;
  font-size: 12px; cursor: pointer; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
}
.chip:hover { border-color: var(--muted); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-code { font-size: 10px; opacity: .55; }
.chip.active .chip-code { opacity: .85; }

/* ---------- forms ---------- */
.form { display: grid; gap: 13px; }
.form label {
  display: grid; gap: 5px;
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted);
}
input, textarea, select {
  background: var(--surface-sunken);
  border: 1px solid var(--line); color: var(--ink);
  border-radius: var(--radius-sm); padding: 9px 11px; font: 14px/1.4 var(--sans);
  width: 100%; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); background: var(--panel);
}
input[type=file] { padding: 7px; cursor: pointer; }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 500; margin-right: 10px; cursor: pointer;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--hairline-strong); border-radius: 6px; padding: 5px 11px;
}
input[type=file]::file-selector-button:hover { border-color: var(--muted); }
.form .btn.primary { margin-top: 4px; justify-content: center; padding: 10px; }

/* ---------- badges (status pills) ---------- */
.badge {
  font-size: 11px; font-weight: 500; color: var(--muted);
  border: 1px solid var(--line); background: var(--surface-sunken);
  padding: 3px 9px; border-radius: var(--radius-pill);
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap;
}
.badge.ok    { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn  { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad   { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.accent{ background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------- job status ---------- */
.status-line { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.error-box {
  white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px;
  background: var(--bad-soft); color: var(--ink-2);
  border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent);
  border-radius: var(--radius-sm); padding: 14px;
}

.stat-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.stat-list li {
  border: 1px solid var(--line); background: var(--surface-sunken);
  border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px;
}
.stat-list li strong { font-family: var(--mono); color: var(--ink-2); }

/* ---------- report tables ---------- */
table { border-collapse: collapse; width: 100%; margin: 4px 0 6px; font-size: 13px; }
th, td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
th {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted);
}
tbody tr:hover { background: var(--surface-sunken); }
tr.outlier td { background: var(--warn-soft); }
td:first-child { font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }

/* ---------- project/job list (reserved for a future run-history panel) ---------- */
.project-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.project-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel);
}

@media (max-width: 940px) {
  .list-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .view { padding: 20px 16px 48px; }
  header { padding: 12px 16px; }
}
