:root {
  --bg: #0B1220; --panel: #121B2E; --panel2: #0E1628; --line: #1F2A40; --line2: #26324A;
  --text: #EEF2F7; --muted: #9AA6B8; --soft: #C4CDDA;
  --ball: #D8F34A; --clay: #C8643B; --clay-dark: #4A2E24; --warn: #FF8A3D; --green: #16301F;
  --r: 14px;
  --font: Inter, system-ui, -apple-system, sans-serif;
  --display: 'Space Grotesk', Inter, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
a { color: var(--ball); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--ball); outline-offset: 2px; }
.boot { display: grid; place-items: center; min-height: 100dvh; color: var(--muted); }

.wrap { max-width: 560px; margin: 0 auto; padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.wide { max-width: 1240px; }
h1 { font-family: var(--display); font-size: 28px; line-height: 1.1; margin: 0; }
h2 { font-family: var(--display); font-size: 20px; margin: 4px 0 0; }
.sub { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.card.hl { border-color: var(--ball); }
.card.warn { border-color: var(--warn); }
.kpi { font-family: var(--display); font-weight: 700; font-size: 28px; }

.btn { height: 50px; border-radius: var(--r); border: 0; background: var(--ball); color: var(--bg); font-weight: 700; font-size: 15px; padding: 0 18px; }
.btn.sec { background: transparent; border: 1px solid var(--line2); color: var(--text); font-weight: 600; }
.btn.sm { height: 40px; font-size: 13px; padding: 0 12px; }
.btn.block { width: 100%; }
.btn.danger { background: var(--warn); color: #1a0f0a; }
.iconbtn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line2); background: var(--panel); display: inline-grid; place-items: center; position: relative; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--warn); color: #1a0f0a; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }

label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input.in, select.in, textarea.in { height: 48px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); padding: 0 14px; font-size: 16px; width: 100%; }
textarea.in { height: 120px; padding: 10px 14px; font-size: 13px; font-family: ui-monospace, monospace; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 4px; border-radius: var(--r); background: var(--panel); }
.seg button { height: 42px; border-radius: 10px; border: 0; background: transparent; color: var(--soft); font-weight: 700; font-size: 14px; }
.seg button.on { background: var(--ball); color: var(--bg); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-width: 58px; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel); font-weight: 600; font-size: 14px; display: flex; flex-direction: column; justify-content: center; align-items: center; line-height: 1.1; }
.chip small { font-size: 10px; color: var(--muted); font-weight: 500; }
.chip.on { background: var(--ball); color: var(--bg); border-color: var(--ball); }
.chip.on small { color: var(--bg); }

/* Plätze in 3D */
.plane-wrap { perspective: 900px; padding: 0 6px; }
.plane { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; transform: rotateX(42deg) scale(.96); transform-origin: 50% 80%; padding: 14px; border-radius: 18px; background: var(--green); }
.tile { position: relative; height: 140px; border: 0; border-radius: 6px; padding: 0; background: var(--clay); box-shadow: 0 10px 0 rgba(0,0,0,.35); color: #1A0F0A; }
.tile.indoor { background: #3B6EA8; color: #fff; }
.tile.busy { background: var(--clay-dark); color: #C4A89C; }
.tile.mine { outline: 3px solid var(--ball); outline-offset: 3px; }
.tile .l1 { position: absolute; inset: 9px; border: 2px solid rgba(255,255,255,.85); border-radius: 2px; }
.tile .l2 { position: absolute; left: 20px; right: 20px; top: 36px; bottom: 36px; border-left: 2px solid rgba(255,255,255,.65); border-right: 2px solid rgba(255,255,255,.65); }
.tile .net { position: absolute; left: 3px; right: 3px; top: calc(50% - 1px); height: 3px; background: #EEF2F7; }
.tile .num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 26px; }
.tile .tag { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 8px; background: var(--bg); color: var(--text); white-space: nowrap; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.list-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); text-align: left; }
.av { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 17px; display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--line2); }
.av.on { background: var(--ball); color: var(--bg); }
.grow { flex: 1 1 auto; min-width: 0; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 9px; background: #1C2740; color: var(--ball); white-space: nowrap; }
.pill.grey { color: var(--soft); background: var(--line2); }
.pill.warn { color: #1a0f0a; background: var(--warn); }
.dot { width: 10px; height: 10px; border-radius: 5px; display: inline-block; flex: 0 0 10px; }

nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #0E1628; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
nav.tabs button { height: 66px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
nav.tabs button.on { color: var(--ball); }

.sheet-bg { position: fixed; inset: 0; background: rgba(5,9,18,.6); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto; background: var(--panel); border-radius: 22px 22px 0 0; border-top: 1px solid var(--line2); padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.grab { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: #33415C; }

#toast { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -200%); opacity: 0; pointer-events: none; transition: transform .25s ease, opacity .25s ease; background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; z-index: 60; max-width: 92vw; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
#toast.show { transform: translate(-50%, 0); opacity: 1; }

.stepper { display: grid; grid-template-columns: 1fr repeat(3, 58px); gap: 6px; align-items: center; }
.stepper .cell { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stepper .cell button { width: 44px; height: 28px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel2); }
.stepper .val { font-family: var(--display); font-weight: 700; font-size: 22px; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
table.t td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.scroll-x { overflow-x: auto; }

/* Rezeption */
.rc-grid { display: grid; gap: 6px; }
.rc-cell { border-radius: 10px; padding: 7px 8px; min-height: 52px; font-size: 12px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.rc-free { border: 1px dashed var(--line2); color: var(--muted); }
.rc-booked { background: var(--clay); color: #1A0F0A; }
.rc-in { background: #1F6B3A; color: #fff; }
.rc-late { background: #FFE3CC; color: #4A2A17; outline: 1px solid #9A3D12; }
.rc-head { font-weight: 700; font-size: 13px; color: var(--soft); text-align: center; }
.rc-time { font-weight: 700; font-size: 13px; color: var(--muted); padding-top: 6px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } .plane { transform: none; } }
.legal { padding-bottom: 48px; line-height: 1.55; font-size: 15px; }
.legal ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.legal p { margin: 0; }
