/* Sober, functional admin styling. Intentionally minimal/fillable — the public-facing
   visual design comes later (Claude Design). A subtle nineties hint: monospace for codes
   and status chips, a single cyan accent. */
:root {
  --ink: #1c1f23;
  --muted: #6b7280;
  --line: #e3e6ea;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --accent: #0bbbd6;
  --accent-ink: #06647a;
  --ok: #1a7f37;
  --warn: #b54708;
  --bad: #b42318;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
header.topbar {
  display: flex; align-items: center; gap: 1.5rem;
  background: var(--ink); color: #fff; padding: 0 1.25rem; height: 52px;
}
header.topbar .brand { font-weight: 700; letter-spacing: .02em; }
header.topbar .brand small { color: var(--accent); font-family: var(--mono); font-weight: 400; }
header.topbar nav { display: flex; gap: 1rem; }
header.topbar nav a { color: #cfd4da; font-size: 14px; }
header.topbar nav a:hover, header.topbar nav a.active { color: #fff; text-decoration: none; }
header.topbar .spacer { flex: 1; }
header.topbar .who { color: #cfd4da; font-size: 13px; }
main { max-width: 1100px; margin: 1.5rem auto; padding: 0 1.25rem; }
h1 { font-size: 22px; margin: 0 0 1rem; }
h2 { font-size: 17px; margin: 1.5rem 0 .6rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr:last-child td { border-bottom: none; }
.code { font-family: var(--mono); background: #eef2f4; padding: .05rem .4rem; border-radius: 4px; font-size: 13px; }
.chip {
  font-family: var(--mono); font-size: 12px; padding: .1rem .45rem; border-radius: 999px;
  border: 1px solid var(--line); background: #f1f3f5; color: var(--muted); white-space: nowrap;
}
.chip.ok { color: var(--ok); border-color: #b7e0c0; background: #ecf8ef; }
.chip.warn { color: var(--warn); border-color: #f3d6a8; background: #fdf3e6; }
.chip.bad { color: var(--bad); border-color: #f3b8b0; background: #fdecea; }
.chip.accent { color: var(--accent-ink); border-color: #aee7f1; background: #e7f9fc; }
.muted { color: var(--muted); }
.btn {
  display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: .4rem .8rem; border-radius: 6px; font-size: 14px; cursor: pointer;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04303b; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.small { padding: .25rem .55rem; font-size: 13px; }
form.inline { display: inline; }
label { display: block; font-size: 13px; color: var(--muted); margin: .6rem 0 .2rem; }
input[type=text], input[type=number], input[type=email], input[type=password], select, textarea {
  width: 100%; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 6px; font: inherit;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: .35rem 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.timeline li:last-child { border-bottom: none; }
.timeline .when { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.flash { padding: .6rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash.success { background: #ecf8ef; color: var(--ok); border: 1px solid #b7e0c0; }
.flash.error { background: #fdecea; color: var(--bad); border: 1px solid #f3b8b0; }
.login-wrap { max-width: 360px; margin: 12vh auto; }
.thumbs { display: flex; gap: .6rem; flex-wrap: wrap; }
.thumb { width: 120px; height: 80px; background: repeating-linear-gradient(45deg,#dfe3e7,#dfe3e7 8px,#e9edf0 8px,#e9edf0 16px); border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: center; }

/* Step indicator: coarse process phases on tape pages. */
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1rem; padding: 0; }
.steps li {
  font-size: 13px; padding: .25rem .7rem; border: 1px solid var(--line); border-radius: 999px;
  background: #f1f3f5; color: var(--muted); position: relative;
}
.steps li.done { background: #ecf8ef; border-color: #b7e0c0; color: var(--ok); }
.steps li.done::before { content: "✓ "; }
.steps li.active { background: var(--accent); border-color: var(--accent); color: #04303b; font-weight: 600; }
.steps li.aborted { background: transparent; border: none; padding: .25rem 0; }
.steps li:not(:last-child)::after {
  content: ""; position: absolute; right: -.35rem; top: 50%; width: .35rem; height: 1px; background: var(--line);
}

/* Media gallery: preview video, keyframes and contact sheet on tape/QA pages. */
.media-video { width: 100%; max-width: 640px; background: #000; border-radius: 6px; }
.keyframes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.keyframes a { display: block; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.keyframes img, .contactsheet img { display: block; width: 100%; height: auto; }
.keyframes a:hover, .contactsheet a:hover { border-color: var(--accent); }
.contactsheet a { display: block; max-width: 480px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.filelist td.num { font-family: var(--mono); font-size: 13px; white-space: nowrap; }

/* Capture page: one panel per deck with live frame, stats and L/R audio meters. */
.capture-deck .deck-head { display: flex; align-items: baseline; gap: .75rem; }
.capture-deck .deck-head h2 { margin: 0; }
.capture-deck .deck-head .spacer { flex: 1; }
.deck-live { display: grid; grid-template-columns: minmax(0, 480px) 1fr; gap: 1.25rem; margin-top: .8rem; }
.deck-preview { background: #000; border-radius: 6px; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.deck-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.deck-nopreview { color: #9aa1a9; font-family: var(--mono); font-size: 13px; }
.deck-stats { width: auto; }
.deck-stats th, .deck-stats td { padding: .25rem .4rem; border: none; }
.deck-stats th { padding-right: 1.5rem; }
.deck-stats td { font-family: var(--mono); font-size: 14px; }
.meters { margin: .8rem 0 1rem; }
.meter { display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.meter-label { font-family: var(--mono); font-size: 12px; color: var(--muted); width: 1rem; }
.meter-track { position: relative; flex: 1; height: 12px; border-radius: 3px; overflow: hidden;
  background: linear-gradient(90deg, #e7f4ea 0 75%, #fdf3e6 75% 90%, #fdecea 90%); border: 1px solid var(--line); }
.meter-rms { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ok); transition: width .3s; }
.meter-peak { position: absolute; top: 0; bottom: 0; width: 2px; left: 0; background: var(--ink); transition: left .3s; }
.meter.clip .meter-peak { background: var(--bad); }
.meter-db { font-family: var(--mono); font-size: 12px; width: 3.5rem; text-align: right; color: var(--muted); }
@media (max-width: 760px) { .deck-live { grid-template-columns: 1fr; } }

/* Irreversible actions. */
.panel.danger { border-color: #f3b8b0; }
.panel.danger h2 { color: var(--bad); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
.btn.danger:hover { filter: brightness(1.1); }

/* Tape overview: phase filter chips + search. */
.phase-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.phase-filter .chip { font-size: 13px; padding: .2rem .6rem; text-decoration: none; }
.phase-filter .chip strong { margin-left: .25rem; }
.overview-search { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.overview-search input[type=text] { max-width: 12rem; }
.overview-search label { display: inline-flex; align-items: center; gap: .35rem; margin: 0; }
td.num { font-family: var(--mono); font-size: 13px; white-space: nowrap; }

/* Scene list (M3). */
.scene-list { max-height: 28rem; overflow-y: auto; }
.scene-list td, .scene-list th { padding: .3rem .5rem; }
.scene-list tr.scene-event td { background: #f1f3f5; font-weight: 600; font-size: 13px; }
.scene-list tr.after-cut td { opacity: .45; }
.tags .chip { margin-bottom: .25rem; display: inline-block; }
.scene-ai summary { cursor: pointer; }
.scene-ai p { margin: .35rem 0; font-size: 14px; }
.scene-ai .transcript { color: var(--muted); font-style: italic; }
h3 { font-size: 15px; margin: 1.1rem 0 .3rem; }

/* ── Mobile (phones; the admin is used on the phone via Tailscale) ─────────────────────────── */
.panel { overflow-x: auto; }               /* wide tables scroll inside their panel */
img, video { max-width: 100%; }
@media (max-width: 760px) {
  body { font-size: 15px; }
  header.topbar { flex-wrap: wrap; height: auto; gap: .2rem .8rem; padding: .5rem .9rem 0; }
  header.topbar .brand { order: 1; }
  header.topbar .spacer { order: 2; }
  header.topbar .who { order: 3; }
  header.topbar span.who { display: none; }  /* the e-mail address; "Uitloggen" stays */
  header.topbar nav {
    order: 4; flex-basis: 100%; overflow-x: auto; gap: 1.1rem; padding: .45rem 0 .55rem;
    white-space: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  header.topbar nav::-webkit-scrollbar { display: none; }
  header.topbar nav a { font-size: 15px; }
  main { margin: 1rem auto; padding: 0 .75rem; }
  h1 { font-size: 20px; }
  .panel { padding: .85rem .9rem; border-radius: 6px; }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  th, td { padding: .45rem .45rem; }
  .hide-sm { display: none; }
  input[type=text], input[type=number], input[type=email], input[type=password], select, textarea { font-size: 16px; }
  .btn { padding: .55rem .9rem; font-size: 15px; }
  .btn.small { padding: .4rem .7rem; font-size: 14px; }
  .phase-filter { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .3rem; }
  .phase-filter .chip { flex: none; }
  .overview-search { flex-wrap: wrap; }
  .overview-search input[type=text] { max-width: none; flex: 1 1 10rem; }
  .capture-deck .deck-head { flex-wrap: wrap; }
  .scene-list { max-height: none; }
  .steps li { font-size: 12px; padding: .2rem .55rem; }
  .keyframes { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}
