/* KARRERlabs Backup-Portal — Design-System
   Angelehnt an karrerlabs.de: warmes Cremeweiß, Orange-Akzent, technische Monospace-Akzente.
   Keine externen Ressourcen (strenge CSP). System-Font-Stack. */

:root {
    --bg:           #F4F3EF;
    --surface:      #FFFFFF;
    --surface-dark: #1E2B27;
    --text:         #1B2A26;
    --text-muted:   #5B5B57;
    --text-on-dark: #C8D5D1;
    --accent:       #E07E1B;
    --accent-hover: #C96E14;
    --ok:           #3FA34D;
    --warn:         #E0A21B;
    --fail:         #C0392B;
    --border:       #E2E0DA;
    --border-dark:  #2E3F3B;
    --radius:       14px;
    --radius-sm:    8px;
    --font-sans:    system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono:    ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.logo {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}
.logo span { color: var(--accent); }

.topbar-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--ok);
}

.topbar-meta a {
    color: var(--text-muted);
    text-decoration: none;
}
.topbar-meta a:hover { color: var(--accent); }

/* ── Layout ─────────────────────────────────────────────── */
.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.page-narrow {
    max-width: 480px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

/* ── Eyebrow / Überzeile ─────────────────────────────────── */
.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
    letter-spacing: 0.01em;
}

/* ── Überschriften ──────────────────────────────────────── */
h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 0.5rem;
    color: var(--text);
}
h1 .accent { color: var(--accent); }

h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--text);
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--text);
}

/* ── Karten ─────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

/* Dunkle Terminal-Karte (wie auf karrerlabs.de unten rechts) */
.card-dark {
    background: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-on-dark);
}

.card-dark .term-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-dark);
}
.card-dark .term-row:last-child { border-bottom: none; }

.card-dark .term-label { color: #7A9A94; }
.card-dark .term-value { color: #E0F0EC; }
.card-dark .term-ok    { color: var(--ok); }
.card-dark .term-warn  { color: var(--warn); }
.card-dark .term-fail  { color: var(--fail); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

/* ── Grid ───────────────────────────────────────────────── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* ── Formulare ──────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.1rem;
}

label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: border-color 0.15s;
    outline: none;
}
input:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(224,126,27,0.12);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg); }

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
}

.btn-full { width: 100%; justify-content: center; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}
.alert-error {
    background: #FDF2F2;
    color: #8B2020;
    border-color: #F5C5C5;
}
.alert-success {
    background: #F0FDF4;
    color: #1A5C2A;
    border-color: #BBDFC7;
}
.alert-info {
    background: #FFF8F0;
    color: #7A4010;
    border-color: #F5D8B0;
}

/* ── Tabellen ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
th {
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--border);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAF9F5; }

/* ── Status-Badges ──────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-mono);
}
.badge-ok   { background: #DDFBE6; color: #1A5C2A; }
.badge-warn { background: #FFF4CC; color: #7A5C00; }
.badge-fail { background: #FDE8E8; color: #8B2020; }
.badge-none { background: var(--bg); color: var(--text-muted); }

/* ── Navigation / Tabs ──────────────────────────────────── */
.nav {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}
.nav a {
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.nav a:hover { color: var(--text); }
.nav a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

/* ── Monospace-Daten ─────────────────────────────────────── */
.mono { font-family: var(--font-mono); font-size: 0.88rem; }

/* ── Login-Seite ─────────────────────────────────────────── */
.login-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 2rem 1rem;
}
.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 2rem 2rem;
}
.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}
.login-logo .wordmark {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text);
    letter-spacing: -0.02em;
}
.login-logo .wordmark span { color: var(--accent); }
.login-logo .sub {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

/* ── Hilfklassen ─────────────────────────────────────────── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); font-size: 0.88rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
