/* Advertising Terminal – ruhig, hell, gut lesbar */
:root {
  --bg: #f5f5f2; --surface: #ffffff; --line: #e2e2dc; --line-strong: #cfcfc7;
  --text: #1c1c1a; --muted: #5f5f58; --accent: #0f5f5a; --accent-hover: #0b4a46; --accent-soft: #e3efed;
  --ok: #1f6f3f; --ok-soft: #e3f1e7; --warn: #8a5300; --warn-soft: #fbf0dc;
  --err: #a32626; --err-soft: #f9e4e2; --info: #1d4f91; --info-soft: #e4ecf8;
  --radius: 10px; --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 2px 8px rgb(0 0 0 / .04);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.5; color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
h1 { font-size: 1.65rem; line-height: 1.2; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; font-weight: 650; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid #2b7de9; outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.strong { font-weight: 600; }
.loading { color: var(--muted); padding: 2rem; }
.tone-ok { color: var(--ok); } .tone-warn { color: var(--warn); } .tone-err { color: var(--err); }
.tone-info { color: var(--info); } .tone-muted { color: var(--muted); } .tone-neutral { color: var(--text); }

/* Marke */
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 650; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent) url("../favicon.svg") center/cover; }

/* Knöpfe und Felder */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: 0 1rem;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text);
  font: inherit; font-weight: 550; cursor: pointer; }
.btn:hover { background: #f0f0eb; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-wide { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid currentColor;
  border-color: var(--muted) transparent var(--muted) transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.btn-primary.busy::after { border-color: #fff transparent #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.linkbtn { background: none; border: 0; padding: .25rem 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-weight: 550; font-size: .95rem; }
input[type=email], input[type=password], input[type=text], input[type=number], input[type=time], input:not([type]) {
  min-height: 44px; padding: 0 .8rem; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; background: #fff; color: var(--text); }
input:focus { border-color: var(--accent); }
.code-input { font-size: 1.5rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.field-inline { flex-direction: row; align-items: center; gap: .6rem; flex-wrap: wrap; }
.field-inline input[type=number] { width: 6.5rem; }
.row-fields { display: flex; flex-wrap: wrap; gap: .75rem 2rem; margin: .6rem 0; }
.check { display: flex; align-items: center; gap: .6rem; min-height: 40px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 650; padding: 0 .4rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }

/* Anmeldung */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: min(100%, 420px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 1rem; }
.auth-card h1 { font-size: 1.4rem; }
.auth-card .brand { color: var(--accent); }
.steps { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .3rem; }
.qr { display: grid; place-items: center; padding: .5rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.secret { display: block; padding: .6rem; background: var(--bg); border-radius: 6px; font-size: 1rem; word-break: break-all; user-select: all; }

/* Hinweise */
.note { display: flex; align-items: flex-start; gap: .55rem; padding: .65rem .85rem; border-radius: 8px; margin: 0; }
.note svg { flex: none; margin-top: .2rem; }
.note-err { background: var(--err-soft); color: var(--err); }
.note-warn { background: var(--warn-soft); color: var(--warn); }
.note-info { background: var(--info-soft); color: var(--info); }
.note a { color: inherit; }
.notes { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .5rem; }

/* Rahmen */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 1.25rem .9rem; display: flex;
  flex-direction: column; gap: .5rem; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: 0 .5rem; }
.netname { padding: 0 .5rem .75rem; color: var(--muted); font-size: .875rem; border-bottom: 1px solid var(--line); margin-bottom: .5rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: .7rem; min-height: 44px; padding: 0 .7rem; border-radius: 8px;
  color: var(--text); text-decoration: none; font-weight: 520; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.nav-item.soon { color: #8a8a82; cursor: default; }
.nav-item.soon em { margin-left: auto; font-style: normal; font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 0 .45rem; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: .6rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.who { display: flex; flex-direction: column; padding: 0 .5rem; font-size: .875rem; overflow-wrap: anywhere; }
.role { color: var(--muted); }
.content { padding: 2rem clamp(1rem, 3vw, 2.5rem) 4rem; max-width: 1200px; width: 100%; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head p { margin: .25rem 0 0; }
.head-actions { display: flex; align-items: center; gap: .6rem; }
.back { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: .75rem; text-decoration: none; font-weight: 550; }

/* Flächen */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.panel-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 1.25rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem;
  display: flex; flex-direction: column; gap: .25rem; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
a.kpi:hover { border-color: var(--line-strong); color: var(--text); }
.kpi-label { color: var(--muted); font-size: .9rem; }
.kpi-value { font-size: 1.75rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); }

/* Zustands-Plakette */
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .65rem; border-radius: 99px; font-size: .875rem; font-weight: 550; white-space: nowrap; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-err { background: var(--err-soft); color: var(--err); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-muted { background: #ececE6; color: var(--muted); }

/* Listen und Tabellen */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 1rem; padding: .75rem .25rem;
  border-top: 1px solid var(--line); text-decoration: none; color: var(--text); }
.rows li:first-child .row { border-top: 0; }
.row:hover { background: var(--bg); color: var(--text); }
.row-main { display: flex; flex-direction: column; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .85rem; color: var(--muted); font-weight: 600; padding: .5rem .75rem; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table td { padding: .7rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-compact td { padding: .45rem .75rem; font-size: .95rem; }
.panel > .table-wrap .table th:first-child, .panel > .table-wrap .table td:first-child { padding-left: 0; }
.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.cmd-list { margin-top: 1rem; font-size: .95rem; }
.pair-code { display: flex; flex-direction: column; gap: .35rem; margin-top: 1rem; }
.pair-code .code { font-size: 2rem; font-weight: 700; letter-spacing: .12em; font-variant-numeric: tabular-nums; user-select: all; }
pre.diag { max-height: 60vh; overflow: auto; background: var(--bg); padding: .75rem; border-radius: 6px; font-size: .85rem; white-space: pre-wrap; }

/* Dialog und Meldungen */
.dlg { border: 0; border-radius: 14px; padding: 1.5rem; width: min(92vw, 640px); box-shadow: 0 20px 60px rgb(0 0 0 / .25); }
.dlg::backdrop { background: rgb(20 20 18 / .45); }
.dlg-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.25rem; }
#toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 10; max-width: min(92vw, 420px); }
.toast { display: flex; gap: .55rem; align-items: flex-start; padding: .75rem 1rem; border-radius: 10px; background: #1c1c1a; color: #fff; box-shadow: var(--shadow); transition: opacity .4s; }
.toast svg { flex: none; margin-top: .2rem; }
.toast-err { background: var(--err); }
.toast.gone { opacity: 0; }

/* Schmale Bildschirme */
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: column; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item.soon { display: none; }
  .sidebar-foot { flex-direction: row; align-items: center; justify-content: space-between; }
  .row { grid-template-columns: 1fr auto; }
  .row > :last-child { display: none; }
}
