/* May Fair – Verwaltung */
:root {
    --bg: #0d0d12;
    --bg-2: #14141c;
    --card: #1a1a24;
    --card-2: #232331;
    --line: #2f2f42;
    --text: #efece4;
    --muted: #9a97a8;
    --gold: #d4af37;
    --gold-2: #f0d77a;
    --wine: #7a1f3d;
    --ok: #2ecc71;
    --warn: #f39c12;
    --bad: #e74c3c;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(1100px 560px at 100% -10%, rgba(212, 175, 55, .09), transparent 60%),
                radial-gradient(900px 500px at -10% 110%, rgba(122, 31, 61, .18), transparent 60%), var(--bg);
    background-attachment: fixed;
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.25; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; color: var(--muted); }
code { background: var(--card-2); padding: 1px 6px; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.muted { color: var(--muted); }
.small, small { font-size: .82rem; }
.pos { color: #6fe3a1; }
.neg { color: #ff8b80; }

/* ---------- Seitenleiste ---------- */
.sidebar {
    width: 240px; flex-shrink: 0; background: rgba(20, 20, 28, .92); border-right: 1px solid var(--line);
    padding: 20px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand {
    display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--text);
    margin: 0 0 18px; padding: 4px 0 18px; border-bottom: 1px solid var(--line);
}
.brand:hover { text-decoration: none; }
.brand small { display: block; color: var(--gold); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; }
.brand strong { font-size: 1.1rem; letter-spacing: .08em; }
.brand-mark {
    width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; letter-spacing: .04em;
    color: #1a1405; background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 0 22px rgba(212, 175, 55, .35);
}
.brand-mark.big { width: 72px; height: 72px; font-size: 1.6rem; margin: 0 auto 16px; border-radius: 20px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--muted); }
.sidebar nav a span { width: 22px; text-align: center; }
.sidebar nav a:hover { background: var(--card); color: var(--text); text-decoration: none; }
.sidebar nav a.active { background: linear-gradient(90deg, rgba(212, 175, 55, .2), rgba(122, 31, 61, .12)); color: var(--text); box-shadow: inset 3px 0 0 var(--gold); }

/* ---------- Hauptbereich ---------- */
main { flex: 1; min-width: 0; padding: 24px 32px 48px; }
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.topbar h1 { margin: 0; font-size: 1.5rem; flex: 1; }
.me { display: flex; align-items: center; gap: 10px; }
.me img { width: 36px; height: 36px; border-radius: 50%; }
.me span { display: flex; flex-direction: column; line-height: 1.2; }
.me small { color: var(--muted); }
.nav-button { display: none; font-size: 22px; cursor: pointer; padding: 4px 10px; border-radius: 8px; background: var(--card); }
.nav-backdrop { display: none; }

/* ---------- Karten & Raster ---------- */
.card {
    background: linear-gradient(180deg, var(--card), rgba(26, 26, 36, .85)); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); min-width: 0; position: relative;
}
.card::before {
    content: ""; position: absolute; top: 0; left: 20px; right: 20px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), var(--wine), transparent); opacity: .7;
}
.card.empty { text-align: center; padding: 48px 20px; }
.grid { display: grid; gap: 20px; align-items: start; margin-bottom: 20px; }
.grid > .card { margin-bottom: 0; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.sidebar-right { grid-template-columns: minmax(0, 1fr) 360px; }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 120px; }
.between { justify-content: space-between; align-items: center; }

/* ---------- Kennzahlen ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; color: var(--text); }
a.stat:hover { border-color: var(--gold); text-decoration: none; }
.stat-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.stat strong { font-size: 1.6rem; margin: 2px 0; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); }

/* ---------- Balkendiagramm ---------- */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 8px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; min-width: 0; }
.bar i { display: block; width: 100%; max-width: 38px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--gold-2), var(--gold)); min-height: 2px; }
.bar.today i { background: linear-gradient(180deg, #ff9fb8, var(--wine)); }
.bar small { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.meter { height: 8px; border-radius: 999px; background: var(--card-2); overflow: hidden; min-width: 80px; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }

/* ---------- Listen ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.list li > .muted:last-child, .list li > form:last-child { margin-left: auto; }
.person { display: inline-flex; align-items: center; gap: 8px; }
.person img, .person .initial { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.person .initial { display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: .8rem; background: var(--card-2); color: var(--gold-2); border: 1px solid var(--line); }
.person > span { display: flex; flex-direction: column; line-height: 1.2; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
tbody tr:hover { background: rgba(212, 175, 55, .06); }
tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }

/* ---------- Formulare ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: .88rem; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, .18); }
textarea { resize: vertical; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font: inherit; font-weight: 600;
    color: #1a1405; border: 0; border-radius: 10px; padding: 9px 16px; background: linear-gradient(135deg, var(--gold-2), var(--gold)); white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--gold); }
.btn.danger { background: transparent; border: 1px solid rgba(231, 76, 60, .5); color: #ff8b80; }
.btn.danger:hover { background: rgba(231, 76, 60, .15); }
.btn.small { padding: 5px 10px; font-size: .82rem; }
.btn.discord { background: #5865f2; color: #fff; width: 100%; padding: 12px; font-size: 1rem; margin: 16px 0; }

.chip { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 10px; border-radius: 6px; white-space: nowrap; }
.att { display: inline-block; min-width: 92px; text-align: center; font-size: .78rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.att.anwesend { background: rgba(46, 204, 113, .22); color: #8ff0b8; }
.att.abgemeldet { background: rgba(243, 196, 18, .22); color: #f6dc6a; }
.att.abwesend { background: rgba(231, 76, 60, .25); color: #ff9a90; }
td.att-cell select { min-width: 118px; padding: 5px 8px; font-size: .82rem; }
td.att-cell select.anwesend { background: rgba(46, 204, 113, .22); }
td.att-cell select.abgemeldet { background: rgba(243, 196, 18, .22); }
td.att-cell select.abwesend { background: rgba(231, 76, 60, .25); }
.badge { display: inline-block; font-size: .75rem; padding: 2px 9px; border-radius: 999px; background: var(--card-2); color: var(--muted); font-weight: 600; }
.badge.ok { background: rgba(46, 204, 113, .15); color: #6fe3a1; }
.badge.warn { background: rgba(243, 156, 18, .15); color: #f8c26a; }
.badge.bad { background: rgba(231, 76, 60, .15); color: #ff8b80; }

.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid; }
.flash.ok { background: rgba(46, 204, 113, .1); border-color: rgba(46, 204, 113, .4); }
.flash.error { background: rgba(231, 76, 60, .1); border-color: rgba(231, 76, 60, .4); }

.tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.tabs > a { padding: 8px 14px; border-radius: 10px; color: var(--muted); background: var(--card); border: 1px solid var(--line); }
.tabs > a.active { color: var(--text); border-color: var(--gold); }
.tabs form { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.tabs form input, .tabs form select { width: auto; }
details summary { cursor: pointer; color: var(--muted); margin-top: 12px; }

/* ---------- Login ---------- */
.login-page { align-items: center; justify-content: center; padding: 16px; flex-direction: column; }
.login-card { width: 100%; max-width: 400px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 36px 28px; box-shadow: var(--shadow); }
.login-card h1 { margin-bottom: 4px; letter-spacing: .08em; }

/* ---------- Mobil ---------- */
@media (max-width: 1100px) {
    .grid.sidebar-right { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
    main { padding: 16px; }
    .grid.two { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; left: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; background: var(--bg-2); }
    #nav-toggle:checked ~ .sidebar { transform: none; }
    #nav-toggle:checked ~ .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 10; }
    .nav-button { display: block; }
    .topbar h1 { font-size: 1.2rem; }
    .me span, .me img { display: none; }
    .tabs form { margin-left: 0; }
}

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; padding: 20px 0 8px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .85rem; }
.site-footer p { margin: 4px auto; max-width: 820px; }
.login-page .site-footer { border: 0; margin: 24px auto 0; padding: 0 16px; }
