/* GastroKasse — Design-System "Pass"
   Touch-Kasse, dunkles Service-Station-Theme, Kupfer-Akzent. */

:root {
  --bg:        #16181d;
  --bg-2:      #1d2027;
  --bg-3:      #262a33;
  --line:      #333845;
  --line-2:    #424857;
  --text:      #e8e6e1;
  --text-dim:  #9aa0ab;
  --text-mute: #6b7280;

  --copper:    #d98e4b;   /* Hauptakzent */
  --copper-d:  #b87334;
  --green:     #4caf7d;
  --red:       #e05c5c;
  --blue:      #5b8def;
  --amber:     #e0b34c;

  --r:         14px;
  --r-sm:      9px;
  --shadow:    0 6px 20px rgba(0,0,0,.35);
  --font:      system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:      "SF Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px;
  -webkit-user-select: none; user-select: none;
}

button { font-family: inherit; cursor: pointer; border: none; color: inherit; }
input { font-family: inherit; }

/* ---- Topbar ---- */
.topbar {
  height: 58px; display: flex; align-items: center; gap: 16px;
  padding: 0 18px; background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 700; font-size: 19px; letter-spacing: .3px;
  display: flex; align-items: center; gap: 9px;
}
.brand .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--copper); box-shadow: 0 0 12px var(--copper);
}
.topbar .spacer { flex: 1; }
.chip {
  font-size: 12.5px; padding: 5px 11px; border-radius: 99px;
  background: var(--bg-3); color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.warn { background: #3a2a1a; color: var(--amber); }
.chip .led { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.user-pill {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px 6px 13px; background: var(--bg-3);
  border-radius: 99px; font-size: 14px;
}
.user-pill .av {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--copper); color: #1a1208; font-weight: 700;
  display: grid; place-items: center; font-size: 13px;
}

/* ---- Nav ---- */
.nav { display: flex; gap: 4px; }
.nav button {
  padding: 8px 16px; border-radius: var(--r-sm); background: transparent;
  color: var(--text-dim); font-size: 14.5px; font-weight: 600;
}
.nav button.active { background: var(--bg-3); color: var(--text); }

/* ---- Layout ---- */
.app { height: calc(100% - 58px); display: flex; }
.view { flex: 1; overflow: hidden; display: none; }
.view.active { display: flex; }

/* ---- Tischplan ---- */
.tables-wrap { flex: 1; overflow-y: auto; padding: 22px; }
.area-block { margin-bottom: 28px; }
.area-head {
  font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-mute); margin: 0 0 14px; font-weight: 700;
}
.table-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 14px;
}
.table-card {
  aspect-ratio: 1; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px; display: flex; flex-direction: column;
  transition: transform .12s, border-color .12s; position: relative;
}
.table-card:active { transform: scale(.97); }
.table-card.occupied { border-color: var(--copper); background: #25201a; }
.table-card .tnum { font-size: 30px; font-weight: 800; line-height: 1; }
.table-card .tseats { font-size: 12.5px; color: var(--text-mute); margin-top: 3px; }
.table-card .tfoot { margin-top: auto; }
.table-card .ttotal { font-size: 17px; font-weight: 700; color: var(--copper); }
.table-card .ttime { font-size: 11.5px; color: var(--text-dim); }
.table-card .badge-occ {
  position: absolute; top: 12px; right: 12px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--copper);
}

/* ---- Bestellansicht (POS) ---- */
.pos { flex: 1; display: flex; }
.pos-menu { flex: 1.4; display: flex; flex-direction: column; border-right: 1px solid var(--line); min-width: 0; }
.cat-bar {
  display: flex; gap: 8px; padding: 14px 16px; overflow-x: auto;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.cat-bar button {
  padding: 9px 17px; border-radius: 99px; background: var(--bg-3);
  color: var(--text-dim); font-weight: 600; font-size: 14.5px; white-space: nowrap;
  border: 1.5px solid transparent;
}
.cat-bar button.active { color: var(--text); border-color: var(--cat-color, var(--copper)); background: var(--bg-2); }
.product-grid {
  flex: 1; overflow-y: auto; padding: 16px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px; align-content: start;
}
.product-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 13px; min-height: 92px; display: flex; flex-direction: column;
  justify-content: space-between; text-align: left; transition: transform .1s, background .1s;
}
.product-card:active { transform: scale(.96); background: var(--bg-3); }
.product-card .pname { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.product-card .pprice { font-size: 16px; font-weight: 700; color: var(--copper); margin-top: 8px; }
.product-card .ptax { font-size: 10.5px; color: var(--text-mute); }

/* ---- Bon / Warenkorb ---- */
.cart { flex: 1; display: flex; flex-direction: column; background: var(--bg-2); min-width: 320px; max-width: 400px; }
.cart-head {
  padding: 16px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.cart-head .back { width: 38px; height: 38px; border-radius: var(--r-sm); background: var(--bg-3); font-size: 20px; display:grid; place-items:center; }
.cart-head .ctitle { font-size: 17px; font-weight: 700; }
.cart-head .csub { font-size: 12.5px; color: var(--text-dim); }
.cart-items { flex: 1; overflow-y: auto; padding: 8px 0; }
.cart-empty { text-align: center; color: var(--text-mute); padding: 50px 20px; font-size: 14px; }
.citem {
  display: flex; align-items: center; gap: 10px; padding: 11px 18px;
  border-bottom: 1px solid var(--bg-3);
}
.citem.sent { opacity: .62; }
.citem .cqty {
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: var(--r-sm);
  background: var(--bg-3); font-weight: 700; font-size: 15px; display: grid; place-items: center;
}
.citem .cinfo { flex: 1; min-width: 0; }
.citem .cn { font-size: 14.5px; font-weight: 600; }
.citem .cmeta { font-size: 11.5px; color: var(--text-mute); }
.citem .cnote { font-size: 11.5px; color: var(--amber); margin-top: 2px; }
.citem .cinfo { cursor: pointer; }

.pay-extra-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.pay-extra-row .btn { padding: 11px; font-size: 14px; }

.table-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 10px; }
.table-pick {
  aspect-ratio: 1.3; background: var(--bg-3); border: 1px solid var(--line);
  border-radius: var(--r-sm); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; font-weight: 700; font-size: 17px;
}
.table-pick small { font-weight: 400; font-size: 11px; color: var(--text-mute); }
.table-pick.current { border-color: var(--copper); background: #25201a; }
.table-pick:active { transform: scale(.95); }
.citem .cline { font-weight: 700; font-size: 14.5px; }
.citem .cdel { color: var(--red); font-size: 19px; padding: 4px 6px; background: none; }
.citem .sent-tag { font-size: 10px; color: var(--green); border:1px solid var(--green); border-radius:4px; padding:1px 4px; }

.cart-foot { border-top: 1px solid var(--line); padding: 16px 18px; flex-shrink: 0; }
.tax-lines { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.tax-lines .tl { display: flex; justify-content: space-between; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.cart-total .lbl { font-size: 14px; color: var(--text-dim); }
.cart-total .amt { font-size: 28px; font-weight: 800; }
.cart-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn {
  padding: 14px; border-radius: var(--r-sm); font-weight: 700; font-size: 15px;
  background: var(--bg-3); color: var(--text); transition: transform .1s, filter .1s;
}
.btn:active { transform: scale(.97); }
.btn.full { grid-column: 1 / -1; }
.btn.copper { background: var(--copper); color: #1a1208; }
.btn.green { background: var(--green); color: #08130c; }
.btn.ghost { background: transparent; border: 1px solid var(--line-2); }
.btn:disabled { opacity: .4; pointer-events: none; }

/* ---- Modal ---- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 120; padding: 20px;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r);
  width: 100%; max-width: 440px; box-shadow: var(--shadow); overflow: hidden;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.93); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); font-size: 18px; font-weight: 700; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.modal-foot .btn { flex: 1; }

/* Zahlung */
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.pay-method {
  padding: 18px; border-radius: var(--r-sm); background: var(--bg-3);
  border: 2px solid transparent; text-align: center; font-weight: 600;
}
.pay-method.active { border-color: var(--copper); background: #25201a; }
.pay-method .ico { font-size: 26px; display: block; margin-bottom: 4px; }
.pay-total-big { text-align: center; font-size: 38px; font-weight: 800; margin: 6px 0 18px; }
.cash-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.cash-pad button { padding: 16px; border-radius: var(--r-sm); background: var(--bg-3); font-size: 18px; font-weight: 700; }
.cash-display { text-align: center; padding: 12px; background: var(--bg); border-radius: var(--r-sm); margin-bottom: 8px; }
.cash-display .given { font-size: 22px; font-weight: 700; }
.cash-display .change { font-size: 14px; color: var(--green); margin-top: 4px; }

/* ---- Login ---- */
.login-screen {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.login-box { width: 340px; text-align: center; }
.login-box .logo { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.login-box .logo .dot { display:inline-block; width:12px; height:12px; border-radius:50%; background:var(--copper); margin-right:8px; box-shadow:0 0 14px var(--copper); }
.login-box .tag { color: var(--text-dim); font-size: 14px; margin-bottom: 30px; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 26px 0; }
.pin-dots .pd { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); }
.pin-dots .pd.on { background: var(--copper); border-color: var(--copper); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pin-pad button {
  height: 64px; border-radius: var(--r); background: var(--bg-2);
  border: 1px solid var(--line); font-size: 24px; font-weight: 600;
}
.pin-pad button:active { background: var(--bg-3); }
.login-toggle { margin-top: 24px; color: var(--text-dim); font-size: 13.5px; background: none; text-decoration: underline; }
.login-error { color: var(--red); font-size: 13.5px; min-height: 18px; margin-top: 12px; }
.field { width: 100%; padding: 14px 16px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line); color: var(--text); font-size: 16px; margin-bottom: 12px; }
.field:focus { outline: none; border-color: var(--copper); }

/* ---- Berichte ---- */
.report-wrap { flex: 1; overflow-y: auto; padding: 24px; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.stat-card .sl { font-size: 12.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
.stat-card .sv { font-size: 26px; font-weight: 800; margin-top: 6px; }
.report-table { width: 100%; border-collapse: collapse; background: var(--bg-2); border-radius: var(--r); overflow: hidden; }
.report-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-mute); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.report-table td { padding: 12px 16px; border-bottom: 1px solid var(--bg-3); font-size: 14px; }
.report-table tr:last-child td { border-bottom: none; }
.section-title { font-size: 15px; font-weight: 700; margin: 24px 0 12px; }

/* ---- Bon-Druck (Beleg) ---- */
.receipt-paper { background: #fff; color: #111; border-radius: 8px; padding: 22px; font-family: var(--mono); font-size: 13px; line-height: 1.55; }
.receipt-paper .rc { text-align: center; }
.receipt-paper .rsmall { font-size: 11px; color: #444; }
.receipt-paper .rnote { font-size: 11px; color: #555; font-style: italic; }
.receipt-paper hr { border: none; border-top: 1px dashed #aaa; margin: 10px 0; }
.receipt-paper .rrow { display: flex; justify-content: space-between; }
.receipt-paper .rtotal { font-size: 17px; font-weight: 700; }
.receipt-paper .tse-block { font-size: 9px; word-break: break-all; color: #555; margin-top: 8px; }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-3); border: 1px solid var(--line-2); padding: 13px 22px;
  border-radius: 99px; font-size: 14px; font-weight: 600; opacity: 0;
  transition: all .25s; z-index: 200; box-shadow: var(--shadow); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: var(--green); }
.toast.err { border-color: var(--red); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

.qty-stepper { display: flex; align-items: center; gap: 8px; }
.qty-stepper button { width: 30px; height: 30px; border-radius: 7px; background: var(--bg); font-size: 18px; font-weight: 700; }

/* ---- Verwaltung ---- */
.admin-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.admin-tabs {
  display: flex; gap: 4px; padding: 14px 20px 0; overflow-x: auto;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.admin-tabs button {
  padding: 11px 18px; background: transparent; color: var(--text-dim);
  font-weight: 600; font-size: 14.5px; white-space: nowrap;
  border-bottom: 2.5px solid transparent; border-radius: 8px 8px 0 0;
}
.admin-tabs button.active { color: var(--text); border-bottom-color: var(--copper); }
.admin-content { flex: 1; overflow-y: auto; padding: 22px; }

.admin-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.admin-bar .title { font-size: 18px; font-weight: 700; flex: 1; }
.admin-bar .btn { padding: 10px 18px; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-2); border-radius: var(--r); overflow: hidden; }
.admin-table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-mute); padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--bg-3); font-size: 14px; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.admin-table .icon-btn {
  width: 34px; height: 34px; border-radius: 8px; background: var(--bg-3);
  display: grid; place-items: center; font-size: 15px;
}
.admin-table .icon-btn.del { color: var(--red); }
.admin-table .icon-btn:active { transform: scale(.94); }

.tag-pill { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.tag-pill.on  { background: #1d3326; color: var(--green); }
.tag-pill.off { background: #3a2222; color: var(--red); }
.tag-pill.role { background: var(--bg-3); color: var(--text-dim); }
.color-dot { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: middle; margin-right: 6px; }

/* Formular im Modal */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.form-row input[type=text], .form-row input[type=number], .form-row input[type=password], .form-row select {
  width: 100%; padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--bg); border: 1px solid var(--line); color: var(--text); font-size: 15px;
}
.form-row input:focus, .form-row select:focus { outline: none; border-color: var(--copper); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-check { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.form-check input { width: 20px; height: 20px; accent-color: var(--copper); }
.form-check label { margin: 0; font-size: 14px; color: var(--text); }
.empty-hint { text-align: center; color: var(--text-mute); padding: 40px 20px; }

/* ============================================================
   SMARTPHONE — Layout für schmale Screens (≤ 720px)
   Desktop/Tablet bleibt unverändert.
   ============================================================ */

/* Default: Mobile-Elemente ausblenden (nur < 720px aktiv) */
.sheet-close,
.cart-summary-bar,
.cart-backdrop { display: none; }

@media (max-width: 720px) {

  html, body { font-size: 15px; }

  /* ---- Topbar kompakter, kein Überlauf ---- */
  .topbar {
    height: 54px; padding: 0 10px; gap: 8px;
    padding-top: env(safe-area-inset-top);
    height: calc(54px + env(safe-area-inset-top));
  }
  .brand { font-size: 16px; gap: 6px; flex-shrink: 0; }
  /* Brand-Text am Handy ausblenden — nur der Punkt bleibt als Logo */
  .brand { font-size: 0; }
  .brand .dot { width: 13px; height: 13px; }
  .nav { flex-shrink: 0; }
  .nav button { padding: 7px 12px; font-size: 14px; }
  /* TSE-Chip am Handy ausblenden (Status bleibt im Bericht/Login sichtbar) */
  .topbar .chip { display: none; }
  .user-pill { padding: 4px; flex-shrink: 0; }
  .user-pill #userName { display: none; }   /* nur Avatar zeigen */
  /* Abmelden als kompaktes Icon, nie abgeschnitten */
  .topbar .btn.ghost {
    padding: 0; width: 38px; height: 38px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 0;
  }
  .topbar .btn.ghost::after { content: "⎋"; font-size: 20px; }

  /* ---- App-Höhe an mobile Topbar (inkl. Safe-Area oben) anpassen ---- */
  .app { height: calc(100% - 54px - env(safe-area-inset-top)); }

  /* ---- Tischplan: enger ---- */
  .tables-wrap { padding: 14px; }
  .table-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
  .table-card { padding: 11px; border-radius: 12px; }
  .table-card .tnum { font-size: 24px; }
  .area-block { margin-bottom: 20px; }

  /* ---- POS: Produkte über volle Breite, Warenkorb wird Sheet ---- */
  .pos { flex-direction: column; position: relative; }
  .pos-menu {
    flex: 1; border-right: none;
    /* Platz für die fixe Zusammenfassungsleiste unten + Gestenleiste freihalten */
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }
  .cat-bar { padding: 10px 12px; gap: 6px; }
  .cat-bar button { padding: 8px 14px; font-size: 14px; }
  .product-grid {
    padding: 12px;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
  }
  .product-card { min-height: 84px; padding: 12px 11px; }
  .product-card .pname { font-size: 14px; }
  .product-card .pprice { font-size: 15px; margin-top: 6px; }

  /* ---- Warenkorb als Bottom-Sheet ---- */
  .cart {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    max-width: none; min-width: 0;
    height: 82vh; max-height: 82vh;
    border-top-left-radius: 18px; border-top-right-radius: 18px;
    border-top: 1px solid var(--line-2);
    box-shadow: 0 -10px 30px rgba(0,0,0,.45);
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    z-index: 60;
  }
  .cart.open { transform: translateY(0); }
  .cart .cart-foot { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }

  .cart-head { padding: 14px 16px; position: relative; }
  /* Greifbarer "Handle" oben am Sheet */
  .cart-head::before {
    content: ""; position: absolute; top: 7px; left: 50%;
    transform: translateX(-50%);
    width: 38px; height: 4px; border-radius: 99px; background: var(--line-2);
  }
  .cart-head .back { display: none; }     /* am Handy stattdessen × / Backdrop */
  .sheet-close {
    display: grid; place-items: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bg-3); font-size: 22px; color: var(--text-dim);
    flex-shrink: 0;
  }

  /* Backdrop hinter dem Sheet */
  .cart-backdrop {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); opacity: 0; pointer-events: none;
    transition: opacity .28s; z-index: 55;
  }
  .cart-backdrop.show { opacity: 1; pointer-events: auto; }

  /* ---- Fixe Zusammenfassungsleiste unten (über der Gestenleiste) ---- */
  .cart-summary-bar {
    display: flex; align-items: center; gap: 12px;
    position: fixed; left: 10px; right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    height: 58px; padding: 0 16px 0 12px;
    background: var(--copper); color: #1a1208;
    border-radius: 14px; z-index: 50;
    box-shadow: 0 6px 20px rgba(0,0,0,.4);
    font-weight: 700; transition: transform .12s, opacity .2s;
  }
  .cart-summary-bar:active { transform: scale(.98); }
  .cart-summary-bar.hidden { opacity: 0; pointer-events: none; transform: translateY(20px); }
  .csb-count {
    min-width: 30px; height: 30px; padding: 0 8px;
    background: rgba(0,0,0,.22); border-radius: 99px;
    display: grid; place-items: center; font-size: 15px;
  }
  .csb-label { flex: 1; font-size: 15px; }
  .csb-total { font-size: 18px; font-weight: 800; }

  /* Auf dem Tischplan / Berichten keine Summenleiste */
  #view-tables .cart-summary-bar,
  #view-reports .cart-summary-bar { display: none; }

  /* ---- Modals: am unteren Rand andocken, volle Breite ---- */
  .modal-bg { align-items: flex-end; padding: 0; }
  .modal {
    max-width: none; width: 100%;
    border-bottom-left-radius: 0; border-bottom-right-radius: 0;
    max-height: 92vh; overflow-y: auto;
    animation: slideUp .26s ease;
  }
  @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .modal-head { padding: 16px 18px; }
  .modal-body { padding: 18px; }
  .modal-foot { padding: 14px 18px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }

  /* Zahlung: Bartasten griffiger */
  .pay-total-big { font-size: 34px; }
  .cash-pad button { padding: 18px; font-size: 17px; }

  /* ---- Berichte: Tabellen scrollbar, Karten gestapelt ---- */
  .report-wrap { padding: 16px; padding-bottom: 24px; }
  .report-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .sv { font-size: 22px; }
  .report-table { font-size: 13px; display: block; overflow-x: auto; white-space: nowrap; }
  .report-table th, .report-table td { padding: 10px 12px; }

  /* Verwaltung am Handy */
  .admin-tabs { padding: 10px 12px 0; }
  .admin-tabs button { padding: 9px 13px; font-size: 13.5px; }
  .admin-content { padding: 14px; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; font-size: 13px; }
  .admin-bar .title { font-size: 16px; }
  .form-grid { grid-template-columns: 1fr; }

  /* ---- Login: an Bildschirm anpassen ---- */
  .login-box { width: 100%; padding: 0 24px; }
  .pin-pad button { height: 58px; font-size: 22px; }
}

/* Sehr schmale Geräte */
@media (max-width: 360px) {
  .table-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .report-grid { grid-template-columns: 1fr; }
}

/* ---- PWA: Installations-Hinweis & Update-Leiste ---- */
.pwa-install, .pwa-update {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(140%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-3); border: 1px solid var(--line-2);
  padding: 12px 14px 12px 18px; border-radius: 14px;
  box-shadow: var(--shadow); z-index: 300; max-width: 92vw;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.pwa-install.show, .pwa-update.show { transform: translateX(-50%) translateY(0); }
.pwa-install-text { font-size: 14.5px; font-weight: 600; }
.pwa-install-btn, .pwa-update-btn {
  padding: 9px 16px; border-radius: 9px; background: var(--copper); color: #1a1208;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.pwa-install-btn:active, .pwa-update-btn:active { transform: scale(.96); }
.pwa-install-close {
  width: 30px; height: 30px; border-radius: 50%; background: transparent;
  color: var(--text-dim); font-size: 20px; flex-shrink: 0;
}
.pwa-update { border-color: var(--copper); }
.pwa-update span { font-size: 14.5px; font-weight: 600; }

/* Standalone-Modus: kleine Politur, wenn als App gestartet */
@media (display-mode: standalone) {
  .topbar { padding-top: max(0px, env(safe-area-inset-top)); }
}

/* ============================================================
   DRUCK — nur der Kassenbeleg, sauber auf Bonpapier (80mm)
   ============================================================ */
/* Druck-Host (nur im Druck sichtbar) */
#printHost { display: none; }

@media print {
  /* Hochformat, schmale Bonbreite */
  @page { size: 80mm 200mm portrait; margin: 3mm; }

  /* Im Druckmodus: gesamten App-Inhalt ausblenden ... */
  body.printing > *:not(#printHost) { display: none !important; }
  body:not(.printing) #printHost { display: none !important; }

  html, body {
    background: #fff !important; margin: 0 !important; padding: 0 !important;
    height: auto !important; overflow: visible !important;
  }

  /* Nur der geklonte Beleg, oben links, fester Bonbreite, ein Block */
  #printHost {
    display: block !important; position: static !important;
    margin: 0 !important; padding: 0 !important;
  }
  #printHost .receipt-paper {
    position: static !important;
    width: 74mm !important; max-width: 74mm !important;
    margin: 0 !important; padding: 0 !important;
    background: #fff !important; color: #000 !important;
    border-radius: 0 !important; box-shadow: none !important;
    font-family: var(--mono) !important;
    font-size: 11px !important; line-height: 1.45 !important;
    page-break-inside: avoid !important; break-inside: avoid !important;
  }
  #printHost .rc { text-align: center !important; }
  #printHost .rrow { display: flex !important; justify-content: space-between !important; }
  #printHost hr { border: none !important; border-top: 1px dashed #000 !important; margin: 6px 0 !important; }
  #printHost .rtotal { font-size: 13px !important; font-weight: 700 !important; }
  #printHost .tse-block { font-size: 8px !important; color: #000 !important; word-break: break-all !important; }
  #printHost .rsmall { font-size: 10px !important; }
  #printHost .rnote { font-size: 10px !important; font-style: italic !important; }
}

  /* Sicherheitshalber: fixe Overlays/Leisten nicht drucken */
  .topbar, .toast, .cart-summary-bar, .pwa-install, .pwa-update,
  .cart-backdrop { display: none !important; }
}
