/* PedUp: laranja da marca, menu escuro (tinta), fundo claro e cartões brancos sem borda. */
:root {
  --bg: #F3F4F7;
  --surface: #FFFFFF;
  --surface-2: #EEF0F4;
  --line: #E2E5EB;
  --fg: #151826;
  --muted: #646B7D;
  --brand: #FF6B00;
  --brand-strong: #E85D00;
  --brand-fg: #FFFFFF;
  --brand-soft: #FFF0E5;
  --ink: #151A2C;
  --ink-2: #1C2138;
  --ink-fg: #E8EAF2;
  --ink-muted: #9AA0B8;
  --ok: #1F9D61;
  --ok-soft: #E3F5EC;
  --warn: #E59400;
  --warn-soft: #FFF4DC;
  --danger: #E5484D;
  --danger-soft: #FDE8E8;
  --info: #2F6BFF;
  --info-soft: #E6EEFF;
  --paper: #FFFFFF;
  /* colunas do quadro de pedidos */
  /* Quadro de pedidos (Opção A): cabeçalho forte e corpo da coluna mais claro */
  --col-novo: #6F7687; --col-novo-f: #C9CDD6;
  --col-preparo: #FF7A14; --col-preparo-f: #FFB97F;
  --col-pronto: #1E9E63; --col-pronto-f: #8FD4B2;
  --col-entrega: #2F6BFF;
  --col-off: #A3A9B8;
  /* formas de pagamento nos gráficos */
  --c-pix: #1F9D61;
  --c-credito: #2F6BFF;
  --c-debito: #8B5CF6;
  --c-dinheiro: #E59400;
  --c-vale: #0EA5A4;
  --shadow: 0 1px 2px rgba(18, 22, 42, .04);
  --shadow-lg: 0 10px 40px rgba(18, 22, 42, .18);
  /* Uma fonte só (Manrope) em todo o sistema; números alinhados em coluna em vez de fonte de programador. */
  --f-display: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0D1020; --surface: #171B2E; --surface-2: #20253C; --line: #2A3049;
  --fg: #E8EAF2; --muted: #9AA0B8; --brand: #FF7A1A; --brand-strong: #FF8C3A; --brand-fg: #1A0D00; --brand-soft: #3A2412;
  --ink: #0A0D1A; --ink-2: #151A2E;
  --ok: #3CC584; --ok-soft: #123326; --warn: #F5B03C; --warn-soft: #3A2E12; --danger: #F07175; --danger-soft: #3D1C20;
  --info: #6B95FF; --info-soft: #1A2547; --paper: #171B2E;
  --col-novo: #5A6072; --col-novo-f: #2B3042; --col-preparo: #E0650A; --col-preparo-f: #4A2A14; --col-pronto: #17834F; --col-pronto-f: #163C2C; --col-entrega: #2856CC; --col-off: #4A5068;
  --c-pix: #3CC584; --c-credito: #6B95FF; --c-debito: #A78BFA; --c-dinheiro: #F5B03C; --c-vale: #2DD4BF;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 14px; line-height: 1.5; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; letter-spacing: -0.02em; font-weight: 650; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 16px; font-weight: 560; text-decoration: none; color: inherit; }
.btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn:disabled { opacity: .45; }
.btn-primary { background: var(--brand); color: var(--brand-fg); border-color: var(--brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--brand-fg); }
.btn-outline { background: var(--surface); color: var(--brand); border-color: var(--brand); }
.btn-outline:hover:not(:disabled) { background: var(--brand-soft); }
.btn-ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn-ok:hover:not(:disabled) { filter: brightness(1.07); color: #fff; border-color: var(--ok); }
.btn-danger { color: var(--danger); }
.btn-danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.btn-ghost { background: none; border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: transparent; color: inherit; }
.btn-small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.field > label, .lbl { font-size: 12px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.field textarea { resize: vertical; min-height: 64px; }
.field .help { font-size: 12px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

.err { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 9px 12px; font-weight: 500; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-weight: 560; white-space: nowrap; }
.tag.live { color: var(--ok); background: var(--ok-soft); }
.tag.info { color: var(--info); background: var(--info-soft); }
.tag.warn { color: var(--warn); background: var(--warn-soft); }
.tag.bad { color: var(--danger); background: var(--danger-soft); }
.tag.brand { color: var(--brand); background: var(--brand-soft); }

.switch { appearance: none; flex: none; width: 40px; height: 23px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(17px); }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100% - 32px); box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--danger); }

.foto-ph { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-family: var(--f-display); font-weight: 650; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Celular: campos com letra de 16px. Menor que isso o iPhone dá zoom sozinho ao tocar para escrever
   (e às vezes não volta). Vale para painel, PDV, cardápio e login. */
@media (max-width: 860px), (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select, textarea { font-size: 16px !important; }
}

/* Tela de carregamento: logo do PedUp pulsando e tremendo de leve até a página ficar pronta */
#pedup-splash { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--bg, #F6F7FB); transition: opacity .35s ease, visibility .35s; }
#pedup-splash img { width: 84px; height: 84px; animation: ps-vibra 1.1s ease-in-out infinite; transform-origin: 50% 60%; }
#pedup-splash .ps-sombra { width: 46px; height: 8px; border-radius: 50%; background: rgba(0,0,0,.12); animation: ps-sombra 1.1s ease-in-out infinite; }
#pedup-splash.sai { opacity: 0; visibility: hidden; }
@keyframes ps-vibra {
  0%, 100% { transform: scale(1) rotate(0); }
  12% { transform: scale(1.08) rotate(-6deg); } 24% { transform: scale(1.1) rotate(6deg); } 36% { transform: scale(1.08) rotate(-4deg); } 48% { transform: scale(1.04) rotate(3deg); }
  60% { transform: scale(1) rotate(0); }
}
@keyframes ps-sombra { 0%, 100%, 60% { transform: scaleX(1); opacity: .8; } 24% { transform: scaleX(.8); opacity: .5; } }
@media (prefers-reduced-motion: reduce) { #pedup-splash img, #pedup-splash .ps-sombra { animation: none; } }
