/* ============================================================================
   Hubfood — sistema visual (design tokens + componentes)
   Carregado após o Tailwind CDN; centraliza a identidade e o polimento.
   ============================================================================ */

:root {
  /* neutros */
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e6e8ec;
  --ink-900: #0b1220;
  --ink-700: #26303e;
  --ink-500: #64748b;
  --ink-400: #94a3b8;

  /* marca (Hubfood) */
  --brand: #e11d48;
  --brand-600: #e11d48;
  --brand-700: #be123c;
  --brand-grad: linear-gradient(135deg, #f43f5e 0%, #e11d48 55%, #be123c 100%);

  /* chrome escuro (sidebar) */
  --nav-bg: #0b1220;
  --nav-bg-2: #111a2b;
  --nav-ink: #aab6c8;
  --nav-ink-active: #ffffff;

  /* semânticos */
  --amber: #f59e0b;
  --sky: #0ea5e9;
  --indigo: #6366f1;
  --emerald: #10b981;
  --violet: #8b5cf6;
  --rose: #f43f5e;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.05);
  --shadow: 0 4px 12px rgba(16,24,40,.08), 0 2px 4px rgba(16,24,40,.04);
  --shadow-lg: 0 18px 40px -12px rgba(16,24,40,.28);
}

* { -webkit-tap-highlight-color: transparent; }
html, body { font-family: Inter, system-ui, sans-serif; }
body.app { background: var(--bg); color: var(--ink-700); }

::selection { background: rgba(225,29,72,.18); }

/* --- scrollbars ----------------------------------------------------------- */
.scroll-y { overflow-y: auto; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.scroll-x { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.scroll-y::-webkit-scrollbar, .scroll-x::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-y::-webkit-scrollbar-thumb, .scroll-x::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 20px; }
.scroll-y::-webkit-scrollbar-track, .scroll-x::-webkit-scrollbar-track { background: transparent; }

/* ============================================================================
   App shell: sidebar + topbar + conteúdo
   ============================================================================ */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-2) 100%);
  color: var(--nav-ink); display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; color: #fff;
  font-weight: 800; font-size: 20px; letter-spacing: -.02em;
}
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-grad); box-shadow: 0 6px 16px -4px rgba(225,29,72,.6); color: #fff;
}
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #5b6b82;
  padding: 14px 10px 6px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 11px;
  color: var(--nav-ink); font-weight: 600; font-size: 14px; transition: .15s;
}
.nav-item svg { width: 19px; height: 19px; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.10); color: var(--nav-ink-active); }
.nav-item.active svg { opacity: 1; }
.nav-spacer { flex: 1; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 24px;
}
.topbar h1 { font-size: 18px; font-weight: 800; color: var(--ink-900); letter-spacing: -.01em; }
.topbar .sub { font-size: 13px; color: var(--ink-500); }
.content { padding: 22px 24px; flex: 1; min-width: 0; }

/* mobile: sidebar vira barra inferior/esconde */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; width: 100%;
    flex-direction: row; justify-content: space-around; padding: 8px; z-index: 40;
    border-top: 1px solid rgba(255,255,255,.08);
  }
  .sidebar .brand, .sidebar .nav-label, .sidebar .nav-spacer, .sidebar .side-foot { display: none; }
  .nav-item { flex-direction: column; gap: 3px; font-size: 10px; padding: 6px 10px; }
  .nav-item span { font-size: 10px; }
  .content { padding: 16px; padding-bottom: 84px; }
  .topbar { padding: 12px 16px; }
}

/* ============================================================================
   Componentes
   ============================================================================ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; }
.pill-live { background: rgba(16,185,129,.12); color: #047857; }
.pill-off  { background: rgba(245,158,11,.14); color: #b45309; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.pill-live .dot { animation: pulse 1.6s infinite; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-weight: 700; font-size: 13px; padding: 9px 14px; border-radius: 11px; cursor: pointer;
  border: 1px solid transparent; transition: .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 8px 18px -8px rgba(225,29,72,.7); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--ink-700); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-dark { background: #111a2b; color: #fff; }
.btn-dark:hover { background: #1b263b; }
.btn-success { background: var(--emerald); color: #fff; }
.btn-success:hover { filter: brightness(1.04); }
.btn-danger { background: #fff; border-color: #fecdd3; color: #e11d48; }
.btn-danger:hover { background: #fff1f2; }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--border); background: #fff; color: var(--ink-700); cursor: pointer; transition: .15s; }
.icon-btn:hover { background: var(--surface-2); }

/* inputs */
.field { width: 100%; border: 1px solid var(--border); border-radius: 11px; padding: 11px 13px;
  font-size: 14px; color: var(--ink-900); background: #fff; transition: .15s; }
.field:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(225,29,72,.12); }
.label { font-size: 13px; font-weight: 600; color: var(--ink-700); margin-bottom: 6px; display: block; }

/* ============================================================================
   Kanban
   ============================================================================ */
.board { display: flex; gap: 16px; align-items: flex-start; padding-bottom: 10px; }
.col { flex: 0 0 300px; width: 300px; background: #eef0f4; border-radius: 18px;
  display: flex; flex-direction: column; max-height: calc(100vh - 150px); }
.col-head { display: flex; align-items: center; justify-content: space-between;
  padding: 13px 15px; position: sticky; top: 0; }
.col-head .t { display: flex; align-items: center; gap: 9px; font-weight: 800; color: var(--ink-900); font-size: 14px; }
.col-accent { width: 9px; height: 9px; border-radius: 50%; }
.col-count { font-size: 12px; font-weight: 800; color: var(--ink-500); background: #fff;
  min-width: 24px; text-align: center; padding: 2px 8px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.col-body { padding: 0 11px 12px; display: flex; flex-direction: column; gap: 11px; overflow-y: auto; }
.col-empty { text-align: center; color: var(--ink-400); font-size: 12.5px; padding: 22px 8px; }

.col[data-col="PLACED"]     .col-accent { background: var(--amber); }
.col[data-col="CONFIRMED"]  .col-accent { background: var(--sky); }
.col[data-col="PREPARING"]  .col-accent { background: var(--indigo); }
.col[data-col="READY"]      .col-accent { background: var(--emerald); }
.col[data-col="DISPATCHED"] .col-accent { background: var(--violet); }

/* order card */
.order-card { position: relative; background: #fff; border-radius: 14px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border); padding: 13px 14px 13px 16px; overflow: hidden; animation: pop .18s ease-out;
  /* flex-shrink:0 — senão a coluna (flex column c/ altura máx.) ESPREME os cards p/ caber, cortando total/botões. */
  flex: 0 0 auto; }
.order-card .stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.oc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.oc-ref { font-weight: 800; color: var(--ink-900); font-size: 15px; margin-top: 3px; letter-spacing: -.01em; }
.oc-time { font-size: 11.5px; color: var(--ink-400); font-variant-numeric: tabular-nums; white-space: nowrap; }
.oc-time.late { color: var(--rose); font-weight: 800; }
.oc-cust { font-size: 13px; color: var(--ink-700); margin-top: 7px; display: flex; align-items: center; gap: 6px; }
.oc-meta { font-size: 12px; color: var(--ink-400); margin-top: 2px; }
.oc-items { margin-top: 9px; display: flex; flex-direction: column; gap: 3px; }
.oc-item { font-size: 13px; color: var(--ink-700); display: flex; gap: 7px; }
.oc-item b { color: var(--ink-900); }
.oc-more { font-size: 12px; color: var(--ink-400); }
.oc-total { margin-top: 10px; font-weight: 800; color: var(--ink-900); font-size: 15px; }
.oc-deadline { margin-top: 9px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  font-weight: 800; color: #be123c; background: #fff1f2; padding: 5px 9px; border-radius: 9px; }
.oc-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 7px; }

/* chips de plataforma */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800;
  padding: 3px 9px; border-radius: 999px; }

/* estado vazio geral */
.empty { text-align: center; color: var(--ink-400); padding: 70px 20px; }
.empty svg { width: 54px; height: 54px; margin: 0 auto 14px; opacity: .5; }

/* ============================================================================
   Animações
   ============================================================================ */
@keyframes pop { from { transform: scale(.97); opacity: .3; } to { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,.4); } 50% { box-shadow: 0 0 0 5px rgba(16,185,129,0); } }
@keyframes slideup { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.animate-slideup { animation: slideup .22s ease-out; }
.flash { animation: flashring 1s ease-in-out 2; }
@keyframes flashring { 0%,100% { box-shadow: var(--shadow-sm); } 50% { box-shadow: 0 0 0 4px rgba(225,29,72,.35); } }
