/* Tandem-Verwaltung – dunkles Erscheinungsbild angelehnt an HaloAP */
:root {
  --bg: #1b1b1b;
  --surface: #262626;
  --surface-2: #2f2f2f;
  --line: #3a3a3a;
  --text: #e8e8e8;
  --text-2: #b4b4b4;
  --muted: #8a8a8a;
  --accent: #26a69a;
  --accent-hover: #2fbcae;
  --accent-ink: #0d1f1d;
  --series: #3987e5;
  --danger: #e5534b;
  --warn: #d8a13a;
  --ok: #3fb950;
  --radius: 6px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font-size: 18px; }
h3 { font-size: 14px; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--danger); min-height: 1.2em; margin: 6px 0 0; }
.msg { color: var(--text-2); }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }

button {
  font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 6px 14px; cursor: pointer;
}
button:hover { border-color: #555; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover { background: var(--accent-hover); }
button.ghost { background: transparent; }
button.danger-ghost { background: transparent; color: var(--danger); border-color: #5a2a28; }
button.link { background: none; border: none; padding: 2px 6px; color: var(--accent); }
button.link.danger { color: var(--danger); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

input, select {
  font: inherit; color: var(--text); background: #1f1f1f; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 7px 10px; width: 100%;
}
label { display: block; color: var(--text-2); font-size: 12px; margin: 12px 0 0; }
label > input, label > select { margin-top: 4px; }
label.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text); }
label.check input { width: auto; margin: 0; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; }
.brand img { width: 24px; height: 24px; }
.badge { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 3px; padding: 1px 5px; }

/* Anmeldung */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.auth-card h1 { font-size: 18px; margin: 18px 0 4px; }
.auth-card button { width: 100%; margin-top: 18px; padding: 9px; }

/* Rahmen */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 0 20px; height: 52px;
  background: #141414; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 15px 12px 13px; color: var(--text-2); white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.who { display: flex; align-items: center; gap: 10px; color: var(--text-2); white-space: nowrap; }
main { max-width: 1200px; margin: 0 auto; padding: 20px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { border: none; border-radius: 0; background: transparent; color: var(--text-2); padding: 5px 12px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--surface-2); color: var(--text); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.form { max-width: 640px; }
.form h3 { margin-bottom: 6px; }
.form p.muted { margin: 0 0 8px; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.kv { display: flex; gap: 12px; margin: 8px 0; }
.kv span:first-child { color: var(--muted); min-width: 60px; }
.checks { display: grid; gap: 6px; margin-top: 8px; }

/* Kennzahlen */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.tile .label { color: var(--muted); font-size: 12px; }
.tile .value { font-size: 26px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .sub { color: var(--text-2); font-size: 12px; margin-top: 2px; }

/* Diagramm */
.chart { position: relative; height: 220px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid { stroke: #333; stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--series); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .bar.hover { fill: #5a9df0; }
.tip { position: fixed; z-index: 20; pointer-events: none; background: #111; border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; font-size: 12px; min-width: 180px; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.tip b { display: block; margin-bottom: 4px; }
.tip .r { display: flex; justify-content: space-between; gap: 16px; color: var(--text-2); }
.tip .r span:last-child { color: var(--text); font-variant-numeric: tabular-nums; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #333; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #2b2b2b; }
.share { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.share .track, .quota .track { display: block; width: 90px; height: 6px; background: #333; border-radius: 3px; overflow: hidden; }
.share .fill, .quota .fill { display: block; height: 100%; background: var(--series); border-radius: 3px; }
.pill { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; border: 1px solid var(--line); color: var(--text-2); }
.pill.admin { border-color: var(--accent); color: var(--accent); }
.pill.off { border-color: #5a2a28; color: var(--danger); }
.pill.ok { border-color: #234d2c; color: var(--ok); }
.pill.warn { border-color: #5a4520; color: var(--warn); }
.quota { display: flex; align-items: center; gap: 6px; }
.quota .track { width: 60px; height: 6px; background: #333; border-radius: 3px; overflow: hidden; }
.quota .fill { height: 100%; background: var(--accent); }
.quota .fill.high { background: var(--warn); }
.empty { color: var(--muted); text-align: center; padding: 24px; }

dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 20px; width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.6); }

@media (max-width: 720px) {
  .topbar { height: auto; flex-wrap: wrap; gap: 8px; padding: 8px 16px 0; }
  .tabs { order: 3; flex-basis: 100%; }
  .who { margin-left: auto; }
  main { padding: 16px; }
}
.row.tight { margin-top: 0; }
#casesUser { width: auto; min-width: 180px; padding: 5px 8px; }
a.open { color: var(--accent); text-decoration: none; white-space: nowrap; }
a.open:hover { text-decoration: underline; }
.sys { font-size: 11px; }
.sent-list { margin: 8px 0; padding-left: 18px; color: var(--text-2); }
.sent-list li { margin: 3px 0; }
#sentDialog { width: min(640px, calc(100vw - 32px)); }
/* Sprachumschaltung */
.seg.lang button { padding: 2px 8px; font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.brand .seg.lang { margin-left: auto; }
.auth-card .seg.lang button { width: auto; margin-top: 0; padding: 2px 8px; }
fieldset.features { border: 1px solid var(--line); border-radius: var(--radius); margin: 14px 0 0; padding: 6px 12px 10px; }
fieldset.features legend { color: var(--text-2); font-size: 12px; padding: 0 4px; }
fieldset.features label.check { margin-top: 6px; }
.pill.feat { margin-right: 4px; }
