/* ==========================================================
   Session-Buchung – Stylesheet
   Palette: Nachtviolett / Mint (frei) / Pink (Aktion)
   ========================================================== */

:root {
    --night:    #14111F;
    --panel:    #1C1830;
    --panel-2:  #232040;
    --edge:     #2F2A4C;
    --text:     #EDE9FB;
    --muted:    #8F87AD;
    --signal:   #FF5C8A;
    --online:   #4BE0A8;
    --busy:     #F5A524;
    --full:     #6A6288;

    --r-sm: 6px;
    --r-md: 12px;
    --r-lg: 18px;

    --font-display: 'Bricolage Grotesque', 'Arial Black', sans-serif;
    --font-body:    'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, monospace;

    --shadow: 0 18px 40px -20px rgba(0, 0, 0, .8);
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--night);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Ambientes Licht im Hintergrund */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(60rem 40rem at 15% -10%, rgba(255, 92, 138, .13), transparent 60%),
        radial-gradient(50rem 35rem at 95% 5%, rgba(75, 224, 168, .09), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.wrap {
    position: relative;
    z-index: 1;
    width: min(1080px, 100% - 2.5rem);
    margin-inline: auto;
}

a { color: inherit; }

/* ---------- Typografie ---------- */

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.02em;
    margin: 0;
}

h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }

.eyebrow {
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 1rem;
}

.lead {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 46ch;
    margin: 1.25rem 0 0;
}

/* ---------- Kopfbereich ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 0;
}

.brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -.01em;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.brand .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--online);
    box-shadow: 0 0 0 4px rgba(75, 224, 168, .18);
}

.topbar nav {
    display: flex;
    gap: 1.4rem;
    font-size: .9rem;
    color: var(--muted);
}

.topbar nav a { text-decoration: none; }
.topbar nav a:hover { color: var(--text); }

.hero { padding: 3rem 0 3.5rem; }

/* ---------- Live-Status-Zeile ---------- */

.status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 1.75rem;
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--edge);
}

.status-strip div { display: flex; flex-direction: column; }

.status-strip .num {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
}

.status-strip .lbl {
    font-size: .78rem;
    color: var(--muted);
    letter-spacing: .04em;
}

/* ---------- Lobby-Liste ---------- */

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.day-group { margin-bottom: 2.5rem; }

.day-head {
    font-family: var(--font-mono);
    font-size: .8rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: .6rem;
    margin-bottom: .9rem;
    border-bottom: 1px solid var(--edge);
}

.slot {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
    text-align: left;
    background: var(--panel);
    border: 1px solid var(--edge);
    border-radius: var(--r-md);
    padding: 1.1rem 1.35rem;
    margin-bottom: .7rem;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.slot:hover:not(:disabled) {
    border-color: var(--signal);
    background: var(--panel-2);
    transform: translateY(-2px);
}

.slot:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 3px;
}

.slot:disabled { cursor: not-allowed; opacity: .55; }

.slot .led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--online);
    box-shadow: 0 0 0 4px rgba(75, 224, 168, .15);
    flex: none;
}

.slot[data-state="filling"] .led {
    background: var(--busy);
    box-shadow: 0 0 0 4px rgba(245, 165, 36, .15);
}

.slot[data-state="full"] .led,
.slot[data-state="closed"] .led {
    background: var(--full);
    box-shadow: none;
}

.slot .time {
    display: block;
    min-width: 5.5rem;
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

.slot .time small {
    display: block;
    font-size: .74rem;
    font-weight: 400;
    color: var(--muted);
    letter-spacing: 0;
}

.slot .meta { min-width: 0; }

.slot .activity {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slot .note {
    display: block;
    font-size: .85rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Platz-Punkte statt "2/4" – man sieht die Lobby */
.seats { display: flex; gap: 5px; align-items: center; }

.seats i {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--edge);
    display: block;
}

.seats i.on { background: var(--signal); }

.seats span {
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--muted);
    margin-left: .45rem;
}

.slot .cta {
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--signal);
    white-space: nowrap;
}

.slot:disabled .cta { color: var(--muted); }

/* ---------- Leerer Zustand ---------- */

.empty {
    border: 1px dashed var(--edge);
    border-radius: var(--r-md);
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--muted);
}

.empty strong {
    display: block;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: .4rem;
}

/* ---------- Dialog ---------- */

dialog {
    border: 1px solid var(--edge);
    background: var(--panel);
    color: var(--text);
    border-radius: var(--r-lg);
    padding: 0;
    width: min(460px, calc(100vw - 2rem));
    box-shadow: var(--shadow);
}

dialog::backdrop {
    background: rgba(10, 8, 18, .75);
    backdrop-filter: blur(3px);
}

.dialog-head {
    padding: 1.5rem 1.6rem 1.1rem;
    border-bottom: 1px solid var(--edge);
}

.dialog-head h3 { font-size: 1.35rem; }

.dialog-head p {
    margin: .5rem 0 0;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: .85rem;
}

.dialog-body { padding: 1.5rem 1.6rem; }

.field { margin-bottom: 1.15rem; }

.field label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: .4rem;
}

.field .hint {
    font-size: .78rem;
    color: var(--muted);
    font-weight: 400;
    margin-top: .25rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="url"],
select,
textarea {
    width: 100%;
    background: var(--night);
    border: 1px solid var(--edge);
    border-radius: var(--r-sm);
    color: var(--text);
    padding: .7rem .85rem;
    font-family: var(--font-body);
    font-size: .95rem;
    transition: border-color .15s ease;
}

input.mono { font-family: var(--font-mono); }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--signal);
}

input[aria-invalid="true"] { border-color: var(--signal); }

textarea { resize: vertical; min-height: 84px; }

.dialog-actions {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    padding-top: .25rem;
}

/* ---------- Buttons ---------- */

.btn {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: .92rem;
    border-radius: var(--r-sm);
    padding: .7rem 1.3rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, opacity .15s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary { background: var(--signal); color: #1A0A12; }
.btn-primary:hover { background: #FF7BA1; }

.btn-ghost {
    background: transparent;
    border-color: var(--edge);
    color: var(--muted);
}

.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

.btn-danger { background: transparent; border-color: var(--edge); color: var(--signal); }
.btn-danger:hover { border-color: var(--signal); }

.btn-sm { padding: .45rem .85rem; font-size: .82rem; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Rückmeldungen ---------- */

.notice {
    border-radius: var(--r-sm);
    padding: .85rem 1rem;
    font-size: .9rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--edge);
    background: var(--panel-2);
}

.notice-error { border-color: var(--signal); color: #FFC2D3; }
.notice-ok    { border-color: var(--online); color: #B6F5DC; }

.result-ok { text-align: center; padding: 1rem 0 .5rem; }

.result-ok .check {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(75, 224, 168, .14);
    color: var(--online);
    display: grid;
    place-items: center;
    margin: 0 auto 1rem;
    font-size: 1.6rem;
}

/* ---------- Fußbereich ---------- */

footer {
    margin-top: 4rem;
    padding: 2rem 0 3rem;
    border-top: 1px solid var(--edge);
    color: var(--muted);
    font-size: .85rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

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

/* ==========================================================
   Adminbereich
   ========================================================== */

.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }

.sidebar {
    background: var(--panel);
    border-right: 1px solid var(--edge);
    padding: 1.5rem 1rem;
    position: relative;
    z-index: 1;
}

.sidebar .brand { margin-bottom: 2rem; padding-inline: .5rem; }

.sidebar a.nav-item {
    display: block;
    padding: .6rem .75rem;
    border-radius: var(--r-sm);
    color: var(--muted);
    text-decoration: none;
    font-size: .92rem;
    margin-bottom: .2rem;
}

.sidebar a.nav-item:hover { background: var(--panel-2); color: var(--text); }
.sidebar a.nav-item.active { background: var(--panel-2); color: var(--text); }

.admin-main { padding: 2rem clamp(1.25rem, 4vw, 2.5rem); position: relative; z-index: 1; }

.card {
    background: var(--panel);
    border: 1px solid var(--edge);
    border-radius: var(--r-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 { font-size: 1.15rem; margin-bottom: 1rem; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }

th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    padding: .6rem .5rem;
    border-bottom: 1px solid var(--edge);
    font-weight: 500;
}

td { padding: .8rem .5rem; border-bottom: 1px solid var(--edge); vertical-align: middle; }
tr:last-child td { border-bottom: none; }

.tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: .7rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .2rem .5rem;
    border-radius: 4px;
    border: 1px solid var(--edge);
    color: var(--muted);
}

.tag-confirmed { color: var(--online); border-color: rgba(75, 224, 168, .4); }
.tag-pending   { color: var(--busy);   border-color: rgba(245, 165, 36, .4); }
.tag-declined,
.tag-cancelled { color: var(--full); }

.stat { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 700; }
.stat + .lbl { font-size: .8rem; color: var(--muted); }

.login-page { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.login-box  { width: min(380px, 100%); }

.inline-form { display: inline; }

/* ---------- Responsiv ---------- */

@media (max-width: 720px) {
    .slot {
        grid-template-columns: auto minmax(0, 1fr);
        gap: .5rem .9rem;
        align-items: center;
    }
    .slot .time  { grid-column: 2; min-width: 0; }
    .slot .meta  { grid-column: 2; }
    .slot .seats { grid-column: 2; }
    .slot .cta   { grid-column: 2; }
    .slot .led   { grid-row: 1; }
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar { border-right: none; border-bottom: 1px solid var(--edge); }
    .sidebar .brand { margin-bottom: 1rem; }
    .sidebar nav { display: flex; flex-wrap: wrap; gap: .3rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
