/* ==========================================================================
   ZEONE POS - MAIN DESIGN SYSTEM & STYLESHEET
   Commercial-Grade Dark/Light Modern Aesthetic
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* Color Palette - Light Mode */
  --bg-app: #f4f6fb;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  /* Brand Accents - FileForge Inspired Palette */
  --primary: #00b887;
  --primary-hover: #009e74;
  --primary-subtle: rgba(0, 184, 135, 0.12);
  --primary-glow: rgba(0, 184, 135, 0.25);

  --secondary: #64748b;
  --success: #00b887;
  --success-subtle: rgba(0, 184, 135, 0.12);
  --warning: #f59e0b;
  --warning-subtle: #fffbeb;
  --danger: #ef4444;
  --danger-subtle: #fef2f2;
  --info: #06b6d4;
  --info-subtle: #ecfeff;

  /* Elevation Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --header-height: 64px;
  --sidebar-width: 250px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme='dark'] {
  --bg-app: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-subtle: #1f2937;
  --bg-card: #141e33;
  --bg-input: #1e293b;

  --border-color: #1f293d;
  --border-subtle: #162032;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --primary: #00d29a;
  --primary-hover: #10e3aa;
  --primary-subtle: rgba(0, 210, 154, 0.15);
  --primary-glow: rgba(0, 210, 154, 0.3);

  --success-subtle: rgba(0, 210, 154, 0.15);
  --warning-subtle: rgba(245, 158, 11, 0.15);
  --danger-subtle: rgba(239, 68, 68, 0.15);
  --info-subtle: rgba(6, 182, 212, 0.15);

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6);
}

/* ==========================================================================
   COLORFUL SQUIRCLE ICON BADGES (FileForge Palette)
   ========================================================================== */
.nav-icon-badge {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  flex-shrink: 0;
}

.nav-item:hover .nav-icon-badge {
  transform: scale(1.08);
}

.icon-teal    { background: linear-gradient(135deg, #00b887, #059669); }
.icon-orange  { background: linear-gradient(135deg, #fb923c, #ea580c); }
.icon-pink    { background: linear-gradient(135deg, #f43f5e, #db2777); }
.icon-purple  { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.icon-red     { background: linear-gradient(135deg, #f87171, #dc2626); }
.icon-amber   { background: linear-gradient(135deg, #fbbf24, #d97706); }
.icon-cyan    { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.icon-blue    { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.icon-fuchsia { background: linear-gradient(135deg, #e879f9, #c026d3); }
.icon-lime    { background: linear-gradient(135deg, #a3e635, #65a30d); }
.icon-indigo  { background: linear-gradient(135deg, #818cf8, #4f46e5); }
.icon-slate   { background: linear-gradient(135deg, #94a3b8, #475569); }

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: var(--primary);
  text-decoration: none;
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

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

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 12px var(--primary-glow);
}

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

.btn-success {
  background: var(--success);
  color: #ffffff;
}
.btn-success:hover {
  filter: brightness(1.1);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  filter: brightness(1.1);
}

.btn-warning {
  background: var(--warning);
  color: #ffffff;
}
.btn-warning:hover {
  filter: brightness(1.1);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   FORM CONTROLS
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

/* ==========================================================================
   BADGES & STATUS TAGS
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary { background: var(--primary-subtle); color: var(--primary); }
.badge-success { background: var(--success-subtle); color: var(--success); }
.badge-warning { background: var(--warning-subtle); color: var(--warning); }
.badge-danger  { background: var(--danger-subtle);  color: var(--danger); }
.badge-info    { background: var(--info-subtle);    color: var(--info); }
.badge-secondary { background: var(--bg-input); color: var(--text-secondary); }

/* Table status styles */
.status-available { background: var(--success-subtle); color: var(--success); border: 1px solid var(--success); }
.status-occupied  { background: var(--danger-subtle); color: var(--danger); border: 1px solid var(--danger); }
.status-reserved  { background: var(--warning-subtle); color: var(--warning); border: 1px solid var(--warning); }
.status-billing   { background: var(--info-subtle); color: var(--info); border: 1px solid var(--info); }

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==========================================================================
   DATA TABLES
   ========================================================================== */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 12px 16px;
  background: var(--bg-surface-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.data-table tbody tr:hover {
  background: var(--bg-surface-subtle);
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  padding: 16px;
}

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

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: transform var(--transition-fast);
  overflow: hidden;
}

.modal-card form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  overscroll-behavior: contain;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}
.modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.modal-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-surface-subtle);
  flex-shrink: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
}
.modal-close:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.2s, transform 0.2s;
}

.toast-success { border-left: 5px solid var(--success); }
.toast-error   { border-left: 5px solid var(--danger); }
.toast-info    { border-left: 5px solid var(--info); }
.toast-warning { border-left: 5px solid var(--warning); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   SKELETON & EMPTY STATES
   ========================================================================== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--border-color) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state svg, .empty-state .icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ==========================================================================
   PWA INSTALLATION BANNER & CONTROLS
   ========================================================================== */
.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff !important;
  font-weight: 700;
  border: none;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pwa-install-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.pwa-install-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9990;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 12px 18px;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 520px;
  width: calc(100% - 32px);
  backdrop-filter: blur(16px);
  animation: slideUpBanner 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpBanner {
  from { transform: translate(-50%, 60px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-banner-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 3px 10px var(--primary-glow);
}

.pwa-banner-text strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
}

.pwa-banner-text p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-close-btn {
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Standalone Mode Adjustments */
body.pwa-standalone {
  user-select: none;
  -webkit-user-select: none;
}
body.pwa-standalone .pwa-install-btn,
body.pwa-standalone .pwa-install-banner {
  display: none !important;
}

