/* Sidebar styles inherited from style.css */

/* ============================================
   Main Content Area
   ============================================ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

.room-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--action-btn-bg);
  padding: 6px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.room-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #000000 !important;
  padding: 8px 18px;
  border-radius: 14px;
  border: none !important;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.95rem;
  position: relative;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.room-selector:hover {
  background: #1a1a1a !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.room-selector::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.6;
  margin-left: 4px;
}

/* Hide original chips, we will use a different rendering in JS */
.room-chip {
  display: none;
}

.room-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: rgba(0, 0, 0, 0.95) !important;
  backdrop-filter: blur(30px) saturate(210%);
  -webkit-backdrop-filter: blur(30px) saturate(210%);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  min-width: 220px;
  padding: 8px;
  display: none;
  transform-origin: top left;
}

.room-dropdown.show {
  display: block;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-5px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.room-dropdown-item {
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #ffffff !important;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.room-dropdown-item:hover {
  background: var(--ios-blue);
  color: #000000;
}

.room-dropdown-item.active {
  background: rgba(0, 122, 255, 0.15);
  color: var(--ios-blue);
  font-weight: 700;
}

.room-dropdown-item.active:hover {
   color: #000000;
}

.room-dropdown-divider {
  height: 1px;
  background: var(--macos-border);
  margin: 6px 4px;
}

.room-dropdown-action {
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ios-blue);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.room-dropdown-action:hover {
  background: rgba(0, 122, 255, 0.1);
}

#btn-nfc-scan, 
#btn-add-table,
#btn-floor-config,
#btn-edit-mode {
  background: #314254;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  transition: all 0.3s ease !important;
}

#btn-nfc-scan:hover, 
#btn-add-table:hover,
#btn-edit-mode:hover {
  background: #3a3a3c; /* Slightly lighter on hover */
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3) !important;
}

/* Topbar actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}


.designer-only {
  display: none !important;
}

.edit-mode-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--warning-light);
  border: 1px solid var(--warning);
  color: var(--warning);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  animation: pulse 2s infinite;
}

/* ============================================
   Floor Plan (Blueprint)
   ============================================ */
.floor-plan-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, rgba(58, 58, 60, 0.1) 0%, rgba(49, 66, 84, 0.1) 100%);
  touch-action: none; /* Crucial for custom touch handling */
}

.floor-plan {
  position: relative;
  width: 2000px; /* Expanded area to avoid cut-off background */
  height: 1600px;
  background-color: transparent;
  background-image:
    linear-gradient(rgba(10, 132, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 132, 255, 0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  cursor: default;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* Ensure a large navigable area on mobile */
@media (max-width: 1024px) {
  /* Dimensions fixed at 1000x800, handled by JS scale */
}

.floor-plan.is-panning {
  transition: none !important;
}

.floor-plan.focus-mode::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1;
  pointer-events: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.floor-plan.focus-mode .table-element:not(.selected) {
  filter: blur(2px) grayscale(30%);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.floor-plan.focus-mode .table-element.selected {
  z-index: 100 !important;
  transform: scale(1.05);
}

[data-theme="dark"] .floor-plan {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

.floor-plan.edit-mode {
  cursor: crosshair;
}

/* Floor Designs - Modular classes for preview and main floor */
.floor-default {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
}

.floor-wood {
  background-color: #3d2b1f;
  background-image: 
    linear-gradient(90deg, rgba(0,0,0,0.1) 1px, transparent 1px),
    repeating-linear-gradient(transparent 0, transparent 40px, rgba(0,0,0,0.05) 40px, rgba(0,0,0,0.05) 41px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 50%, transparent 50.5%);
  background-size: 150px 100%, 100% 41px, 300px 100%;
}

.floor-tile {
  background-color: #2c3e50;
  background-image: 
    linear-gradient(white 1px, transparent 1px),
    linear-gradient(90deg, white 1px, transparent 1px);
  background-size: 80px 80px;
}

.floor-granite {
  background-color: #3a3a3c;
  background-image: 
    radial-gradient(#4a4a4c 1px, transparent 0),
    radial-gradient(#2c2c2e 1px, transparent 0);
  background-size: 4px 4px;
}

.floor-marble {
  background-color: #e5e5e7;
  background-image: 
    linear-gradient(120deg, rgba(0,0,0,0.05) 25%, transparent 25.1%),
    linear-gradient(240deg, rgba(0,0,0,0.03) 25%, transparent 25.1%);
  background-size: 200px 200px;
}

.floor-parquet {
  background-color: #4a3728;
  background-image: 
    linear-gradient(90deg, rgba(0,0,0,0.15) 1px, transparent 1px),
    linear-gradient(rgba(0,0,0,0.15) 1px, transparent 1px);
  background-size: 100px 40px;
}

.floor-carpet {
  background-color: #8b0000;
  background-image: radial-gradient(rgba(0,0,0,0.2) 15%, transparent 16%),
                    radial-gradient(rgba(0,0,0,0.2) 15%, transparent 16%);
  background-size: 8px 8px;
}

.floor-concrete {
  background-color: #7f8c8d;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.05) 0%, transparent 60%),
    linear-gradient(45deg, rgba(0,0,0,0.02) 25%, transparent 25%);
  background-size: 100% 100%, 20px 20px;
}

.floor-terrazzo {
  background-color: #dcdde1;
  background-image: 
    radial-gradient(circle at 10% 20%, #e67e22 2px, transparent 3px),
    radial-gradient(circle at 30% 50%, #3498db 2px, transparent 3px),
    radial-gradient(circle at 70% 30%, #2c3e50 2px, transparent 3px);
  background-size: 30px 30px;
}

.floor-checker {
  background-color: #111;
  background-image: 
    conic-gradient(#222 90deg, transparent 90deg 180deg, #222 180deg 270deg, transparent 270deg);
  background-size: 60px 60px;
}

.floor-vintage {
  background-color: #f5e6d3;
  background-image: 
    radial-gradient(circle at 50% 50%, #d4a373 5%, transparent 6%),
    linear-gradient(#f5e6d3 1px, transparent 1px),
    linear-gradient(90deg, #f5e6d3 1px, transparent 1px);
  background-size: 40px 40px;
}

.floor-stone {
  background-color: #7f8c8d;
  background-image: 
    radial-gradient(rgba(0,0,0,0.1) 20%, transparent 21%),
    radial-gradient(rgba(0,0,0,0.1) 20%, transparent 21%);
  background-size: 80px 80px;
  background-position: 0 0, 40px 40px;
}

.floor-industrial {
  background-color: #2c2c2e;
  background-image: 
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px),
    repeating-linear-gradient(45deg, rgba(0,0,0,0.05) 0, rgba(0,0,0,0.05) 2px, transparent 2px, transparent 4px);
  background-size: 100% 100%, 10px 10px;
}

.floor-walnut {
  background-color: #2c1b0e;
  background-image: linear-gradient(90deg, rgba(0,0,0,0.2) 1px, transparent 1px), 
                    repeating-linear-gradient(transparent 0, transparent 40px, rgba(0,0,0,0.1) 40px, rgba(0,0,0,0.1) 41px);
  background-size: 150px 100%, 100% 41px;
}

.floor-deck {
  background-color: #8d6e63;
  background-image: linear-gradient(90deg, rgba(0,0,0,0.1) 2px, transparent 2px);
  background-size: 60px 100%;
}

.floor-grass {
  background-color: #27ae60;
  background-image: radial-gradient(rgba(255,255,255,0.1) 10%, transparent 11%), 
                    radial-gradient(rgba(0,0,0,0.05) 5%, transparent 6%);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
}

.floor-sand {
  background-color: #f1c40f;
  background-image: radial-gradient(rgba(0,0,0,0.05) 1px, transparent 0);
  background-size: 3px 3px;
}

.floor-mosaic {
  background-color: #ecf0f1;
  background-image: 
    conic-gradient(#3498db 45deg, #e74c3c 45deg 90deg, #f1c40f 90deg 135deg, #2ecc71 135deg 180deg, 
                   #3498db 180deg 225deg, #e74c3c 225deg 270deg, #f1c40f 270deg 315deg, #2ecc71 315deg);
  background-size: 100px 100px;
  opacity: 0.8;
}

.floor-slate {
  background-color: #2f3640;
  background-image: radial-gradient(ellipse at center, rgba(255,255,255,0.05) 0%, transparent 70%);
  background-size: 100% 100%;
}

.floor-brick {
  background-color: #c0392b;
  background-image: 
    linear-gradient(90deg, rgba(255,255,255,0.1) 2px, transparent 2px),
    linear-gradient(rgba(255,255,255,0.1) 2px, transparent 2px);
  background-size: 80px 40px;
  background-position: 0 0, 40px 20px;
}

.floor-galaxy {
  background-color: #0c0d1b;
  background-image: 
    radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 40px),
    radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 30px);
  background-size: 550px 550px, 350px 350px;
}

.floor-gold {
  background-color: #d4af37;
  background-image: linear-gradient(135deg, rgba(255,215,0,0.3) 0%, transparent 50%, rgba(255,215,0,0.3) 100%);
  background-size: 200% 200%;
}

.floor-bamboo {
  background-color: #a3b18a;
  background-image: linear-gradient(90deg, rgba(0,0,0,0.05) 10px, transparent 10px);
  background-size: 40px 100%;
}

.floor-epoxy {
  background: radial-gradient(circle at 30% 30%, #3498db, #2980b9, #1c1c1e);
  background-size: 200% 200%;
}

.floor-kds-dark {
  background: linear-gradient(135deg, #2f2f31 0%, #1c1c1e 100%) !important;
  background-image: linear-gradient(135deg, #2f2f31 0%, #1c1c1e 100%) !important;
}

.floor-solid {
  background-image: none !important;
}

.floor-metal-grid {
  background-color: #0c0c0e;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.1) 0%, transparent 75%),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 100% 100%, 60px 60px, 60px 60px;
  background-attachment: local, local, local;
}

.floor-metal-grid-blue {
  background-color: #0a0d16;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(0, 122, 255, 0.2) 0%, transparent 75%),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 100% 100%, 60px 60px, 60px 60px;
  background-attachment: local, local, local;
}

.floor-metal-grid-red {
  background-color: #120a0a;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 59, 48, 0.15) 0%, transparent 75%),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 100% 100%, 60px 60px, 60px 60px;
  background-attachment: local, local, local;
}

.floor-metal-grid-gold {
  background-color: #110f0a;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 214, 10, 0.15) 0%, transparent 75%),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 60px 60px, 60px 60px;
  background-attachment: local, local, local;
}

.floor-chessboard {
  background-color: #ffffff;
  background-image: 
    conic-gradient(#1a1a1a 90deg, transparent 90deg 180deg, #1a1a1a 180deg 270deg, transparent 270deg);
  background-size: 100px 100px;
}

/* Modal Previews */
.floor-preview {
  width: 100%;
  height: 60px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
  pointer-events: none; /* Evita que el click interno interfiera */
}
.floor-preview.floor-default { background-color: #1a1a1c; }
.floor-preview.floor-metal-grid { background-color: #0c0c0e; background-size: 20px 20px; }
.floor-preview.floor-metal-grid-blue { background-color: #0a0d16; background-size: 20px 20px; }
.floor-preview.floor-metal-grid-red { background-color: #120a0a; background-size: 20px 20px; }
.floor-preview.floor-metal-grid-gold { background-color: #110f0a; background-size: 20px 20px; }
.floor-preview.floor-chessboard { background-size: 30px 30px; }

/* ============================================
   Table Elements
   ============================================ */
.table-element {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  cursor: pointer !important; /* Force pointer to avoid interact.js default move cursor */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
  z-index: 1;
}

/* Edit mode specific cursors */
.floor-plan.edit-mode .table-element {
  cursor: grab !important;
}

.floor-plan.edit-mode .table-element:active {
  cursor: grabbing !important;
}

.table-element::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.table-element:hover {
  z-index: 2;
  transform: scale(1.03);
}
.table-element:not(.type-deco):hover::before {
  opacity: 1;
}

/* Table shapes */
.table-element.shape-square {
  border-radius: var(--radius-lg);
}
.table-element.shape-round {
  border-radius: 50%;
}
.table-element.shape-rectangle {
  border-radius: var(--radius-md);
}
.table-element.shape-hexagon .table-bg {
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  border-radius: 0;
}
.table-element.shape-bar-table {
  border-radius: 0;
  border-bottom: 3px solid rgba(255,255,255,0.2);
}
.table-element.shape-capsule {
  border-radius: 1000px;
}

/* Decorative Elements Specific Styles */
.table-element.sub-wall {
  background: #333 !important;
  border-radius: 0 !important;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
  border: 1px solid #000;
}

.table-element.sub-wall .table-bg,
.table-element.sub-wall .table-bg::after {
  display: none !important;
}

.table-element.sub-wall-black { background: #000 !important; border-radius: 0 !important; border: 1px solid #333; }
.table-element.sub-wall-white { background: #fff !important; border-radius: 0 !important; border: 1px solid #ddd; }
.table-element.sub-wall-blue { background: #007aff !important; border-radius: 0 !important; border: 1px solid #0056b3; }
.table-element.sub-wall-yellow { background: #ffcc00 !important; border-radius: 0 !important; border: 1px solid #e6b800; }

.table-element.sub-wall-black .table-bg, .table-element.sub-wall-black .table-bg::after,
.table-element.sub-wall-white .table-bg, .table-element.sub-wall-white .table-bg::after,
.table-element.sub-wall-blue .table-bg, .table-element.sub-wall-blue .table-bg::after,
.table-element.sub-wall-yellow .table-bg, .table-element.sub-wall-yellow .table-bg::after {
  display: none !important;
}

.table-element.sub-door {
  background: #666 !important;
  border-radius: 0 !important;
  border: 2px dashed #999;
}

.table-element.sub-door .table-bg,
.table-element.sub-door .table-bg::after {
  display: none !important;
}

.table-element.sub-column {
  background: #111 !important;
  border-radius: 4px !important;
  border: 1px solid #000;
}

.table-element.sub-column .table-bg,
.table-element.sub-column .table-bg::after {
  display: none !important;
}

.table-element.sub-window {
  background: rgba(173, 216, 230, 0.4) !important;
  border: 2px solid #add8e6;
  border-radius: 0 !important;
}

.table-element.sub-window .table-bg,
.table-element.sub-window .table-bg::after {
  display: none !important;
}

/* Table bg for stacking context solution */
.table-bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 5;
  overflow: hidden;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

/* Luxury Center Glow & Internal Rim */
.table-bg::before {
  content: '';
  position: absolute;
  inset: 8px; /* Subtle rim */
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 6;
  opacity: 0.6;
}

/* Premium Crystal Glass Effect */
.table-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: 
    radial-gradient(circle at 30% 15%, rgba(255, 255, 255, 0.5) 0%, transparent 45%),
    radial-gradient(circle at 75% 85%, rgba(255, 255, 255, 0.25) 0%, transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.08) 100%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 
    inset 0 4px 6px rgba(255, 255, 255, 0.4),
    inset 0 -4px 10px rgba(0, 0, 0, 0.1),
    0 10px 30px rgba(0, 0, 0, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px) saturate(180%) brightness(1.05);
  -webkit-backdrop-filter: blur(12px) saturate(180%) brightness(1.05);
  pointer-events: none;
  z-index: 1;
}

.table-element:hover .table-bg::after {
  background: 
    radial-gradient(circle at 25% 10%, rgba(255, 255, 255, 0.6) 0%, transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(255, 255, 255, 0.35) 0%, transparent 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, transparent 100%);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 
    inset 0 8px 15px rgba(255, 255, 255, 0.6),
    inset 0 -12px 25px rgba(0, 0, 0, 0.2),
    0 18px 45px rgba(0, 0, 0, 0.5);
}

/* Table state colors - Deep Saturations */
.table-element.state-free .table-bg {
  background: linear-gradient(145deg, #30D158, #248A3D);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 20px rgba(48, 209, 88, 0.25);
}
.table-element.state-free:hover .table-bg {
  background: linear-gradient(135deg, #34E05B, #2AA146);
}

.table-element.state-occupied .table-bg {
  background: linear-gradient(145deg, #FF453A, #9E0E0E);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 25px rgba(255, 69, 58, 0.35);
}

.table-element.state-reserved .table-bg {
  background: linear-gradient(145deg, #FF9F0A, #C97D00);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 25px rgba(255, 159, 10, 0.3);
}

.table-element.state-waiting .table-bg {
  background: linear-gradient(145deg, #5E5CE6, #3634A3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 25px rgba(94, 92, 230, 0.35);
  animation: pulse 2s ease infinite;
}

.table-element.selected .table-bg::after {
  border: 4px solid #ffffff !important;
  box-shadow: 
    0 0 0 2px rgba(0, 0, 0, 0.1),
    0 0 30px rgba(255, 255, 255, 0.5),
    inset 0 0 15px rgba(255, 255, 255, 0.3);
}

.table-element.selected .table-number {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  transform: rotate(calc(-1 * var(--table-rotation, 0deg))) scale(1.1);
  transition: transform 0.3s ease;
}

/* Kitchen status based colors - Priority over manual states */
.table-element.ks-draft .table-bg {
  background: linear-gradient(135deg, #F2D600, #C9B100) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 8px 20px rgba(242, 214, 0, 0.3) !important;
}
.table-element.ks-draft .chair { background: #F2D600; }
.table-element.ks-draft .chair::after { background: #C9B100; }

.table-element.ks-kitchen .table-bg {
  background: linear-gradient(135deg, #2980B9, #1F618D) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 8px 20px rgba(41, 128, 185, 0.3) !important;
}
.table-element.ks-kitchen .chair { background: #2980B9; }
.table-element.ks-kitchen .chair::after { background: #1F618D; }

.table-element.ks-ready {
  z-index: 10 !important;
}

.table-element.ks-ready::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 4px solid #ffffff;
  border-radius: inherit;
  z-index: 20;
  pointer-events: none;
  animation: ready-table-flash 1.0s infinite !important;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

@keyframes ready-table-flash {
  0% { border-color: #ffffff; box-shadow: 0 0 5px rgba(255, 255, 255, 0.5); transform: scale(1.0); }
  50% { border-color: #34c759; box-shadow: 0 0 20px 8px rgba(52, 199, 89, 0.7); transform: scale(1.02); }
  100% { border-color: #ffffff; box-shadow: 0 0 5px rgba(255, 255, 255, 0.5); transform: scale(1.0); }
}

.table-element.ks-ready .table-bg {
  background: linear-gradient(135deg, #27AE60, #1E8449) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 8px 20px rgba(39, 174, 96, 0.3) !important;
}
.table-element.ks-ready .chair { background: #27AE60; }
.table-element.ks-ready .chair::after { background: #1E8449; }

/* Station Ready Indicators */
.station-ready-indicators {
  position: absolute;
  top: -12px;
  right: -12px;
  display: flex;
  gap: 4px;
  z-index: 50;
  pointer-events: none;
}

.station-indicator {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 2px solid #ffffff;
}

.station-indicator i {
  width: 18px;
  height: 18px;
}

.ki-cocina-ready {
  background: #ff9500 !important; /* Orange for kitchen */
  color: #ffffff !important;
  border-color: #ffcc00 !important;
}

.ki-bar-ready {
  background: #5856d6 !important; /* Purple/Indigo for bar */
  color: #ffffff !important;
  border-color: #af52de !important;
}

.station-indicator.pulsing {
  animation: indicator-pulse 1.5s infinite;
}

@keyframes indicator-pulse {
  0% { transform: scale(1); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
  50% { transform: scale(1.15); box-shadow: 0 0 20px rgba(255, 255, 255, 0.6); }
  100% { transform: scale(1); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
}

/* Chair indicators - Top Down Realism */
.chair {
  position: absolute;
  width: 38px;
  height: 38px;
  background: #2c2c2e;
  border-radius: 8px; /* Softer rounded chairs */
  box-shadow: 
    0 6px 12px rgba(0,0,0,0.5),
    inset 0 1px 1px rgba(255,255,255,0.1);
  overflow: hidden;
  z-index: 1; /* Lowest level, will be covered by table-bg */
  border: 1px solid rgba(255,255,255,0.05);
}

.chair::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.05);
  transition: all var(--transition-fast);
  box-shadow: inset 0 -4px 6px rgba(0,0,0,0.3);
}

/* Chair backrests seen from above - Refined profiles */
.chair.top::after { top: 0; left: 0; right: 0; height: 10px; border-radius: 6px 6px 0 0; }
.chair.bottom::after { bottom: 0; left: 0; right: 0; height: 10px; border-radius: 0 0 6px 6px; }
.chair.left::after { left: 0; top: 0; bottom: 0; width: 10px; border-radius: 6px 0 0 6px; }
.chair.right::after { right: 0; top: 0; bottom: 0; width: 10px; border-radius: 0 6px 6px 0; }

.state-free .chair { background: #1a6d2c; border-color: #34C759; }
.state-occupied .chair { background: #611818; border-color: #ff453a; }
.state-reserved .chair { background: #875c06; border-color: #ff9f0a; }
.state-waiting .chair { background: #32318c; border-color: #5e5ce6; color: white; }

/* Table inner content */
.table-number, 
.table-label, 
.table-order-badge, 
.table-pay-badge, 
.service-request-badge,
.kitchen-indicator,
.bar-indicator {
  transform: rotate(calc(-1 * var(--table-rotation, 0deg)));
  transition: transform 0.3s ease;
}

.table-number {
  font-size: 2rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 
    0 1px 1px rgba(0,0,0,0.5),
    0 4px 15px rgba(0,0,0,0.3);
  letter-spacing: -2px;
  line-height: 1;
  z-index: 30;
  -webkit-font-smoothing: antialiased;
}

.table-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 30;
}

.table-order-badge {
  position: absolute; top: -10px; right: -10px;
  background: var(--accent-color); color: white;
  min-width: 24px; height: 24px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; border: 2.5px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15); z-index: 30;
}

.table-pay-badge {
  position: absolute; top: -10px; left: -10px;
  background: #34C759; color: white;
  padding: 4px 8px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 10px; font-weight: 900; border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(52,199,89,0.3); z-index: 30;
}
.table-pay-badge i { width: 12px; height: 12px; }

.pulsing {
  animation: pulse-glow 2s infinite ease-in-out;
}
@keyframes pulse-glow {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(52,199,89,0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px 5px rgba(52,199,89,0.2); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(52,199,89,0); }
}

.payment-verify-box {
  margin-top: 10px;
  animation: slideInUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-verify-confirm {
  background: #34C759; color: #fff; border: none; padding: 10px;
  border-radius: 14px; font-weight: 800; font-size: 0.85rem;
  cursor: pointer; transition: 0.2s;
}
.btn-verify-confirm:hover { background: #28a745; transform: translateY(-2px); }
.btn-verify-confirm:active { transform: scale(0.96); }

.btn-verify-reject {
  background: #fff; color: #FF3B30; border: 1.5px solid #FF3B30; padding: 10px;
  border-radius: 14px; font-weight: 700; font-size: 0.85rem;
  cursor: pointer; transition: 0.2s;
}
.btn-verify-reject:hover { background: #fff1f0; }
.btn-verify-reject:active { transform: scale(0.96); }

/* Chair indicators around tables */
.chair-indicators {
  position: absolute;
  inset: -20px;
  pointer-events: none;
  z-index: 1; /* Lowest z-index within table element */
}

/* Edit mode table styles */
.edit-mode .table-element {
  cursor: move;
  border-style: dashed !important;
}
.edit-mode .table-element:hover {
  transform: none;
}

.resize-handle {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  background: var(--warning);
  border-radius: 50%;
  cursor: se-resize;
  display: none;
  z-index: 50;
  border: 2px solid var(--bg-primary);
}
.edit-mode .resize-handle {
  display: block;
}

.rotate-handle {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background: var(--accent);
  border-radius: 50%;
  cursor: grab;
  display: none;
  z-index: 51;
  border: 2px solid white;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.edit-mode .rotate-handle {
  display: flex;
}

.delete-handle {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  border-radius: 50%;
  cursor: pointer;
  display: none;
  z-index: 52;
  border: 2px solid var(--bg-primary);
  font-size: 0.6rem;
  color: white;
  align-items: center;
  justify-content: center;
}
.edit-mode .delete-handle {
  display: flex;
}

/* ============================================
   Decorative & Extra Elements
   ============================================ */
.table-element.type-deco {
  border: none;
  background: transparent;
  box-shadow: none;
}

.table-element.type-deco .table-bg {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  opacity: 1; /* Made solid as requested */
}

.table-element.type-deco .table-number,
.table-element.type-deco .table-label,
.table-element.type-deco .chair-indicators {
  display: none !important;
}

/* Specific deco types - PHOTO REALISTIC CSS */
.table-element.sub-plant .table-bg {
  background: #795548; /* pot */
  border: 2px solid #4e342e;
  border-radius: 50%;
  box-shadow: 0 5px 10px rgba(0,0,0,0.3);
}
.table-element.sub-plant::before {
  content: ''; position: absolute;
  inset: -10%;
  background: 
    radial-gradient(circle at 50% 20%, #4caf50 15%, transparent 20%),
    radial-gradient(circle at 50% 80%, #4caf50 15%, transparent 20%),
    radial-gradient(circle at 20% 50%, #4caf50 15%, transparent 20%),
    radial-gradient(circle at 80% 50%, #4caf50 15%, transparent 20%),
    radial-gradient(circle at 28% 28%, #4caf50 15%, transparent 20%),
    radial-gradient(circle at 72% 72%, #4caf50 15%, transparent 20%),
    radial-gradient(circle at 28% 72%, #4caf50 15%, transparent 20%),
    radial-gradient(circle at 72% 28%, #4caf50 15%, transparent 20%);
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
  pointer-events: none;
}
.table-element.sub-plant::after {
  content: ''; position: absolute;
  inset: 20%;
  background: #388e3c;
  border-radius: 50%;
  border: 2px solid #2e7d32;
  pointer-events: none;
}

.table-element.sub-sofa .table-bg {
  background: #34495e;
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}
.table-element.sub-sofa::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #2c3e50;
  /* Respaldo arriba + 2 reposabrazos laterales (U invertida) */
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 82% 100%, 82% 30%, 18% 30%, 18% 100%, 0% 100%);
  z-index: 6;
  box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.3);
}
.table-element.sub-sofa::after {
  content: '';
  display: none;
}

.table-element.sub-sofa-l .table-bg {
  background: #34495e;
  clip-path: polygon(0% 0%, 100% 0%, 100% 45px, 45px 45px, 45px 100%, 0% 100%);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}
.table-element.sub-sofa-l::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #2c3e50;
  clip-path: polygon(0% 0%, 100% 0%, 100% 15px, 15px 15px, 15px 100%, 0% 100%);
  z-index: 6;
  box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.3);
  opacity: 1 !important;
}
.table-element.sub-sofa-l::after {
  content: '';
  display: none; /* Removed diagonal line as requested */
}

/* Modulo de sofa recto para extensiones */
.table-element.sub-sofa-straight .table-bg {
  background: #34495e;
  border-radius: 4px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}
.table-element.sub-sofa-straight::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 35%;
  background: #2c3e50;
  box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.3);
  border-radius: 4px 4px 0 0;
  z-index: 6;
}
.table-element.sub-sofa-straight::after {
  content: '';
  position: absolute;
  bottom: 0; left: 8%; right: 8%; height: 55%;
  background: linear-gradient(90deg, transparent 49%, rgba(0,0,0,0.2) 50%, transparent 51%), #2c3e50;
  border-radius: 4px;
  opacity: 1;
}


.table-element.sub-bar .table-bg {
  background: #111;
  border-radius: 4px;
}
.table-element.sub-bar::before {
  content: '';
  position: absolute;
  inset: 0 0 25% 0;
  background: linear-gradient(to bottom, #444, #222);
  border-radius: 4px 4px 0 0;
  border-bottom: 2px solid #000;
}
.table-element.sub-bar::after {
  content: '';
  position: absolute;
  top: 15%; left: 5%; right: 5%; height: 20%;
  background-image: 
    radial-gradient(circle at 8px 50%, #3498db 3px, transparent 4px),
    radial-gradient(circle at 20px 50%, #e67e22 3.5px, transparent 4.5px),
    radial-gradient(circle at 32px 50%, #27ae60 3px, transparent 4px);
  background-repeat: repeat-x;
  background-size: 50px 100%;
}

.table-element.sub-light .table-bg {
  background: #fff9c4;
  border-radius: 50%;
  box-shadow: 0 0 25px 10px rgba(255, 235, 59, 0.6);
  border: 2px solid #ffeb3b;
}
.table-element.sub-light::before {
  content: ''; position: absolute;
  width: 40%; height: 25%;
  background: #bdc3c7; /* base of the bulb */
  border: 2px solid #95a5a6;
  border-top: none;
  border-radius: 0 0 4px 4px;
  bottom: -15%; left: 30%;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 2px, #95a5a6 2px, #95a5a6 4px);
  z-index: -1;
}
.table-element.sub-light::after {
  content: ''; position: absolute;
  width: 50%; height: 50%;
  background: radial-gradient(circle, #fff 0%, transparent 70%);
  top: 15%; left: 25%;
  pointer-events: none;
}

.table-element.sub-disco { overflow: visible !important; }
.table-element.sub-disco .table-bg {
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.8), inset 0 0 15px rgba(0,0,0,0.5);
  background: conic-gradient(
    #ff0000 0% 12.5%,
    #ff7f00 12.5% 25%,
    #ffff00 25% 37.5%,
    #00ff00 37.5% 50%,
    #0000ff 50% 62.5%,
    #4b0082 62.5% 75%,
    #9400d3 75% 87.5%,
    #ff00ff 87.5% 100%
  );
  animation: disco-spin 2s linear infinite;
}
.table-element.sub-disco::before {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%;
  background-image: 
    repeating-linear-gradient(0deg, rgba(0,0,0,0.5) 0 4px, transparent 4px 8px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.5) 0 4px, transparent 4px 8px);
  z-index: 1;
  animation: disco-spin 4s linear infinite reverse;
  pointer-events: none;
}
.table-element.sub-disco::after {
  content: ''; position: absolute; inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.7) 0%, transparent 70%);
  z-index: 2;
  mix-blend-mode: overlay;
  animation: disco-glow 0.8s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes disco-spin {
  100% { transform: rotate(360deg); }
}
@keyframes disco-glow {
  0% { opacity: 0.5; filter: blur(5px); transform: scale(0.9); }
  100% { opacity: 1; filter: blur(10px); transform: scale(1.1); }
}

.table-element.sub-door .table-bg {
  background: #7f8c8d;
  border-radius: 0;
}
.table-element.sub-door::after {
  content: '';
  position: absolute;
  width: 100%; height: 1000%; /* The arc */
  border-radius: 0 100% 0 0;
  border-top: 2px solid rgba(127, 140, 141, 0.5);
  border-right: 2px solid rgba(127, 140, 141, 0.5);
  bottom: 0; left: 0;
  transform-origin: bottom left;
  transform: scaleY(0.1); 
  pointer-events: none;
}

.table-element.sub-wall .table-bg {
  background: #2c3e50; /* Darker, solid wall */
  border: none;
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
}
.table-element.sub-wall::before {
  content: '';
  position: absolute;
  inset: 2px;
  background: #34495e;
  border-radius: 1px;
}

.table-element.sub-staff .table-bg,
.table-element.sub-waiter .table-bg,
.table-element.sub-bartender .table-bg {
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  width: 80%; height: 80%; top: 10%; left: 10%; /* Center the body */
}
/* Colors for different roles */
.table-element.sub-staff .table-bg { background: #f1c40f; } /* Manager - Gold */
.table-element.sub-waiter .table-bg { background: #3498db; } /* Waiter - Blue */
.table-element.sub-bartender .table-bg { background: #e74c3c; } /* Bartender - Red */

/* The head */
.table-element.sub-staff .table-bg::after,
.table-element.sub-waiter .table-bg::after,
.table-element.sub-bartender .table-bg::after {
  content: ''; position: absolute; width: 50%; height: 50%; top: 25%; left: 25%;
  background: #f5cba7; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Labels below */
.table-element.sub-staff::after,
.table-element.sub-waiter::after,
.table-element.sub-bartender::after {
  position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%);
  background: var(--bg-primary); color: var(--text-primary); padding: 3px 6px;
  border-radius: 4px; font-size: 0.65rem; font-weight: bold; border: 1px solid var(--border-light);
  white-space: nowrap; box-shadow: 0 2px 4px rgba(0,0,0,0.1); z-index: 10;
}
.table-element.sub-staff::after { content: 'Gerente'; }
.table-element.sub-waiter::after { content: 'Mesero'; }
.table-element.sub-bartender::after { content: 'Barman'; }

/* Override selection highlight to avoid weird interactions */
.table-element.sub-staff::before,
.table-element.sub-waiter::before,
.table-element.sub-bartender::before {
  display: none !important;
}

.table-element.sub-chair .table-bg {
  background: #34495e;
  border-radius: 6px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.4);
}
.table-element.sub-chair::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #222224;
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 85% 100%, 85% 25%, 15% 25%, 15% 100%, 0% 100%);
  z-index: 6;
}
.table-element.sub-chair::after {
  content: '';
  display: none;
}

/* Tucked in Chairs - Improved Position */
.chair {
  z-index: -1; 
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
/* Adjustments for chairs to be partially UNDER the table edge */
.chair.top { transform: translate(-50%, -10%) !important; }
.chair.bottom { transform: translate(-50%, -90%) !important; }
.chair.left { transform: translate(-10%, -50%) !important; }
.chair.right { transform: translate(-90%, -50%) !important; }

/* New Bar/Club Elements */
.table-element.sub-stage .table-bg {
  background: #8d6e63;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(0,0,0,0.1) 10px, rgba(0,0,0,0.1) 12px);
  border: 2px solid #5d4037;
  border-radius: 4px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.3), 0 5px 15px rgba(0,0,0,0.5);
}
.table-element.sub-stage::before { 
  content: 'ESCENARIO'; 
  position: absolute; inset: 0; 
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.3); font-size: 1.5rem; font-weight: bold; letter-spacing: 2px;
}

.table-element.sub-speaker .table-bg {
  background: #2a2a2a;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}
.table-element.sub-speaker::before {
  content: '';
  position: absolute;
  width: 65%;
  aspect-ratio: 1;
  bottom: 12%; 
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, #ffffff 0% 30%, transparent 31% 60%, #ffffff 61% 100%);
  border-radius: 50%;
  z-index: 6;
}
.table-element.sub-speaker::after {
  content: '';
  position: absolute;
  width: 40%;
  aspect-ratio: 1;
  top: 15%; 
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, transparent 0% 45%, #ffffff 46% 100%);
  border-radius: 50%;
  z-index: 6;
}

.table-element.sub-bathroom .table-bg {
  background: #80deea;
  background-image: 
    linear-gradient(white 1px, transparent 1px),
    linear-gradient(90deg, white 1px, transparent 1px);
  background-size: 15px 15px;
  border: 2px solid #00acc1;
  border-radius: 4px;
}
.table-element.sub-bathroom::before {
  content: 'WC'; position: absolute; inset: 0; 
  display: flex; align-items: center; justify-content: center;
  color: #00838f; font-size: 1.2rem; font-weight: bold;
}

.table-element.sub-dancefloor .table-bg {
  background: #111;
  background-image: 
    conic-gradient(#333 90deg, transparent 90deg 180deg, #333 180deg 270deg, transparent 270deg);
  background-size: 40px 40px;
  border: 2px solid #e0e0e0;
  box-shadow: inset 0 0 20px rgba(255, 0, 255, 0.2);
}
.table-element.sub-dancefloor::before {
  content: 'PISTA'; position: absolute; inset: 0; 
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.5); font-size: 1.5rem; font-weight: bold; font-style: italic;
  text-shadow: 0 0 5px rgba(255,0,255,0.8);
}

.table-element.sub-pos .table-bg {
  background: #34495e; border: 2px solid #2c3e50; border-radius: 4px;
}
.table-element.sub-pos::before {
  content: ''; position: absolute; width: 60%; height: 40%; top: 10%; left: 20%;
  background: #64b5f6; border-radius: 2px; border: 1px solid #154360;
}
.table-element.sub-pos::after {
  content: ''; position: absolute; width: 40%; height: 20%; bottom: 10%; left: 30%;
  background: #1abc9c; border-radius: 1px;
}

.table-element.sub-column .table-bg {
  background: #bdc3c7; border: 2px solid #2c3e50; border-radius: 0;
}
.table-element.sub-column::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(45deg, transparent 48%, #2c3e50 48%, #2c3e50 52%, transparent 52%),
              linear-gradient(-45deg, transparent 48%, #2c3e50 48%, #2c3e50 52%, transparent 52%);
}

.table-element.sub-host .table-bg {
  background: #d35400; border: 2px solid #a04000; border-radius: 15px 15px 0 0;
}
.table-element.sub-host::before {
  content: 'RECEPCIÓN'; position: absolute; inset: 0; 
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 0.6rem; font-weight: bold;
}

.table-element.sub-stairs .table-bg {
  background: #bdc3c7; border: 2px solid #7f8c8d;
  background-image: repeating-linear-gradient(0deg, #bdc3c7, #bdc3c7 10px, #95a5a6 10px, #95a5a6 12px);
}
.table-element.sub-stairs::after {
  content: '↑'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: #2c3e50; font-size: 1.5rem; font-weight: bold;
}

/* Design Toolbox Modal Styles */
.toolbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 15px;
  padding: 10px 0;
}

.toolbox-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toolbox-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.toolbox-item i, .toolbox-item svg {
  color: var(--primary);
}

.toolbox-item span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}




/* ============================================
   Order Side Panel
   ============================================ */
.order-panel {
  width: 420px;
  background-color: #ffffff;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 5;
  box-shadow: -10px 0 30px rgba(47, 47, 49, 0.05);
  flex-shrink: 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .order-panel {
  background-color: #2f2f31;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.3);
}

.order-panel.closed {
  width: 0;
  overflow: hidden;
  border-left: none;
}

/* .order-panel.open {
  transform: translateX(0);
} */

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: linear-gradient(to bottom, #ffffff, #f9f9fb);
  flex-shrink: 0;
  min-height: 65px;
}

[data-theme="dark"] .panel-header {
  background: linear-gradient(to bottom, #2f2f31, #262628);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-header-info {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 12px;
  overflow: hidden;
}

.header-table-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.panel-table-name {
  font-size: 1.1rem;
  font-weight: 850;
  color: #1d1d1f;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .panel-table-name {
  color: #ffffff;
}

.panel-status-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.03);
  padding: 2px 8px;
  border-radius: 99px;
  width: fit-content;
}

[data-theme="dark"] .panel-status-wrapper {
  background: rgba(255, 255, 255, 0.05);
}

.status-dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34C759;
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.4);
  transition: all 0.3s ease;
}

.status-dot-indicator.occupied { background: #FF3B30; box-shadow: 0 0 8px rgba(255, 59, 48, 0.4); }
.status-dot-indicator.reserved { background: #FF9500; box-shadow: 0 0 8px rgba(255, 149, 0, 0.4); }

.status-select-ios {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  color: #8e8e93;
  cursor: pointer;
  outline: none;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
}

[data-theme="dark"] .status-select-ios {
  color: #98989d;
}

.status-select-ios:hover {
  color: #1d1d1f;
}

[data-theme="dark"] .status-select-ios:hover {
  color: #ffffff;
}

.panel-close {
  display: none !important;
}

/* Empty state for panel */
.panel-empty-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  z-index: 100;
  transition: all 0.3s ease;
  opacity: 1;
  pointer-events: all;
}

.order-panel.table-selected .panel-empty-overlay {
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
}

/* Kitchen Summary UI */
.kitchen-summary {
  width: 100%;
  flex: 1;
  overflow-y: auto;
  padding: 10px 5px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  text-align: left;
}

.summary-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-title i {
  width: 14px;
  height: 14px;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.summary-card:active {
  transform: scale(0.98);
}

.summary-card.ready {
  border-left: 4px solid #34c759;
  background: linear-gradient(to right, rgba(52, 199, 89, 0.05), transparent);
}

.summary-card.ready.pulsing-ready {
  border: 2px solid #34c759 !important;
  animation: ready-green-pulse 1.5s infinite;
}

@keyframes ready-green-pulse {
  0% { box-shadow: 0 0 0 0px rgba(52, 199, 89, 0.6); }
  70% { box-shadow: 0 0 0 15px rgba(52, 199, 89, 0); }
  100% { box-shadow: 0 0 0 0px rgba(52, 199, 89, 0); }
}

.summary-card.prep {
  border-left: 4px solid #007aff;
}

.summary-card.new {
  border-left: 4px solid #007aff;
  background: linear-gradient(to right, rgba(0, 122, 255, 0.05), transparent);
}

.summary-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.summary-table-num {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-primary);
}

.summary-time {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.summary-items {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.summary-item-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.summary-hint {
  margin-top: 15px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-loading {
  padding: 40px;
  opacity: 0.5;
  font-size: 0.9rem;
}

/* Scrollbar for kitchen summary */
.kitchen-summary::-webkit-scrollbar {
  width: 6px;
}
.kitchen-summary::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 10px;
}
.kitchen-summary::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* Panel tabs */
.panel-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.05);
  margin: 6px 20px 4px 20px;
  padding: 2px;
  border-radius: 10px;
  flex-shrink: 0;
  border: none;
}

[data-theme="dark"] .panel-tabs {
  background: rgba(255, 255, 255, 0.05);
}

.panel-tab {
  flex: 1;
  padding: 8px 10px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #8e8e93;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  border: none;
}

.panel-tab:hover {
  color: #1d1d1f;
}

[data-theme="dark"] .panel-tab:hover {
  color: #ffffff;
}

.panel-tab.active {
  color: #1d1d1f;
  background: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .panel-tab.active {
  color: #ffffff;
  background: #3a3a3c;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .panel-tab.active {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

/* Panel body */
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 16px 20px;
}

.panel-tab-content {
  display: none;
}
.panel-tab-content.active {
  display: block;
}

/* Order items list */
.order-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 4px;
  transition: all 0.2s ease;
}
.order-item:hover {
  border-color: rgba(49, 66, 84, 0.3);
  transform: translateX(-2px);
  box-shadow: var(--shadow-sm);
}

.order-item-img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.order-item-info {
  flex: 1;
  min-width: 0;
}

.order-item-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #314254;
  margin-bottom: 0px;
}

[data-theme="dark"] .order-item-name {
  color: #ffffff;
}

.order-item-note-row {
  margin: 2px 0;
}

.item-note-input {
  font-size: 0.75rem;
  padding: 2px 0;
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--border-color);
  border-radius: 0;
  color: var(--text-tertiary);
  font-style: italic;
}

.order-item-price {
  font-weight: 800;
  font-size: 0.95rem;
  color: #314254;
  white-space: nowrap;
}

[data-theme="dark"] .order-item-price {
  color: var(--primary);
}

.order-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  padding: 0;
}
.qty-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.qty-value {
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 20px;
  text-align: center;
}

.order-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  font-size: 0.9rem;
}
.order-item-remove:hover {
  color: var(--danger);
  background: var(--danger-light);
}

.order-item-unified {
  transition: all 0.2s ease;
  padding: 12px 0;
}

.order-item-unified:hover {
  background: rgba(255, 255, 255, 0.03);
}

.item-note-input-mini {
  width: 100%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 4px;
}

.item-note-premium {
  width: 100%;
  min-height: 50px;
  border: 1.5px solid rgba(0, 0, 0, 0.05);
  background: rgba(49, 115, 255, 0.05);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
  margin-top: 4px;
  resize: vertical;
  transition: all 0.3s ease;
  font-family: inherit;
}

.item-note-premium:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--ios-blue);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.1);
}

.item-note-display {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(0, 122, 255, 0.08);
  color: var(--ios-blue);
  border-radius: 8px;
  display: inline-block;
  font-style: italic;
}

[data-theme="dark"] .item-note-input-mini {
  background: rgba(255, 255, 255, 0.1);
  color: #a1a1a6;
}

[data-theme="dark"] .item-note-premium {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

[data-theme="dark"] .item-note-premium:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--ios-blue);
}

[data-theme="dark"] .item-note-display {
  background: rgba(49, 115, 255, 0.15);
  color: #007aff;
}

.order-item-qty-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.05);
  padding: 6px;
  border-radius: 12px;
  margin-top: 8px;
}

[data-theme="dark"] .order-item-qty-mini {
  background: rgba(255, 255, 255, 0.05);
}

.qty-btn-mini {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: white;
  color: #1d1d1f;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .qty-btn-mini {
  background: #3a3a3c;
  color: white;
}

.qty-btn-mini:active {
  transform: scale(0.9);
}

.qty-val-mini {
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 28px;
  text-align: center;
}

.remove-btn-mini {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: #ff3b30;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.remove-btn-mini:active {
  transform: scale(0.9);
}

.remove-btn-mini:hover {
  background: #ff453a;
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

/* Specific styling for draft cards in Actual Order */
.draft-card-premium {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin-bottom: 10px;
  border: 1px dashed #c7c7cc;
}

[data-theme="dark"] .draft-card-premium {
  background: #1c1c1e;
  border-color: #3a3a3c;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Menu categories - iOS Pills */
.menu-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding: 4px 0;
}

.category-chip {
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: #8e8e93;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .category-chip {
  background: rgba(255, 255, 255, 0.05);
}

.category-chip:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #1d1d1f;
}

[data-theme="dark"] .category-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.category-chip.active {
  background: #1d1d1f;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .category-chip.active {
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}
.category-chip:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.category-chip.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.menu-product {
  display: flex !important;
  flex-direction: column;
  background: #ffffff;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  padding: 0 !important;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  user-select: none;
  -webkit-user-select: none;
}

[data-theme="dark"] .menu-product {
  background: #2c2c2e;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.menu-product:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.menu-product-img-container {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-tertiary);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.menu-product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.menu-product:hover .menu-product-img {
  transform: scale(1.1);
}

.menu-product-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
}

.menu-product-content {
  padding: 8px;
}

.menu-product-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1d1d1f;
  margin-bottom: 4px;
  line-height: 1.2;
}

[data-theme="dark"] .menu-product-name {
  color: #ffffff;
}

.menu-product-price {
  font-size: 0.9rem;
  font-weight: 800;
  color: #34C759;
}

.menu-product-stock {
  font-size: 0.65rem;
  color: #8e8e93;
  margin-top: 4px;
}

.menu-product.out-of-stock {
  border: 1.5px dashed rgba(255, 69, 58, 0.2);
  background: rgba(255, 69, 58, 0.02);
}

[data-theme="dark"] .menu-product.out-of-stock {
  background: rgba(255, 69, 58, 0.05);
}

.menu-product.out-of-stock .menu-product-name {
  opacity: 0.5;
}

.menu-product.out-of-stock .menu-product-price {
  color: #8e8e93;
}

/* Search */
.search-input {
  position: relative;
  margin-bottom: 12px;
}
/* Search styles moved to .search-wrapper */

/* ============================================
   Panel Footer (Totals & Actions)
   ============================================ */
.panel-footer {
  border-top: 1px solid var(--glass-border-dark);
  padding: 10px 20px;
  background: transparent;
  flex-shrink: 0;
}

.order-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.summary-row.total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-top: 4px;
  border-top: 1px solid var(--border-color);
}

.panel-footer-actions {
  display: flex;
  gap: 8px;
}

.panel-footer-actions .btn {
  flex: 1;
}

/* ============================================
   Context Menu (Right-click on tables)
   ============================================ */
.context-menu {
  position: fixed;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  min-width: 180px;
  z-index: var(--z-dropdown);
  padding: 6px;
  animation: scaleIn 0.15s ease;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.context-menu-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.context-menu-item.danger:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.context-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* ============================================
   Room selector
   ============================================ */
.room-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-chip {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.room-chip:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}
.room-chip.active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================
   Notifications
   ============================================ */
.notification-bell {
  position: relative;
}

.notification-count {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-secondary);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .sidebar {
    width: 56px;
    padding: 8px 0;
  }
  .nav-item {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  .topbar {
    padding: 8px 12px;
    flex-wrap: wrap;
  }
  .stats-bar {
    gap: 4px;
  }
  .stat-chip {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
  .order-panel {
    width: 100%;
  }
}

#btn-floor-config {
  background-color: #2f2f31 !important;
  color: #ffffff !important;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#btn-floor-config:hover {
  background-color: #3a3a3c !important;
  transform: translateY(-1px);
}

#btn-floor-config i, #btn-floor-config svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}
/* Design Toolbox Tabs */
.design-toolbox-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 400px;
}

.toolbox-tabs {
  display: flex;
  gap: 8px;
  padding: 8px 4px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  margin-bottom: 10px;
  justify-content: center;
}

[data-theme="dark"] .toolbox-tabs {
  background: rgba(255, 255, 255, 0.05);
}

.toolbox-tabs::-webkit-scrollbar {
  display: none;
}

.toolbox-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  min-width: 80px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toolbox-tab i {
  margin-bottom: 2px;
}

.toolbox-tab span {
  font-size: 0.7rem;
  font-weight: 600;
}

.toolbox-tab.active {
  background: white;
  color: var(--ios-blue);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .toolbox-tab.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.toolbox-content {
  flex: 1;
  overflow-y: auto;
  min-height: 300px;
}

/* Ensure images in floor plan look good */
.table-asset {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  transition: transform 0.2s ease;
}

.table-element:hover .table-asset {
  transform: scale(1.05);
}

/* Alignment Guides */
.guide-line {
  position: absolute;
  pointer-events: none;
  z-index: 1000;
  display: none;
}

.guide-line-v {
  width: 0;
  top: 0;
  bottom: 0;
  border-left: 1px dashed #007aff;
}

.guide-line-h {
  height: 0;
  left: 0;
  right: 0;
  border-top: 1px dashed #007aff;
}
/* Payment Modal Premium Selection */
.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.currency-btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.selectable-item {
  position: relative;
}

.selectable-item input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.selection-card {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px !important;
  border-radius: 14px !important;
  background: #000000 !important;
  border: 2px solid transparent !important;
  color: #ffffff !important;
  transition: all 0.2s ease;
  text-align: center;
}

.selection-card i {
  color: #ffffff !important;
  opacity: 0.9;
}

.selection-card span {
  color: #ffffff !important;
}

.selectable-item input:checked + .selection-card {
  background: #000000 !important;
  border-color: #34C759 !important;
  border-width: 3px !important;
  box-shadow: 0 4px 12px rgba(52, 199, 89, 0.2);
}

.selectable-item input:checked + .selection-card span {
  color: #ffffff !important;
  font-weight: 800;
}

.selectable-item input:checked + .selection-card i {
  color: #ffffff !important;
  opacity: 1;
}

.compact-form-group {
  margin-bottom: 12px;
}

.compact-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.bank-account-selection {
  margin-top: 8px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(49, 66, 84, 0.04);
  animation: slideDown 0.2s ease-out;
}

.hidden { display: none !important; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

[data-theme="dark"] .selectable-item input:checked + .selection-card {
  border-color: #34C759 !important;
  background: #000000 !important;
}

[data-theme="dark"] .selectable-item input:checked + .selection-card span,
[data-theme="dark"] .selectable-item input:checked + .selection-card i {
  color: #ffffff;
}
/* Service Request Alert - Regular (Cuenta/Mesero) */
.table-element.state-service-active:not(.state-service-cocina) .table-bg {
  background: linear-gradient(135deg, #FFD60A, #FFB300) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 0 25px rgba(255, 214, 10, 0.6) !important;
  animation: pulse-service 2s ease infinite !important;
}

/* Service Request Alert - Cocina */
.table-element.state-service-active.state-service-cocina .table-bg {
  background: linear-gradient(135deg, #EF4444, #DC2626) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.6) !important;
  animation: pulse-service-cocina 2s ease infinite !important;
}
@keyframes pulse-service {
  0% { box-shadow: 0 0 10px rgba(255, 214, 10, 0.4); }
  50% { box-shadow: 0 0 30px rgba(255, 214, 10, 0.8); }
  100% { box-shadow: 0 0 10px rgba(255, 214, 10, 0.4); }
}

@keyframes pulse-service-cocina {
  0% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 30px rgba(239, 68, 68, 0.8); }
  100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }
}

.service-request-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #FFD60A;
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 45; /* Higher than kitchen-indicator (30) */
  border: 2px solid #FFD60A;
  font-weight: 800;
  white-space: nowrap;
}

.btn-attended {
  background: #FFD60A;
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
  margin-left: 4px;
}

.btn-attended:hover {
  background: #FFFFFF;
}

.service-request-badge.sr-cocina {
  background: #EF4444 !important;
  color: #FFFFFF !important;
  border-color: #EF4444 !important;
}
.service-request-badge.sr-cocina .btn-attended {
  background: #FFFFFF !important;
  color: #EF4444 !important;
}
.service-request-badge.sr-cocina .btn-attended:hover {
  background: #2f2f31 !important;
  color: #FFFFFF !important;
}

[data-theme="light"] .service-request-badge {
  background: #FFD60A;
  color: #000;
  border: 2px solid #000;
}
[data-theme="light"] .btn-attended {
  background: #000;
  color: #FFD60A;
}
.btn-ingredients-custom {
  background: rgba(255, 59, 48, 0.1);
  color: #ff3b30;
  border: none;
  border-radius: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-ingredients-custom:hover {
  background: #ff3b30;
  color: #fff;
}

/* Unit Selector Segmented Control */
/* Unit Selector Individual Buttons */
.unit-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 15px 0 25px;
  padding: 0;
  background: transparent;
}

.unit-tab-btn {
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.04);
  border: 1.5px solid transparent;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.unit-tab-btn.active {
  background: #fff;
  border-color: #ff3b30;
  color: #ff3b30;
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.1);
}

.ingredients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.ingredient-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(0, 0, 0, 0.03);
  border: 1.5px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  overflow: hidden;
  text-align: center;
}

.ingredient-choice:hover {
  background: rgba(0, 0, 0, 0.06);
}

.ingredient-choice.to-remove {
  background: #ff3b30 !important;
  color: #fff !important;
  border-color: #ff3b30;
  box-shadow: 0 8px 24px rgba(255, 59, 48, 0.3);
}

.ingredient-choice.to-remove .ingredient-name,
.ingredient-choice.to-remove .ingredient-qty {
  color: #fff !important;
}

.ingredient-choice.to-remove::before {
  content: "REMOVIDO";
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.5rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 6px;
  border-radius: 6px;
}

.ingredient-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
}

.ingredient-qty {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
  display: block;
  opacity: 0.5;
}

[data-theme="dark"] .unit-selector {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .unit-tab-btn.active {
  background: #3a3a3c;
  color: #fff;
}

[data-theme="dark"] .ingredient-choice {
  background: rgba(255, 255, 255, 0.03);
}

/* Client Assignment Styling */
.client-assignment-container {
  padding: 10px 20px;
  background: rgba(0,0,0,0.02);
  border-bottom: 1px solid var(--border-color);
}

.btn-assign-client {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  background: white;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-assign-client:hover {
  background: #f8fafc;
  border-color: var(--ios-blue);
  color: var(--ios-blue);
}

.client-assigned-card.compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.05);
}

.client-avatar-tiny {
  width: 28px;
  height: 28px;
  background: var(--ios-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.client-info-minimal {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.client-name-compact {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.client-pref-row-tiny {
  margin-top: 1px;
}

.client-pref-badge-tiny {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  background: rgba(255,149,0,0.1);
  color: #FF9500;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1;
}

.btn-remove-client-tiny {
  background: rgba(255,59,48,0.1);
  color: #ff3b30;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-remove-client-tiny:hover {
  background: #ff3b30;
  color: white;
}

[data-theme="dark"] .client-assignment-container {
  background: rgba(255,255,255,0.02);
}

[data-theme="dark"] .client-assigned-card.compact,
[data-theme="dark"] .btn-assign-client {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .btn-assign-client {
  color: rgba(255,255,255,0.6);
}

[data-theme="dark"] .client-name-compact {
  color: #fff;
}


/* Modal Search List */
.clients-modal-list {
  max-height: 350px;
  overflow-y: auto;
  margin-top: 10px;
}

.client-modal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.client-modal-item:hover {
  background: rgba(0,0,0,0.04);
}

.client-modal-avatar {
  width: 44px;
  height: 44px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-weight: 800;
  font-size: 1.2rem;
}

.client-modal-info {
  display: flex;
  flex-direction: column;
}

.client-modal-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.client-modal-phone {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.client-modal-notes {
  font-size: 0.7rem;
  color: #FF9500;
  font-weight: 700;
  margin-top: 2px;
}

/* Custom Overrides for Delivery Tables */
.table-element { container-type: size; }
.sub-delivery .table-label { color: #ffffff !important; font-weight: 800 !important; font-size: clamp(8px, 16cqw, 20px) !important; text-shadow: 0 1px 4px rgba(0,0,0,0.8); margin-top: 1cqh; max-width: 95%; text-align: center; line-height: 1.1; display: block; }
.sub-delivery .table-number i { width: 45cqw !important; height: 45cqw !important; }

/* ============================================
   RESPONSIVE DESIGN (Floor Plan & Order Panel)
   ============================================ */

/* ============================================
   RESPONSIVE DESIGN (Floor Plan & Order Panel)
   ============================================ */

/* Generic Mobile & Tablet (All touch devices) */
@media (max-width: 1024px) {
  .order-panel {
    width: 100%;
    height: 100dvh;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: none;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    margin: 0;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
  }

  [data-theme="dark"] .order-panel {
    background: #1c1c1e !important;
  }

  .order-panel.table-selected {
    transform: translateX(0);
  }

  .panel-header {
    padding: calc(16px + env(safe-area-inset-top)) 20px 16px !important;
    background: inherit !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    height: auto !important;
    min-height: 80px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .panel-table-name {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
  }

  .panel-close {
    display: flex !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    background: rgba(0,0,0,0.05) !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    margin: 0 !important;
  }

  [data-theme="dark"] .panel-close {
    background: rgba(255,255,255,0.1) !important;
  }

  .floor-plan-wrapper {
    height: 100% !important;
  }
}

/* TABLET LANDSCAPE: SIDE-BY-SIDE VIEW (Split Screen) */
@media (min-width: 768px) and (max-width: 1280px) and (orientation: landscape) {
  .app-layout {
    display: flex !important;
    flex-direction: row !important;
  }

  .main-content {
    flex: 1 !important;
    width: auto !important;
  }

  /* When table is selected, make panel a right sidebar instead of full screen overlay */
  .order-panel {
    width: 0 !important;
    position: relative !important;
    transform: none !important;
    opacity: 0;
    pointer-events: none;
    border-left: none !important;
    left: auto !important;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease !important;
    box-shadow: none !important;
  }

  .order-panel.table-selected {
    width: 380px !important;
    opacity: 1;
    pointer-events: all;
    border-left: 1px solid var(--border-color) !important;
    box-shadow: -10px 0 30px rgba(0,0,0,0.05) !important;
  }

  .panel-close {
    display: flex !important; /* Keep it to allow closing the panel */
  }

  .floor-plan-wrapper {
     height: 100% !important;
  }
}

@media (max-width: 1024px) {
  .panel-tabs {
    margin: 8px 12px !important;
  }
  
  .panel-footer-actions {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  
  .panel-footer-actions .btn {
    flex: 1 !important;
    min-width: 120px !important;
  }
}

/* ============================================
   List View (Mobile Button View)
   ============================================ */
.list-view-container {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 16px;
  background: var(--bg-secondary);
  animation: fadeIn 0.3s ease-out;
}

.list-view-container.hidden {
  display: none;
}

.table-list-item {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.table-list-item:active {
  transform: scale(0.95);
}

.table-list-item .table-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.table-list-item .status-text {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 4px;
  z-index: 2;
}

/* Status colors for list items */
.table-list-item.state-free {
  background: linear-gradient(135deg, #30D158, #248A3D);
}
.table-list-item.state-occupied {
  background: linear-gradient(135deg, #FF453A, #9E0E0E);
}
.table-list-item.state-reserved {
  background: linear-gradient(135deg, #FF9F0A, #C97D00);
}
.table-list-item.state-waiting {
  background: linear-gradient(135deg, #5E5CE6, #3634A3);
  animation: pulse 2s infinite;
}

.table-list-item.selected {
  border: 3px solid #fff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

/* Glass effect for list items */
.table-list-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), transparent);
  pointer-events: none;
}

/* Kitchen status indicators in list view */
.table-list-item.ks-ready::before {
  content: '';
  position: absolute;
  inset: -2px;
  border: 4px solid #fff;
  border-radius: inherit;
  animation: ready-table-flash 1s infinite;
  z-index: 1;
}

.table-list-item .kitchen-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fff;
  color: #000;
  font-size: 0.6rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 3;
}

.table-list-item .station-ready-indicators {
  top: -8px;
  right: -8px;
}

.table-list-item {
  overflow: visible !important;
}

/* Header Compressed Styles */
.header-table-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.client-assignment-header {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
  margin-left: 10px;
}

.btn-assign-client-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 122, 255, 0.08);
  color: var(--ios-blue);
  border: none;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-assign-client-mini:hover {
  background: rgba(0, 122, 255, 0.15);
}

.client-assigned-card.compact {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 12px;
  width: 100%;
  max-width: 220px;
}

[data-theme="dark"] .client-assigned-card.compact {
  background: rgba(255, 255, 255, 0.05);
}

.menu-categories-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
  padding: 8px;
}

.category-grid-btn {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.1);
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  text-align: center;
  gap: 14px;
  user-select: none;
}

.category-icon-wrapper {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(47, 47, 49, 0.08);
  color: #2f2f31;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-icon-wrapper i {
  width: 26px;
  height: 26px;
}

.category-btn-text {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1e293b;
  line-height: 1.2;
}

.category-grid-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
  border-color: var(--ios-blue) !important;
}


[data-theme="dark"] .category-grid-btn {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .category-grid-btn:hover {
  background: var(--bg-hover) !important;
}

/* ============================================
   DELIVERY HEADER OPTIMIZATION
   ============================================ */
.is-delivery-active .panel-header {
  height: auto !important;
  min-height: 100px;
  padding-bottom: 12px;
}

.is-delivery-active .panel-header-info {
  flex-wrap: wrap !important;
  align-items: flex-start !important;
  overflow: visible !important;
  gap: 10px 12px !important;
}

.client-assignment-header.is-delivery-mode {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 6px !important;
  justify-content: flex-start !important;
  flex: 1 0 100% !important; /* Force wrap and full width */
  width: 100%;
  margin-left: 0 !important;
  margin-top: 8px !important;
}

.delivery-header-top-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

/* Force buttons and cards to take full width in delivery mode */
.is-delivery-active .btn-assign-client-mini,
.is-delivery-active .client-assigned-card.compact {
  width: 100% !important;
  max-width: none !important;
  justify-content: center !important;
  padding-top: 4px !important;
  padding-bottom: 4px !important;
  min-height: 38px !important;
}

.is-delivery-active .delivery-details-section {
  width: 100%;
  margin-top: 2px !important;
  padding: 8px !important;
}@media (max-width: 1024px) {
  .is-delivery-active .panel-header {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    padding-top: calc(16px + env(safe-area-inset-top)) !important;
    padding-bottom: 6px !important; /* Reduced base padding */
  }

  .is-delivery-active .panel-header-info {
    flex: 1 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  /* Title alignment */
  .is-delivery-active .header-table-info {
    flex: 1 !important;
    padding-right: 10px !important;
    padding-top: 4px !important;
  }

  .is-delivery-active .panel-close {
    order: 2 !important;
    margin-top: 0 !important;
    flex-shrink: 0 !important;
    position: relative !important;
    top: 0 !important;
  }

  /* Compact client assignment / delivery toggle */
  .is-delivery-active .client-assignment-header.is-delivery-mode {
    order: 3 !important;
    flex: 1 0 100% !important;
    margin-left: 0 !important;
    margin-top: 2px !important; /* Very compact margin */
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  /* Compact 3-column menu grid on mobile */
  .menu-categories-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  .category-grid-btn {
    padding: 12px 6px !important;
    gap: 8px !important;
    border-radius: 12px !important;
  }

  .category-icon-wrapper {
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
  }

  .category-icon-wrapper i {
    width: 20px !important;
    height: 20px !important;
  }

  .category-btn-text {
    font-size: 0.75rem !important;
    word-break: break-word; /* Ensure long names don't break layout */
  }
}


/* Delivery Collapsible Styles - Compacted */
.delivery-toggle-container {
  width: 100%;
  margin-top: 0;
  margin-bottom: 2px; /* Small margin when collapsed */
}

.btn-delivery-collapse {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px; 
  background: rgba(46, 204, 113, 0.08);
  color: #27ae60;
  border: 1px solid rgba(46, 204, 113, 0.15);
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 40px !important;
}

.btn-delivery-collapse:active {
  transform: scale(0.98);
}

.delivery-collapsible-content {
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  max-height: 500px;
  opacity: 1;
  margin-top: 10px; /* Space when expanded */
  margin-bottom: 6px;
}

.delivery-collapsible-content.mobile-collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0; /* Remove space when collapsed */
  pointer-events: none;
}

@media (min-width: 1025px) {
  /* On desktop, always show and hide toggle */
  .delivery-toggle-container {
    display: none !important;
  }
  .delivery-collapsible-content {
    max-height: none !important;
    opacity: 1 !important;
    pointer-events: all !important;
  }
  #btn-toggle-list-view {
    display: none !important;
  }
}

/* Hide 'Libre' status for delivery in mobile */
@media (max-width: 1024px) {
  .is-delivery-active #select-table-status option[value="free"] {
    display: none;
  }

  .hide-mobile-only {
    display: none !important;
  }

  .btn-modal-action {
    min-width: 42px !important;
    padding: 0 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}



