* {
    box-sizing: border-box;
}

:root {
    --bg: #f3f6f9;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #667085;
    --border: #d9e0e7;
    --primary: #1769aa;
    --primary-dark: #10558c;
    --success: #16803c;
    --danger: #b42318;
    --soft-blue: #edf5fb;
    --soft-green: #edf8f1;
    --soft-red: #fff1f0;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--bg);
    color: var(--text);
}

.seite {
    width: min(760px, calc(100% - 32px));
    margin: 0 auto;
    padding: 44px 0;
}

.kopf {
    text-align: center;
    margin-bottom: 26px;
}

.marke {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--primary);
    margin-bottom: 8px;
}

.kopf h1 {
    margin: 0;
    font-size: clamp(30px, 6vw, 42px);
    line-height: 1.15;
}

.untertitel {
    margin: 12px auto 0;
    max-width: 560px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.5;
}

.karte {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(31, 41, 55, 0.07);
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 17px;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 54px;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 20px;
    color: var(--text);
    background: white;
    outline: none;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(23, 105, 170, 0.12);
}

.code-eingabe {
    text-align: center;
    font-size: 30px;
    letter-spacing: 0.25em;
    font-weight: 700;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    margin-top: 20px;
    padding: 12px 20px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: var(--primary-dark);
}

.meldung {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--soft-red);
    border: 1px solid #f3c7c2;
    color: var(--danger);
    line-height: 1.45;
}

.info {
    margin: 20px 0 0;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--soft-blue);
    color: #31566f;
    line-height: 1.5;
}

.datenkopf {
    margin-bottom: 20px;
}

.datenkopf h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.datenkopf p {
    margin: 0;
    color: var(--muted);
}

.uebersicht {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 22px 0;
}

.wertkarte {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafbfd;
}

.wertkarte .titel {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 14px;
}

.wertkarte .wert {
    font-size: 24px;
    font-weight: 750;
}

.details {
    margin-top: 8px;
    border-top: 1px solid var(--border);
}

.zeile {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 15px 0;
    border-bottom: 1px solid #edf0f3;
}

.zeile span:first-child {
    color: var(--muted);
}

.zeile .wert {
    font-weight: 700;
    text-align: right;
}

.rest-offen {
    color: var(--danger);
}

.erfuellt {
    color: var(--success);
}

.status-ok {
    background: var(--soft-green);
}

.status-offen {
    background: var(--soft-red);
}

.aktionen {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.aktionen a {
    flex: 1;
    text-align: center;
    padding: 13px 18px;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    background: white;
}

.fuss {
    margin-top: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .seite {
        width: min(100% - 20px, 760px);
        padding: 22px 0;
    }

    .karte {
        padding: 22px 18px;
        border-radius: 14px;
    }

    .uebersicht {
        grid-template-columns: 1fr;
    }

    .zeile {
        flex-direction: column;
        gap: 4px;
    }

    .zeile .wert {
        text-align: left;
    }
}


/* OFFI-MITGLIEDERVERWALTUNG */

.seite-breit {
    width: min(1180px, calc(100% - 32px));
}

.verwaltung-kopf {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 18px;
}

.suche {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex: 1;
}

.suche input {
    max-width: 460px;
}

.button-klein {
    width: auto;
    min-height: 46px;
    margin-top: 0;
    white-space: nowrap;
}

.verwaltung-hinweis {
    color: var(--muted);
    margin: 8px 0 18px;
}

.tabellen-scroll {
    width: 100%;
    overflow-x: auto;
}

.mitglieder-tabelle {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

.mitglieder-tabelle th,
.mitglieder-tabelle td {
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.mitglieder-tabelle th {
    font-size: 14px;
    color: var(--muted);
    background: #fafbfd;
}

.inaktiv-zeile {
    opacity: 0.62;
}

.status-chip {
    display: inline-block;
    margin: 2px 4px 2px 0;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--soft-blue);
    font-size: 12px;
    font-weight: 700;
}

.status-aktiv {
    color: var(--success);
    background: var(--soft-green);
}

.status-inaktiv {
    color: var(--danger);
    background: var(--soft-red);
}

.klein {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.aktionen-zelle {
    white-space: nowrap;
}

.inline-form {
    display: inline;
}

.button-link {
    display: inline-block;
    width: auto;
    min-height: auto;
    margin: 2px 6px 2px 0;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

button.button-link {
    width: auto;
}

.button-link.gefahr {
    color: var(--danger);
}

.verwaltung-meldung {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 10px;
}

.verwaltung-meldung.ok {
    color: var(--success);
    background: var(--soft-green);
}

.verwaltung-meldung.fehler {
    color: var(--danger);
    background: var(--soft-red);
}

.formular-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.formular-grid input,
.formular-grid select {
    width: 100%;
}

select {
    width: 100%;
    min-height: 54px;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 18px;
    color: var(--text);
    background: white;
}

select:focus {
    border-color: var(--primary);
    outline: none;
}

.formular-voll {
    grid-column: 1 / -1;
}

.checkbox-bereich {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    margin-bottom: 28px;
}

.checkbox-zeile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-weight: 600;
}

.checkbox-zeile input {
    width: 22px;
    min-height: 22px;
    margin: 0;
}

.formular-aktionen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 28px;
}

.formular-aktionen .button,
.formular-aktionen button {
    margin-top: 0;
}

.button-sekundaer {
    background: white;
    color: var(--primary);
    border: 1px solid var(--border);
}

.button-sekundaer:hover {
    background: var(--soft-blue);
}

@media (max-width: 760px) {
    .verwaltung-kopf,
    .suche {
        flex-direction: column;
        align-items: stretch;
    }

    .suche input,
    .button-klein {
        width: 100%;
        max-width: none;
    }

    .formular-grid,
    .checkbox-bereich,
    .formular-aktionen {
        grid-template-columns: 1fr;
    }

    .formular-voll {
        grid-column: auto;
    }
}


/* MODUL 6 – VERWALTUNGSZUGANG */
.verwaltungszugang {
    width: min(580px, calc(100% - 32px));
    margin: 18px auto;
}

.verwaltungszugang .button {
    display: block;
    text-align: center;
}

/* DOPPELT GESICHERTER VERWALTUNGSZUGANG */

.verwaltung-timer {
    position: sticky;
    top: 0;
    z-index: 1000;
    margin: 0 auto 16px;
    padding: 12px 18px;
    width: min(1180px, calc(100% - 32px));
    box-sizing: border-box;
    text-align: center;
    border-radius: 8px;
    background: #fff3cd;
    border: 1px solid #d6b656;
}

.verwaltung-timer[hidden] {
    display: none;
}

#verwaltung-countdown {
    font-variant-numeric: tabular-nums;
    font-size: 1.15em;
}

.verwaltung-beenden {
    width: min(1180px, calc(100% - 32px));
    margin: 18px auto;
    text-align: right;
}

.verwaltung-beenden form {
    display: inline-block;
}


/* ==========================================================
   ARBEITSZEIT-EIGENMELDUNG
   ========================================================== */

textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    font: inherit;
    padding: 11px 12px;
    border: 1px solid #b8c2cc;
    border-radius: 8px;
    margin-bottom: 18px;
}

input:disabled,
textarea:disabled,
button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.sperrhinweis {
    font-weight: 700;
}

.warnkasten {
    margin: 22px 0;
    padding: 16px;
    border: 2px solid currentColor;
    border-radius: 10px;
}

.bestaetigung {
    align-items: flex-start;
    margin: 20px 0;
}

.bestaetigung input {
    margin-top: 4px;
    flex: 0 0 auto;
}

.arbeitsnachweise-karte {
    margin-top: 24px;
}

.nachweis-liste {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.nachweis {
    border: 1px solid #ccd3da;
    border-radius: 10px;
    padding: 15px;
}

.nachweis-kopf {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 7px;
}

.klein {
    margin-top: 8px;
    font-size: 0.9rem;
    opacity: 0.78;
}


/* ==========================================================
   JAHRESABRECHNUNG / RÜCKZAHLUNGSLISTE
   ========================================================== */

.abrechnungstabelle-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
}

.abrechnungstabelle {
    width: 100%;
    border-collapse: collapse;
}

.abrechnungstabelle th,
.abrechnungstabelle td {
    padding: 10px 12px;
    border-bottom: 1px solid #ccd3da;
    text-align: left;
    white-space: nowrap;
}

.abrechnungstabelle th {
    font-weight: 700;
}
