* {
    box-sizing: border-box;
}

:root {
    --bg: #eef2f7;
    --bg-soft: #f6f8fb;
    --panel: #ffffff;
    --panel-2: #f8fafc;
    --text: #1f2937;
    --muted: #6b7280;
    --line: rgba(148, 163, 184, 0.22);
    --line-strong: rgba(148, 163, 184, 0.34);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #16a34a;
    --success-soft: rgba(34, 197, 94, 0.10);
    --warning: #d97706;
    --warning-soft: rgba(245, 158, 11, 0.12);
    --danger: #dc2626;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --radius: 16px;
    --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    --max-width: 1440px;
}

html,
body {
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg, #f4f7fb 0%, #e9eef5 100%);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    color: #1d4ed8;
}

.container {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 18px 0;
}

.logo {
    font-size: 1.3rem;
    font-weight: bold;
    color: #1f2937;
}

.subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.92rem;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.site-main {
    padding: 32px 0 48px;
    min-height: calc(100vh - 140px);
}

.site-footer {
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
}

.footer-inner {
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    flex-wrap: wrap;
}

.site-footer a {
    color: #2563eb;
    font-weight: 600;
}

.site-footer a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.hero,
.card,
.panel {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero {
    padding: 32px;
    margin-bottom: 24px;
}

.hero h1 {
    margin-top: 0;
    font-size: 2rem;
}

.hero p {
    color: var(--muted);
    line-height: 1.6;
}

.hero-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.panel {
    padding: 24px;
}

.card h3,
.panel h2,
.panel h3 {
    margin-top: 0;
    color: #1f2937;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
}

.btn-outline {
    background: #ffffff;
    border-color: rgba(59, 130, 246, 0.28);
    color: #1d4ed8;
}

.btn-outline:hover {
    background: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
}

.btn-small {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #374151;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #ffffff;
    color: var(--text);
    outline: none;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(59, 130, 246, 0.7);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(22, 163, 74, 0.10);
    border-color: rgba(22, 163, 74, 0.22);
    color: #166534;
}

.alert-error {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.18);
    color: #991b1b;
}

.alert-warning {
    background: rgba(217, 119, 6, 0.10);
    border-color: rgba(217, 119, 6, 0.20);
    color: #92400e;
}

.muted {
    color: var(--muted);
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    font-size: 0.85rem;
    font-weight: bold;
}

.badge-success {
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #92400e;
}

.badge-muted {
    background: rgba(148, 163, 184, 0.14);
    color: #475569;
}

.actions-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.help-text {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.92rem;
}

.info-box {
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.16);
    color: #1e40af;
    margin-bottom: 20px;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-bar {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
}

/* Planner */
.planner-shell {
    overflow-x: auto;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--shadow);
}

.planner-board {
    min-width: 1120px;
}

.planner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0;
}

.planner-column {
    border-right: 1px solid var(--line-strong);
    min-width: 320px;
}

.planner-column:last-child {
    border-right: none;
}

.planner-column-head {
    padding: 18px 16px;
    border-bottom: 1px solid var(--line-strong);
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    position: sticky;
    top: 0;
    z-index: 5;
}

.planner-column-title {
    font-size: 1rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 4px;
}

.planner-column-subtitle {
    color: var(--muted);
    font-size: 0.84rem;
}

.planner-column-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 420px;
}

.planner-empty {
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    padding: 16px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.75);
}

.slot-card {
    border-radius: 16px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.slot-card-free {
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.10), rgba(34, 197, 94, 0.04));
    border-color: rgba(34, 197, 94, 0.22);
}

.slot-card-partial {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.05));
    border-color: rgba(245, 158, 11, 0.24);
}

.slot-card-full {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.10), rgba(239, 68, 68, 0.04));
    border-color: rgba(239, 68, 68, 0.24);
}

.slot-card-clickable {
    cursor: pointer;
}

.slot-card-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
    border-color: rgba(59, 130, 246, 0.45);
}

.slot-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.slot-time {
    font-size: 0.95rem;
    font-weight: bold;
    color: #1f2937;
}

.slot-capacity {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: right;
    white-space: nowrap;
}

.slot-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: bold;
}

.slot-status-free {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

.slot-status-partial {
    background: rgba(245, 158, 11, 0.14);
    color: #92400e;
}

.slot-status-full {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
}

.slot-bookings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.booking-card {
    display: block;
    position: relative;
    z-index: 3;
    border-radius: 12px;
    padding: 10px 11px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.14), rgba(37, 99, 235, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.26);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    color: #1f2937;
}

.booking-card:hover {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.20), rgba(37, 99, 235, 0.12));
    border-color: rgba(59, 130, 246, 0.38);
}

.booking-card-selected {
    border-color: rgba(22, 163, 74, 0.45);
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18), 0 6px 16px rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.14), rgba(21, 128, 61, 0.08));
}

.booking-time {
    font-size: 0.78rem;
    font-weight: bold;
    color: #1d4ed8;
    margin-bottom: 4px;
}

.booking-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 4px;
}

.booking-meta {
    font-size: 0.76rem;
    color: #475569;
    line-height: 1.35;
}

.slot-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.slot-action {
    margin-top: 2px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #1d4ed8;
}

.slot-inline-form {
    margin-top: 6px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.82);
}

.slot-inline-form h4 {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: #1f2937;
}

.slot-inline-form .form-group {
    margin-bottom: 12px;
}

.slot-inline-form .form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.calendar-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.calendar-legend-box {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.24);
}

.legend-free {
    background: var(--success-soft);
    border-color: rgba(34, 197, 94, 0.22);
}

.legend-partial {
    background: var(--warning-soft);
    border-color: rgba(245, 158, 11, 0.24);
}

.legend-full {
    background: var(--danger-soft);
    border-color: rgba(239, 68, 68, 0.24);
}

.legend-booking {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.26);
}

.list-modern {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #dbe2ea;
    cursor: pointer;
    transition: .15s;
}

.list-row:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .06);
}

.list-main {
    flex: 1;
}

.list-title {
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
}

.list-sub {
    font-size: 13px;
    color: #6b7280;
}

.list-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-right: 20px;
}

.list-actions {
    display: flex;
    gap: 8px;
}

.mitglied-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.mitglied-card {
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 18px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.mitglied-card:hover {
    background: #ffffff;
    border-color: rgba(59, 130, 246, 0.24);
    transform: translateY(-1px);
}

.mitglied-card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.mitglied-card-header-left {
    min-width: 0;
}

.mitglied-card-name {
    display: inline-block;
    font-size: 1.05rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 6px;
}

.mitglied-card-name:hover {
    color: #1d4ed8;
}

.mitglied-card-email {
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.4;
    word-break: break-word;
}

.mitglied-card-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.mitglied-card-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.mitglied-info-box {
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.16);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mitglied-info-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: bold;
}

.mitglied-info-value {
    color: #1f2937;
    font-size: 0.94rem;
    line-height: 1.35;
    word-break: break-word;
}

.mitglied-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 1100px) {
    .mitglied-card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .filter-bar {
        grid-template-columns: 1fr;
    }

    .header-inner,
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .planner-grid {
        grid-template-columns: 1fr;
    }

    .planner-column {
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid var(--line-strong);
    }

    .planner-column:last-child {
        border-bottom: none;
    }
}

@media (max-width: 640px) {
    .mitglied-card-body {
        grid-template-columns: 1fr;
    }

    .mitglied-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}