/* Yachtclub-Verwaltung — eigenstaendige Gestaltung, kein CDN, keine externen
   Schriften oder Skripte. Ruhige maritime Farbwelt: dunkles Marineblau als
   Akzent, viel Weissraum, gut lesbare Tabellen und Formulare. */

:root {
    --marine-900: #0b2440;
    --marine-800: #0f3357;
    --marine-700: #14476f;
    --marine-600: #1c5f8c;
    --marine-100: #e7eef4;
    --akzent: #147d97;
    --akzent-dunkel: #0f6579;

    --flaeche: #ffffff;
    --hintergrund: #f2f5f8;
    --rand: #dbe3ea;
    --rand-stark: #c2ceda;

    --text: #1c2b3a;
    --text-schwach: #5b6b7c;
    --text-auf-marine: #eaf1f7;

    --erfolg: #1f7a4d;
    --erfolg-bg: #e2f4ea;
    --erfolg-rand: #b8e2c8;
    --fehler: #b3261e;
    --fehler-bg: #fbe9e7;
    --fehler-rand: #f0bcb6;
    --hinweis: #8a5a00;
    --hinweis-bg: #fdf1dc;
    --hinweis-rand: #f0d69f;

    --radius: 8px;
    --schatten: 0 1px 2px rgba(11, 36, 64, 0.06), 0 1px 12px rgba(11, 36, 64, 0.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--hintergrund);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--akzent-dunkel); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.5rem; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.75rem; }
p { margin: 0.5rem 0; }
.muted { color: var(--text-schwach); }

.icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }

/* ---------- Kopfzeile ---------- */

.topbar {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    background: linear-gradient(180deg, var(--marine-800), var(--marine-900));
    color: var(--text-auf-marine);
    padding: 0.65rem 1.25rem;
    box-shadow: var(--schatten);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 650;
    font-size: 1.05rem;
    white-space: nowrap;
}
.brand:hover { text-decoration: none; opacity: 0.9; }
.brand .icon { width: 1.4em; height: 1.4em; color: #bcdcec; }

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    flex: 1;
}
.main-nav a {
    color: #cfe2ee;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    font-size: 0.93rem;
}
.main-nav a:hover { background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.main-nav a.aktiv { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 600; }

.user-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
    white-space: nowrap;
}
.user-name { font-weight: 600; }
.user-rolle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(255, 255, 255, 0.12);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    color: #cfe2ee;
}
.link-abmelden {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #cfe2ee;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
}
.link-abmelden:hover { background: rgba(255, 255, 255, 0.08); text-decoration: none; }

/* ---------- Inhalt ---------- */

.content {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem 3rem;
}

body.login-shell .content {
    max-width: 420px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

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

/* ---------- Anmelde-Karte ---------- */

.login-card {
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: 12px;
    box-shadow: var(--schatten);
    padding: 2rem 1.75rem;
    width: 100%;
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}
.login-brand .icon { width: 1.8em; height: 1.8em; color: var(--marine-700); }
.login-brand h1 { font-size: 1.25rem; }

/* ---------- Meldungen ---------- */

.alert, .flash {
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 0.65rem 0.9rem;
    margin: 0 0 1rem;
    font-size: 0.93rem;
}
.alert-fehler, .flash-fehler {
    background: var(--fehler-bg); border-color: var(--fehler-rand); color: var(--fehler);
}
.flash-erfolg {
    background: var(--erfolg-bg); border-color: var(--erfolg-rand); color: var(--erfolg);
}
.flash-hinweis {
    background: var(--hinweis-bg); border-color: var(--hinweis-rand); color: var(--hinweis);
}

/* ---------- Formulare ---------- */

.form { max-width: 480px; }
.form-row { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.form-row-inline { flex-direction: row; align-items: center; }

label { font-weight: 600; font-size: 0.88rem; color: var(--text); }
.checkbox-label { display: flex; align-items: center; gap: 0.45rem; font-weight: 600; cursor: pointer; }

input[type="text"], input[type="password"], input[type="email"],
input[type="search"], input:not([type]), select, textarea {
    font: inherit;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--rand-stark);
    border-radius: 6px;
    background: var(--flaeche);
    color: var(--text);
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--akzent);
    outline-offset: 1px;
    border-color: var(--akzent);
}
input[type="checkbox"] { width: 1.1em; height: 1.1em; }

.form-help { font-size: 0.85rem; color: var(--text-schwach); margin: -0.4rem 0 1rem; }

.form-actions { display: flex; gap: 0.6rem; margin-top: 1.4rem; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.55rem 1rem;
    border-radius: 7px;
    border: 1px solid var(--rand-stark);
    background: var(--flaeche);
    color: var(--text);
    cursor: pointer;
}
.btn:hover { background: var(--marine-100); text-decoration: none; }
.btn-primary {
    background: var(--marine-800);
    border-color: var(--marine-800);
    color: #fff;
}
.btn-primary:hover { background: var(--marine-700); }

/* ---------- Tabellen ---------- */

.table-wrap {
    overflow-x: auto;
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    box-shadow: var(--schatten);
}
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td {
    text-align: left;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--rand);
    white-space: nowrap;
}
thead th {
    background: var(--marine-100);
    color: var(--marine-900);
    font-weight: 650;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--marine-100); }
.col-aktion { text-align: right; }

.badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 650;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}
.badge-ok { background: var(--erfolg-bg); color: var(--erfolg); }
.badge-aus { background: var(--fehler-bg); color: var(--fehler); }

/* ---------- Dashboard-Kacheln ---------- */

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.tile {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: 10px;
    padding: 1.1rem 1.2rem;
    box-shadow: var(--schatten);
    color: var(--text);
}
.tile:hover {
    border-color: var(--marine-600);
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(11, 36, 64, 0.1), 0 4px 18px rgba(11, 36, 64, 0.08);
}
.tile-icon { color: var(--marine-700); }
.tile-icon .icon { width: 1.7em; height: 1.7em; }
.tile-titel { font-weight: 650; font-size: 1.02rem; }
.tile-beschreibung { color: var(--text-schwach); font-size: 0.87rem; }

.page-head-aktionen { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.btn-gefahr {
    background: var(--fehler-bg);
    border-color: var(--fehler-rand);
    color: var(--fehler);
}
.btn-gefahr:hover { background: var(--fehler); color: #fff; }

.alert-hinweis, .flash-hinweis {
    background: var(--hinweis-bg); border-color: var(--hinweis-rand); color: var(--hinweis);
}
.alert-hinweis ul { margin: 0.4rem 0; padding-left: 1.3rem; }

/* Formulare mit mehreren Feldern nebeneinander (Mitglieder, Vereinsdaten, Beitragsklassen) */
.form-breit { max-width: 900px; }
.form-zeile {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.form-zeile > .form-row { flex: 1 1 200px; }

fieldset {
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 1rem 1.1rem 0.2rem;
    margin: 0 0 1.2rem;
}
legend {
    font-weight: 650;
    color: var(--marine-800);
    padding: 0 0.4rem;
    font-size: 0.95rem;
}
.versteckt-label {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Such-/Filterleiste (Mitgliederliste) */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    align-items: flex-end;
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    margin-bottom: 1.1rem;
}
.filter-feld { display: flex; flex-direction: column; gap: 0.3rem; }
.filter-feld-gross { flex: 2 1 240px; }
.filter-feld-aktion { flex-direction: row; align-items: center; gap: 0.5rem; }

.liste-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}
.link-export {
    font-weight: 600;
    font-size: 0.88rem;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.2rem;
    font-size: 0.9rem;
}

/* Status-Badges (Mitglieder) */
.badge-status-aktiv { background: var(--erfolg-bg); color: var(--erfolg); }
.badge-status-ruhend { background: var(--hinweis-bg); color: var(--hinweis); }
.badge-status-ausgetreten { background: var(--fehler-bg); color: var(--fehler); }

/* Stammblatt (Mitglieder-Detailansicht) */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.2rem;
}
.detail-karte {
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    box-shadow: var(--schatten);
}
.detail-karte-breit { grid-column: 1 / -1; }
.detail-karte h2 {
    margin: 0 0 0.7rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--marine-700);
}
.detail-liste { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.8rem; }
.detail-liste dt { color: var(--text-schwach); font-size: 0.85rem; }
.detail-liste dd { margin: 0; }

.link-liste { margin: 0; padding-left: 1.2rem; }
.link-liste li { margin-bottom: 0.3rem; }

/* Schlanke Aktions-Formulare innerhalb von Tabellenzeilen */
.inline-form, .inline-form-mit-datum {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.6rem;
}
.inline-form-mit-datum input[type="date"] {
    width: auto;
    padding: 0.25rem 0.4rem;
    font-size: 0.85rem;
}
.link-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--akzent-dunkel);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
}
.link-button:hover { color: var(--fehler); }

/* Kennzahlen-Kopfzeile (Liegeplaetze: gesamt/belegt/frei/gesperrt) */
.kennzahlen-leiste {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}
.kennzahl {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 0.6rem 1.1rem;
    box-shadow: var(--schatten);
    min-width: 90px;
}
.kennzahl-wert { font-size: 1.4rem; font-weight: 650; color: var(--marine-900); line-height: 1.1; }
.kennzahl-label { font-size: 0.78rem; color: var(--text-schwach); text-transform: uppercase; letter-spacing: 0.03em; }

/* Belegungs-Badges (Liegeplaetze) */
.badge-platz-frei { background: var(--erfolg-bg); color: var(--erfolg); }
.badge-platz-belegt { background: var(--marine-100); color: var(--marine-800); }
.badge-platz-gesperrt { background: var(--fehler-bg); color: var(--fehler); }

/* Status-Badges (Rechnungen) */
.badge-status-entwurf { background: var(--marine-100); color: var(--marine-800); }
.badge-status-offen { background: var(--hinweis-bg); color: var(--hinweis); }
.badge-status-teilbezahlt { background: var(--hinweis-bg); color: var(--hinweis); }
.badge-status-bezahlt { background: var(--erfolg-bg); color: var(--erfolg); }
.badge-status-storniert { background: var(--fehler-bg); color: var(--fehler); }

/* ---------- Mobil ---------- */

@media (max-width: 640px) {
    .topbar { padding: 0.6rem 0.85rem; }
    .user-name, .user-rolle { display: none; }
    .content { padding: 1.25rem 0.85rem 2.5rem; }
    .page-head { flex-direction: column; align-items: flex-start; }
    th, td { padding: 0.55rem 0.6rem; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-feld-aktion { flex-direction: row; }
    .detail-grid { grid-template-columns: 1fr; }
    .form-zeile { flex-direction: column; gap: 0; }
    .kennzahl { padding: 0.5rem 0.85rem; min-width: 76px; }
}
