/* GLORiXX NEXUS – eigenes Design ohne Fremdbibliotheken (angelehnt an glorixxadmin, futuristischer) */

:root {
    --bg: #060912;
    --bg-2: #0a0f1d;
    --surface: rgba(15, 20, 35, 0.74);
    --surface-solid: #0f1527;
    --surface-2: rgba(140, 170, 255, 0.045);
    --surface-3: rgba(140, 170, 255, 0.09);
    --line: rgba(120, 160, 255, 0.13);
    --line-strong: rgba(120, 160, 255, 0.26);
    --text: #e6edf8;
    --muted: #8590ab;
    --accent: #38e1ff;
    --accent-2: #8a7dff;
    --accent-soft: rgba(56, 225, 255, 0.11);
    --grad: linear-gradient(120deg, #38e1ff 0%, #6aa8ff 45%, #8a7dff 100%);
    --glow: 0 0 0 1px rgba(56, 225, 255, 0.35), 0 0 22px -4px rgba(56, 225, 255, 0.55);
    --ok: #34e3a0;
    --warn: #ffc24d;
    --bad: #ff5d7a;
    --radius: 14px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
    position: relative;
    min-height: 100vh;
    background:
        radial-gradient(900px 520px at 88% -12%, rgba(138, 125, 255, 0.16), transparent 70%),
        radial-gradient(800px 500px at 10% 110%, rgba(56, 225, 255, 0.09), transparent 70%),
        var(--bg);
    color: var(--text);
    font: 14.5px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* feines Raster im Hintergrund, nach unten ausgeblendet */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(120, 170, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 170, 255, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 120% 80% at 50% 0%, #000 20%, transparent 75%);
}

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

h1, h2, h3 { margin: 0; }

code, .mono { font-family: var(--mono); font-size: 0.9em; overflow-wrap: anywhere; }
code { padding: 1px 6px; border-radius: 5px; background: var(--surface-3); color: #b9f3ff; }
.small { font-size: 12.5px; }
.muted { color: var(--muted); }
.text-bad { color: var(--bad); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.user-select-all { user-select: all; }
[hidden] { display: none !important; }

::selection { background: rgba(56, 225, 255, 0.3); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(120, 160, 255, 0.18); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(120, 160, 255, 0.32); }
::-webkit-scrollbar-track { background: transparent; }

.icon {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------------------------------------------------------------- layout */

.layout {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px 12px 16px;
    background: linear-gradient(180deg, rgba(10, 14, 27, 0.92), rgba(7, 10, 20, 0.92));
    border-right: 1px solid var(--line);
    backdrop-filter: blur(14px);
    z-index: 30;
}

/* Leuchtlinie an der Kante der Seitenleiste */
.sidebar::after {
    content: "";
    position: absolute;
    top: 0;
    right: -1px;
    width: 1px;
    height: 40%;
    background: linear-gradient(180deg, transparent, var(--accent), transparent);
    opacity: 0.5;
    animation: scan 7s ease-in-out infinite;
}

@keyframes scan { 0%, 100% { transform: translateY(-10%); } 50% { transform: translateY(160%); } }

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 10px 22px;
    color: var(--text);
    text-decoration: none !important;
}

.brand-logo {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--glow);
    flex: none;
}

.brand-logo img { width: 27px; height: 27px; object-fit: contain; }

.brand-text {
    display: flex;
    flex-direction: column;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.04em;
    line-height: 1.15;
}

.brand-text small {
    font: 700 11px/1.3 var(--mono);
    letter-spacing: 0.42em;
    text-transform: uppercase;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin: 0 -4px;
    padding: 0 4px;
    scrollbar-width: thin;
}

.nav-section {
    display: block;
    margin: 16px 10px 6px;
    font: 600 10.5px/1 var(--mono);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(133, 144, 171, 0.72);
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 12px;
    margin-bottom: 1px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 14px;
    text-decoration: none !important;
    transition: background 0.2s, color 0.2s;
}

.nav-item .icon { width: 17px; height: 17px; }
.nav-item:hover { color: var(--text); background: var(--surface-2); }

.nav-item.active {
    color: var(--text);
    font-weight: 600;
    background: linear-gradient(90deg, rgba(56, 225, 255, 0.14), rgba(138, 125, 255, 0.04) 80%, transparent);
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--grad);
    box-shadow: 0 0 12px var(--accent);
}

.nav-item.active .icon { color: var(--accent); filter: drop-shadow(0 0 6px rgba(56, 225, 255, 0.7)); }

.nav-item.soon { opacity: 0.45; cursor: default; }
.nav-item.soon:hover { background: none; color: var(--muted); }
.nav-item .soon-tag { margin-left: auto; font: 600 9.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line); }

.sidebar-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 8px 0;
    border-top: 1px solid var(--line);
}

.sidebar-foot .who { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.sidebar-foot .who strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .who small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font: 700 13px/1 var(--mono);
    color: #04101a;
    background: var(--grad);
    box-shadow: 0 0 16px -4px rgba(56, 225, 255, 0.7);
    flex: none;
}

.topbar { display: none; }

.content {
    padding: 28px clamp(16px, 3vw, 40px) 56px;
    width: 100%;
    min-width: 0;
}

/* ---------------------------------------------------------------- header */

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 24px;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    color: var(--muted);
    font: 600 11px/1 var(--mono);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.eyebrow .sep { opacity: 0.4; }

.live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ok);
}

.live i, .dot {
    position: relative;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    flex: none;
}

.live i::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: currentColor;
    animation: ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping { 70%, 100% { transform: scale(2.4); opacity: 0; } }

.page-head h1 {
    font-size: clamp(24px, 2.6vw, 32px);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.page-head h1 span {
    background: linear-gradient(90deg, #fff, #d4f6ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.clock {
    font: 300 28px/1 var(--mono);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
    color: #cfefff;
    text-shadow: 0 0 18px rgba(56, 225, 255, 0.35);
}

.clock small { display: block; margin-top: 7px; font-size: 11.5px; letter-spacing: 0.14em; color: var(--muted); text-shadow: none; }

.notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 11px;
    background: rgba(56, 225, 255, 0.06);
    border: 1px solid rgba(56, 225, 255, 0.22);
    color: #cfe9f2;
    font-size: 13.5px;
}

.notice .icon { color: var(--accent); margin-top: 1px; }
.notice.warn { background: rgba(255, 194, 77, 0.07); border-color: rgba(255, 194, 77, 0.3); color: #f1e2bf; }
.notice.warn .icon { color: var(--warn); }
.notice.bad { background: rgba(255, 93, 122, 0.08); border-color: rgba(255, 93, 122, 0.35); color: #f8ccd5; }
.notice.bad .icon { color: var(--bad); }
.notice p { margin: 0; }

/* ---------------------------------------------------------------- pills */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--surface-2);
    border: 1px solid var(--line);
    vertical-align: middle;
}

.pill .dot { width: 6px; height: 6px; }
.pill.ok { color: var(--ok); border-color: rgba(52, 227, 160, 0.3); }
.pill.warn { color: var(--warn); border-color: rgba(255, 194, 77, 0.3); }
.pill.bad { color: var(--bad); border-color: rgba(255, 93, 122, 0.4); }
.pill.info { color: var(--accent); border-color: rgba(56, 225, 255, 0.3); }
.pill.violet { color: #b9b0ff; border-color: rgba(138, 125, 255, 0.35); }
.pill.neutral { color: var(--muted); }

/* ---------------------------------------------------------------- buttons */

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border-radius: 9px;
    border: 1px solid var(--line-strong);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.25s, opacity 0.2s, filter 0.2s;
    white-space: nowrap;
    text-decoration: none !important;
}

.btn:hover { background: var(--surface-3); border-color: rgba(56, 225, 255, 0.45); box-shadow: 0 0 18px -6px rgba(56, 225, 255, 0.6); }

.btn.primary {
    background: var(--grad);
    border-color: transparent;
    color: #04101a;
    box-shadow: 0 0 22px -6px rgba(56, 225, 255, 0.75);
}

.btn.primary:hover { filter: brightness(1.12); box-shadow: 0 0 28px -4px rgba(56, 225, 255, 0.85); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: rgba(255, 93, 122, 0.4); background: rgba(255, 93, 122, 0.06); }
.btn.danger:hover { background: rgba(255, 93, 122, 0.14); border-color: var(--bad); box-shadow: 0 0 18px -6px var(--bad); }
.btn.warn { color: var(--warn); border-color: rgba(255, 194, 77, 0.4); }
.btn.warn:hover { background: rgba(255, 194, 77, 0.1); border-color: var(--warn); box-shadow: 0 0 18px -6px var(--warn); }
.btn.success { color: var(--ok); border-color: rgba(52, 227, 160, 0.4); }
.btn.success:hover { background: rgba(52, 227, 160, 0.1); border-color: var(--ok); box-shadow: 0 0 18px -6px var(--ok); }
.btn.small { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.small .icon { width: 14px; height: 14px; }
.btn .icon { width: 16px; height: 16px; }
.btn:disabled, .btn:disabled:hover { opacity: 0.4; cursor: not-allowed; box-shadow: none; filter: none; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    flex: none;
}

.icon-btn:hover { color: var(--accent); border-color: rgba(56, 225, 255, 0.45); background: var(--surface-2); }
.icon-btn.danger:hover { color: var(--bad); border-color: rgba(255, 93, 122, 0.5); }
.icon-btn .icon { width: 16px; height: 16px; }

.actions-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.actions-bar .hint { margin-left: 6px; }
.actions-bar .spacer { flex: 1; }

/* ---------------------------------------------------------------- forms */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 14px 16px;
}

.form-grid .full { grid-column: 1 / -1; }

.stack { display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .field > label {
    font: 600 11px/1.2 var(--mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.field .help { color: var(--muted); font-size: 12px; }

input[type=text], input[type=email], input[type=number], input[type=password], input[type=date], input[type=search], input[type=url], select, textarea {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border-radius: 9px;
    border: 1px solid var(--line-strong);
    background: rgba(4, 7, 15, 0.65);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea { height: auto; padding: 10px 12px; resize: vertical; }
select[multiple] { height: auto; padding: 6px; }
select[multiple] option { padding: 5px 8px; border-radius: 6px; }
select[multiple] option:checked { background: var(--accent-soft) linear-gradient(0deg, rgba(56, 225, 255, 0.2), rgba(56, 225, 255, 0.2)); color: var(--text); }

input::placeholder, textarea::placeholder { color: rgba(133, 144, 171, 0.6); }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 225, 255, 0.14), 0 0 18px -6px rgba(56, 225, 255, 0.7);
}

input[readonly] { color: var(--muted); background: rgba(140, 170, 255, 0.04); }

.btn:focus-visible, .icon-btn:focus-visible, a:focus-visible, .tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

input[type=date]::-webkit-calendar-picker-indicator { filter: invert(0.8); opacity: 0.7; cursor: pointer; }

.is-invalid { border-color: var(--bad) !important; box-shadow: 0 0 0 3px rgba(255, 93, 122, 0.14) !important; }
.invalid-feedback { display: none; color: var(--bad); font-size: 12px; }
.is-invalid ~ .invalid-feedback { display: block; }

.switch { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; font-size: 14px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch > span {
    position: relative;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: rgba(4, 7, 15, 0.7);
    border: 1px solid var(--line-strong);
    transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
    flex: none;
}
.switch > span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform 0.25s var(--ease), background 0.25s;
}
.switch input:checked + span { background: rgba(56, 225, 255, 0.2); border-color: var(--accent); box-shadow: 0 0 14px -4px var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + span { opacity: 0.5; }
.switch-list { display: flex; flex-direction: column; gap: 12px; }

/* ---------------------------------------------------------------- cards */

.card {
    position: relative;
    background:
        linear-gradient(90deg, transparent, rgba(56, 225, 255, 0.35), rgba(138, 125, 255, 0.25), transparent) top / 100% 1px no-repeat,
        var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    min-width: 0;
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 40px -28px rgba(0, 0, 0, 0.9);
}

/* HUD-Ecken */
.card::before, .card::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    pointer-events: none;
    opacity: 0.7;
}

.card::before { top: -1px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); border-top-left-radius: var(--radius); }
.card::after { right: -1px; bottom: -1px; border-bottom: 2px solid var(--accent-2); border-right: 2px solid var(--accent-2); border-bottom-right-radius: var(--radius); }

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.card-head h2 { display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
.card-head h2 small { font-weight: 400; font-size: 12.5px; color: var(--muted); }

.chip-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(56, 225, 255, 0.2);
    flex: none;
}

.chip-icon .icon { width: 16px; height: 16px; }

h3.sub {
    font: 600 11px/1.2 var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
    margin: 20px 0 10px;
}
h3.sub:first-child { margin-top: 0; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-all { grid-column: 1 / -1; }
.mb { margin-bottom: 16px; }

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px 18px;
    margin: 0;
}

.facts.stacked { grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 9px 16px; align-items: baseline; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.facts.stacked dd { margin: 0; }

.empty { color: var(--muted); margin: 0; font-size: 13.5px; }

.reveal { animation: reveal 0.5s var(--ease) var(--delay, 0s) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- KPIs */

.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.kpi { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-label { display: flex; align-items: center; gap: 10px; font: 600 11px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.kpi-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-top: 10px; }

.kpi-value {
    font: 700 34px/1 var(--mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    background: linear-gradient(180deg, #fff, #9fe9ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    min-width: 2ch;
}

.kpi .spark { width: 46%; max-width: 150px; height: 36px; }
.delta { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.delta .icon { width: 14px; height: 14px; }
.delta.up b { color: var(--ok); }
.delta.down b { color: var(--bad); }
.delta b { font-weight: 600; }

.skeleton { display: inline-block; width: 60px; height: 0.9em; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: flow 1.4s linear infinite; }

/* ---------------------------------------------------------------- meters */

.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 18px 26px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.meter-label { font: 600 10.5px/1.2 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.meter-value { margin: 6px 0 8px; font: 600 20px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.meter-time { margin-top: 6px; font-size: 11.5px; color: var(--muted); }

.bar { height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); box-shadow: 0 0 10px rgba(56, 225, 255, 0.7); transition: width 1s var(--ease); }

.host-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.host-list li { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.host-list li .dot { color: var(--accent); width: 6px; height: 6px; }
.host-list li span { flex: 1; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; }
.host-list li b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.table th {
    text-align: left;
    font: 600 10.5px/1.2 var(--mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 10px 10px;
    border-bottom: 1px solid var(--line-strong);
    white-space: nowrap;
    user-select: none;
}

.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover td { background: rgba(56, 225, 255, 0.04); }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.table.nowrap td { white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }
.table .end { text-align: right; white-space: nowrap; }
.table .strong { font-weight: 600; }
.table.compact td { padding: 7px 8px; }
.table.compact th { padding: 7px 8px; }

.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }
.table th.sortable::after { content: "↕"; margin-left: 6px; opacity: 0.3; font-size: 11px; }
.table th.asc::after { content: "↑"; opacity: 1; color: var(--accent); }
.table th.desc::after { content: "↓"; opacity: 1; color: var(--accent); }

.yes { color: var(--ok); }
.no { color: var(--muted); opacity: 0.6; }
.yes .icon, .no .icon { width: 16px; height: 16px; vertical-align: middle; }

.table-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.table-tools .search { position: relative; flex: 0 1 300px; }
.table-tools .search .icon { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.table-tools .search input { padding-left: 36px; }
.table-tools .group { display: flex; align-items: center; gap: 8px; }
.table-tools select { width: auto; height: 34px; padding: 0 30px 0 10px; font-size: 13px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 4px; }
.pager button { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); font: 600 12.5px/1 var(--mono); cursor: pointer; }
.pager button:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); }
.pager button.active { color: #04101a; background: var(--grad); box-shadow: 0 0 14px -4px var(--accent); }
.pager button:disabled { opacity: 0.35; cursor: default; }
.pager .icon { width: 14px; height: 14px; vertical-align: middle; }
.table-empty td { text-align: center; color: var(--muted); padding: 30px 10px !important; }

/* ---------------------------------------------------------------- tabs */

.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; border-radius: 11px; background: rgba(4, 7, 15, 0.55); border: 1px solid var(--line); margin-bottom: 16px; width: fit-content; max-width: 100%; }
.tab {
    padding: 6px 13px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(56, 225, 255, 0.4), 0 0 14px -6px var(--accent); }
.tab .count { margin-left: 6px; font: 600 11px/1 var(--mono); color: var(--accent); }

/* ---------------------------------------------------------------- charts */

.chart { position: relative; height: 260px; }
.chart.small { height: 120px; margin-top: 6px; }
.chart-stack { display: flex; flex-direction: column; gap: 14px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: rgba(120, 160, 255, 0.1); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .axis { fill: var(--muted); font: 10.5px var(--mono); }
.chart .line { fill: none; stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.chart .cursor { stroke: rgba(56, 225, 255, 0.5); stroke-width: 1; }
.chart .marker { stroke: var(--bg); stroke-width: 2; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); font-size: 13px; }

.spark svg { display: block; width: 100%; height: 100%; }
.spark rect { transition: opacity 0.2s; }
.spark rect:hover { opacity: 0.7; }

.tooltip {
    position: absolute;
    top: 6px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 11px;
    border-radius: 9px;
    background: rgba(10, 15, 29, 0.94);
    border: 1px solid var(--line-strong);
    box-shadow: 0 10px 30px -10px #000, 0 0 18px -8px var(--accent);
    font-size: 12px;
    pointer-events: none;
    white-space: nowrap;
}

.tooltip strong { font: 600 11px/1.3 var(--mono); color: var(--muted); letter-spacing: 0.06em; }
.tooltip i, .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; box-shadow: 0 0 6px currentColor; }

.legend { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- code preview, lists */

pre {
    margin: 0;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(3, 6, 13, 0.75);
    border: 1px solid var(--line);
    font: 12.5px/1.6 var(--mono);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 420px;
    overflow: auto;
    color: #c8d3ea;
}

pre .k { color: var(--accent); }
pre .s { color: #8ef0c4; }
pre .n { color: #c3b8ff; }
pre .b { color: var(--warn); }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 1px; background: linear-gradient(180deg, var(--accent), var(--line-strong) 30%, transparent); }
.timeline li { position: relative; display: grid; grid-template-columns: 118px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 7px 0 7px 22px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 13px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-strong); }
.timeline li:first-child::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.timeline time { font: 600 12px var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.timeline em { font-style: normal; color: var(--muted); font-family: var(--mono); font-size: 12px; }

/* ---------------------------------------------------------------- autocomplete */

.autocomplete { position: relative; }
.autocomplete-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 20;
    list-style: none;
    margin: 0;
    padding: 5px;
    border-radius: 11px;
    background: rgba(10, 15, 29, 0.97);
    border: 1px solid var(--line-strong);
    box-shadow: 0 20px 40px -14px #000, 0 0 22px -10px var(--accent);
}
.autocomplete-list li { padding: 8px 11px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.autocomplete-list li small { margin-left: 8px; color: var(--muted); font-family: var(--mono); }
.autocomplete-list li.active, .autocomplete-list li:hover { background: var(--accent-soft); color: var(--text); }
.autocomplete-list mark { background: none; color: var(--accent); font-weight: 700; }

/* ---------------------------------------------------------------- license, release */

.license-clients { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.client-configs { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.client-configs:empty { display: none; }
.client-card .card-head h2 .num { font-family: var(--mono); color: var(--accent); }
.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px 18px; }

.change-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.change-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.change-type { justify-content: flex-start; }
.change-type.feature .icon { color: var(--ok); }
.change-type.fix .icon { color: var(--warn); }

/* ---------------------------------------------------------------- dialog, toasts, loader */

.dialog {
    width: min(460px, calc(100vw - 32px));
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--line-strong);
    background: rgba(12, 17, 31, 0.97);
    color: var(--text);
    box-shadow: 0 30px 80px -20px #000, 0 0 40px -16px var(--accent);
}

.dialog[open] { animation: pop 0.25s var(--ease); }
.dialog::backdrop { background: rgba(3, 5, 10, 0.72); backdrop-filter: blur(4px); }
.dialog h2 { font-size: 18px; margin-bottom: 10px; }
.dialog p { color: var(--muted); margin: 0 0 20px; white-space: pre-line; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.dialog .btn.danger.confirm-plain { color: #04101a; background: var(--grad); border-color: transparent; }

@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }

.toast {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 12px 16px;
    border-radius: 11px;
    background: rgba(12, 17, 31, 0.96);
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--ok);
    box-shadow: 0 16px 34px -14px #000;
    font-size: 13.5px;
    animation: toast-in 0.35s var(--ease);
    transition: opacity 0.4s, transform 0.4s;
}

.toast .icon { color: var(--ok); margin-top: 1px; }
.toast strong { display: block; font-size: 13px; }
.toast span { color: var(--muted); }
.toast.bad { border-left-color: var(--bad); }
.toast.bad .icon { color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }
.toast.warn .icon { color: var(--warn); }
.toast.info { border-left-color: var(--accent); }
.toast.info .icon { color: var(--accent); }
.toast.out { opacity: 0; transform: translateX(12px); }

@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } }

/* Ladebalken oben, sperrt die Seite während einer Anfrage */
.loadbar { position: fixed; inset: 0 0 auto; height: 2px; z-index: 70; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
.loadbar i { display: block; height: 100%; width: 40%; background: var(--grad); box-shadow: 0 0 12px var(--accent), 0 0 4px var(--accent); animation: loading 1.1s ease-in-out infinite; }
body.busy .loadbar { opacity: 1; }
body.busy { cursor: progress; }
body.busy .content { pointer-events: none; }

@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@keyframes flow { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- login, error */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; }
.auth-box { width: min(100%, 400px); display: flex; flex-direction: column; gap: 26px; }
.auth .brand { justify-content: center; padding: 0; }
.auth .brand-logo { width: 52px; height: 52px; border-radius: 15px; }
.auth .brand-logo img { width: 35px; height: 35px; }
.auth .brand-text { font-size: 19px; }
.auth .card { padding: 26px; }
.auth .btn.primary { width: 100%; height: 42px; margin-top: 4px; }
.auth-foot { text-align: center; color: var(--muted); font: 11px var(--mono); letter-spacing: 0.18em; text-transform: uppercase; }

.error-code {
    font: 800 clamp(72px, 14vw, 120px)/1 var(--mono);
    text-align: center;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 24px rgba(56, 225, 255, 0.35));
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
    .grid.two, .license-clients { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
    .layout { grid-template-columns: minmax(0, 1fr); }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 25;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 16px;
        background: rgba(7, 10, 20, 0.88);
        border-bottom: 1px solid var(--line);
        backdrop-filter: blur(14px);
    }

    .topbar .brand { padding: 0; }
    .topbar .brand-logo { width: 34px; height: 34px; }
    .topbar .brand-logo img { width: 23px; height: 23px; }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(290px, 86vw);
        transform: translateX(-102%);
        transition: transform 0.35s var(--ease);
    }

    body.nav-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, 0.8); }
    body.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 20; background: rgba(3, 5, 10, 0.6); }

    .content { padding-top: 22px; }
    .page-head { align-items: flex-start; }
    .clock { font-size: 20px; }
}

@media (max-width: 560px) {
    .card { padding: 16px; }
    .kpi-value { font-size: 28px; }
    .clock { display: none; }
    .change-row { grid-template-columns: minmax(0, 1fr) auto; }
    .change-row .change-type { grid-column: 1 / -1; width: fit-content; }
    .timeline li { grid-template-columns: minmax(0, 1fr) auto; }
    .timeline em { display: none; }
    .table-tools .search { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
    body { background: #fff; color: #000; }
    body::before, .sidebar, .topbar, .toasts, .loadbar, .table-tools, .table-foot { display: none !important; }
    .layout { display: block; }
    .card { background: none; border: 0; box-shadow: none; backdrop-filter: none; }
}

/* Icons in Tabellenzellen auf Textlinie */
.table td .icon { width: 15px; height: 15px; vertical-align: -3px; }
.tab-body { min-height: 60px; }
/* Cursor und Punkte der Diagramme nur beim Überfahren */
.chart .cursor, .chart .marker { opacity: 0; transition: opacity 0.15s; }
.chart:hover .cursor, .chart:hover .marker { opacity: 1; }

/* Platz der Scrollleiste immer reservieren: sonst springt das Layout, sobald die Diagramme nachladen */
html { scrollbar-gutter: stable; }
.content { overflow-x: clip; }
.chart { contain: layout; }

/* Kennzahlen nie 3 + 1 umbrechen */
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1250px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis { grid-template-columns: minmax(0, 1fr); } }
