/* ================================================================
   Admin Panel — Styles
   TC Schwarz-Weiss Golkrath e.V.
   ================================================================ */

/* ── Variables ────────────────────────────────────── */
:root {
    --bg:         #0a0a0a;
    --bg-card:    #141414;
    --bg-hover:   #1e1e1e;
    --bg-input:   #1a1a1a;
    --border:     #2a2a2a;
    --text:       #e0e0e0;
    --text-muted: #777;
    --accent:     #fff;
    --accent-dim: rgba(255,255,255,.08);
    --danger:     #ef4444;
    --danger-dim: rgba(239,68,68,.12);
    --warning:    #f59e0b;
    --warning-dim:rgba(245,158,11,.12);
    --info:       #3b82f6;
    --info-dim:   rgba(59,130,246,.12);
    --radius:     8px;
    --sidebar-w:  250px;
    --header-h:   56px;
    --transition: .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
    font-family: 'Roboto', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Loading Bar ─────────────────────────────────── */
.loading-bar {
    position: fixed; top: 0; left: 0; height: 3px;
    background: #ccc; z-index: 9999;
    width: 0; transition: width .3s;
}

/* ── Toast ────────────────────────────────────────── */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 9998; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 10px 18px; border-radius: var(--radius); font-size: .85rem;
    color: #fff; opacity: 1; transition: opacity .3s; max-width: 360px;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.toast.success { background: #444; color: #fff; }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--info); }
.toast.warning { background: var(--warning); color: #000; }
.toast.info    { background: #555; color: #fff; }

/* ── Auth View ───────────────────────────────────── */
.auth-wrapper {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; padding: 20px;
}
.auth-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 40px 32px; width: 100%; max-width: 400px;
}
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-logo {
    width: 56px; height: 56px; border-radius: 50%; background: #333;
    color: #fff; font-weight: 700; font-size: 1.3rem;
    display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.auth-header h1 { font-size: 1.25rem; font-weight: 600; margin-bottom: 4px; }
.auth-header p  { color: var(--text-muted); font-size: .85rem; }
.auth-form  { display: flex; flex-direction: column; gap: 16px; }
.auth-error { margin-top: 14px; padding: 10px; border-radius: var(--radius); background: var(--danger-dim); color: var(--danger); font-size: .85rem; text-align: center; }

/* ── Form Elements ───────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: .8rem; color: var(--text-muted); font-weight: 500; }
input, select, textarea {
    background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); padding: 10px 12px; font-size: .9rem; font-family: inherit;
    transition: border-color var(--transition);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #888; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }
textarea { resize: vertical; min-height: 60px; }

/* ── Buttons ─────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: var(--radius); border: 1px solid var(--border);
    background: transparent; color: var(--text); font-size: .85rem; font-weight: 500;
    cursor: pointer; transition: all var(--transition); font-family: inherit;
    white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }
.btn-primary { background: #fff; color: #000; border-color: #fff; }
.btn-primary:hover { background: #ddd; border-color: #ddd; }
.btn-danger  { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: #444; color: #fff; border-color: #444; }
.btn-success:hover { background: #555; border-color: #555; }
.btn-outline { border-color: var(--border); }
.btn-outline:hover { border-color: var(--text-muted); }
.btn-sm { padding: 5px 10px; font-size: .78rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 6px 8px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
    position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh;
    background: var(--bg-card); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; z-index: 100;
    transition: transform .25s ease;
}
.sidebar-header {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.sidebar-logo {
    width: 34px; height: 34px; border-radius: 50%; background: #333;
    color: #fff; font-weight: 700; font-size: .85rem;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-title { font-weight: 600; font-size: 1rem; }
.sidebar-close { display: none; background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; margin-left: auto; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.nav-section-title { padding: 14px 18px 6px; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 600; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px; cursor: pointer; transition: background var(--transition);
    font-size: .88rem; color: var(--text-muted); border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: rgba(255,255,255,.06); color: #fff; border-left-color: #fff; font-weight: 500; }
.nav-item .nav-icon { width: 20px; text-align: center; font-size: 1rem; }
.nav-item .nav-badge {
    margin-left: auto; background: #555; color: #fff;
    font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 10px;
}
.nav-group-toggle .nav-chevron { margin-left: auto; font-size: .7rem; transition: transform .2s; }
.nav-sub { display: none; }
.nav-sub.open { display: block; }
.nav-sub-item { padding-left: 44px !important; font-size: .84rem; }

.sidebar-footer { padding: 14px 18px; border-top: 1px solid var(--border); }
.user-info { margin-bottom: 10px; font-size: .8rem; }
.user-info .user-name { font-weight: 500; color: var(--text); }
.user-info .user-role { color: var(--text-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }

.sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 99;
}

/* ── Main Content ────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w); min-height: 100vh;
    display: flex; flex-direction: column;
}
.main-header {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 12px;
    padding: 0 24px; height: var(--header-h);
    background: var(--bg); border-bottom: 1px solid var(--border);
}
.main-header h2 { font-size: 1.1rem; font-weight: 600; flex: 1; }
.menu-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; }
.header-actions { display: flex; gap: 8px; }

.module-content { flex: 1; padding: 24px; }

/* ── Cards & Stat Boxes ──────────────────────────── */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; display: flex; flex-direction: column; gap: 4px;
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-card .stat-label { font-size: .78rem; color: var(--text-muted); }
.stat-card.accent .stat-value { color: #fff; }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.info .stat-value    { color: var(--info); }
.stat-card.danger .stat-value  { color: var(--danger); }

/* ── Dashboard Nav Buttons ───────────────────────── */
.dash-nav-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px;
    margin-top: 24px;
}
.dash-nav-btn {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 32px 28px; cursor: pointer; transition: all var(--transition);
    display: flex; flex-direction: column; gap: 16px; text-decoration: none; color: var(--text);
    min-height: 180px;
}
.dash-nav-btn:hover { background: var(--bg-hover); border-color: #555; transform: translateY(-2px); }
.dash-nav-icon {
    width: 56px; height: 56px; border-radius: 14px; background: rgba(255,255,255,.06);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; flex-shrink: 0;
}
.dash-nav-text { flex: 1; }
.dash-nav-text .dash-nav-title { font-weight: 600; font-size: 1.15rem; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-nav-text .dash-nav-stat { font-size: .95rem; color: var(--text); margin-bottom: 6px; }
.dash-nav-text .dash-nav-value { font-weight: 700; font-size: 1.5rem; }
.dash-nav-text .dash-nav-desc { font-size: .82rem; color: var(--text-muted); }
.dash-nav-arrow { color: var(--text-muted); font-size: 1rem; align-self: flex-end; transition: transform var(--transition); }
.dash-nav-btn:hover .dash-nav-arrow { transform: translateX(4px); color: var(--text); }
.dash-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: .72rem; font-weight: 600; }
.dash-badge.warning { background: var(--warning-dim); color: var(--warning); }

.card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; margin-bottom: 16px;
}
.card-title { font-size: .95rem; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }

/* ── Tables ──────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table th {
    text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--border);
    font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr.clickable { cursor: pointer; }

/* ── Badges ──────────────────────────────────────── */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.badge-neu       { background: var(--info-dim); color: var(--info); }
.badge-genehmigt { background: rgba(34,197,94,.12); color: #4ade80; }
.badge-abgelehnt { background: var(--danger-dim); color: var(--danger); }
.badge-admin     { background: rgba(255,255,255,.1); color: #fff; }
.badge-vorstand-schreibend { background: var(--warning-dim); color: var(--warning); }
.badge-vorstand-lesend     { background: var(--info-dim); color: var(--info); }
.badge-pending  { background: var(--warning-dim); color: var(--warning); }
.badge-rejected { background: var(--danger-dim); color: var(--danger); }
.badge-member    { background: rgba(255,255,255,.08); color: var(--text-muted); }
.badge-recurring { background: var(--info-dim); color: var(--info); }
.badge-once      { background: var(--warning-dim); color: var(--warning); }

/* ── Filter Tabs ─────────────────────────────────── */
.filter-bar { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tab {
    padding: 6px 14px; border-radius: 20px; font-size: .8rem; cursor: pointer;
    background: var(--bg-input); border: 1px solid var(--border); color: var(--text-muted);
    transition: all var(--transition);
}
.filter-tab:hover { color: var(--text); border-color: var(--text-muted); }
.filter-tab.active { background: rgba(255,255,255,.1); color: #fff; border-color: #888; }

/* ── Empty State ─────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: .9rem; }

/* ── Blocked Slot Items ──────────────────────────── */
.blocked-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 8px; transition: background var(--transition);
}
.blocked-item:hover { background: var(--bg-hover); }
.blocked-info { flex: 1; min-width: 0; }
.blocked-reason { font-weight: 500; font-size: .88rem; display: block; }
.blocked-detail { font-size: .78rem; color: var(--text-muted); }

/* ── Sperrzeit Form ──────────────────────────────── */
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 20px; }
.form-inline .form-group { flex: 1; min-width: 120px; }
.form-inline .form-group.grow { flex: 2; }

/* ── Detail Grid (Modal) ─────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 1px; }
.detail-label { padding: 8px 10px; font-size: .8rem; color: var(--text-muted); font-weight: 500; }
.detail-value { padding: 8px 10px; font-size: .85rem; }
.detail-divider { grid-column: 1 / -1; height: 1px; background: var(--border); margin: 4px 0; }

/* ── Modal ────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.7);
    display: flex; justify-content: center; align-items: center; z-index: 200; padding: 20px;
}
.modal {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    width: 100%; max-width: 600px; max-height: 85vh; display: flex; flex-direction: column;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ── User Management ─────────────────────────────── */
.user-card {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 8px; transition: background var(--transition);
}
.user-card:hover { background: var(--bg-hover); }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%; background: var(--border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem; color: var(--text-muted); flex-shrink: 0;
}
.user-card-info { flex: 1; min-width: 0; }
.user-card-name { font-weight: 500; font-size: .88rem; }
.user-card-email { font-size: .78rem; color: var(--text-muted); }
.user-card-actions { display: flex; gap: 6px; }

/* ── Checkbox & Chips in Forms ───────────────────── */
.module-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.module-chip {
    padding: 4px 12px; border-radius: 16px; font-size: .78rem; cursor: pointer;
    border: 1px solid var(--border); background: transparent; color: var(--text-muted);
    transition: all var(--transition);
}
.module-chip.selected { background: rgba(255,255,255,.1); color: #fff; border-color: #888; }

/* ── Responsive ──────────────────────────────────── */
/* ── PC / Wide Screen ─────────────────────────────── */
@media (min-width: 1200px) {
    .module-content { max-width: 1100px; }
    .dash-nav-grid { grid-template-columns: repeat(2, 1fr); }
    .blocked-item { padding: 12px 18px; }
}
@media (min-width: 1600px) {
    .module-content { max-width: 1300px; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .sidebar-overlay.show { display: block; }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-inline { flex-direction: column; }
    .form-inline .form-group { min-width: 100%; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-label { padding-bottom: 0; }
    .data-table { font-size: .78rem; }
    .data-table th, .data-table td { padding: 8px 6px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .module-content { padding: 16px 12px; }
    .modal { max-width: 100%; }
}
