/* saffron-ops dashboard — one small stylesheet, light + dark, phone first. Surfaces/ink per the dataviz palette;
   status colors are reserved for state and always sit next to a text label. */
:root {
  --plane: #f9f9f7; --surface: #fcfcfb; --ink: #0b0b0b; --ink2: #52514e; --muted: #898781; --line: #e6e4df;
  --accent: #c2410c; --link: #9a3412; --blue: #2a78d6;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d7263d;
  --good-text: #006300; --serious-text: #b3400f; --critical-text: #b3001b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --plane: #0d0d0d; --surface: #1a1a19; --ink: #ffffff; --ink2: #c3c2b7; --muted: #898781; --line: #2c2c2a;
    --accent: #f59e0b; --link: #fbbf24; --blue: #3987e5;
    --good-text: #5fd35f; --serious-text: #f0a080; --critical-text: #ff6b7a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--plane); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); }
h1 { font-size: 1.4rem; margin: .2rem 0 .8rem; }
h1 .sub, h2 .sub { font-weight: 400; text-transform: none; letter-spacing: 0; }
header.top { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.brand span { color: var(--accent); }
nav { display: flex; flex-wrap: wrap; gap: .1rem .5rem; font-size: .92rem; }
nav a { color: var(--ink2); text-decoration: none; padding: .15rem .35rem; border-radius: 4px; }
nav a.on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--ink); }
form.inline { margin-left: auto; }
.linklike { background: none; border: 0; color: var(--ink2); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
main { max-width: 1100px; margin: 0 auto; padding: 1rem; }
footer { max-width: 1100px; margin: 1rem auto 2rem; padding: 0 1rem; color: var(--muted); font-size: .85rem; }
.banner { padding: .7rem 1rem; font-weight: 600; }
.banner.critical { background: color-mix(in srgb, var(--critical) 18%, var(--surface)); border-bottom: 2px solid var(--critical); }
.status { background: var(--surface); border-left: 4px solid var(--accent); padding: .5rem .8rem; border-radius: 0 6px 6px 0; }

/* KPI row: stat tiles, one hero figure */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .8rem .9rem; min-width: 0; }
.tile.hero { grid-column: span 2; }
@media (max-width: 420px) { .tile.hero { grid-column: span 1; } }
.tile .label { color: var(--ink2); font-size: .85rem; }
.tile .value { font-size: 1.75rem; font-weight: 600; line-height: 1.15; margin: .15rem 0; }
.tile.hero .value { font-size: 3rem; }
.tile .sub { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }  /* long bases: 3 lines, full text on hover */
.tile .delta { font-size: .85rem; font-weight: 600; }
.delta.good { color: var(--good-text); }
.delta.serious { color: var(--serious-text); }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: .8rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; margin-bottom: .8rem; min-width: 0; }
.card h2 { font-size: .85rem; margin: 0 0 .5rem; color: var(--ink2); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
h2.inline { display: inline; }
ul.rows { list-style: none; margin: 0; padding: 0; }
ul.rows li { padding: .4rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
ul.rows li:first-child { border-top: 0; }
.sub { color: var(--muted); font-size: .85rem; }
.date { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .85rem; margin-right: .35rem; }
.crumbs { margin: 0 0 .6rem; }

.chip { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .03em; padding: .05rem .45rem; border-radius: 999px;
  border: 1px solid var(--muted); background: color-mix(in srgb, var(--muted) 15%, transparent); color: var(--ink); vertical-align: middle; margin-right: .3rem; }
.chip.good { border-color: var(--good); background: color-mix(in srgb, var(--good) 16%, transparent); }
.chip.warning { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 22%, transparent); }
.chip.serious { border-color: var(--serious); background: color-mix(in srgb, var(--serious) 20%, transparent); }
.chip.critical { border-color: var(--critical); background: color-mix(in srgb, var(--critical) 16%, transparent); }
.chip.accent { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; vertical-align: top; padding: .4rem .5rem; border-top: 1px solid var(--line); }
th { color: var(--ink2); font-weight: 600; border-top: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
.filters a { margin-right: .5rem; }
.filters a.on { font-weight: 700; color: var(--ink); }

.doc { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.2rem; overflow-wrap: anywhere; }
.doc h1 { font-size: 1.3rem; } .doc h2 { font-size: 1.1rem; } .doc h3 { font-size: 1rem; }
.doc table { display: block; overflow-x: auto; width: max-content; max-width: 100%; }
.doc pre, pre.raw { overflow-x: auto; background: var(--plane); padding: .6rem; border-radius: 6px; font-size: .85rem; white-space: pre-wrap; }
.doc img { max-width: 100%; }
.doc code { font-size: .9em; }
details { margin: .2rem 0; }
summary { cursor: pointer; list-style: revert; }

.auth { max-width: 440px; margin: 2.5rem auto; }
.auth label { display: block; font-weight: 600; margin-top: .6rem; }
.auth input { width: 100%; font: inherit; padding: .55rem; margin: .3rem 0 .4rem; border: 1px solid var(--muted); border-radius: 6px; background: var(--surface); color: var(--ink); }
.auth button { font: inherit; padding: .55rem 1.1rem; margin-top: .6rem; border-radius: 6px; border: 0; background: var(--accent); color: #fff; cursor: pointer; font-weight: 600; }
.error { color: var(--critical-text); font-weight: 600; }
