/* Robinson Ops : charte robinson.agency (papier chaud, encre ardoise, accent rouille). Montserrat et Libre Baskerville, SIL Open Font License. */
@font-face { font-family: 'Robinson Montserrat'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/montserrat-latin.woff2') format('woff2'); }
@font-face { font-family: 'Robinson Baskerville'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/libre-baskerville-latin.woff2') format('woff2'); }

:root {
  --paper: #F3F2EF; --panel: #FFFFFF; --sand: #EDEBE6; --ink: #22313B; --slate: #3A4F5C;
  --muted: #6B7A85; --line: #D9DEE2; --mist: #B9C4CC; --rust: #C8502E; --ochre: #B7862F; --sage: #4F7A5A;
  --sans: 'Robinson Montserrat', Montserrat, 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Robinson Baskerville', 'Libre Baskerville', Baskerville, Georgia, serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 15px; line-height: 1.6; }
a { color: var(--slate); }
:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; }

.topbar { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { font-family: var(--sans); font-weight: 600; font-size: 13px; letter-spacing: .32em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.brand small { letter-spacing: .12em; color: var(--muted); font-weight: 600; margin-left: 6px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--slate); text-decoration: none; padding: 6px 10px; }
.nav a:hover { color: var(--rust); }
.nav a[aria-current="page"] { color: #fff; background: var(--slate); }
.user { display: flex; align-items: center; gap: 10px; font-family: var(--sans); font-size: 12px; color: var(--muted); }
.user button { font: inherit; font-weight: 600; color: var(--slate); background: none; border: 1px solid var(--line); padding: 4px 10px; cursor: pointer; }

.page { max-width: 1280px; margin: 0 auto; padding: 32px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 36px; }
@media (min-width: 720px) { .page { padding-left: 40px; padding-right: 40px; } }
.eyebrow { font-family: var(--sans); color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin: 0; }
h1 { font-family: var(--sans); font-weight: 700; font-size: clamp(26px, 3.6vw, 36px); line-height: 1.15; color: var(--slate); margin: 4px 0 0; text-wrap: balance; }
h2 { font-family: var(--sans); font-size: 20px; font-weight: 700; color: var(--slate); margin: 0; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
h3 { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--ink); margin: 0; }
.lead { font-size: 16px; max-width: 70ch; margin: 8px 0 0; }
.lead b, .num-inline { font-family: var(--sans); font-weight: 700; color: var(--rust); font-variant-numeric: tabular-nums; }
.note { color: var(--muted); font-size: 14px; margin: 0; max-width: 80ch; }
section[id] { scroll-margin-top: 150px; }
.block { display: grid; gap: 12px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 32px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tile { background: var(--panel); padding: 18px 20px; display: grid; gap: 6px; align-content: start; box-shadow: inset 0 3px 0 var(--mist); text-decoration: none; color: inherit; }
a.tile:hover { background: var(--paper); }
.tile.bad { box-shadow: inset 0 3px 0 var(--rust); }
.tile.warn { box-shadow: inset 0 3px 0 var(--ochre); }
.tile.ok { box-shadow: inset 0 3px 0 var(--slate); }
.tile-label { font-family: var(--sans); font-weight: 600; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.tile-value { font-family: var(--sans); font-weight: 700; font-size: 30px; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.tile-note { font-size: 13px; color: var(--muted); }

.scroll { overflow: auto; max-height: 560px; border: 1px solid var(--line); background: var(--panel); }
.table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 13px; font-variant-numeric: tabular-nums; }
.table th { position: sticky; top: 0; background: var(--sand); text-align: left; font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--slate); padding: 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th > span, .table th > a { display: block; padding: 10px 12px; color: inherit; text-decoration: none; }
.table th > a:hover { color: var(--rust); }
.table th > a::after { content: ' \2195'; opacity: .35; font-size: 10px; }
.table th[aria-sort="ascending"] > a::after { content: ' \2191'; opacity: 1; }
.table th[aria-sort="descending"] > a::after { content: ' \2193'; opacity: 1; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:hover td { background: var(--paper); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table td.empty { color: var(--muted); text-align: center; padding: 20px; }
.link { color: var(--slate); font-weight: 600; white-space: nowrap; text-decoration: underline; text-decoration-color: var(--mist); text-underline-offset: 3px; }
.link:hover { color: var(--rust); text-decoration-color: currentColor; }

.pill { display: inline-block; padding: 2px 9px; font-size: 11px; font-weight: 600; white-space: nowrap; border: 1px solid currentColor; }
.pill.bad { color: var(--rust); }
.pill.warn { color: var(--ochre); }
.pill.mut { color: var(--muted); }
.pill.ok { color: var(--sage); }

.bars { display: grid; gap: 8px; background: var(--panel); border: 1px solid var(--line); padding: 16px; font-family: var(--sans); font-size: 12px; }
.bar-row { display: grid; grid-template-columns: 80px 1fr; gap: 12px; align-items: center; }
.bar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar { height: 22px; background: var(--mist); min-width: 2px; }
.bar.warn { background: var(--ochre); }
.bar.bad { background: var(--rust); }
.bar-value { font-weight: 600; white-space: nowrap; }

.filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--slate); }
.filter select, .field input { font-family: var(--sans); font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); max-width: 100%; }
.button { font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: var(--slate); color: #fff; border: 0; padding: 11px 18px; cursor: pointer; }
.button:hover { background: var(--ink); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { background: var(--panel); border: 1px solid var(--line); padding: 32px; width: min(420px, 100%); display: grid; gap: 18px; }
.field { display: grid; gap: 6px; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--slate); }
.flash { font-family: var(--sans); font-size: 13px; padding: 10px 12px; background: var(--sand); border-left: 3px solid var(--sage); }
.error { font-family: var(--sans); font-size: 12px; color: var(--rust); text-transform: none; letter-spacing: 0; font-weight: 400; }
.footer-note { font-family: var(--sans); font-size: 12px; color: var(--muted); }

.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; background: var(--rust); color: #fff; font-size: 10px; line-height: 18px; text-align: center; border-radius: 9px; letter-spacing: 0; }
.tabs { display: flex; gap: 0; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs a { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--slate); text-decoration: none; padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { border-bottom-color: var(--rust); color: var(--ink); }
.toolbar { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.button.secondary { background: var(--panel); color: var(--slate); border: 1px solid var(--line); }
a.button { text-decoration: none; display: inline-block; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; align-items: end; }
.field select, .field textarea { font-family: var(--sans); font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); width: 100%; text-transform: none; letter-spacing: 0; font-weight: 400; }
.field input { width: 100%; text-transform: none; letter-spacing: 0; font-weight: 400; }
.field textarea { min-height: 110px; font-family: var(--serif); font-size: 15px; line-height: 1.5; }
.card { background: var(--panel); border: 1px solid var(--line); padding: 20px; display: grid; gap: 14px; min-width: 0; }
.prewrap { white-space: pre-wrap; margin: 0; font-size: 14px; }
.meta { display: flex; gap: 8px 18px; flex-wrap: wrap; font-family: var(--sans); font-size: 12px; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border: 1px solid var(--line); background: var(--panel); }
.timeline li { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.timeline li:last-child { border-bottom: 0; }
.timeline li.event { background: var(--paper); font-family: var(--sans); font-size: 12px; color: var(--muted); }
.timeline .who { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--slate); }
.late { color: var(--rust); font-weight: 600; }
.task-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 32px; align-items: start; }
@media (max-width: 860px) { .task-layout { grid-template-columns: 1fr; } }
