/* easymailserver Panel – Designsystem
   Tokens: Farben/Schatten als CSS-Variablen (hell, dunkel per prefers-color-scheme oder data-theme),
   Abstaende im 8px-Raster (--s1..--s6), Radien --r-sm/--r/--r-lg. */
:root {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r-sm: 8px; --r: 10px; --r-lg: 14px; --r-xl: 18px;
  --side-w: 256px; --top-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --grad: linear-gradient(135deg, #5b52e8 0%, #7c3aed 100%);
  --term-bg: #0d1017; --term-text: #d5dae4; --term-line: #232838;

  --bg: #f5f6fa; --panel: #ffffff; --panel-2: #f8f9fc; --side: #ffffff;
  --text: #161a26; --muted: #5f667a; --line: #e5e8ef; --line-strong: #d2d7e2;
  --accent: #5046e5; --accent-soft: rgba(80,70,229,.10); --accent-text: #ffffff;
  --ok: #15803d; --warn: #b45309; --fail: #c62828; --grey: #7a6fd0;
  --code: #f1f3f8; --hover: #f1f2f8; --skel: #e9ecf3; --skel-hi: #f7f8fb;
  --ring: 0 0 0 3px rgba(80,70,229,.30);
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 14px rgba(16,24,40,.05);
  --shadow-lg: 0 2px 6px rgba(16,24,40,.08), 0 18px 40px rgba(16,24,40,.16);
  --overlay: rgba(15,18,30,.38); --toast-bg: #1b1e2b; --toast-text: #f3f4f8;
  --mesh-1: rgba(99,102,241,.30); --mesh-2: rgba(168,85,247,.24); --mesh-3: rgba(14,165,233,.18);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f15; --panel: #151821; --panel-2: #1a1e29; --side: #11141c;
    --text: #e8eaf1; --muted: #979eb2; --line: #252a37; --line-strong: #323949;
    --accent: #8f89ff; --accent-soft: rgba(143,137,255,.14); --accent-text: #ffffff;
    --ok: #4ade80; --warn: #fbbf24; --fail: #f87171; --grey: #a49bf0;
    --code: #1d2130; --hover: #1d2130; --skel: #1c202c; --skel-hi: #272c3b;
    --ring: 0 0 0 3px rgba(143,137,255,.40);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    --shadow-lg: 0 2px 8px rgba(0,0,0,.4), 0 24px 48px rgba(0,0,0,.5);
    --overlay: rgba(0,0,0,.55); --toast-bg: #e8eaf1; --toast-text: #11131a;
    --mesh-1: rgba(99,102,241,.28); --mesh-2: rgba(168,85,247,.20); --mesh-3: rgba(14,165,233,.12);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f15; --panel: #151821; --panel-2: #1a1e29; --side: #11141c;
  --text: #e8eaf1; --muted: #979eb2; --line: #252a37; --line-strong: #323949;
  --accent: #8f89ff; --accent-soft: rgba(143,137,255,.14); --accent-text: #ffffff;
  --ok: #4ade80; --warn: #fbbf24; --fail: #f87171; --grey: #a49bf0;
  --code: #1d2130; --hover: #1d2130; --skel: #1c202c; --skel-hi: #272c3b;
  --ring: 0 0 0 3px rgba(143,137,255,.40);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
  --shadow-lg: 0 2px 8px rgba(0,0,0,.4), 0 24px 48px rgba(0,0,0,.5);
  --overlay: rgba(0,0,0,.55); --toast-bg: #e8eaf1; --toast-text: #11131a;
  --mesh-1: rgba(99,102,241,.28); --mesh-2: rgba(168,85,247,.20); --mesh-3: rgba(14,165,233,.12);
  color-scheme: dark;
}

/* ---------- Basis ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.55 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--fail); min-height: 1.2em; margin: var(--s2) 0 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, [tabindex]:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.nav-item:focus-visible { border-radius: var(--r); }
h1 { font-size: 24px; line-height: 1.25; font-weight: 650; letter-spacing: -.02em; margin: 0 0 var(--s5); }
h1 .muted { font-weight: 450; font-size: 18px; }
h2 { font-size: 16px; font-weight: 620; letter-spacing: -.01em; margin: var(--s6) 0 var(--s3); }
h3 { font-size: 14px; font-weight: 620; margin: var(--s5) 0 var(--s2); }
.card > h2:first-child, .modal-card h2:first-child, #modalBody > h2:first-child { margin-top: 0; }
p { margin: 0 0 var(--s3); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s4) 0; }
code, pre { font-family: var(--mono); font-size: 12.5px; background: var(--code); border-radius: 6px; }
code { padding: 1px 6px; }
pre { padding: var(--s3); overflow-x: auto; white-space: pre-wrap; word-break: break-all; border: 1px solid var(--line); border-radius: var(--r); }
.secret { font-size: 16px; padding: 10px 14px; display: inline-block; user-select: all; border: 1px dashed var(--line-strong); margin: var(--s1) 0 var(--s3); word-break: break-all; }
.ic { flex: none; display: block; }

/* ---------- App-Schale ---------- */
#app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .18s ease; }
aside { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s4) var(--s3) var(--s3) var(--s4); min-height: var(--top-h); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; color: var(--text); white-space: nowrap; overflow: hidden; }
.brand:hover { text-decoration: none; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo { width: 32px; height: 32px; border-radius: var(--r); background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 4px 12px rgba(91,82,232,.35); }
nav { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--s3) var(--s3); flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.nav-h { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: var(--s4) var(--s3) 6px; white-space: nowrap; }
.nav-item { position: relative; display: flex; align-items: center; gap: var(--s3); padding: 8px var(--s3); border-radius: var(--r); color: var(--muted); font-weight: 500; white-space: nowrap; transition: background .12s, color .12s; }
.nav-item:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-foot { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collapse-btn svg { transition: transform .18s; }
.nav-backdrop { display: none; }
main { min-width: 0; overflow-x: clip; }

.top { position: sticky; top: 0; z-index: 20; display: flex; gap: var(--s3); align-items: center; min-height: var(--top-h); padding: 10px var(--s6);
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 13px; white-space: nowrap; }
.crumbs b { color: var(--text); font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.search-wrap { position: relative; flex: 1; max-width: 380px; margin-left: auto; }
.search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-wrap input { width: 100%; padding-left: 34px; background: var(--panel-2); }
.prefs { display: flex; gap: 6px; }
.prefs select, .login-prefs select { padding: 6px 28px 6px 10px; font-size: 12.5px; min-height: 34px; }
.menu-btn { display: none; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: var(--s2); padding: 4px 10px 4px 4px; border: 0; background: none; box-shadow: none; border-radius: 999px; font-weight: 500; max-width: 220px; }
.user-btn:hover { background: var(--hover); }
.user-btn #whoami { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 650; flex: none; letter-spacing: .02em; }
.user-drop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; animation: pop .14s ease-out; }
.user-drop-head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; word-break: break-all; }
.user-drop-head .muted { font-size: 12px; }
.user-drop a, .user-drop button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text); font-weight: 500; }
.user-drop a:hover { background: var(--hover); text-decoration: none; }
#view { padding: var(--s6); max-width: 1440px; }

/* ---------- Karten & Statistik ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.stat { position: relative; display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat > .muted { font-size: 12.5px; margin-top: 4px; }
.stat:has(.stat-ic) { padding-right: 68px; }
.stat-ic { position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-bottom: var(--s4); }
.spacer { flex: 1; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.alerts { margin: var(--s2) 0 0; padding-left: 20px; } .alerts li { color: var(--warn); }

/* ---------- Formulare ---------- */
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 7px 12px; min-height: 36px; max-width: 100%;
  transition: border-color .12s, box-shadow .12s; }
textarea { min-height: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a90a2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
select[multiple] { background-image: none; padding-right: 12px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; cursor: pointer; }
input[type=color] { padding: 2px; width: 44px; }
input[type=file] { padding: 6px; }
label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; color: var(--muted); font-size: 13px; font-weight: 500; }
label input, label select, label textarea { color: var(--text); font-size: 14px; font-weight: 400; }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-weight: 400; font-size: 14px; cursor: pointer; }
/* Checkboxen in label.check als Schalter */
label.check input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; width: 34px; height: 20px; border-radius: 999px; background: var(--line-strong); position: relative; border: 0; transition: background .15s; }
label.check input[type=checkbox]::before { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
label.check input[type=checkbox]:checked { background: var(--accent); background-image: var(--grad); }
label.check input[type=checkbox]:checked::before { transform: translateX(14px); }
label.check input[type=checkbox]:focus-visible { box-shadow: var(--ring); }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3) var(--s4); margin: var(--s2) 0 var(--s4); }
legend { color: var(--muted); padding: 0 6px; font-size: 12.5px; font-weight: 600; }

/* ---------- Buttons ---------- */
button { font: inherit; font-weight: 550; cursor: pointer; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); border-radius: var(--r); padding: 7px 14px; min-height: 36px;
  box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, box-shadow .12s, filter .12s, transform .06s; white-space: nowrap; }
button:hover { background: var(--hover); border-color: color-mix(in srgb, var(--accent) 30%, var(--line-strong)); }
button:active { transform: translateY(1px); }
button:focus-visible { box-shadow: var(--ring); }
button:disabled { opacity: .55; cursor: default; transform: none; }
button.primary { background: var(--grad); color: var(--accent-text); border-color: transparent; box-shadow: 0 1px 2px rgba(16,24,40,.12), 0 4px 14px rgba(91,82,232,.28); }
button.primary:hover { filter: brightness(1.07) saturate(1.05); }
button.danger { color: var(--fail); }
button.danger:hover { background: color-mix(in srgb, var(--fail) 10%, var(--panel)); border-color: color-mix(in srgb, var(--fail) 40%, var(--line-strong)); }
button.primary.danger { background: var(--fail); color: #fff; }
button.link, button.ghost { border-color: transparent; background: none; box-shadow: none; }
button.link { color: var(--accent); padding: 0; min-height: 0; }
button.link:hover { text-decoration: underline; background: none; }
button.ghost:hover { background: var(--hover); border-color: transparent; }
button.small, a.small { padding: 3px 10px; min-height: 28px; font-size: 12.5px; border-radius: var(--r-sm); }
.icon-btn { width: 36px; height: 36px; min-height: 36px; padding: 0; display: inline-grid; place-items: center; border: 0; background: none; box-shadow: none; color: var(--muted); border-radius: var(--r); }
.icon-btn:hover { background: var(--hover); color: var(--text); }

/* ---------- Tabellen ---------- */
.table-wrap { overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); max-width: 100%; margin-bottom: var(--s2); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: var(--hover); }
tr.clickable { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .muted { font-size: 12.5px; }
td.muted[colspan] { text-align: center; padding: 36px 14px; font-size: 13.5px; }
td.muted[colspan]::before { content: ""; display: block; width: 28px; height: 28px; margin: 0 auto 8px; background: currentColor; opacity: .5;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13l2.5-8h13L21 13v6H3z'/%3E%3Cpath d='M3 13h5l1.5 2.5h5L16 13h5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13l2.5-8h13L21 13v6H3z'/%3E%3Cpath d='M3 13h5l1.5 2.5h5L16 13h5'/%3E%3C/svg%3E") center / contain no-repeat; }
.card .table-wrap, .modal-card .table-wrap { box-shadow: none; }

/* ---------- Pills, Status ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 550; line-height: 1.6; white-space: nowrap; color: var(--accent);
  background: color-mix(in srgb, currentColor 11%, transparent); border: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .fail { color: var(--fail); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 8px 0 6px; }
.bar > span { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.sym { display: inline-block; font-size: 11.5px; padding: 0 6px; margin: 1px; border-radius: 6px; background: var(--code); font-family: var(--mono); }
.sym.pos { color: var(--fail); } .sym.neg { color: var(--ok); }

/* ---------- Tabs (Segment-Control) ---------- */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; margin-bottom: var(--s4); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-lg); max-width: 100%; }
.tabs button { border: 0; background: none; box-shadow: none; padding: 6px 12px; min-height: 32px; border-radius: var(--r-sm); color: var(--muted); font-weight: 550; }
.tabs button:hover { color: var(--text); background: var(--hover); }
.tabs button.on { color: var(--text); background: var(--panel); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }

/* ---------- Diagramm ---------- */
.chart { width: 100%; height: 180px; display: block; }
.chart text { fill: var(--muted); font-size: 10px; }
.chart rect { rx: 2px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: var(--s2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.c-reject { background: var(--fail); fill: var(--fail); } .c-header { background: var(--warn); fill: var(--warn); }
.c-grey { background: var(--grey); fill: var(--grey); } .c-clean { background: var(--ok); fill: var(--ok); }

/* ---------- Log-Terminal (in beiden Designs dunkel) ---------- */
.logbox { background: var(--term-bg); color: var(--term-text); border: 1px solid var(--term-line); border-radius: var(--r-lg); padding: 14px 16px; font: 12.5px/1.6 var(--mono);
  max-height: 70vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: inset 0 1px 0 rgba(255,255,255,.04), var(--shadow); color-scheme: dark; }
.logbox .skel { background: linear-gradient(90deg, #1a1f2b 25%, #262c3b 37%, #1a1f2b 63%); background-size: 400% 100%; }

/* ---------- Skeleton ---------- */
.skel { height: 14px; border-radius: 6px; margin: 10px 0; background: linear-gradient(90deg, var(--skel) 25%, var(--skel-hi) 37%, var(--skel) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.skel.h1 { width: 240px; height: 28px; margin-bottom: var(--s5); }
.skel.w40 { width: 40%; } .skel.w60 { width: 60%; } .skel.w80 { width: 80%; } .skel.big { height: 26px; width: 50%; }
.skel-page .grid { margin-bottom: var(--s4); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: var(--s4);
  background: radial-gradient(1100px 600px at 8% -10%, var(--mesh-1), transparent 60%), radial-gradient(900px 520px at 108% 12%, var(--mesh-2), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, var(--mesh-3), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 400px; padding: 36px 32px 24px; border-radius: var(--r-xl); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); animation: pop .25s ease-out; }
.login-logo { width: 52px; height: 52px; border-radius: var(--r-lg); background: var(--grad); color: #fff; display: grid; place-items: center; margin-bottom: var(--s4); box-shadow: 0 8px 24px rgba(91,82,232,.4); }
.brand.big { font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.login-sub { margin: 2px 0 var(--s5); }
.login-card input { min-height: 42px; }
.login-card button[type=submit] { width: 100%; min-height: 44px; margin-top: var(--s2); font-size: 15px; }
.totp-step { padding: var(--s3); border-radius: var(--r-lg); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); color: var(--accent); animation: pop .2s ease-out; }
.totp-step input { text-align: center; font: 600 22px/1 var(--mono); letter-spacing: .45em; padding-left: calc(12px + .45em); }
.login-prefs { display: flex; gap: 6px; justify-content: center; margin-top: var(--s3); }

/* ---------- Modal & Toast ---------- */
.modal { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: var(--s4); z-index: 50; animation: fade .15s ease-out; }
.modal-card { width: 100%; max-width: 680px; max-height: 90vh; overflow-y: auto; padding: var(--s5); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2,.9,.3,1.2); }
.toast { position: fixed; bottom: 20px; right: 20px; z-index: 60; display: flex; align-items: flex-start; gap: 10px; background: var(--toast-bg); color: var(--toast-text); padding: 12px 16px; border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); max-width: min(460px, calc(100vw - 32px)); font-weight: 500; animation: toast-in .22s ease-out; overflow-wrap: anywhere; }
.toast .ic { color: #8f89ff; margin-top: 1px; }
.toast.ok .ic { color: #4ade80; } .toast.err .ic { color: #f87171; }
:root[data-theme="light"] .toast .ic { color: #a5a0ff; }
.toast.leaving { animation: toast-out .2s ease-in forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(4px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Seitenleiste eingeklappt (Desktop) ---------- */
@media (min-width: 901px) {
  #app.collapsed { --side-w: 76px; }
  #app.collapsed .brand-txt, #app.collapsed .nav-label, #app.collapsed .nav-foot { display: none; }
  #app.collapsed .side-head { flex-direction: column; padding: var(--s3) 0; gap: var(--s2); }
  #app.collapsed .collapse-btn svg { transform: rotate(180deg); }
  #app.collapsed .nav-item { justify-content: center; padding: 10px 0; }
  #app.collapsed .nav-h { font-size: 0; padding: 0; height: 1px; background: var(--line); margin: var(--s3) var(--s2); }
}

/* ---------- Responsiv ---------- */
@media (max-width: 900px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  aside { position: fixed; left: 0; top: 0; width: 280px; max-width: 86vw; transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  aside.open { transform: none; box-shadow: var(--shadow-lg); }
  aside.open + .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 25; background: var(--overlay); animation: fade .15s; }
  .collapse-btn { display: none; }
  .menu-btn { display: inline-grid; }
  .top { padding: 10px var(--s4); }
  #view { padding: var(--s5) var(--s4); }
}
@media (max-width: 640px) {
  .top { flex-wrap: wrap; row-gap: var(--s2); }
  .crumbs { flex: 1; }
  .search-wrap { order: 10; flex-basis: 100%; max-width: none; margin-left: 0; }
  .user-btn #whoami { display: none; }
  .user-btn { padding: 2px; }
  .prefs select { padding-left: 8px; padding-right: 24px; background-position: right 6px center; }
  h1 { font-size: 21px; margin-bottom: var(--s4); }
  .row > input, .row > select, .row > textarea { flex: 1 1 100%; min-width: 0 !important; }
  .card { padding: var(--s4); }
  .modal-card { padding: 18px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; } .kv dd { margin-bottom: var(--s2); }
  .toast { left: 16px; right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Logs: aufbereitete Ansicht ---------- */
.log-toolbar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; margin: var(--s3) 0; }
.log-toolbar .row { margin: 0; }
.log-q { min-width: 260px; flex: 1; }
.log-opts { gap: var(--s3); align-items: center; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); padding: 3px; gap: 2px; }
.seg button { background: transparent; border: 0; box-shadow: none; color: var(--muted); padding: 5px 12px; border-radius: calc(var(--r) - 3px); font-weight: 500; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.seg .cnt { font-variant-numeric: tabular-nums; opacity: .7; margin-left: 4px; font-size: 11px; }
.seg button[data-lv="warn"] .cnt { color: var(--warn); opacity: 1; }
.seg button[data-lv="error"] .cnt { color: var(--fail); opacity: 1; }
.logview { background: var(--term-bg); color: var(--term-text); border: 1px solid var(--term-line); border-radius: var(--r-lg);
  font: 12.5px/1.55 var(--mono); height: calc(100vh - 300px); min-height: 320px; overflow: auto; padding: 6px 0; }
.logview .skel { margin: 10px 16px; background: linear-gradient(90deg, #1a1f2b 25%, #262c3b 37%, #1a1f2b 63%); background-size: 400% 100%; }
.logrow { display: grid; grid-template-columns: 9.5em 5.5em 10em 1fr; gap: 0 12px; padding: 2px 16px 2px 13px; border-left: 3px solid transparent; cursor: default; }
.logrow:hover { background: rgba(255, 255, 255, .04); }
.logrow.lv-warn { border-left-color: #e0a33a; }
.logrow.lv-error { border-left-color: #f0616d; background: rgba(240, 97, 109, .07); }
.logrow.lv-error .l-msg { color: #ffb4ba; }
.l-time { color: #7d8699; font-variant-numeric: tabular-nums; white-space: nowrap; }
.l-node { justify-self: start; align-self: start; margin-top: 1px; padding: 0 7px; border-radius: 999px; font-size: 11px; line-height: 18px;
  color: hsl(var(--h) 80% 78%); background: hsl(var(--h) 45% 22% / .7); white-space: nowrap; }
.l-prog { color: #9fb3ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-msg { min-width: 0; overflow-wrap: anywhere; }
.logview.nowrap .l-msg { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.l-rawline { display: none; grid-column: 1 / -1; color: #7d8699; padding: 4px 0 6px; overflow-wrap: anywhere; }
.logrow.open .l-rawline { display: block; }
.logrow.open { background: rgba(255, 255, 255, .05); }
.hl-q { color: #7fd1ff; text-decoration: none; border-bottom: 1px dotted currentColor; }
.hl-m { color: #c7a6ff; cursor: pointer; }
.hl-ip { color: #f4c983; cursor: pointer; }
.hl-m:hover, .hl-ip:hover, .hl-q:hover { text-decoration: underline; }
.hl-ok { color: #6fdc9a; }
.hl-bad { color: #ff8a94; font-weight: 600; }
.log-raw { margin: 0; padding: 8px 16px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; color: inherit; background: none; border: 0; }
.logview.nowrap .log-raw { white-space: pre; }
.log-empty { padding: 40px; text-align: center; color: #7d8699; }
.log-foot { margin-top: var(--s2); font-size: 12px; }
@media (max-width: 900px) {
  .logrow { grid-template-columns: auto auto 1fr; }
  .l-prog { display: none; }
  .l-msg { grid-column: 1 / -1; }
  .logview { height: calc(100vh - 360px); }
}

/* Impressum/Datenschutz-Links (Branding) */
.legal-foot { font-size: 12.5px; color: var(--muted); text-align: center; padding: var(--s3) var(--s4); }
.legal-foot a { color: inherit; }
#login .legal-foot { position: absolute; bottom: 12px; left: 0; right: 0; }
#nav .legal-foot { text-align: left; border-top: 1px solid var(--line); margin-top: auto; }
#login { position: relative; }
