/* ============================================================
   FLUXOX WEB — fluxox.css
   Design system único: tokens + componentes básicos.
   Fonte: Archivo (Google Fonts) — ver README.md
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root {
  /* superfícies */
  --fx-canvas: #EEF3F9;        /* fundo da aplicação */
  --fx-surface: #FFFFFF;       /* cartões, menus, tabelas */
  --fx-surface-2: #F7FAFD;     /* campo de texto em repouso, linhas zebradas */
  --fx-surface-3: #E3EAF3;     /* área de coluna, fundo de agrupamento */
  --fx-line: #D5DEEA;          /* bordas */
  --fx-line-2: #C3CEDC;        /* bordas de controle desabilitado */

  /* texto */
  --fx-ink: #0F1E33;           /* texto principal (azul-marinho) */
  --fx-ink-2: #4A5A70;         /* texto secundário */
  --fx-ink-3: #7A8798;         /* legendas, placeholders */
  --fx-ink-4: #B5C2D3;         /* desativado */

  /* marca / ação */
  --fx-primary: #2563EB;
  --fx-primary-hover: #1D4ED8;
  --fx-primary-soft: #E3ECFF;  /* fundo de item ativo, chip */
  --fx-primary-line: #B9CCF5;
  --fx-navy: #0F1E33;          /* painel escuro, botão secundário forte */
  --fx-navy-2: #1B2D4A;

  /* semânticas */
  --fx-ok: #0E9F76;      --fx-ok-soft: #E6F6F0;   --fx-ok-line: #BDE8D6;
  --fx-warn: #F59E0B;    --fx-warn-soft: #FEF3C7; --fx-warn-line: #FCD34D; --fx-warn-ink: #92400E;
  --fx-danger: #E5484D;  --fx-danger-soft: #FDECEC; --fx-danger-line: #F5B5B5; --fx-danger-ink: #C62F34;
  --fx-info: #1D4ED8;    --fx-info-soft: #DBEAFE;
  --fx-pix: #0E7C72;     --fx-pix-soft: #D7F3F0;
  --fx-whatsapp: #25D366;

  /* tipografia */
  --fx-font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fx-text-xs: 11.5px;
  --fx-text-sm: 13px;
  --fx-text-md: 14.5px;
  --fx-text-lg: 16px;
  --fx-text-xl: 20px;
  --fx-text-2xl: 26px;
  --fx-text-3xl: 34px;

  /* forma */
  --fx-radius-sm: 8px;
  --fx-radius: 12px;
  --fx-radius-lg: 16px;
  --fx-radius-xl: 24px;
  --fx-radius-pill: 999px;
  --fx-shadow-sm: 0 2px 6px rgba(15,30,51,.08);
  --fx-shadow: 0 10px 30px rgba(15,30,51,.10);
  --fx-shadow-lg: 0 24px 60px rgba(15,30,51,.14);
  --fx-ring: 0 0 0 4px rgba(37,99,235,.14);

  /* layout */
  --fx-rail-w: 84px;           /* menu lateral em trilho (só ícones) */
  --fx-topbar-h: 64px;
  --fx-content-max: 1180px;
}

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--fx-font);
  font-size: var(--fx-text-md);
  line-height: 1.4;
  color: var(--fx-ink);
  background: var(--fx-canvas);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--fx-primary); text-decoration: none; font-weight: 600; }
a:hover { color: var(--fx-primary-hover); }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: var(--fx-text-2xl); }
h2 { font-size: var(--fx-text-xl); }
h3 { font-size: var(--fx-text-lg); }
p { margin: 0; }
.fx-display { font-stretch: 112%; letter-spacing: -.03em; }   /* títulos grandes */
.fx-num { font-variant-numeric: tabular-nums; letter-spacing: -.02em; } /* números alinhados */
.fx-muted { color: var(--fx-ink-3); }
.fx-sub { color: var(--fx-ink-2); }
.fx-eyebrow { font-size: var(--fx-text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--fx-ink-3); }
.fx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 3. BOTÃO ---------- */
.fx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border-radius: var(--fx-radius-pill);
  border: 1.5px solid transparent;
  font: inherit; font-size: var(--fx-text-md); font-weight: 600; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.fx-btn:active { transform: translateY(1px); }
.fx-btn:focus-visible { outline: none; box-shadow: var(--fx-ring); }
.fx-btn svg { width: 17px; height: 17px; flex: none; }

/* variantes */
.fx-btn--primary   { background: var(--fx-primary); color: #fff; }
.fx-btn--primary:hover { background: var(--fx-primary-hover); }
.fx-btn--navy      { background: var(--fx-navy); color: #fff; }
.fx-btn--navy:hover { background: var(--fx-navy-2); }
.fx-btn--outline   { background: var(--fx-surface); color: var(--fx-ink); border-color: var(--fx-line); }
.fx-btn--outline:hover { border-color: var(--fx-line-2); background: var(--fx-surface-2); }
.fx-btn--ghost     { background: transparent; color: var(--fx-ink-2); }
.fx-btn--ghost:hover { background: var(--fx-surface-3); color: var(--fx-ink); }
.fx-btn--danger    { background: var(--fx-surface); color: var(--fx-danger-ink); border-color: var(--fx-line); }
.fx-btn--danger:hover { background: var(--fx-danger-soft); border-color: var(--fx-danger-line); }
.fx-btn--ok        { background: var(--fx-ok); color: #fff; }

/* tamanhos */
.fx-btn--sm { height: 36px; padding: 0 14px; font-size: var(--fx-text-sm); }
.fx-btn--lg { height: 52px; padding: 0 24px; font-size: var(--fx-text-lg); }
.fx-btn--block { width: 100%; }
.fx-btn--icon { width: 40px; padding: 0; }
.fx-btn--square { border-radius: var(--fx-radius); }

/* enviando (loading): texto some, spinner aparece, botão trava */
.fx-btn--loading { position: relative; color: transparent !important; pointer-events: none; }
.fx-btn--loading::after {
  content: ""; position: absolute; width: 18px; height: 18px;
  border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: fx-spin .7s linear infinite;
}
.fx-btn--outline.fx-btn--loading::after, .fx-btn--ghost.fx-btn--loading::after, .fx-btn--danger.fx-btn--loading::after {
  border-color: rgba(15,30,51,.2); border-top-color: var(--fx-ink);
}
@keyframes fx-spin { to { transform: rotate(360deg); } }

/* desabilitado */
.fx-btn:disabled, .fx-btn[aria-disabled="true"] {
  background: var(--fx-line-2); color: #fff; border-color: transparent;
  cursor: not-allowed; box-shadow: none; transform: none;
}
.fx-btn--outline:disabled, .fx-btn--ghost:disabled { background: var(--fx-surface-2); color: var(--fx-ink-4); border-color: var(--fx-line); }

/* ---------- 4. CAMPO DE TEXTO ---------- */
.fx-field { display: block; }
.fx-field + .fx-field { margin-top: 16px; }
.fx-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--fx-text-sm); font-weight: 600; color: var(--fx-ink); margin-bottom: 6px;
}
.fx-label a { font-weight: 500; font-size: var(--fx-text-sm); }
.fx-input, .fx-select, .fx-textarea {
  width: 100%; height: 48px; padding: 0 14px;
  font: inherit; font-size: var(--fx-text-lg); color: var(--fx-ink);
  background: var(--fx-surface-2);
  border: 1.5px solid var(--fx-line); border-radius: var(--fx-radius);
  outline: none; transition: border-color .15s, background .15s, box-shadow .15s;
}
.fx-textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.fx-input::placeholder, .fx-textarea::placeholder { color: var(--fx-ink-3); }
.fx-input:hover, .fx-select:hover, .fx-textarea:hover { border-color: var(--fx-line-2); }
.fx-input:focus, .fx-select:focus, .fx-textarea:focus { background: var(--fx-surface); border-color: var(--fx-primary); box-shadow: var(--fx-ring); }
.fx-input:disabled, .fx-select:disabled, .fx-textarea:disabled { background: var(--fx-surface-3); color: var(--fx-ink-3); cursor: not-allowed; }
.fx-input[aria-invalid="true"], .fx-field--error .fx-input { border-color: var(--fx-danger); background: #fff; }
.fx-field--error .fx-input:focus { box-shadow: 0 0 0 4px rgba(229,72,77,.14); }
.fx-input--ghost { background: transparent; border-color: transparent; border-bottom: 2px solid var(--fx-line); border-radius: 0; padding: 0; }
.fx-input--ghost:focus { box-shadow: none; border-bottom-color: var(--fx-primary); background: transparent; }

/* campo com ícone/botão dentro (ex.: olho da senha, lupa) */
.fx-input-wrap { position: relative; }
.fx-input-wrap .fx-input { padding-right: 44px; }
.fx-input-wrap .fx-input-icon {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; display: grid; place-items: center;
  background: none; border: 0; color: var(--fx-ink-3); cursor: pointer; border-radius: 6px;
}
.fx-input-wrap .fx-input-icon:hover { color: var(--fx-ink); background: var(--fx-surface-3); }

/* mensagem de erro (abaixo do campo) e ajuda */
.fx-help  { display: block; margin-top: 6px; font-size: var(--fx-text-sm); color: var(--fx-ink-3); }
.fx-error { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: var(--fx-text-sm); font-weight: 500; color: var(--fx-danger-ink); }
.fx-error::before { content: "!"; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--fx-danger); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }

/* ---------- 5. AVISO (alert) ---------- */
.fx-alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: var(--fx-radius);
  border: 1px solid var(--fx-line); background: var(--fx-surface-2);
  font-size: var(--fx-text-md); color: var(--fx-ink);
}
.fx-alert strong { font-weight: 700; }
.fx-alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.fx-alert--info    { background: var(--fx-primary-soft); border-color: var(--fx-primary-line); color: var(--fx-info); }
.fx-alert--ok      { background: var(--fx-ok-soft);      border-color: var(--fx-ok-line);      color: var(--fx-ok); }
.fx-alert--warn    { background: var(--fx-warn-soft);    border-color: var(--fx-warn-line);    color: var(--fx-warn-ink); }
.fx-alert--danger  { background: var(--fx-danger-soft);  border-color: var(--fx-danger-line);  color: var(--fx-danger-ink); }
.fx-alert--banner  { border-radius: 0; border-width: 0 0 1px; }  /* faixa colada no topo do conteúdo */

/* ---------- 6. CARTÃO ---------- */
.fx-card {
  background: var(--fx-surface);
  border: 1px solid var(--fx-line);
  border-radius: var(--fx-radius-lg);
}
.fx-card--pad { padding: 20px; }
.fx-card--hover:hover { border-color: var(--fx-line-2); box-shadow: var(--fx-shadow-sm); }
.fx-card--selected { border-color: var(--fx-primary); box-shadow: 0 0 0 2px var(--fx-primary-soft); }
.fx-card--elevated { box-shadow: var(--fx-shadow); border-color: transparent; }
.fx-card__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px 12px; }
.fx-card__head h2, .fx-card__head h3 { flex: 1; }
.fx-card__body { padding: 0 20px 20px; }
.fx-card__foot { padding: 12px 20px; border-top: 1px solid var(--fx-line); background: var(--fx-surface-2); border-radius: 0 0 var(--fx-radius-lg) var(--fx-radius-lg); font-size: var(--fx-text-sm); color: var(--fx-ink-2); }
.fx-divider { height: 1px; background: var(--fx-line); border: 0; margin: 0; }
.fx-divider--dashed { background: none; border-top: 1px dashed var(--fx-line); }

/* bloco de etapa (contador grande) — usado no painel de pedidos */
.fx-stage { position: relative; display: block; text-align: left; width: 100%; padding: 10px 12px 12px; background: rgba(255,255,255,.6); border: 2px solid transparent; border-radius: 14px; cursor: pointer; font: inherit; color: inherit; transition: background .15s, border-color .15s; }
.fx-stage:hover { background: var(--fx-surface); }
.fx-stage--active { background: var(--fx-surface); border-color: var(--fx-ink); }
.fx-stage__icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.fx-stage__icon svg { width: 15px; height: 15px; }
.fx-stage__count { font-size: 26px; font-weight: 700; line-height: 1; }
.fx-stage__count--zero { color: var(--fx-ink-4); }
.fx-stage__label { font-size: var(--fx-text-sm); font-weight: 600; margin-left: 8px; }
.fx-stage__dot { position: absolute; top: 10px; right: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--fx-danger); }
.fx-stage__dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--fx-danger); animation: fx-ping 1.2s cubic-bezier(0,0,.2,1) infinite; }
@keyframes fx-ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }
.fx-stage-arrow { align-self: center; width: 24px; display: flex; justify-content: center; color: var(--fx-ink-4); flex: none; }

/* ---------- 7. TABELA ---------- */
.fx-table-wrap { overflow-x: auto; }
.fx-table { width: 100%; border-collapse: collapse; font-size: var(--fx-text-md); }
.fx-table th {
  text-align: left; padding: 10px 16px; font-size: var(--fx-text-xs); font-weight: 600;
  color: var(--fx-ink-3); text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--fx-line); white-space: nowrap;
}
.fx-table td { padding: 12px 16px; border-bottom: 1px solid var(--fx-line); vertical-align: middle; }
.fx-table tr:last-child td { border-bottom: 0; }
.fx-table tbody tr:hover td { background: var(--fx-surface-2); }
.fx-table td:first-child { font-weight: 600; }
.fx-table .fx-right, .fx-table th.fx-right { text-align: right; }
.fx-table--dense th { padding: 8px 12px; } .fx-table--dense td { padding: 8px 12px; }
.fx-table-row--late td { background: var(--fx-danger-soft); }
.fx-table-row--late td:first-child { box-shadow: inset 3px 0 0 var(--fx-danger); }

/* ---------- 8. ETIQUETA DE SITUAÇÃO (badge / chip) ---------- */
.fx-badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 8px; border-radius: var(--fx-radius-pill);
  font-size: var(--fx-text-xs); font-weight: 600; white-space: nowrap;
  background: var(--fx-surface-3); color: var(--fx-ink-2);
}
.fx-badge svg { width: 12px; height: 12px; }
.fx-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.fx-badge--nodot::before { display: none; }
/* situações de pedido */
.fx-badge--novo      { background: var(--fx-danger-soft); color: var(--fx-danger-ink); }
.fx-badge--preparo   { background: #FFEDD5; color: #C2410C; }
.fx-badge--pronto    { background: var(--fx-warn-soft); color: var(--fx-warn-ink); }
.fx-badge--rota      { background: var(--fx-info-soft); color: var(--fx-info); }
.fx-badge--concluido { background: var(--fx-ok-soft); color: var(--fx-ok); }
.fx-badge--cancelado { background: var(--fx-surface-3); color: var(--fx-ink-3); }
/* genéricas */
.fx-badge--ok     { background: var(--fx-ok-soft); color: var(--fx-ok); }
.fx-badge--warn   { background: var(--fx-warn-soft); color: var(--fx-warn-ink); }
.fx-badge--danger { background: var(--fx-danger-soft); color: var(--fx-danger-ink); }
.fx-badge--info   { background: var(--fx-primary-soft); color: var(--fx-info); }
.fx-badge--pix    { background: var(--fx-pix-soft); color: var(--fx-pix); }
.fx-badge--solid-danger { background: var(--fx-danger); color: #fff; text-transform: uppercase; letter-spacing: .04em; }
/* contador (bolinha vermelha de notificação) */
.fx-counter { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--fx-danger); color: #fff; font-size: 10.5px; font-weight: 700; }

/* ---------- 9. CABEÇALHO (topbar) ---------- */
.fx-topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--fx-topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px;
  background: rgba(238,243,249,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--fx-line);
}
.fx-topbar__title { line-height: 1.1; white-space: nowrap; }
.fx-topbar__title h1 { font-size: var(--fx-text-xl); }
.fx-topbar__title small { display: block; font-size: var(--fx-text-xs); color: var(--fx-ink-3); margin-top: 1px; }
.fx-topbar__meta { font-size: var(--fx-text-sm); color: var(--fx-ink-3); white-space: nowrap; }
.fx-topbar__spacer { flex: 1; }
.fx-search { display: flex; align-items: center; gap: 8px; height: 40px; width: 220px; padding: 0 14px; border-radius: var(--fx-radius-pill); background: var(--fx-surface); border: 1px solid var(--fx-line); font-size: var(--fx-text-sm); }
.fx-search:focus-within { border-color: var(--fx-primary); }
.fx-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; }
.fx-search svg { width: 15px; height: 15px; color: var(--fx-ink-3); }
/* pílulas de estado no topo (loja aberta, pausado, esgotado) */
.fx-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 8px; border-radius: var(--fx-radius-pill); border: 1px solid var(--fx-line); background: var(--fx-surface); font-size: var(--fx-text-sm); font-weight: 600; cursor: pointer; white-space: nowrap; }
.fx-pill__dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.fx-pill--ok   { background: var(--fx-ok-soft); border-color: var(--fx-ok-line); color: #0E7C5C; }   .fx-pill--ok .fx-pill__dot { background: var(--fx-ok); }
.fx-pill--warn { background: var(--fx-warn-soft); border-color: var(--fx-warn-line); color: var(--fx-warn-ink); } .fx-pill--warn .fx-pill__dot { background: var(--fx-warn); color: var(--fx-ink); }
.fx-pill--danger { background: var(--fx-danger-soft); border-color: var(--fx-danger-line); color: var(--fx-danger-ink); } .fx-pill--danger .fx-pill__dot { background: var(--fx-danger); }

/* ---------- 10. MENU LATERAL EM TRILHO (só ícones) ---------- */
.fx-shell { display: flex; min-height: 100vh; }
.fx-rail {
  position: sticky; top: 0; height: 100vh; width: var(--fx-rail-w); flex: none;
  display: flex; flex-direction: column; align-items: center; padding: 16px 0;
  background: var(--fx-surface); border-right: 1px solid var(--fx-line);
}
.fx-rail__logo { width: 44px; height: 44px; border-radius: 12px; background: var(--fx-primary); color: #fff; display: grid; place-items: center; margin-bottom: 12px; }
.fx-rail__nav { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fx-rail__item {
  position: relative; width: 72px; padding: 10px 0; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font: inherit; font-size: 10.5px; font-weight: 500; color: var(--fx-ink-3); border-radius: 12px;
}
.fx-rail__item:hover { color: var(--fx-ink); background: #F3F6FA; }
.fx-rail__icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.fx-rail__icon svg { width: 21px; height: 21px; }
.fx-rail__item--active { color: var(--fx-primary); font-weight: 700; }
.fx-rail__item--active .fx-rail__icon { background: var(--fx-primary-soft); }
.fx-rail__item .fx-counter { position: absolute; top: 6px; right: 10px; box-shadow: 0 0 0 2px #fff; }
.fx-rail__user { margin-top: 8px; width: 40px; height: 40px; border-radius: 50%; background: var(--fx-navy); color: #fff; border: 0; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.fx-main { flex: 1; min-width: 0; }
.fx-content { padding: 20px 24px; max-width: var(--fx-content-max); }

/* ---------- 11. UTILITÁRIOS ---------- */
.fx-row { display: flex; align-items: center; gap: 10px; }
.fx-row--between { justify-content: space-between; }
.fx-stack > * + * { margin-top: 12px; }
.fx-grid-5 { display: flex; align-items: stretch; gap: 4px; }
.fx-grid-5 .fx-stage { flex: 1; min-width: 0; }
.fx-hidden { display: none !important; }
@media (max-width: 1023px) {
  .fx-rail { display: none; }
  .fx-content { padding: 16px; }
  .fx-search, .fx-topbar__meta { display: none; }
}
