/* Verwaltung im SmileSketch Design System. Alle Farben, Radien, Schatten und Schriften kommen aus tokens.css. */
:root {
  color-scheme: light;
  --ink: var(--color-text);
  --muted: var(--color-text-muted);
  --paper: var(--bg-page);
  --card: var(--surface-card);
  --line: var(--border-default);
  --line-strong: var(--border-strong);
  --accent: var(--color-brand-green);
  --shadow: var(--shadow-xs);
  --radius: var(--radius-lg);
  --font: var(--font-sans);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: var(--fs-14);
  color: var(--ink);
  background: var(--paper);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--color-brand-lime); color: var(--color-on-lime); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
header.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 0.35rem 0.4rem;
  align-items: center;
  min-height: 56px;
  padding: 0.6rem 1.35rem;
  background: var(--color-background);
  border-bottom: 1px solid var(--line);
}
header.bar strong {
  margin-right: auto;
  font-family: var(--font-display);
  font-size: var(--fs-18);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-display);
  color: var(--ink);
}
header.bar strong .ver {
  margin-left: 0.35rem;
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  font-weight: var(--fw-medium);
  letter-spacing: 0;
  color: var(--muted);
}
header.bar .nav { display: flex; flex-wrap: wrap; gap: 0.15rem; align-items: center; }
header.bar .nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-sm);
  padding: 0 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  font-weight: var(--fw-medium);
  font-size: var(--fs-14);
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out);
}
header.bar .nav a:hover { background: var(--color-tertiary-hover); color: var(--ink); }
/* Aktiver Eintrag: weicher Lime-Hintergrund, kein reines Farbsignal (zusätzlich fett) */
header.bar .nav a[aria-current="page"] {
  background: var(--color-lime-soft);
  box-shadow: inset 0 0 0 1px var(--color-lime-active);
  font-weight: var(--fw-semibold);
  color: var(--ink);
}
header.bar form { margin: 0 0 0 0.4rem; }
main { max-width: 980px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }
h1 {
  margin: 0.2rem 0 0.9rem;
  font-family: var(--font-display);
  font-size: var(--fs-30);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-tight);
}
h2 {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: var(--fs-18);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
  line-height: var(--lh-snug);
}
h3 { font-size: var(--fs-16); font-weight: var(--fw-semibold); }
p { color: var(--ink); }
form.card, section.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5);
  margin: 0 0 var(--space-4);
  box-shadow: var(--shadow);
}
label { display: block; margin: 0.85rem 0; }
label span, .ed-caption {
  display: block;
  font-size: var(--fs-13);
  font-weight: var(--fw-semibold);
  color: var(--ink);
  margin-bottom: 0.35rem;
}
input, select, textarea {
  width: 100%;
  min-height: var(--control-md);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  font: inherit;
  color: inherit;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
input:hover, select:hover, textarea:hover { border-color: var(--color-input-border-hover); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-focus);
  box-shadow: var(--focus-ring);
}
/* Fehler: roter Rahmen; die Meldung als Text kommt vom Server (.error) oder vom Browser */
input:user-invalid, select:user-invalid, textarea:user-invalid,
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--color-error); }
input:user-invalid:focus, select:user-invalid:focus, textarea:user-invalid:focus,
input[aria-invalid="true"]:focus, select[aria-invalid="true"]:focus, textarea[aria-invalid="true"]:focus { box-shadow: var(--focus-ring-error); }
input[readonly], textarea[readonly] { background: var(--surface-muted); color: var(--muted); }
input:disabled, select:disabled, textarea:disabled {
  background: var(--color-disabled-bg);
  border-color: var(--color-disabled-border);
  color: var(--color-disabled-text);
  cursor: not-allowed;
}
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--color-brand-green); }
textarea { min-height: 8rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.check { display: flex; gap: 0.55rem; align-items: center; font-weight: var(--fw-medium); color: var(--ink); }
.check input, .check span { width: auto; margin: 0; font-weight: var(--fw-medium); color: inherit; font-size: var(--fs-14); }
/* Primär: Lime mit dunkler Schrift. Nur für die Hauptaktion. */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-md);
  padding: 0 1rem;
  background: var(--action-primary);
  color: var(--color-on-lime);
  border: 1px solid var(--action-primary);
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
button:hover, .btn:hover { background: var(--action-primary-hover); border-color: var(--action-primary-hover); color: var(--color-on-lime); }
button:active, .btn:active { background: var(--color-lime-active); border-color: var(--color-lime-active); transform: translateY(1px); }
button:disabled, button:disabled:hover {
  background: var(--color-disabled-bg);
  border-color: var(--color-disabled-border);
  color: var(--color-disabled-text);
  cursor: not-allowed;
  transform: none;
}
/* Tertiär: weiß mit Rahmen */
.ghost {
  background: var(--surface-card);
  color: var(--ink);
  border: 1px solid var(--color-tertiary-border);
}
.ghost:hover { background: var(--color-tertiary-hover); border-color: var(--color-tertiary-border); color: var(--ink); }
.ghost:active { background: var(--color-tertiary-active); border-color: var(--color-tertiary-border); }
header.bar .ghost { min-height: var(--control-sm); padding: 0 0.75rem; font-weight: var(--fw-medium); }
button.star {
  min-height: var(--control-sm);
  background: var(--surface-card);
  color: var(--muted);
  border: 1px solid var(--color-tertiary-border);
  font-size: var(--fs-16);
  line-height: 1;
  padding: 0 0.6rem;
}
button.star:hover { background: var(--color-tertiary-hover); color: var(--ink); }
button.star.on { background: var(--color-lime-soft); color: var(--ink); border-color: var(--color-lime-active); }
.probe { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.probe h2, .probe h3 { font-size: var(--fs-16); }
img.probe { max-width: 100%; max-height: 420px; border-radius: var(--radius-md); display: block; margin: 0.4rem 0 0.8rem; box-shadow: var(--shadow-sm); }
.probe-progress { margin: 0.8rem 0 0.2rem; }
.probe-progress__row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.4rem; }
.probe-progress__row strong { font-variant-numeric: tabular-nums; font-size: var(--fs-18); }
.probe-progress__track { height: 8px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.probe-progress__fill { width: 0; height: 100%; border-radius: inherit; background: var(--color-brand-lime); transition: width 0.2s linear; }
/* Meldungen: Farbe nie allein – Symbol (Lucide) und Text gehören dazu. */
.notice, .error, .avv-note {
  position: relative;
  padding: 0.75rem 0.9rem 0.75rem 2.6rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}
.notice::before, .error::before, .avv-note::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 0.85rem;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.notice { --icon: url("icons/circle-check.svg"); background: var(--color-success-soft); border-color: var(--color-success-border); color: var(--color-success-text); }
.error { --icon: url("icons/circle-alert.svg"); background: var(--color-error-soft); border-color: var(--color-error-border); color: var(--color-error-text); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--table-divider); vertical-align: middle; }
th {
  background: var(--table-header);
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  color: var(--muted);
}
tbody tr:hover td { background: var(--color-row-hover); }
tr:last-child td { border-bottom: 0; }
code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  word-break: break-all;
  background: var(--surface-muted);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
body:not(:has(header.bar)) main {
  width: min(28rem, calc(100% - 2rem));
  padding-top: 8vh;
}
body:not(:has(header.bar)) h1 { font-size: var(--fs-38); }
@media (max-width: 720px) {
  .row { grid-template-columns: 1fr; }
  header.bar { flex-wrap: wrap; }
  header.bar .nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  h1 { font-size: var(--fs-24); }
}
.avv-note { --icon: url("icons/triangle-alert.svg"); background: var(--color-warning-soft); border-color: var(--color-warning-border); color: var(--color-warning-text); padding-top: 0.9rem; padding-bottom: 0.9rem; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-sm);
  min-width: var(--control-sm);
  padding: 0;
}
header.bar .theme-toggle { padding: 0; }
.theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-icon--sun { display: none; }
html[data-theme="dark"] .theme-icon--moon { display: none; }
html[data-theme="dark"] .theme-icon--sun { display: block; }
.theme-toggle--float { position: fixed; top: 0.8rem; right: 0.8rem; z-index: 40; }
.avv-note::before { top: 0.95rem; }
.avv h2 { font-size: var(--fs-18); margin-top: 1.6rem; }
.avv h3 { font-size: var(--fs-16); margin-top: 1.1rem; }
.avv p, .avv li { line-height: 1.5; }
.avv table td:first-child { width: 34%; }
/* Übersichten: Kennzahlen, Status-Pillen, Kopfzeile mit Aktionen, Kacheln */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.page-head h1 { margin-bottom: 0; }
.page-head .lead { margin: 0.35rem 0 0; color: var(--muted); }
.back { display: inline-block; margin-bottom: var(--space-2); color: var(--muted); text-decoration: none; font-size: var(--fs-13); }
.back:hover { color: var(--ink); text-decoration: underline; }
.facts { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-8); margin: 0 0 var(--space-3); }
.facts div { min-width: 0; }
.facts dt { font-size: var(--fs-12); color: var(--muted); }
.facts dd { margin: 0.1rem 0 0; font-weight: var(--fw-semibold); }
.pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.1rem 0.55rem; border-radius: var(--radius-round); border: 1px solid transparent; font-size: var(--fs-12); font-weight: var(--fw-semibold); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--ok, .pill--active { background: var(--color-success-soft); border-color: var(--color-success-border); color: var(--color-success-text); }
.pill--failed, .pill--disabled { background: var(--color-error-soft); border-color: var(--color-error-border); color: var(--color-error-text); }
.pill--running { background: var(--color-info-soft); border-color: var(--color-info-border); color: var(--color-info-text); }
.pill--warn { background: var(--color-warning-soft); border-color: var(--color-warning-border); color: var(--color-warning-text); }
.pill--none, .pill--muted { background: var(--surface-muted); border-color: var(--line); color: var(--muted); }
.pill--lime { background: var(--color-lime-soft); border-color: var(--color-lime-active); color: var(--ink); }
.pill--lime::before { background: var(--color-brand-green); }
pre.log { margin: 0; padding: var(--space-3) var(--space-4); max-height: 28rem; overflow: auto; background: var(--surface-muted); border: 1px solid var(--line); border-radius: var(--radius-sm); font: var(--type-mono); white-space: pre-wrap; word-break: break-word; }
/* Tabellen in Karten laufen bis an den Rand */
.card.table-card { padding: 0; overflow: hidden; }
.table-card > h2, .table-card > .card-head { padding: var(--space-4) var(--space-5) 0; }
.table-card > .empty { padding: var(--space-4) var(--space-5) var(--space-5); margin: 0; color: var(--muted); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.card-head h2 { margin: 0; }
.table-card table { margin-top: var(--space-3); }
.fold > summary { cursor: pointer; padding: var(--space-2) var(--space-5); font-weight: 600; list-style-position: inside; }
.table-card th:first-child, .table-card td:first-child { padding-left: var(--space-5); }
.table-card th:last-child, .table-card td:last-child { padding-right: var(--space-5); }
.table-card tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions-cell { text-align: right; white-space: nowrap; }
td.actions-cell form { display: inline; margin: 0; }
td .sub { display: block; color: var(--muted); font-size: var(--fs-12); }
a.row-link { font-weight: var(--fw-semibold); color: var(--ink); text-decoration: none; }
a.row-link:hover { color: var(--accent); text-decoration: underline; }
.btn-sm, button.btn-sm, .ghost.btn-sm { min-height: var(--control-sm); padding: 0 0.7rem; font-size: var(--fs-13); }
/* Umschalter Liste / Kacheln */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: var(--radius-md); }
.seg a { display: inline-flex; align-items: center; min-height: 30px; padding: 0 0.75rem; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-weight: var(--fw-medium); font-size: var(--fs-13); }
.seg a:hover { color: var(--ink); }
.seg a[aria-current="true"] { background: var(--surface-card); color: var(--ink); font-weight: var(--fw-semibold); box-shadow: var(--shadow-xs); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); }
.tile { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4) var(--space-5); background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); color: var(--ink); text-decoration: none; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); color: var(--ink); }
.tile__title { font-family: var(--font-display); font-size: var(--fs-18); font-weight: var(--fw-semibold); letter-spacing: -0.01em; line-height: 1.25; }
.tile__meta { color: var(--muted); font-size: var(--fs-13); }
.tile__foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: var(--space-2); }
/* Vorschaubild für FX-Prompts */
.thumb { display: block; width: 48px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--surface-muted); border: 1px solid var(--line); }
.thumb--empty { display: grid; place-items: center; color: var(--color-disabled-text); font-size: var(--fs-11); text-align: center; line-height: 1.2; }
.thumb-pair { display: flex; gap: 4px; }
/* Mandanten-Detail: zweispaltig */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
.split > .card { margin: 0; }
.stack { display: grid; gap: var(--space-4); margin-bottom: var(--space-4); }
.danger-zone { border-color: var(--color-error-border); }
.inline-form { display: flex; gap: var(--space-2); align-items: end; flex-wrap: wrap; }
.inline-form label { margin: 0; flex: 1; min-width: 12rem; }
@media (max-width: 720px) {
  .split { grid-template-columns: 1fr; }
  .table-card { overflow-x: auto; }
}
.hint { color: var(--muted); font-size: var(--fs-13); margin: 0.25rem 0 0.75rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ghost.danger { color: var(--color-error-text); border-color: var(--color-error-border); }
.ghost.danger:hover { background: var(--color-error-soft); color: var(--color-error-text); border-color: var(--color-error-border); }
h1 .pill { vertical-align: middle; margin-left: 0.4rem; font-family: var(--font-sans); letter-spacing: 0; }
.table-card > table:first-child { margin-top: 0; }
.table-card code { word-break: normal; white-space: nowrap; }
.table-card button.star { font-size: var(--fs-13); white-space: nowrap; }
a:has(> .thumb) { text-decoration: none; }
.page-head > div:first-child { flex: 1 1 28rem; max-width: 46rem; }
/* Rechtstexte (Datenschutz): gut lesbare Spalte, ohne Kopfleiste */
main.legal { max-width: 46rem; padding-top: 2.5rem; }
.legal h1 { hyphens: auto; overflow-wrap: break-word; }
@media (max-width: 480px) { .legal h1 { font-size: var(--fs-24); } }
.legal h2 { margin-top: 2rem; font-size: var(--fs-20); }
.legal h3 { margin: 1.25rem 0 0.4rem; }
.legal p, .legal li { line-height: 1.6; }
.legal li + li { margin-top: 0.3rem; }
.legal table { margin: 0.5rem 0 1rem; background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; border-collapse: separate; border-spacing: 0; }
.legal-box { padding: var(--space-3) var(--space-4); background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius-md); }
.legal-toc { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-4) 0; }
.legal-toc a { padding: 0.3rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-round); background: var(--surface-card); color: var(--ink); text-decoration: none; font-size: var(--fs-13); font-weight: var(--fw-medium); }
.legal-toc a:hover { background: var(--color-tertiary-hover); }
.profile-banner { margin: 0; padding: 0.6rem 1.35rem; background: var(--color-warning-soft); border-bottom: 1px solid var(--color-warning-border); color: var(--color-warning-text); font-size: var(--fs-13); }
.profile-banner a { color: inherit; font-weight: var(--fw-semibold); }
.row--zip { grid-template-columns: 8rem 1fr; }
.legal-providers { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--space-3); margin: 0.5rem 0 1rem; }
@media print {
  header.bar, .no-print { display: none; }
  body { background: #fff; }
  main { max-width: none; }
  .avv-note { border: 1px solid #000; color: #000; }
}
/* Anmelden/Registrieren: eine Karte, Bildfläche gleitet zwischen den Formularen (auth-card.ejs, auth-switch.js) */
body:not(:has(header.bar)) main:has(.auth) { width: min(880px, calc(100% - 2rem)); padding-top: 7vh; }
.auth {
  --auth-slide: 650ms cubic-bezier(.65,0,.35,1);
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 560px;
  overflow: hidden;
  background: var(--surface-card);
  border: 8px solid var(--surface-card);
  border-radius: 24px;
  box-shadow: 0 12px 80px rgba(17,43,55,.12);
}
html[data-theme="dark"] .auth { box-shadow: 0 12px 80px rgba(0,0,0,.45); }
.auth-bg, .auth-hero, .auth-form { grid-row: 1; grid-column: 1; transition: translate var(--auth-slide), opacity var(--auth-slide), visibility var(--auth-slide); }
.auth-bg {
  z-index: 2;
  overflow: hidden;
  border-radius: 16px;
  background: var(--color-brand-dark);
  translate: 100% 0;
}
.auth.is-register .auth-bg { translate: 0 0; }
.auth-bg svg { display: block; width: 100%; height: 100%; }
.auth-sky-top { stop-color: #2B4A57; }
.auth-sky-bottom { stop-color: #112B37; }
.auth-glow-in { stop-color: #D5FA42; stop-opacity: .22; }
.auth-glow-out { stop-color: #D5FA42; stop-opacity: 0; }
.auth-ridge--back { fill: #355966; opacity: .55; }
.auth-ridge--mid { fill: #1C3B48; }
.auth-ridge--front { fill: #0C1F27; }
.auth-sketch { fill: none; stroke: #D5FA42; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 6 9; opacity: .55; }

.auth-hero, .auth-form { opacity: 0; visibility: hidden; }
.auth-hero {
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: 0 var(--space-8);
  color: var(--text-inverse);
  text-align: center;
}
.auth-hero h2 { margin: 0; font-size: var(--fs-30); letter-spacing: var(--tracking-display); color: #FFFFFF; }
.auth-hero p { margin: 0 0 var(--space-2); max-width: 22rem; color: #FFFFFF; opacity: .85; line-height: 1.45; font-size: var(--fs-16); }
.auth-switch {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-lg);
  padding: 0 2.75rem;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.1);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: #FFFFFF;
  font-size: var(--fs-16);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transition: background 300ms var(--ease-out), color 300ms var(--ease-out);
}
.auth-switch:hover, .auth-switch:focus-visible { background: var(--color-brand-lime); color: var(--color-on-lime); }
.auth-hero--login { grid-column: 2; }
.auth-hero--register { translate: -100% 0; }
.auth.is-register .auth-hero--login { translate: 100% 0; }
.auth.is-register .auth-hero--register { translate: 0 0; }

.auth-form {
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-10) var(--space-10);
}
.auth-form h1 { margin: 0 0 var(--space-4); text-align: center; font-size: var(--fs-30); }
.auth-form form { margin: 0; }
.auth-form .notice, .auth-form .error { margin: 0 0 var(--space-2); }
.auth-lead { margin: 0 0 var(--space-2); color: var(--muted); text-align: center; }
.auth-form label { margin: 0 0 var(--space-4); }
.auth-form input:not([type="hidden"]) {
  min-height: 52px;
  padding: 0 var(--space-4);
  background: var(--surface-muted);
  border-color: transparent;
  border-radius: var(--radius-lg);
  font-size: var(--fs-16);
}
.auth-form input:hover { border-color: var(--color-input-border); }
.auth-form input:focus { background: var(--surface-card); border-color: var(--color-focus); }
.auth-form input::placeholder { color: var(--color-disabled-text); }
.auth-password-field { position: relative; display: block; margin: 0; font: inherit; }
.auth-password-field input:not([type="hidden"]) { padding-right: 3.25rem; }
.auth-eye, .auth-eye:hover, .auth-eye:active {
  position: absolute;
  top: 50%;
  right: 6px;
  translate: 0 -50%;
  width: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  transform: none;
}
.auth-eye:hover { color: var(--ink); background: var(--color-tertiary-hover); }
.auth-eye[hidden] { display: none; }
.auth-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-eye-hide, .auth-eye[aria-pressed="true"] .auth-eye-show { display: none; }
.auth-eye[aria-pressed="true"] .auth-eye-hide { display: block; }
.auth-forgot { margin: calc(var(--space-2) * -1) 0 var(--space-5); text-align: right; font-size: var(--fs-13); }
.auth-forgot a { color: var(--color-info); font-weight: var(--fw-medium); text-decoration: none; }
.auth-forgot a:hover { text-decoration: underline; }
html[data-theme="dark"] .auth-forgot a { color: var(--color-info-text); }
.auth-fine { margin: 0 0 var(--space-5); color: var(--muted); font-size: var(--fs-13); line-height: 1.5; }
.auth-submit { width: 100%; min-height: 52px; border-radius: var(--radius-lg); font-size: var(--fs-16); }
.auth-alt { display: none; margin: var(--space-5) 0 0; text-align: center; color: var(--muted); }
.auth-form--login { translate: 0 0; }
.auth-form--register { grid-column: 2; translate: -100% 0; }
.auth.is-register .auth-form--login { translate: 100% 0; }
.auth.is-register .auth-form--register { translate: 0 0; }

.auth:not(.is-register) :is(.auth-hero--login, .auth-form--login),
.auth.is-register :is(.auth-hero--register, .auth-form--register) { opacity: 1; visibility: visible; }
.auth-legal { margin-top: var(--space-5); text-align: center; }

@media (max-width: 720px) {
  body:not(:has(header.bar)) main:has(.auth) { padding-top: 4.5rem; }
  .auth { grid-template-columns: 1fr; min-height: 0; border-radius: 20px; }
  .auth-bg, .auth-hero { display: none; }
  .auth-form { grid-column: 1; translate: none; padding: var(--space-6) var(--space-4); transition: none; }
  .auth.is-register .auth-form--login { display: none; }
  .auth:not(.is-register) .auth-form--register { display: none; }
  .auth-alt { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .auth { --auth-slide: 1ms linear; }
}
/* Kopfzeile: Menü-Wrapper ist am Desktop unsichtbar, die Reihenfolge bleibt Navigation · Design · Abmelden */
.bar-menu { display: contents; }
header.bar .nav { order: 1; }
header.bar > .theme-toggle { order: 2; }
header.bar .bar-logout { order: 3; }
.nav-toggle { display: none; }
.nav-toggle svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.nav-toggle-close, header.bar.menu-open .nav-toggle-open { display: none; }
header.bar.menu-open .nav-toggle-close { display: inline; }
@media (max-width: 720px) {
  /* Mit JavaScript: Hamburger-Menü statt waagerecht scrollender Navigation (admin-ui.js) */
  header.bar.has-menu { flex-wrap: nowrap; padding: 0.5rem var(--space-4); }
  header.bar.has-menu > .theme-toggle,
  header.bar.has-menu .nav-toggle { display: inline-flex; width: 44px; min-width: 44px; min-height: 44px; padding: 0; }
  header.bar.has-menu .nav-toggle { order: 4; }
  header.bar.has-menu .bar-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
    padding: var(--space-2) var(--space-4) var(--space-4);
    background: var(--color-background);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }
  header.bar.has-menu.menu-open .bar-menu { display: block; }
  header.bar.has-menu .nav { width: auto; flex-direction: column; align-items: stretch; flex-wrap: nowrap; overflow: visible; gap: 2px; }
  header.bar.has-menu .nav a { min-height: 44px; padding: 0 var(--space-3); font-size: var(--fs-16); }
  header.bar.has-menu .bar-logout { margin: var(--space-2) 0 0; padding-top: var(--space-3); border-top: 1px solid var(--line); }
  header.bar.has-menu .bar-logout button { width: 100%; min-height: 44px; font-size: var(--fs-16); }

  /* Tabellen: jede Zeile als Block, Spaltenkopf links an der Zelle (data-label aus admin-ui.js) */
  table.table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.table-stack, table.table-stack tbody, table.table-stack tr { display: block; width: 100%; }
  table.table-stack tr { padding: var(--space-3) 0; border-bottom: 1px solid var(--table-divider); }
  table.table-stack tr:last-child { border-bottom: 0; }
  .table-card table.table-stack tr { padding: var(--space-3) var(--space-5); }
  table.table-stack td, .table-card table.table-stack td {
    display: block;
    padding: 0.2rem 0;
    border: 0;
    text-align: left;
    background: none;
  }
  table.table-stack tbody tr:hover td { background: none; }
  table.table-stack td[data-label] { text-align: right; }
  table.table-stack td[data-label]::before {
    content: attr(data-label);
    float: left;
    margin-right: var(--space-3);
    color: var(--muted);
    font-size: var(--fs-12);
    font-weight: var(--fw-semibold);
    line-height: 1.9;
  }
  table.table-stack:has(thead) td:first-child { font-weight: var(--fw-semibold); }
  table.table-stack td.actions-cell { padding-top: var(--space-2); white-space: normal; }
  table.table-stack td.actions-cell form { display: inline-block; }
  table.table-stack td[data-label] .inline-form { justify-content: flex-end; }
  table.table-stack code { white-space: normal; word-break: break-all; }
}
.inline-form--narrow label { flex: 0 1 14rem; min-width: 10rem; }
.limit-reset { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.limit-reset .hint { margin-top: 0; }
/* Logo SMILE.ONX WALL: helle und dunkle Fassung, umgeschaltet über data-theme */
header.bar strong.brand { display: inline-flex; align-items: center; gap: 0.15rem; line-height: 0; }
header.bar strong.brand .ver { line-height: 1; }
.brand-logo { display: block; height: 28px; width: auto; }
.brand-logo--dark, html[data-theme="dark"] .brand-logo--light { display: none; }
html[data-theme="dark"] .brand-logo--dark { display: block; }
.auth-logo { display: flex; justify-content: center; margin: 0 0 var(--space-6); }
.auth-logo .brand-logo { height: 32px; }
@media (max-width: 720px) {
  header.bar strong.brand .brand-logo { height: 24px; }
}
