/* Optimiert für 7″ Touch: offiziell 800×480, oft auch 1024×600 */

:root {
  --bg: #1a1f1c;
  --bg-panel: #242b27;
  --bg-elevated: #2e3732;
  --border: #3d4a42;
  --text: #f2f5f3;
  --text-muted: #a8b5ad;
  --accent: #5cb85c;
  --accent-dark: #3d8b3d;
  --danger: #d9534f;
  --warning: #f0ad4e;
  --touch-min: 48px;
  --topbar-h: 36px;
  --side-w: 38vw;
  --font: 20px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.25;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  /* Touch: standard Pan/Zoom-Verhalten erlauben wo nötig */
  touch-action: manipulation;
}

/* Popup-Karte / Schein-Layout (Breite für zentriertes Numpad) */
:root {
  --modal-card-w: min(414px, 90vw);
}

/* 7″ Querformat (RPi-Display & ähnliche) */
@media (max-height: 520px), (max-width: 900px) {
  :root {
    --font: 19px;
    --touch-min: 46px;
    --topbar-h: 34px;
    --side-w: min(300px, 40vw);
    --modal-card-w: min(400px, 88vw);
  }
}

/* ~10,1″ Tablets (z. B. 1280×800) */
@media (min-width: 1000px) and (min-height: 580px) {
  :root {
    --font: 22px;
    --touch-min: 50px;
    --topbar-h: 34px;
    --side-w: min(340px, 36vw);
    --modal-card-w: min(460px, 42vw);
  }
}

@media (min-width: 1200px) and (min-height: 700px) {
  :root {
    --modal-card-w: min(500px, 40vw);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  height: 100%;
  width: 100%;
  max-height: 100dvh;
  overflow: hidden;
  /* wichtig für Touch-Scroll in Chromium/Kiosk */
  touch-action: manipulation;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  min-height: var(--touch-min);
  touch-action: manipulation;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

input {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 0.35rem 0.5rem;
  min-height: var(--touch-min);
}

.app-shell {
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

/* ---- Topbar ---- */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.4rem;
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  max-height: var(--topbar-h);
  padding: 0 0.4rem 0 0.55rem;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.topbar-date {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  justify-self: start;
  color: var(--text);
}

.topbar-time {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
  justify-self: center;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  gap: 0.3rem;
  flex-wrap: nowrap;
  justify-self: end;
}

.topbar .btn {
  min-height: 28px;
  padding: 0.15rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn {
  padding: 0.4rem 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.95rem;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #0d1a0d;
  font-weight: 700;
}

.btn-primary:active:not(:disabled) {
  background: var(--accent-dark);
}

.btn-danger {
  background: #d32f2f;
  border-color: #b71c1c;
  color: #fff;
  font-weight: 700;
}

.btn-danger:active:not(:disabled) {
  background: #b71c1c;
}

.btn-ghost {
  background: transparent;
}

.toast {
  position: fixed;
  top: 0.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: #2a3a2e;
  border: 1px solid var(--accent);
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  font-weight: 600;
  font-size: 0.9rem;
  max-width: 90vw;
  text-align: center;
}

.toast.error {
  border-color: var(--danger);
  background: #3a2220;
}

.toast.success {
  border-color: var(--accent);
}

/* Kasse: Hinweis wenn Verkauf nicht auf „heute“ gebucht wird */
.pos-booking-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(240, 173, 78, 0.55);
  background: rgba(240, 173, 78, 0.14);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
}
.pos-booking-day-lbl {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.65rem;
}
.pos-booking-day-val {
  color: #ffd48a;
  font-variant-numeric: tabular-nums;
}

/* ---- POS: links Produkte, rechts Warenkorb+Zahlung ---- */
.pos-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr var(--side-w);
  min-height: 0;
  overflow: hidden;
}

.products-panel {
  --product-gap: 0.35rem;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto; /* Scrollbar nur bei Bedarf */
  padding: var(--product-gap);
  -webkit-overflow-scrolling: touch;
  touch-action: none; /* Drag-Scroll per JS (Pi emuliert oft Maus) */
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 181, 173, 0.45) transparent;
  contain: layout style;
  /* scrollTop-Änderungen nicht animieren */
  scroll-behavior: auto;
  /* Höhe für 2 sichtbare Kachelreihen (cqh) */
  container-type: size;
  container-name: products;
}

.products-panel::-webkit-scrollbar {
  width: 6px;
}
.products-panel::-webkit-scrollbar-track {
  background: transparent;
}
.products-panel::-webkit-scrollbar-thumb {
  background: rgba(168, 181, 173, 0.4);
  border-radius: 99px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
.products-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 181, 173, 0.65);
  background-clip: padding-box;
}

/* Während Drag/Momentum: weniger Paint-Jank */
.scroll-panel.is-scrolling,
.scroll-panel.is-scrolling * {
  pointer-events: none !important;
}
.scroll-panel.is-scrolling .product-tile {
  transition: none !important;
}

.product-grid {
  display: grid;
  /* fest 3 Spalten (7″) */
  grid-template-columns: repeat(3, 1fr);
  gap: var(--product-gap);
  /* genau 2 Reihen im sichtbaren Bereich, Rest per Scroll */
  grid-auto-rows: calc((100cqh - var(--product-gap)) / 2);
  align-content: start;
  touch-action: none;
  /* ein Layer für flüssigeres Scrollen auf dem Pi */
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Fallback ohne Container-Queries: 2 Reihen = Viewport − Topbar − Gaps */
@supports not (height: 1cqh) {
  .product-grid {
    grid-auto-rows: calc((100dvh - var(--topbar-h) - var(--product-gap) * 3) / 2);
  }
}

.product-tile {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  aspect-ratio: auto;
  padding: 0;
  border-radius: 10px;
  border: 2px solid transparent;
  color: #fff;
  font-weight: 700;
  text-align: center;
  overflow: hidden;
  background: #0d0d0d; /* dunkler Grund, damit contain-Ränder sauber wirken */
  cursor: pointer;
  transition: filter 0.12s ease, opacity 0.12s ease, border-color 0.12s ease;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  /* none: Scroll per JS, damit Touch am Pi funktioniert */
  touch-action: none;
  -webkit-user-drag: none;
  contain: layout style paint;
}

.product-tile .product-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* ganzes Produkt sichtbar, nicht abschneiden */
  object-position: center;
  pointer-events: none;
  z-index: 0;
  padding: 1.35rem 0.3rem 1.25rem; /* Platz für Name oben / Preis unten */
  /* günstigeres Compositing beim Scrollen */
  image-rendering: auto;
  transform: translateZ(0);
}

/* Name oben – heller Verlauf */
.product-tile .name {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.2;
  padding: 0.5rem 0.4rem 1.1rem;
  max-height: 48%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: #fff;
  letter-spacing: 0.01em;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 8px rgba(0, 0, 0, 0.5);
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.28) 50%,
    rgba(0, 0, 0, 0) 100%
  );
}

/* Preis unten – heller Verlauf, weißer Text */
.product-tile .price {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  font-size: 1.25rem;
  font-weight: 900;
  padding: 1.1rem 0.4rem 0.45rem;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 8px rgba(0, 0, 0, 0.5);
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.28) 50%,
    rgba(0, 0, 0, 0) 100%
  );
}

/* Menge +/− zentriert */
.tile-qty-controls {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  pointer-events: none;
}

.tile-qty-controls .tile-qty-btn,
.tile-qty-controls .tile-qty {
  pointer-events: auto;
}

.tile-qty {
  min-width: 1.6rem;
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.tile-qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  min-height: 2.25rem;
  min-width: 2.25rem;
  padding: 0;
  border-radius: 999px;
  border: 2px solid transparent;
  touch-action: manipulation;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.tile-qty-btn-plus {
  background: #2f9e44;
  border-color: #37b34d;
}

.tile-qty-btn-minus {
  background: #c92a2a;
  border-color: #e03131;
}

.tile-qty-btn:active {
  transform: scale(0.94);
  filter: brightness(0.88);
}



.product-tile.selected {
  border-color: rgba(255, 255, 255, 0.7);
}

.product-tile.selected .product-img {
  filter: brightness(0.55) saturate(0.7);
}

.product-tile.selected::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  z-index: 1;
  pointer-events: none;
}

.side-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  overflow: hidden;
}

.cart {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  padding: 0.3rem 0.4rem 0;
}

.cart h2 {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.cart-list {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto; /* Scrollbar nur bei Bedarf */
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: none; /* Drag-Scroll per JS (wie Produkte) */
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 181, 173, 0.45) transparent;
  contain: layout style;
  scroll-behavior: auto;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.cart-list::-webkit-scrollbar {
  width: 6px;
}
.cart-list::-webkit-scrollbar-track {
  background: transparent;
}
.cart-list::-webkit-scrollbar-thumb {
  background: rgba(168, 181, 173, 0.4);
  border-radius: 99px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
.cart-list::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 181, 173, 0.65);
  background-clip: padding-box;
}

.cart-empty {
  color: var(--text-muted);
  padding: 0.4rem 0.15rem;
  font-size: 0.8rem;
}

.cart-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 0.3rem;
  align-items: center;
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 0.2rem 0.35rem;
}

.cart-row .label {
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-row .line-total {
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.95rem;
}

.cart-row .controls {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.cart-row .controls button {
  min-height: 30px;
  min-width: 34px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 6px;
  color: #fff;
}

.cart-row .controls .cart-btn-plus {
  background: #2f9e44;
  border-color: #37b34d;
}

.cart-row .controls .cart-btn-minus {
  background: #c92a2a;
  border-color: #e03131;
}

.cart-row .controls .qty-label {
  min-width: 1.25rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ---- Zahlung (ohne Nummernpad) ---- */
.cash-panel {
  flex: 0 0 auto;
  min-height: 0;
  border-top: 1px solid var(--border);
  padding: 0.35rem 0.35rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: #1e2621;
  overflow: hidden;
}

.cash-quick {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr 0.7fr;
  gap: 0.25rem;
}

.cash-quick .btn {
  min-height: 42px;
  padding: 0.3rem 0.15rem;
  font-size: 0.9rem;
  font-weight: 700;
}

/* Summe / Gegeben / Rückgeld */
.cash-summary {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 0;
}

.cash-lines {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
  padding: 0.15rem 0.1rem;
}

.cash-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.65rem;
  width: 100%;
}

.cash-line-lbl {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
}

.cash-line-val {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
  margin-left: auto;
}

.cash-line-change {
  color: var(--accent);
}

.cash-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.cash-row.total {
  font-size: 1rem;
  font-weight: 800;
}

.cash-row .change.ok {
  color: var(--accent);
  font-weight: 800;
}

.cash-row .change.bad {
  color: var(--danger);
  font-weight: 800;
}

.cash-actions {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.3rem;
  flex-shrink: 0;
  align-items: stretch;
}

.cash-actions .btn {
  min-height: 48px;
  padding: 0.4rem;
  font-size: 1.05rem;
  border-radius: 8px;
}

.cash-actions .btn-clear-icon {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 48px;
  min-height: 48px !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.cash-actions .btn-clear-icon .icon-trash {
  display: block;
  width: 1.45rem;
  height: 1.45rem;
  pointer-events: none;
}

.cash-actions .btn-pay {
  min-height: 48px;
  font-size: 1.2rem;
}

/* ---- Gegeben-Popover: kleine Karte, zentriert, NICHT volle Höhe ---- */
.modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 500;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  /* kein Flex-Stretch der Karte */
  display: block !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: visible !important;
  pointer-events: none;
}

.modal[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.81);
  pointer-events: auto;
}

.modal-card {
  position: absolute !important;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: auto;
  width: var(--modal-card-w);
  height: fit-content !important;
  max-height: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.58rem 0.7rem 0.63rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  display: block;
}

/* Schließen: außerhalb der Karte, oben rechts (25 % kleiner) */
.modal-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 10;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  min-height: 1.8rem !important;
  min-width: 1.8rem;
  padding: 0 !important;
  border: none;
  border-radius: 7px;
  background: #d32f2f;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.modal-close:active {
  color: #fff;
  background: #b71c1c;
  transform: scale(0.96);
}

.modal-title {
  display: none;
}

/* Summe / Gegeben / Rückgeld – klare Auflistung */
.modal-summary {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0 0 0.55rem;
  padding: 0.4rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.modal-sum-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.12rem 0.15rem;
  font-variant-numeric: tabular-nums;
}

.modal-sum-lbl {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: left;
}

.modal-sum-val {
  font-size: 1.15rem;
  font-weight: 800;
  text-align: right;
  min-width: 5.5rem;
}

/* Gegeben: Zeile unauffällig, nur der Betrag wie ein Eingabefeld */
.modal-sum-row.modal-sum-given {
  margin: 0;
  padding: 0.12rem 0.15rem 0.35rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  align-items: center;
}

.modal-sum-row.modal-sum-change {
  padding-top: 0.32rem;
}

.modal-sum-row.modal-sum-given .modal-sum-lbl {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.modal-sum-row.modal-sum-given .modal-sum-val {
  min-width: 6.5rem;
  padding: 0.28rem 0.45rem;
  font-size: 1.25rem;
  font-weight: 900;
  color: #fff;
  text-align: right;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

.modal-sum-row.modal-sum-change.ok .modal-sum-val {
  color: var(--accent);
}

.modal-sum-row.modal-sum-change.bad .modal-sum-val {
  color: var(--danger);
  font-size: 1rem;
}

.modal-sum-row.modal-sum-change.neutral .modal-sum-val {
  color: var(--text-muted);
}

/* Legacy-Klassen (falls noch referenziert) */
.modal-sum-line,
.modal-amount,
.modal-change {
  display: none;
}

.modal-quick {
  display: none;
}

/* Schnellwahl: links 5/10/20, rechts 50/100/Gutschein – Numpad zentriert.
   Spalten füllen den freien Rand und werden am Bildschirmrand abgeschnitten. */
.modal-notes {
  --notes-gap: 1.35rem; /* Abstand Scheine ↔ Numpad */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: clamp(0.4rem, 1.4vh, 0.95rem);
  width: auto;
  max-width: none;
  max-height: min(92vh, 100dvh - 1rem);
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  overflow: hidden; /* sauberer Schnitt am Bildschirmrand */
}

/* links: von Bildschirm-links bis Numpad; Abschneiden am linken Rand */
.modal-notes-left {
  left: 0;
  right: calc(50% + (var(--modal-card-w) / 2) + var(--notes-gap));
}

/* rechts: von Numpad bis Bildschirm-rechts; Abschneiden am rechten Rand */
.modal-notes-right {
  left: calc(50% + (var(--modal-card-w) / 2) + var(--notes-gap));
  right: 0;
}

/* Komplett ungestylt – alle Scheine/Gutschein identische Maße */
button.modal-note,
.modal-note {
  all: unset;
  display: block;
  box-sizing: border-box;
  width: 100%;
  /* festes Euro-Schein-Verhältnis (ca. 2:1), gleiche Größe links & rechts */
  aspect-ratio: 2 / 1;
  height: auto;
  flex: 0 0 auto;
  max-height: calc((min(92vh, 100dvh - 1rem) - 2 * clamp(0.4rem, 1.4vh, 0.95rem)) / 3);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  background: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  min-width: 0 !important;
  line-height: 0;
  color: inherit;
  font: inherit;
  overflow: hidden;
}

.modal-note img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: none;
}

/* Zum Numpad hin ausrichten → abgeschnitten wird am äußeren Bildschirmrand */
.modal-notes-left .modal-note img {
  object-position: right center; /* Schnitt links */
}

.modal-notes-right .modal-note img {
  object-position: left center; /* Schnitt rechts */
}

.modal-note:active img {
  opacity: 0.88;
}

/* Gutschein: wie rechte Scheine (Schnitt rechts) */
.modal-notes-right .modal-note-voucher img {
  object-fit: cover;
  object-position: left center;
}

/* Ausgewählter Schein: Glow-Rahmen in Scheinfarbe */
.modal-note.is-selected {
  position: relative;
  z-index: 3;
  overflow: visible !important;
  border-radius: 6px !important;
}

.modal-note.is-selected img {
  border-radius: 5px;
  outline: 3px solid var(--note-glow, #fff);
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.35),
    0 0 14px 4px var(--note-glow, #fff),
    0 0 28px 2px color-mix(in srgb, var(--note-glow, #fff) 55%, transparent);
}

.modal-note.note-5 {
  --note-glow: #9aaa78;
}
.modal-note.note-10 {
  --note-glow: #e07058;
}
.modal-note.note-20 {
  --note-glow: #4a8fd4;
}
.modal-note.note-50 {
  --note-glow: #e89840;
}
.modal-note.note-100 {
  --note-glow: #5cb85c;
}
.modal-note.note-30 {
  --note-glow: #d4e040;
}

/* 10,1″: etwas großzügigere Abstände */
@media (min-width: 1000px) and (min-height: 600px) {
  .modal-notes {
    --notes-gap: 1.75rem;
    gap: clamp(0.55rem, 1.6vh, 1.1rem);
  }
}

/* 7″ flach */
@media (max-height: 500px) {
  .modal-notes {
    --notes-gap: 1rem;
    gap: 0.4rem;
  }
}

.modal-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin: 0 0 0.45rem;
}

.modal-pad .pad-key {
  min-height: 55px !important;
  height: 55px !important;
  padding: 0 !important;
  font-size: 1.5rem !important;
  font-weight: 800;
  border-radius: 9px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  margin: 0;
}

.modal-actions-single {
  grid-template-columns: 1fr;
}

.modal-actions .btn {
  min-height: 55px !important;
  height: 55px !important;
  padding: 0 !important;
  font-size: 1.25rem !important;
  font-weight: 700;
  border-radius: 9px;
}

/* Slide-to-pay (Slide-to-unlock Stil) */
.pay-slider {
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.pay-slider-track {
  position: relative;
  display: flex;
  align-items: center;
  height: 56px;
  min-height: 56px;
  padding: 3px;
  border-radius: 999px;
  background: #1a221c;
  border: 2px solid var(--accent-dark);
  overflow: hidden;
  box-sizing: border-box;
}

.pay-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(92, 184, 92, 0.25), rgba(92, 184, 92, 0.55));
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}

.pay-slider-label {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  z-index: 1;
  padding-left: 2.8rem;
  overflow: hidden;
}

.pay-slider-label-text {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: rgba(242, 245, 243, 0.45);
  /* rollender Glow links → rechts */
  background: linear-gradient(
    90deg,
    rgba(242, 245, 243, 0.35) 0%,
    rgba(242, 245, 243, 0.35) 35%,
    rgba(180, 255, 180, 0.95) 50%,
    rgba(242, 245, 243, 0.35) 65%,
    rgba(242, 245, 243, 0.35) 100%
  );
  background-size: 220% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: pay-label-glow 2.2s linear infinite;
}

@keyframes pay-label-glow {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.pay-slider.is-disabled .pay-slider-label-text {
  animation: none;
  background: none;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
}

.pay-slider.is-done .pay-slider-label-text {
  animation: none;
  background: none;
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

.pay-slider-thumb {
  position: relative;
  z-index: 2;
  width: 48px;
  height: 48px;
  min-width: 48px !important;
  min-height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 999px !important;
  background: var(--accent) !important;
  color: #0d1a0d !important;
  font-size: 1.35rem !important;
  font-weight: 900 !important;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: grab;
  touch-action: none;
  will-change: transform;
}

.pay-slider-thumb.is-dragging {
  cursor: grabbing;
  filter: brightness(1.05);
}

.pay-slider.is-disabled .pay-slider-track {
  border-color: var(--border);
  opacity: 0.55;
}

.pay-slider.is-disabled .pay-slider-thumb {
  background: #3d4a42 !important;
  color: var(--text-muted) !important;
  cursor: not-allowed;
}

.pay-slider.is-done .pay-slider-track {
  border-color: var(--accent);
  background: rgba(92, 184, 92, 0.2);
}

/* Sehr flache Displays (480px Höhe) – Kacheln bleiben 2 Reihen hoch */
@media (max-height: 500px) {
  .products-panel {
    --product-gap: 0.28rem;
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .product-tile .name {
    font-size: 0.88rem;
    padding: 0.3rem 0.25rem 0.7rem;
    max-height: 42%;
  }

  .product-tile .price {
    font-size: 1rem;
    padding: 0.7rem 0.25rem 0.28rem;
  }

  .product-tile .product-img {
    padding: 1.1rem 0.25rem 1rem;
  }

  .tile-qty {
    font-size: 1.35rem;
  }

  .tile-qty-btn {
    width: 1.85rem;
    height: 1.85rem;
    min-height: 1.85rem;
    min-width: 1.85rem;
    font-size: 1.15rem;
  }

  .cash-quick .btn {
    min-height: 38px;
    font-size: 0.85rem;
  }

  .cash-actions .btn,
  .cash-actions .btn-pay {
    min-height: 44px;
    font-size: 1.05rem;
  }
}

/* ---- Subpages (Admin / Tagesabschluss) ---- */
.view-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.4rem;
  -webkit-overflow-scrolling: touch;
}

.page-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem;
  max-width: 100%;
  margin: 0 auto;
}

.page-card h2 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.stat {
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 0.4rem;
}

.stat .label {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.stat .value {
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 0.1rem;
}

/* ---- Tagesabschluss (eine Ansicht, kein Scroll) ---- */
.day-page {
  padding: 0.35rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.day-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: hidden;
}

/* Obere Zeile: Datum-Feld + eigenes CSV-Feld */
.day-top-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  flex-shrink: 0;
  align-items: stretch;
  min-width: 0;
}

.day-header {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.3rem 0.4rem;
  min-width: 0;
}

.day-csv-field {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: #d32f2f;
  border: 1px solid #b71c1c;
  border-radius: 10px;
  padding: 0;
  flex-shrink: 0;
  overflow: hidden;
}

.day-nav {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  flex: 1;
}

.day-nav-btn {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}

.day-date-block {
  min-width: 0;
  flex: 1;
}

.day-date-label {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.15;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-date-sub {
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-top: 0.05rem;
  text-transform: capitalize;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-header-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.day-header-actions .btn {
  min-height: 34px;
  padding: 0.2rem 0.45rem;
  font-size: 0.85rem;
}

.day-cal-btn {
  width: 36px;
  min-width: 36px;
  min-height: 36px !important;
  height: 36px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.day-cal-btn .icon-calendar {
  display: block;
  width: 1.2rem;
  height: 1.2rem;
  pointer-events: none;
}

/* natives Date-Input (Fallback, unsichtbar) */
.day-date-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  padding: 0;
  margin: 0;
}

/* ---- Tag: großes Kalender-Popup (Touch / 7″) ---- */
.day-cal-popup {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
  box-sizing: border-box;
}
.day-cal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}
.day-cal-sheet {
  position: relative;
  z-index: 1;
  width: min(96vw, 720px);
  height: min(94vh, 94dvh);
  max-height: 94dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  box-sizing: border-box;
}
.day-cal-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-elevated);
}
.day-cal-sheet-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.day-cal-close {
  width: 2.4rem;
  height: 2.4rem;
  min-height: 2.4rem !important;
  min-width: 2.4rem;
  padding: 0 !important;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.day-cal-month-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem 0.35rem;
  flex-shrink: 0;
}
.day-cal-month-label {
  flex: 1;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: #b8f0b8;
}
.day-cal-nav {
  width: 2.75rem;
  height: 2.75rem;
  min-height: 2.75rem !important;
  min-width: 2.75rem;
  padding: 0 !important;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
}
.day-cal-nav:disabled {
  opacity: 0.35;
  pointer-events: none;
}
.day-cal-nav:active:not(:disabled) {
  transform: scale(0.96);
  border-color: var(--accent);
}
.day-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
  padding: 0 0.55rem 0.25rem;
  flex-shrink: 0;
}
.day-cal-weekdays span {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0;
}
.day-cal-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 0.28rem;
  padding: 0.2rem 0.55rem 0.45rem;
}
.day-cal-cell {
  min-height: 0;
  min-width: 0;
  height: 100%;
  width: 100%;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: clamp(0.95rem, 2.8vh, 1.25rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  box-sizing: border-box;
}
.day-cal-cell:active:not(:disabled) {
  transform: scale(0.96);
}
.day-cal-cell.is-empty {
  background: transparent;
  border-color: transparent;
  pointer-events: none;
}
.day-cal-cell.is-disabled {
  opacity: 0.28;
  pointer-events: none;
}
.day-cal-cell.is-today:not(.is-selected) {
  border-color: rgba(92, 184, 92, 0.65);
  color: #b8f0b8;
  box-shadow: inset 0 0 0 1px rgba(92, 184, 92, 0.2);
}
.day-cal-cell.is-selected {
  background: linear-gradient(180deg, #6fdc6f 0%, #3d8b3d 100%);
  border-color: rgba(255, 255, 255, 0.25);
  color: #0d1a0d;
  box-shadow: 0 2px 10px rgba(61, 139, 61, 0.45);
}
.day-cal-footer {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0.45rem;
  padding: 0.45rem 0.65rem 0.6rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-elevated);
}
.day-cal-footer .btn {
  min-height: 2.85rem !important;
  font-size: 1rem !important;
  font-weight: 800;
  border-radius: 12px;
}
.day-cal-today-btn {
  background: rgba(92, 184, 92, 0.18);
  border-color: var(--accent-dark);
  color: #b8f0b8;
}

/* Querformat / flache Displays: etwas kompakter */
@media (max-height: 520px) {
  .day-cal-sheet {
    height: 96vh;
    max-height: 96dvh;
    border-radius: 12px;
  }
  .day-cal-sheet-head {
    padding: 0.35rem 0.55rem;
  }
  .day-cal-sheet-title {
    font-size: 1rem;
  }
  .day-cal-month-label {
    font-size: 1.05rem;
  }
  .day-cal-nav {
    width: 2.4rem;
    height: 2.4rem;
    min-height: 2.4rem !important;
    min-width: 2.4rem;
    font-size: 1.4rem;
  }
  .day-cal-cell {
    border-radius: 9px;
    font-size: clamp(0.88rem, 3.2vh, 1.1rem);
  }
  .day-cal-footer .btn {
    min-height: 2.5rem !important;
  }
}

.day-csv-btn {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 100% !important;
  min-width: 0;
  margin: 0;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 10px !important;
  background: #d32f2f !important;
  border-color: #d32f2f !important;
  color: #fff !important;
  border-width: 0 !important;
  cursor: pointer;
}

.day-csv-btn:active {
  background: #b71c1c !important;
  border-color: #b71c1c !important;
  color: #fff !important;
}

/* Telegram-Abschluss-Popup */
.modal-card-tg {
  max-width: min(420px, 92vw);
}

.modal-tg-title {
  margin: 0 2.5rem 0.15rem 0;
  font-size: 1.15rem;
  font-weight: 900;
  text-align: center;
}

.modal-tg-sub {
  margin: 0 0 0.55rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.modal-tg-status {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 0.55rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
}

.modal-tg-status.ok {
  color: var(--accent);
  background: rgba(92, 184, 92, 0.12);
}

.modal-tg-status.bad {
  color: #ffb4b0;
  background: rgba(211, 47, 47, 0.18);
}

.tg-setup-steps {
  margin: 0 0 0.65rem;
  padding: 0.45rem 0.55rem 0.45rem 1.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.tg-setup-steps li {
  margin: 0.2rem 0;
}

.tg-setup-steps code {
  font-size: 0.78rem;
  color: #c8f0c8;
}

.tg-setup-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.tg-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tg-field-hint {
  margin: -0.15rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.tg-field-hint code {
  font-size: 0.7rem;
  word-break: break-all;
  color: var(--text);
}

.tg-field input {
  min-height: 44px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
}

.tg-setup-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.35rem;
}

.tg-setup-actions .btn {
  min-height: 48px;
  font-weight: 800;
}

.day-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.3rem;
  flex-shrink: 0;
}

.day-kpi {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.45rem;
  min-width: 0;
  min-height: 3.4rem;
  cursor: pointer;
  touch-action: manipulation;
  text-align: left;
  color: inherit;
  font: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.day-kpi:active {
  transform: scale(0.98);
}

.day-kpi.is-active {
  border-color: rgba(168, 181, 173, 0.65);
  background: var(--bg-elevated);
}

.day-kpi-label {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-kpi-value {
  margin-top: 0.12rem;
  font-size: 1.05rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.day-section {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem 0.45rem 0.4rem;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.day-section-fill {
  flex: 1;
  min-height: 0;
}

.day-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
  flex-shrink: 0;
}

.day-section-head h3 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 800;
}

.day-section-meta {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.day-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 0.5rem;
}

.day-panel-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 181, 173, 0.45) transparent;
}

.day-product-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* Bestellungsliste (Verkäufe) */
.day-sales-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-bottom: 0.25rem;
}

.day-sale-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.5rem;
}

.day-sale-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.day-sale-time {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.day-sale-total {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.day-sale-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.day-sale-line {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
}

.day-sale-meta {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Artikel: Säulendiagramm nach Menge/Anteil */
.day-chart {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.15rem 0.1rem 0.2rem;
  box-sizing: border-box;
}

.day-chart-plot {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.35rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding: 0.15rem 0.1rem 0;
}

.day-chart-col {
  flex: 1 0 auto;
  min-width: 3.6rem;
  max-width: 5.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
}

.day-chart-value {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.15rem;
}

.day-chart-bar-area {
  flex: 1 1 auto;
  width: 100%;
  min-height: 4.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  padding: 0 0.15rem;
  box-sizing: border-box;
}

.day-chart-bar {
  width: 100%;
  max-width: 3.6rem;
  min-height: 1.6rem;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bar-color, #5cb85c) 85%, #fff) 0%,
    var(--bar-color, #5cb85c) 55%,
    color-mix(in srgb, var(--bar-color, #5cb85c) 70%, #000) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem;
  box-sizing: border-box;
  overflow: hidden;
}

.day-chart-bar-pct {
  font-size: 0.72rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  line-height: 1.1;
  text-align: center;
  margin: 0;
  padding: 0;
}

.day-chart-label {
  flex-shrink: 0;
  margin-top: 0.28rem;
  width: 100%;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 1.6em;
}

.day-chart-thumb {
  flex-shrink: 0;
  margin-top: 0.2rem;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 8px;
  overflow: hidden;
  background: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-chart-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.day-chart-img-ph {
  width: 100%;
  height: 100%;
}

.day-product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  table-layout: fixed;
}

.day-product-table th,
.day-product-table td {
  padding: 0.22rem 0.3rem;
  border-bottom: 1px solid rgba(61, 74, 66, 0.5);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-product-table th {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.day-product-table th.num,
.day-product-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  width: 18%;
}

.day-product-table td.name {
  font-weight: 700;
  width: 46%;
}

.day-product-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.12);
}

.day-product-table tfoot td {
  border-bottom: none;
  border-top: 1px solid var(--border);
  font-weight: 800;
  padding-top: 0.35rem;
}

@media (max-width: 900px), (max-height: 520px) {
  .day-kpi-value {
    font-size: 0.95rem;
  }

  .day-kpi {
    min-height: 3.1rem;
    padding: 0.3rem 0.35rem;
  }

  .day-product-table {
    font-size: 0.8rem;
  }

  .day-product-table th,
  .day-product-table td {
    padding: 0.16rem 0.22rem;
  }

  .day-chart-col {
    min-width: 3.1rem;
    max-width: 4.4rem;
  }

  .day-chart-bar-area {
    min-height: 3.6rem;
  }

  .day-chart-label {
    font-size: 0.62rem;
  }
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.3rem 0.25rem;
  border-bottom: 1px solid var(--border);
}

table.data th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
}

table.data td.num,
table.data th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.45rem;
}

.form-row label {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

/* ---- Lager / Inventar (Balkendiagramm) ---- */
.lager-page {
  padding: 0.35rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.lager-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: hidden;
}

.lager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.55rem;
  flex-shrink: 0;
}

.lager-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
}

.lager-sub {
  margin: 0.1rem 0 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.lager-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  flex-shrink: 0;
}

.lager-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.lager-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

.lager-dot-stock {
  background: linear-gradient(180deg, #6fdc6f 0%, #3d8b3d 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.lager-dot-sold {
  background: linear-gradient(180deg, #ff6b6b 0%, #c62828 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.lager-dot-fillable {
  background: repeating-linear-gradient(
    -45deg,
    rgba(168, 181, 173, 0.55),
    rgba(168, 181, 173, 0.55) 2px,
    transparent 2px,
    transparent 4px
  );
  border: 1px solid rgba(168, 181, 173, 0.45);
}

.lager-sync {
  margin-left: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #7ddea0;
  letter-spacing: 0.02em;
}

.lager-val-min {
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.85em;
}

.lager-chart-bar-wrap {
  /* Fester Boden aller Balken: absolute unten in der Plot-Fläche */
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 3.4rem;
  min-height: 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: 8px 8px 3px 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  box-sizing: border-box;
}

/* Oben: noch auffüllbar bis Mindestanzahl; unten: aktueller Bestand */
.lager-chart-bar-fillable {
  width: 100%;
  min-height: 0;
  flex-shrink: 1;
  background: repeating-linear-gradient(
    -45deg,
    rgba(168, 181, 173, 0.22),
    rgba(168, 181, 173, 0.22) 3px,
    rgba(46, 55, 50, 0.35) 3px,
    rgba(46, 55, 50, 0.35) 6px
  );
  border-bottom: 1px dashed rgba(168, 181, 173, 0.35);
}

.lager-chart-bar-stock-only {
  width: 100%;
  min-height: 0;
  flex-shrink: 1;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(
    180deg,
    #7be07b 0%,
    #5cb85c 45%,
    #3d8b3d 100%
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.lager-chart-thumb-wrap {
  flex-shrink: 0;
  margin-top: 0.2rem;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 8px;
  overflow: hidden;
  background: #0d0d0d;
  pointer-events: none;
}

.lager-chart-actions {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.lager-act-btn {
  width: 2rem;
  height: 2rem;
  min-height: 2rem !important;
  min-width: 2rem;
  padding: 0 !important;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lager-act-edit {
  color: var(--text-muted);
}

.lager-act-add {
  background: rgba(92, 184, 92, 0.22);
  border-color: var(--accent-dark);
  color: #b8f0b8;
}

.lager-chart-unit {
  flex-shrink: 0;
  height: 1.1em;
  margin: 0.05rem 0 0.15rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #a8b5ad;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.1;
}

.lager-chart {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem 0.25rem 0.3rem;
  box-sizing: border-box;
  overflow: hidden;
}

.lager-chart-plot {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.35rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 181, 173, 0.45) transparent;
  scroll-behavior: auto;
  padding: 0.15rem 0.15rem 0.35rem;
}

/* Moderne Scrollbar wie Produkte/Warenkorb */
.lager-chart-plot::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}
.lager-chart-plot::-webkit-scrollbar-track {
  background: transparent;
}
.lager-chart-plot::-webkit-scrollbar-thumb {
  background: rgba(168, 181, 173, 0.4);
  border-radius: 99px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
.lager-chart-plot::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 181, 173, 0.65);
  background-clip: padding-box;
}

.lager-chart-col {
  flex: 1 0 auto;
  min-width: 3.6rem;
  max-width: 5.2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  border-radius: 8px;
  padding: 0.1rem;
  -webkit-tap-highlight-color: transparent;
}

.lager-chart-value {
  flex-shrink: 0;
  height: 1.2em;
  font-size: 0.72rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin-bottom: 0.15rem;
  white-space: nowrap;
}

.lager-val-stock {
  color: #7ddea0;
}

.lager-val-sep {
  color: var(--text-muted);
  margin: 0 0.05rem;
  font-weight: 700;
}

.lager-val-sold {
  color: #ff8a80;
}

.lager-chart-bar-area {
  /* Gemeinsame Plot-Höhe für alle Produkte → Balken-Boden auf einer Linie */
  flex: 1 1 0;
  width: 100%;
  min-height: 5rem;
  position: relative;
  border-bottom: 1px solid var(--border);
  padding: 0 0.15rem;
  box-sizing: border-box;
}

.lager-chart-bar {
  width: 100%;
  max-width: 3.4rem;
  min-height: 0.9rem;
  border-radius: 8px 8px 3px 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.lager-chart-bar-empty {
  background: var(--bg-elevated);
  opacity: 0.45;
  min-height: 0.55rem;
}

/* oben rot (verkauft), unten grün (Bestand) */
.lager-chart-sold {
  width: 100%;
  min-height: 0;
  background: linear-gradient(
    180deg,
    #ff7a7a 0%,
    #e53935 45%,
    #b71c1c 100%
  );
  flex-shrink: 1;
}

.lager-chart-stock {
  width: 100%;
  min-height: 0;
  background: linear-gradient(
    180deg,
    #7be07b 0%,
    #5cb85c 45%,
    #3d8b3d 100%
  );
  flex-shrink: 1;
}

.lager-chart-label {
  flex-shrink: 0;
  margin-top: 0.28rem;
  width: 100%;
  height: 2.3em;
  min-height: 2.3em;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lager-chart-thumb {
  flex-shrink: 0;
  margin-top: 0.2rem;
  width: 2.55rem;
  height: 2.55rem;
  min-height: 2.55rem !important;
  min-width: 2.55rem;
  padding: 0 !important;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}

.lager-chart-thumb:active {
  transform: scale(0.94);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(92, 184, 92, 0.35);
}

.lager-chart-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.lager-chart-img-ph {
  width: 100%;
  height: 100%;
}

/* Lager: Stift- & Plus-Popups – Breite an Bildschirm (7″ Kiosk), ohne scale-Schrumpf */
.modal-card.lager-modal-card {
  display: flex !important;
  flex-direction: column;
  gap: 0.4rem;
  width: min(94vw, 860px) !important;
  max-width: 96vw;
  padding: 0.55rem 0.7rem 0.5rem !important;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  box-sizing: border-box;
}

/* Stift-Popup: gleiche Breite, etwas kompakter (mehr Inhalt) */
.modal-card.lager-modal-card-edit {
  width: min(94vw, 860px) !important;
  max-width: 96vw;
  gap: 0.32rem;
  padding: 0.45rem 0.65rem 0.42rem !important;
  transform: translate(-50%, -50%);
}

.lager-modal-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.lager-modal-thumb {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 10px;
  overflow: hidden;
  background: #0d0d0d;
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lager-modal-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.lager-modal-head-text {
  min-width: 0;
  flex: 1;
}

.lager-modal-name {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.2;
}

.lager-modal-stock {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.lager-modal-stock strong {
  color: #7ddea0;
  font-size: 1rem;
}

.lager-modal-add-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem 0.6rem 0.6rem;
}

.lager-modal-add-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.lager-modal-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
}

.lager-step-btn {
  width: 3rem;
  height: 3rem;
  min-height: 3rem !important;
  min-width: 3rem;
  padding: 0 !important;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lager-step-btn:active {
  transform: scale(0.95);
}

.lager-step-plus {
  background: rgba(92, 184, 92, 0.22);
  border-color: var(--accent-dark);
  color: #b8f0b8;
}

.lager-step-val {
  min-width: 5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.05;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.lager-step-num {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.lager-step-unit {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.lager-modal-hint {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin: -0.1rem 0 0.45rem;
}

.lager-modal-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}

.lager-modal-quick-crates {
  grid-template-columns: repeat(2, 1fr);
}

.lager-quick-btn {
  min-height: 2.4rem !important;
  padding: 0.25rem 0.2rem !important;
  font-size: 0.82rem !important;
  font-weight: 800;
  border-radius: 8px;
}

.lager-quick-crate {
  min-height: 2.7rem !important;
  font-size: 0.9rem !important;
  background: rgba(92, 184, 92, 0.16);
  border-color: var(--accent-dark);
}

.lager-modal-preview {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lager-modal-preview-add {
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.15rem;
  font-size: 0.95rem;
}

.lager-modal-preview strong {
  color: #7ddea0;
  font-size: 1.05rem;
}

.lager-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 0.4rem;
}

.lager-modal-actions .btn {
  min-height: 3rem !important;
  font-size: 1.05rem !important;
  font-weight: 800;
  border-radius: 10px;
}

/* Schieberegler wie mobiles Lager */
.lager-edit-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.65rem 0.55rem;
  margin-bottom: 0.55rem;
  min-width: 0;
  box-sizing: border-box;
}

/* Stift-Popup: Bestand | Mindestanzahl nebeneinander */
.lager-edit-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  align-items: stretch;
  min-width: 0;
  width: 100%;
}

.lager-modal-card-edit .lager-edit-block {
  margin-bottom: 0;
  padding: 0.45rem 0.5rem 0.4rem;
  display: flex;
  flex-direction: column;
}

.lager-modal-card-edit .lager-edit-label {
  margin-bottom: 0.3rem;
  font-size: 0.68rem;
}

.lager-modal-card-edit .lager-slider-row {
  margin-bottom: 0.35rem;
}

.lager-modal-card-edit .lager-slider-row:last-of-type {
  margin-bottom: 0.2rem;
}

.lager-modal-card-edit .lager-slider {
  height: 2rem;
}

.lager-modal-card-edit .lager-slider-val {
  font-size: 1.05rem;
}

.lager-modal-card-edit .lager-slider-label {
  font-size: 0.8rem;
}

.lager-modal-card-edit .lager-slider-summary {
  margin-top: auto;
  padding-top: 0.3rem;
}

.lager-modal-card-edit .lager-slider-summary strong {
  font-size: 0.88rem;
}

.lager-modal-card-edit .lager-slider-summary span {
  font-size: 0.72rem;
}

.lager-modal-card-edit .lager-modal-actions .btn {
  min-height: 2.55rem !important;
  font-size: 0.95rem !important;
}

.lager-edit-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.45rem;
}

.lager-modal-warn {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #ff8a80;
}

.lager-slider-row {
  margin-bottom: 0.55rem;
}

.lager-slider-row:last-of-type {
  margin-bottom: 0.35rem;
}

.lager-slider-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.lager-slider-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.lager-slider-val {
  font-size: 1.2rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #7ddea0;
  min-width: 2rem;
  text-align: right;
}

.lager-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2.4rem;
  margin: 0;
  background: transparent;
  touch-action: none;
}

.lager-slider:focus {
  outline: none;
}

.lager-slider::-webkit-slider-runnable-track {
  height: 0.5rem;
  border-radius: 99px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.lager-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: -0.65rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #7be07b 0%, #5cb85c 55%, #3d8b3d 100%);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.lager-slider::-moz-range-track {
  height: 0.5rem;
  border-radius: 99px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.lager-slider::-moz-range-thumb {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: #5cb85c;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.lager-slider-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  margin-top: 0.25rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.lager-slider-summary strong {
  font-size: 0.98rem;
  font-weight: 800;
  color: #7ddea0;
}

.lager-slider-summary span {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* ---- Admin-Login ---- */
.page-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  overflow: hidden;
}

.login-card {
  width: min(340px, 100%);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.85rem 0.9rem 0.95rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.login-card.login-error {
  border-color: rgba(217, 83, 79, 0.65);
}

.login-shake {
  animation: login-shake 0.4s ease;
}

@keyframes login-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(6px);
  }
}

.login-icon {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 0.25rem;
  opacity: 0.9;
}

.login-title {
  margin: 0 0 0.2rem;
  font-size: 1.25rem;
  font-weight: 800;
}

.login-sub {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login-loading {
  padding: 1.5rem;
  color: var(--text-muted);
  font-weight: 600;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
  min-height: 1.1rem;
}

.pin-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.pin-dot.filled {
  background: #fff;
  border-color: #fff;
  transform: scale(1.08);
}

.pin-dot.busy {
  opacity: 0.55;
}

.login-hint {
  min-height: 1.25rem;
  margin-bottom: 0.55rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.login-error-msg {
  min-height: 1.25rem;
  margin-bottom: 0.55rem;
  color: #ff8a85;
  font-size: 0.9rem;
  font-weight: 700;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.pin-key {
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.pin-key:active:not(:disabled) {
  transform: scale(0.97);
  filter: brightness(1.08);
}

.pin-key:disabled {
  opacity: 0.45;
}

.pin-key-muted {
  background: #3a4540;
  font-size: 1.1rem;
}

.pin-key-submit {
  grid-column: 1 / -1;
  min-height: 50px;
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #0d1a0d;
  font-size: 1.15rem;
  font-weight: 800;
}

.pin-key-submit:disabled {
  opacity: 0.4;
}

@media (max-height: 500px) {
  .login-card {
    padding: 0.55rem 0.65rem 0.65rem;
  }

  .login-icon {
    display: none;
  }

  .login-title {
    font-size: 1.1rem;
  }

  .login-sub {
    margin-bottom: 0.45rem;
    font-size: 0.8rem;
  }

  .pin-key {
    min-height: 42px;
    font-size: 1.2rem;
    border-radius: 10px;
  }

  .pin-key-submit {
    min-height: 42px;
  }
}

.admin-product-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.45rem;
  touch-action: pan-y;
}

.admin-product {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.35rem 0.45rem;
  align-items: center;
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 0.4rem 0.5rem;
  border: 1px solid transparent;
  transition: box-shadow 0.12s ease, opacity 0.12s ease, transform 0.08s ease;
}

.admin-product.is-dragging {
  opacity: 0.92;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  border-color: var(--accent-dark);
  z-index: 5;
  transform: scale(1.01);
  background: #354039;
}

.admin-product-placeholder {
  border-radius: 10px;
  border: 2px dashed rgba(92, 184, 92, 0.45);
  background: rgba(92, 184, 92, 0.08);
  min-height: 3rem;
}

.admin-drag-handle {
  width: 2.2rem;
  height: 2.4rem;
  min-height: 2.4rem !important;
  min-width: 2.2rem;
  padding: 0 !important;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  flex-shrink: 0;
}
.admin-drag-handle:active {
  cursor: grabbing;
  color: #b8f0b8;
  border-color: var(--accent-dark);
  background: rgba(92, 184, 92, 0.12);
}
.admin-drag-handle svg {
  pointer-events: none;
  display: block;
}

.admin-product.inactive {
  opacity: 0.72;
}

.admin-product.inactive .admin-product-info strong {
  color: var(--text-muted);
}

.admin-product-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.admin-product-thumb {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  background: #0d0d0d;
  flex-shrink: 0;
}

.admin-product-info {
  min-width: 0;
}

.admin-product-info strong {
  display: block;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-product .meta {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.admin-product-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* Toggle-Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: #4a5550;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: background 0.15s ease;
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.switch input:checked + .switch-slider {
  background: var(--accent);
  border-color: var(--accent-dark);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(18px);
}

/* Icon-Buttons */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 1.15rem;
  line-height: 1;
}

.icon-btn-edit {
  color: #fff;
  background: #3a4f6b;
  border-color: #4a6a8b;
}

.icon-btn-delete {
  color: #fff;
  background: #5a2a28;
  border-color: #7a3a36;
}

.icon-btn:active {
  transform: scale(0.96);
  filter: brightness(1.08);
}

.admin-telegram-box {
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.7rem;
  background: var(--bg-elevated);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.admin-help {
  margin: 0 0 0.65rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.toolbar .btn,
.toolbar input {
  min-height: 34px;
  font-size: 0.8rem;
}

.toolbar .adm-close-app {
  margin-left: auto;
  background: rgba(211, 47, 47, 0.22);
  border-color: #b71c1c;
  color: #ffcdd2;
  font-weight: 800;
}
.toolbar .adm-close-app:active:not(:disabled) {
  background: rgba(211, 47, 47, 0.4);
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 1px solid var(--border);
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.3rem;
}

/* Portrait / sehr schmal: untereinander (selten am Pi) */
@media (max-width: 640px) and (orientation: portrait) {
  .pos-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1.15fr;
  }

  .side-panel {
    border-left: none;
    border-top: 1px solid var(--border);
  }

}
