/* Backup Control Center – ein einheitliches Stylesheet */
:root {
  --bg: #0e1013;
  --side: #121418;
  --panel: #171a1f;
  --panel-2: #1d2127;
  --line: #262b33;
  --line-2: #323844;
  --text: #e7e9ec;
  --muted: #8a919b;
  --faint: #5c636d;
  --accent: #f08c2a;
  --accent-2: #ffa549;
  --accent-bg: rgba(240, 140, 42, .12);
  --ok: #3dbb7d;
  --ok-bg: rgba(61, 187, 125, .12);
  --warn: #e3b341;
  --warn-bg: rgba(227, 179, 65, .12);
  --bad: #ec5b52;
  --bad-bg: rgba(236, 91, 82, .12);
  --live: #4ea3f2;
  --live-bg: rgba(78, 163, 242, .12);
  --radius: 10px;
  --input: #111317;
  --sunken: #14171b;
  --deep: #0b0c0f;
  --track: #0f1114;
  --tile: #191c22;
  --code-text: #c9cdd3;
  --hover-line: #46505e;
  --hover-bg: #232830;
  --toast-bg: #23272e;
  --on-accent: #1b1006;
  --mono: "Cascadia Mono", Consolas, "SF Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--on-accent); }

/* ---------------------------------------------------------------- Rahmen */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--side); border-right: 1px solid var(--line); padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 16px;
}
.brand b { display: block; font-size: 14px; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { margin: 16px 10px 6px; color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px;
  color: var(--muted); font-weight: 550;
}
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: var(--accent-bg); color: var(--accent-2); }
.nav svg { width: 17px; height: 17px; flex: none; }
.nav .count { margin-left: auto; font-size: 11.5px; padding: 0 7px; border-radius: 99px; background: var(--panel-2); color: var(--muted); }
.nav .count.bad { background: var(--bad-bg); color: var(--bad); }
.nav .count.live { background: var(--live-bg); color: var(--live); }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; display: flex; justify-content: space-between; }
.side-foot a:hover { color: var(--text); }

.main { min-width: 0; }
.content { max-width: 1320px; margin: 0 auto; padding: 28px 32px 60px; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--accent-2); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-head .title-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- Karten */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head p { color: var(--muted); font-size: 13px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.cols > .card { margin-bottom: 0; }
.cols + .card, .cols + .cols { margin-top: 18px; }
.cols-3 { grid-template-columns: 2fr 1fr; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; display: block; }
a.kpi:hover { border-color: var(--line-2); }
.kpi span { color: var(--muted); font-size: 12.5px; }
.kpi strong { display: block; font-size: 24px; font-weight: 650; margin-top: 2px; }
.kpi strong small { font-size: 14px; color: var(--muted); font-weight: 500; }
.kpi small { color: var(--faint); font-size: 12px; }
.kpi.bad strong { color: var(--bad); }
.kpi.ok strong { color: var(--ok); }
.kpi.warn strong { color: var(--warn); }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); overflow: hidden; }
.facts > div { padding: 12px 18px; min-width: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); margin: 0 -1px -1px 0; }
.facts span { display: block; color: var(--muted); font-size: 12px; }
.facts b { display: block; font-weight: 550; overflow-wrap: anywhere; }

.banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid; }
.banner .sym { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.banner b { display: block; }
.banner span { color: var(--muted); font-size: 13px; }
.banner.ok { background: var(--ok-bg); border-color: rgba(61,187,125,.3); }
.banner.ok .sym { background: var(--ok); color: #08130d; }
.banner.warn { background: var(--warn-bg); border-color: rgba(227,179,65,.3); }
.banner.warn .sym { background: var(--warn); color: #1a1405; }
.banner.bad { background: var(--bad-bg); border-color: rgba(236,91,82,.3); }
.banner.bad .sym { background: var(--bad); color: #1a0705; }

/* ---------------------------------------------------------------- Tabellen & Listen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--faint); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: var(--panel-2); }
td small, .sub { display: block; color: var(--muted); font-size: 12.5px; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.nowrap { white-space: nowrap; }

.list-row { display: flex; align-items: center; gap: 13px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover, .list-row[data-href]:hover { background: var(--panel-2); cursor: pointer; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { color: var(--faint); font-size: 18px; }

.empty { padding: 30px 18px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }

.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--faint); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.dot.live { background: var(--live); box-shadow: 0 0 0 3px var(--live-bg); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------------------------------------------------------------- Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; font-style: normal; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.live { background: var(--live-bg); color: var(--live); border-color: transparent; }
.badge.accent { background: var(--accent-bg); color: var(--accent-2); border-color: transparent; }

/* ---------------------------------------------------------------- Buttons */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600; font-size: 13.5px;
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { border-color: var(--hover-line); background: var(--hover-bg); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel-2); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { color: var(--accent-2); cursor: pointer; background: none; border: 0; font: inherit; padding: 0; }
.link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- Toolbar / Filter */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { color: var(--text); background: var(--panel-2); }
.chip.active { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
.search { margin-left: auto; height: 32px; width: 280px; flex: 0 1 280px; }

/* ---------------------------------------------------------------- Formulare */
input, select, textarea {
  width: 100%; background: var(--input); color: var(--text); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 8px 11px; font: inherit; font-size: 13.5px;
}
textarea { resize: vertical; min-height: 80px; font-family: var(--mono); font-size: 12.5px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: 13px; }
.field > small, .hint { color: var(--muted); font-size: 12.5px; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--sunken); }
.check:hover { border-color: var(--line-2); }
.check input { margin-top: 3px; }
.check b { display: block; font-weight: 600; }
.check small { color: var(--muted); font-size: 12.5px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }

.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pick { position: relative; cursor: pointer; }
.pick input { position: absolute; opacity: 0; }
.pick > span { display: flex; flex-direction: column; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--sunken); transition: border-color .12s, background .12s; }
.pick strong { font-size: 18px; }
.pick b { font-weight: 550; }
.pick small { color: var(--muted); font-size: 12px; }
.pick:hover > span { border-color: var(--hover-line); }
.pick input:checked + span { border-color: var(--accent); background: var(--accent-bg); }
.pick input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-bg); }

.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 10px; }
.section-title small { color: var(--muted); }
.form-section + .form-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.savebar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; background: rgba(23,26,31,.96); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(6px); flex-wrap: wrap; }

details.advanced > summary { cursor: pointer; list-style: none; color: var(--muted); font-weight: 600; padding: 4px 0; }
details.advanced > summary::before { content: "▸ "; }
details.advanced[open] > summary::before { content: "▾ "; }
details.advanced > div { margin-top: 14px; }

/* ---------------------------------------------------------------- Fortschritt */
.progress { height: 8px; border-radius: 99px; background: var(--track); border: 1px solid var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.progress.ok > i { background: var(--ok); }
.progress.warn > i { background: var(--warn); }
.progress.bad > i { background: var(--bad); }
.progress.indeterminate > i { width: 35% !important; animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.progress.slim { height: 5px; }

.live-box { padding: 18px; }
.live-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.live-top strong { font-size: 26px; }
.live-meta { display: flex; gap: 22px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 10px; }
.live-meta b { color: var(--text); font-weight: 600; }
pre.log {
  margin: 0; max-height: 340px; overflow: auto; padding: 14px 16px; background: var(--deep); color: var(--code-text);
  font-family: var(--mono); font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-all;
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- Läufe */
.run { border-bottom: 1px solid var(--line); }
.run:last-child { border-bottom: 0; }
.run > summary { display: flex; align-items: center; gap: 13px; padding: 12px 18px; cursor: pointer; list-style: none; }
.run > summary::-webkit-details-marker { display: none; }
.run > summary:hover { background: var(--panel-2); }
.run[open] > summary { background: var(--panel-2); }
.run-body { padding: 4px 18px 18px; background: var(--panel-2); }
.run-body .facts { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.run-body .facts > div { background: var(--tile); }
.hash-table td, .hash-table th { padding: 8px 12px; }
.hash-table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 14px; display: table; }
.hash { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; color: var(--code-text); }
.hash-short { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.run-body pre.log { border: 1px solid var(--line); border-radius: 8px; }

/* ---------------------------------------------------------------- Dialoge */
.dialog { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; background: rgba(5,6,8,.65); backdrop-filter: blur(3px); padding: 20px; }
.dialog.open { display: grid; animation: fade .15s ease-out; }
.dialog-card { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.dialog-card.wide { width: min(860px, 100%); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dialog-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.dialog-body { padding: 20px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }

/* ---------------------------------------------------------------- Toasts */

/* ---------------------------------------------------------------- Speicher */
.disk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 18px; }
.disk { text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--sunken); display: flex; flex-direction: column; gap: 8px; }
.disk:hover { border-color: var(--line-2); }
.disk.due { border-color: rgba(227,179,65,.5); }
.disk-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.disk-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; }
.warn-text { color: var(--warn); }
.bad-text { color: var(--bad); }
.ok-text { color: var(--ok); }
.muted { color: var(--muted); }

/* ---------------------------------------------------------------- Pairing / Login */
.pair-code { font-family: var(--mono); font-size: 34px; letter-spacing: .12em; font-weight: 700; color: var(--accent-2); padding: 18px; text-align: center; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--input); margin-bottom: 12px; }
.steps { counter-reset: step; display: flex; flex-direction: column; gap: 14px; }
.steps > div { display: flex; gap: 12px; }
.steps > div::before { counter-increment: step; content: counter(step); flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); font-weight: 700; font-size: 12.5px; }
.steps small { display: block; color: var(--muted); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(400px, 100%); }
.login .brand { padding: 0 0 18px; }
.alert { padding: 10px 13px; border-radius: 8px; background: var(--bad-bg); color: var(--bad); margin-bottom: 14px; font-size: 13px; }

.module-choice { display: flex; flex-direction: column; gap: 4px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.module-choice:hover { border-color: var(--accent); }
.module-choice small { color: var(--muted); }

pre.code { margin: 0; padding: 14px 16px; background: var(--deep); border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-size: 12.5px; overflow: auto; color: var(--code-text); }
.prose p + p, .prose p + pre, .prose pre + p { margin-top: 10px; }
.prose code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }

/* ---------------------------------------------------------------- Responsiv */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; }
  .brand { padding: 0 8px 0 0; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-label, .side-foot { display: none; }
  .content { padding: 20px 16px 50px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .search { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------------------------------------------------------------- Themes */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.theme-tile {
  position: relative; display: flex; flex-direction: column; gap: 3px; padding: 12px; text-align: left;
  font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--line-2); border-radius: 10px; background: var(--sunken);
  transition: border-color .12s, background .12s;
}
.theme-tile:hover { border-color: var(--hover-line); }
.theme-tile.active { border-color: var(--accent); background: var(--accent-bg); }
.theme-tile b { font-weight: 600; }
.theme-tile small { color: var(--muted); font-size: 12px; }
.theme-swatches { display: flex; height: 42px; border-radius: 7px; overflow: hidden; margin-bottom: 8px; border: 1px solid var(--line); }
.theme-swatches i { flex: 1; }
.theme-remove { position: absolute; top: 6px; right: 8px; padding: 0 6px; border-radius: 6px; color: var(--muted); font-size: 12px; }
.theme-remove:hover { background: var(--bad-bg); color: var(--bad); }

/* Einstellungen: Tabs links, Inhalt rechts */
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 22px; align-items: start; }
.settings-nav { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav .nav-label { margin: 14px 10px 4px; }
.settings-nav a { display: flex; align-items: center; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 550; }
.settings-nav a:hover { background: var(--panel-2); color: var(--text); }
.settings-nav a.active { background: var(--accent-bg); color: var(--accent-2); }
.settings-nav .count { margin-left: auto; font-style: normal; font-size: 11.5px; padding: 0 7px; border-radius: 99px; background: var(--panel-2); }
.settings-panels > section > .card + .card { margin-top: 18px; }
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .settings-nav .nav-label { display: none; }
}

/* Angemeldeter Benutzer in der Seitenleiste */
.side-user { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; padding: 8px 10px; border-radius: 8px; }
.side-user:hover { background: var(--panel-2); }
.side-user b { display: block; font-size: 13px; }
.side-user small { color: var(--muted); font-size: 11.5px; }
.avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent-2); font-weight: 700; }

/* Nur-Lesen: Bedienelemente ausblenden, der Server lehnt Änderungen ohnehin ab */
body[data-role="viewer"] .main :is(.btn.primary, .btn.danger, [onclick*="runAction"], [data-open]):not(.settings-panels *) { display: none; }

/* Globale Suche */
.global-search { position: relative; flex: 1; min-width: 0; }
.global-search input { width: 100%; height: 34px; font-size: 13px; }
.search-pop { position: absolute; z-index: 60; top: 38px; left: 0; width: 380px; max-width: calc(100vw - 30px); max-height: 70vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.45); padding: 6px; }
.search-pop a { display: block; padding: 7px 10px; border-radius: 7px; }
.search-pop a:hover, .search-pop a:focus { background: var(--panel-2); outline: none; }
.search-pop a span { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-pop a small { color: var(--muted); font-size: 12px; }
.search-group { display: block; margin: 8px 10px 2px; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.search-none { padding: 10px; color: var(--muted); }
.search-pop .search-all { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; color: var(--accent-2); font-weight: 600; }

/* Sortierbare Tabellen */
table.sortable th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
table.sortable th[data-sort]:hover { color: var(--text); }
table.sortable th.sorted::after { content: " ▾"; color: var(--accent-2); }
table.sortable th.sorted.asc::after { content: " ▴"; }
.audit-detail { color: var(--muted); font-size: 12.5px; word-break: break-word; }
details.flash > summary { box-shadow: inset 3px 0 0 var(--accent); }

/* Toasts: stapelbar unten rechts, gleiten rein, Balken läuft ab, Hover pausiert */
#toasts { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { --tone: var(--live); position: relative; overflow: hidden; pointer-events: auto; display: flex; align-items: flex-start; gap: 11px;
  width: 360px; max-width: calc(100vw - 44px); padding: 12px 36px 14px 13px; border-radius: 11px; background: var(--toast-bg);
  border: 1px solid var(--line-2); box-shadow: 0 14px 40px rgba(0,0,0,.45); color: var(--text);
  opacity: 0; transform: translateX(110%) scale(.96); transition: transform .38s cubic-bezier(.2,1.3,.4,1), opacity .25s, margin .3s, max-height .3s; max-height: 200px; }
.toast.show { opacity: 1; transform: none; }
.toast.hide { opacity: 0; transform: translateX(60%) scale(.95); max-height: 0; margin-top: -10px; padding-top: 0; padding-bottom: 0; transition: .3s ease-in; }
.toast.ok { --tone: var(--ok); } .toast.bad { --tone: var(--bad); } .toast.warn { --tone: var(--warn); } .toast.live { --tone: var(--live); }
.toast-icon { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, transparent); animation: pop .45s .1s cubic-bezier(.2,1.6,.4,1) backwards; }
.toast.live .toast-icon { animation: spin 1.6s linear infinite; }
.toast-text { min-width: 0; }
.toast-text b { display: block; font-weight: 650; }
.toast-text b:empty { display: none; }
.toast-text span { display: block; font-size: 13px; color: var(--code-text); word-break: break-word; }
.toast-close { position: absolute; top: 8px; right: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; padding: 2px 6px; opacity: 0; transition: .15s; }
.toast:hover .toast-close { opacity: 1; }
.toast-close:hover { background: var(--panel-2); color: var(--text); }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--tone); transform-origin: left; animation: toastbar var(--ms, 4000ms) linear forwards; }
.toast:hover .toast-bar { animation-play-state: paused; }
a.toast:hover { border-color: var(--tone); }
@keyframes toastbar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes pop { from { transform: scale(0); } }

/* Glocke + Benachrichtigungszentrale */
.side-tools { display: flex; gap: 6px; align-items: center; margin: 0 0 14px; }
.bell { position: relative; flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--input); color: var(--muted); cursor: pointer; transition: .15s; }
.bell:hover { color: var(--text); border-color: var(--hover-line); }
.bell svg { width: 17px; height: 17px; transform-origin: 50% 10%; }
.bell.ring svg { animation: ring .9s ease-in-out; }
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; animation: pop .3s cubic-bezier(.2,1.6,.4,1); }
@keyframes ring { 10%, 30% { transform: rotate(16deg); } 20%, 40% { transform: rotate(-16deg); } 50% { transform: rotate(8deg); } 60% { transform: none; } }
.bell-panel { overflow: hidden; position: fixed; top: 112px; left: 14px; z-index: 99999999999; width: 390px; max-width: calc(100vw - 28px); max-height: 72vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.5); animation: drop .18s ease-out; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.bell-prefs { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--sunken); font-size: 13px; }
.bell-prefs small { color: var(--faint); text-transform: uppercase; font-size: 10.5px; letter-spacing: .08em; margin-top: 4px; }
.bell-prefs label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.bell-list { overflow: auto; padding: 6px; }
.bell-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 8px; transition: background .15s; animation: fadeup .25s ease-out backwards; }
.bell-item:hover { background: var(--panel-2); }
.bell-item .dot { margin-top: 6px; }
.bell-item b { display: block; font-size: 13px; }
.bell-item small { display: block; color: var(--muted); font-size: 12.5px; }
.bell-item time { flex: none; color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.bell-item.unread { background: var(--accent-bg); }
.bell-item.unread b::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.bell-empty { padding: 24px; text-align: center; color: var(--muted); }

/* Animationen */
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.content > * { animation: fadeup .35s ease-out backwards; }
.content > *:nth-child(2) { animation-delay: .04s; } .content > *:nth-child(3) { animation-delay: .08s; } .content > *:nth-child(4) { animation-delay: .12s; } .content > *:nth-child(n+5) { animation-delay: .16s; }
.dialog.open .dialog-card { animation: popin .22s cubic-bezier(.2,1.2,.4,1); }
@keyframes popin { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.search-pop:not([hidden]) { animation: drop .15s ease-out; }
.nav a, .settings-nav a, .btn, .chip, .list-row, .theme-tile, .card { transition: background .15s, color .15s, border-color .15s, transform .15s, box-shadow .2s; }
.nav a:hover svg { transform: translateX(2px); transition: transform .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.theme-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
a.list-row:hover, .list-row[data-href]:hover { box-shadow: inset 3px 0 0 var(--accent); }
[data-panel]:not([hidden]) { animation: fadeup .25s ease-out; }
.search-hit { animation: fadeup .2s ease-out backwards; }
mark { background: var(--accent-bg); color: var(--accent-2); border-radius: 3px; padding: 0 1px; }
@media (prefers-reduced-motion: reduce) { *:not(.toast-bar), *::before, *::after { animation: none !important; transition: none !important; } }
.bell-filter { padding: 8px 10px 0; }
.bell-list { flex: 1; min-height: 0; }

/* Seitenleiste als eigene Ebene über dem Inhalt (Such-Vorschläge ragen hinein), unter Dialogen (50) und Toasts (100) */
.sidebar { z-index: 40; }
