/* Literaturschiff – Sitzplatzreservierung */
:root {
  --ink: #14213d;
  --ink-2: #3a4560;
  --muted: #6b7388;
  --paper: #f5f0e6;
  --card: #ffffff;
  --line: #e6dfd1;
  --gold: #f2b632;
  --gold-d: #d99a12;
  --cat-A: #0e6e6e;
  --cat-B: #d2693a;
  --cat-C: #6b3a14;
  --danger: #b3261e;
  --ok: #1d7a4a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20,33,61,.06), 0 8px 28px rgba(20,33,61,.08);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--sans); color: var(--ink); background: var(--paper); }
a { color: inherit; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------- Hero */
.hero { position: relative; background: radial-gradient(1200px 400px at 80% -10%, #2b3d66 0%, transparent 60%), var(--ink); color: #fff; }
.hero-inner { max-width: 1440px; margin: 0 auto; padding: 34px 28px 54px; display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.brand { display: flex; gap: 16px; align-items: center; }
.mark { width: 52px; height: 52px; flex: none; border-radius: 14px; background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M4 19h24l-3.5 6.5h-17z' fill='%2314213d'/%3E%3Cpath d='M9 19v-7h10v7M19 14.5h5V19' fill='none' stroke='%2314213d' stroke-width='2'/%3E%3Cpath d='M12 9V5h4v4' fill='none' stroke='%2314213d' stroke-width='1.6'/%3E%3C/svg%3E") center/34px no-repeat; box-shadow: 0 6px 20px rgba(242,182,50,.3); }
.hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 4vw, 46px); line-height: 1.05; margin: 2px 0 4px; letter-spacing: .2px; }
.kicker { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; color: var(--gold); font-weight: 600; }
.hero .info { color: #c9d3e6; font-size: 15px; }
.steps { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; flex-wrap: wrap; }
.steps li { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 6px 14px 6px 6px; font-size: 13.5px; color: #e6ebf5; }
.steps b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--ink); font-size: 12px; margin-right: 6px; }
.waves { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 34px; fill: var(--paper); }

/* ------------------------------------------------------------ Layout */
.layout { max-width: 1440px; margin: -18px auto 0; padding: 0 28px 40px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; position: relative; }
.plan-card, .cart, .card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.plan-card { padding: 16px 16px 10px; min-width: 0; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px 20px; flex-wrap: wrap; padding: 2px 4px 12px; }
.segmented { display: inline-flex; background: #f1ece2; border-radius: 12px; padding: 4px; gap: 4px; }
.segmented button { position: relative; border: 0; background: transparent; padding: 8px 18px; border-radius: 9px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 128px; transition: background .2s, box-shadow .2s; }
.segmented button span { font-weight: 600; }
.segmented button small { color: var(--muted); font-size: 12px; }
.segmented button em { position: absolute; top: 6px; right: 8px; font-style: normal; background: var(--gold); color: var(--ink); font-weight: 700; font-size: 11px; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; }
.segmented button[aria-selected="true"] { background: #fff; box-shadow: 0 1px 3px rgba(20,33,61,.12); }
.segmented button:hover:not([aria-selected="true"]) { background: rgba(255,255,255,.6); }

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; font-size: 13px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend b { color: var(--ink); }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; flex: none; }
.sw.cat-A, .dot.cat-A { background: var(--cat-A); }
.sw.cat-B, .dot.cat-B { background: var(--cat-B); }
.sw.cat-C, .dot.cat-C { background: var(--cat-C); }
.sw.sel { background: var(--gold); box-shadow: inset 0 0 0 2px var(--ink); }
.sw.pend { background: repeating-linear-gradient(45deg, #e7e2d8 0 3px, #cbc4b6 3px 5px); }

.plan-scroll { overflow-x: auto; overflow-y: hidden; border-radius: 10px; background: linear-gradient(#eaf1f4, #e2ebef); -webkit-overflow-scrolling: touch; }
#plan { display: block; width: 100%; min-width: 980px; height: auto; user-select: none; -webkit-user-select: none; }
.swipe { display: none; }
.hint { font-size: 12.5px; color: var(--muted); margin: 10px 4px 2px; }

/* SVG-Elemente */
#plan .hull { fill: url(#deckwood); stroke: #8a95a8; stroke-width: 2.5; }
#plan .hull-shadow { fill: rgba(20,33,61,.07); }
#plan .centerline { stroke: #d6cdbb; stroke-width: 1.5; stroke-dasharray: 14 8; }
#plan .house { fill: #ece5d6; stroke: #bfb49e; stroke-width: 1.5; }
#plan .octagon { fill: #f8f4ec; stroke: #bfb49e; stroke-width: 1.5; }
#plan .stairs line { stroke: #bfb49e; stroke-width: 1.5; }
#plan .stage { fill: var(--ink); }
#plan .stage-label { fill: #fff; font: 600 20px var(--serif); text-anchor: middle; dominant-baseline: middle; letter-spacing: .1em; }
#plan .deck-label { fill: #a99e88; text-anchor: middle; font-family: var(--serif); }
#plan .deck-label.big { font-size: 30px; fill: #b9ae98; }
#plan .deck-label.small { font: 600 11px var(--sans); letter-spacing: .12em; text-transform: uppercase; }
#plan .table { fill: #c9c2b4; stroke: #b3ab9b; stroke-width: 1; }

#plan .seat { cursor: pointer; outline: none; }
#plan .seat rect { transition: transform .15s ease, fill .15s; transform-box: fill-box; transform-origin: center; stroke: rgba(0,0,0,.12); stroke-width: 1; }
#plan .seat text { fill: #fff; font: 700 9.5px var(--sans); text-anchor: middle; pointer-events: none; letter-spacing: -.2px; }
#plan .seat.cat-A rect { fill: var(--cat-A); }
#plan .seat.cat-B rect { fill: var(--cat-B); }
#plan .seat.cat-C rect { fill: var(--cat-C); }
#plan .seat:hover rect, #plan .seat:focus-visible rect { transform: scale(1.18); stroke: var(--ink); stroke-width: 1.5; }
#plan .seat:focus-visible rect { stroke: var(--gold-d); stroke-width: 2.5; }
#plan .seat.selected rect { fill: var(--gold); stroke: var(--ink); stroke-width: 2; }
#plan .seat.selected text { fill: var(--ink); }
#plan .seat.pop rect { animation: pop .3s ease; }
#plan .seat.pending { cursor: not-allowed; }
#plan .seat.pending rect { fill: url(#hatch); stroke: #bdb5a5; }
#plan .seat.pending text { fill: #8f8778; }
#plan .seat.pending:hover rect { transform: none; stroke: #bdb5a5; stroke-width: 1; }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1.18); } }

/* ------------------------------------------------------------- Cart */
.cart { position: sticky; top: 16px; display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.cart-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 6px; }
.cart-head h2 { font: 500 21px var(--serif); margin: 0; }
.cart-body { padding: 6px 20px; overflow-y: auto; flex: 1; }
.cart-foot { padding: 12px 20px 18px; border-top: 1px solid var(--line); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; color: var(--ink-2); }
.cart-total:empty { display: none; }
.cart-total strong { font-size: 20px; color: var(--ink); }
.cart-foot p { margin: 10px 0 0; }
.empty-cart { text-align: center; color: var(--muted); padding: 18px 0 10px; }
.empty-cart svg { width: 74px; fill: #e7e1d4; }
.empty-cart p { margin: 6px 0 0; font-size: 14px; }

.sel-group { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.sel-group:last-child { border-bottom: 0; }
.sel-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.sel-head .muted { margin-left: auto; font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 0; color: #fff; font-weight: 700; font-size: 12.5px; border-radius: 7px; padding: 3px 8px; line-height: 1.4; }
.chip.cat-A { background: var(--cat-A); } .chip.cat-B { background: var(--cat-B); } .chip.cat-C { background: var(--cat-C); }
button.chip { cursor: pointer; }
button.chip i { font-style: normal; opacity: .7; font-weight: 400; }
button.chip:hover i { opacity: 1; }

/* ---------------------------------------------------------- Buttons */
.btn { border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s, transform .05s, opacity .15s; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #22335c; }
.btn.primary:disabled { opacity: .35; cursor: not-allowed; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: #f6f2ea; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.wide { width: 100%; }
.btn.loading { pointer-events: none; opacity: .75; }
.btn.loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; font-size: 13px; }
.icon-btn { border: 0; background: #f1ece2; width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }

/* ---------------------------------------------------------- Dialoge */
dialog.sheet { border: 0; padding: 0; border-radius: 18px; width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px rgba(20,33,61,.35); color: var(--ink); }
dialog.sheet::backdrop { background: rgba(20,33,61,.45); backdrop-filter: blur(3px); }
dialog.sheet[open] { animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.sheet form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.sheet-head h2, .sheet h2 { font: 500 23px var(--serif); margin: 0; }
.sheet-body { padding: 18px 22px; overflow-y: auto; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: #fbf9f5; }
.summary { background: #f8f5ef; border-radius: 12px; padding: 4px 14px; margin-bottom: 18px; }
.sum-total { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.span2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea, .reason textarea, .search input { font: inherit; font-weight: 400; color: var(--ink); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; transition: border-color .15s, box-shadow .15s; width: 100%; }
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .reason textarea:focus, .search input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20,33,61,.1); }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); background: #fff8f7; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--ink); flex: none; }
.check.invalid { color: var(--danger); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { background: #fdecea; color: var(--danger); border-radius: 10px; padding: 10px 12px; margin: 14px 0 0; font-size: 14px; }

.done .center { text-align: center; padding: 34px 30px 28px; }
.done p { color: var(--ink-2); margin: 10px 0 22px; }
.done-icon svg { width: 72px; height: 72px; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.done-icon circle { stroke: var(--ok); stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw .6s ease forwards; }
.done-icon path { stroke: var(--ok); stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .35s .45s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------------------------------------------------- Tooltip/Toast */
.tooltip { position: fixed; z-index: 50; transform: translate(-50%, -100%); background: var(--ink); color: #fff; border-radius: 9px; padding: 7px 11px; font-size: 12.5px; pointer-events: none; display: flex; flex-direction: column; line-height: 1.35; white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.tooltip::after { content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%) rotate(45deg); width: 10px; height: 10px; background: var(--ink); }
.tooltip span { color: #c9d3e6; }
.tooltip em { color: var(--gold); font-style: normal; font-size: 11.5px; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: min(560px, calc(100vw - 32px)); font-size: 14px; animation: rise .25s ease; }
.toast.err { background: #7d1d17; }

.site-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 0 30px; }

/* ------------------------------------------------------------ Mobil */
@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; padding: 0 12px 120px; }
  .hero-inner { padding: 24px 18px 46px; }
  .cart { position: fixed; left: 10px; right: 10px; bottom: 10px; top: auto; z-index: 40; max-height: 58vh; box-shadow: 0 12px 40px rgba(20,33,61,.3); }
  .cart:not(.has-items) .cart-body, .cart:not(.has-items) .cart-head, .cart .cart-foot p { display: none; }
  .cart-head { padding: 12px 16px 0; }
  .cart-body { padding: 4px 16px; }
  .cart-foot { padding: 10px 16px 12px; border-top: 0; display: flex; gap: 12px; align-items: center; }
  .cart-total { margin: 0; flex-direction: column; flex: none; }
  .cart-total strong { font-size: 16px; }
  .segmented button { min-width: 0; padding: 7px 12px; }
  .toast { bottom: 120px; }
  .swipe { display: inline; font-weight: 600; color: var(--ink-2); }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .steps { display: none; }
  .mark { width: 44px; height: 44px; background-size: 28px; }
  .sheet-foot .btn { flex: 1; }
}

/* ============================================================ Verwaltung */
.admin .topbar { background: var(--ink); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 14px 28px; gap: 20px; flex-wrap: wrap; }
.admin .topbar .mark { width: 40px; height: 40px; background-size: 26px; border-radius: 11px; }
.admin .topbar .title { font: 500 20px var(--serif); }
.admin .topbar .sub { font-size: 12px; color: var(--gold); text-transform: uppercase; letter-spacing: .14em; }
.topnav { display: flex; gap: 18px; align-items: center; font-size: 14px; }
.topnav a, .topnav .linkbtn { color: #dbe2f0; text-decoration: none; font-size: 14px; }
.topnav a:hover, .topnav .linkbtn:hover { color: #fff; }
.inline { display: inline; }
.admin-main { max-width: 1100px; margin: 0 auto; padding: 26px 22px 60px; }
.h1 { font: 500 26px var(--serif); margin: 0 0 16px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.flash { background: #e6f4ec; color: var(--ok); padding: 11px 14px; border-radius: 10px; margin-bottom: 18px; font-weight: 500; }
.flash.err { background: #fdecea; color: var(--danger); }
.login { max-width: 380px; margin: 50px auto; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.login code { background: #f1ece2; padding: 1px 5px; border-radius: 4px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { padding: 16px 18px; }
.stat-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.stat-num { font: 500 32px var(--serif); margin: 6px 0 8px; }
.stat-num small { font: 400 14px var(--sans); color: var(--muted); }
.bar { height: 8px; border-radius: 4px; background: #eee8dc; display: flex; overflow: hidden; }
.bar .b { background: var(--ink); } .bar .p { background: var(--gold); }
.stat-foot { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

.tabs { display: flex; gap: 6px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { text-decoration: none; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.tabs a span { background: #e9e3d6; border-radius: 10px; padding: 1px 8px; font-size: 12px; margin-left: 4px; }
.tabs a.active { background: var(--ink); color: #fff; }
.tabs a.active span { background: rgba(255,255,255,.18); }
.tabs .search { margin-left: auto; }
.tabs .search input { padding: 8px 12px; width: 240px; }

.list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }
.empty { color: var(--muted); text-align: center; padding: 30px; background: var(--card); border-radius: var(--radius); }
.res { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border-left: 5px solid var(--line); }
.res.status-pending { border-left-color: var(--gold); }
.res.status-confirmed { border-left-color: var(--ok); }
.res.status-rejected, .res.status-cancelled { border-left-color: #c9c2b4; opacity: .85; }
.res header { display: flex; gap: 10px; align-items: center; padding: 12px 18px 0; }
.res .no { font: 600 17px var(--serif); }
.res .date { margin-left: auto; color: var(--muted); font-size: 13px; }
.badge { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 10px; text-transform: uppercase; letter-spacing: .05em; }
.badge.pending { background: #fdf1d4; color: #8a5d00; }
.badge.confirmed { background: #e2f2e8; color: var(--ok); }
.badge.rejected, .badge.cancelled { background: #eee8dc; color: var(--muted); }
.badge.overdue { background: #fdecea; color: var(--danger); text-transform: none; letter-spacing: 0; }
.badge.manual { background: #e6eaf3; color: var(--ink-2); }
.res-body { display: grid; grid-template-columns: 1fr 1.2fr; gap: 18px; padding: 10px 18px 14px; }
.who { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.who strong { font-size: 16px; }
.who a { color: var(--ink-2); }
.note { background: #f8f5ef; border-radius: 8px; padding: 8px 10px; margin: 8px 0 0; font-size: 13.5px; }
.note.admin { background: #eef1f7; }
.chipline { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-bottom: 6px; }
.chipline .deck { font-size: 12px; color: var(--muted); width: 74px; }
.sum { font-size: 13px; color: var(--ink-2); margin-top: 4px; font-weight: 600; }
.res footer { display: flex; gap: 10px; align-items: flex-start; padding: 12px 18px; background: #fbf9f5; border-top: 1px solid var(--line); flex-wrap: wrap; }
.reason summary { list-style: none; }
.reason summary::-webkit-details-marker { display: none; }
.reason[open] summary { background: #f1ece2; }
.reason form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; width: min(460px, 80vw); }
.manual { padding: 16px 20px; }
.manual summary { cursor: pointer; }
.manual form { margin-top: 16px; }

@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr; }
  .res-body { grid-template-columns: 1fr; }
  .tabs .search { margin-left: 0; width: 100%; }
  .tabs .search input { width: 100%; }
  .admin .topbar { padding: 12px 16px; }
}
