/* ==============================================================
   DESIGN SYSTEM — DAPPIO
   "Seu cardápio digital inteligente"
   ==============================================================

   Paleta oficial Dappio:
   - Principal: #FF5F00 (laranja vibrante)
   - Secundária: #FF8A33 (laranja claro)
   - Fundo escuro: #0F1115
   - Cinza neutro: #6B7280
   - Fundo claro: #F3F4F6

   Tipografia: Poppins (títulos SemiBold, textos Regular)
   ============================================================== */

:root {
  /* ── CORES BASE ── */
  --bg-app:         #F3F4F6;   /* paleta Dappio */
  --bg-card:        #FFFFFF;
  --bg-subtle:      #F9FAFB;
  --bg-elevated:    #FFFFFF;
  --bg-dark:        #0F1115;   /* paleta Dappio */

  --text-primary:   #0F1115;   /* paleta Dappio */
  --text-secondary: #6B7280;   /* paleta Dappio */
  --text-muted:     #9CA3AF;
  --text-inverse:   #FFFFFF;

  --border:         #E5E7EB;
  --border-strong:  #D1D5DB;

  /* ── ACCENT DAPPIO (pode ser sobrescrito pela loja) ── */
  --accent:         #FF5F00;   /* paleta Dappio principal */
  --accent-hover:   #E54E00;
  --accent-light:   #FF8A33;   /* paleta Dappio secundária */
  --accent-subtle:  rgba(255, 95, 0, 0.08);
  --accent-ring:    rgba(255, 95, 0, 0.28);
  --accent-fg:      #FFFFFF;

  --accent-gradient: linear-gradient(135deg, #FF8A33, #FF5F00);

  /* ── STATUS ── */
  --success:        #16A34A;
  --success-subtle: rgba(22, 163, 74, 0.08);
  --warn:           #D97706;
  --warn-subtle:    rgba(217, 119, 6, 0.08);
  --error:          #DC2626;
  --error-subtle:   rgba(220, 38, 38, 0.08);
  --info:           #2563EB;
  --info-subtle:    rgba(37, 99, 235, 0.08);

  /* ── TIPOGRAFIA DAPPIO (Poppins) ── */
  --font-display:   'Poppins', system-ui, -apple-system, sans-serif;
  --font-body:      'Poppins', system-ui, -apple-system, sans-serif;
  --font-mono:      ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --fs-xs:   0.75rem;
  --fs-sm:   0.85rem;
  --fs-base: 0.95rem;
  --fs-lg:   1.05rem;
  --fs-xl:   1.25rem;
  --fs-2xl:  1.5rem;
  --fs-3xl:  1.875rem;
  --fs-4xl:  2.25rem;

  --lh-tight: 1.2;
  --lh-base:  1.5;
  --lh-loose: 1.65;

  /* Pesos Poppins */
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold: 600;
  --fw-bold:    700;

  /* ── ESPAÇAMENTO ── */
  --sp-1:   4px;
  --sp-2:   8px;
  --sp-3:   12px;
  --sp-4:   16px;
  --sp-5:   20px;
  --sp-6:   24px;
  --sp-8:   32px;
  --sp-10:  40px;
  --sp-12:  48px;
  --sp-16:  64px;

  /* ── RAIOS ── */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-2xl:  28px;
  --r-full: 9999px;

  /* ── SOMBRAS ── */
  --sh-xs:  0 1px 2px rgba(15, 17, 21, 0.04);
  --sh-sm:  0 2px 4px rgba(15, 17, 21, 0.06), 0 1px 2px rgba(15, 17, 21, 0.04);
  --sh-md:  0 4px 12px rgba(15, 17, 21, 0.08), 0 2px 4px rgba(15, 17, 21, 0.04);
  --sh-lg:  0 12px 28px rgba(15, 17, 21, 0.12), 0 4px 8px rgba(15, 17, 21, 0.06);
  --sh-xl:  0 24px 48px rgba(15, 17, 21, 0.15);

  --sh-accent-sm: 0 4px 12px rgba(255, 95, 0, 0.22);
  --sh-accent-md: 0 8px 24px rgba(255, 95, 0, 0.28);
  --sh-accent-lg: 0 16px 36px rgba(255, 95, 0, 0.35);

  /* ── ANIMAÇÃO ── */
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out:  cubic-bezier(0.65, 0, 0.35, 1);

  --dur-fast:   150ms;
  --dur-base:   220ms;
  --dur-slow:   400ms;

  /* ── LAYOUT ── */
  --container-max: 1240px;
  --header-h:      64px;
  --tabs-h:        56px;
}

/* ── RESET SUAVE ── */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-base);
  color: var(--text-primary);
  background: var(--bg-app);
}

/* Títulos usam peso SemiBold (600) */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ── UTILITÁRIAS ── */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── BOTÕES BASE ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast),
              border-color var(--dur-fast),
              color var(--dur-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 2px;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-accent {
  background: var(--accent-gradient);
  color: var(--accent-fg);
  box-shadow: var(--sh-accent-sm);
}
.btn-accent:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--sh-accent-md);
}
.btn-accent:active:not(:disabled) { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: var(--error-subtle);
  color: var(--error);
  border: 1px solid rgba(220, 38, 38, 0.3);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.12);
}

/* ── STATUS PILL ── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.status-pill--open   { background: var(--success-subtle); color: var(--success); }
.status-pill--closed { background: var(--error-subtle);   color: var(--error);   }
.status-pill--busy   { background: var(--warn-subtle);    color: var(--warn);    }

.status-pill .status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.status-pill--open .status-dot {
  animation: status-pulse 1.8s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  70%      { box-shadow: 0 0 0 6px transparent; opacity: 0.85; }
}

/* ── ACESSIBILIDADE ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── SCROLLBARS ── */
@media (min-width: 641px) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
    background-clip: padding-box;
    border: 2px solid transparent;
  }
}

/* ==============================================================
   ÍCONES — SVG (Lucide / Phosphor)
   --------------------------------------------------------------
   Lucide: usado no painel admin via <i data-lucide="..."></i>
           inicializado por lucide.createIcons() (vira <svg>)
   Phosphor: usado no cliente/pedidos/mobile via <i class="ph ph-..."></i>
             funciona como webfont — controla via font-size

   Tamanhos padronizados pra evitar diferença entre dispositivos
   (emojis tinham aparência distinta em iOS/Android/Windows).
   ============================================================== */

/* Lucide e similares (renderizados como <svg>) */
.nav-icon,
.sidebar-icon,
.action-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.bottom-nav-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.icon-btn svg,
.icon-btn i {
  width: 20px;
  height: 20px;
  color: currentColor;
}

/* Phosphor webfont — controla por font-size, não width/height.
   .ph base já vem do CSS da lib; aqui só ajusto tamanhos contextuais. */
.nav-icon .ph,
.sidebar-icon .ph,
.action-icon .ph { font-size: 20px; }

.bottom-nav-icon .ph { font-size: 24px; }

/* Tamanhos utility pra usar em qualquer ícone de UI (Lucide ou Phosphor) */
.icon-sm { width: 16px; height: 16px; font-size: 16px; }
.icon-md { width: 20px; height: 20px; font-size: 20px; }
.icon-lg { width: 24px; height: 24px; font-size: 24px; }
.icon-xl { width: 32px; height: 32px; font-size: 32px; }

/* SVG dentro de Lucide herda stroke da cor atual */
[data-lucide],
.lucide {
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

