/* ═══════════════════════════════════════════════════════════════
   CSS VARIABLES - The Brigade Design System
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* Primary Colors */
  --color-primary: #FF6B35;
  --color-primary-light: #FF8E53;
  --color-primary-dark: #E55A2B;

  /* Secondary Colors */
  --color-secondary: #4ECDC4;
  --color-secondary-light: #6EDDD5;

  /* Background Colors */
  --color-bg: #1a1a2e;
  --color-bg-dark: #16213e;
  --color-bg-darker: #0f0f23;
  --color-bg-card: #252540;

  /* Text Colors */
  --color-text: #FFFFFF;
  --color-text-muted: rgba(255, 255, 255, 0.6);

  /* Accent Colors */
  --color-accent-yellow: #FFE66D;
  --color-accent-green: #00bb4f;
  --color-accent-cyan: #4ECDC4;
  --color-accent-pink: #FF6B9D;
  --color-accent-purple: #9B5DE5;

  /* Border */
  --color-border: rgba(255, 255, 255, 0.1);

  /* Border Radius */
  --radius-full: 9999px;
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 8px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  display: none;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Nunito', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  overflow: hidden;
}

/* Screen management - hide all screens by default, show only active */
.screen {
  display: none;
}

.screen.active {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 100vh;
}

/* Quit button styles */
.btn-quit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(255, 107, 53, 0.2);
  color: var(--color-text);
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  border: 2px solid #FF6B35;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 16px;
  width: 100%;
}

.btn-quit:hover {
  background: #FF6B35;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-quit:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-quit .btn-icon {
  font-size: 1.1rem;
}

/* Settings quit button */
.quit-section {
  border-top: 2px solid rgba(255, 107, 53, 0.3);
  margin-top: 16px;
  padding-top: 16px;
}

.quit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #FF6B35 0%, #FF8E53 100%);
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 8px;
}

.quit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

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

.quit-hint {
  display: block;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════════
   COMMON BUTTON STYLES
   ═══════════════════════════════════════════════════════════════ */

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  font-family: 'Fredoka One', cursive;
  font-size: 0.9375rem;
  font-weight: 400;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 3px 0 var(--color-primary-dark), 0 4px 12px rgba(255, 107, 53, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 100%;
  min-height: 44px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--color-primary-dark), 0 8px 24px rgba(255, 107, 53, 0.5);
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--color-primary-dark), 0 4px 12px rgba(255, 107, 53, 0.4);
}

.btn-primary.btn-large {
  padding: 14px 28px;
  font-size: 1.0625rem;
}

.btn-bouncy {
  animation: btnBounce 2s ease-in-out infinite;
}

@keyframes btnBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.btn-bouncy:hover {
  animation: none;
}

.btn-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--color-bg-card);
  color: var(--color-text);
  font-family: 'Fredoka One', cursive;
  font-size: 0.9375rem;
  font-weight: 400;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  min-height: 44px;
}

.btn-toggle:hover {
  border-color: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-toggle.active {
  background: var(--color-accent-green);
  border-color: var(--color-accent-green);
  color: white;
}

.btn-toggle.active .toggle-icon {
  transform: scale(1.2) rotate(360deg);
}

.btn-round {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-bg-card);
  border: 3px solid var(--color-border);
  color: var(--color-text);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-round:hover {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: white;
  transform: scale(1.1);
}

.btn-back {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--color-bg-card);
  border: 2px solid var(--color-border);
  color: var(--color-text);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-back:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* ═══════════════════════════════════════════════════════════════
   FORM STYLES
   ═══════════════════════════════════════════════════════════════ */

.form-label {
  display: block;
  text-align: center;
  font-family: 'Fredoka One', cursive;
  font-size: 1.25rem;
  color: var(--color-text);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.code-inputs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.code-char {
  width: 48px;
  height: 64px;
  background: var(--color-bg-card);
  border: 3px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text);
  font-family: 'Fredoka One', cursive;
  font-size: 1.75rem;
  text-align: center;
  text-transform: uppercase;
  transition: all var(--transition-fast);
  outline: none;
}

.code-char:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.3), 0 0 20px rgba(255, 107, 53, 0.4);
  transform: scale(1.1);
}

.name-input-wrapper {
  position: relative;
  margin-bottom: 24px;
}

.name-input-wrapper .input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  pointer-events: none;
}

.name-input-wrapper input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  background: var(--color-bg-card);
  border: 3px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  font-family: 'Nunito', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  text-align: center;
  transition: all var(--transition-fast);
  outline: none;
}

.name-input-wrapper input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.3);
}

.name-input-wrapper input::placeholder {
  color: var(--color-text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   SCREEN HEADER
   ═══════════════════════════════════════════════════════════════ */

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  padding-top: max(16px, env(safe-area-inset-top));
  background: var(--color-bg-dark);
  border-bottom: 2px solid var(--color-border);
  gap: 12px;
}

.screen-header h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.5rem;
  color: var(--color-text);
  flex: 1;
  text-align: center;
}

.header-spacer {
  flex: 0 0 auto;
  min-width: 80px;
}

/* ═══════════════════════════════════════════════════════════════
   ROOM CODE PILL
   ═══════════════════════════════════════════════════════════════ */

.room-code-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--color-bg-card);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
}

.room-code-pill.small {
  padding: 6px 12px;
  font-size: 0.875rem;
}

.room-code-pill .label {
  color: var(--color-text-muted);
  font-weight: 600;
}

.room-code-pill .code {
  font-family: 'Fredoka One', cursive;
  color: var(--color-accent-yellow);
  font-weight: 400;
  letter-spacing: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */

.hidden {
  display: none !important;
}

.connection-status {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--color-bg-card);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  font-weight: 600;
  font-size: 0.875rem;
}

.connection-status.warning {
  border-color: var(--color-accent-yellow);
  background: rgba(255, 230, 109, 0.2);
}

.connection-status.error {
  border-color: #ff4444;
  background: rgba(255, 68, 68, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   ROOM SETUP SCREEN
   ═══════════════════════════════════════════════════════════════ */

#screen-setup {
  flex-direction: column;
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#screen-setup.active {
  display: flex;
}

#screen-setup .screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

#screen-setup .screen-header h2 {
  font-size: 1.25rem;
  color: var(--color-primary);
}

.setup-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-bottom: 80px;
}

.setup-hint {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 10px;
}

.setup-option {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.setup-option .option-label {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.setup-option .option-hint {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-style: italic;
  margin-top: 6px;
  opacity: 0.8;
}

.setup-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--color-secondary);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.3);
  color: var(--color-text);
  font-size: 1rem;
  font-family: inherit;
}

.setup-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.setup-slider {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.3);
  -webkit-appearance: none;
  appearance: none;
}

.setup-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.setup-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-md);
}

.toggle-group {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}

.toggle-group .toggle-btn {
  flex: 1;
  padding: 12px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.toggle-group .toggle-btn.active {
  background: var(--color-primary);
  color: var(--color-text);
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--color-primary);
}

.checkbox-wrapper label {
  color: var(--color-text);
  font-size: 1rem;
  cursor: pointer;
}

#btn-confirm-setup {
  margin-top: auto;
  margin-bottom: 20px;
  position: relative;
  z-index: 10;
}

#btn-confirm-setup .btn-icon {
  font-size: 1rem;
  line-height: 1;
  vertical-align: middle;
  display: inline-block;
  overflow: hidden;
  height: 1em;
}

/* ═══════════════════════════════════════════════════════════════
   FLOORPLAN SCREEN
   ═══════════════════════════════════════════════════════════════ */

#screen-floorplan {
  display: none;
  flex-direction: column;
  background: var(--color-bg-darker);
  z-index: 100;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#screen-floorplan.active {
  display: flex;
}

.floorplan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--color-bg-card) 0%, var(--color-bg-dark) 100%);
  border-bottom: 3px solid var(--color-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.floorplan-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

.btn-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #f44336;
  background: linear-gradient(135deg, #ff6b6b 0%, #f44336 100%);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(244, 67, 54, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  transition: all 0.15s ease;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-close:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 12px rgba(244, 67, 54, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.btn-close:active {
  transform: translateY(0) scale(0.95);
  box-shadow: 0 2px 4px rgba(244, 67, 54, 0.3);
}

.btn-recenter {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--color-secondary);
  background: linear-gradient(135deg, #4ECDC4 0%, var(--color-secondary) 100%);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(78, 205, 196, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  transition: all 0.15s ease;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-recenter:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 12px rgba(78, 205, 196, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.btn-recenter:active {
  transform: translateY(0) scale(0.95);
  box-shadow: 0 2px 4px rgba(78, 205, 196, 0.3);
}

#floorplan-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: grab;
}

#floorplan-container:active {
  cursor: grabbing;
}

#floorplan-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.floorplan-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.legend-item .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-item .dot.green { background: #4CAF50; }
.legend-item .dot.yellow { background: #FFC107; }
.legend-item .dot.red { background: #F44336; }
.legend-item .dot.orange { background: #FF6B35; }

/* ═══════════════════════════════════════════════════════════════
   DESIGN MODE SCREEN
   ═══════════════════════════════════════════════════════════════ */

#screen-design {
  display: none;
  flex-direction: column;
  background: var(--color-bg-darker);
  z-index: 100;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#screen-design.active {
  display: flex;
}

.design-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
}

.design-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--color-text);
}

.btn-save {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
}

.design-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
}

.tool-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-bg-dark);
  color: var(--color-text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tool-btn.active {
  background: var(--color-primary);
  color: #fff;
}

#design-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: crosshair;
}

#design-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.design-status {
  color: var(--color-text-muted);
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
}

.design-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--color-bg-card) 0%, var(--color-bg-dark) 100%);
  border-bottom: 3px solid var(--color-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.design-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

.btn-save {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-text);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-save:hover {
  background: var(--color-primary-light);
  transform: scale(1.1);
}

.design-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.tool-btn {
  padding: 8px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-dark);
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.tool-btn.active {
  border-color: var(--color-primary);
  background: rgba(255, 107, 53, 0.2);
  color: var(--color-primary);
}

.tool-btn:hover {
  border-color: var(--color-primary);
}

.tool-btn.hidden {
  display: none !important;
}

/* Split button - highlighted when visible */
#design-split-btn {
  background: var(--color-accent-pink);
  border-color: var(--color-accent-pink);
  color: #fff;
  animation: pulse-btn 1.5s ease-in-out infinite;
}

#design-split-btn:hover {
  background: #ff8eb0;
  border-color: #ff8eb0;
}

@keyframes pulse-btn {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Floorplan button in settings */
.floorplan-btn {
  width: 100%;
  padding: 12px 16px;
  background: var(--color-secondary);
  color: var(--color-text);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.floorplan-btn:hover {
  background: var(--color-secondary-light);
}

.floorplan-hint {
  display: block;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  margin-top: 4px;
}

/* Table Edit Modal */
.table-edit-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.table-edit-content {
  background: var(--color-bg-card);
  border: 3px solid var(--color-primary);
  border-radius: var(--radius-lg);
  width: 95%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.table-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-border);
}

.table-edit-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
}

.table-edit-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-bg-dark);
  color: var(--color-text);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.table-edit-close:hover {
  background: #f44336;
  border-color: #f44336;
  color: #fff;
}

.table-visualization {
  background: var(--color-bg-dark);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.table-shape-container {
  position: relative;
  width: 320px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-shape {
  background: #8B4513;
  border: 3px solid #FFD700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

/* Rectangle table - maintains aspect ratio, max size 200px wide */
.table-shape.rectangle {
  max-width: 200px;
  max-height: 120px;
}

/* Circle table */
.table-shape.circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
}

.seat {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #4A4A4A;
  border: 2px solid #666;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #fff;
}

.seat:hover {
  transform: scale(1.1);
  border-color: var(--color-primary);
}

.seat.enabled {
  background: #4CAF50;
  border-color: #66BB6A;
}

.seat.disabled {
  background: #666;
  border-color: #888;
  opacity: 0.5;
}

.table-edit-actions {
  display: flex;
  gap: 12px;
  flex-direction: column;
}

.btn-split-table {
  padding: 16px 24px;
  background: linear-gradient(135deg, #FF6B35 0%, #FF8E53 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
  transition: var(--transition-fast);
}

.btn-split-table:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.5);
}

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

.table-info {
  text-align: center;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(78, 205, 196, 0.1);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-secondary);
}

.table-info-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.table-info-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-secondary);
}

.seat-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
  font-size: 0.875rem;
}

.seat-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.seat-legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid;
}

.seat-legend-dot.enabled {
  background: #4CAF50;
  border-color: #66BB6A;
}

.seat-legend-dot.disabled {
  background: #666;
  border-color: #888;
  opacity: 0.5;
}

/* Hostess UI Styles */
.hostess-view {
  padding: 16px;
  background: var(--color-bg-dark);
  min-height: 100%;
}

.hostess-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border);
}

.hostess-header h2 {
  margin: 0;
  color: var(--color-primary);
  font-size: 1.5rem;
}

.hostess-status {
  font-size: 0.875rem;
}

.status-ready {
  color: #4CAF50;
  font-weight: 600;
}

.status-walking {
  color: #FF9800;
  font-weight: 600;
}

.hostess-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .hostess-panels {
    grid-template-columns: 1fr;
  }
}

.guest-queue-section,
.seating-chart-section {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-border);
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--color-bg-dark);
  border-bottom: 1px solid var(--color-border);
}

.panel-header h3 {
  margin: 0;
  font-size: 1.125rem;
  color: var(--color-text);
}

.queue-count {
  background: var(--color-primary);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.legend {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-item.available { color: #4CAF50; }  /* Green */
.legend-item.occupied { color: #FFC107; }   /* Yellow */
.legend-item.dirty { color: #F44336; }      /* Red */
.legend-item.selected { color: #FF6B35; }   /* Orange */

.guest-queue-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 12px;
}

.empty-queue {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-text {
  font-size: 1.125rem;
  margin-bottom: 4px;
}

.empty-subtext {
  font-size: 0.875rem;
  opacity: 0.7;
}

.guest-group-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--color-bg-dark);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.guest-group-card:hover {
  border-color: var(--color-primary);
}

.guest-group-card.selected {
  border-color: var(--color-primary);
  background: rgba(255, 107, 53, 0.1);
}

.guest-group-card.no-fit {
  opacity: 0.5;
}

.group-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.group-size {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.group-info {
  flex: 1;
}

.group-wait-time {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.group-prefs {
  font-size: 0.75rem;
}

.selected-indicator {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.seat-confirmation {
  padding: 12px;
  background: var(--color-bg-dark);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seat-btn.primary {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.seat-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.cancel-btn {
  width: 100%;
  padding: 10px 24px;
  background: transparent;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.cancel-btn:hover {
  border-color: #f44336;
  color: #f44336;
}

.seating-chart-container {
  max-height: 400px;
  overflow-y: auto;
  padding: 12px;
}

.table-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--color-bg-dark);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.table-card:hover {
  border-color: var(--color-primary);
}

.table-card.selected {
  border-color: var(--color-primary);
  background: rgba(255, 107, 53, 0.1);
}

.table-card.too-small {
  opacity: 0.4;
}

.table-card.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.table-shape {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shape-round {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #8B4513;
  border: 2px solid #FFD700;
}

.shape-rect {
  width: 40px;
  background: #8B4513;
  border: 2px solid #FFD700;
  border-radius: 4px;
}

.table-info {
  flex: 1;
}

.table-number {
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
}

.table-capacity {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.no-tables {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
}

/* Table Grid Tile Styles */
.seating-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
}

.table-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: var(--color-bg-dark);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  aspect-ratio: 1;
}

.table-tile:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.table-tile.selected {
  border-color: var(--color-primary);
  background: rgba(255, 107, 53, 0.2);
  box-shadow: 0 0 0 2px var(--color-primary);
}

.table-tile.too-small {
  opacity: 0.4;
}

.table-tile.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.table-tile.disabled:hover {
  transform: none;
  border-color: var(--color-border);
}

.table-tile-shape {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: var(--transition-fast);
}

.table-tile-shape.round {
  border-radius: 50%;
}

.table-tile-shape.square {
  border-radius: 6px;
}

.table-tile-shape.open {
  background: #22c55e;
  border: 2px solid #16a34a;
}

.table-tile-shape.occupied {
  background: #eab308;
  border: 2px solid #ca8a04;
}

.table-tile-shape.dirty {
  background: #ef4444;
  border: 2px solid #dc2626;
}

.table-tile-number {
  font-size: 0.875rem;
  font-weight: 700;
}

.table-tile-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.selected-indicator {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
}

.locked-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  opacity: 0.8;
}

/* Hostess View Additional Styles */
.hostess-view {
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.hostess-header {
  margin-bottom: 16px;
}

.hostess-header h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.hostess-status-text {
  font-size: 0.75rem;
  line-height: 1.2;
}

.hostess-status-ready {
  color: var(--color-accent-green);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  background: rgba(0, 187, 79, 0.1);
  border-radius: var(--radius-md);
  display: inline-block;
}

.hostess-status-ready:hover {
  background: rgba(0, 187, 79, 0.2);
}

.hostess-status-walking {
  color: var(--color-accent-yellow);
  font-size: 0.75rem;
  font-weight: 600;
}

.hostess-panels {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1 !important;
  overflow: hidden !important;
  min-height: 0 !important;
  height: 100% !important;
}

.guest-queue-section,
.seating-chart-section {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  min-height: 0 !important;
  height: 100% !important;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.panel-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.queue-count {
  background: var(--color-primary);
  color: white;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
}

.legend {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-item.available { color: var(--color-accent-green); }
.legend-item.occupied { color: #FFC107; }   /* Yellow */
.legend-item.dirty { color: #ff4444; }     /* Red */
.legend-item.selected { color: #FF6B35; }  /* Orange */

.guest-queue-list,
.seating-chart-container {
  flex: 1 1 auto;
  overflow-y: auto !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0 !important;
  max-height: 100%;
}

.empty-queue {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-text {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.empty-subtext {
  font-size: 0.875rem;
  opacity: 0.7;
}

.guest-group-card {
  background: var(--color-bg-dark);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.guest-group-card:hover {
  background: var(--color-bg-darker);
  border-color: var(--color-border);
}

.guest-group-card.selected {
  border-color: var(--color-accent-yellow);
  background: rgba(255, 230, 109, 0.1);
}

.guest-group-card.no-fit {
  opacity: 0.5;
}

.guest-group-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.locked-indicator {
  font-size: 1.2rem;
  opacity: 0.7;
}

.group-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.group-info {
  flex: 1;
}

.group-wait-time {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.group-prefs {
  font-size: 0.875rem;
}

.selected-indicator {
  color: var(--color-accent-yellow);
  font-size: 1.25rem;
}

.table-card {
  background: var(--color-bg-dark);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.table-card:hover {
  background: var(--color-bg-darker);
  border-color: var(--color-border);
}

.table-card.selected {
  border-color: var(--color-accent-yellow);
  background: rgba(255, 230, 109, 0.1);
}

.table-card.too-small {
  opacity: 0.5;
}

.table-card.occupied {
  border-color: #FFC107;
  background: rgba(255, 193, 7, 0.1);
}

.table-card.dirty {
  border-color: #F44336;
  background: rgba(244, 67, 54, 0.1);
}

.table-shape {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.seat-confirmation {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seat-btn.primary {
  background: var(--color-accent-green);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
}

.cancel-btn {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

/* Walking Screen Styles */
.walking-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  text-align: center;
}

.walking-animation {
  font-size: 4rem;
  animation: walkBounce 0.6s ease-in-out infinite;
  margin-bottom: 20px;
}

@keyframes walkBounce {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-10px) translateX(5px); }
  50% { transform: translateY(0) translateX(10px); }
  75% { transform: translateY(-10px) translateX(5px); }
}

.walking-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.walking-subtext {
  font-size: 1rem;
  color: var(--color-text-muted);
}

/* Disabled nav button */
.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Waitress Top Bar */
.waitress-top-bar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
  position: relative;
  z-index: 10;
}

.waitress-top-bar .location-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
}

.waitress-top-bar .top-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-dark);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.waitress-top-bar .top-btn:hover {
  background: var(--color-bg-darker);
  transform: translateY(-1px);
}

.waitress-top-bar .top-btn:active {
  transform: translateY(0);
}
