:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --text: #18202a;
    --muted: #657386;
    --line: #dbe2ea;
    --primary: #0f6b67;
    --primary-dark: #0a504d;
    --danger: #b42318;
    --warning: #b7791f;
    --info: #2251a4;
    --success: #247a3d;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Arial, Helvetica, sans-serif; line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { align-items: center; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; gap: 24px; padding: 14px 28px; position: sticky; top: 0; z-index: 10; }
.brand { color: var(--text); font-weight: 700; min-width: 110px; }
.nav { display: flex; flex: 1; flex-wrap: wrap; gap: 14px; }
.nav a { color: var(--muted); font-size: 14px; font-weight: 600; }
.user-chip { background: #eef3f3; border: 1px solid var(--line); border-radius: 999px; color: var(--primary-dark); font-size: 13px; padding: 6px 12px; }
.page { margin: 0 auto; max-width: 1180px; padding: 28px; }
.login-shell { display: grid; min-height: 100vh; place-items: center; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; max-width: 430px; padding: 32px; width: 100%; }
.page-heading, .panel-header { align-items: center; display: flex; gap: 16px; justify-content: space-between; margin-bottom: 20px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 30px; line-height: 1.2; margin-bottom: 0; }
h2 { font-size: 20px; margin-bottom: 0; }
h3 { font-size: 16px; margin: 22px 0 8px; }
.eyebrow { color: var(--primary); font-size: 12px; font-weight: 700; letter-spacing: 0; margin-bottom: 5px; text-transform: uppercase; }
.muted, small { color: var(--muted); }
small { display: block; font-size: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 22px; padding: 22px; }
.stats-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--info); border-radius: 8px; padding: 18px; }
.stat span, .stat small { color: var(--muted); }
.stat strong { display: block; font-size: 34px; line-height: 1.1; margin: 8px 0; }
.stat-warning { border-left-color: var(--warning); }
.stat-danger { border-left-color: var(--danger); }
.stat-info { border-left-color: var(--info); }
.form, .filters, .form-grid { display: grid; gap: 16px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filters { align-items: end; grid-template-columns: repeat(6, minmax(130px, 1fr)); margin-bottom: 20px; }
label { color: var(--muted); display: grid; font-size: 13px; font-weight: 700; gap: 6px; }
input, select, textarea { background: #fff; border: 1px solid #cbd5df; border-radius: 6px; color: var(--text); font: inherit; min-height: 42px; padding: 9px 11px; width: 100%; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: 3px solid rgba(15, 107, 103, 0.12); }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; }
.button { align-items: center; background: #eef2f6; border: 1px solid #cbd5df; border-radius: 6px; color: var(--text); cursor: pointer; display: inline-flex; font-size: 14px; font-weight: 700; justify-content: center; min-height: 40px; padding: 9px 14px; text-decoration: none; white-space: nowrap; }
.button:hover { background: #e4eaf0; text-decoration: none; }
.button-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.button-primary:hover { background: var(--primary-dark); }
.button-small { font-size: 13px; min-height: 34px; padding: 6px 10px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; min-width: 860px; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 13px 12px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
tbody tr:hover { background: #f8fafc; }
.row-soon { background: #fff8eb; }
.row-expired { background: #fff1f0; }
.badge { border-radius: 999px; display: inline-flex; font-size: 12px; font-weight: 700; padding: 4px 9px; }
.badge-neu { background: #e9f1ff; color: var(--info); }
.badge-in_pruefung { background: #fff6df; color: var(--warning); }
.badge-freigegeben, .badge-aktiv { background: #e8f6ed; color: var(--success); }
.badge-abgelehnt, .badge-abgelaufen { background: #fdecec; color: var(--danger); }
.badge-ersetzt { background: #eef2f6; color: var(--muted); }
.alert { border-radius: 8px; margin-bottom: 18px; padding: 12px 14px; }
.alert-success { background: #e8f6ed; border: 1px solid #b8dfc5; color: var(--success); }
.alert-danger { background: #fdecec; border: 1px solid #f4b8b4; color: var(--danger); }
.empty { color: var(--muted); margin-bottom: 0; }
.detail-grid { display: grid; gap: 22px; grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr); }
.meta-list { display: grid; gap: 12px; grid-template-columns: 150px minmax(0, 1fr); margin: 0; }
.meta-list dt { color: var(--muted); font-weight: 700; }
.meta-list dd { margin: 0; overflow-wrap: anywhere; }
.note-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 0; padding: 12px; }
@media (max-width: 980px) {
    .topbar, .page-heading, .panel-header { align-items: flex-start; flex-direction: column; }
    .stats-grid, .detail-grid, .form-grid { grid-template-columns: 1fr; }
    .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .span-2 { grid-column: span 1; }
}
@media (max-width: 640px) {
    .page { padding: 18px; }
    .topbar { padding: 14px 18px; }
    .filters { grid-template-columns: 1fr; }
    .meta-list { grid-template-columns: 1fr; }
}
