/* ============================================================
   Parkplatz-Buchung – Darkmode mit Glass-Optik
   ============================================================ */
@font-face { font-family: "Inter"; src: url(/fonts/inter-regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-medium.woff) format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-semibold.woff) format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-bold.woff) format("woff"); font-weight: 700 800; font-display: swap; }

:root {
  /* Grundfarben (dunkel ist Standard) */
  --bg: #060a13;
  --blob-1: rgba(37, 84, 220, .38);
  --blob-2: rgba(124, 58, 237, .26);
  --blob-3: rgba(8, 145, 178, .22);
  --glass: rgba(255, 255, 255, .045);
  --glass-2: rgba(255, 255, 255, .075);
  --glass-hover: rgba(255, 255, 255, .1);
  --glass-strong: rgba(14, 20, 34, .78);
  --line: rgba(255, 255, 255, .085);
  --line-strong: rgba(255, 255, 255, .16);
  --highlight: rgba(255, 255, 255, .07);      /* Lichtkante oben an Glasflächen */
  --text: #e9eef8; --muted: #9ba7bf; --faint: #69768f;
  --accent: #6b93ff; --accent-2: #9b7bff;
  --accent-grad: linear-gradient(135deg, #4f7cff 0%, #7c5cff 100%);
  --accent-soft: rgba(107, 147, 255, .14); --on-accent: #ffffff;
  --free: #34d399; --free-soft: rgba(52, 211, 153, .13);
  --half: #fbbf24; --half-soft: rgba(251, 191, 36, .13);
  --taken: #f87171; --taken-soft: rgba(248, 113, 113, .13);
  --fixed: #b39dff; --fixed-soft: rgba(155, 123, 255, .15);
  --blocked: #94a3b8; --blocked-soft: rgba(148, 163, 184, .12);
  --danger: #f87171; --ok: #34d399;
  --pin-free: #10b981; --pin-taken: #ef4444; --pin-mine: #4f7cff; --pin-fixed: #8b5cf6; --pin-blocked: #64748b;
  --radius: 16px; --radius-sm: 11px;
  --blur: blur(20px) saturate(150%);
  --shadow: 0 1px 0 var(--highlight) inset, 0 10px 30px -12px rgba(0, 0, 0, .55);
  --shadow-lg: 0 1px 0 var(--highlight) inset, 0 30px 80px -20px rgba(0, 0, 0, .7);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI Variable", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef2f9;
  --blob-1: rgba(79, 124, 255, .22); --blob-2: rgba(155, 123, 255, .18); --blob-3: rgba(34, 211, 238, .16);
  --glass: rgba(255, 255, 255, .62); --glass-2: rgba(255, 255, 255, .8); --glass-hover: rgba(255, 255, 255, .92);
  --glass-strong: rgba(255, 255, 255, .9);
  --line: rgba(15, 23, 42, .08); --line-strong: rgba(15, 23, 42, .16); --highlight: rgba(255, 255, 255, .9);
  --text: #111827; --muted: #556074; --faint: #8590a3;
  --accent: #3d63e8; --accent-soft: rgba(61, 99, 232, .1);
  --free: #059669; --free-soft: rgba(5, 150, 105, .1); --half: #b45309; --half-soft: rgba(217, 119, 6, .12);
  --taken: #dc2626; --taken-soft: rgba(220, 38, 38, .09); --fixed: #7c3aed; --fixed-soft: rgba(124, 58, 237, .1);
  --blocked: #64748b; --blocked-soft: rgba(100, 116, 139, .1); --danger: #dc2626; --ok: #059669;
  --shadow: 0 1px 0 var(--highlight) inset, 0 10px 30px -14px rgba(30, 41, 80, .25);
  --shadow-lg: 0 1px 0 var(--highlight) inset, 0 30px 70px -20px rgba(30, 41, 80, .35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
/* Farbverläufe im Hintergrund – fest, damit beim Scrollen nichts neu gezeichnet wird */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 8% -8%, var(--blob-1), transparent 62%),
    radial-gradient(800px 520px at 100% 0%, var(--blob-2), transparent 60%),
    radial-gradient(900px 600px at 70% 110%, var(--blob-3), transparent 60%);
}
body::after { /* feines Korn gegen Farbstreifen im Verlauf */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: rgba(107, 147, 255, .35); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.015em; }
h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 1.08rem; font-weight: 650; }
h3 { font-size: .93rem; font-weight: 650; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .84rem; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Glasflächen ---------- */
.glass, .card, .side, .topbar, .table-wrap, .stat, .bitem, .mapbox, .datenav {
  background: var(--glass);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.shell > div { min-width: 0; }
.side {
  margin: 14px 0 14px 14px; border-radius: 20px; padding: 16px 12px;
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 14px; height: calc(100vh - 28px); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 18px; }
.brand img { width: 36px; height: 36px; filter: drop-shadow(0 6px 16px rgba(79, 124, 255, .45)); }
.brand b { display: block; font-size: .97rem; font-weight: 700; letter-spacing: -.01em; }
.brand span { display: block; font-size: .77rem; color: var(--muted); }
.nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding: 16px 12px 6px; font-weight: 600; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 11px;
  color: var(--muted); font-weight: 500; font-size: .93rem;
  transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.nav a:hover { background: var(--glass-2); color: var(--text); text-decoration: none; }
.nav a:active { transform: scale(.98); }
.nav a.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent-grad); box-shadow: 0 0 12px rgba(107, 147, 255, .8);
}
.nav a.active svg { color: var(--accent); opacity: 1; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .8; transition: color .25s var(--ease); }
.side-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--line); font-size: .85rem; }
.side-foot .who { font-weight: 600; } .side-foot .role { color: var(--muted); font-size: .78rem; }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: .85rem;
  background: var(--accent-grad); color: #fff; flex: none; box-shadow: 0 6px 18px -6px rgba(79, 124, 255, .7); }
.main { padding: 32px 36px 70px; min-width: 0; max-width: 1320px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.topbar { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 40; left: 0; top: 0; margin: 10px; height: calc(100vh - 20px); width: 272px;
    transform: translateX(calc(-100% - 20px)); transition: transform .38s var(--ease); background: var(--glass-strong); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(2, 6, 15, .5); z-index: 35; animation: fade .3s var(--ease); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; position: sticky; top: 0; z-index: 30;
    border-width: 0 0 1px; border-radius: 0; }
  .topbar img { width: 28px; height: 28px; }
  .topbar b { flex: 1; }
  .main { padding: 20px 14px 60px; }
  h1 { font-size: 1.4rem; }
}

/* ---------- Seitenwechsel ---------- */
.enter > * { animation: rise .5s var(--ease) both; }
.enter > *:nth-child(2) { animation-delay: .04s; }
.enter > *:nth-child(3) { animation-delay: .08s; }
.enter > *:nth-child(4) { animation-delay: .12s; }
.enter > *:nth-child(5) { animation-delay: .16s; }
.enter > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes popout { to { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Bausteine ---------- */
.card { border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.spacer { flex: 1; }

button, .btn {
  font: inherit; font-weight: 550; font-size: .92rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--glass-2); color: var(--text);
  padding: 9px 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; line-height: 1.3;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease), box-shadow .25s var(--ease), opacity .2s;
}
button:hover, .btn:hover { background: var(--glass-hover); border-color: rgba(255, 255, 255, .22); text-decoration: none; }
button:active, .btn:active { transform: scale(.97); }
button svg, .btn svg { width: 18px; height: 18px; flex: none; }
button.primary, .btn.primary {
  background: var(--accent-grad); border-color: transparent; color: var(--on-accent);
  box-shadow: 0 8px 24px -10px rgba(79, 124, 255, .85), inset 0 1px 0 rgba(255, 255, 255, .22);
}
button.primary:hover, .btn.primary:hover { filter: brightness(1.1); box-shadow: 0 10px 30px -10px rgba(110, 120, 255, .95), inset 0 1px 0 rgba(255, 255, 255, .25); }
button.danger { color: var(--danger); border-color: rgba(248, 113, 113, .3); background: rgba(248, 113, 113, .06); }
button.danger:hover { background: var(--taken-soft); border-color: rgba(248, 113, 113, .5); }
button.ghost { border-color: transparent; background: transparent; }
button.ghost:hover { background: var(--glass-2); }
button.small, .btn.small { padding: 6px 11px; font-size: .84rem; border-radius: 9px; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.icon-btn { padding: 7px; }

label.field { display: block; }
label.field > span { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  font: inherit; color: var(--text); background: rgba(0, 0, 0, .18); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 9px 12px; width: 100%;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
:root[data-theme="light"] input, :root[data-theme="light"] select, :root[data-theme="light"] textarea { background: rgba(255, 255, 255, .7); }
input:hover, select:hover { border-color: rgba(255, 255, 255, .24); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(107, 147, 255, .18); }
input::placeholder { color: var(--faint); }
input[disabled], select[disabled] { opacity: .6; }
select option { background: #121a2b; color: var(--text); }
:root[data-theme="light"] select option { background: #fff; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; padding: 0; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.8); cursor: pointer; opacity: .7; }
:root[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator { filter: none; }
.check { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 2px; flex: none; }
.hint { font-size: .79rem; color: var(--faint); margin-top: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 16px; }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: 99px;
  background: var(--glass-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag.ok { background: var(--free-soft); color: var(--free); border-color: transparent; }
.tag.warn { background: var(--half-soft); color: var(--half); border-color: transparent; }
.tag.bad { background: var(--taken-soft); color: var(--taken); border-color: transparent; }
.tag.info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag.violet { background: var(--fixed-soft); color: var(--fixed); border-color: transparent; }
.plate {
  font-family: var(--mono); font-weight: 700; letter-spacing: .05em; font-size: .86rem; white-space: nowrap;
  background: linear-gradient(#fff, #eef0f3); color: #0b0f17; border: 1.5px solid #1b1f27; border-left: 8px solid #2747c7;
  border-radius: 5px; padding: 1px 8px; box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 650; background: rgba(255, 255, 255, .025); }
tbody tr { transition: background .2s var(--ease); }
tr.click { cursor: pointer; } tr.click:hover td, tbody tr:hover td { background: rgba(255, 255, 255, .035); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table-wrap table tr:last-child td { border-bottom: 0; }
.empty { padding: 34px; text-align: center; color: var(--muted); }

/* ---------- Buchen ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.datenav { display: inline-flex; align-items: center; gap: 2px; border-radius: 13px; padding: 3px; }
.datenav button { border: 0; background: transparent; padding: 7px 9px; border-radius: 9px; }
.datenav button:hover { background: var(--glass-2); }
.datenav input { border: 0; width: auto; padding: 6px 4px; background: transparent; box-shadow: none; }
.daylabel { font-weight: 650; font-size: 1.05rem; letter-spacing: -.01em; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin: 12px 2px 0; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.map-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.map-tabs button.on { background: var(--accent-soft); color: var(--text); border-color: rgba(107, 147, 255, .4); }

.mapbox { position: relative; border-radius: var(--radius); overflow: auto; max-height: 74vh; padding: 0; }
.mapinner { position: relative; width: 100%; transition: width .35s var(--ease); }
.mapinner img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; pointer-events: none; border-radius: calc(var(--radius) - 1px); }
.grid-placeholder { aspect-ratio: 16 / 9;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 5% 8.888%; }
.zoom { position: sticky; float: right; top: 10px; right: 10px; margin: 10px 10px -50px 0; z-index: 5; display: flex; gap: 4px; }
.zoom button { background: var(--glass-strong); padding: 6px 12px; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }

.pin {
  position: absolute; transform: translate(-50%, -50%); min-width: 36px; height: 30px; padding: 0 8px; border-radius: 9px;
  border: 1.5px solid rgba(255, 255, 255, .85); display: flex; align-items: center; justify-content: center; gap: 3px;
  font-weight: 700; font-size: .82rem; color: #fff; cursor: pointer; white-space: nowrap; touch-action: none; line-height: 1;
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, .55);
  transition: transform .22s var(--ease), box-shadow .3s var(--ease), filter .2s, background .3s var(--ease);
  animation: pinIn .45s var(--ease) both;
}
@keyframes pinIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.6); } }
.pin:hover { transform: translate(-50%, -50%) scale(1.12); z-index: 3; filter: brightness(1.1); }
.pin:active { transform: translate(-50%, -50%) scale(1.02); }
.pin.free { background: var(--pin-free); box-shadow: 0 6px 18px -4px rgba(16, 185, 129, .65); }
.pin.partial { background: linear-gradient(90deg, var(--pin-free) 50%, var(--pin-taken) 50%); }
.pin.partial.pm-free { background: linear-gradient(90deg, var(--pin-taken) 50%, var(--pin-free) 50%); }
.pin.taken { background: var(--pin-taken); box-shadow: 0 6px 18px -6px rgba(239, 68, 68, .6); }
.pin.mine { background: var(--accent-grad); box-shadow: 0 0 0 3px rgba(107, 147, 255, .45), 0 0 26px rgba(107, 147, 255, .75); animation: pinIn .45s var(--ease) both, glow 2.4s ease-in-out .5s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 5px rgba(107, 147, 255, .25), 0 0 34px rgba(124, 92, 255, .9); } }
.pin.blocked { background: repeating-linear-gradient(135deg, #64748b 0 5px, #475569 5px 10px); border-color: rgba(255, 255, 255, .5); }
.pin.fixed { background: var(--pin-fixed); box-shadow: 0 6px 18px -6px rgba(139, 92, 246, .7); }
.pin.selected { box-shadow: 0 0 0 3px #facc15, 0 0 24px rgba(250, 204, 21, .6); z-index: 4; }
.pin .k { font-size: .7rem; opacity: .95; }
.editing .pin { cursor: grab; animation: none; }
.editing .pin.dragging { cursor: grabbing; transition: none; transform: translate(-50%, -50%) scale(1.15); z-index: 6; }
.mapinner.adding { cursor: crosshair; }
.mapinner.adding::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px rgba(107, 147, 255, .7); pointer-events: none; animation: fade .3s; }

.spotlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); gap: 8px; margin-top: 16px; }
.spotchip {
  border: 1px solid var(--line); background: var(--glass); border-radius: 12px; padding: 9px 11px; cursor: pointer; text-align: left; display: block; width: 100%;
  transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.spotchip:hover { transform: translateY(-2px); background: var(--glass-2); border-color: var(--line-strong); }
.spotchip b { display: flex; justify-content: space-between; align-items: center; font-size: .95rem; }
.spotchip small { display: block; color: var(--muted); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.free { background: var(--pin-free); box-shadow: 0 0 8px var(--pin-free); }
.dot.partial { background: linear-gradient(90deg, var(--pin-free) 50%, var(--pin-taken) 50%); }
.dot.taken { background: var(--pin-taken); } .dot.mine { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dot.blocked { background: var(--pin-blocked); } .dot.fixed { background: var(--pin-fixed); }

.summary { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { border-radius: var(--radius); padding: 14px 18px; min-width: 130px; position: relative; overflow: hidden; }
.stat b { font-size: 1.6rem; display: block; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--muted); }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--c, transparent); filter: blur(30px); opacity: .35; }

.halves { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.half { border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; transition: background .3s var(--ease); }
.half .t { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; margin-bottom: 2px; }
.half.is-free { background: var(--free-soft); border-color: rgba(52, 211, 153, .25); }
.half.is-free b { color: var(--free); }
.half.is-taken { background: var(--taken-soft); border-color: rgba(248, 113, 113, .22); }
.half.is-mine { background: var(--accent-soft); border-color: rgba(107, 147, 255, .35); }
.half.is-blocked { background: var(--blocked-soft); }

/* ---------- Buchungsliste ---------- */
.blist { display: flex; flex-direction: column; gap: 10px; }
.bitem { display: flex; align-items: center; gap: 16px; border-radius: var(--radius); padding: 14px 16px; transition: transform .2s var(--ease), background .2s; }
.bitem:hover { transform: translateX(3px); background: var(--glass-2); }
.bdate { width: 56px; text-align: center; flex: none; border-right: 1px solid var(--line); padding-right: 14px; }
.bdate b { display: block; font-size: 1.5rem; line-height: 1.05; font-weight: 700; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bdate span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.bitem .info { flex: 1; min-width: 0; }

/* ---------- Kennzeichen ---------- */
.bigsearch { font-size: 1.55rem; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 16px 18px; border-width: 1.5px; border-radius: 14px; }
.hit { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.verdict { border-radius: var(--radius); padding: 15px 18px; font-weight: 650; display: flex; gap: 10px; align-items: center; animation: rise .35s var(--ease); border: 1px solid transparent; }
.verdict.ok { background: var(--free-soft); color: var(--free); border-color: rgba(52, 211, 153, .25); }
.verdict.bad { background: var(--taken-soft); color: var(--taken); border-color: rgba(248, 113, 113, .25); }
.verdict.warn { background: var(--half-soft); color: var(--half); border-color: rgba(251, 191, 36, .25); }
#res .card { animation: rise .35s var(--ease) both; }

/* ---------- Rollenmatrix ---------- */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; min-width: 260px; }
.matrix .grp td { background: rgba(255, 255, 255, .03); font-weight: 650; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); text-align: left; }
.matrix th .rname { text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--text); display: block; font-weight: 650; }
.matrix th .rmeta { text-transform: none; letter-spacing: 0; font-weight: 500; }
.matrix label { display: inline-flex; padding: 6px; cursor: pointer; }
/* Schalter statt Kästchen in der Matrix */
.matrix input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 99px; position: relative;
  background: rgba(255, 255, 255, .1); border: 1px solid var(--line-strong); transition: background .25s var(--ease), border-color .25s; }
.matrix input[type="checkbox"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #cbd5e1; box-shadow: 0 2px 5px rgba(0, 0, 0, .4); transition: transform .28s var(--ease), background .25s; }
.matrix input[type="checkbox"]:checked { background: var(--accent-grad); border-color: transparent; }
.matrix input[type="checkbox"]:checked::after { transform: translateX(16px); background: #fff; }
.matrix input[type="checkbox"]:disabled { opacity: .45; cursor: default; }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .editor { grid-template-columns: minmax(0, 1fr); } }
.panel { position: sticky; top: 18px; }
.panel .card { animation: rise .35s var(--ease) both; }

/* ---------- Diagramm ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 170px; padding-top: 10px; border-bottom: 1px solid var(--line); }
.bar { flex: 1; min-width: 4px; background: var(--accent-grad); border-radius: 4px 4px 1px 1px; transform-origin: bottom; animation: grow .7s var(--ease) both; transition: filter .2s; }
.bar:hover { filter: brightness(1.3); }
.bar.future { background: linear-gradient(rgba(107, 147, 255, .45), rgba(124, 92, 255, .3)); }
.bar.weekend { background: var(--line-strong); }
.bar.today { box-shadow: 0 0 0 2px var(--half), 0 0 14px rgba(251, 191, 36, .6); }
@keyframes grow { from { transform: scaleY(0); } }
.bars-x { display: flex; justify-content: space-between; font-size: .74rem; color: var(--faint); margin-top: 6px; }

/* ---------- Dialog / Toast ---------- */
dialog {
  border: 1px solid var(--line-strong); border-radius: 20px; padding: 0; width: min(530px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
  background: var(--glass-strong); color: var(--text); box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(28px) saturate(160%); backdrop-filter: blur(28px) saturate(160%);
}
dialog[open] { animation: pop .34s var(--ease); }
dialog.closing { animation: popout .18s ease-in forwards; }
dialog.wide { width: min(780px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(2, 6, 15, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .3s var(--ease); }
dialog.closing::backdrop { opacity: 0; transition: opacity .18s; }
.dlg-head { padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dlg-body { padding: 14px 22px; }
.dlg-foot { padding: 12px 22px 20px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.err { background: var(--taken-soft); color: var(--taken); border: 1px solid rgba(248, 113, 113, .25); border-radius: 11px; padding: 10px 13px; font-size: .9rem; margin-top: 10px; animation: rise .3s var(--ease); }
.notice { background: var(--accent-soft); border: 1px solid rgba(107, 147, 255, .22); color: var(--text); border-radius: 12px; padding: 11px 14px; font-size: .9rem; }
.notice.warn { background: var(--half-soft); border-color: rgba(251, 191, 36, .25); }
.secret { font-family: var(--mono); font-size: 1.1rem; background: rgba(0, 0, 0, .25); border: 1px dashed var(--line-strong); padding: 12px 14px; border-radius: 12px; user-select: all; word-break: break-all; }
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--glass-strong); color: var(--text); padding: 11px 18px 11px 14px; border-radius: 13px; font-size: .9rem; max-width: 90vw;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  animation: toastIn .4s var(--ease);
}
.toast::before { content: "✓"; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; background: var(--free-soft); color: var(--free); flex: none; }
.toast.bad::before { content: "!"; background: var(--taken-soft); color: var(--taken); }
.toast.out { animation: toastOut .3s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.96); } }

/* ---------- Anmeldung ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: min(410px, 100%); animation: pop .6s var(--ease); }
.login .brand { padding: 0 0 22px; justify-content: center; }
.login .brand img { width: 52px; height: 52px; }
.login .brand b { font-size: 1.25rem; }
.login .card { padding: 26px; border-radius: 22px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: .78rem; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.ms-btn { width: 100%; justify-content: center; padding: 12px; }
.ms-logo { width: 18px; height: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ms-logo i:nth-child(1) { background: #f25022; } .ms-logo i:nth-child(2) { background: #7fba00; }
.ms-logo i:nth-child(3) { background: #00a4ef; } .ms-logo i:nth-child(4) { background: #ffb900; }

/* ---------- Handy ---------- */
@media (max-width: 860px) {
  .mapinner { min-width: 820px; }
  .mapbox { max-height: 62vh; }
  .pin { min-width: 30px; height: 26px; font-size: .76rem; padding: 0 5px; }
  .summary { gap: 8px; }
  .summary .stat { flex: 1 1 0; min-width: 0; padding: 10px 12px; }
  .summary .stat b { font-size: 1.25rem; }
  .spotlist { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); }
  .hit { grid-template-columns: 1fr; }
  .hit > div:last-child { text-align: left !important; }
  dialog { border-radius: 20px 20px 0 0; margin: auto 0 0; width: 100vw; max-width: 100vw; max-height: 88vh; }
  dialog[open] { animation: sheet .38s var(--ease); }
  dialog.closing { animation: sheetOut .22s ease-in forwards; }
  @keyframes sheet { from { transform: translateY(100%); } }
  @keyframes sheetOut { to { transform: translateY(100%); } }
}

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

/* Weicher Wechsel zwischen Hell und Dunkel */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after { transition: background-color .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease), box-shadow .45s var(--ease) !important; }

/* Helle Parkplan-Bilder im Darkmode etwas abdunkeln, damit sie nicht blenden */
:root:not([data-theme="light"]) .mapinner img { filter: brightness(.8) contrast(1.06) saturate(.9); }

/* Wochentag-Auswahl (wöchentlich reserviert) */
.wdpick { display: flex; gap: 6px; flex-wrap: wrap; }
.wdpick label { cursor: pointer; }
.wdpick input { position: absolute; opacity: 0; pointer-events: none; }
.wdpick span { display: inline-grid; place-items: center; min-width: 38px; height: 34px; padding: 0 8px; border-radius: 10px; font-weight: 600; font-size: .85rem;
  border: 1px solid var(--line-strong); background: var(--glass-2); color: var(--muted); transition: background .2s var(--ease), color .2s, border-color .2s, transform .15s var(--ease); }
.wdpick label:hover span { border-color: rgba(255, 255, 255, .28); color: var(--text); }
.wdpick input:checked + span { background: var(--half-soft); border-color: rgba(251, 191, 36, .55); color: var(--half); }
.wdpick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.wdpick input:disabled + span { opacity: .55; cursor: default; }
.wdpick label:active span { transform: scale(.94); }
