:root {
    --bg:      #0f1117;
    --surface: #1a1d27;
    --card:    #22263a;
    --border:  #2e3350;
    --accent:  #6366f1;
    --accent2: #818cf8;
    --text:    #e2e8f0;
    --muted:   #94a3b8;
    --green:   #22c55e;
    --red:     #ef4444;
    --orange:  #f59e0b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Layout ─────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.sidebar-logo h1 {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent2);
}

.sidebar-logo p {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}

.nav-item:hover, .nav-item.aktiv {
    color: var(--text);
    background: rgba(99,102,241,0.1);
    border-left-color: var(--accent);
}

.nav-item .icon { font-size: 16px; width: 20px; }

.main {
    margin-left: 240px;
    flex: 1;
    padding: 24px;
    max-width: 100%;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

/* ── Kennzahlen ──────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent);
}

.stat-card.green::before { background: var(--green); }
.stat-card.red::before   { background: var(--red); }
.stat-card.orange::before{ background: var(--orange); }

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}

/* ── Tabellen ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    text-align: left;
    padding: 10px 12px;
    color: var(--muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge.green  { background: rgba(34,197,94,0.15);  color: var(--green); }
.badge.red    { background: rgba(239,68,68,0.15);   color: var(--red); }
.badge.orange { background: rgba(245,158,11,0.15);  color: var(--orange); }
.badge.blue   { background: rgba(99,102,241,0.15);  color: var(--accent2); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent2); }
.btn-danger  { background: rgba(239,68,68,0.15); color: var(--red); }
.btn-danger:hover  { background: rgba(239,68,68,0.3); }
.btn-ghost   { background: rgba(255,255,255,0.05); color: var(--muted); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: var(--text); }

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.page-header p {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

/* ── Login ───────────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.login-box p {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 28px;
}

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

.form-group input:focus { border-color: var(--accent); }

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-error { background: rgba(239,68,68,0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }

/* ── Mobil ───────────────────────────────────────────────── */
.mobil-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 8px 0;
    z-index: 200;
}

.mobil-nav-inner {
    display: flex;
    justify-content: space-around;
}

.mobil-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--muted);
    text-decoration: none;
    font-size: 10px;
    padding: 4px 12px;
}

.mobil-nav-item.aktiv { color: var(--accent2); }
.mobil-nav-item .icon { font-size: 20px; }

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main { margin-left: 0; padding: 16px; padding-bottom: 80px; }
    .mobil-nav { display: block; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}