/* ==========================================================================
   RESTAURANT MANAGER FOH - MAIN DESIGN SYSTEM & LAYOUT
   ========================================================================== */

:root {
  /* Core Palette */
  --bg-app: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-elevated: #334155;
  --bg-canvas: #f8fafc;
  --bg-panel: #1e293b;
  --bg-card: #273549;
  --bg-card-hover: #334155;

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dark: #0f172a;

  /* Accents & Brand */
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-secondary: #6366f1;
  --accent-emerald: #10b981;
  --accent-emerald-hover: #059669;
  --accent-amber: #f59e0b;
  --accent-orange: #f97316;
  --accent-crimson: #ef4444;
  --accent-pink: #ec4899;
  --accent-purple: #a855f7;

  /* Table Base Colors (Occupancy Layer) */
  --table-vacant: #ffffff;
  --table-vacant-border: #64748b;
  --table-reserved-today: #e0f2fe;
  --table-reserved-today-border: #0284c7;
  --table-occupied: #1d4ed8;
  --table-occupied-text: #ffffff;
  --table-finishing-30m: #facc15;
  --table-finishing-30m-text: #1e293b;
  --table-finishing-10m: #f97316;
  --table-finishing-10m-text: #ffffff;
  --table-overdue-leave: #dc2626;
  --table-cleaning: #9333ea;

  /* Perimeter Rings (Arrival Layer) */
  --ring-due-soon: #ec4899;      /* Pink: due in 10m or <15m ago */
  --ring-overdue: #ef4444;       /* Red: >15m overdue arrival */
  --ring-suitable: #10b981;      /* Green: valid drop/allocation target */
  --ring-selected: #3b82f6;      /* Blue: selected in editor/multi-table */

  /* Borders & Shadows */
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-focus: #3b82f6;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.45;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   APP SHELL & TOP NAVIGATION BAR
   ========================================================================== */

.app-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
}

.top-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 20px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  z-index: 100;
  gap: 16px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-title h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Mode Navigation Tabs */
.mode-tabs {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.mode-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.mode-tab.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}

.mode-tab .badge-count {
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 6px;
  border-radius: 99px;
  font-size: 11px;
}

/* Action Buttons Group */
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-clock-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

.live-dot.preview {
  background-color: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
  animation: none;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.88); }
}

/* Standard Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-primary-hover);
}

.btn-emerald {
  background-color: var(--accent-emerald);
  color: #ffffff;
}

.btn-emerald:hover:not(:disabled) {
  background-color: var(--accent-emerald-hover);
}

.btn-amber {
  background-color: var(--accent-amber);
  color: #0f172a;
}

.btn-amber:hover:not(:disabled) {
  background-color: #d97706;
  color: #ffffff;
}

.btn-danger {
  background-color: var(--accent-crimson);
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  background-color: #dc2626;
}

.btn-secondary {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover:not(:disabled) {
  background-color: #475569;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* ==========================================================================
   MAIN WORKSPACE AREA
   ========================================================================== */

.main-workspace {
  display: flex;
  flex: 1;
  position: relative;
  overflow: hidden;
}

.view-panel {
  display: none;
  width: 100%;
  height: 100%;
}

.view-panel.active {
  display: flex;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
}

::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ==========================================================================
   TOAST NOTIFICATIONS & BANNERS
   ========================================================================== */

.toast-container {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: #1e293b;
  color: #fff;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  animation: toastSlideIn 0.2s ease-out;
}

.toast.toast-success { border-left: 4px solid var(--accent-emerald); }
.toast.toast-warning { border-left: 4px solid var(--accent-amber); }
.toast.toast-error { border-left: 4px solid var(--accent-crimson); }
.toast.toast-info { border-left: 4px solid var(--accent-primary); }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Floating 20-Second Undo Bar for Blank Slate / Reload Demo */
.reset-undo-floating-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--accent-amber);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55), 0 0 16px rgba(245, 158, 11, 0.25);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  z-index: 2900;
  animation: undoBarPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.reset-undo-floating-bar.visible {
  display: flex;
}

.reset-undo-text {
  color: #fde68a;
  white-space: nowrap;
}

.reset-undo-btn {
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

@keyframes undoBarPopIn {
  from { opacity: 0; transform: translate(-50%, 14px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

