/* Linguagem visual compartilhada pelo cardápio, pela conta do cliente e pelo painel.
   Papel claro (ou preto), cartões brancos arredondados, um cartão preto com arco laranja para o número principal,
   rótulos pequenos em fonte monoespaçada e o laranja da marca só onde importa. */

:root {
  color-scheme: dark;
  --mola: cubic-bezier(0.22, 0.8, 0.2, 1);
  --page: 0 0 0;
  --surface: 14 14 14;
  --surface-2: 24 24 24;
  --ov: 255 255 255;
  --ink: 237 234 220;
  --ink-2: 196 192 180;
  --muted: 142 137 126;
  --brand: 248 104 45;
  --acento: #F8682D;
  --acento-claro: #7A3318;
  --acento-texto: 255 133 84;
  --ember: 248 104 45;
  --on-ember: 10 10 10;
  --on-brand: 10 10 10;
  --good: 111 207 158;
  --bad: 255 112 99;
  --selo-bg: rgba(248, 104, 45, 0.18);
  --selo-ink: #FFA074;
  --kpi-bg: 22 22 24;
  --kpi-fg: 244 242 234;
  --kpi-mut: 168 165 156;
  --kpi-borda: rgba(255, 255, 255, 0.12);
  --sombra-cartao: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --sombra-pop: 0 24px 60px -16px rgba(0, 0, 0, 0.85);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --page: 243 243 241;
    --surface: 255 255 255;
    --surface-2: 246 246 244;
    --ov: 20 24 27;
    --ink: 20 24 27;
    --ink-2: 62 70 76;
    --muted: 94 102 108;
    --acento-claro: #FBC3A8;
    --acento-texto: 178 58 12;
    --ember: 20 24 27;
    --on-ember: 247 248 247;
    --good: 30 122 84;
    --bad: 196 52 42;
    --selo-bg: rgba(248, 104, 45, 0.14);
    --selo-ink: #A3380B;
    --kpi-bg: 15 16 17;
    --kpi-borda: rgba(255, 255, 255, 0.06);
    --sombra-cartao: 0 1px 2px rgba(20, 24, 27, 0.04), 0 14px 34px -22px rgba(20, 24, 27, 0.22);
    --sombra-pop: 0 2px 6px rgba(20, 24, 27, 0.08), 0 24px 48px -16px rgba(20, 24, 27, 0.32);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: 243 243 241;
  --surface: 255 255 255;
  --surface-2: 246 246 244;
  --ov: 20 24 27;
  --ink: 20 24 27;
  --ink-2: 62 70 76;
  --muted: 94 102 108;
  --acento-claro: #FBC3A8;
  --acento-texto: 178 58 12;
  --ember: 20 24 27;
  --on-ember: 247 248 247;
  --good: 30 122 84;
  --bad: 196 52 42;
  --selo-bg: rgba(248, 104, 45, 0.14);
  --selo-ink: #A3380B;
  --kpi-bg: 15 16 17;
  --kpi-borda: rgba(255, 255, 255, 0.06);
  --sombra-cartao: 0 1px 2px rgba(20, 24, 27, 0.04), 0 14px 34px -22px rgba(20, 24, 27, 0.22);
  --sombra-pop: 0 2px 6px rgba(20, 24, 27, 0.08), 0 24px 48px -16px rgba(20, 24, 27, 0.32);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; background: rgb(var(--page)); }
body {
  color: rgb(var(--ink));
  font-family: "Instrument Sans", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
body.locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: rgb(var(--brand) / 0.3); }
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid rgb(var(--brand)); outline-offset: 2px; border-radius: 10px; }

/* Barra do topo: migalha à esquerda, tema e usuário à direita */
.cab-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.migalha { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; color: rgb(var(--muted)); white-space: nowrap; }
.migalha i { font-style: normal; opacity: 0.55; }
.migalha b { font-weight: 500; color: rgb(var(--ink)); overflow: hidden; text-overflow: ellipsis; }
.acoes-top { display: flex; align-items: center; gap: 8px; flex: none; }

.icone-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgb(var(--ov) / 0.14); background: rgb(var(--surface)); color: rgb(var(--ink-2));
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms var(--mola);
}
.icone-btn:hover { border-color: rgb(var(--ov) / 0.28); color: rgb(var(--ink)); }
.icone-btn:active { transform: scale(0.94); }
.icone-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.usuario {
  display: flex; align-items: center; gap: 10px; min-height: 44px; max-width: 240px; padding: 4px 12px 4px 4px; text-align: left;
  border-radius: 999px; border: 1px solid rgb(var(--ov) / 0.14); background: rgb(var(--surface));
  transition: border-color 160ms ease, transform 160ms var(--mola);
}
.usuario:hover { border-color: rgb(var(--ov) / 0.28); }
.usuario:active { transform: scale(0.97); }
.usuario[hidden] { display: none; }
.av {
  width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: rgb(var(--ink)); color: rgb(var(--page)); font-size: 15px; font-weight: 600;
}
.av svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.u-txt { display: grid; min-width: 0; line-height: 1.15; }
.u-txt b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-txt small { font-size: 12px; color: rgb(var(--muted)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usuario .seta { width: 16px; height: 16px; flex: none; stroke: rgb(var(--muted)); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 460px) {
  .usuario { padding: 4px; }
  .usuario .seta { display: none; }
  .usuario .u-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Texto de página */
.eyebrow { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(var(--muted)); }
.titulo { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: clamp(34px, 9vw, 48px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; text-wrap: balance; }
.subtitulo { max-width: 46ch; font-size: 15px; line-height: 1.5; color: rgb(var(--muted)); }

.pilula {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgb(var(--ov) / 0.14); background: rgb(var(--surface)); font-size: 13px; color: rgb(var(--ink-2)); white-space: nowrap;
}
.pilula::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: rgb(var(--good)); box-shadow: 0 0 0 4px rgb(var(--good) / 0.16); }
.pilula[data-aberto="false"]::before { background: rgb(var(--muted)); box-shadow: none; }

/* Cartões */
.cartao { background: rgb(var(--surface)); border: 1px solid rgb(var(--ov) / 0.08); border-radius: 20px; box-shadow: var(--sombra-cartao); }
/* Cartão preto: texto à esquerda, anel à direita. Ficam em colunas separadas, então nunca se sobrepõem. */
.cartao-preto {
  position: relative; overflow: hidden; border-radius: 20px; text-align: left; container-type: inline-size;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px 14px 20px;
  background: rgb(var(--kpi-bg)); color: rgb(var(--kpi-fg)); border: 1px solid var(--kpi-borda); box-shadow: var(--sombra-pop);
}
.cartao-preto .cp-txt { display: grid; gap: 2px; min-width: 0; }
.cartao-preto .rotulo { font-size: 13px; font-weight: 500; color: rgb(var(--kpi-mut)); }
.cartao-preto .num { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cartao-preto .sub { font-size: 13px; line-height: 1.35; color: rgb(var(--kpi-mut)); }
.cartao-preto .cp-arco { width: 52px; height: 52px; flex: none; color: rgb(var(--kpi-fg)); }
.cartao-preto .cp-arco svg { display: block; width: 100%; height: 100%; }
.cartao-preto.grande {
  grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "rot arco" "num num" "sub sub";
  align-items: start; gap: 4px 12px; padding: 20px 22px 22px;
}
.cartao-preto.grande .cp-txt { display: contents; }
.cartao-preto.grande .rotulo { grid-area: rot; align-self: center; font-size: 14px; color: rgb(var(--kpi-fg)); }
.cartao-preto.grande .cp-arco { grid-area: arco; width: 56px; height: 56px; }
.cartao-preto.grande .num { grid-area: num; margin-top: 14px; font-size: clamp(48px, 26cqw, 84px); letter-spacing: -0.04em; line-height: 1; }
.cartao-preto.grande .sub { grid-area: sub; margin-top: 8px; }

[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
