/* =========================================================
   DAMOS – zentrales Design
   Grundregeln mit :where() = niedrige Priorität, damit
   seiteneigene Styles immer gewinnen.
   ========================================================= */
:root {
    --blau: #214f9e;
    --blau-dunkel: #16366e;
    --blau-hell: #e9f0fb;
    --text: #1d2433;
    --grau: #6b7280;
    --linie: #e3e7ee;
    --hinter: #f4f6fa;
    --weiss: #ffffff;
    --gruen: #1f9d55;
    --rot: #c0392b;
    --orange: #e67e22;
    --radius: 12px;
    --schatten: 0 1px 3px rgba(16, 30, 60, .08), 0 4px 14px rgba(16, 30, 60, .06);
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

:where(body) {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.45;
    color: var(--text);
    background: var(--hinter);
}

:where(h1, h2, h3, h4) { color: var(--text); line-height: 1.25; }
:where(h2) { font-size: 1.45rem; margin: 22px 0 14px; }
:where(h3) { font-size: 1.1rem; }
:where(a) { color: var(--blau); }

:where(button, input, select, textarea) {
    font-family: inherit;
    font-size: 1rem;
}
:where(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), select, textarea) {
    padding: 9px 12px;
    border: 1px solid #cfd6e2;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    max-width: 100%;
}
:where(input, select, textarea):focus {
    outline: none;
    border-color: var(--blau);
    box-shadow: 0 0 0 3px rgba(33, 79, 158, .15);
}
/* Neutrale Grundform – Seiten, die nur eine Hintergrundfarbe setzen, behalten dunkle Schrift */
:where(button) {
    padding: 9px 16px;
    border: 1px solid #d5dbe5;
    border-radius: 8px;
    background: #eef1f6;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
}
:where(button):hover { background: #e2e7ef; }
:where(button[type=submit]) { background: var(--blau); border-color: var(--blau); color: #fff; }
:where(button[type=submit]):hover { background: var(--blau-dunkel); }

:where(table) { border-collapse: collapse; width: 100%; background: #fff; }
:where(th, td) { padding: 8px 10px; border-bottom: 1px solid var(--linie); text-align: left; }
:where(th) { background: #eef2f8; font-weight: 600; font-size: .88rem; }

/* ---------- Hilfsklassen für neue Seiten ---------- */
.seite { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.seite.schmal { max-width: 720px; }
.seite-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 18px; }
.seite-kopf h2 { margin: 0; }
.untertitel { color: var(--grau); margin: 4px 0 0; font-size: .92rem; }

.karte {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--schatten);
    padding: 18px;
    margin-bottom: 16px;
}
.karte h3 { margin: 0 0 12px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border: none; border-radius: 8px;
    background: var(--blau); color: #fff; font-weight: 600; font-size: .95rem;
    text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover { background: var(--blau-dunkel); color: #fff; }
.btn.hell { background: var(--blau-hell); color: var(--blau); }
.btn.hell:hover { background: #d8e4f7; }
.btn.grau { background: #eceff4; color: var(--text); }
.btn.grau:hover { background: #dde2ea; }
.btn.gruen { background: var(--gruen); }
.btn.rot { background: var(--rot); }
.btn.orange { background: var(--orange); }
.btn.klein { padding: 5px 10px; font-size: .82rem; }
.btn.gross { padding: 14px 22px; font-size: 1.05rem; }
.btn.voll { width: 100%; }

.meldung { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: .95rem; }
.meldung.ok { background: #e7f6ee; color: #145c34; }
.meldung.fehler { background: #fdecea; color: #8e2318; }
.meldung.info { background: var(--blau-hell); color: var(--blau-dunkel); }
.meldung.warn { background: #fff4e5; color: #8a4b08; }

.feld { margin-bottom: 14px; }
.feld label, .feld .label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; color: #374151; }
.feld input:not([type=checkbox]):not([type=radio]), .feld select, .feld textarea { width: 100%; }
.feld .hinweis { font-size: .8rem; color: var(--grau); margin-top: 4px; }
.zwei-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 600px) { .zwei-spalten { grid-template-columns: 1fr; } }

.check { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; font-weight: 400 !important; }
.check input { width: 18px; height: 18px; accent-color: var(--blau); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .74rem; font-weight: 600; background: #eceff4; color: #374151; vertical-align: middle; }
.badge.blau { background: var(--blau-hell); color: var(--blau); }
.badge.gruen { background: #e7f6ee; color: #145c34; }
.badge.rot { background: #fdecea; color: #8e2318; }
.badge.orange { background: #fff4e5; color: #8a4b08; }
.badge.dunkel { background: #1d2433; color: #fff; }

.tabelle-rahmen { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--schatten); }
.tabelle-rahmen table { min-width: 600px; }
.leer { text-align: center; color: var(--grau); padding: 30px 10px; }

.ico { flex-shrink: 0; vertical-align: -3px; }
.btn .ico { vertical-align: middle; }

.avatar { border-radius: 50%; object-fit: cover; display: inline-flex; flex-shrink: 0; }
.avatar-initialen { align-items: center; justify-content: center; background: var(--blau); color: #fff; font-weight: 700; letter-spacing: .5px; }

/* ---------- Modal ---------- */
.modal-hg { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 200; align-items: center; justify-content: center; padding: 16px; }
.modal-hg.offen { display: flex; }
.modal-box { background: #fff; border-radius: 14px; padding: 22px; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; }
.modal-box h3 { margin-top: 0; }
