/* Gorilla Gate – eigenes, schlankes Design (keine Bibliothek). */

:root {
  --bg: #f4f6f4;
  --surface: #ffffff;
  --surface-2: #f7f8f7;
  --border: #e3e7e4;
  --border-strong: #cfd6d1;
  --text: #17201b;
  --text-2: #56635b;
  --text-3: #8a968f;
  --accent: #14805e;
  --accent-strong: #0d6b4e;
  --accent-soft: #e3f3ec;
  --accent-text: #0b5a42;
  --danger: #c83a32;
  --danger-soft: #fdecea;
  --warn: #b7791f;
  --warn-soft: #fdf3e1;
  --info: #2f6fd6;
  --info-soft: #e8f0fd;
  --violet: #6d4fd6;
  --violet-soft: #efebfd;
  --sidebar: #0f1a15;
  --sidebar-2: #17261f;
  --sidebar-text: #c6d3cc;
  --sidebar-muted: #7f9289;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 32, 24, .05), 0 4px 16px rgba(16, 32, 24, .05);
  --shadow-lg: 0 12px 40px rgba(10, 30, 20, .14);
  --focus: 0 0 0 3px rgba(20, 128, 94, .28);
  font-size: 15px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1210;
    --surface: #131c18;
    --surface-2: #18231e;
    --border: #23312a;
    --border-strong: #2f4037;
    --text: #e6eee9;
    --text-2: #a3b2aa;
    --text-3: #6f8077;
    --accent: #34b98a;
    --accent-strong: #4fcf9f;
    --accent-soft: #15332a;
    --accent-text: #7fe0bb;
    --danger: #ef6b62;
    --danger-soft: #3a1d1b;
    --warn: #e0a64a;
    --warn-soft: #3a2c15;
    --info: #74a6ff;
    --info-soft: #172843;
    --violet: #a993ff;
    --violet-soft: #2a2248;
    --sidebar: #080e0b;
    --sidebar-2: #121c17;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    --focus: 0 0 0 3px rgba(52, 185, 138, .35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv11", "ss01";
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; line-height: 1.25; }
h1 { font-size: 1.7rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 650; margin-bottom: .9rem; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
code, .mono { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; font-size: .86em; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: .08rem .35rem; border-radius: 6px; }
.muted { color: var(--text-3); }
.sub { color: var(--text-2); font-size: .92rem; }
.hint { color: var(--text-3); font-size: .85rem; margin-top: .9rem; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt { margin-top: .6rem; }

.ic { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.18em; }

/* ---------- Logo ---------- */
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 700; font-size: 1.05rem; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand.light { color: #fff; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(140deg, #2ec68e 0%, #14805e 55%, #0b4f3a 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 12px rgba(20,128,94,.35); }
.logo svg { width: 22px; height: 22px; }
.logo-shield { fill: rgba(255,255,255,.18); stroke: #fff; stroke-width: 2; stroke-linejoin: round; }
.logo-check { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .58rem 1rem; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: .93rem; line-height: 1.2; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, .action:focus-visible { outline: none; box-shadow: var(--focus); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 2px 6px rgba(20,128,94,.25); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { padding: .35rem .7rem; font-size: .84rem; }
.btn.lg { padding: .78rem 1.2rem; font-size: 1rem; }
.btn.block { width: 100%; }
.btn.copied { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--text-2); border: 1px solid transparent; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); text-decoration: none; }
.link { font-weight: 600; font-size: .88rem; display: inline-flex; align-items: center; gap: .3rem; }
.row-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* ---------- Formulare ---------- */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .38rem; margin: 0; }
.field > span { font-weight: 600; font-size: .88rem; color: var(--text); }
.field > span em { font-style: normal; font-weight: 500; color: var(--text-3); }
.field small { color: var(--text-3); font-size: .8rem; }
fieldset.plain { border: 0; padding: 0; min-width: 0; }
fieldset:disabled { opacity: .45; }
input[type=text], input[type=password], input[type=email], input[type=search], input:not([type]) {
  font: inherit; color: var(--text); width: 100%; padding: .62rem .8rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: var(--text-3); }
input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input.code { font-family: ui-monospace, Menlo, monospace; font-size: 1.6rem; letter-spacing: .45em; text-align: center; padding: .7rem .5rem .7rem 1rem; }
input.code.sm { font-size: 1.15rem; letter-spacing: .3em; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
form.inline { display: flex; gap: .7rem; align-items: stretch; flex-wrap: wrap; }
form.inline input.code { width: 13rem; }

.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: .35rem; padding: .36rem .8rem; border-radius: 999px; font-size: .86rem; font-weight: 550;
  border: 1px solid var(--border-strong); color: var(--text-2); background: var(--surface); transition: all .15s; }
.chip span::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; border: 1.5px solid var(--border-strong); transition: all .15s; }
.chip:hover span { border-color: var(--accent); }
.chip input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.chip input:checked + span::before { background: var(--accent); border-color: var(--accent); }
.chip input:focus-visible + span { box-shadow: var(--focus); }

.switch { display: inline-flex; align-items: center; gap: .7rem; cursor: pointer; font-weight: 500; font-size: .93rem; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; width: 40px; height: 23px; border-radius: 999px; background: var(--border-strong); transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }

.search { position: relative; display: inline-flex; align-items: center; }
.search .ic { position: absolute; left: .7rem; color: var(--text-3); }
.search input { padding-left: 2.2rem; width: 15rem; }

/* ---------- Hinweise ---------- */
.alert { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--radius-sm); border: 1px solid; font-size: .93rem; margin-bottom: 1.2rem; }
.alert > .ic { margin-top: .15rem; }
.alert > div { flex: 1; min-width: 0; }
.alert.ok { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-text); }
.alert.err { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.auth-card .alert { margin-bottom: 0; }
.note { display: flex; gap: .7rem; padding: .85rem 1rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--text-2); font-size: .88rem; }
.note > .ic { margin-top: .15rem; color: var(--accent); }
.copy-field { display: flex; gap: .5rem; margin-top: .7rem; }
.copy-field input { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; background: var(--surface); }

.badge { display: inline-flex; align-items: center; gap: .38rem; padding: .16rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 650; white-space: nowrap; vertical-align: middle; letter-spacing: .01em; }
.badge i { width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--accent-soft); color: var(--accent-text); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.gray { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
h1 .badge { font-size: .78rem; margin-left: .4rem; vertical-align: .3em; }
.tag { display: inline-flex; align-items: center; gap: .25rem; padding: .08rem .5rem; margin: .1rem .25rem .1rem 0; border-radius: 6px; font-size: .78rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.tag.accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.tag.outline { background: transparent; }
.tag .ic { width: .9em; height: .9em; }
.ok-icon { color: var(--accent); }

/* ---------- Avatare ---------- */
.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; font-weight: 700; font-size: .82rem; color: #fff; letter-spacing: .02em; }
.avatar.xl { width: 58px; height: 58px; font-size: 1.25rem; }
.av0 { background: linear-gradient(135deg, #22a979, #0e6e50); }
.av1 { background: linear-gradient(135deg, #4c8df6, #2a5fc4); }
.av2 { background: linear-gradient(135deg, #f0a63a, #cf6f18); }
.av3 { background: linear-gradient(135deg, #e46a8f, #b23a62); }
.av4 { background: linear-gradient(135deg, #9a7bf2, #6447c7); }
.av5 { background: linear-gradient(135deg, #32b6c4, #1d7f8c); }
.av6 { background: linear-gradient(135deg, #8aa13a, #5e7220); }
.av7 { background: linear-gradient(135deg, #e47a5a, #b54a2c); }

/* =========================================================
   Login-Seiten
   ========================================================= */
body.auth { min-height: 100vh; }
.auth-wrap { display: grid; grid-template-columns: minmax(340px, 44%) 1fr; min-height: 100vh; }
.auth-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 2.5rem 3rem; color: #e9f5ef;
  background:
    radial-gradient(900px 500px at -10% -10%, rgba(52,214,150,.35), transparent 60%),
    radial-gradient(700px 500px at 110% 110%, rgba(20,128,94,.55), transparent 60%),
    linear-gradient(160deg, #0f2a20 0%, #0b1d16 60%, #07130e 100%); }
.auth-brand::after { content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent); }
.auth-claim { position: relative; z-index: 1; max-width: 26rem; }
.auth-claim h2 { font-size: 2.5rem; line-height: 1.1; font-weight: 750; letter-spacing: -.03em; color: #fff; margin-bottom: 1rem; }
.auth-claim p { color: #a9c7b9; font-size: 1.05rem; }
.auth-foot { position: relative; z-index: 1; display: flex; gap: .5rem; align-items: center; font-size: .85rem; color: #7fa594; }
.auth-main { display: grid; place-items: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 1.1rem; }
.auth-card h1 { font-size: 1.75rem; }
.auth-card .lead { color: var(--text-2); margin-top: -.5rem; }
.only-mobile { display: none; }
.big-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.big-icon .ic { width: 26px; height: 26px; }
.big-icon.warn { background: var(--warn-soft); color: var(--warn); }

/* =========================================================
   App mit Seitenleiste
   ========================================================= */
.layout { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.5rem; padding: 1.25rem .9rem; background: var(--sidebar); color: var(--sidebar-text); }
.sidebar .brand { padding: .2rem .5rem; }
.sidebar nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.nav-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--sidebar-muted); padding: 1rem .7rem .4rem; }
.sidebar nav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 9px; color: var(--sidebar-text); font-weight: 550; font-size: .93rem; }
.sidebar nav a:hover { background: var(--sidebar-2); color: #fff; text-decoration: none; }
.sidebar nav a.on { background: linear-gradient(90deg, rgba(52,185,138,.22), rgba(52,185,138,.06)); color: #fff; box-shadow: inset 2px 0 0 #34b98a; }
.sidebar nav a .ic { opacity: .85; }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .8rem .5rem 0; border-top: 1px solid var(--sidebar-2); }
.me { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.me > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me strong { color: #fff; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me > div span { color: var(--sidebar-muted); font-size: .8rem; }
.sidebar .icon-btn { color: var(--sidebar-muted); }
.sidebar .icon-btn:hover { background: var(--sidebar-2); border-color: transparent; color: #fff; }

.content { min-width: 0; padding: 2rem clamp(1rem, 3vw, 2.75rem) 3rem; max-width: 1180px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.page-head:empty { display: none; }
.head-main { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.head-main .sub { margin-top: .3rem; }
.head-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: .35rem; color: var(--text-3); font-size: .85rem; font-weight: 600; margin-bottom: .35rem; }
.back:hover { color: var(--text); text-decoration: none; }

.section { margin-bottom: 1.75rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.35rem 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.card.flush { padding: 0; overflow: hidden; }
.narrow-card { max-width: 720px; }
.card-head { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1.1rem; }
.card-head.spread { justify-content: space-between; align-items: center; flex-wrap: wrap; }
.card-head.spread > .card-head { margin: 0; }
.card-head .sub { margin-top: .15rem; }
.card-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.card-icon.good { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.card-icon.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .card, .grid-2 + .section { margin-top: 1.25rem; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); }
.grid-2.wide-left > div > .card:last-child, .grid-2.wide-left > aside > .card:last-child { margin-bottom: 0; }

.empty { display: flex; flex-direction: column; align-items: center; gap: .8rem; text-align: center; padding: 3rem 1rem; color: var(--text-3);
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.empty > .ic { width: 34px; height: 34px; color: var(--border-strong); }
.empty.small { padding: 1.6rem 1rem; border: 0; background: transparent; }
.empty.good > .ic { color: var(--accent); }

/* Kacheln (Apps im Konto) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .85rem; }
.tiles.compact { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; }
.tile { position: relative; display: flex; align-items: center; gap: .85rem; padding: .95rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); text-decoration: none; }
.tile.dim { opacity: .55; }
.tiles.compact .tile { padding: .65rem .8rem; box-shadow: none; }
.tile-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 11px; color: #fff; font-weight: 750; font-size: .95rem; }
.tiles.compact .tile-icon { width: 32px; height: 32px; border-radius: 9px; font-size: .78rem; }
.tile-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.tile-body strong { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-body small { color: var(--text-3); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-flag { margin-left: auto; color: var(--violet); }

/* Geräte */
.devices { list-style: none; margin: 0; padding: 0; }
.devices li { display: flex; align-items: center; gap: .85rem; padding: .75rem 0; border-top: 1px solid var(--border); }
.devices li:first-child { border-top: 0; padding-top: 0; }
.device-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); flex: none; }
.device-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.device-body small { color: var(--text-3); font-size: .82rem; }
.device-title { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
details.disclosure summary { cursor: pointer; color: var(--text-2); font-size: .9rem; font-weight: 550; margin-bottom: .2rem; }
details.disclosure[open] summary { margin-bottom: 1rem; }

/* 2FA einrichten */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.6rem; }
.steps > li { position: relative; padding-left: 3rem; counter-increment: step; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: -.15rem; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 750; }
.steps h3 { margin-bottom: .45rem; }
.qr-row { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; margin-top: .7rem; }
.qr { background: #fff; padding: .6rem; border-radius: 12px; border: 1px solid var(--border); line-height: 0; }
.qr svg { width: 196px; height: 196px; }
.qr-row .sub { max-width: 18rem; display: flex; flex-direction: column; gap: .5rem; }
code.secret { display: inline-block; font-size: 1rem; letter-spacing: .06em; padding: .45rem .6rem; user-select: all; word-break: break-all; }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon num" "icon label" "note note"; column-gap: .9rem; align-items: center; align-content: start;
  padding: 1.1rem 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); transition: border-color .15s, transform .15s; }
.stat:hover { border-color: var(--border-strong); transform: translateY(-1px); text-decoration: none; }
.stat-icon { grid-area: icon; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); }
.stat-icon.green { background: var(--accent-soft); color: var(--accent); }
.stat-icon.amber { background: var(--warn-soft); color: var(--warn); }
.stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.stat-num { grid-area: num; font-size: 1.75rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.stat-label { grid-area: label; color: var(--text-2); font-size: .85rem; }
.stat-note { grid-area: note; color: var(--text-3); font-size: .78rem; margin-top: .55rem; }

/* Zeitleiste */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: .85rem; padding: 0 0 1rem 0; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 14px; bottom: -2px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .dot { flex: none; width: 10px; height: 10px; margin-top: .4rem; border-radius: 50%; background: var(--text-3); box-shadow: 0 0 0 3px var(--surface); position: relative; }
.timeline li.login .dot { background: var(--info); }
.timeline li.admin .dot { background: var(--violet); }
.timeline li.security .dot { background: var(--accent); }
.timeline li.bad .dot { background: var(--danger); }
.timeline li > div { font-size: .9rem; min-width: 0; }
.timeline small { display: block; color: var(--text-3); font-size: .78rem; }

.warnings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.warnings a { display: flex; gap: .65rem; align-items: flex-start; padding: .7rem .8rem; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: .88rem; font-weight: 550; }
.warnings li.info a { background: var(--info-soft); color: var(--info); }
.warnings a:hover { text-decoration: none; filter: brightness(.98); }
.warnings .ic { margin-top: .12rem; }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
  padding: .8rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr[hidden] { display: none; }
.table tr[data-href] { cursor: pointer; }
.who { display: flex; align-items: center; gap: .75rem; color: var(--text); min-width: 0; }
.who:hover { text-decoration: none; }
.who:hover strong { color: var(--accent); }
.who > span:not(.avatar) { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.who small { color: var(--text-3); font-size: .8rem; }
.table.log td { font-size: .86rem; }
.kind-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); margin-right: .55rem; vertical-align: .05em; }
.table.log tr.login .kind-dot { background: var(--info); }
.table.log tr.admin .kind-dot { background: var(--violet); }
.table.log tr.security .kind-dot { background: var(--accent); }
.table.log tr.bad .kind-dot { background: var(--danger); }
.table.log tr.bad td:nth-child(3) { color: var(--danger); }

.tabs { display: inline-flex; gap: .25rem; padding: .25rem; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 1rem; }
.tabs a { padding: .4rem .85rem; border-radius: 8px; font-size: .88rem; font-weight: 600; color: var(--text-2); }
.tabs a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.tabs a.on { background: var(--accent); color: #fff; }

/* Benutzer-Detail */
.facts { display: grid; grid-template-columns: auto 1fr; gap: .65rem 1rem; margin: 0; font-size: .9rem; }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; text-align: right; }
.actions { display: flex; flex-direction: column; }
.actions form { margin: 0; }
.action { display: flex; gap: .85rem; align-items: flex-start; width: 100%; padding: .75rem .7rem; margin: 0 0 .25rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.action:hover { background: var(--surface-2); border-color: var(--border); }
.action > .ic { margin-top: .15rem; color: var(--text-2); }
.action > span { display: flex; flex-direction: column; }
.action strong { font-weight: 600; font-size: .92rem; }
.action small { color: var(--text-3); font-size: .8rem; }
.action.warn > .ic, .action.warn strong { color: var(--warn); }
.action.danger > .ic, .action.danger strong { color: var(--danger); }
.action.danger:hover { background: var(--danger-soft); border-color: transparent; }

/* Apps */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1.1rem; }
.app-card { display: flex; flex-direction: column; gap: .9rem; margin: 0; }
.app-top { display: flex; align-items: center; gap: .85rem; }
.app-title { flex: 1; min-width: 0; }
.app-title h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-title .link { display: flex; align-items: center; gap: .3rem; font-weight: 500; font-size: .8rem; color: var(--text-3); min-width: 0; }
.app-title .link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-title .link:hover { color: var(--accent); }
.app-meta { display: flex; gap: .4rem; flex-wrap: wrap; }
.app-access { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem; }
.app-access .label { font-size: .75rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-right: .5rem; }
.app-foot { display: flex; gap: 1.2rem; flex-wrap: wrap; color: var(--text-3); font-size: .82rem; padding-top: .8rem; border-top: 1px solid var(--border); margin-top: auto; }
.app-foot span { display: inline-flex; align-items: center; gap: .35rem; }
.app-hint { font-size: .8rem; color: var(--warn); background: var(--warn-soft); padding: .55rem .7rem; border-radius: 8px; }
.app-hint code { display: block; margin-top: .35rem; word-break: break-all; background: transparent; border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: inherit; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
.danger-zone h3 { color: var(--danger); }

/* ---------- Mobil ---------- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2.wide-left { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .only-mobile { display: flex; margin-bottom: .5rem; }
  .layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .7rem .9rem; }
  .sidebar .brand span { display: none; }
  .sidebar nav { flex-direction: row; flex: 1; overflow-x: auto; gap: .1rem; }
  .nav-label { display: none; }
  .sidebar nav a { padding: .5rem .6rem; }
  .sidebar nav a span { display: none; }
  .sidebar nav a.on { box-shadow: none; }
  .sidebar-foot { border: 0; padding: 0; }
  .me > div { display: none; }
  .content { padding-top: 1.5rem; }
  .two { grid-template-columns: 1fr; }
  .search input { width: 100%; }
  .table th:nth-child(n+4), .table td:nth-child(n+4) { display: none; }
  #user-list th:nth-child(2), #user-list td:nth-child(2) { display: none; }
  .table th, .table td { padding: .65rem .7rem; }
  .who small { word-break: break-all; }
  .table td:last-child, .table th:last-child { display: table-cell; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  h1 { font-size: 1.4rem; }
  .avatar.xl { width: 46px; height: 46px; font-size: 1rem; }
}
