:root {
  --bg: #0f0f12;
  --surface: #18181c;
  --surface-elevated: #1f1f25;
  --surface-hover: #222228;
  --border: #2a2a32;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  /* SKG Rodgau Brand (aus Logo extrahiert) */
  --accent: #102080;
  --accent-hover: #203080;
  --danger: #e00010;
  --success: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.4;
  touch-action: manipulation;
}

/* Login-Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  z-index: 2000;
  padding: 1rem;
}

.login-modal {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.login-title {
  margin: 0 0 0.75rem 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.login-pin-display {
  min-height: 2.2rem;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.35rem;
  color: var(--text);
  text-align: center;
  margin-bottom: 0.75rem;
  user-select: none;
}

.login-error {
  min-height: 1.2rem;
  text-align: center;
  color: #f87171;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.login-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.login-pin-btn {
  padding: 0.85rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  user-select: none;
}

.login-pin-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.login-pin-btn:active {
  transform: scale(0.98);
}

.login-pin-btn-back {
  grid-column: 3 / 4;
  grid-row: 4;
}

.login-pin-btn-zero {
  grid-column: 2 / 3;
  grid-row: 4;
}

.login-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

#app-shell {
  width: 100%;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.4rem 0.75rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  grid-template-rows: auto 1fr;
  gap: 0.25rem 0.5rem;
  min-height: 100vh;
  align-content: start;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
}

header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sync-server-btn {
  position: relative;
  padding: 0.35rem 0.75rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.sync-server-btn:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.is-offline .sync-server-btn {
  opacity: 0.75;
  border-bottom-color: transparent;
}

.sync-pending-count:empty {
  display: none;
}

.sync-pending-count:not(:empty) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  margin-left: 0.35rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--danger, #c0392b);
  border-radius: 999px;
}

.logout-btn {
  padding: 0.35rem 0.75rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.logout-btn:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.logout-btn:active {
  transform: scale(0.98);
}

.admin-gear-btn {
  display: none;
  padding: 0.35rem 0.55rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.admin-gear-btn:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.admin-role-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.admin-items-form {
  width: 100%;
  margin: 0.25rem 0 0.75rem 0;
}

.admin-items-row {
  margin-bottom: 0.6rem;
}

.admin-items-row .modal-input {
  margin-bottom: 0;
}

.admin-role-btn {
  padding: 0.35rem 0.55rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.admin-role-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.admin-role-btn.active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(99, 102, 241, 0.08);
}

.admin-users-panel {
  width: 100%;
  margin-top: 0.25rem;
}
.admin-users-form {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}
.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.admin-user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.admin-user-meta { display: flex; flex-direction: column; gap: 0.1rem; }
.admin-user-name { font-weight: 800; }
.admin-user-sub { color: var(--text-muted); font-size: 0.85rem; }
.admin-user-actions { display: inline-flex; gap: 0.35rem; }
.admin-user-actions .export-btn { padding: 0.35rem 0.6rem; font-size: 0.85rem; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.logo-text span {
  color: var(--accent);
}

.section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

/* Artikel-Palette (Getränke+Essen zusammengeführt) */
.items-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 0.33rem;
  min-height: 0;
  overflow: visible;
  padding-right: 0.15rem;
}

/* Simple Subtabs (Standard/VIP) */
.kasse-subtabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  flex-shrink: 0;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kasse-subtab {
  flex: 1 1 0;
  padding: 0.85rem 1rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, filter 0.15s;
}

.kasse-subtab:hover { filter: brightness(1.03); }
.kasse-subtab:active { transform: translateY(1px); }
.kasse-subtab.active {
  color: #fff;
  box-shadow: var(--shadow);
}
.kasse-subtab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Farb-Codierung: Standard = Blau, VIP = Gold */
.kasse-subtab[data-subtab="standard"].active {
  background: #2563eb;
  border-color: #1d4ed8;
}
.kasse-subtab[data-subtab="vip"].active {
  background: #d4a514;
  border-color: #b8890f;
}

.kasse-panel[data-panel="essen"] {
  overflow: hidden !important;
  scrollbar-width: none;
}

.kasse-panel[data-panel="essen"]::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.view-kasse .order-list {
  scrollbar-width: none;
}

.view-kasse .order-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Alte Getränke-Kategorien UI wird nicht mehr genutzt */

.drinks-category-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.825rem 0.9rem;
  min-height: 75px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
  user-select: none;
  text-align: left;
}

.drinks-category-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--text);
}

.drinks-category-btn:active {
  transform: scale(0.99);
}

.drinks-category-btn.active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(99, 102, 241, 0.12);
}

.drinks-category-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}

.drinks-category-count {
  min-width: 2.4rem;
  padding: 0.12rem 0.525rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.18);
  color: var(--accent);
  font-size: 1.125rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.drinks-items {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.drinks-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.1rem;
}

.drinks-items-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* +Kachel als normaler Drink-Button */
.drink-btn--add {
  border-style: dashed;
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.08);
}

.drink-btn--add:hover {
  background: rgba(99, 102, 241, 0.14);
  border-color: var(--accent);
}

.drink-btn--add .icon {
  font-size: 1.6rem;
  font-weight: 900;
}

.drink-btn--add .price,
.drink-btn--add .inventar-count {
  display: none !important;
}

.drinks-items .drinks-grid {
  min-height: 0;
  overflow: auto;
  padding-right: 0.15rem;
}

.drinks-empty {
  padding: 1rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* Buttons in der Artikel-Palette (an die vergrößerte Getränke-UI angelehnt) */
.items-grid .drink-btn {
  gap: 0.09rem;
  padding: 0.42rem 0.27rem;
  font-size: 1.08rem;
  height: 132px;
}

.items-grid .drink-btn .icon {
  font-size: 1.77rem;
}

.items-grid .drink-btn .name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
  min-height: calc(2 * 1.15em);
}

.items-grid .drink-btn .price {
  font-size: 0.81rem;
}

/* Inventar entfernt: keine Badges in der Kachel */

@media (max-width: 900px) {
  .drinks-layout {
    grid-template-columns: 1fr;
  }
  .drinks-categories {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow: auto;
  }
  .drinks-category-btn {
    flex: 0 0 auto;
  }
}

.kasse-panel[data-panel="essen"] .essen-grid {
  grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
  gap: 0.25rem;
}

.kasse-panel[data-panel="essen"] .drink-btn {
  gap: 0.08rem;
  padding: 0.36rem 0.22rem;
  font-size: 0.82rem;
}

.kasse-panel[data-panel="essen"] .drink-btn .icon {
  font-size: 1.28rem;
}

.kasse-panel[data-panel="essen"] .drink-btn .price {
  font-size: 0.62rem;
}

.drinks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.3rem;
}

.drink-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.45rem 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  position: relative;
}

.drink-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.drink-btn:active {
  transform: scale(0.98);
}

.drink-btn .icon {
  font-size: 1.4rem;
  line-height: 1;
}

.vip-crown {
  margin-left: 0.15rem;
  font-size: 1.05em;
  vertical-align: baseline;
}

.drink-btn .price {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.drink-btn--af {
  border-color: rgba(34, 197, 94, 0.65);
  background: rgba(34, 197, 94, 0.08);
}
.drink-btn--af:hover {
  border-color: rgba(34, 197, 94, 0.95);
  background: rgba(34, 197, 94, 0.12);
}

.drink-btn-delete {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  width: 1.25rem;
  height: 1.25rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  color: var(--text);
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}
.drink-btn-delete:hover { background: rgba(0, 0, 0, 0.14); }

/* Essen-Grid wird nicht mehr separat genutzt */

/* Bestellung */
.order-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 0.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  box-shadow: var(--shadow);
  align-self: stretch;
}

.order-section .section-title {
  margin-top: 0;
  padding-top: 0;
  margin-bottom: 0.25rem;
}

.order-list {
  list-style: none;
  margin-bottom: 0.2rem;
  flex: 1 1 auto;
  min-height: 120px;
  max-height: none;
  overflow-y: auto;
}

.order-list::-webkit-scrollbar {
  width: 6px;
}

.order-list::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 3px;
}

.order-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  min-height: 3.2rem;
}

.order-item:last-child {
  border-bottom: none;
}

.order-item-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.order-item-qty {
  min-width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 6px;
}

.order-item-remove {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.16);
  border: 2px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  color: #ef4444;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 900;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.08s;
}

.order-item-remove:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.55);
}

.order-item-remove:active {
  transform: scale(0.98);
}

.order-item-remove:focus-visible {
  outline: 2px solid rgba(239, 68, 68, 0.75);
  outline-offset: 2px;
}

.order-empty {
  padding: 0.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.order-total {
  padding-top: 0.35rem;
  border-top: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.order-cash-balance {
  margin-top: 0.75rem;
  padding: 0.55rem 0.6rem;
  border: 2px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.10);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  flex-shrink: 0;
  width: 100%;
}

.order-cash-balance-title {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.order-cash-balance-value {
  color: var(--success);
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
  font-weight: 800;
}

.order-total-label {
  color: var(--text-muted);
}

.order-total-amount {
  color: var(--success);
  font-variant-numeric: tabular-nums;
}

.order-complete-btn {
  width: 100%;
  margin-top: 0;
  margin-bottom: 0;
  padding: 0.4rem 0.6rem;
  background: var(--success);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.order-complete-btn:hover:not(:disabled) {
  background: #16a34a;
}

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

.order-complete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.order-sumup-btn {
  width: 100%;
  margin-top: 0.35rem;
  margin-bottom: 0;
  padding: 0.4rem 0.6rem;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.order-sumup-btn:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent-hover);
  color: var(--accent-hover);
}

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

.order-sumup-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  align-items: center;
}

.tab {
  padding: 0.35rem 0;
  margin-left: 0.85rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.view-kasse {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0.5rem;
  grid-column: 1 / -1;
  height: fit-content;
  overflow: visible;
}

.kasse-content {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.kasse-content .kasse-panel {
  min-height: 0;
  overflow: visible;
}

.kasse-content .essen-section {
  overflow: auto;
}

.kasse-info-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.25rem;
  gap: 1rem;
}

.vip-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  padding: 1rem;
}

.vip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 0.33rem;
  min-height: 0;
}

.kasse-betrag-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.kasse-betrag-btn {
  padding: 0.6rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  min-width: 4rem;
}

.kasse-betrag-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.kasse-betrag-btn:active {
  transform: scale(0.98);
}

.kasse-change-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-variant-numeric: tabular-nums;
}

.kasse-change-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.kasse-zahlbetrag {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.kasse-change-ok {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--success);
}

.kasse-change-warn {
  font-size: 0.9rem;
  color: #f87171;
}

.kasse-cash-row {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.kasse-cash-status {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.kasse-cash-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.kasse-cash-value {
  font-size: 1rem;
  font-weight: 600;
}

.kasse-cash-set {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.kasse-cash-input,
.kasse-cash-reason {
  flex: 1 1 120px;
  padding: 0.45rem 0.6rem;
  font-family: inherit;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.kasse-cash-set-btn {
  padding: 0.45rem 0.8rem;
  font-family: inherit;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.kasse-cash-set-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.kasse-cash-last {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Cash-Modal Reason Presets */
.cash-reason-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin: 0 0 1rem 0;
}

.cash-reason-btn {
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.cash-reason-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 900px) {
  .view-kasse {
    grid-template-columns: 1fr;
    min-height: auto;
  }
}
.view-history { display: none; grid-column: 1 / -1; }
.view-history.active { display: block; }
.view-kasse.hidden { display: none; }

/* Vergangene Bestellungen */
.history-list { list-style: none; }

.history-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.history-item-pending {
  border-left: 3px solid #c9a227;
}

.history-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s;
}

.history-item-header:hover { background: var(--surface-hover); }

.history-item-date { font-size: 0.9rem; color: var(--text-muted); }
.history-item-nr {
  font-size: 0.8rem;
  color: #fff;
  background: var(--accent);
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  margin-right: 0.5rem;
  font-weight: 800;
}
.history-item-meta { display: inline-flex; align-items: center; gap: 0.35rem; }
.history-item-source {
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--surface-hover);
  color: var(--text-muted);
}
.history-item-user {
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: var(--text);
  font-weight: 700;
}
.history-item-actions { display: inline-flex; align-items: center; gap: 0.5rem; }
.history-item-total { font-weight: 700; color: var(--success); font-variant-numeric: tabular-nums; }
.history-item-delete {
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  color: var(--danger, #d33);
  font-weight: 700;
  cursor: pointer;
}
.history-item-delete:hover { background: var(--surface-hover); }
.history-item-cancelled .history-item-total { color: var(--text-muted); text-decoration: line-through; }
.history-item-cancelled-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-hover);
  color: var(--text-muted);
  font-weight: 700;
}

.history-item-details {
  padding: 0 1.25rem 1rem;
  border-top: 1px solid var(--border);
}

.history-item-details ul { list-style: none; padding-top: 0.75rem; }
.history-item-details li {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.history-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.export-row { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.export-btn {
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.export-btn:hover { background: var(--surface-hover); }
.export-btn-danger {
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}
.export-btn-danger:hover { background: rgba(239, 68, 68, 0.15); }

/* Auswertung */
.view-stats { display: none; grid-column: 1 / -1; }
.view-stats.active { display: block; }

.drink-btn {
  position: relative;
}

/* Inventar-Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.modal-open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  min-width: 280px;
  max-width: 90vw;
  box-shadow: var(--shadow);
}

.modal-title {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.modal-drink-name {
  margin: 0 0 1rem 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.modal-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.modal-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 1rem;
  box-sizing: border-box;
}

.modal-input:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.modal-btn {
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: background 0.2s, border-color 0.2s;
}

.modal-btn-cancel:hover {
  background: var(--surface-hover);
}

.modal-btn-ok {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.modal-btn-ok:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Andere-Modal mit PIN-Pad (kein System-Keyboard) */
.modal-pinpad {
  min-width: 260px;
}

.pinpad-display {
  padding: 0.75rem 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  color: var(--text);
  user-select: none;
}

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

.pinpad-btn {
  padding: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.pinpad-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.pinpad-btn:active {
  transform: scale(0.98);
}

.pinpad-btn-back {
  font-size: 1.1rem;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stats-table th,
.stats-table td {
  padding: 0.75rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.stats-table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--surface-hover);
}

.stats-table tr:last-child td { border-bottom: none; }
.stats-table td { font-variant-numeric: tabular-nums; }
.stats-table .col-name { font-weight: 500; }
.stats-table .col-qty { text-align: right; }
.stats-table .col-price { text-align: right; color: var(--text-muted); }
.stats-table .col-revenue { text-align: right; color: var(--success); }

.stats-total-row td {
  font-weight: 700;
  padding-top: 1rem;
  border-top: 2px solid var(--border);
}

.stats-pfand-block {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stats-pfand-block .section-title { margin-bottom: 0.5rem; }
.stats-pfand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-variant-numeric: tabular-nums;
}
.stats-pfand-row .revenue { color: var(--text-muted); }

/* Auswertung nach Datum */
.stats-by-date-list { list-style: none; }
.stats-selected {
  margin-top: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 1rem;
}
.stats-selected-title {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.stats-selected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.stats-selected-header .stats-selected-title { margin: 0; }
.stats-selected-toggle {
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  font-weight: 600;
  cursor: pointer;
}
.stats-selected-toggle:hover { background: var(--surface-hover); }
.stats-selected-toggle:active { transform: translateY(1px); }
.stats-selected-table-wrap {
  width: 100%;
}
.stats-date-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.stats-date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.stats-date-header:hover { background: var(--surface-hover); }
.stats-date-label { font-weight: 600; color: var(--text); }
.stats-date-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.stats-date-csv-btn {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: calc(var(--radius) * 0.65);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.stats-date-csv-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
}
.stats-date-total { font-weight: 700; color: var(--success); font-variant-numeric: tabular-nums; }
.stats-date-details {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border);
}
.stats-date-details .stats-table { margin-bottom: 0.75rem; }
.stats-date-details .stats-table th, .stats-date-details .stats-table td { padding: 0.5rem 0.75rem; font-size: 0.9rem; }
.stats-date-pfand { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.5rem; }
.stats-empty { text-align: center; padding: 2rem; color: var(--text-muted); }

/* iPhone / Small screens */
@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

@media (max-width: 640px) {
  .login-overlay {
    align-items: flex-start;
    overflow: auto;
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .login-modal {
    max-height: 90vh;
    overflow: auto;
    padding: 1rem;
  }

  .login-pin-btn {
    padding: 0.75rem 0.4rem;
    font-size: 1.1rem;
  }

  .app {
    padding: 0.4rem 0.5rem;
    gap: 0.4rem;
  }

  header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding-bottom: 0.35rem;
  }

  .logo {
    justify-content: center;
  }

  .header-right {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.4rem 0.5rem;
    justify-content: space-between;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { width: 0; height: 0; }

  .tab {
    margin-left: 0.65rem;
    white-space: nowrap;
    padding: 0.55rem 0;
    font-size: 0.95rem;
    font-weight: 600;
  }
  .tab:first-child { margin-left: 0; }

  .sync-server-btn,
  .logout-btn {
    padding: 0.55rem 0.65rem;
    font-size: 0.95rem;
  }

  .kasse-subtabs {
    position: sticky;
    top: 0;
    z-index: 5;
  }

  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 0.28rem;
  }
  .items-grid .drink-btn {
    height: 116px;
    font-size: 0.98rem;
  }
  .items-grid .drink-btn .icon { font-size: 1.55rem; }

  .order-section {
    position: static;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    max-height: 52vh;
    overflow: hidden;
  }
  .order-list {
    max-height: 34vh;
  }

  .history-item-header {
    padding: 0.85rem 0.9rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .history-item-actions {
    width: 100%;
    justify-content: space-between;
  }

  .stats-selected-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .stats-table {
    min-width: 520px;
  }

  .modal {
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: auto;
  }
  .modal-overlay {
    align-items: flex-start;
    padding: 1rem;
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  }
  .items-grid .drink-btn {
    height: 108px;
    font-size: 0.95rem;
  }
  .order-item {
    padding: 0.6rem 0;
  }
}
