/* ===== Grundlayout ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:   #2B3080;
    --primary-h: #1e2260;
    --accent:    #F0921C;
    --accent-h:  #d47c10;
    --danger:    #dc2626;
    --danger-h:  #b91c1c;
    --success-bg: #f0fdf4;
    --success-br: #86efac;
    --error-bg:  #fef2f2;
    --error-br:  #fca5a5;
    --bg:        #f4f5f9;
    --card-bg:   #ffffff;
    --text:      #1f2937;
    --muted:     #6b7280;
    --border:    #e5e7eb;
    --radius:    10px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

/* ===== Login ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: 100vh;
    background: linear-gradient(135deg, #f4f5f9 0%, #e8eaf6 100%);
}

.login-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 24px rgba(43,48,128,.10);
    text-align: center;
}

.login-logo {
    width: 200px;
    max-width: 80%;
    margin-bottom: 1.25rem;
}

.login-box h1 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: .4rem;
}

.subtitle { color: var(--muted); font-size: .9rem; margin-bottom: 1.75rem; }

.login-box form { text-align: left; }

.login-box .btn {
    width: 100%;
    padding: .75rem;
    font-size: 1.1rem;
}

/* ===== Header ===== */
header {
    background: #fff;
    border-bottom: 3px solid var(--accent);
    padding: .75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(43,48,128,.10);
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-logo {
    height: 48px;
    width: auto;
}

nav { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ===== Tab-Navigation ===== */
.tab-nav {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: .25rem;
    padding-top: .6rem;
}

.tab {
    padding: .45rem 1.25rem;
    border-radius: 6px 6px 0 0;
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--muted);
    border: 1px solid transparent;
    border-bottom: none;
    transition: background .15s, color .15s;
}

.tab:hover { color: var(--primary); background: #f0f1f9; }

.tab--active {
    color: var(--primary);
    background: var(--bg);
    border-color: var(--border);
    border-bottom-color: var(--bg);
    margin-bottom: -1px;
}

/* ===== Main ===== */
main {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem 3rem;
}

main h2 {
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
    color: var(--primary);
}

main h3 {
    font-size: 1rem;
    margin-bottom: .75rem;
    color: var(--primary);
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: .5rem 1rem;
    border-radius: 6px;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.btn-primary  { background: var(--accent);  color: #fff; }
.btn-primary:hover  { background: var(--accent-h); }

.btn-danger   { background: var(--danger);   color: #fff; }
.btn-danger:hover   { background: var(--danger-h); }

.btn-outline  {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-outline:hover { background: #e8eaf6; }

/* ===== Formulare ===== */
label {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: .35rem;
    margin-top: 1rem;
    color: var(--primary);
}

input[type="text"],
input[type="password"],
input[type="file"] {
    width: 100%;
    padding: .6rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 1rem;
    background: #fff;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* ===== Card ===== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ===== Zähler ===== */
.zaehler {
    font-size: .75rem;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    padding: .2rem .6rem;
    border-radius: 999px;
    vertical-align: middle;
    margin-left: .5rem;
}

/* ===== Suche ===== */
.search-box {
    margin-bottom: 1.25rem;
}

.search-box input {
    width: 100%;
    padding: .65rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    transition: border-color .15s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
}

/* ===== Dateiliste ===== */
.file-list { display: flex; flex-direction: column; gap: .75rem; }

.file-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    transition: box-shadow .15s;
}

.file-card:hover {
    box-shadow: 0 2px 12px rgba(43,48,128,.10);
}

.file-icon { font-size: 1.75rem; flex-shrink: 0; }

.file-info {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    font-size: .95rem;
    word-break: break-word;
    color: var(--primary);
}

.file-meta { font-size: .8rem; color: var(--muted); }

.file-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ===== Audio-Player ===== */
.audio-player {
    width: 100%;
    padding-top: .5rem;
}

.audio-player audio {
    width: 100%;
    height: 36px;
    border-radius: 6px;
}

/* ===== Titelformular (Admin) ===== */
.title-form {
    display: flex;
    gap: .4rem;
    margin-top: .5rem;
    flex-wrap: wrap;
}

.title-form input[type="text"] {
    flex: 1;
    min-width: 140px;
    padding: .35rem .6rem;
    font-size: .85rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin: 0;
}

.title-form input[type="text"]:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.title-form .btn {
    padding: .35rem .75rem;
    font-size: .85rem;
}

/* ===== Alerts ===== */
.alert {
    padding: .75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
    font-size: .9rem;
}

.alert-success { background: var(--success-bg); border: 1px solid var(--success-br); color: #166534; }
.alert-error   { background: var(--error-bg);   border: 1px solid var(--error-br);   color: #991b1b; }

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}

.empty-state p { margin-bottom: 1rem; }

.muted { color: var(--muted); }

/* ===== Mitgliedertabelle ===== */
.mitglieder-tabelle-wrapper {
    overflow-x: auto;
}

.mitglieder-tabelle {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    font-size: .75rem;
}

.mitglieder-tabelle thead {
    background: var(--primary);
    color: #fff;
}

.mitglieder-tabelle th {
    padding: .4rem .75rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.mitglieder-tabelle td {
    padding: .35rem .75rem;
    border-top: 1px solid var(--border);
    color: var(--text);
    white-space: nowrap;
}

.mitglieder-tabelle tbody tr:hover {
    background: #f0f1f9;
}

.mitglieder-tabelle th:nth-child(4),
.mitglieder-tabelle td:nth-child(4) {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Terminliste ===== */
.termin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

.termin-form-voll {
    grid-column: 1 / -1;
}

.termin-form-grid input[type="date"],
.termin-form-grid input[type="time"],
.termin-form-grid input[type="text"] {
    width: 100%;
    padding: .6rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 0;
    background: #fff;
}

.termin-form-grid input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.termin-liste { display: flex; flex-direction: column; gap: .75rem; }

.termin-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.termin-card--vergangen {
    border-left-color: var(--border);
    opacity: .65;
}

.termin-datum {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 48px;
    text-align: center;
    flex-shrink: 0;
}

.termin-tag {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.termin-card--vergangen .termin-tag { color: var(--muted); }

.termin-monat {
    font-size: .7rem;
    color: var(--muted);
    white-space: nowrap;
}

.termin-info { flex: 1; min-width: 0; }

.termin-titel {
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: .2rem;
}

.termin-card--vergangen .termin-titel { color: var(--text); }

.termin-meta { font-size: .8rem; color: var(--muted); }

.termin-notiz {
    font-size: .8rem;
    color: var(--muted);
    margin-top: .25rem;
    font-style: italic;
}

.termin-actions { flex-shrink: 0; }

/* ===== Admin Schnellnavigation ===== */
.admin-quicknav {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.admin-quicknav-item {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .65rem 1.25rem;
    background: var(--card-bg);
    border: 2px solid var(--primary);
    border-radius: 8px;
    color: var(--primary);
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.admin-quicknav-item:hover {
    background: var(--primary);
    color: #fff;
}

.admin-section-title {
    scroll-margin-top: 80px;
}

/* ===== Dashboard ===== */
.dashboard-section {
    margin-bottom: 2.5rem;
}

.dashboard-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* Geburtstage */
.geburtstag-liste {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.geburtstag-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 4px solid #f9a8d4;
    border-radius: var(--radius);
    padding: .75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.geburtstag-datum {
    font-size: .95rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 56px;
    flex-shrink: 0;
}

.geburtstag-name {
    flex: 1;
    font-size: .95rem;
}

.geburtstag-badge {
    font-size: .75rem;
    font-weight: 600;
    background: #fce7f3;
    color: #9d174d;
    padding: .2rem .6rem;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.geburtstag-badge--heute {
    background: var(--accent);
    color: #fff;
}

/* Schnellzugriff-Kacheln */
.dashboard-kacheln {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.dashboard-kachel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    transition: box-shadow .15s, border-color .15s;
}

.dashboard-kachel:hover {
    box-shadow: 0 2px 12px rgba(43,48,128,.12);
    border-color: var(--primary);
}

.dashboard-kachel-icon { font-size: 2rem; }

.dashboard-kachel-label {
    font-size: .9rem;
    font-weight: 600;
    color: var(--primary);
}

/* ===== Responsive ===== */
@media (max-width: 520px) {
    /* Header */
    .header-inner { flex-direction: column; align-items: flex-start; gap: .6rem; }
    .header-logo { height: 38px; }
    nav { width: 100%; }
    nav .btn { flex: 1; text-align: center; }

    /* Tabs */
    .tab-nav { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
    .tab { white-space: nowrap; padding: .4rem .9rem; font-size: .82rem; }

    /* Main */
    main { margin: 1rem auto; padding: 0 .75rem 2rem; }
    main h2 { font-size: 1.15rem; }

    /* Cards */
    .card { padding: 1rem; }

    /* Dateiliste */
    .file-card { flex-direction: column; align-items: flex-start; gap: .6rem; padding: .85rem 1rem; }
    .file-actions { width: 100%; display: flex; flex-direction: column; gap: .4rem; }
    .file-actions .btn { width: 100%; text-align: center; }

    /* Titelformular im Admin */
    .title-form { flex-direction: column; }
    .title-form input[type="text"] { min-width: 0; width: 100%; }
    .title-form .btn { width: 100%; text-align: center; }

    /* Termine */
    .termin-form-grid { grid-template-columns: 1fr; }
    .termin-card { gap: .75rem; padding: .85rem 1rem; }
    .termin-actions { width: 100%; }
    .termin-actions .btn { width: 100%; text-align: center; }

    /* Dashboard Kacheln */
    .dashboard-kacheln { grid-template-columns: repeat(2, 1fr); }
    .geburtstag-card { padding: .65rem .85rem; gap: .6rem; }

    /* Admin Schnellnavigation */
    .admin-quicknav { gap: .5rem; }
    .admin-quicknav-item { flex: 1 1 40%; justify-content: center; padding: .55rem .75rem; font-size: .88rem; }

    /* Buttons allgemein */
    .btn { padding: .6rem 1rem; font-size: .9rem; }
}
