/*
 * Vorlaeufige Gestaltung der Vereinsverwaltung.
 *
 * Bewusst schlank und ohne Abhaengigkeit: das eigentliche Design-System
 * kommt in der naechsten Phase. Das Markup ist semantisch, hier werden
 * dann nur die Stile getauscht.
 */

:root {
    --paper: #f7f6f3;
    --surface: #ffffff;
    --surface-2: #efeee9;
    --ink: #16202e;
    --ink-2: #414d5c;
    --muted: #6b7684;
    --line: #dedcd5;
    --accent: #1b4d8f;
    --accent-ink: #ffffff;
    --ok: #2c6e49;
    --ok-bg: #e3f0e8;
    --warn: #855e10;
    --warn-bg: #f6eeda;
    --danger: #a3342a;
    --danger-bg: #f8e9e6;
    --radius: 6px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #11151b;
        --surface: #171c24;
        --surface-2: #1f252f;
        --ink: #e7eaee;
        --ink-2: #b4bdc8;
        --muted: #8593a2;
        --line: #29313c;
        --accent: #82b1eb;
        --accent-ink: #0d1620;
        --ok: #74c293;
        --ok-bg: #16271d;
        --warn: #d9ac48;
        --warn-bg: #2a2317;
        --danger: #e98c7f;
        --danger-bg: #2d1e1b;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.centered {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

a { color: var(--accent); }

code {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.875em;
    background: var(--surface-2);
    padding: 0.1em 0.35em;
    border-radius: 3px;
}

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ── Kopfzeile ─────────────────────────────────────────────── */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.topbar__brand {
    font-weight: 650;
    text-decoration: none;
    color: var(--ink);
}

.topbar__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar__user { color: var(--muted); font-size: 0.875rem; }
.topbar form { margin: 0; }

/* ── Grundgeruest ──────────────────────────────────────────── */

.shell {
    max-width: 62rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 4rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem;
    width: 100%;
    max-width: 24rem;
}

.card h1 { font-size: 1.25rem; margin: 0 0 1.25rem; }

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.page-head h1 { font-size: 1.5rem; margin: 0; }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.panel h2 { font-size: 1rem; margin: 0 0 1rem; }

.panel__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.panel__actions form { margin: 0; }

/* ── Formulare ─────────────────────────────────────────────── */

.form { margin: 0; }

.field { margin-bottom: 1.125rem; }

.field label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
}

.field input[type="text"],
.field input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.7rem;
    font: inherit;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.field input[type="color"] {
    width: 4rem;
    height: 2.4rem;
    padding: 0.2rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.field input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.hint, .empty__hint {
    font-size: 0.8125rem;
    color: var(--muted);
    margin: 0.35rem 0 0;
}

.static-value { margin: 0; color: var(--muted); font-size: 0.875rem; }

.form__actions { margin-top: 1.25rem; }

/* ── Schaltflaechen ────────────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 0.55rem 1rem;
    font: inherit;
    font-size: 0.9375rem;
    line-height: 1.2;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    /* Touch-Ziel */
    min-height: 44px;
}

.btn:hover { border-color: var(--muted); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
}

.btn--ghost { background: transparent; }

.btn--block { width: 100%; }

.btn--small {
    min-height: 0;
    padding: 0.3rem 0.6rem;
    font-size: 0.8125rem;
}

/* ── Tabellen ──────────────────────────────────────────────── */

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

table {
    width: 100%;
    min-width: 40rem;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

th, td {
    text-align: left;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    background: var(--surface-2);
    white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }
tr.is-inactive { opacity: 0.55; }

td .muted { display: block; font-size: 0.8125rem; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.actions form { margin: 0; }

/* ── Marken und Meldungen ──────────────────────────────────── */

.chip {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.chip--ok { background: var(--ok-bg); color: var(--ok); }
.chip--warn { background: var(--warn-bg); color: var(--warn); }
.chip--off { background: var(--surface-2); color: var(--muted); }

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border-left: 3px solid;
    font-size: 0.9375rem;
}

.alert--success { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.alert--error { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.alert--warning { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.alert--info { background: var(--surface-2); border-color: var(--muted); color: var(--ink-2); }

/* ── Sonstiges ─────────────────────────────────────────────── */

.empty {
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--muted);
}

.callout {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.callout h2 { margin: 0 0 0.5rem; font-size: 1rem; }
.callout--once { border-left-color: var(--warn); }

.credentials {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 1rem;
    margin: 1rem 0 0.75rem;
}

.credentials dt { font-size: 0.8125rem; color: var(--muted); }
.credentials dd { margin: 0; }

.password { font-size: 1.05rem; letter-spacing: 0.06em; }

.facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.45rem 1.25rem;
    margin: 0;
    font-size: 0.9375rem;
}

.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-all; }

.next-steps { margin-bottom: 1.5rem; }
.next-steps h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.next-steps ol { margin: 0; padding-left: 1.25rem; color: var(--ink-2); }

@media (max-width: 30rem) {
    .page-head { align-items: stretch; }
    .page-head .btn { width: 100%; text-align: center; }
}
