:root {
    --primary:        #0F172A;
    --secondary:      #1E293B;
    --accent:         #3B82F6;
    --accent-light:   #60A5FA;
    --success:        #10B981;
    --warning:        #F59E0B;
    --error:          #EF4444;
    --error-light:    #FEE2E2;
    --bg:             #F8FAFC;
    --card:           #FFFFFF;
    --text-primary:   #0F172A;
    --text-secondary: #64748B;
    --border:         #E2E8F0;
    --shadow:         rgba(15, 23, 42, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
}

.mono { font-family: 'JetBrains Mono', monospace; }

.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

/* ── Header ── */
header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
}
.header-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.header-brand { display: flex; align-items: center; gap: 0.75rem; }
.header-brand h1 { font-size: 1.15rem; font-weight: 700; }
.header-brand .untertitel { font-size: 0.8rem; color: var(--text-secondary); }
.header-user { display: flex; align-items: center; gap: 1rem; font-size: 0.875rem; color: var(--text-secondary); }

.btn {
    padding: 0.6rem 1.25rem; border: none; border-radius: 8px;
    font-family: 'DM Sans', sans-serif; font-size: 0.875rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 0.4rem;
    text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: var(--primary); }
.btn-outline { background: var(--card); color: var(--text-primary); border: 2px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Stat-Cards ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 1.1rem 1.25rem; box-shadow: 0 1px 3px var(--shadow);
}
.stat-card .wert { font-size: 1.75rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.stat-card .label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.2rem; }

/* ── Karten & Tabellen ── */
.card {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 1px 3px var(--shadow); overflow: hidden; margin-bottom: 1.5rem;
}
.card-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card-head h2 { font-size: 1rem; font-weight: 700; }
.card-body { padding: 1.25rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th {
    text-align: left; padding: 0.75rem 1rem; background: var(--bg);
    color: var(--text-secondary); font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 0.04em; position: sticky; top: 0;
}
tbody td { padding: 0.8rem 1rem; border-top: 1px solid var(--border); }
tbody tr.klickbar { cursor: pointer; transition: background 0.15s; }
tbody tr.klickbar:hover { background: var(--bg); }
.leer { padding: 2rem; text-align: center; color: var(--text-secondary); }

/* ── Status-Badges ── */
.badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.25rem 0.7rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
}
.badge-zur_freigabe { background: #FEF3C7; color: #92400E; }
.badge-freigegeben  { background: #D1FAE5; color: #065F46; }
.badge-abgelehnt    { background: var(--error-light); color: #991B1B; }
.badge-entwurf      { background: #E2E8F0; color: #475569; }
.badge-keine        { background: var(--bg); color: var(--text-secondary); border: 1px dashed var(--border); }

.badge-bestell-eingegangen    { background: #FEF3C7; color: #92400E; }
.badge-bestell-in_bearbeitung { background: #DBEAFE; color: #1E40AF; }
.badge-bestell-erledigt       { background: #D1FAE5; color: #065F46; }
.badge-bestell-storniert      { background: var(--error-light); color: #991B1B; }

/* ── Formulare ── */
label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.3rem; }
input, select, textarea {
    width: 100%; padding: 0.65rem 0.85rem; border: 2px solid var(--border); border-radius: 8px;
    font-family: 'DM Sans', sans-serif; font-size: 0.9rem; background: var(--card); color: var(--text-primary);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.form-zeile { margin-bottom: 1rem; }

/* ── Modal ── */
.modal {
    display: none; position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(4px);
    z-index: 2000; justify-content: center; align-items: center;
}
.modal-box {
    background: var(--card); border-radius: 16px; padding: 2rem;
    width: 100%; max-width: 440px; margin: 1rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.25s ease-out; text-align: center;
}
.modal-box .icon { font-size: 2.5rem; margin-bottom: 1rem; }
.modal-box h3 { font-size: 1.2rem; font-weight: 700; color: var(--primary); margin-bottom: 0.5rem; }
.modal-box p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1.25rem; }
.modal-buttons { display: flex; gap: 0.75rem; justify-content: center; margin-top: 1.5rem; }

/* ── Notification ── */
#notification {
    position: fixed; top: 1.25rem; right: 1.25rem; z-index: 3000;
    padding: 0.85rem 1.25rem; border-radius: 10px; color: white;
    font-size: 0.9rem; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    display: none; animation: slideDown 0.25s ease-out; max-width: 360px;
}
#notification.success { background: var(--success); }
#notification.error { background: var(--error); }
#notification.info { background: var(--accent); }

/* ── Login ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 16px;
    padding: 2.5rem; width: 100%; max-width: 400px; box-shadow: 0 8px 30px var(--shadow);
    animation: fadeIn 0.3s ease-out;
}
.login-card h1 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.login-card .untertitel { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1.75rem; }

@keyframes slideDown { from { opacity:0; transform:translateY(-20px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideUp   { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes spin      { to { transform: rotate(360deg); } }
@keyframes fadeIn    { from { opacity:0; } to { opacity:1; } }
