:root {
  --bg: #0b0e14;
  --bg-soft: #121722;
  --panel: #161c28;
  --panel-2: #1c2432;
  --border: #26303f;
  --text: #e7ecf4;
  --muted: #8b98ad;
  --accent: #f6821f;
  --accent-2: #ffb340;
  --ok: #2ecc71;
  --warn: #f2c94c;
  --err: #ff5f6d;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(246, 130, 31, .16), transparent 60%),
    radial-gradient(700px 420px at 92% 0%, rgba(80, 140, 255, .12), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; letter-spacing: -.02em; }
code, pre, .mono { font-family: "JetBrains Mono", "Cascadia Code", ui-monospace, monospace; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------------------------- Navigation ---------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(11, 14, 20, .78);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #10131a; font-weight: 800;
}
.nav-links { display: flex; gap: 6px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-links a, .tab {
  padding: 8px 14px; border-radius: 10px; color: var(--muted);
  font-weight: 500; border: 1px solid transparent; background: none; cursor: pointer;
  font-size: .92rem; font-family: inherit;
}
.nav-links a:hover, .tab:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.tab.active { color: var(--text); background: var(--panel-2); border-color: var(--border); }

/* ---------------------------- Buttons ---------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 18px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; transition: transform .12s ease, filter .12s ease, background .12s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #14171f;
}
.btn-ghost { background: transparent; }
.btn-danger { border-color: rgba(255, 95, 109, .4); color: #ffb3b8; background: rgba(255, 95, 109, .1); }
.btn-sm { padding: 6px 11px; font-size: .84rem; border-radius: 9px; }

/* ---------------------------- Karten ---------------------------- */

.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.sub { color: var(--muted); font-size: .9rem; margin: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; }
.stat .value { font-size: 1.7rem; font-weight: 700; margin-top: 4px; }
.stat .value small { font-size: .95rem; color: var(--muted); font-weight: 500; }

/* ---------------------------- Formulare ---------------------------- */

label { display: block; font-size: .84rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  background: #0e131c; border: 1px solid var(--border); color: var(--text);
  font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(246, 130, 31, .16); }
textarea { min-height: 150px; resize: vertical; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .86rem; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
.inline { display: flex; gap: 10px; align-items: center; }
.checkbox { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: .9rem; }
.checkbox input { width: auto; }

/* ---------------------------- Tabellen ---------------------------- */

.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--panel-2); color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, .025); }
td.actions { text-align: right; white-space: nowrap; }

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .04em;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
}
.badge-type { background: rgba(246, 130, 31, .14); border-color: rgba(246, 130, 31, .35); color: var(--accent-2); }
.badge-ok { background: rgba(46, 204, 113, .14); border-color: rgba(46, 204, 113, .35); color: #7ee2a8; }
.badge-warn { background: rgba(242, 201, 76, .14); border-color: rgba(242, 201, 76, .35); color: #ffe08a; }
.badge-err { background: rgba(255, 95, 109, .14); border-color: rgba(255, 95, 109, .35); color: #ff9aa2; }

/* ---------------------------- Diagramm ---------------------------- */

.chart { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 10px; }
.chart .bar { flex: 1; background: linear-gradient(180deg, var(--accent-2), rgba(246, 130, 31, .25)); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.chart .bar span { display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: #000; padding: 4px 8px; border-radius: 6px; font-size: .74rem; white-space: nowrap; border: 1px solid var(--border); }
.chart .bar:hover span { display: block; }
.bar-list { display: grid; gap: 8px; }
.bar-list .item { display: grid; grid-template-columns: 1fr auto; gap: 4px; font-size: .87rem; }
.bar-list .track { grid-column: 1 / -1; height: 6px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.bar-list .fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ---------------------------- Modal / Toast ---------------------------- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4, 6, 10, .72); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px; z-index: 80;
}
.modal { width: min(560px, 100%); max-height: 88vh; overflow-y: auto; }
.hidden { display: none !important; }

#toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 100; max-width: 380px; }
.toast {
  background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  padding: 12px 16px; border-radius: 11px; box-shadow: var(--shadow); font-size: .9rem;
  animation: slide-in .2s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
@keyframes slide-in { from { opacity: 0; transform: translateX(20px); } }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { color: var(--text); }

/* ---------------------------- Landing ---------------------------- */

.hero { padding: 90px 0 70px; text-align: center; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.hero .gradient { background: linear-gradient(120deg, var(--accent), var(--accent-2) 60%, #7db9ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 660px; margin: 14px auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.pill { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--muted); font-size: .85rem; margin-bottom: 18px; }
.feature { padding: 22px; }
.feature .icon { font-size: 1.5rem; margin-bottom: 10px; }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; }
pre.snippet {
  background: #080b11; border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; overflow-x: auto; font-size: .84rem; color: #cfe3ff;
}
footer { border-top: 1px solid var(--border); margin-top: 70px; padding: 26px 0; color: var(--muted); font-size: .88rem; }

@media (max-width: 720px) {
  .topbar-inner { height: auto; padding: 10px 0; flex-wrap: wrap; }
  .hero { padding: 56px 0 40px; }
}
