:root {
    --blau: #1a4f8a;
    --blau-hell: #2563ab;
    --gruen: #16a34a;
    --orange: #ea580c;
    --rot: #dc2626;
    --grau: #6b7280;
    --grau-hell: #f3f4f6;
    --rand: #e5e7eb;
    --text: #111827;
    --weiss: #ffffff;
    --schatten: 0 1px 3px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: #f0f2f5;
}

/* ─── Navigation ─── */
nav {
    background: var(--blau);
    color: var(--weiss);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    height: 52px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .logo {
    font-size: 16px;
    font-weight: bold;
    margin-right: 2rem;
    white-space: nowrap;
}

nav .logo span { color: #93c5fd; }

nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0 0.75rem;
    height: 52px;
    display: flex;
    align-items: center;
    font-size: 13px;
    border-bottom: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

nav a:hover, nav a.aktiv {
    color: var(--weiss);
    border-bottom-color: #93c5fd;
}

/* ─── Layout ─── */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem;
}

.seiten-titel {
    font-size: 20px;
    font-weight: bold;
    color: var(--blau);
    margin-bottom: 1.25rem;
}

/* ─── Cards ─── */
.card {
    background: var(--weiss);
    border-radius: 6px;
    box-shadow: var(--schatten);
    margin-bottom: 1rem;
}

.card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--rand);
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.card-body { padding: 1rem; }

/* ─── Tabellen ─── */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    background: var(--grau-hell);
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--rand);
    font-weight: bold;
    white-space: nowrap;
}

td {
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid var(--rand);
    vertical-align: middle;
}

tr:hover td { background: #f9fafb; }

tr:last-child td { border-bottom: none; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.85rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.15s;
}

.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--blau); color: var(--weiss); }
.btn-success { background: var(--gruen); color: var(--weiss); }
.btn-danger  { background: var(--rot); color: var(--weiss); }
.btn-warning { background: var(--orange); color: var(--weiss); }
.btn-secondary { background: var(--grau); color: var(--weiss); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--rand);
    color: var(--text);
}

.btn-sm { padding: 0.25rem 0.55rem; font-size: 12px; }

/* ─── Formulare ─── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.25rem; }

label { font-size: 12px; font-weight: bold; color: var(--grau); }

input, select, textarea {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--rand);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blau-hell);
    box-shadow: 0 0 0 2px rgba(37, 99, 171, 0.15);
}

/* ─── Badges / Status ─── */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
}

.badge-gruen  { background: #dcfce7; color: #15803d; }
.badge-gelb   { background: #fef9c3; color: #a16207; }
.badge-rot    { background: #fee2e2; color: #b91c1c; }
.badge-grau   { background: #f3f4f6; color: #374151; }
.badge-blau   { background: #dbeafe; color: #1d4ed8; }

/* ─── Lager-Ampel ─── */
.ampel-ok     { color: var(--gruen); font-weight: bold; }
.ampel-warn   { color: var(--orange); font-weight: bold; }
.ampel-fehlt  { color: var(--rot); font-weight: bold; }
.ampel-unb    { color: var(--grau); }

/* ─── Modal ─── */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 200;
}

.modal {
    background: var(--weiss);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    width: min(600px, 95vw);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--rand);
    font-weight: bold;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body { padding: 1.25rem; }
.modal-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--rand);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ─── Tabs ─── */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--rand);
    margin-bottom: 1rem;
    gap: 0.25rem;
}

.tab {
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--grau);
}

.tab.aktiv {
    color: var(--blau);
    border-bottom-color: var(--blau);
    font-weight: bold;
}

/* ─── Meldungen ─── */
.alert {
    padding: 0.6rem 1rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    font-size: 13px;
}

.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.alert-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.alert-warn    { background: #fef9c3; color: #a16207; border: 1px solid #fde047; }

/* ─── Utilities ─── */
.flex { display: flex; align-items: center; }
.gap-sm { gap: 0.4rem; }
.gap-md { gap: 0.75rem; }
.mt-sm  { margin-top: 0.5rem; }
.mt-md  { margin-top: 1rem; }
.text-grau { color: var(--grau); }
.text-sm { font-size: 12px; }
.bold { font-weight: bold; }
.text-right { text-align: right; }

[x-cloak] { display: none !important; }
