/* ============================================================
   Kalender – modernes Design-System
   ============================================================ */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: #eef2ff;
    --primary-soft-2: #e0e7ff;
    --accent: #7c3aed;
    --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e6e8ee;
    --border-strong: #d4d8e0;

    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;

    --ok-bg: #ecfdf5; --ok-fg: #047857;
    --warn-bg: #fffbeb; --warn-fg: #b45309;
    --err-bg: #fef2f2; --err-fg: #b91c1c;
    --info-bg: #eff6ff; --info-fg: #1d4ed8;

    --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
    --sh-sm: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.08);
    --sh: 0 4px 12px rgba(16,24,40,.06), 0 2px 4px rgba(16,24,40,.04);
    --sh-lg: 0 20px 40px -12px rgba(16,24,40,.18), 0 8px 16px -8px rgba(16,24,40,.10);
    --ring: 0 0 0 4px var(--primary-soft-2);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { letter-spacing: -0.015em; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    width: 256px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.app-main { flex: 1; min-width: 0; }
.app-content { padding: 36px 44px; max-width: 1120px; margin: 0 auto; }

.brand { display: flex; align-items: center; gap: 11px; margin: 4px 6px 22px; }
.brand-logo {
    width: 34px; height: 34px; border-radius: 10px; background: var(--grad);
    display: grid; place-items: center; color: #fff; box-shadow: var(--sh-sm);
}
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }

.btn-create {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    text-decoration: none; background: var(--grad); color: #fff; font-weight: 600;
    padding: 11px 16px; border-radius: 12px; margin-bottom: 24px;
    box-shadow: 0 6px 16px -6px rgba(99,102,241,.6); transition: transform .12s ease, box-shadow .12s ease;
}
.btn-create:hover { text-decoration: none; color: #fff; transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(99,102,241,.7); }

.nav-list { display: flex; flex-direction: column; gap: 3px; }
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px; text-decoration: none;
    color: var(--text-2); font-size: 14.5px; font-weight: 500; transition: background .12s ease, color .12s ease;
}
.nav-link:hover { background: #f1f5f9; text-decoration: none; color: var(--text); }
.nav-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-link.active .nav-ic svg { stroke: var(--primary); }
.nav-ic { width: 20px; height: 20px; display: inline-flex; }
.nav-ic svg { width: 20px; height: 20px; stroke: currentColor; }

.nav-bottom { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.nav-user {
    display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted);
    margin-bottom: 10px; padding: 4px 6px; word-break: break-all;
}
.nav-avatar {
    width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft-2); color: var(--primary);
    display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; text-transform: uppercase;
}
.btn-logout {
    background: none; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px;
    cursor: pointer; width: 100%; color: var(--text-2); font-weight: 500; font-size: 13.5px; transition: background .12s;
}
.btn-logout:hover { background: #f1f5f9; }

/* ---------- Headings ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
.page-head h1 { font-size: 28px; margin: 0; font-weight: 700; }
.page-sub { color: var(--muted); margin: 6px 0 0; font-size: 15px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
    padding: 10px 16px; border-radius: 10px; font-weight: 600; cursor: pointer;
    text-decoration: none; font-size: 14px; font-family: inherit; transition: all .12s ease; white-space: nowrap;
}
.btn:hover { background: #f8fafc; border-color: var(--border-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px -4px rgba(79,70,229,.5); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-danger { color: var(--err-fg); border-color: #fecaca; background: #fff; }
.btn-danger:hover { background: var(--err-bg); border-color: #fca5a5; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; margin-bottom: 18px; box-shadow: var(--sh-sm); }
.card h3 { margin: 0 0 16px; font-size: 17px; font-weight: 700; }

/* event type cards */
.et-card {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--sh-sm);
    position: relative; overflow: hidden; transition: box-shadow .15s ease, transform .15s ease;
}
.et-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent); }
.et-card:hover { box-shadow: var(--sh); transform: translateY(-1px); }
.et-title { font-weight: 700; font-size: 17px; margin: 0 0 5px; }
.et-meta { color: var(--muted); font-size: 14px; margin: 0; }
.et-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 20px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 7px; font-size: 14px; color: var(--text-2); }
.form-row .hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.input, .select, .textarea, .form-control {
    width: 100%; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 10px;
    font-size: 14.5px; font-family: inherit; color: var(--text); background: #fff; transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus, .form-control:focus {
    outline: none; border-color: var(--primary); box-shadow: var(--ring);
}
.textarea { resize: vertical; }
.inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.inline .form-row { flex: 1; min-width: 120px; margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); vertical-align: -2px; margin-right: 6px; }
input[type="color"] { padding: 4px; height: 42px; cursor: pointer; }

/* ---------- Badges / alerts ---------- */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge-off { background: #f1f5f9; color: var(--muted); }

.alert { padding: 13px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 14px; font-weight: 500; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok-fg); border-color: #a7f3d0; }
.alert-error { background: var(--err-bg); color: var(--err-fg); border-color: #fecaca; }
.alert-info { background: var(--info-bg); color: var(--info-fg); border-color: #bfdbfe; }

.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty p { font-size: 15px; margin-bottom: 18px; }

table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th, table.tbl td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
table.tbl th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
table.tbl tr:last-child td { border-bottom: none; }
code { background: #f1f5f9; border-radius: 6px; padding: 2px 7px; font-size: 13px; font-family: 'JetBrains Mono', Consolas, monospace; }

/* ============================================================
   Auth (Login / Registrierung)
   ============================================================ */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px;
    background: radial-gradient(1200px 600px at 50% -10%, #eef2ff 0%, var(--bg) 55%); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-xl); box-shadow: var(--sh-lg); padding: 36px 34px; }
.auth-brand { display: flex; align-items: center; gap: 11px; justify-content: center; margin-bottom: 22px; }
.auth-brand .brand-name { font-size: 20px; }
.auth-card h1, .auth-card h2 { text-align: center; }
.auth-card h1 { font-size: 22px; margin: 0 0 4px; }
.auth-card h2 { font-size: 15px; font-weight: 500; color: var(--muted); margin: 0 0 24px; }
.auth-card hr { display: none; }
.auth-card .row { display: block; margin: 0; }
.auth-card .col-md-4, .auth-card .col-md-6 { width: 100%; max-width: 100%; flex: none; padding: 0; }
/* Externe-Login-Sektion (leer) ausblenden */
.auth-card .col-md-6.col-md-offset-2 { display: none; }
.auth-card h3 { display: none; }

/* Bootstrap form-floating an unser System angleichen */
.form-floating { position: relative; margin-bottom: 16px; }
.form-floating > .form-control { height: 52px; padding: 20px 13px 6px; }
.form-floating > label { position: absolute; top: 0; left: 0; padding: 15px 13px; color: var(--muted);
    pointer-events: none; transform-origin: 0 0; transition: .1s ease; font-size: 14.5px; }
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label { transform: scale(.8) translateY(-9px); color: var(--primary); }
.btn-lg { padding: 12px 16px; font-size: 15px; border-radius: 12px; }
.w-100 { width: 100%; }
.text-danger { color: var(--err-fg); font-size: 13px; }
.checkbox label { font-size: 14px; color: var(--text-2); }
.auth-links { margin-top: 18px; text-align: center; font-size: 14px; }
.auth-links p { margin: 6px 0; }

/* ============================================================
   Öffentliche Buchung
   ============================================================ */
.pub-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 40px 16px; background: radial-gradient(1200px 600px at 50% -10%, #eef2ff 0%, var(--bg) 55%); }
.pub-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
    box-shadow: var(--sh-lg); width: 100%; max-width: 960px; overflow: hidden; }
.pub-foot { color: var(--muted); font-size: 13px; margin-top: 18px; }
.pub-foot strong { color: var(--text-2); }

.book { display: grid; grid-template-columns: 340px 1fr; min-height: 540px; }
.book-info { padding: 34px; border-right: 1px solid var(--border); background: linear-gradient(180deg, #fbfcfe, #fff); }
.book-org { color: var(--muted); font-size: 14px; font-weight: 500; }
.book-title { font-size: 26px; font-weight: 700; margin: 8px 0 20px; letter-spacing: -0.02em; }
.book-detail { display: flex; align-items: center; gap: 9px; color: var(--text-2); font-size: 14.5px; margin-bottom: 11px; }
.book-main { padding: 34px; }
.book-main h3 { margin: 0 0 18px; font-size: 18px; }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head strong { font-size: 15px; text-transform: capitalize; }
.cal-nav { background: #f1f5f9; border: none; cursor: pointer; font-size: 18px; color: var(--primary);
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; transition: background .12s; }
.cal-nav:hover:not(:disabled) { background: var(--primary-soft); }
.cal-nav:disabled { color: #cbd5e1; cursor: default; background: #f8fafc; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow { text-align: center; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 6px 0; text-transform: uppercase; }
.cal-day { aspect-ratio: 1; border: none; background: none; border-radius: 50%; font-size: 14px; cursor: pointer;
    color: var(--text); font-weight: 500; transition: background .12s, transform .1s; }
.cal-day.free { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.cal-day.free:hover { background: var(--primary-soft-2); transform: scale(1.06); }
.cal-day.sel { background: var(--primary); color: #fff; box-shadow: 0 4px 10px -3px rgba(79,70,229,.6); }
.cal-day.empty { color: #cbd5e1; cursor: default; }

.tz-row { margin-top: 20px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.tz-row .select { display: inline-block; width: auto; padding: 7px 10px; font-size: 13px; }
.slots { display: flex; flex-direction: column; gap: 10px; max-height: 440px; overflow-y: auto; padding-right: 8px; }
.slot { border: 1.5px solid var(--primary); color: var(--primary); background: #fff; border-radius: 10px;
    padding: 13px; font-weight: 600; cursor: pointer; text-align: center; font-size: 15px; transition: all .12s; }
.slot:hover { background: var(--primary); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 14px -6px rgba(79,70,229,.6); }
.book-two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }

@media (max-width: 780px) {
    .book, .book-two, .grid-2 { grid-template-columns: 1fr; }
    .book-info { border-right: none; border-bottom: 1px solid var(--border); }
    .app-content { padding: 22px 18px; }
}
