/* ============================================================================
   KassenFlow – Table Selection Styles (Tischauswahl + Numpad)
   ============================================================================ */

/* ── Override: Wenn Tischauswahl im productGrid aktiv ist ── */
.product-grid:has(.ts-layout) {
  display: block;
  padding: 8px 16px;
}

/* ── Layout: Grid + Numpad Side-by-Side ── */
.ts-layout {
  display: grid;
  /* Numpad-Breite skalierbar (Anzeige-Einstellung/KI: „Nummernfeld kleiner") */
  grid-template-columns: 1fr calc(240px * var(--kf-numpad-scale, 1) * var(--kf-numpad-width-scale, 1));
  gap: 16px;
  height: 100%;
  padding: 8px 0;
}

@media (max-width: 768px) {
  .ts-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
}

/* Nummernfeld ausgeblendet (Anzeige-Einstellung/KI: set_numpad_visible):
   Tisch-Grid bekommt die volle Breite. */
.kf-no-numpad .ts-numpad-panel { display: none; }
.kf-no-numpad .ts-layout { grid-template-columns: 1fr; }

/* ── Header ── */
.ts-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.ts-header__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #e0e6ff);
  white-space: nowrap;
}

.ts-header__counter-btn {
  margin-left: auto;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #6C5CE7, #a29bfe);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ts-header__counter-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}

.ts-header__counter-btn:active {
  transform: scale(0.97);
}

/* ── Tisch-Grid ── */
.ts-grid {
  display: grid;
  /* --kf-table-size-scale wird über Einstellungen → Ansicht gesetzt (Standard 1) */
  grid-template-columns: repeat(auto-fill, minmax(calc(130px * var(--kf-table-size-scale, 1)), 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 4px;
  align-content: start;
}

.ts-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 8px;
}

.ts-empty__icon {
  font-size: 3rem;
  opacity: 0.4;
}

.ts-empty__text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary, #8b93b0);
}

.ts-empty__sub {
  font-size: 0.8rem;
  color: var(--text-tertiary, #5a617a);
}

.ts-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-secondary, #8b93b0);
  font-size: 0.9rem;
}

/* ── Tisch-Kachel ── */
.ts-table {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 8px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary, #e0e6ff);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 90px;
  font-family: inherit;
}

.ts-table:hover {
  border-color: rgba(108, 92, 231, 0.5);
  background: rgba(108, 92, 231, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.ts-table:active {
  transform: translateY(0);
}

.ts-table__number {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.ts-table__status {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.85;
  white-space: nowrap;
}

.ts-table__duration {
  font-size: 0.65rem;
  opacity: 0.5;
}

.ts-table__name {
  font-size: 0.65rem;
  opacity: 0.5;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Tisch: Frei ── */
.ts-table--free {
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.06);
}

.ts-table--free:hover {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.12);
}

.ts-table--free .ts-table__number {
  color: #4ade80;
}

/* ── Tisch: Besetzt ── */
.ts-table--occupied {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
}

.ts-table--occupied:hover {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(59, 130, 246, 0.15);
}

.ts-table--occupied .ts-table__number {
  color: #60a5fa;
}

.ts-table--occupied .ts-table__status {
  color: #93c5fd;
  font-weight: 600;
}

/* ── Tisch: Reserviert / Da ── */
.ts-table--arrived {
  border-color: rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.08);
}

.ts-table--arrived:hover {
  border-color: rgba(168, 85, 247, 0.6);
  background: rgba(168, 85, 247, 0.15);
}

.ts-table--arrived .ts-table__number {
  color: #c084fc;
}

.ts-table--arrived .ts-table__status {
  color: #d8b4fe;
  font-weight: 600;
}

/* ── Numpad Panel ── */
.ts-numpad-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
}

.ts-numpad-display {
  text-align: center;
  font-size: calc(2.4rem * var(--kf-numpad-scale, 1));
  font-weight: 800;
  color: var(--text-primary, #e0e6ff);
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.ts-numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ts-numpad-key {
  padding: calc(18px * var(--kf-numpad-scale, 1)) 8px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary, #e0e6ff);
  font-size: calc(1.3rem * var(--kf-numpad-scale, 1));
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.ts-numpad-key:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.04);
}

.ts-numpad-key:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.2);
}

.ts-numpad-key--clear {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.ts-numpad-key--clear:hover {
  background: rgba(239, 68, 68, 0.25);
}

.ts-numpad-key--confirm {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-size: 1.5rem;
}

.ts-numpad-key--confirm:hover {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* ── Order Header (Bestellmodus) ── */
.ts-order-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.ts-back-btn {
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #e0e6ff);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.ts-back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(108, 92, 231, 0.5);
}

.ts-order-table {
  font-size: 1.1rem;
  font-weight: 700;
  color: #a29bfe;
}

.ts-order-info {
  font-size: 0.8rem;
  color: var(--text-secondary, #8b93b0);
  margin-left: auto;
}

/* ── Parteien-Tabs ── */
.party-tabs {
  display: flex;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.party-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary, #8b93b0);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.party-tab__label {
  font-weight: 700;
}

.party-tab__badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #64748b);
}

.party-tab--active .party-tab__badge {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

.party-tab:hover {
  background: rgba(108, 92, 231, 0.1);
  border-color: rgba(108, 92, 231, 0.3);
}

.party-tab--active {
  background: linear-gradient(135deg, #6C5CE7, #a29bfe);
  color: white;
  border-color: transparent;
}

.party-tab--paid {
  opacity: 0.4;
  pointer-events: none;
}

.party-tab--paid .party-tab__label {
  text-decoration: line-through;
}

.party-tab--add {
  border-style: dashed;
  color: #6C5CE7;
}

.party-tab--add:hover {
  background: rgba(108, 92, 231, 0.12);
}

/* ── Cart-Actions: Flexbox-Wrap für 4 Buttons ── */
.cart-actions {
  flex-wrap: wrap;
}

/* ── Park Button ── */
.cart-btn--park {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #F59E0B, #d97706);
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.cart-btn--park svg {
  width: 18px;
  height: 18px;
}

.cart-btn--park:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.cart-btn--park:active {
  transform: scale(0.97);
}

/* ── Park Button: Disabled (nichts zu parken) ── */
.cart-btn--park:disabled,
.cart-btn--park[disabled] {
  background: linear-gradient(135deg, #4b5563, #374151);
  color: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  opacity: 0.7;
}

.cart-btn--park:disabled:hover,
.cart-btn--park[disabled]:hover {
  transform: none;
  box-shadow: none;
}

.cart-btn--park:disabled:active,
.cart-btn--park[disabled]:active {
  transform: none;
}

/* ── Alles kassieren Button ── */
.cart-btn--pay-all {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-top: 4px;
}

.cart-btn--pay-all svg {
  width: 18px;
  height: 18px;
}

.cart-btn--pay-all:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* ── Storno Dialog (GoBD-konform) ── */
.storno-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.storno-dialog {
  background: var(--bg-secondary, #1a1d2e);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 16px;
  padding: 24px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.storno-dialog__header h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  color: #f87171;
}

.storno-dialog__sub {
  font-size: 0.75rem;
  color: var(--text-tertiary, #5a617a);
}

.storno-dialog__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  margin: 14px 0 0;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  color: var(--text-primary, #e0e6ff);
  font-size: 0.9rem;
}

.storno-dialog__remaining {
  padding: 6px 14px;
  margin: 6px 0 14px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 8px;
  color: var(--text-secondary, #8b93b0);
  font-size: 0.78rem;
  text-align: center;
}

.storno-dialog__reasons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.storno-reason-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary, #8b93b0);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-align: left;
}

.storno-reason-btn:hover {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  color: var(--text-primary, #e0e6ff);
}

.storno-reason-btn.active {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.storno-reason-icon {
  font-size: 1rem;
}

.storno-dialog__custom {
  margin-bottom: 14px;
}

.storno-dialog__custom input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-primary, #e0e6ff);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

.storno-dialog__custom input:focus {
  border-color: rgba(239, 68, 68, 0.5);
}

.storno-dialog__actions {
  display: flex;
  gap: 10px;
}

.storno-btn-cancel {
  flex: 1;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary, #8b93b0);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.storno-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
}

.storno-btn-confirm {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.storno-btn-confirm:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  transform: scale(1.02);
}

.storno-btn-confirm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ══════════════════════════════════════════════════════════════════ */
/* Split-Button (auf Cart-Items)                                     */
/* ══════════════════════════════════════════════════════════════════ */

.split-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: 6px;
  background: rgba(108, 92, 231, 0.08);
  color: #a29bfe;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.split-btn:hover {
  background: rgba(108, 92, 231, 0.2);
  border-color: rgba(108, 92, 231, 0.5);
  transform: scale(1.1);
}

/* ══════════════════════════════════════════════════════════════════ */
/* Split-Dialog (Overlay)                                            */
/* ══════════════════════════════════════════════════════════════════ */

.split-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.split-dialog {
  background: var(--bg-secondary, #1a1d2e);
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: 16px;
  padding: 20px;
  width: 440px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.split-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.split-dialog__header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #a29bfe;
}

.split-dialog__close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary, #8b93b0);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.split-dialog__close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.split-dialog__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(108, 92, 231, 0.08);
  border: 1px solid rgba(108, 92, 231, 0.2);
  border-radius: 10px;
  color: var(--text-primary, #e0e6ff);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

/* ── Qty Controls ── */
.split-dialog__qty {
  margin-bottom: 14px;
}

.split-dialog__qty label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary, #8b93b0);
  margin-bottom: 6px;
}

.split-dialog__qty-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.split-qty-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #e0e6ff);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-qty-btn:hover:not(:disabled) {
  background: rgba(108, 92, 231, 0.15);
  border-color: rgba(108, 92, 231, 0.4);
}

.split-qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.split-qty-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary, #e0e6ff);
  min-width: 30px;
  text-align: center;
}

.split-qty-max {
  font-size: 0.8rem;
  color: var(--text-tertiary, #5a617a);
}

/* ── Sections ── */
.split-dialog__section {
  margin-bottom: 14px;
}

.split-dialog__section h4 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary, #8b93b0);
}

.split-dialog__targets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.split-dialog__tables {
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  max-height: 160px;
  overflow-y: auto;
}

/* ── Numpad im Split-Dialog ── */
.split-dialog__numpad-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.split-numpad-input {
  width: 80px;
  height: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: 10px;
  background: rgba(108, 92, 231, 0.06);
  color: var(--text-primary, #e0e6ff);
  font-size: 1.3rem;
  font-weight: 800;
  text-align: center;
  font-family: inherit;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-numpad-input::placeholder {
  color: var(--text-tertiary, #5a617a);
  font-weight: 500;
  font-size: 0.85rem;
}

.split-numpad-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  flex: 1;
}

.split-numpad-key {
  padding: 6px;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary, #e0e6ff);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.1s ease;
  font-family: inherit;
  touch-action: manipulation;
}

.split-numpad-key:hover {
  background: rgba(255, 255, 255, 0.1);
}

.split-numpad-key:active {
  transform: scale(0.95);
}

.split-numpad-key--clear {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}

.split-numpad-key--go {
  background: linear-gradient(135deg, #6C5CE7, #a29bfe);
  color: white;
  border-color: transparent;
  font-size: 1rem;
}

.split-numpad-key--go:hover {
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.4);
}

.split-target-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary, #e0e6ff);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  touch-action: manipulation;
}

.split-target-btn:hover {
  border-color: rgba(108, 92, 231, 0.5);
  background: rgba(108, 92, 231, 0.12);
  transform: translateY(-1px);
}

.split-target-btn:active {
  transform: translateY(0);
}

.split-target__label {
  font-size: 0.9rem;
  font-weight: 700;
}

.split-target__info {
  font-size: 0.7rem;
  color: var(--text-tertiary, #5a617a);
}

.split-target-btn--occupied {
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.06);
}

.split-target-btn--occupied:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.12);
}

.split-target-btn--new {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.07);
  border-style: dashed;
}

.split-target-btn--new:hover {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.14);
}

.split-dialog__cancel {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary, #8b93b0);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.split-dialog__cancel:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ══════════════════════════════════════════════════════════════════ */
/* SMARTPHONE: Tischauswahl-Verhältnisse an das Display anpassen       */
/* ----------------------------------------------------------------- */
/* MUSS am Dateiende stehen: die Basisregeln (.ts-grid, .ts-table,    */
/* .ts-numpad-*) stehen weiter oben; bei gleicher Spezifität gewinnt   */
/* die SPÄTERE Regel. Sonst überschreibt die Basis diese Overrides.   */
/* Problem ohne das: der große Numpad frisst fast die ganze Höhe und   */
/* drückt das Tisch-Grid zu einem 37px-Streifen → "Warenkorb überdeckt */
/* die Tische". Hier: Tische = Hauptbereich (scrollbar), Numpad kompakt.*/
/* ══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .ts-layout {
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 0;
    height: 100%;
  }

  .ts-grid {
    min-height: 0; /* erlaubt echtes Schrumpfen → eigenes Scrollen statt Überlauf */
    grid-template-columns: repeat(auto-fill, minmax(calc(96px * var(--kf-table-size-scale, 1)), 1fr));
    gap: 8px;
  }

  .ts-table {
    min-height: 72px;
    padding: 10px 6px;
  }

  .ts-table__number {
    font-size: 1.3rem;
  }

  /* Numpad deutlich kompakter – damit die Tische die Mehrheit der Höhe bekommen. */
  .ts-numpad-panel {
    padding: 8px;
    gap: 6px;
  }

  .ts-numpad-display {
    font-size: 1.5rem;
    min-height: 40px;
    padding: 6px;
  }

  .ts-numpad-grid {
    gap: 6px;
  }

  .ts-numpad-key {
    padding: 11px 6px;
    font-size: 1.05rem;
  }

  .ts-numpad-key--confirm {
    font-size: 1.2rem;
  }
}

/* Kurze Displays (kleine/ältere Smartphones, Landscape): Numpad NOCH kompakter,
   damit das Tisch-Grid auch bei wenig Höhe nutzbar bleibt statt zum Streifen zu
   schrumpfen. Greift zusätzlich zur Breiten-Regel oben. */
@media (max-width: 768px) and (max-height: 720px) {
  .ts-numpad-panel {
    padding: 6px;
    gap: 4px;
  }

  .ts-numpad-display {
    font-size: 1.15rem;
    min-height: 28px;
    padding: 4px;
  }

  .ts-numpad-grid {
    gap: 4px;
  }

  .ts-numpad-key {
    padding: 6px 5px;
    font-size: 0.9rem;
  }

  .ts-numpad-key--confirm {
    font-size: 1rem;
  }
}

/* ============================================================================
   STAMMGÄSTE (benennbare „Tische") – Sektion unter dem Tisch-Grid + Umschalter
   ============================================================================ */

/* Linke Spalte: Tische oben, Stammgäste unten. Auf großen Screens beide sichtbar. */
.ts-left-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.ts-left-col .ts-grid { flex: 1 1 auto; min-height: 0; }

.ts-regulars {
  flex: 0 0 auto;
  max-height: 38%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-top: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  padding-top: 8px;
}
.ts-regulars__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.ts-regulars__title { font-size: 0.95rem; font-weight: 700; color: var(--text-primary, #e0e6ff); }
.ts-add-regular {
  padding: 6px 12px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.15));
  border-radius: 8px;
  background: var(--glass, rgba(255, 255, 255, 0.06));
  color: var(--text-primary, #e0e6ff);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ts-add-regular:hover { background: rgba(255, 255, 255, 0.12); }
.ts-regulars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(130px * var(--kf-table-size-scale, 1)), 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 4px;
  align-content: start;
}
.ts-regulars__empty {
  grid-column: 1 / -1;
  color: var(--text-muted, #8a90b8);
  font-size: 0.85rem;
  padding: 12px;
  text-align: center;
}
/* Stammgast-Kachel erbt die .ts-table-Optik, mit leichtem Stern-Akzent. */
.ts-table.ts-regular {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.06), rgba(108, 92, 231, 0.05));
}

/* Ansicht-Umschalter im Header: NUR auf kleinen Screens (Default: versteckt). */
.ts-view-toggle { display: none; }
.ts-view-btn {
  padding: 6px 12px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.15));
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary, #a9b0d6);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.ts-view-btn--active { background: var(--accent, #6C5CE7); color: #fff; border-color: var(--accent, #6C5CE7); }

@media (max-width: 768px) {
  .ts-header { flex-wrap: wrap; }
  .ts-view-toggle { display: flex; gap: 6px; }
  /* Auf kleinen Screens NUR eine Sektion zeigen (per Umschalter); Numpad im
     Stammgast-View ausblenden (namensbasiert → Nummernblock nutzlos, gewinnt Höhe). */
  .ts-regulars { max-height: none; flex: 1 1 auto; border-top: none; padding-top: 0; }
  .ts-layout:not(.ts-show-regulars) .ts-regulars { display: none; }
  .ts-layout.ts-show-regulars .ts-grid { display: none; }
  .ts-layout.ts-show-regulars .ts-numpad-panel { display: none; }
}

/* ── Stammgast-Anlege-Modal (Namens-Vorauswahl / Autocomplete + ✕ zum Löschen) ── */
.ts-reg-modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 10050; padding: 16px;
}
.ts-reg-box {
  width: 100%; max-width: 420px; max-height: 80vh;
  display: flex; flex-direction: column;
  background: var(--bg-secondary, #1a1f3a);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
  border-radius: 14px; padding: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.ts-reg-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 1.05rem; font-weight: 700; color: var(--text-primary, #e0e6ff); margin-bottom: 12px;
}
.ts-reg-close {
  border: none; background: transparent; color: var(--text-muted, #8a90b8);
  font-size: 1.1rem; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.ts-reg-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary, #e0e6ff); }
.ts-reg-input {
  width: 100%; box-sizing: border-box; padding: 12px 14px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.15)); border-radius: 10px;
  background: var(--bg-primary, #12162e); color: var(--text-primary, #e0e6ff);
  font-size: 1rem; outline: none;
}
.ts-reg-input:focus { border-color: var(--accent, #6C5CE7); box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.25); }
.ts-reg-list { margin-top: 10px; overflow-y: auto; flex: 1 1 auto; min-height: 40px; }
.ts-reg-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ts-reg-name {
  flex: 1; text-align: left; padding: 10px 12px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12)); border-radius: 8px;
  background: var(--bg-card, rgba(255, 255, 255, 0.04)); color: var(--text-primary, #e0e6ff);
  font-size: 0.92rem; font-weight: 600; cursor: pointer;
}
.ts-reg-name:hover { background: var(--accent, #6C5CE7); color: #fff; border-color: var(--accent, #6C5CE7); }
.ts-reg-del {
  flex-shrink: 0; width: 38px; height: 38px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12)); border-radius: 8px;
  background: transparent; color: var(--text-muted, #8a90b8); font-size: 0.95rem; cursor: pointer;
}
.ts-reg-del:hover { background: rgba(239, 68, 68, 0.18); color: #ef4444; border-color: rgba(239, 68, 68, 0.35); }
.ts-reg-empty { color: var(--text-muted, #8a90b8); font-size: 0.85rem; padding: 14px 4px; text-align: center; }
.ts-reg-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.ts-reg-btn {
  padding: 10px 18px; border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.15)); border-radius: 8px;
  background: var(--glass, rgba(255, 255, 255, 0.06)); color: var(--text-primary, #e0e6ff);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.ts-reg-btn--primary { background: var(--accent, #6C5CE7); border-color: var(--accent, #6C5CE7); color: #fff; }
.ts-reg-btn--danger { background: var(--danger, #e05555); border-color: var(--danger, #e05555); color: #fff; }
.ts-reg-btn:hover { filter: brightness(1.1); }

/* ── Bestätigungs-Dialog (tsConfirm) – nutzt die ts-reg-Modal-Optik ── */
.ts-confirm-box { max-width: 360px; }
.ts-confirm-msg { font-size: 0.98rem; line-height: 1.45; color: var(--text-primary, #e0e6ff); }

/* ── Stammgast-Kachel mit „−"-Entfernen-Knopf ──
   Wrapper füllt die Grid-Zelle; die Kachel bleibt der große Öffnen-Bereich,
   das „−" liegt als eigener Knopf oben rechts (ein <button> darf kein <button>
   enthalten → deshalb der Wrapper). */
.ts-regular-wrap { position: relative; display: flex; }
.ts-regular-wrap > .ts-table { flex: 1 1 auto; width: 100%; }
.ts-regular-remove {
  position: absolute; top: 5px; right: 5px;
  width: 30px; height: 30px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.2));
  background: rgba(18, 22, 46, 0.78);
  color: var(--text-secondary, #cfd3ee);
  font-size: 22px; font-weight: 700; line-height: 1; cursor: pointer;
  z-index: 2; -webkit-tap-highlight-color: transparent;
}
.ts-regular-remove:hover { background: var(--danger, #e05555); border-color: var(--danger, #e05555); color: #fff; }
.ts-regular-remove:active { transform: scale(0.9); }
/* Boniert = optisch gesperrt (bleibt klickbar → erklärender Toast statt still). */
.ts-regular-remove--locked { opacity: 0.4; }
.ts-regular-remove--locked:hover {
  background: rgba(18, 22, 46, 0.78);
  border-color: var(--glass-border, rgba(255, 255, 255, 0.2));
  color: var(--text-secondary, #cfd3ee);
  cursor: not-allowed;
}

/* HELL-MODUS (Sonnenmodus) – Tisch-Kacheln sichtbar (Pilot-Fund 2026-07-14).
   .ts-table ist für DUNKLEN Grund gebaut (background/border = rgba(255,255,255,…))
   → im Hell-Modus unsichtbar (nur Nummer/Icon „schweben"). Gleiche Fehlerklasse
   wie die schwarzen Felder: für Dunkel verdrahtete Farben ignorieren den Hell-Modus. */
html.kf-light .ts-table {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.10);
}
html.kf-light .ts-table:hover {
  background: #f1f5f9;
  border-color: rgba(108, 92, 231, 0.55);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14);
}
