/* =========================================================================
   QLICK DEMO  ·  Design System
   Farben aus dem Qlick-Logo abgeleitet:
   Blau-Violett #5A2BFF  ·  Primaer #7B2FFF  ·  Hell-Violett #9A3CFF  ·  Hintergrund #F6F7FB
   ========================================================================= */

:root {
  /* Marke */
  --brand-blue:   #5A2BFF;
  --brand-mid:    #7B2FFF;
  --brand-violet: #9A3CFF;
  --grad:        linear-gradient(135deg, #5A2BFF 0%, #7B2FFF 50%, #9A3CFF 100%);
  --grad-soft:   linear-gradient(135deg, rgba(90,43,255,.10), rgba(154,60,255,.10));

  /* Neutralfundament */
  --bg:        #F6F7FB;
  --bg-2:      #EEF0F8;
  --surface:   #FFFFFF;
  --ink:       #0E1330;
  --ink-2:     #353B5C;
  --muted:     #6B7192;
  --faint:     #9AA0BE;
  --line:      #E8EAF2;
  --line-2:    #EDEFF6;

  /* Status */
  --st-open:        #E08600;  --st-open-bg:#FFF4E0;
  --st-partial:     #2563EB;  --st-partial-bg:#E5EDFF;
  --st-paid:        #15A34A;  --st-paid-bg:#E3F8EC;
  --st-cancelled:   #8A90A8;  --st-cancelled-bg:#EEF0F5;

  /* Form */
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-xs: 0 1px 2px rgba(16,19,48,.05);
  --shadow:    0 1px 2px rgba(16,19,48,.04), 0 10px 28px rgba(16,19,48,.07);
  --shadow-lg: 0 2px 4px rgba(16,19,48,.04), 0 24px 60px rgba(16,19,48,.12);
  --ring:      0 0 0 4px rgba(123,47,255,.16);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1180px;
}

/* ----- Reset ----- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; color: var(--ink); }
p { margin: 0; }

/* =========================================================================
   Typo-Helfer
   ========================================================================= */
.eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand-mid);
}
.muted { color: var(--muted); }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .85rem 1.35rem; border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 600; color: #fff;
  background: var(--grad); background-size: 140% 140%;
  box-shadow: 0 8px 20px rgba(123,47,255,.28);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:hover   { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(123,47,255,.34); }
.btn:active  { transform: translateY(0); }
.btn:disabled{ filter: grayscale(.4) opacity(.55); cursor: not-allowed; box-shadow: none; transform: none; }
.btn--block  { width: 100%; }
.btn--lg     { padding: 1.05rem 1.5rem; font-size: 1.02rem; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.2rem; border-radius: var(--radius-sm);
  font-size: .92rem; font-weight: 600; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.btn-ghost:hover { border-color: #D4D8E8; background: #FCFCFE; transform: translateY(-1px); }
.btn-ghost--block { width: 100%; }

.btn-text {
  font-weight: 600; color: var(--brand-mid); padding: .5rem .25rem;
  border-radius: 8px;
}
.btn-text:hover { color: var(--brand-violet); }

.chip {
  padding: .4rem .8rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
  transition: all .14s ease;
}
.chip:hover { border-color: var(--brand-mid); color: var(--brand-mid); }
.chip[aria-pressed="true"], .chip.is-active {
  background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: 0 6px 14px rgba(123,47,255,.28);
}

/* =========================================================================
   Cards, Badges, Inputs
   ========================================================================= */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.card-pad { padding: 1.4rem; }

.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .32rem .7rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: .01em;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--open       { color: var(--st-open);      background: var(--st-open-bg); }
.badge--partial    { color: var(--st-partial);   background: var(--st-partial-bg); }
.badge--paid       { color: var(--st-paid);      background: var(--st-paid-bg); }
.badge--cancelled  { color: var(--st-cancelled); background: var(--st-cancelled-bg); }

.field { margin-bottom: 1rem; }
.field label {
  display: block; font-size: .82rem; font-weight: 600;
  color: var(--ink-2); margin-bottom: .4rem;
}
.input, .select {
  width: 100%; padding: .8rem .9rem; font-size: .95rem; color: var(--ink);
  background: #FBFBFD; border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.input:focus, .select:focus {
  outline: none; border-color: var(--brand-mid); background: #fff; box-shadow: var(--ring);
}
.input::placeholder { color: var(--faint); }

/* =========================================================================
   App-Shell / Layout
   ========================================================================= */
.screen { min-height: 100vh; min-height: 100dvh; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.4rem; }

/* Topbar (Dashboards) */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.86); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: .85rem 1.4rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.brand { display: flex; align-items: center; gap: .65rem; flex-shrink: 0; }
.brand img { height: 30px; width: auto; }
.brand-tag {
  font-size: .68rem; font-weight: 700; letter-spacing: .04em; color: var(--muted);
  border: 1px solid var(--line); padding: .15rem .45rem; border-radius: 6px;
}
.topnav-wrap { flex: 1; display: flex; min-width: 0; position: relative; }
.topnav { display: flex; gap: .35rem; flex-wrap: wrap; flex: 1; }
.nav-arrow {
  display: none; position: absolute; top: 0; bottom: 0; width: 22px;
  align-items: center; pointer-events: none; z-index: 2;
  color: var(--brand-mid); font-size: 1.1rem; font-weight: 700; opacity: .55;
}
.nav-arrow-l { left: -2px; justify-content: flex-start; }
.nav-arrow-r { right: -2px; justify-content: flex-end; }
.topnav a {
  padding: .5rem .85rem; border-radius: 9px; font-size: .9rem; font-weight: 600;
  color: var(--muted); transition: background .14s ease, color .14s ease;
}
.topnav a:hover { color: var(--ink); background: var(--bg-2); }
.topnav a.is-active { color: var(--brand-mid); background: var(--grad-soft); }
.topbar-right { display: flex; align-items: center; gap: .7rem; flex-shrink: 0; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--grad);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}

.page { padding: 2rem 0 4rem; }
.page-head { margin-bottom: 1.6rem; }
.page-head h1 { font-size: 1.7rem; font-weight: 800; }
.page-head p { color: var(--muted); margin-top: .35rem; }

/* Grids */
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.4rem; }
.section + .section { margin-top: 1.6rem; }

/* ===== Responsive: Tablet und Smartphone (iPad / iPhone) ===== */

/* Klickbares Logo (Gastansicht und Dashboards) */
.brand-link { display: inline-flex; align-items: center; cursor: pointer; }
.brand, .brand-link { -webkit-tap-highlight-color: transparent; }
.brand:active, .brand-link:active { opacity: .7; }

@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

/* Tablet und darunter: Navigation bleibt sichtbar, wird zur scrollbaren Leiste */
@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; gap: .55rem 1rem; padding: .7rem 1rem; }
  .brand { order: 1; }
  .topbar-right { order: 2; margin-left: auto; }
  .topnav-wrap { order: 3; flex: 1 1 100%; }
  .topnav {
    flex-wrap: nowrap;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    gap: .3rem; padding-bottom: 2px; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
    scroll-behavior: smooth;
  }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { flex: 0 0 auto; white-space: nowrap; }
  .topnav-wrap.can-left .nav-arrow-l { display: flex; }
  .topnav-wrap.can-right .nav-arrow-r { display: flex; }
  .container { padding: 0 1rem; }
  .page { padding: 1.4rem 0 3rem; }
}

/* Smartphone: kompaktere KPIs, ueberschreibt auch Inline-Spalten (3er/4er/5er) */
@media (max-width: 680px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: .7rem; }
  .page-head h1 { font-size: 1.4rem; }
  .kpi-value { font-size: 1.55rem; }
  .btn-reset { padding: .45rem .7rem; font-size: .78rem; }
  .table { font-size: .86rem; }
  .table th, .table td { padding: .7rem .7rem; }
}
@media (max-width: 380px) {
  .kpi-grid { grid-template-columns: 1fr !important; }
}

/* Smartphone: breite Tabellen werden zu gestapelten Karten (kein Seitwaerts-Wischen) */
@media (max-width: 680px) {
  .card.table-wrap { border: none; box-shadow: none; background: transparent; border-radius: 0; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody { display: block; width: 100%; }
  .table tr {
    display: block; background: var(--surface);
    border: 1px solid var(--line); border-radius: 14px;
    margin-bottom: .7rem; padding: .25rem .1rem; box-shadow: var(--shadow-xs);
  }
  .table tr:hover td { background: transparent; }
  .table td {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    border: 0 !important; padding: .55rem .85rem; text-align: right;
  }
  .table td[data-label]::before {
    content: attr(data-label); color: var(--faint); font-weight: 700;
    text-align: left; flex: 0 0 auto;
  }
  .table td[colspan] { justify-content: center; text-align: center; }
  .table td[colspan]::before { content: none; }
  .table .cell-v { display: inline-flex; flex-direction: column; align-items: flex-end; }
}

/* KPI-Karte */
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.15rem; box-shadow: var(--shadow-xs);
  position: relative; overflow: hidden;
}
.kpi-label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 1.9rem; font-weight: 800; margin-top: .35rem; letter-spacing: -.03em; }
.kpi-sub { font-size: .78rem; color: var(--faint); margin-top: .2rem; }
.kpi-accent { height: 3px; background: var(--grad); border-radius: 3px; width: 38px; margin-top: .8rem; }

/* =========================================================================
   Tabellen / Listen
   ========================================================================= */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--faint); font-weight: 700; padding: .8rem 1rem; border-bottom: 1px solid var(--line);
}
.table td { padding: .9rem 1rem; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #FAFBFE; }
.table .num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }

/* Tisch-Zeile */
.table-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; padding: 1rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  margin-bottom: .7rem; transition: box-shadow .15s ease, border-color .15s ease;
}
.table-row:hover { box-shadow: var(--shadow); border-color: #DCE0EE; }
.table-no {
  width: 46px; height: 46px; border-radius: 12px; background: var(--grad-soft);
  display: grid; place-items: center; font-weight: 800; color: var(--brand-mid); flex-shrink: 0;
}
.table-meta { flex: 1 1 220px; min-width: 0; }
.table-meta strong { font-size: .98rem; }
.table-meta span { display: block; font-size: .82rem; color: var(--muted); }
.table-row > div:not(.table-no):not(.table-meta):not(.row-actions) { flex-shrink: 0; }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; flex: 1 1 100%; }

/* =========================================================================
   LOGIN / STARTSCREEN
   ========================================================================= */
.login-screen {
  min-height: 100dvh; display: grid; place-items: center; padding: 2.5rem 1.4rem;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(90,43,255,.10), transparent 60%),
    radial-gradient(820px 520px at 100% 0%, rgba(154,60,255,.12), transparent 55%),
    var(--bg);
}
.login-wrap { width: 100%; max-width: 940px; }
.login-head { text-align: center; margin-bottom: 2.2rem; }
.login-head img { height: 52px; width: auto; margin: 0 auto 1.4rem; }
.login-head h1 { font-size: 2.2rem; font-weight: 800; }
.login-head p { color: var(--muted); margin-top: .6rem; font-size: 1.05rem; }

.entry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.6rem; }
.entry {
  text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.4rem; box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .2s ease, border-color .16s ease;
}
.entry:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #DADEEE; }
.entry-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--grad);
  display: grid; place-items: center; margin-bottom: 1rem; box-shadow: 0 8px 18px rgba(123,47,255,.28);
}
.entry-icon svg { width: 22px; height: 22px; }
.entry h3 { font-size: 1.08rem; font-weight: 700; }
.entry p { color: var(--muted); font-size: .9rem; margin-top: .35rem; }
.entry-go { margin-top: 1rem; color: var(--brand-mid); font-weight: 700; font-size: .9rem; display: inline-flex; gap: .35rem; align-items: center; }

.login-card { max-width: 460px; margin: 0 auto; }
.login-card .card-pad { padding: 1.6rem; }
.login-error {
  display: none; align-items: center; gap: .5rem; margin-bottom: 1rem;
  padding: .7rem .9rem; border-radius: var(--radius-sm);
  background: #FFF0F0; color: #C0341D; font-size: .88rem; font-weight: 600;
  border: 1px solid #FAD6D0;
}
.login-error.show { display: flex; }
.login-hint { font-size: .8rem; color: var(--faint); text-align: center; margin-top: 1rem; line-height: 1.6; }
.login-hint code { background: var(--bg-2); padding: .1rem .4rem; border-radius: 5px; color: var(--ink-2); }

@media (max-width: 760px) {
  .entry-grid { grid-template-columns: 1fr; }
  .login-head h1 { font-size: 1.7rem; }
}

/* =========================================================================
   GASTANSICHT (Mobile-first Payment-App)
   ========================================================================= */
.guest-screen {
  min-height: 100dvh; background: var(--bg-2);
  display: flex; justify-content: center;
}
.guest-app {
  width: 100%; max-width: 460px; background: var(--surface);
  min-height: 100dvh; display: flex; flex-direction: column;
  box-shadow: 0 0 60px rgba(16,19,48,.10);
}
.guest-top {
  position: sticky; top: 0; z-index: 10;
  padding: 1rem 1.2rem; display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2);
}
.guest-top img { height: 24px; width: auto; }
.guest-body { flex: 1; padding: 1.2rem 1.2rem 2rem; }
.guest-hero {
  background: var(--grad); color: #fff; border-radius: var(--radius-lg);
  padding: 1.4rem; margin-bottom: 1.2rem; box-shadow: 0 14px 30px rgba(123,47,255,.30);
  position: relative; overflow: hidden;
}
.guest-hero::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 130px; height: 130px;
  background: rgba(255,255,255,.12); border-radius: 50%;
}
.guest-hero .rest { font-size: .82rem; opacity: .9; font-weight: 600; }
.guest-hero .tbl { font-size: 1.5rem; font-weight: 800; margin-top: .2rem; }
.guest-hero .amount { font-size: 2.3rem; font-weight: 800; margin-top: .9rem; letter-spacing: -.03em; }
.guest-hero .amount small { font-size: .95rem; font-weight: 600; opacity: .9; }
.guest-hero .status-line { margin-top: .8rem; }
.guest-hero .badge { background: rgba(255,255,255,.22); color:#fff; }
.guest-hero .badge::before { background: #fff; }

.block { margin-bottom: 1.3rem; }
.block-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: .7rem; }

.bill-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.bill-item { display: flex; justify-content: space-between; padding: .85rem 1rem; border-bottom: 1px solid var(--line-2); font-size: .94rem; }
.bill-item:last-child { border-bottom: none; }
.bill-item .nm { color: var(--ink-2); }
.bill-item .qty { color: var(--faint); font-size: .82rem; margin-left: .4rem; }
.bill-item .pr { font-weight: 600; font-variant-numeric: tabular-nums; }
.bill-total { display: flex; justify-content: space-between; padding: 1rem; background: #FAFBFE; font-weight: 800; font-size: 1.05rem; }

.opt-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
.opt {
  text-align: center; padding: .8rem .4rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); font-size: .82rem; font-weight: 600; color: var(--ink-2); transition: all .14s ease;
}
.opt small { display:block; color: var(--faint); font-weight: 600; font-size:.7rem; margin-top:.2rem; }
.opt:hover { border-color: var(--brand-mid); }
.opt.is-active { border-color: transparent; background: var(--grad-soft); color: var(--brand-mid); box-shadow: inset 0 0 0 1.5px var(--brand-mid); }

.tip-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.tip-row .chip { flex: 1; min-width: 56px; text-align: center; }

.pay-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
.pay {
  display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .85rem .4rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  font-size: .8rem; font-weight: 600; color: var(--ink-2); transition: all .14s ease;
}
.pay svg { height: 20px; }
.pay:hover { border-color: var(--brand-mid); }
.pay.is-active { border-color: transparent; box-shadow: inset 0 0 0 1.5px var(--brand-mid); background: var(--grad-soft); color: var(--brand-mid); }

.share-summary {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 1rem; border-radius: var(--radius); background: var(--grad-soft); margin-bottom: 1rem;
}
.share-summary .lbl { font-size: .82rem; color: var(--ink-2); font-weight: 600; }
.share-summary .val { font-size: 1.4rem; font-weight: 800; }
.share-summary .val small { font-size: .8rem; font-weight: 600; color: var(--muted); display:block; text-align:right; }

.guest-foot {
  position: sticky; bottom: 0; z-index: 9;
  padding: 1rem 1.2rem calc(1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line-2);
  background: rgba(255,255,255,.86); backdrop-filter: blur(12px);
}

/* Erfolg */
.success-wrap { text-align: center; padding: 2.5rem 1.4rem; }
.success-ring {
  width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 1.4rem;
  background: var(--st-paid-bg); display: grid; place-items: center;
  animation: pop .5s cubic-bezier(.22,1,.36,1);
}
.success-ring svg { width: 46px; height: 46px; }
.success-wrap h2 { font-size: 1.5rem; font-weight: 800; }
.success-wrap > p { color: var(--muted); margin-top: .4rem; }
.receipt-mini { text-align: left; margin: 1.6rem auto 0; max-width: 320px; }
.receipt-mini .bill-item { padding: .7rem 0; border-color: var(--line-2); }

@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* =========================================================================
   Footer / Demo-Hinweise
   ========================================================================= */
.demo-foot {
  border-top: 1px solid var(--line); background: var(--surface);
}
.demo-foot-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 1.4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.demo-badges { display: flex; gap: .5rem; flex-wrap: wrap; }
.demo-badge {
  font-size: .74rem; font-weight: 600; color: var(--muted);
  background: var(--bg-2); border: 1px solid var(--line); padding: .3rem .7rem; border-radius: 999px;
}
.demo-foot small { color: var(--faint); }

.guest-app .demo-badges { justify-content: center; padding: 0 0 1.4rem; }

/* =========================================================================
   Modal & Toast
   ========================================================================= */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(14,19,48,.45);
  backdrop-filter: blur(3px); display: grid; place-items: center; padding: 1.4rem;
  animation: fade .2s ease;
}
.modal {
  width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 1.6rem; animation: rise .26s cubic-bezier(.22,1,.36,1);
  max-height: 90dvh; overflow: auto;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.1rem; gap: 1rem; }
.modal-head h3 { font-size: 1.2rem; font-weight: 800; }
.modal-head p { color: var(--muted); font-size: .88rem; margin-top: .25rem; }
.modal-close {
  width: 34px; height: 34px; border-radius: 9px; background: var(--bg-2); color: var(--ink-2);
  display: grid; place-items: center; font-size: 1.1rem; flex-shrink: 0;
}
.modal-close:hover { background: var(--bg); }

.qr-box {
  display: grid; place-items: center; padding: 1.4rem; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem;
}
.qr-box canvas, .qr-box img { border-radius: 8px; }
.link-row {
  display: flex; gap: .5rem; align-items: stretch; margin-bottom: .9rem;
}
.link-row .input { font-size: .82rem; }

.status-options { display: flex; flex-direction: column; gap: .5rem; }
.status-opt {
  display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); text-align: left; transition: all .14s ease; background: var(--surface);
}
.status-opt:hover { border-color: var(--brand-mid); background: #FCFCFE; }

#toast-root { position: fixed; left: 0; right: 0; bottom: 24px; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: .5rem; pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 999px;
  font-size: .88rem; font-weight: 600; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: .5rem; animation: rise .25s ease;
}
.toast svg { width: 16px; height: 16px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Sanfte Section-Reveals */
.reveal { opacity: 0; transform: translateY(12px); animation: reveal .5s ease forwards; }
.reveal:nth-child(2) { animation-delay: .04s; }
.reveal:nth-child(3) { animation-delay: .08s; }
.reveal:nth-child(4) { animation-delay: .12s; }
.reveal:nth-child(5) { animation-delay: .16s; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Utility */
.row { display: flex; align-items: center; gap: .6rem; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.gap-s { gap: .4rem; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 1.6rem; }
.stack > * + * { margin-top: 1rem; }
.hide { display: none !important; }

/* =========================================================================
   Qlick-Logo (Inline-Lockup: Lupe + Wortmarke)
   ========================================================================= */
.qlick-logo { display: inline-flex; align-items: center; }
.qlick-tile {
  background: #fff; display: grid; place-items: center; flex-shrink: 0;
  border: 1.5px solid rgba(123,47,255,.16); box-shadow: 0 3px 12px rgba(123,47,255,.14);
}
.qlick-tile svg { display: block; }
.qlick-word {
  font-family: "Outfit", var(--font); font-weight: 900; letter-spacing: -.045em;
  color: var(--brand-mid); line-height: 1;
}

/* =========================================================================
   Erweiterungen: Einzelprodukt-Auswahl, Zahlungs-Zusammenfassung, Reset
   ========================================================================= */

/* Bezahlte Positionen in der Rechnungsliste */
.bill-item.is-paid .nm { color: var(--faint); text-decoration: line-through; }
.bill-item.is-paid .pr { color: var(--faint); }
.paid-tag {
  font-size: .68rem; font-weight: 700; color: var(--st-paid); background: var(--st-paid-bg);
  padding: .12rem .45rem; border-radius: 6px; margin-left: .4rem; text-decoration: none;
  display: inline-block; vertical-align: middle;
}

/* Auswahlkarten fuer einzelne Produkte */
.item-pick { display: flex; flex-direction: column; gap: .5rem; }
.pick-card {
  display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left;
  padding: .8rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.pick-card:hover { border-color: var(--brand-mid); }
.pick-card.is-active { border-color: transparent; background: var(--grad-soft); box-shadow: inset 0 0 0 1.5px var(--brand-mid); }
.pick-check {
  width: 20px; height: 20px; border-radius: 6px; border: 2px solid #CDD2E6;
  flex-shrink: 0; position: relative; transition: all .14s ease;
}
.pick-card.is-active .pick-check { background: var(--brand-mid); border-color: var(--brand-mid); }
.pick-card.is-active .pick-check::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.pick-name { flex: 1; min-width: 0; font-size: .92rem; font-weight: 600; color: var(--ink-2); }
.pick-name .qty { color: var(--faint); font-size: .8rem; margin-left: .3rem; }
.pick-price { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Dynamische Zahlungs-Zusammenfassung */
.paysum {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow-xs);
}
.paysum-row { display: flex; justify-content: space-between; font-size: .9rem; color: var(--ink-2); padding: .32rem 0; }
.paysum-row span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.paysum-total {
  border-top: 1px solid var(--line); margin-top: .35rem; padding-top: .65rem;
  font-size: 1.05rem; font-weight: 800; color: var(--ink);
}
.paysum-total span:last-child { font-weight: 800; }
.paysum-rest { color: var(--muted); font-size: .82rem; }

/* Reset-Button im Topbar */
.btn-reset { padding: .5rem .85rem; font-size: .82rem; }
@media (max-width: 760px) { .topbar-sub { display: none; } }

/* Mengen-Auswahl pro Position (Stepper) */
.pick-card { justify-content: space-between; }
.pick-info { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.pick-sub { font-size: .78rem; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; gap: .2rem; flex-shrink: 0; }
.step-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 1.1rem; font-weight: 700;
  line-height: 1; cursor: pointer; transition: border-color .14s ease, background .14s ease;
  display: grid; place-items: center;
}
.step-btn:hover:not(:disabled) { border-color: var(--brand-mid); background: var(--grad-soft); }
.step-btn:disabled { opacity: .4; cursor: default; }
.step-val {
  min-width: 48px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums;
  display: flex; flex-direction: column; line-height: 1.05;
}
.step-val small { font-size: .66rem; font-weight: 600; color: var(--faint); }

/* =========================================================================
   Rechnungs-Modal: Aufteilung bezahlt / offen
   ========================================================================= */
.inv-list { margin-bottom: 1rem; }
.inv-item { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.inv-item:last-child { border-bottom: 0; }
.inv-line { display: flex; justify-content: space-between; gap: 1rem; font-size: .95rem; }
.inv-name { font-weight: 600; color: var(--ink-2); }
.inv-name .qty { color: var(--faint); font-size: .82rem; margin-left: .25rem; }
.inv-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.inv-line.is-paid-full .inv-name,
.inv-line.is-paid-full .inv-price { color: var(--st-paid); text-decoration: line-through; }
.inv-break { display: flex; flex-wrap: wrap; gap: .35rem .8rem; margin-top: .3rem; }
.inv-paid { font-size: .8rem; font-weight: 700; color: var(--st-paid); text-decoration: line-through; }
.inv-open { font-size: .8rem; font-weight: 700; color: var(--st-open); }
.inv-sum { background: var(--bg-2); border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: 1rem; }
.inv-sum-row { display: flex; justify-content: space-between; font-size: .9rem; color: var(--ink-2); padding: .25rem 0; }
.inv-sum-row span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.inv-sum-paid span:last-child { color: var(--st-paid); }
.inv-sum-open { border-top: 1px solid var(--line); margin-top: .25rem; padding-top: .5rem; font-size: 1rem; font-weight: 800; color: var(--ink); }
.inv-sum-open span:last-child { font-weight: 800; }

/* =========================================================================
   Tischplan (Vogelperspektive)
   ========================================================================= */
.floor-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.floor-leg { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.floor-dot { width: 14px; height: 14px; border-radius: 5px; display: inline-block; }
.floor-dot.is-open { background: var(--st-open-bg); border: 2px solid var(--st-open); }
.floor-dot.is-partial { background: var(--st-partial-bg); border: 2px solid var(--st-partial); }
.floor-dot.is-paid { background: var(--st-paid-bg); border: 2px solid var(--st-paid); }
.floor-dot.is-cancelled { background: var(--st-cancelled-bg); border: 2px solid var(--st-cancelled); }

.floor-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.floorplan {
  position: relative; min-width: 520px; height: 440px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background:
    linear-gradient(var(--bg-2) 1px, transparent 1px) 0 0 / 100% 40px,
    linear-gradient(90deg, var(--bg-2) 1px, transparent 1px) 0 0 / 40px 100%,
    var(--surface);
  box-shadow: var(--shadow-xs); overflow: hidden;
}
.floor-zone {
  position: absolute; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--faint);
  background: var(--bg-2); border: 1px dashed var(--line); border-radius: 10px;
  padding: .35rem .7rem;
}
.floor-bar { top: 14px; left: 50%; transform: translateX(-50%); }
.floor-entry { bottom: 14px; right: 16px; }

.floor-table {
  position: absolute; transform: translate(-50%, -50%);
  width: 96px; height: 78px; border-radius: 16px;
  display: grid; place-items: center; gap: .1rem; cursor: pointer;
  border: 2px solid var(--line); background: var(--surface);
  transition: transform .14s ease, box-shadow .14s ease;
}
.floor-table:hover { transform: translate(-50%, -50%) scale(1.05); box-shadow: var(--shadow); z-index: 2; }
.ft-no { font-size: 1.25rem; font-weight: 900; line-height: 1; }
.ft-status { font-size: .66rem; font-weight: 700; text-align: center; line-height: 1.1; }
.floor-table.is-open { background: var(--st-open-bg); border-color: var(--st-open); color: var(--st-open); }
.floor-table.is-partial { background: var(--st-partial-bg); border-color: var(--st-partial); color: var(--st-partial); }
.floor-table.is-paid { background: var(--st-paid-bg); border-color: var(--st-paid); color: var(--st-paid); }
.floor-table.is-cancelled { background: var(--st-cancelled-bg); border-color: var(--st-cancelled); color: var(--st-cancelled); }

/* =========================================================================
   Gast: Speisekarte, Auswahl-Screen, Status frei
   ========================================================================= */

/* Zurueck-Link im Zahlungs-View */
.guest-back {
  background: none; border: 0; color: var(--brand-mid); font-weight: 700; font-size: .85rem;
  padding: .2rem 0; margin-bottom: .6rem; cursor: pointer;
}
.guest-back:hover { text-decoration: underline; }

/* Speisekarte */
.menu-hero-sub { font-size: .82rem; opacity: .9; margin-top: .35rem; }
.menu-cat { margin-top: 1.4rem; }
.menu-cat-head {
  display: flex; align-items: baseline; justify-content: space-between;
  position: sticky; top: 56px; z-index: 6; margin-bottom: .7rem;
  padding: .45rem 0; background: linear-gradient(var(--surface) 72%, rgba(255,255,255,0));
}
.menu-cat-title {
  font-size: 1.08rem; font-weight: 800; color: var(--ink);
  position: relative; padding-left: .72rem; letter-spacing: -0.01em;
}
.menu-cat-title::before {
  content: ""; position: absolute; left: 0; top: .18rem; bottom: .18rem; width: 4px;
  border-radius: 4px; background: var(--grad);
}
.menu-cat-count { font-size: .74rem; font-weight: 700; color: var(--faint); }
.menu-card {
  display: flex; align-items: center; gap: .85rem; padding: .6rem; margin-bottom: .65rem;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color .16s ease, box-shadow .18s ease, transform .18s ease;
}
.menu-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.menu-card.is-active {
  border-color: transparent; box-shadow: inset 0 0 0 1.5px var(--brand-mid), var(--shadow);
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              var(--grad-soft) border-box;
}
.menu-thumb { position: relative; flex-shrink: 0; }
.menu-img {
  width: 72px; height: 72px; border-radius: 14px; object-fit: cover; display: block;
  background: var(--bg-2); box-shadow: inset 0 0 0 1px rgba(16,19,48,.05);
}
.menu-tag {
  position: absolute; top: -7px; left: -6px;
  font-size: .62rem; font-weight: 800; letter-spacing: .02em; color: #fff;
  background: var(--grad); padding: .2rem .45rem; border-radius: 999px;
  box-shadow: 0 4px 10px rgba(123,47,255,.35); white-space: nowrap;
}
.menu-info { flex: 1; min-width: 0; }
.menu-name { font-weight: 800; font-size: .97rem; color: var(--ink); letter-spacing: -0.01em; }
.menu-desc { font-size: .8rem; color: var(--muted); margin: .12rem 0 .28rem; }
.menu-price {
  display: inline-block; font-weight: 800; font-size: .82rem; font-variant-numeric: tabular-nums;
  color: var(--brand-mid); background: var(--grad-soft); padding: .12rem .5rem; border-radius: 999px;
}
.menu-step { flex-shrink: 0; }
.menu-endcap {
  text-align: center; color: var(--faint); font-weight: 700; font-size: .82rem;
  letter-spacing: .16em; text-transform: uppercase; margin: 1.6rem 0 .4rem;
}

/* Scroll-Reveal (sanftes Aufploppen beim Hereinscrollen) */
.pop { opacity: 0; transform: translateY(20px) scale(.98); will-change: opacity, transform; }
.pop.in {
  opacity: 1; transform: none;
  transition: opacity .55s cubic-bezier(.2,.7,.2,1), transform .55s cubic-bezier(.2,.7,.2,1);
  transition-delay: calc(var(--i, 0) * 55ms);
}
@media (prefers-reduced-motion: reduce) {
  .pop { opacity: 1; transform: none; }
  .pop.in { transition: none; }
}

/* Auswahl-Screen (Rechnung bezahlen / weiter bestellen) */
.choice-grid { display: grid; grid-template-columns: 1fr; gap: .8rem; margin-top: 1rem; }
.choice-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: .2rem;
  padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; text-align: left;
  transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}
.choice-btn:hover { border-color: var(--brand-mid); box-shadow: var(--shadow); transform: translateY(-1px); }
.choice-pay { background: var(--grad); border-color: transparent; color: #fff; }
.choice-pay .choice-s { color: rgba(255,255,255,.85); }
.choice-ic { width: 26px; height: 26px; display: grid; place-items: center; margin-bottom: .2rem; }
.choice-pay .choice-ic svg, .choice-pay .choice-ic { color: #fff; }
.choice-t { font-weight: 800; font-size: 1.05rem; }
.choice-s { font-size: .85rem; color: var(--muted); font-weight: 600; }

/* Status frei */
.badge--free { color: #5B6473; background: #EEF1F7; }
.floor-dot.is-free { background: #EEF1F7; border: 2px solid #B6BECF; }
.floor-table.is-free { background: #F4F6FA; border-color: #C2C9D8; color: #6B7383; }

/* Stornieren-Button im Auswahl-Screen */
.choice-cancel { border-color: #F1C4C4; color: #C0392B; }
.choice-cancel:hover { border-color: #C0392B; box-shadow: var(--shadow); }
.choice-cancel .choice-s { color: #C0392B; opacity: .8; }

/* Tischplan und Diverses auf dem Smartphone */
@media (max-width: 680px) {
  .floorplan { min-width: 0; height: 500px; }
  .floor-table { width: 84px; height: 70px; }
  .ft-no { font-size: 1.1rem; }
  .modal { padding: 1.25rem; }
  .choice-btn { padding: 1rem 1.05rem; }
  .guest-body { padding: 1rem 1rem 1.6rem; }
}

/* =========================================================================
   Rechnungs-Modal (PDF-Download, Mail) und Soft-Button
   ========================================================================= */
.btn-soft {
  background: var(--grad-soft); color: var(--brand-mid); font-weight: 700;
  border: 1px solid transparent; border-radius: var(--radius); padding: .8rem 1rem;
  cursor: pointer; transition: box-shadow .16s ease, transform .16s ease;
}
.btn-soft:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.modal-head-actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.icon-btn {
  display: inline-flex; align-items: center; gap: .35rem; height: 34px; padding: 0 .7rem;
  border-radius: 9px; background: var(--grad-soft); color: var(--brand-mid);
  font-weight: 700; font-size: .82rem; cursor: pointer; border: 1px solid transparent;
  transition: box-shadow .14s ease;
}
.icon-btn:hover { box-shadow: var(--shadow-xs); }
.icon-btn-txt { font-variant-numeric: tabular-nums; }

.rc-block { margin-bottom: 1rem; }
.rc-block:last-of-type { margin-bottom: 0; }
.rc-block-title {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--faint); font-weight: 700; margin-bottom: .45rem;
}
