/* Iwanow-IT Design-System (Quelle: Tray-App / Connect) – dunkles Theme */
:root {
  --bg: #070b16; --card: #0e1424; --card-hover: #131b2e; --border: #1e2a3d; --border-strong: #2a3953;
  --input: #0a101d; --surface-active: #18223a; --text: #f1f5f9; --muted: #8b9ab1; --placeholder: #5b6b84;
  --primary: #0b6cff; --primary-hover: #2a7fff; --ring: rgba(11,108,255,.35);
  --ok: #22c55e; --warn: #f5a524; --waiting: #a78bfa; --bad: #f05252;
  --icon-bg: rgba(11,108,255,.12); --icon: #7fb2ff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: #7fb2ff; text-decoration: none; }
a:hover { color: #a9caff; }
h1 { font-size: 21px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
p { margin: 0 0 10px; }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Layout */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--card); border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--text); }
.brand img { width: 34px; height: 34px; }
.brand .overline { font-size: 10.5px; font-weight: 800; letter-spacing: .18em; color: var(--muted); text-transform: uppercase; display: block; }
.brand .name { font-size: 15px; font-weight: 700; display: block; line-height: 1.2; }
.nav-label { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.nav a:hover { background: var(--card-hover); color: var(--text); }
.nav a.active { background: var(--surface-active); color: var(--text); }
.nav a.active svg { color: var(--icon); }
.nav .count { margin-left: auto; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }
.user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar { width: 32px; height: 32px; border-radius: 10px; background: var(--icon-bg); color: var(--icon); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.user .who { min-width: 0; }
.user .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user .who span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--border); background: rgba(7,11,22,.85); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 5; }
.topbar .spacer { flex: 1; }
.content { padding: 24px; max-width: 1240px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); } .crumb a:hover { color: var(--text); }

/* Karten, Kacheln */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.card + .card { margin-top: 12px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; }
.grid { display: grid; gap: 12px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; gap: 14px; align-items: flex-start; color: var(--text); transition: background .15s, border-color .15s; }
a.tile:hover { background: var(--card-hover); border-color: var(--border-strong); color: var(--text); }
.tile .ibox { width: 42px; height: 42px; border-radius: 11px; background: var(--icon-bg); color: var(--icon); display: grid; place-items: center; flex: none; }
.tile .t { display: block; font-size: 15px; font-weight: 700; }
.tile .d { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.tile.primary { background: var(--primary); border-color: var(--primary); }
.tile.primary .ibox { background: rgba(255,255,255,.16); color: #fff; }
.tile.primary .d { color: rgba(255,255,255,.8); }
a.tile.primary:hover { background: var(--primary-hover); }
.stat .v { display: block; font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat .l { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; font: 600 13px/1 inherit; font-family: inherit; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--primary); background: var(--primary); color: #fff; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn.secondary { background: transparent; border-color: var(--border); color: var(--text); }
.btn.secondary:hover { background: var(--card-hover); border-color: var(--border-strong); }
.btn.danger { background: transparent; border-color: rgba(240,82,82,.45); color: #ff8a8a; }
.btn.danger:hover { background: rgba(240,82,82,.12); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 6px 8px; }
.btn.ghost:hover { color: var(--text); background: var(--card-hover); }
.btn.small { padding: 6px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
form.inline { display: inline; }

/* Formulare */
label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]), select, textarea {
  width: 100%; background: var(--input); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font: inherit; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 180px; }
.input-suffix { display: flex; align-items: stretch; }
.input-suffix input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-suffix span { display: flex; align-items: center; padding: 0 12px; background: var(--surface-active); border: 1px solid var(--border); border-left: 0; border-radius: 0 8px 8px 0; color: var(--muted); white-space: nowrap; }
.validation, .field-error { color: #ff8a8a; font-size: 12.5px; margin-top: 5px; }
.validation ul { margin: 0; padding-left: 18px; }

/* Toggle (Schieberegler) */
.toggle { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; margin: 0; color: var(--text); font-weight: 400; font-size: 14px; }
.toggle:last-child { border-bottom: 0; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .rail { width: 40px; height: 24px; border-radius: 999px; background: #1f2a3c; position: relative; flex: none; transition: background .15s; }
.toggle .rail::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + .rail { background: var(--primary); }
.toggle input:checked + .rail::after { transform: translateX(16px); }
.toggle input:focus-visible + .rail { box-shadow: 0 0 0 3px var(--ring); }
.toggle .txt b { display: block; font-weight: 600; }
.toggle .txt span { display: block; font-size: 12.5px; color: var(--muted); }

/* Tabellen */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,.015); }
td.actions { text-align: right; white-space: nowrap; }
td .muted, .muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }

/* Status, Badges */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(34,197,94,.16); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 4px rgba(245,165,36,.16); }
.dot.wait { background: var(--waiting); box-shadow: 0 0 0 4px rgba(167,139,250,.16); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 4px rgba(240,82,82,.16); }
.dot.off { background: var(--placeholder); box-shadow: 0 0 0 4px rgba(91,107,132,.16); }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--primary); color: #fff; white-space: nowrap; }
.badge.warn { background: var(--warn); color: #1b1200; }
.badge.ok { background: rgba(34,197,94,.15); color: #6ee7a0; }
.badge.bad { background: rgba(240,82,82,.15); color: #ff9a9a; }
.badge.wait { background: rgba(167,139,250,.15); color: #c4b5fd; }
.badge.neutral { background: var(--surface-active); color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-active); font-size: 12.5px; }

/* Hinweise */
.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.alert svg { flex: none; margin-top: 1px; }
.alert.ok { background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.3); }
.alert.bad { background: rgba(240,82,82,.08); border-color: rgba(240,82,82,.35); }
.alert.info { background: rgba(11,108,255,.08); border-color: rgba(11,108,255,.3); }
.alert.warn { background: rgba(245,165,36,.08); border-color: rgba(245,165,36,.35); }
.empty { text-align: center; padding: 34px 10px; color: var(--muted); }
.empty .ibox { width: 46px; height: 46px; border-radius: 12px; background: var(--icon-bg); color: var(--icon); display: grid; place-items: center; margin: 0 auto 10px; }

/* Tabs */
.tabs { display: inline-flex; gap: 2px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 16px; }
.tabs a { padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: 13px; }
.tabs a.active { background: var(--surface-active); color: var(--text); }

/* Details als aufklappbare Formulare */
details.edit > summary { list-style: none; cursor: pointer; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit[open] > summary { color: var(--text); }
.edit-row td { background: var(--input); }

/* Domain-Suche */
.search-hero { display: flex; gap: 10px; }
.search-hero input { font-size: 16px; padding: 12px 14px; }
.result { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.result:last-child { border-bottom: 0; }
.result .name { font-weight: 700; font-size: 15px; }
.result .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Anmeldung */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(900px 500px at 50% -10%, rgba(11,108,255,.16), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 22px; }
.auth-brand img { width: 44px; height: 44px; }
.auth-card .card { padding: 24px; }
.auth-card h1 { margin-bottom: 4px; }
.qr { background: #fff; padding: 10px; border-radius: 10px; width: 196px; margin: 4px 0 12px; }
.qr img { display: block; width: 176px; height: 176px; }
.secret { font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; background: var(--input); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; word-break: break-all; }

.mobile-nav { display: none; }
.foot-note { color: var(--placeholder); font-size: 12px; margin-top: 28px; }

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav { display: flex; gap: 4px; overflow-x: auto; padding: 8px 16px; border-bottom: 1px solid var(--border); background: var(--card); }
  .mobile-nav a { padding: 7px 10px; border-radius: 8px; color: var(--muted); font-weight: 600; white-space: nowrap; font-size: 13px; }
  .mobile-nav a.active { background: var(--surface-active); color: var(--text); }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .search-hero { flex-direction: column; }
  .hide-m { display: none; }
}
@media (max-width: 520px) { .grid-4 { grid-template-columns: 1fr 1fr; } }

/* Impressum / Datenschutz */
.rechtliches { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; color: var(--placeholder); padding: 28px 0 8px; }
.rechtliches a { color: var(--placeholder); }
.rechtliches a:hover { color: inherit; }

/* Cookie-Hinweis (nicht blockierend, unten) */
.cookie-hinweis { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 760px; margin: 0 auto; display: flex; gap: 16px; align-items: center;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 12px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: 13px; color: var(--muted); }
.cookie-hinweis b { color: var(--text); }
.cookie-hinweis a { margin-left: 4px; }
.cookie-hinweis form { margin: 0; flex: none; }
@media (max-width: 600px) { .cookie-hinweis { flex-direction: column; align-items: stretch; } .cookie-hinweis .btn { width: 100%; justify-content: center; } }

/* Speicherbelegung */
.belegung { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; width: 140px; margin: 4px 0 2px; }
.belegung .bar { height: 100%; }
.belegung .bar.ok { background: #3fb97a; } .belegung .bar.warn { background: #e0a23a; } .belegung .bar.bad { background: #e5534b; }
.text-bad { color: #ff9a9a; }
.einrichtung td:first-child { color: var(--muted); width: 38%; }
.liste-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }

/* Statistik-Balken */
.balken { display: grid; gap: 6px; margin: 6px 0; }
.b-zeile { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.b-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-spur { height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.b-wert { display: block; height: 100%; border-radius: 5px; }
.b-wert.ok { background: #3fb97a; } .b-wert.warn { background: #e0a23a; } .b-wert.bad { background: #e5534b; }
.b-zahl { font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
