/* ============================================================
   ReservationFlow – Premium Design System
   Dunkel, ruhig, edel. Tiefschwarz/Anthrazit-Flächen, warmes
   Off-White, dezente Bronze-/Gold-Akzente. Alles token-getrieben.
   ============================================================ */

/* ---------- Schriften (selbst-gehostet, kein externer Request) ---------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Cormorant';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/cormorant-latin-wght-normal.woff2') format('woff2-variations');
}

/* ---------- Design-Tokens ---------- */
:root {
  color-scheme: dark;

  /* Flächen – Tiefschwarz → Anthrazit → Dunkelgrau */
  --bg: #0c0d10;
  --bg-2: #0f1114;
  --surface: #15171c;
  --surface-2: #1c1f26;
  --surface-3: #23272f;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .13);

  /* Text – warmes Off-White, ruhig abgestuft */
  --text: #ece8e1;
  --text-soft: #a4a099;
  --grau: #a4a099;
  --muted: #6f6d67;

  /* Akzent – Bronze / Gold */
  --gold: #c8a56a;
  --gold-soft: #dcc294;
  --gold-strong: #b48f4f;
  --gold-dim: rgba(200, 165, 106, .12);
  --gold-line: rgba(200, 165, 106, .32);
  --sand: #cabfa2;

  /* Semantische Status – gedämpft, edel */
  --frei: #5aa585;
  --reserviert: #d2a250;
  --besetzt: #d0685f;
  --primär: var(--gold);
  --primär-dunkel: var(--gold-strong);

  /* Radien / Schatten / Bewegung */
  --radius: 16px;
  --radius-sm: 11px;
  --radius-xs: 8px;
  --schatten: 0 1px 2px rgba(0, 0, 0, .45), 0 12px 30px -14px rgba(0, 0, 0, .7);
  --schatten-weich: 0 8px 24px -16px rgba(0, 0, 0, .8);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --tempo: .24s;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Cormorant', 'Inter', Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-feature-settings: 'cv05' 1, 'ss01' 1;
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(200, 165, 106, .05), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(255, 255, 255, .02), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  letter-spacing: .002em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--gold-dim); color: var(--gold-soft); }

/* Schlanke, dezente Scrollbalken */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); background-clip: padding-box; }

:focus-visible { outline: 2px solid var(--gold-line); outline-offset: 2px; border-radius: 6px; }

/* ============================================================
   Kopfzeile
   ============================================================ */
.kopf {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 18px;
  background: color-mix(in srgb, var(--bg-2) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  padding: 15px 28px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.marke { display: flex; align-items: center; gap: 15px; }
.logo {
  font-size: 26px; width: 46px; height: 46px; display: grid; place-items: center;
  background: var(--gold-dim); border: 1px solid var(--gold-line); border-radius: 13px;
}
/* Lalibela-Logo (dunkles SVG) auf der dunklen Box weiß darstellen. */
.logo img { width: 30px; height: 30px; filter: brightness(0) invert(1); }
.kopf h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.untertitel { margin: 3px 0 0; color: var(--text-soft); font-size: 12.5px; letter-spacing: .01em; }
.steuerung { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.steuerung label { display: flex; flex-direction: column; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); gap: 6px; font-weight: 600; }

/* ---------- Eingabefelder (global, konsistent) ---------- */
input, select, textarea {
  font-family: inherit; color: var(--text); font-size: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  transition: border-color var(--tempo) var(--ease), box-shadow var(--tempo) var(--ease), background var(--tempo) var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: rgba(255,255,255,.22); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold-line);
  box-shadow: 0 0 0 3px var(--gold-dim);
  background: var(--surface-3);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
select option { background: var(--surface); color: var(--text); }
input[type="date"], input[type="time"] { color-scheme: dark; }
label { color: var(--text-soft); }

/* ============================================================
   Buttons
   ============================================================ */
.btn-primär, .btn-neutral, .btn-mini, .btn-erfolg, .btn-warnung, .btn-gefahr {
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: .005em;
  padding: 11px 20px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform var(--tempo) var(--ease), background var(--tempo) var(--ease),
    border-color var(--tempo) var(--ease), box-shadow var(--tempo) var(--ease), color var(--tempo) var(--ease);
}
.btn-primär {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #241a08; box-shadow: 0 10px 24px -14px rgba(200,165,106,.9);
}
.btn-primär:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -14px rgba(200,165,106,1); }
.btn-primär:active { transform: translateY(0); }
.btn-neutral { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.btn-neutral:hover { background: var(--surface-3); border-color: rgba(255,255,255,.2); }
.btn-mini {
  padding: 7px 13px; font-size: 12.5px; min-height: 34px; border-radius: 9px;
  background: var(--surface-2); color: var(--text-soft); border-color: var(--line);
}
.btn-mini:hover { background: var(--surface-3); color: var(--text); border-color: var(--line-strong); }
.btn-erfolg { background: color-mix(in srgb, var(--frei) 20%, var(--surface-2)); color: #9fe0c0; border-color: color-mix(in srgb, var(--frei) 40%, transparent); }
.btn-erfolg:hover { background: color-mix(in srgb, var(--frei) 32%, var(--surface-2)); }
.btn-warnung { background: color-mix(in srgb, var(--reserviert) 20%, var(--surface-2)); color: #f0cd8e; border-color: color-mix(in srgb, var(--reserviert) 40%, transparent); }
.btn-warnung:hover { background: color-mix(in srgb, var(--reserviert) 32%, var(--surface-2)); }
.btn-gefahr { background: color-mix(in srgb, var(--besetzt) 18%, var(--surface-2)); color: #f0aaa3; border-color: color-mix(in srgb, var(--besetzt) 40%, transparent); }
.btn-gefahr:hover { background: color-mix(in srgb, var(--besetzt) 30%, var(--surface-2)); }

/* ============================================================
   Kennzahlen (Stat-Tiles)
   ============================================================ */
.kennzahlen {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px; padding: 26px 28px 4px;
}
.kpi {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--schatten-weich);
  transition: border-color var(--tempo) var(--ease), transform var(--tempo) var(--ease);
}
.kpi::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--gold), transparent); opacity: .5;
}
.kpi:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.kpi .zahl { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; }
.kpi .titel { color: var(--text-soft); font-size: 12px; margin-top: 6px; text-transform: uppercase; letter-spacing: .1em; }

/* ============================================================
   Layout & Karten
   ============================================================ */
.inhalt {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px;
  padding: 24px 28px 56px; align-items: start;
}
@media (max-width: 980px) { .inhalt { grid-template-columns: 1fr; } }

.karte {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--schatten-weich);
  padding: 22px 24px;
}
.karte-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.karte-kopf h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: .005em; }
.zaehler {
  background: var(--gold-dim); color: var(--gold-soft); border: 1px solid var(--gold-line);
  border-radius: 999px; padding: 3px 11px; font-size: 12.5px; font-weight: 700;
}

/* Legende */
.legende { display: flex; gap: 16px; font-size: 12px; color: var(--text-soft); flex-wrap: wrap; }
.legende span { display: flex; align-items: center; gap: 7px; }
.punkt { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 10px -1px currentColor; }
.punkt.frei { background: var(--frei); color: var(--frei); }
.punkt.reserviert { background: var(--reserviert); color: var(--reserviert); }
.punkt.besetzt { background: var(--besetzt); color: var(--besetzt); }

/* ============================================================
   Tischplan (einfache Kacheln – Fallback)
   ============================================================ */
.bereich-titel { font-size: 12px; font-weight: 700; margin: 18px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.raum {
  position: relative; width: 100%; height: 260px;
  background:
    linear-gradient(var(--bg-2), var(--bg-2)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 1px, transparent 1px 26px);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.raum.aussen { background:
    linear-gradient(#0e1512, #0e1512),
    repeating-linear-gradient(0deg, rgba(90,165,133,.08) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(90,165,133,.08) 0 1px, transparent 1px 26px); }
.tisch {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  color: #0c0d10; font-weight: 700; cursor: pointer; border: 2px solid rgba(255,255,255,.25);
  box-shadow: 0 6px 16px -6px rgba(0,0,0,.7); transition: transform var(--tempo) var(--ease);
}
.tisch:hover { transform: translate(-50%, -50%) scale(1.06); }
.tisch.frei { background: var(--frei); }
.tisch.reserviert { background: var(--reserviert); }
.tisch.besetzt { background: var(--besetzt); }
.tisch.rund { border-radius: 50%; }
.tisch.quadrat, .tisch.rechteck { border-radius: 10px; }
.tisch .nr { font-size: 15px; line-height: 1; }
.tisch .pl { font-size: 10px; font-weight: 500; opacity: .85; }

/* ============================================================
   Reservierungsliste
   ============================================================ */
.res-liste { display: flex; flex-direction: column; gap: 10px; max-height: 640px; overflow-y: auto; padding-right: 4px; }
.res-zeile {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); cursor: pointer;
  transition: border-color var(--tempo) var(--ease), background var(--tempo) var(--ease), transform var(--tempo) var(--ease);
}
.res-zeile:hover { border-color: var(--gold-line); background: var(--surface-3); transform: translateX(2px); }
.res-zeit { font-weight: 700; font-size: 15px; min-width: 50px; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.res-mitte { flex: 1; min-width: 0; }
.res-name { font-weight: 600; }
.res-detail { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }

.badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.badge.tag { background: var(--gold-dim); color: var(--gold-soft); border: 1px solid var(--gold-line); margin-left: 5px; }
.badge.online { background: rgba(90,165,133,.14); color: #7fc7a4; border: 1px solid rgba(90,165,133,.3); margin-left: 5px; }

.status-badge { font-size: 10.5px; padding: 4px 10px; border-radius: 999px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.status-offen { background: rgba(210,162,80,.14); color: #e5be79; }
.status-bestaetigt { background: rgba(90,165,133,.15); color: #7fc7a4; }
.status-storniert { background: rgba(208,104,95,.14); color: #e09a93; text-decoration: line-through; }
.status-erschienen { background: rgba(239,86,70,.16); color: #f0a79f; }
.status-no_show { background: rgba(255,255,255,.06); color: var(--text-soft); }
.status-beendet { background: rgba(90,165,133,.14); color: #7fc7a4; }
.besetzt-hinweis { color: #f0a79f; font-weight: 700; }
/* Bestätigungs-Nachfrage (z. B. vor dem endgültigen Löschen) */
.dialog-bestaetigen { max-width: 440px; padding: 26px 26px 22px; }
.bestaetige-titel { margin: 0 0 10px; font-size: 18px; font-weight: 600; letter-spacing: -.005em; }
.bestaetige-text { margin: 0 0 20px; color: var(--text-soft); line-height: 1.6; font-size: 14.5px; }

/* ============================================================
   Dialoge / Overlays
   ============================================================ */
.overlay {
  position: fixed; inset: 0;
  background: rgba(6, 7, 9, .68); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center; overflow-y: auto;
  z-index: 50; padding: 24px 16px;
  animation: overlay-in var(--tempo) var(--ease);
}
@keyframes overlay-in { from { opacity: 0; } }
.dialog {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); width: 100%; max-width: 540px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .85); margin: auto;
  animation: dialog-in var(--tempo) var(--ease);
}
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.99); } }
@media (prefers-reduced-motion: reduce) { .overlay, .dialog { animation: none; } }
.dialog-kopf { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.dialog-kopf h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.005em; }
.btn-schliessen {
  border: 1px solid transparent; background: none; font-size: 18px; cursor: pointer; color: var(--text-soft);
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  transition: background var(--tempo) var(--ease), color var(--tempo) var(--ease);
}
.btn-schliessen:hover { background: var(--surface-3); color: var(--text); }

#resForm, #einstellungForm, #gastForm, #warteForm, #teamForm, #tischForm { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.feld-reihe { display: flex; gap: 14px; }
@media (max-width: 480px) { .feld-reihe { flex-direction: column; } }
.feld-reihe label, form > label {
  flex: 1; display: flex; flex-direction: column; gap: 7px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-soft); font-weight: 600;
}
.dialog-fuss { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.fehler { color: #e09a93; font-size: 13px; margin: 0; }
.feld-hinweis { color: var(--muted); font-size: 12px; margin: -4px 0 0; text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--surface-3); color: var(--text); padding: 13px 22px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  font-size: 14px; font-weight: 500; z-index: 100;
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .9);
  animation: toast-in var(--tempo) var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.toast.fehler-toast { border-color: color-mix(in srgb, var(--besetzt) 50%, transparent); color: #f0aaa3; }

/* ============================================================
   Navigation (Segmented Control)
   ============================================================ */
.nav { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 5px; flex-wrap: wrap; gap: 2px; }
.nav button {
  border: none; background: none; padding: 9px 16px; border-radius: 9px; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-soft);
  transition: color var(--tempo) var(--ease), background var(--tempo) var(--ease);
}
.nav button:hover { color: var(--text); }
.nav button.aktiv { background: var(--surface-3); color: var(--gold-soft); box-shadow: 0 1px 2px rgba(0,0,0,.4), inset 0 0 0 1px var(--gold-line); }

.werkzeuge { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.werkzeuge label { display: flex; flex-direction: column; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); gap: 6px; font-weight: 600; }
.inhalt-voll { padding: 24px 28px 56px; }

/* ============================================================
   Editor
   ============================================================ */
.editor-werkzeuge { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bereich-editkopf { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; }
.bereich-editkopf .titel { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.tisch.auswahl { outline: 2px solid var(--gold); outline-offset: 3px; }
.raum.editor .tisch { cursor: move; }

/* ============================================================
   Suche & Gäste
   ============================================================ */
.suchfeld { min-width: 240px; }
.gast-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.gast-karte {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; cursor: pointer;
  background: var(--surface-2);
  transition: border-color var(--tempo) var(--ease), transform var(--tempo) var(--ease), background var(--tempo) var(--ease);
}
.gast-karte:hover { border-color: var(--gold-line); background: var(--surface-3); transform: translateY(-2px); }
.gast-karte .gn { font-weight: 700; font-size: 15px; }
.gast-karte .gm { font-size: 12.5px; color: var(--text-soft); margin-top: 4px; }
.gast-karte .gt { margin-top: 10px; }

.dialog-breit { max-width: 760px; }
.gast-detail { padding: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 640px) { .gast-detail { grid-template-columns: 1fr; } }
.gast-historie h4 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hist-zeile { border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 11px 13px; margin-bottom: 9px; font-size: 13px; background: var(--surface-2); }
.hist-zeile .hd { font-weight: 600; }
.hist-zeile .hm { color: var(--text-soft); font-size: 12px; margin-top: 2px; }

/* ============================================================
   Einstellungen
   ============================================================ */
.abschnitt {
  font-size: 12px; color: var(--gold-soft); margin: 26px 0 14px;
  border-bottom: 1px solid var(--line); padding-bottom: 9px;
  text-transform: uppercase; letter-spacing: .12em; font-weight: 700;
}
.oeffnung { display: flex; flex-direction: column; gap: 10px; }
.oeffnung-zeile { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.oeffnung-zeile .tag { width: 96px; font-weight: 600; font-size: 14px; color: var(--text); }
.oeffnung-zeile.ruhetag input[type="time"] { opacity: .35; pointer-events: none; }
.oeffnung-zeile label.ruhe { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-soft); text-transform: none; letter-spacing: 0; font-weight: 400; }
.oeffnung-zeile .bis { color: var(--muted); }

.hinweis { font-size: 12.5px; color: var(--text-soft); background: var(--gold-dim); border: 1px solid var(--gold-line); padding: 11px 14px; border-radius: var(--radius-xs); margin: 0 0 14px; }

/* Markenfarben-Wähler */
.farbwahl { display: flex; align-items: center; gap: 10px; }
.farbwahl input[type="color"] {
  width: 46px; height: 44px; padding: 4px; cursor: pointer; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line-strong);
}
.farbwahl input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.farbwahl input[type="color"]::-webkit-color-swatch { border: none; border-radius: 6px; }
.farbwahl-hex { width: 108px; font-variant-numeric: tabular-nums; text-transform: lowercase; }
.farbwahl-vorschau {
  margin-left: auto; font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: 999px;
  white-space: nowrap; box-shadow: 0 6px 16px -8px rgba(0,0,0,.7);
}
.seitenspalte { display: flex; flex-direction: column; gap: 24px; }

/* Tisch beim Ziehen */
.tisch { -webkit-user-select: none; user-select: none; }
.tisch.ziehbar { cursor: grab; }
.tisch.ziel-aktiv { outline: 2px dashed var(--gold-soft); outline-offset: 3px; filter: brightness(1.12); }

/* ============================================================
   Wochen-Raster
   ============================================================ */
.inhalt-woche { padding: 24px 28px 56px; }
.woche-raster { display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; }
@media (max-width: 860px) { .woche-raster { grid-template-columns: repeat(2, 1fr); } }
.woche-tag {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; cursor: pointer;
  background: var(--surface-2);
  transition: border-color var(--tempo) var(--ease), transform var(--tempo) var(--ease), background var(--tempo) var(--ease);
}
.woche-tag:hover { border-color: var(--gold-line); transform: translateY(-2px); background: var(--surface-3); }
.woche-tag.heute { border-color: var(--gold-line); background: var(--gold-dim); }
.woche-tag .wt { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.woche-tag .dt { font-size: 22px; font-weight: 700; margin: 4px 0 12px; letter-spacing: -.02em; }
.woche-tag .wz { font-size: 13px; color: var(--text-soft); }
.woche-tag .wz b { color: var(--gold-soft); }
.woche-tag .wl { font-size: 12px; color: var(--reserviert); margin-top: 5px; }
.woche-tag.leer { opacity: .5; }
/* ---- Zeitraum-Ansicht (frei wählbarer Von–Bis-Bereich) ---- */
.zeitraum-kopf { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; }
.zeitraum-waehler { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.zeitraum-waehler label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.hinweis-klein { font-size: 12px; color: var(--muted); font-weight: 400; }

/* ============================================================
   Detail-Dialog
   ============================================================ */
.detail-inhalt { padding: 22px 24px; display: flex; flex-direction: column; gap: 4px; }
.detail-zeile { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-zeile span:first-child { color: var(--text-soft); }
.detail-zeile span:last-child { text-align: right; }
.detail-aktionen { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.detail-umzug { display: flex; gap: 9px; align-items: center; margin-top: 14px; }
.detail-umzug select { flex: 1; }

/* Warteliste */
.warte-zeile {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--reserviert) 30%, transparent); border-radius: var(--radius-sm);
  background: rgba(210, 162, 80, .06);
}
.warte-mitte { flex: 1; min-width: 0; }
.warte-name { font-weight: 600; }
.warte-detail { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }

/* ============================================================
   Grundriss-Leinwand (Tag + Editor)
   ============================================================ */
.leinwand-vp { width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; background: var(--bg-2); }
.leinwand-vp.editor { overflow: auto; max-height: 640px; }
.leinwand { position: relative; transform-origin: 0 0; }
.leinwand.innen { background:
  linear-gradient(var(--bg-2), var(--bg-2)),
  repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 40px),
  repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 40px); }
.leinwand.aussen { background:
  linear-gradient(#0e1512, #0e1512),
  repeating-linear-gradient(0deg, rgba(90,165,133,.1) 0 1px, transparent 1px 40px),
  repeating-linear-gradient(90deg, rgba(90,165,133,.1) 0 1px, transparent 1px 40px); }

.wand { position: absolute; background: #3a4150; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.wand.vorschau { background: var(--gold); opacity: .5; }
.leinwand.editor .wand { cursor: move; }

.fenster { position: absolute; box-sizing: border-box; border: 2px solid #3a4150; border-radius: 3px;
  background: repeating-linear-gradient(90deg, rgba(120,180,210,.5) 0 18px, rgba(90,150,180,.5) 18px 20px); box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.fenster.vorschau { opacity: .55; }
.leinwand.editor .fenster { cursor: move; }

.deko { position: absolute; }
.deko.pflanze { line-height: 1; transform: translate(-50%,-50%); filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); }
.deko.tuer { background: var(--gold-strong); color: #1a1206; border-radius: 6px; font-size: 11px; font-weight: 700; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; padding: 4px 10px; white-space: nowrap; box-shadow: var(--schatten); }
.deko.bar { background: #4a5361; color: #dfe4ea; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; letter-spacing: 1px; box-shadow: var(--schatten); }
.deko.text { color: var(--text-soft); font-weight: 700; white-space: nowrap; }
.leinwand.editor .deko { cursor: move; }

/* Tische mit Stühlen */
.tischwrap { position: absolute; }
.stuhl { position: absolute; width: 16px; height: 16px; background: #3c434f; border: 1px solid #4c5563;
  border-radius: 5px 5px 6px 6px; box-shadow: inset 0 3px 0 rgba(0,0,0,.25); }
.tischplatte { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #0c0d10; font-weight: 700; border: 2px solid rgba(255,255,255,.25); box-shadow: 0 6px 16px -6px rgba(0,0,0,.8); }
.tischplatte.rund { border-radius: 50%; }
.tischplatte.quadrat, .tischplatte.rechteck { border-radius: 9px; }
.tischplatte.neutral { background: linear-gradient(160deg, #8b95a3, #5f6a79); color: #0c0d10; }
.tischplatte.frei { background: linear-gradient(160deg, #6fc79c, var(--frei)); }
.tischplatte.reserviert { background: linear-gradient(160deg, #e6bd76, var(--reserviert)); }
/* Besetzt = Gäste sind da: deutliches, sattes Rot mit klarem Ring (gut sichtbar
   auf Desktop, Tablet und Smartphone). */
.tischplatte.besetzt {
  background: linear-gradient(160deg, #ef5646, #c8261d);
  color: #fff; border-color: rgba(255, 255, 255, .45);
  box-shadow: 0 6px 18px -5px rgba(200, 38, 29, .75), 0 0 0 2px rgba(239, 86, 70, .4);
}
.tischplatte .nr { font-size: 15px; line-height: 1; }
.tischplatte .pl { font-size: 10px; font-weight: 500; opacity: .85; }
/* Kurzer, ruhiger Puls, wenn ein Tisch gerade besetzt wurde – läuft dreimal und
   bleibt danach dauerhaft rot. Nicht hektisch. */
@keyframes tisch-puls {
  0%   { box-shadow: 0 6px 18px -5px rgba(200, 38, 29, .75), 0 0 0 0 rgba(239, 86, 70, .65); }
  70%  { box-shadow: 0 6px 18px -5px rgba(200, 38, 29, .75), 0 0 0 16px rgba(239, 86, 70, 0); }
  100% { box-shadow: 0 6px 18px -5px rgba(200, 38, 29, .75), 0 0 0 0 rgba(239, 86, 70, 0); }
}
.tischplatte.besetzt.gerade-besetzt { animation: tisch-puls 1.15s var(--ease) 3; }
@media (prefers-reduced-motion: reduce) { .tischplatte.besetzt.gerade-besetzt { animation: none; } }
/* Auf Tablets (grober Zeiger) den Belegt-Ring etwas kräftiger. */
@media (pointer: coarse) { .tischplatte.besetzt { border-width: 3px; } }
.leinwand:not(.editor) .tischwrap.ziehbar { cursor: grab; }
.tischwrap.ziel-aktiv .tischplatte { outline: 2px dashed var(--gold-soft); outline-offset: 3px; filter: brightness(1.1); }

/* Werkzeugleiste */
.tool-gruppe { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; flex-wrap: wrap; gap: 2px; }
.tool-gruppe button { border: none; background: none; padding: 7px 12px; border-radius: 7px; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text-soft); transition: background var(--tempo) var(--ease), color var(--tempo) var(--ease); }
.tool-gruppe button:hover { color: var(--text); }
.tool-gruppe button.aktiv { background: var(--surface-3); color: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold-line); }
#dekoVariante { padding: 7px 9px; font-size: 16px; }
.zoom-steuer { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; }
.zoom-steuer button { border: 1px solid var(--line); background: var(--surface-3); width: 28px; height: 28px; border-radius: 7px; cursor: pointer; font-size: 16px; font-weight: 700; color: var(--text); }
.zoom-steuer button:hover { border-color: var(--gold-line); }
.zoom-steuer #zoomLabel { font-size: 13px; font-weight: 600; min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }

.deko-wahl { display: flex; gap: 8px; flex-wrap: wrap; }
.vbtn { font-size: 20px; width: 44px; height: 44px; border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 10px; cursor: pointer; transition: border-color var(--tempo) var(--ease); }
.vbtn:hover { border-color: var(--gold-line); }
.tuer-schnell { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.tbtn { width: auto !important; height: auto !important; font-size: 12px !important; padding: 7px 11px !important; font-weight: 600; color: var(--text); }

/* ============================================================
   Login / Ersteinrichtung
   ============================================================ */
.login-overlay {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto;
  /* min-height, damit der dunkle Login-Hintergrund den ganzen Schirm füllt –
     auch dann, wenn iPad-Safari das position:fixed nicht greifen lässt und das
     Overlay im normalen Fluss landet. */
  min-height: 100vh; min-height: 100svh;
  background:
    radial-gradient(1000px 700px at 50% -20%, rgba(200,165,106,.14), transparent 60%),
    linear-gradient(160deg, #0a0b0e, #101217 60%, #0a0b0e);
  padding: 24px 16px;
}
/* Solange keine Sitzung besteht, NUR das Login zeigen. Auf iPad-Safari deckt das
   position:fixed-Overlay den Admin-Bereich nicht zuverlässig ab (bekannter iOS-
   Bug mit backdrop-filter im Kopf) – deshalb blenden wir Kopf und Ansichten hart
   aus. So kann nach dem Abmelden nie wieder der Admin-Bereich über/unter dem
   Login auftauchen. `angemeldet` setzt/entfernt app.js (starteSitzung/zeigeLogin). */
body:not(.angemeldet) .kopf,
body:not(.angemeldet) .ansicht { display: none !important; }
.login-karte {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line-strong);
  border-radius: 22px; box-shadow: 0 50px 90px -40px rgba(0,0,0,.9);
  padding: 40px 36px; width: 100%; max-width: 420px; text-align: center; margin: auto;
}
.login-logo {
  font-size: 30px; width: 66px; height: 66px; margin: 0 auto 6px; display: grid; place-items: center;
  background: var(--gold-dim); border: 1px solid var(--gold-line); border-radius: 18px;
}
.login-logo img { width: 42px; height: 42px; filter: brightness(0) invert(1); }
.login-karte h2 { margin: 10px 0 2px; font-family: var(--font-display); font-size: 34px; font-weight: 600; letter-spacing: .01em; }
.login-unter { color: var(--text-soft); margin: 0 0 24px; font-size: 14px; }
#loginForm, #setupForm { display: flex; flex-direction: column; gap: 15px; text-align: left; }
#loginForm label, #setupForm label { display: flex; flex-direction: column; gap: 7px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-soft); font-weight: 600; }
#loginForm input, #setupForm input { padding: 12px 14px; font-size: 15px; }
#loginForm button, #setupForm button { padding: 13px; font-size: 15px; margin-top: 6px; }

/* Angemeldeter Benutzer */
.user-box { display: flex; align-items: center; gap: 12px; }
#userInfo { font-size: 13.5px; color: var(--text-soft); }
#userInfo b { color: var(--text); font-weight: 600; }

/* ============================================================
   Statistik
   ============================================================ */
.stat-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 4px; }
@media (max-width: 900px) { .stat-raster { grid-template-columns: 1fr; } }
.balken { display: flex; flex-direction: column; gap: 11px; }
.balken-zeile { display: flex; align-items: center; gap: 12px; }
.bl-label { width: 90px; font-size: 12.5px; color: var(--text-soft); font-weight: 600; }
.bl-bar { flex: 1; height: 24px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.bl-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-strong), var(--gold-soft)); border-radius: 6px; min-width: 3px; box-shadow: 0 0 16px -2px var(--gold-dim); }
.bl-wert { font-size: 12px; color: var(--text-soft); min-width: 82px; text-align: right; font-variant-numeric: tabular-nums; }

/* Schalter */
.schalter-liste { display: flex; flex-direction: column; gap: 12px; }
.schalter { display: flex; align-items: center; gap: 11px; font-size: 14px; color: var(--text); cursor: pointer; }
.schalter input { width: 18px; height: 18px; accent-color: var(--gold); }

/* Postausgang */
.post-zeile { display: flex; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background var(--tempo) var(--ease); }
.post-zeile:hover { background: var(--surface-2); }
.post-icon { font-size: 20px; }
.post-mitte { flex: 1; min-width: 0; }
.post-betreff { font-weight: 600; font-size: 14px; }
.post-meta { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.post-text { margin-top: 8px; font-size: 13px; white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 12px; color: var(--text-soft); }
.typ-pill { font-size: 10px; padding: 3px 8px; border-radius: 999px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.typ-email { background: rgba(200,165,106,.14); color: var(--gold-soft); }
.typ-sms { background: rgba(90,165,133,.15); color: #7fc7a4; }
.typ-vorbereitet { background: rgba(210,162,80,.14); color: #e5be79; }

/* Sperrtage */
.sperrtag-liste { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.sperrtag-zeile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sp-datum { font-weight: 700; min-width: 130px; color: var(--gold-soft); }
.sp-grund { flex: 1; color: var(--text-soft); }

/* Interne Notiz */
.detail-notiz { display: flex; flex-direction: column; gap: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-soft); font-weight: 600; margin: 16px 0; }
.detail-notiz textarea { resize: vertical; text-transform: none; letter-spacing: 0; font-weight: 400; }
.detail-notiz .btn-mini { align-self: flex-start; }

/* ============================================================
   Admin-Bereich (Team / Konto)
   ============================================================ */
.admin-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 980px) { .admin-raster { grid-template-columns: 1fr; } }
.status-pill { font-size: 12px; padding: 3px 11px; border-radius: 999px; font-weight: 700; background: rgba(90,165,133,.15); color: #7fc7a4; }

.team-zeile { display: flex; align-items: center; gap: 14px; padding: 13px 6px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background var(--tempo) var(--ease); border-radius: 8px; }
.team-zeile:hover { background: var(--surface-2); }
.team-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--gold-dim); color: var(--gold-soft); border: 1px solid var(--gold-line); display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.team-mitte { flex: 1; min-width: 0; }
.team-name { font-weight: 600; }
.team-mail { font-size: 12.5px; color: var(--text-soft); margin-top: 1px; }
.rolle-badge { font-size: 10.5px; padding: 4px 11px; border-radius: 999px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.rolle-besitzer { background: var(--gold-dim); color: var(--gold-soft); border: 1px solid var(--gold-line); }
.rolle-manager { background: rgba(200,165,106,.1); color: var(--sand); }
.rolle-personal { background: rgba(255,255,255,.06); color: var(--text-soft); }
.konto-zeile { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; border-bottom: 1px solid var(--line); padding: 11px 0; }
.konto-zeile span:first-child { color: var(--text-soft); }

.leer { color: var(--muted); font-size: 14px; margin: 6px 0; }

/* ============================================================
   Überschriften-Feinschliff & Utilities
   ============================================================ */
h1, h2, h3, h4 { color: var(--text); }
a { color: var(--gold-soft); }

.versteckt { display: none !important; }

/* ============================================================
   Responsiv – Tablet (Restaurant) & Smartphone
   ============================================================ */
@media (max-width: 720px) {
  .kopf { padding: 13px 18px; }
  .kennzahlen { padding: 18px 18px 2px; gap: 14px; }
  .inhalt, .inhalt-voll, .inhalt-woche { padding: 18px 18px 44px; }
  .karte { padding: 18px 18px; }
  .kpi .zahl { font-size: 28px; }
  .login-karte { padding: 32px 26px; }
  .login-karte h2 { font-size: 30px; }
}

/* Restaurant-Tablet: großzügige Touch-Flächen */
@media (min-width: 721px) and (max-width: 1180px) and (pointer: coarse) {
  .nav button { padding: 12px 20px; font-size: 15px; }
  .btn-primär, .btn-neutral, .btn-mini { min-height: 50px; font-size: 15px; }
  .res-zeile { padding: 18px; }
  input, select, textarea { padding: 13px 14px; font-size: 15px; }
}

/* Statusabzeichen im Postausgang.
   Vorher gab es nur „vorbereitet"; gesendete und fehlgeschlagene Sendungen
   sahen gleich aus – man konnte nicht erkennen, ob ein Gast je eine
   Bestätigung bekommen hat. */
.typ-gesendet {
  background: rgba(45, 160, 90, 0.18);
  color: #6ed19a;
}
.typ-fehler {
  background: rgba(210, 60, 60, 0.2);
  color: #ef8383;
  font-weight: 600;
}
