/* Smart QR Café System — Global Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Variables ────────────────────────────────── */
:root {
  /* Customer Portal — Warm Amber */
  --c-primary:    #F59E0B;
  --c-primary-d:  #D97706;
  --c-primary-l:  #FDE68A;
  --c-bg:         #1C1917;
  --c-bg2:        #292524;
  --c-bg3:        #3C3835;
  --c-text:       #F5F5F4;
  --c-muted:      #A8A29E;
  --c-border:     rgba(255,255,255,0.08);

  /* Manager Portal — Slate Blue */
  --m-primary:    #3B82F6;
  --m-primary-d:  #2563EB;
  --m-bg:         #0F172A;
  --m-bg2:        #1E293B;
  --m-bg3:        #334155;
  --m-text:       #F1F5F9;
  --m-muted:      #94A3B8;
  --m-border:     rgba(255,255,255,0.07);

  /* Admin Portal — Deep Violet */
  --a-primary:    #7C3AED;
  --a-primary-d:  #6D28D9;
  --a-bg:         #0D0D1A;
  --a-bg2:        #13132B;
  --a-bg3:        #1E1E3F;
  --a-text:       #EDE9FE;
  --a-muted:      #A5B4FC;
  --a-border:     rgba(255,255,255,0.07);

  /* Waiter Portal — Emerald */
  --w-primary:    #10B981;
  --w-primary-d:  #059669;
  --w-bg:         #0A1F1A;
  --w-bg2:        #122920;
  --w-bg3:        #1C3D2E;
  --w-text:       #ECFDF5;
  --w-muted:      #6EE7B7;
  --w-border:     rgba(255,255,255,0.07);

  /* Shared Semantic Colors */
  --green:   #10B981;
  --red:     #EF4444;
  --yellow:  #F59E0B;
  --blue:    #3B82F6;
  --purple:  #8B5CF6;

  /* Shared Layout */
  --radius-sm:  8px;
  --radius:     14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.2);
  --shadow:     0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg:  0 8px 48px rgba(0,0,0,0.4);
  --transition: all 0.2s ease;
}

/* ── Reset ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* ── Typography Scale ─────────────────────────────── */
.text-xs   { font-size: 11px; }
.text-sm   { font-size: 13px; }
.text-base { font-size: 15px; }
.text-lg   { font-size: 18px; }
.text-xl   { font-size: 22px; }
.text-2xl  { font-size: 28px; }
.text-3xl  { font-size: 36px; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ── Skeleton Loader ──────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-wave {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Toast Notifications ──────────────────────────── */
#toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  max-width: calc(100vw - 40px);
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
  min-width: 260px; max-width: 380px;
}
.toast.removing { animation: toast-out 0.25s ease forwards; }
.toast-success { background: #065F46; color: #A7F3D0; border: 1px solid #059669; }
.toast-error   { background: #7F1D1D; color: #FCA5A5; border: 1px solid #EF4444; }
.toast-info    { background: #1E3A5F; color: #BAE6FD; border: 1px solid #3B82F6; }
.toast-warn    { background: #78350F; color: #FDE68A; border: 1px solid #F59E0B; }
.toast i       { font-size: 20px; flex-shrink: 0; }
.toast-msg     { flex: 1; }
.toast-close   { background: none; border: none; color: inherit; opacity: 0.6; font-size: 18px; padding: 0; }
.toast-close:hover { opacity: 1; }

@keyframes toast-in  { from { opacity:0; transform: translateX(40px) scale(0.9); } to { opacity:1; transform: translateX(0) scale(1); } }
@keyframes toast-out { to   { opacity:0; transform: translateX(40px) scale(0.9); } }

/* ── Modal / Bottom Sheet ─────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 8000; display: flex; align-items: flex-end;
  opacity: 0; transition: opacity 0.25s;
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; justify-content: center; }
}
.modal-overlay.active { opacity: 1; }
.modal-sheet {
  width: 100%; max-width: 540px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34,1.3,0.64,1);
  max-height: 92vh; overflow-y: auto;
}
@media (min-width: 640px) {
  .modal-sheet { border-radius: var(--radius-lg); transform: scale(0.9) translateY(0); max-height: 85vh; }
}
.modal-overlay.active .modal-sheet { transform: translateY(0) scale(1); }
.modal-drag-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.2);
  margin: 0 auto 20px;
}
@media (min-width: 640px) { .modal-drag-handle { display: none; } }

/* ── Spinner ──────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Badges ───────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; line-height: 1.4;
  white-space: nowrap;
}
.badge-green  { background: rgba(16,185,129,0.15);  color: #6EE7B7; }
.badge-red    { background: rgba(239,68,68,0.15);   color: #FCA5A5; }
.badge-yellow { background: rgba(245,158,11,0.15);  color: #FDE68A; }
.badge-blue   { background: rgba(59,130,246,0.15);  color: #93C5FD; }
.badge-purple { background: rgba(139,92,246,0.15);  color: #C4B5FD; }
.badge-gray   { background: rgba(156,163,175,0.15); color: #D1D5DB; }

/* ── Divider ──────────────────────────────────────── */
.divider { height: 1px; background: rgba(255,255,255,0.07); margin: 16px 0; }

/* ── Utility ──────────────────────────────────────── */
.d-flex      { display: flex; }
.align-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Micro-animations ─────────────────────────────── */
@keyframes fade-in  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop-in   { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.animate-fade { animation: fade-in  0.3s ease both; }
.animate-pop  { animation: pop-in   0.25s cubic-bezier(0.34,1.56,0.64,1) both; }

/* ── Responsive Breakpoints ───────────────────────── */
/* Mobile  : < 640px  (default) */
/* Tablet  : >= 768px           */
/* Desktop : >= 1280px          */

/* ── Animate counter (data-counter) ─────────────────────── */
@keyframes count-up { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
[data-counter] { animation: count-up 0.4s ease both; }

/* ── Glassmorphism card utility ──────────────────────────── */
.glass {
  backdrop-filter: blur(16px);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

/* ── Focus ring ───────────────────────────────────────────── */
:focus-visible { outline: 2px solid rgba(255,255,255,0.3); outline-offset: 2px; }

/* ── Badge amber alias ────────────────────────────────────── */
.badge-amber  { background: rgba(245,158,11,0.15); color: #FDE68A; }
.badge-orange { background: rgba(234,88,12,0.15);  color: #FDBA74; }

/* ── Page fade-in ─────────────────────────────────────────── */
.page-wrapper { animation: fade-in 0.25s ease; }

/* ── Smooth image load ────────────────────────────────────── */
img { transition: opacity 0.3s ease; }
img[loading="lazy"] { opacity: 0; }
img[loading="lazy"].loaded { opacity: 1; }

/* ── Selection color ─────────────────────────────────────── */
::selection { background: rgba(245,158,11,0.3); color: #fff; }

