/* HE Restaurant Design Tokens — @he-restaurant/ui */
:root {
  /* Colors */
  --color-primary: #1a2332;
  --color-primary-hover: #243048;
  --color-accent: #2563EB;
  --color-accent-hover: #1D4ED8;
  --color-accent-light: #EFF6FF;
  --color-accent-border: #BFDBFE;
  --color-danger: #dc2626;
  --color-danger-light: #fef2f2;
  --color-danger-border: #fecaca;
  --color-warning: #F59E0B;
  --color-warning-light: #FFFBEB;
  --color-info: #0ea5e9;
  --color-info-light: #f0f9ff;

  /* Neutrals */
  --color-white: #ffffff;
  --color-bg: #f9fafb;
  --color-surface: #ffffff;
  --color-surface-hover: #f3f4f6;
  --color-border: #e5e7eb;
  --color-border-light: #f3f4f6;
  --color-text: #1a2332;
  --color-text-secondary: #6b7280;
  --color-text-muted: #9ca3af;
  --color-text-disabled: #d1d5db;

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-md: 13px;
  --font-size-base: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 22px;
  --font-size-3xl: 28px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

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

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  /* Transitions */
  --transition-fast: 0.12s ease;
  --transition-base: 0.2s ease;

  /* Dark mode (kitchen screen) */
  --sidebar-bg: #1a2332;
  --sidebar-text: rgba(255,255,255,0.75);
  --sidebar-text-muted: rgba(255,255,255,0.35);
  --sidebar-active-bg: rgba(255,255,255,0.1);
  --sidebar-active-text: #ffffff;
  --sidebar-border: rgba(255,255,255,0.08);
}

/* Dark mode for kitchen display */
[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-surface-hover: #263347;
  --color-border: #334155;
  --color-border-light: #1e293b;
  --color-text: #f1f5f9;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
}

/* RTL support */
[dir="rtl"] {
  font-family: 'Noto Sans Arabic', 'Tajawal', system-ui, sans-serif;
}

/* Reset & base */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
/* Animations */
@keyframes he-spin {
  to { transform: rotate(360deg); }
}

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

@keyframes he-fade-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes he-slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-disabled); }

/* Focus visible */
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ─── Responsive Layout ─────────────────────────────────────────────────────── */

/* Tablet: 600px – 900px */
@media (max-width: 900px) {
  /* Sidebar: hide, rely on top ribbon */
  aside {
    display: none !important;
  }

  /* POS: switch to column layout on small screens */
  .pos-layout {
    flex-direction: column !important;
  }
  .pos-order-panel {
    width: 100% !important;
    max-height: 45vh !important;
    min-width: 0 !important;
  }

  /* Ribbon: smaller tabs */
  header nav button {
    padding: 0 8px !important;
    font-size: 11px !important;
  }
}

/* Mobile: < 600px */
@media (max-width: 600px) {
  /* Ribbon name hide */
  :root { --ribbon-name-display: none; }

  /* Page padding reduce */
  [style*="padding: var(--space-8)"] {
    padding: var(--space-4) !important;
  }

  /* Tables grid: 2 columns on mobile */
  .tables-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Modal full screen */
  [role="dialog"] > div {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 12px 12px 0 0 !important;
    position: fixed !important;
    bottom: 0 !important;
  }

  /* POS bottom bar: smaller */
  .pos-quickbar button {
    padding: 8px 6px !important;
    gap: 4px !important;
  }
  .pos-quickbar button span:first-child {
    font-size: 20px !important;
    width: 36px !important;
    height: 36px !important;
  }
  .pos-quickbar button span:last-child {
    font-size: 10px !important;
  }
}

/* Print */
@media print {
  aside, header, .pos-quickbar, [data-no-print] {
    display: none !important;
  }
  body { background: #fff !important; }
}
