/* ==========================================================================
   MeinRobot – Designsystem
   Alle Farben ausschließlich über Design-Tokens (CSS-Variablen), damit
   Hell- und Dunkelmodus überall automatisch funktionieren.
   ========================================================================== */

/* ---------- Design-Tokens: Hell ---------- */
:root {
    color-scheme: light;

    --brand-50: #eef2ff;
    --brand-100: #e0e7ff;
    --brand-200: #c7d2fe;
    --brand-300: #a5b4fc;
    --brand-400: #818cf8;
    --brand-500: #6366f1;
    --brand-600: #4f46e5;
    --brand-700: #4338ca;
    --brand-800: #3730a3;
    --brand-900: #312e81;
    --violet-500: #8b5cf6;
    --violet-600: #7c3aed;

    --bg: #f6f7fb;
    --bg-subtle: #eef0f6;
    --surface: #ffffff;
    --surface-2: #f9fafc;
    --surface-hover: #f3f4f8;
    --surface-active: #eceef5;
    --overlay: rgba(15, 23, 42, .45);

    --border: #e4e7ef;
    --border-strong: #cfd4e0;
    --ring: rgba(79, 70, 229, .35);

    --text: #0f172a;
    --text-2: #334155;
    --text-muted: #64748b;
    --text-faint: #94a3b8;
    --text-on-brand: #ffffff;

    --primary: var(--brand-600);
    --primary-hover: var(--brand-700);
    --primary-soft: var(--brand-50);
    --primary-soft-text: var(--brand-700);

    --up: #16a34a;
    --up-soft: #dcfce7;
    --up-text: #166534;
    --down: #dc2626;
    --down-soft: #fee2e2;
    --down-text: #991b1b;
    --degraded: #d97706;
    --degraded-soft: #fef3c7;
    --degraded-text: #92400e;
    --pending: #ea580c;
    --pending-soft: #ffedd5;
    --pending-text: #9a3412;
    --maintenance: #2563eb;
    --maintenance-soft: #dbeafe;
    --maintenance-text: #1e40af;
    --paused: #6b7280;
    --paused-soft: #f1f5f9;
    --paused-text: #475569;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .07), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, .07), 0 2px 4px rgba(15, 23, 42, .04);
    --shadow-lg: 0 18px 40px rgba(15, 23, 42, .12), 0 4px 10px rgba(15, 23, 42, .05);
    --shadow-brand: 0 8px 24px rgba(79, 70, 229, .28);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 999px;
    /* Einheitliche Höhen für Buttons, Eingabefelder, Auswahllisten */
    --control-h: 40px;
    --control-h-sm: 32px;
    --control-h-lg: 46px;
    --control-radius: var(--radius);
    --control-radius-sm: 8px;
    --control-radius-lg: 12px;

    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    --sidebar-w: 260px;
    --topbar-h: 64px;
    --transition: 160ms cubic-bezier(.4, 0, .2, 1);

    --gradient-brand: linear-gradient(135deg, var(--brand-600) 0%, var(--violet-600) 100%);
    --gradient-hero: radial-gradient(1200px 600px at 10% -10%, rgba(99, 102, 241, .16), transparent 60%),
                     radial-gradient(900px 500px at 100% 0%, rgba(139, 92, 246, .14), transparent 55%);
}

/* ---------- Design-Tokens: Dunkel ---------- */
:root[data-theme="dark"] {
    color-scheme: dark;

    --bg: #0b0f1a;
    --bg-subtle: #0f1422;
    --surface: #121827;
    --surface-2: #161d2e;
    --surface-hover: #1b2336;
    --surface-active: #212a40;
    --overlay: rgba(2, 6, 16, .7);

    --border: #232c41;
    --border-strong: #2f3a53;
    --ring: rgba(129, 140, 248, .45);

    --text: #e8ecf5;
    --text-2: #c3cad9;
    --text-muted: #8a94ab;
    --text-faint: #5d6780;

    --primary: var(--brand-500);
    --primary-hover: var(--brand-400);
    --primary-soft: rgba(99, 102, 241, .14);
    --primary-soft-text: var(--brand-300);

    --up: #22c55e;
    --up-soft: rgba(34, 197, 94, .14);
    --up-text: #4ade80;
    --down: #ef4444;
    --down-soft: rgba(239, 68, 68, .15);
    --down-text: #f87171;
    --degraded: #f59e0b;
    --degraded-soft: rgba(245, 158, 11, .15);
    --degraded-text: #fbbf24;
    --pending: #f97316;
    --pending-soft: rgba(249, 115, 22, .15);
    --pending-text: #fb923c;
    --maintenance: #3b82f6;
    --maintenance-soft: rgba(59, 130, 246, .15);
    --maintenance-text: #60a5fa;
    --paused: #8a94ab;
    --paused-soft: rgba(138, 148, 171, .14);
    --paused-text: #a3acc0;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .35);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, .35);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, .5);
    --shadow-brand: 0 8px 28px rgba(99, 102, 241, .35);

    --gradient-hero: radial-gradient(1200px 600px at 10% -10%, rgba(99, 102, 241, .22), transparent 60%),
                     radial-gradient(900px 500px at 100% 0%, rgba(139, 92, 246, .18), transparent 55%);
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* fieldset nur als Gruppierung (z. B. zum Sperren per disabled); Rahmen/Abstand kommen von .card bzw. .stack */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Schmale Scrollleisten im Stil der Oberfläche (Farben folgen Hell/Dunkel über die Variablen) */
:root {
    --scrollbar-size: 6px;
    --scrollbar-thumb: color-mix(in srgb, var(--text-faint) 45%, transparent);
    --scrollbar-thumb-hover: color-mix(in srgb, var(--primary) 70%, transparent);
}
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) transparent; }
*::-webkit-scrollbar { width: var(--scrollbar-size); height: var(--scrollbar-size); }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: var(--radius-full); }
*::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
*::-webkit-scrollbar-corner { background: transparent; }
html.theme-transition, html.theme-transition *, html.theme-transition *::before, html.theme-transition *::after {
    transition: background-color 250ms ease, border-color 250ms ease, color 250ms ease, fill 250ms ease !important;
}
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; color: var(--text); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
code, kbd, pre, .mono { font-family: var(--font-mono); font-size: .875em; }
code { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .1em .4em; }
pre { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; overflow-x: auto; margin: 0 0 1rem; }
pre code { background: none; border: 0; padding: 0; }
kbd { display: inline-block; min-width: 1.6em; padding: .1em .45em; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); font-size: .75rem; color: var(--text-2); text-align: center; }
::selection { background: var(--brand-200); color: var(--brand-900); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; flex-shrink: 0; }
.icon-lg { width: 22px; height: 22px; flex-shrink: 0; }
.icon-xl { width: 32px; height: 32px; flex-shrink: 0; }

/* ---------- Hilfsklassen ---------- */
.flex { display: flex; } .inline-flex { display: inline-flex; } .grid { display: grid; }
.items-center { align-items: center; } .items-start { align-items: flex-start; } .items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; } .justify-end { justify-content: flex-end; }
.flex-col { flex-direction: column; } .flex-wrap { flex-wrap: wrap; } .flex-1 { flex: 1 1 0%; min-width: 0; } .shrink-0 { flex-shrink: 0; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; } .gap-6 { gap: 1.5rem; } .gap-8 { gap: 2rem; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; } .mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .75rem; } .mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; } .mb-8 { margin-bottom: 2rem; }
.ml-auto { margin-left: auto; } .mx-auto { margin-left: auto; margin-right: auto; }
.p-0 { padding: 0 !important; }
.w-full { width: 100%; } .max-w-sm { max-width: 420px; } .max-w-md { max-width: 560px; } .max-w-lg { max-width: 760px; } .max-w-xl { max-width: 960px; }
.text-center { text-align: center; } .text-right { text-align: right; }
.text-xs { font-size: .75rem; } .text-sm { font-size: .875rem; } .text-lg { font-size: 1.125rem; } .text-xl { font-size: 1.25rem; } .text-2xl { font-size: 1.6rem; } .text-3xl { font-size: 2rem; }
.font-medium { font-weight: 500; } .font-semibold { font-weight: 600; } .font-bold { font-weight: 700; }
.text-muted { color: var(--text-muted); } .text-faint { color: var(--text-faint); } .text-2 { color: var(--text-2); }
.text-up { color: var(--up); } .text-down { color: var(--down); } .text-degraded { color: var(--degraded); } .text-primary { color: var(--primary); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.break-all { word-break: break-all; }
.hide-mobile { } .show-mobile { display: none; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .5rem; }
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    height: var(--control-h); padding: 0 1rem; border-radius: var(--control-radius);
    font: inherit; font-size: .9rem; font-weight: 600; line-height: 1;
    border: 1px solid transparent; cursor: pointer; white-space: nowrap; user-select: none;
    transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
    text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary); color: var(--text-on-brand); box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--primary-hover); color: var(--text-on-brand); }
.btn-gradient { background: var(--gradient-brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn-gradient:hover { color: #fff; filter: brightness(1.07); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--surface-hover); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-danger { background: var(--down); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); color: #fff; }
.btn-danger-soft { background: var(--down-soft); color: var(--down-text); }
.btn-danger-soft:hover { color: var(--down-text); filter: brightness(.97); }
.btn-success { background: var(--up); color: #fff; }
.btn-sm { height: var(--control-h-sm); padding: 0 .75rem; font-size: .82rem; border-radius: var(--control-radius-sm); }
.btn-lg { height: var(--control-h-lg); padding: 0 1.4rem; font-size: 1rem; border-radius: var(--control-radius-lg); }
.btn-icon { width: var(--control-h); padding: 0; flex-shrink: 0; }
.btn-icon.btn-sm { width: var(--control-h-sm); }
.btn-icon.btn-lg { width: var(--control-h-lg); }
.btn-block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; }
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn-group { display: inline-flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Formulare ---------- */
.field { margin-bottom: 1.1rem; }
.field:last-child { margin-bottom: 0; }
.label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-2); margin-bottom: .4rem; }
.label .optional { font-weight: 400; color: var(--text-faint); margin-left: .25rem; }
.help { font-size: .8rem; color: var(--text-muted); margin-top: .35rem; }
.field-error { font-size: .8rem; color: var(--down-text); margin-top: .35rem; display: flex; gap: .3rem; align-items: center; }
.input, .select, .textarea {
    display: block; width: 100%; height: var(--control-h); padding: 0 .85rem;
    font: inherit; font-size: .92rem; color: var(--text);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--control-radius);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    appearance: none;
}
.input-sm, .select-sm { height: var(--control-h-sm); font-size: .85rem; border-radius: var(--control-radius-sm); }
.input-sm { padding: 0 .65rem; }
.select-sm { padding-left: .65rem; padding-right: 2rem; background-position: right .5rem center; }
.input-lg, .select-lg { height: var(--control-h-lg); font-size: 1rem; border-radius: var(--control-radius-lg); }
.select-auto { width: auto; }
.textarea { height: auto; min-height: 110px; padding: .65rem .85rem; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--down); }
.input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .25); }
.input[readonly] { background: var(--surface-2); color: var(--text-muted); }
.input-mono { font-family: var(--font-mono); font-size: .85rem; }
.select {
    padding-right: 2.25rem; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .7rem center; background-size: 16px;
}
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 0; }
.input-group > :first-child { border-top-left-radius: var(--control-radius); border-bottom-left-radius: var(--control-radius); }
.input-group > :last-child { border-top-right-radius: var(--control-radius); border-bottom-right-radius: var(--control-radius); }
.input-group > * + * { margin-left: -1px; }
.input-addon { display: inline-flex; align-items: center; padding: 0 .8rem; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-muted); font-size: .85rem; white-space: nowrap; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.input-icon > .input { padding-left: 2.4rem; }
.password-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.form-actions { display: flex; gap: .75rem; justify-content: flex-end; align-items: center; margin-top: 1.5rem; flex-wrap: wrap; }
.form-section { padding: 1.5rem 0; border-top: 1px solid var(--border); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section-title { font-size: 1rem; font-weight: 700; margin-bottom: .25rem; }
.form-section-desc { font-size: .85rem; color: var(--text-muted); margin-bottom: 1rem; }

.check { display: flex; gap: .65rem; align-items: flex-start; cursor: pointer; font-size: .9rem; }
.check input[type="checkbox"], .check input[type="radio"] {
    appearance: none; flex-shrink: 0; width: 18px; height: 18px; margin: 2px 0 0;
    border: 1.5px solid var(--border-strong); background: var(--surface); border-radius: 5px; cursor: pointer;
    display: grid; place-content: center; transition: background var(--transition), border-color var(--transition);
}
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { background: var(--primary); border-color: var(--primary); }
.check input[type="checkbox"]:checked::after { content: ""; width: 10px; height: 10px; background: #fff; clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
.check input[type="radio"]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.check input:focus-visible { box-shadow: 0 0 0 3px var(--ring); outline: none; }
.check-desc { display: block; font-size: .8rem; color: var(--text-muted); margin-top: .1rem; }

.switch { display: inline-flex; align-items: center; gap: .7rem; cursor: pointer; font-size: .9rem; }
.switch input { appearance: none; position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--border-strong); cursor: pointer; transition: background var(--transition); flex-shrink: 0; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--transition); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { box-shadow: 0 0 0 3px var(--ring); outline: none; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; }
.choice { position: relative; display: flex; flex-direction: column; gap: .35rem; padding: 1rem; border: 1.5px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); cursor: pointer; transition: border-color var(--transition), box-shadow var(--transition), background var(--transition); }
.choice:hover { border-color: var(--border-strong); background: var(--surface-2); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); background: var(--primary-soft); }
.choice-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.choice-title { font-weight: 600; font-size: .92rem; }
.choice-desc { font-size: .78rem; color: var(--text-muted); line-height: 1.4; }

/* ---------- Karten ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.card-body { padding: 1.5rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--border); }
.card-header h2, .card-header h3 { margin: 0; font-size: 1rem; }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card-title { font-size: 1rem; font-weight: 700; margin: 0; }
.card-subtitle { font-size: .85rem; color: var(--text-muted); margin: .15rem 0 0; }
.card-hover { transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition); }
.card-hover:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-flush .table-wrap { border: 0; border-radius: 0; }

/* ---------- Kennzahlen ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.kpi { position: relative; padding: 1.1rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); overflow: hidden; }
.kpi-label { font-size: .8rem; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: .4rem; }
.kpi-value { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; margin-top: .3rem; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .78rem; color: var(--text-muted); margin-top: .15rem; }
.kpi-accent { position: absolute; inset: 0 auto 0 0; width: 3px; }
.kpi.is-up .kpi-accent { background: var(--up); } .kpi.is-down .kpi-accent { background: var(--down); }
.kpi.is-paused .kpi-accent { background: var(--paused); } .kpi.is-brand .kpi-accent { background: var(--primary); }

/* ---------- Status ---------- */
.status-dot { position: relative; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--paused); flex-shrink: 0; }
.status-dot.is-up { background: var(--up); } .status-dot.is-down { background: var(--down); }
.status-dot.is-degraded { background: var(--degraded); } .status-dot.is-pending { background: var(--pending); }
.status-dot.is-maintenance { background: var(--maintenance); } .status-dot.is-paused { background: var(--paused); }
.status-dot.is-up::after, .status-dot.is-down::after, .status-dot.is-pending::after {
    content: ""; position: absolute; inset: -4px; border-radius: 50%; background: inherit; opacity: .35;
    animation: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;
}
.status-dot.is-down::after { animation-duration: 1.1s; }
@keyframes pulse { 0%, 100% { transform: scale(.6); opacity: .45; } 50% { transform: scale(1.25); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .status-dot::after { animation: none !important; } }

.badge { display: inline-flex; align-items: center; gap: .35rem; height: 24px; padding: 0 .6rem; border-radius: var(--radius-full); font-size: .74rem; font-weight: 650; white-space: nowrap; background: var(--paused-soft); color: var(--paused-text); }
.badge .status-dot { width: 7px; height: 7px; }
.badge .status-dot::after { display: none; }
.badge-up { background: var(--up-soft); color: var(--up-text); }
.badge-down { background: var(--down-soft); color: var(--down-text); }
.badge-degraded { background: var(--degraded-soft); color: var(--degraded-text); }
.badge-pending { background: var(--pending-soft); color: var(--pending-text); }
.badge-maintenance, .badge-info { background: var(--maintenance-soft); color: var(--maintenance-text); }
.badge-brand { background: var(--primary-soft); color: var(--primary-soft-text); }
.badge-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); }

/* Uptime-Balken (z. B. 90 Tage) */
.uptime-bars { display: flex; gap: 2px; align-items: stretch; height: 30px; }
.uptime-bars span { flex: 1 1 0; min-width: 2px; border-radius: 2px; background: var(--up); opacity: .9; transition: opacity var(--transition), transform var(--transition); }
.uptime-bars span:hover { opacity: 1; transform: scaleY(1.12); }
.uptime-bars span.is-down { background: var(--down); } .uptime-bars span.is-degraded { background: var(--degraded); }
.uptime-bars span.is-maintenance { background: var(--maintenance); } .uptime-bars span.is-nodata { background: var(--border); }
.uptime-bars.is-small { height: 18px; gap: 1.5px; }

.sparkline { width: 100%; height: 32px; color: var(--primary); }

/* ---------- Hinweise ---------- */
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1rem; border-radius: var(--radius); border: 1px solid transparent; font-size: .9rem; }
.alert > .icon { margin-top: 1px; }
.alert-title { font-weight: 700; margin-bottom: .15rem; }
.alert p:last-child { margin-bottom: 0; }
.alert-info { background: var(--maintenance-soft); color: var(--maintenance-text); }
.alert-success { background: var(--up-soft); color: var(--up-text); }
.alert-warning { background: var(--degraded-soft); color: var(--degraded-text); }
.alert-danger { background: var(--down-soft); color: var(--down-text); }
.alert-brand { background: var(--primary-soft); color: var(--primary-soft-text); }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; font-size: .74rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: .75rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--surface-hover); }
.table .actions { text-align: right; white-space: nowrap; }
.table-compact td, .table-compact th { padding: .5rem .8rem; }
.row-link { color: var(--text); font-weight: 600; }
.row-link:hover { color: var(--primary); }

/* ---------- Seitenkopf ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.page-title { font-size: 1.6rem; margin: 0; }
.page-subtitle { color: var(--text-muted); margin: .3rem 0 0; font-size: .92rem; }
.breadcrumbs { display: flex; gap: .4rem; align-items: center; font-size: .82rem; color: var(--text-muted); margin-bottom: .5rem; }
.breadcrumbs a { color: var(--text-muted); } .breadcrumbs a:hover { color: var(--text); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: .45rem; padding: .7rem .9rem; font-size: .9rem; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.is-active { color: var(--primary); border-bottom-color: var(--primary); }

.segmented { display: inline-flex; height: var(--control-h); padding: 3px; gap: 2px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--control-radius); }
.segmented button, .segmented a { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; height: 100%; padding: 0 .7rem; border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: .8rem; font-weight: 600; border-radius: 7px; cursor: pointer; }
.segmented label { display: contents; }
.segmented label > span { display: inline-flex; align-items: center; justify-content: center; height: 100%; padding: 0 .7rem; color: var(--text-muted); font-size: .8rem; font-weight: 600; border-radius: 7px; cursor: pointer; }
.segmented label > span:hover { color: var(--text); }
.segmented button:hover, .segmented a:hover { color: var(--text); }
.segmented .is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Theme-Umschalter ---------- */
.theme-toggle { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-full); background: var(--bg-subtle); border: 1px solid var(--border); }
.theme-toggle button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); cursor: pointer; transition: background var(--transition), color var(--transition); }
.theme-toggle button:hover { color: var(--text); }
.theme-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.theme-toggle .icon { width: 16px; height: 16px; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; padding: .35rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 60; opacity: 0; visibility: hidden; transform: translateY(-4px) scale(.98); pointer-events: none; transition: opacity 120ms ease, transform 120ms ease, visibility 0s linear 120ms; }
.dropdown.is-open .dropdown-menu { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition-delay: 0s; }
.dropdown-menu.align-left { left: 0; right: auto; }
.dropdown-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .7rem; border: 0; background: none; border-radius: 8px; font: inherit; font-size: .88rem; color: var(--text-2); text-align: left; cursor: pointer; }
.dropdown-item:hover { background: var(--surface-hover); color: var(--text); }
.dropdown-item.is-danger { color: var(--down-text); }
.dropdown-item.is-active { color: var(--primary); font-weight: 600; }
.dropdown-header { padding: .6rem .7rem .4rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }
.dropdown-divider { height: 1px; background: var(--border); margin: .35rem 0; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: var(--overlay); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity 160ms ease; }
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal-dialog { width: 100%; max-width: 520px; max-height: calc(100vh - 2rem); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); transform: translateY(8px) scale(.98); transition: transform 160ms ease; }
.modal.is-open .modal-dialog { transform: none; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem 0; }
.modal-header h2 { font-size: 1.1rem; margin: 0; }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: .6rem; padding: 0 1.5rem 1.25rem; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: flex; flex-direction: column; gap: .6rem; max-width: min(420px, calc(100vw - 2rem)); }
.toast { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: .9rem; animation: toast-in 220ms ease; }
.toast.is-success { border-left-color: var(--up); } .toast.is-success > .icon { color: var(--up); }
.toast.is-error { border-left-color: var(--down); } .toast.is-error > .icon { color: var(--down); }
.toast.is-warning { border-left-color: var(--degraded); } .toast.is-warning > .icon { color: var(--degraded); }
.toast.is-leaving { animation: toast-out 200ms ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

/* ---------- Leere Zustände ---------- */
.empty { text-align: center; padding: 3rem 1.5rem; }
.empty-art { width: 220px; max-width: 70%; margin: 0 auto 1.25rem; }
.empty-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 1rem; background: var(--primary-soft); color: var(--primary); }
.empty h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.empty p { color: var(--text-muted); max-width: 440px; margin: 0 auto 1.25rem; }

/* ---------- Spinner / Skeleton ---------- */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--surface-hover) 37%, var(--bg-subtle) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.progress { height: 8px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--gradient-brand); transition: width 400ms ease; }
.progress.is-warning > span { background: var(--degraded); } .progress.is-danger > span { background: var(--down); }

.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gradient-brand); color: #fff; font-size: .8rem; font-weight: 700; flex-shrink: 0; }
.avatar-sm { width: 26px; height: 26px; font-size: .68rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.logo:hover { color: var(--text); }
.logo .logo-img { width: auto; max-width: none; }
.logo .logo-on-dark { display: none; }
:root[data-theme="dark"] .logo .logo-on-light { display: none; }
:root[data-theme="dark"] .logo .logo-on-dark { display: block; }
.logo-mark { width: 36px; height: 36px; }

/* ==========================================================================
   App-Layout (Kunden- und Adminbereich)
   ========================================================================== */
.app { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar-w); display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); transition: transform 200ms ease; }
.sidebar-brand { display: flex; align-items: center; height: var(--topbar-h); padding: 0 1.25rem; border-bottom: 1px solid var(--border); }
.sidebar-org { padding: .9rem .9rem .3rem; }
.org-switch { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .55rem .65rem; border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius); cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.org-switch:hover { border-color: var(--border-strong); }
.org-switch .org-name { font-weight: 650; font-size: .88rem; }
.org-switch .org-plan { font-size: .72rem; color: var(--text-muted); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem .75rem 1rem; }
.nav-section { margin-top: 1.1rem; }
.nav-section-title { padding: 0 .65rem .4rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); }
.nav-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; margin-bottom: 2px; border-radius: var(--radius); color: var(--text-2); font-size: .9rem; font-weight: 550; transition: background var(--transition), color var(--transition); }
.nav-link:hover { background: var(--surface-hover); color: var(--text); }
.nav-link.is-active { background: var(--primary-soft); color: var(--primary-soft-text); }
.nav-link.is-active .icon { color: var(--primary); }
.nav-link .icon { color: var(--text-muted); }
.nav-count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 .4rem; border-radius: 999px; display: inline-grid; place-items: center; font-size: .7rem; font-weight: 700; background: var(--bg-subtle); color: var(--text-muted); }
.nav-count.is-down { background: var(--down); color: #fff; }
.sidebar-footer { padding: .9rem; border-top: 1px solid var(--border); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem; height: var(--topbar-h); padding: 0 1.75rem; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--border); }
.search-trigger { display: flex; align-items: center; gap: .6rem; width: min(380px, 100%); height: var(--control-h); padding: 0 .75rem; border: 1px solid var(--border); border-radius: var(--control-radius); background: var(--surface); color: var(--text-faint); font: inherit; font-size: .88rem; cursor: pointer; }
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger kbd { margin-left: auto; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.content { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 2rem 1.75rem 3rem; }
.app-footer { padding: 1.25rem 1.75rem; font-size: .78rem; color: var(--text-faint); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.menu-toggle { display: none; }
.sidebar-backdrop { display: none; }

.impersonation-bar { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .5rem 1rem; background: var(--degraded); color: #1f1300; font-size: .85rem; font-weight: 600; }
.announcement { display: flex; align-items: center; gap: .75rem; padding: .6rem 1.75rem; font-size: .86rem; border-bottom: 1px solid var(--border); }
.announcement.is-info { background: var(--maintenance-soft); color: var(--maintenance-text); }
.announcement.is-warning { background: var(--degraded-soft); color: var(--degraded-text); }
.announcement.is-critical { background: var(--down-soft); color: var(--down-text); }
.announcement.is-success { background: var(--up-soft); color: var(--up-text); }

/* Admin-Bereich: eigene Akzentfarbe zur klaren Unterscheidung */
.is-admin { --primary: var(--violet-600); --primary-hover: #6d28d9; --primary-soft: #f5f3ff; --primary-soft-text: #6d28d9; --ring: rgba(124, 58, 237, .35); }
:root[data-theme="dark"] .is-admin { --primary: var(--violet-500); --primary-hover: #a78bfa; --primary-soft: rgba(139, 92, 246, .15); --primary-soft-text: #c4b5fd; }
.admin-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 .5rem; border-radius: 6px; background: var(--primary); color: #fff; font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-left: .5rem; }

/* ==========================================================================
   Monitor-Liste
   ========================================================================== */
.monitor-list { display: flex; flex-direction: column; }
.monitor-row { display: grid; grid-template-columns: auto minmax(0, 2.2fr) minmax(0, 1.4fr) 110px 110px auto; align-items: center; gap: 1.25rem; padding: .95rem 1.25rem; border-bottom: 1px solid var(--border); color: var(--text); transition: background var(--transition); }
.monitor-row:last-child { border-bottom: 0; }
.monitor-row:hover { background: var(--surface-hover); color: var(--text); }
.monitor-name { font-weight: 650; font-size: .93rem; }
.monitor-target { font-size: .78rem; color: var(--text-muted); }
.monitor-metric { font-size: .85rem; font-variant-numeric: tabular-nums; text-align: right; }
.monitor-metric small { display: block; font-size: .7rem; color: var(--text-faint); }
.type-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 .45rem; border-radius: 5px; background: var(--bg-subtle); color: var(--text-muted); font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.toolbar { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar .input-icon { flex: 1; min-width: 200px; max-width: 360px; }

.chart { width: 100%; height: 300px; }
.chart-sm { height: 200px; }

.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 1.25rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -1.5rem; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.timeline-item.is-down::before { border-color: var(--down); } .timeline-item.is-up::before { border-color: var(--up); }
.timeline-item.is-muted::before { border-color: var(--border-strong); }
.timeline-time { font-size: .76rem; color: var(--text-muted); }
.timeline-title { font-weight: 650; font-size: .9rem; }

.dl { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: .6rem 1rem; font-size: .88rem; margin: 0; }
.dl dt { color: var(--text-muted); }
.dl dd { margin: 0; word-break: break-word; }

.code-snippet { position: relative; }
.code-snippet pre { padding-right: 3rem; }
.code-snippet .copy-btn { position: absolute; top: .5rem; right: .5rem; }

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.25rem; font-size: .85rem; color: var(--text-muted); border-top: 1px solid var(--border); }

/* ==========================================================================
   Gast-Layouts: Login, Installer, Fehlerseiten
   ========================================================================== */
.guest { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); background-image: var(--gradient-hero); }
.guest-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 2rem; }
.guest-main { flex: 1; display: grid; place-items: center; padding: 1.5rem 1rem 3rem; }
.guest-card { width: 100%; max-width: 440px; }
.guest-card .card-body { padding: 2rem; }
.guest-title { font-size: 1.5rem; margin-bottom: .35rem; text-align: center; }
.guest-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 1.75rem; font-size: .93rem; }
.guest-footer { padding: 1.25rem 2rem; display: flex; justify-content: center; gap: 1.25rem; flex-wrap: wrap; font-size: .8rem; color: var(--text-faint); }
.guest-footer a { color: var(--text-muted); }

.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-pane { display: flex; flex-direction: column; padding: 1.5rem 2rem; background: var(--bg); }
.auth-pane .guest-main { place-items: center; }
.auth-art { position: relative; overflow: hidden; background: linear-gradient(160deg, #312e81 0%, #4c1d95 100%); color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 3rem; }
.auth-art img.auth-art-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-art::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px); background-size: 22px 22px; }
.auth-art-content { position: relative; max-width: 460px; }
.auth-art h2 { color: #fff; font-size: 1.8rem; }
.auth-art p { color: rgba(255, 255, 255, .78); }
.auth-features { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .7rem; }
.auth-features li { display: flex; gap: .6rem; align-items: center; color: rgba(255, 255, 255, .9); font-size: .92rem; }
.auth-features .icon { color: #86efac; }
.divider-text { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0; color: var(--text-faint); font-size: .8rem; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.otp-input { letter-spacing: .5em; text-align: center; font-family: var(--font-mono); font-size: 1.4rem; height: 52px; }

/* Installer */
.installer { width: 100%; max-width: 860px; }
.installer-card { display: grid; grid-template-columns: 250px minmax(0, 1fr); overflow: hidden; }
.installer-steps { padding: 1.75rem 1.25rem; background: var(--surface-2); border-right: 1px solid var(--border); }
.installer-steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.installer-step { display: flex; align-items: center; gap: .7rem; padding: .5rem .55rem; border-radius: var(--radius); font-size: .86rem; color: var(--text-muted); font-weight: 550; }
.installer-step .step-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border-strong); font-size: .75rem; font-weight: 700; background: var(--surface); flex-shrink: 0; }
.installer-step.is-done { color: var(--text-2); }
.installer-step.is-done .step-num { background: var(--up); border-color: var(--up); color: #fff; }
.installer-step.is-current { background: var(--primary-soft); color: var(--primary-soft-text); }
.installer-step.is-current .step-num { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--ring); }
.installer-body { padding: 2rem 2.25rem; min-width: 0; }
.installer-body h1 { font-size: 1.45rem; }
.installer-art { width: 210px; margin: 0 auto 1rem; }

.req-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.req-item { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); font-size: .88rem; }
.req-item:last-child { border-bottom: 0; }
.req-item .req-value { margin-left: auto; color: var(--text-muted); font-size: .8rem; text-align: right; }
.req-item .req-hint { display: block; font-size: .76rem; color: var(--text-muted); margin-top: .1rem; }
.req-ok { color: var(--up); } .req-fail { color: var(--down); } .req-warn { color: var(--degraded); }

.engine-wait { display: flex; align-items: center; gap: .75rem; padding: 1rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); font-size: .9rem; }

/* Fehlerseiten */
.error-page { text-align: center; max-width: 520px; }
.error-code { font-size: 5.5rem; font-weight: 850; letter-spacing: -.05em; line-height: 1; background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: .5rem; }
.error-art { width: 260px; max-width: 80%; margin: 0 auto 1rem; }
.error-trace { text-align: left; font-size: .75rem; max-height: 360px; overflow: auto; margin-top: 1.5rem; }

/* ==========================================================================
   Responsiv
   ========================================================================== */
.layout-main-side { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 1100px) {
    .layout-main-side, #dash-grid { grid-template-columns: 1fr !important; }
    .monitor-row { grid-template-columns: auto minmax(0, 1fr) 100px auto; }
    .monitor-row .col-bars, .monitor-row .col-response { display: none; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .app.nav-open .sidebar { transform: none; }
    .app.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: var(--overlay); }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .topbar { padding: 0 1rem; }
    .content { padding: 1.5rem 1rem 2.5rem; }
    .auth-split { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .installer-card { grid-template-columns: 1fr; }
    .installer-steps { border-right: 0; border-bottom: 1px solid var(--border); padding: 1rem; }
    .installer-steps ol { display: flex; overflow-x: auto; gap: .5rem; }
    .installer-step span:not(.step-num) { display: none; }
    .installer-step.is-current span:not(.step-num) { display: inline; }
    .installer-body { padding: 1.5rem 1.25rem; }
    .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    body { font-size: 14.5px; }
    .form-row, .form-row-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
    .hide-mobile { display: none !important; }
    .show-mobile { display: initial; }
    .page-title { font-size: 1.35rem; }
    .search-trigger { width: auto; }
    .search-trigger span, .search-trigger kbd { display: none; }
    .guest-header { padding: 1rem; }
    .guest-card .card-body { padding: 1.5rem; }
    .monitor-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; padding: .85rem 1rem; }
    .monitor-row .col-uptime { display: none; }
    .dl { grid-template-columns: 1fr; gap: .15rem; }
    .dl dd { margin-bottom: .6rem; }
    .error-code { font-size: 4rem; }
}

@media print {
    .sidebar, .topbar, .app-footer, .toasts, .btn { display: none !important; }
    .main { margin: 0; }
    body { background: #fff; }
}
