/* ============================================================
   TTC Ferienaktion – Stylesheet
   Farben: Dunkelblau (#1a1ab0) + Schwarz/Weiß
   ============================================================ */

:root {
    --primary:       #1a1ab0;
    --primary-dark:  #10107e;
    --primary-light: #2828cc;
    --primary-pale:  #e8e8f8;
    --text:          #212529;
    --text-muted:    #6c757d;
    --bg:            #f0f0f8;
    --white:         #ffffff;
    --border:        #dee2e6;
    --success:       #198754;
    --success-pale:  #d1e7dd;
    --danger:        #dc3545;
    --danger-pale:   #f8d7da;
    --warning:       #856404;
    --warning-pale:  #fff3cd;
    --info-pale:     #cff4fc;
    --radius:        8px;
    --shadow:        0 2px 12px rgba(26,26,176,.10);
    --shadow-sm:     0 1px 4px rgba(0,0,0,.08);
    --sidebar-width: 240px;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

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

img { max-width: 100%; }

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4 { margin-top: 0; color: var(--primary); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: .95rem;
}
.alert-success { background: var(--success-pale); color: #0a3622; border: 1px solid #a3cfbb; }
.alert-danger  { background: var(--danger-pale);  color: #58151c; border: 1px solid #f1aeb5; }
.alert-warning { background: var(--warning-pale); color: var(--warning); border: 1px solid #ffe69c; }
.alert-info    { background: var(--info-pale);    color: #055160; border: 1px solid #9eeaf9; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, color .2s, border-color .2s;
    white-space: nowrap;
}
.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--white); text-decoration: none; }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); text-decoration: none; }
.btn-danger {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}
.btn-danger:hover { background: #b02a37; border-color: #b02a37; color: var(--white); text-decoration: none; }
.btn-sm { padding: 4px 12px; font-size: .82rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 24px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--primary-pale);
}
.card-header h2, .card-header h3 { margin: 0; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: .9rem;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,26,176,.15);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-text { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* Radio / Checkbox groups */
.radio-group, .check-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.radio-group.horizontal, .check-group.horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
}
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}
.form-check input[type="radio"],
.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}
.form-check-label { cursor: pointer; line-height: 1.4; }
.form-check-label small { display: block; color: var(--text-muted); font-size: .78rem; margin-top: 2px; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
thead th {
    background: var(--primary);
    color: var(--white);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:hover { background: var(--primary-pale); }
tbody td { padding: 11px 14px; vertical-align: middle; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .3px;
}
.badge-success { background: var(--success-pale); color: #0a3622; }
.badge-danger  { background: var(--danger-pale);  color: #58151c; }
.badge-warning { background: var(--warning-pale); color: var(--warning); }
.badge-primary { background: var(--primary-pale); color: var(--primary-dark); }
.badge-muted   { background: #e9ecef; color: #495057; }

/* ── Capacity bar ────────────────────────────────────────── */
.capacity-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}
.capacity-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width .3s;
}
.capacity-bar-fill.full { background: var(--danger); }
.capacity-text { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* ── Stats grid (Dashboard) ──────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.stat-card .stat-label {
    font-size: .82rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.stat-card.stat-success .stat-value { color: var(--success); }
.stat-card.stat-danger  .stat-value { color: var(--danger); }
.stat-card.stat-warning .stat-value { color: #856404; }

/* ──────────────────────────────────────────────────────────
   PUBLIC PAGES (Anmeldeformular)
   ────────────────────────────────────────────────────────── */
.public-header {
    background: var(--primary);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.public-header img { height: 56px; }
.public-header-text h1 { color: var(--white); margin: 0; font-size: 1.4rem; }
.public-header-text p  { color: #b0b8e8; margin: 0; font-size: .85rem; }

.public-main {
    max-width: 760px;
    margin: 36px auto;
    padding: 0 16px;
}

.group-option {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.group-option:hover { border-color: var(--primary-light); background: var(--primary-pale); }
.group-option.selected { border-color: var(--primary); background: var(--primary-pale); }
.group-option.full { opacity: .55; cursor: not-allowed; }
.group-option-title { font-weight: 700; color: var(--primary); }
.group-option-meta  { font-size: .83rem; color: var(--text-muted); margin-top: 4px; }

.section-divider {
    border: none;
    border-top: 2px solid var(--primary-pale);
    margin: 28px 0;
}

.public-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: .82rem;
    margin-top: 40px;
    border-top: 1px solid var(--border);
}

/* Success page */
.success-box {
    text-align: center;
    padding: 48px 32px;
}
.success-icon {
    width: 72px;
    height: 72px;
    background: var(--success-pale);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--success);
}

/* ──────────────────────────────────────────────────────────
   ADMIN LAYOUT
   ────────────────────────────────────────────────────────── */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-logo-circle {
    width: 52px;
    height: 52px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 4px;
}
.sidebar-logo { height: 42px; width: 42px; object-fit: contain; }
.sidebar-title { display: flex; flex-direction: column; }
.sidebar-app   { color: var(--white); font-weight: 700; font-size: .95rem; line-height: 1.2; }
.sidebar-sub   { color: #b0b8e8; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    flex: 1;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: #b0b8e8;
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: var(--white); text-decoration: none; }
.nav-item.active { background: rgba(255,255,255,.12); color: var(--white); border-left-color: var(--white); }

.sidebar-footer {
    padding: 12px 0;
    border-top: 1px solid rgba(255,255,255,.12);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    color: #b0b8e8;
    font-size: .82rem;
    overflow: hidden;
}
.sidebar-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-logout { color: #f0a0a0; }
.nav-logout:hover { color: #ffd0d0; background: rgba(220,53,69,.15); }

/* Main content */
.admin-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.admin-topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}
.admin-topbar h1 { font-size: 1.25rem; margin: 0; color: var(--primary); }
.admin-main { padding: 28px; flex: 1; }

/* Admin Login page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}
.login-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 48px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}
.login-card img { height: 80px; margin-bottom: 16px; }
.login-card h2 { margin-bottom: 8px; }
.login-card p { color: var(--text-muted); margin-bottom: 28px; }
.btn-microsoft {
    background: var(--white);
    color: var(--text);
    border: 1.5px solid var(--border);
    padding: 12px 24px;
    border-radius: 6px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: box-shadow .2s, border-color .2s;
}
.btn-microsoft:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); border-color: #aaa; color: var(--text); text-decoration: none; }
.btn-microsoft svg { flex-shrink: 0; }

/* ── Filters ─────────────────────────────────────────────── */
.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: flex-end;
}
.filters .form-control { width: auto; min-width: 160px; }

/* ── Print (Anwesenheitsliste) ───────────────────────────── */
@media print {
    .sidebar, .admin-topbar, .btn, .no-print { display: none !important; }
    .admin-content { margin-left: 0; }
    .admin-main { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    thead th { background: #1a1ab0 !important; -webkit-print-color-adjust: exact; }
    body { background: white; }
}

/* ── Honeypot (NIEMALS sichtbar für echte Nutzer) ────────── */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    visibility: hidden;
}
