/* Layout and components of the dashboard. Colours, fonts and the corner radius come from brand.css (generated from
   brand/tokens.json, loaded first); this file defines none of its own, except the three chart colours further down. */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 400 16px/1.5 var(--schrift-text); color: var(--schwarz); background: var(--hallenboden); }
a { color: var(--schwarz); text-decoration-color: var(--stahl); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--schwarz); }
b, strong { font-weight: 600; }
h1, h2 { font-family: var(--schrift-titel); font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.1; }
h1 { font-size: 34px; margin: 0 0 6px; }
h2 { font-size: 21px; margin: 0 0 12px; }
p { margin: 0 0 12px; }
.lead { color: var(--stahl-dunkel); margin-bottom: 28px; }
.muted { color: var(--stahl-dunkel); }
.small { font-size: 14px; }

/* keyboard focus: a dark line with a yellow edge, so it shows on the grey floor, on white cards and on the dark nav */
:focus-visible { outline: 2px solid var(--schwarz); outline-offset: 1px; box-shadow: 0 0 0 5px var(--signalgelb); }

/* layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.nav { background: var(--anthrazit); color: var(--nebel); padding: 24px 16px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.nav .brand { display: block; padding: 0 0 26px 10px; line-height: 0; }
.nav .brand img { height: 22px; width: auto; display: block; }
.nav a { color: var(--nebel); text-decoration: none; padding: 8px 10px; border-radius: var(--radius); }
.nav a:hover { color: var(--weiss); background: color-mix(in srgb, var(--weiss) 8%, transparent); }
.nav a.active { color: var(--schwarz); background: var(--signalgelb); font-weight: 600; }
.nav a.brand, .nav a.brand:hover { background: none; }
.nav .bottom { margin-top: auto; padding: 0 10px; font-size: 14px; color: var(--nebel); }
.nav .bottom button { all: unset; cursor: pointer; text-decoration: underline; }
.nav .bottom button:focus-visible { outline: 2px solid var(--schwarz); outline-offset: 1px; box-shadow: 0 0 0 5px var(--signalgelb); }
main { padding: 36px 44px 64px; max-width: 1180px; min-width: 0; }   /* min-width: wide tables scroll inside their card */

/* blocks */
.card { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; overflow-x: auto; }   /* a wide table scrolls inside its card */
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.side { grid-template-columns: 2fr 1fr; }
.grid.video { grid-template-columns: 340px 1fr; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stats.five { grid-template-columns: repeat(5, 1fr); }
.stats.seven { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.stat { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font: 800 34px/1.1 var(--schrift-titel); font-variant-numeric: tabular-nums; }
.notice { border-left: 4px solid var(--signalgelb); background: var(--weiss); padding: 10px 14px; margin-bottom: 8px; border-radius: 0 var(--radius) var(--radius) 0; }
.notice.error { border-left-color: var(--fehler); }

/* tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--stahl-dunkel); font-weight: 500; padding: 0 10px 8px 0; border-bottom: 1px solid var(--linie); }
td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--linie); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.actions form { display: inline; }
td.nowrap { white-space: nowrap; }

/* status pills: square, capitals, title font. Yellow is kept for what waits for a person */
.pill { display: inline-block; font: 600 13px/1.3 var(--schrift-titel); text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border: 1px solid transparent; border-radius: 0; background: var(--hallenboden); color: var(--schwarz); white-space: nowrap; }
.pill.in_arbeit, .pill.laeuft, .pill.wird_geplant { background: transparent; border-color: var(--anthrazit); }
.pill.wartet { background: var(--warnung-flaeche); }
.pill.vorgeschlagen { background: var(--signalgelb); }
.pill.freigegeben { background: var(--weiss); border-color: var(--gut); color: var(--gut); }
.pill.fertig, .pill.online { background: var(--gut-flaeche); color: var(--gut); }
.pill.geplant, .pill.veroeffentlicht { background: var(--anthrazit); color: var(--weiss); }
.pill.fehler, .pill.verworfen { background: var(--fehler-flaeche); color: var(--fehler); }
.tag { font-size: 12px; color: var(--stahl-dunkel); border: 1px solid var(--linie); border-radius: var(--radius); padding: 0 6px; white-space: nowrap; }

/* forms */
form.stack { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--stahl-dunkel); }
input[type=text], input[type=email], input[type=password], input[type=time], input[type=number], select, textarea {
  font: inherit; font-size: 16px; color: var(--schwarz); background: var(--weiss); border: 1px solid var(--stahl); border-radius: var(--radius); padding: 8px 10px; width: 100%;
}
input[type=checkbox] { accent-color: var(--anthrazit); }
textarea { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 120px; }
.checks { display: flex; gap: 6px; flex-wrap: wrap; }
.checks label, label.check { display: flex; align-items: center; gap: 6px; color: var(--schwarz); font-size: 15px; }
.btn { font: 600 16px/1.2 var(--schrift-titel); text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer; border: 1px solid var(--signalgelb); background: var(--signalgelb); color: var(--schwarz); padding: 9px 16px; border-radius: var(--radius); text-decoration: none; display: inline-block; }
.btn:hover { background: var(--schwarz); border-color: var(--schwarz); color: var(--weiss); }
.btn.quiet { background: var(--weiss); color: var(--schwarz); border-color: var(--stahl); }
.btn.quiet:hover { background: var(--weiss); color: var(--schwarz); border-color: var(--schwarz); }
.btn.small { padding: 4px 10px; font-size: 14px; }
.btn.danger { background: var(--weiss); color: var(--fehler); border-color: var(--fehler); }
.btn.danger:hover { background: var(--fehler); color: var(--weiss); border-color: var(--fehler); }

/* video detail */
.player { width: 100%; max-width: 320px; aspect-ratio: 9 / 16; background: var(--anthrazit); border-radius: var(--radius); }
.player.empty { display: grid; place-items: center; color: var(--nebel); }
.script { white-space: pre-wrap; line-height: 1.65; }
pre.log { white-space: pre-wrap; font: 12px/1.5 ui-monospace, Menlo, monospace; background: var(--hallenboden); border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px; max-height: 480px; overflow: auto; }
details summary { cursor: pointer; }

/* login: the wordmark is drawn for a dark ground, so the page is dark and the form sits on a card */
.login-page { background: var(--anthrazit); }
.login { max-width: 360px; margin: 14vh auto; padding: 0 16px; }
.login .wordmark { display: block; height: 30px; width: auto; margin: 0 0 24px; }
.login h1 { font-size: 26px; margin-bottom: 16px; }
.error { color: var(--fehler); }

/* statistics. The three network colours are a validated set (colour-blind safe); text never wears them, the mark beside it does */
:root { --series-instagram: #eb6834; --series-tiktok: #1baf7a; --series-youtube: #2a78d6; }
.filters { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: -8px 0 20px; }
.range { display: flex; gap: 4px; }
.range a { font: 600 14px/1.3 var(--schrift-titel); text-transform: uppercase; letter-spacing: 0.05em; text-decoration: none; padding: 5px 12px; border-radius: var(--radius); border: 1px solid var(--stahl); background: var(--weiss); color: var(--schwarz); }
.range a.active { background: var(--signalgelb); border-color: var(--signalgelb); }
.refresh { display: flex; align-items: center; gap: 10px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: var(--radius); vertical-align: baseline; }
.key.instagram, .stroke.instagram { background: var(--series-instagram); }
.key.tiktok, .stroke.tiktok { background: var(--series-tiktok); }
.key.youtube, .stroke.youtube { background: var(--series-youtube); }
table.numbers td.n, table.numbers th.n, table.facts td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.numbers th.n { padding-right: 10px; }
table.sortable th[data-sort] { cursor: pointer; user-select: none; }
table.numbers th:nth-child(2) { width: 36%; }
table.sortable th[data-dir=down]::after { content: " ↓"; }
table.sortable th[data-dir=up]::after { content: " ↑"; }
table.facts td { padding: 6px 0; }
.follow { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--linie); }
.follow:last-child { border-bottom: 0; }
.follow b { font: 800 28px/1.1 var(--schrift-titel); font-variant-numeric: tabular-nums; }

.scroll { overflow-x: auto; }
.viz { position: relative; }
.viz svg { display: block; }
.viz .grid { stroke: var(--linie); stroke-width: 1; }
.viz .tick { fill: var(--stahl-dunkel); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz .value { fill: var(--schwarz); font-size: 12px; }
.viz .fill.instagram { fill: var(--series-instagram); }
.viz .fill.tiktok { fill: var(--series-tiktok); }
.viz .fill.youtube { fill: var(--series-youtube); }
.viz .fill.neutral { fill: var(--anthrazit); }
.viz .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz .line.instagram { stroke: var(--series-instagram); }
.viz .line.tiktok { stroke: var(--series-tiktok); }
.viz .line.youtube { stroke: var(--series-youtube); }
.viz .dot { stroke: var(--weiss); stroke-width: 2; }
.viz .dot.instagram { fill: var(--series-instagram); }
.viz .dot.tiktok { fill: var(--series-tiktok); }
.viz .dot.youtube { fill: var(--series-youtube); }
.viz .cross { stroke: var(--stahl-dunkel); stroke-width: 1; }
.viz .hit { fill: transparent; cursor: pointer; }
.viz .spark .hit, .viz.spark .hit { cursor: default; }
.viz .column:hover .fill { opacity: 0.78; }
.viz .legend { display: flex; gap: 16px; font-size: 14px; margin-bottom: 8px; }
.viz .tip { position: absolute; top: 4px; z-index: 2; pointer-events: none; background: var(--anthrazit); color: var(--weiss); border-radius: var(--radius); padding: 8px 10px; font-size: 14px; max-width: 280px; box-shadow: 0 4px 14px color-mix(in srgb, var(--schwarz) 18%, transparent); }
.viz .tip-title { color: var(--nebel); margin-bottom: 4px; }
.viz .tip-row { display: flex; align-items: center; gap: 6px; }
.viz .tip-row b { font-weight: 600; }
.viz .tip-row span { color: var(--nebel); }
.viz .stroke { display: inline-block; width: 12px; height: 3px; border-radius: var(--radius); }

@media (max-width: 1000px) { .stats.five { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); } }
@media (max-width: 900px) { .grid.three, .grid.two, .grid.side, .grid.video { grid-template-columns: 1fr; } }
/* narrow screens: the navigation moves to the top and wraps */
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 14px 16px; }
  .nav .brand { flex-basis: 100%; padding: 0 0 12px; }
  .nav .bottom { margin: 0 0 0 auto; }
  main { padding: 24px 16px 48px; }
}
