:root {
    --tb-bg: #faf7f4;
    --tb-ink: #2a2320;
    --tb-accent: #c2185b; /* vorläufig – durch echte Tanzbuudä-Markenfarbe ersetzen */
    --tb-muted: #8a807a;
    --tb-line: #e7ddd5;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--tb-ink);
    background: var(--tb-bg);
}

.page { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; gap: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--tb-line);
}

.topbar .brand { font-weight: 700; font-size: 1.25rem; color: var(--tb-accent); text-decoration: none; }
.topbar nav { display: flex; gap: 1rem; }
.topbar nav a { color: var(--tb-ink); text-decoration: none; padding: 0.25rem 0.5rem; border-radius: 6px; }
.topbar nav a:hover { background: var(--tb-bg); }

main { padding: 1.5rem; flex: 1; }

h1 { font-size: 1.5rem; margin-top: 0; }
.muted { color: var(--tb-muted); font-weight: 400; }

.cards { display: flex; flex-wrap: wrap; gap: 1rem; }
.card {
    background: #fff; border: 1px solid var(--tb-line); border-radius: 12px;
    padding: 1rem 1.5rem; min-width: 140px;
}
.card .num { font-size: 2rem; font-weight: 700; color: var(--tb-accent); }

.grid { border-collapse: collapse; width: 100%; background: #fff; border-radius: 12px; overflow: hidden; }
.grid th, .grid td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--tb-line); }
.grid th { background: #fff; color: var(--tb-muted); font-weight: 600; }
.grid tr:hover td { background: var(--tb-bg); }

/* --- Blazor Standard --- */
h1:focus { outline: none; }
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

.blazor-error-boundary {
    background: #b32121; padding: 1rem; color: white;
}
.blazor-error-boundary::after { content: "Ein Fehler ist aufgetreten."; }

/* --- Topbar: Benutzer / Logout --- */
.topbar .user { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; color: var(--tb-muted); }
.linkbtn { background: none; border: none; color: var(--tb-accent); cursor: pointer; font: inherit; padding: 0; }
.linkbtn:hover { text-decoration: underline; }

/* --- Login --- */
.login-box {
    max-width: 360px; margin: 4rem auto; background: #fff;
    border: 1px solid var(--tb-line); border-radius: 12px; padding: 2rem;
}
.login-box h1 { margin-top: 0; }
.login-box label { display: block; margin-bottom: 1rem; color: var(--tb-muted); font-size: 0.9rem; }
.login-box input {
    display: block; width: 100%; margin-top: 0.25rem; padding: 0.5rem 0.6rem;
    border: 1px solid var(--tb-line); border-radius: 6px; font-size: 1rem; color: var(--tb-ink);
}
.login-box button {
    width: 100%; padding: 0.6rem; background: var(--tb-accent); color: #fff;
    border: none; border-radius: 8px; font-size: 1rem; cursor: pointer;
}
.login-box button:hover { filter: brightness(0.95); }
.login-box .error { color: #e50000; margin-bottom: 1rem; }
.validation-message { color: #e50000; font-size: 0.85rem; }

/* --- Formulare (Mitglied-Detail) --- */
fieldset { border: 1px solid var(--tb-line); border-radius: 10px; margin: 0 0 1rem; padding: 1rem 1.25rem; background: #fff; max-width: 640px; }
legend { color: var(--tb-accent); font-weight: 600; padding: 0 0.4rem; }
fieldset label { display: block; margin-bottom: 0.6rem; color: var(--tb-muted); font-size: 0.9rem; }
fieldset label.check { display: flex; align-items: center; gap: 0.4rem; }
fieldset input, fieldset select {
    display: block; margin-top: 0.2rem; padding: 0.4rem 0.5rem;
    border: 1px solid var(--tb-line); border-radius: 6px; min-width: 280px; color: var(--tb-ink); font-size: 0.95rem;
}
fieldset label.check input { display: inline; min-width: auto; margin: 0; }
.hint { color: var(--tb-muted); font-size: 0.85rem; margin: 0.2rem 0 0.8rem; }
.ok { color: #26a050; margin-left: 0.6rem; }
form button[type=submit] {
    padding: 0.55rem 1.2rem; background: var(--tb-accent); color: #fff;
    border: none; border-radius: 8px; cursor: pointer; font-size: 1rem;
}
form button[type=submit]:hover { filter: brightness(0.95); }

/* --- Buttons / Beleg-Vorschau --- */
.btn { display: inline-block; padding: 0.5rem 1rem; background: var(--tb-accent); color: #fff; border-radius: 8px; text-decoration: none; }
.btn:hover { filter: brightness(0.95); }

.beleg { background: #fff; border: 1px solid var(--tb-line); border-radius: 12px; padding: 1.5rem 2rem; max-width: 680px; }
.beleg-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--tb-accent); padding-bottom: 0.75rem; margin-bottom: 1rem; }
.beleg-title { font-size: 1.5rem; font-weight: 700; color: var(--tb-accent); }
.beleg-sum { margin-top: 1rem; text-align: right; }
.beleg-sum > div { margin: 0.15rem 0; }
.beleg-total { font-size: 1.2rem; font-weight: 700; border-top: 1px solid var(--tb-line); padding-top: 0.4rem; margin-top: 0.4rem; }

/* --- Kurs-Slots im Mitglied-Detail --- */
.kursslot { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.kursslot-nr { color: var(--tb-muted); width: 3.5rem; font-size: 0.9rem; }
.kursslot select { min-width: 280px; margin: 0; }
.kursslot-anzahl { min-width: 7rem !important; }

/* Inaktive Mitglieder in der Liste ausgrauen */
.grid tr.inaktiv td { color: var(--tb-muted); }
.grid tr.inaktiv a { color: var(--tb-muted); }

/* --- Kundenstamm: Toolbar / Filter / Sortierung --- */
.toolbar { display: flex; align-items: flex-end; gap: 1rem; margin: 0 0 1rem; flex-wrap: wrap; }
.toolbar .filter { display: flex; flex-direction: column; gap: 0.2rem; color: var(--tb-muted); font-size: 0.9rem; }
.toolbar .filter select { padding: 0.4rem 0.5rem; border: 1px solid var(--tb-line); border-radius: 6px; color: var(--tb-ink); font-size: 0.95rem; background: #fff; }
.grid th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.grid th.sortable:hover { color: var(--tb-accent); }
.grid td.aktion { text-align: center; width: 1%; }
.grid td span[title] { cursor: help; }

/* --- Benutzer/Settings/Konto --- */
.card-link { text-decoration: none; color: var(--tb-ink); align-items: flex-start; }
.card-link:hover { border-color: var(--tb-accent); }
.user-name { color: var(--tb-ink); text-decoration: none; }
.user-name:hover { text-decoration: underline; }
.noaccess { padding: 1rem 0; }
button.danger { background: #b32121; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.btn-back { display: inline-block; padding: 0.35rem 0.8rem; background: #fff; border: 1px solid var(--tb-line); border-radius: 8px; color: var(--tb-ink); text-decoration: none; font-size: 0.9rem; }
.btn-back:hover { border-color: var(--tb-accent); }
.icon-link { text-decoration: none; font-size: 1.05rem; }
