:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #10151f;
  --muted: #5b6474;
  --line: #d9dee7;
  /* Laranja da marca. Texto escuro sobre ele: branco não atinge o contraste mínimo. */
  --accent: #f25c05;
  --accent-text: #1b1206;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 16px rgba(16, 24, 40, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e17;
    --surface: #121826;
    --text: #eef1f6;
    --muted: #9aa4b5;
    --line: #263043;
    --accent: #ff7a1a;
    --accent-text: #1b1206;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0a0e17;
    --surface: #121826;
    --text: #eef1f6;
    --muted: #9aa4b5;
    --line: #263043;
    --accent: #ff7a1a;
    --accent-text: #1b1206;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }

/* A logo tem fundo branco: fica sempre em uma placa clara, também no tema escuro. */
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: #ffffff; }
.hero-logo { display: block; width: 200px; height: 200px; margin: 0 0 24px; border-radius: 24px; background: #ffffff; }

.locales { display: flex; gap: 8px; }

.locale {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.locale[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.locale:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.hero { max-width: 720px; margin: 0 auto; padding: 48px 16px; }
.hero h1 { margin: 0 0 12px; font-size: clamp(1.5rem, 5vw, 2.5rem); line-height: 1.2; text-wrap: balance; }
.muted { margin: 0; color: var(--muted); }

/* Telas de conta: entrar, definir senha e início. */
a.brand { color: inherit; text-decoration: none; }
.narrow { max-width: 460px; margin: 0 auto; padding: 32px 16px; display: grid; gap: 16px; }
.card { display: grid; gap: 12px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.card h1 { margin: 0; font-size: 1.5rem; line-height: 1.2; }
.card p { margin: 0; }
.card label { font-weight: 600; margin-top: 4px; }

.card input, .card select {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.card input:focus-visible, .card select:focus-visible, .primary:focus-visible, .secondary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.primary { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); }
.secondary { border: 1px solid var(--line); background: transparent; color: var(--text); }
.link-btn { border: none; background: none; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }
.primary:disabled { opacity: 0.6; cursor: not-allowed; }

.hint { color: var(--muted); font-size: 0.9rem; }
.pay-instructions { white-space: pre-wrap; overflow-wrap: anywhere; }
.strong { font-weight: 700; font-size: 1.1rem; }
.badge { justify-self: start; padding: 2px 10px; border: 1px solid var(--accent); border-radius: 999px; font-size: 0.85rem; }
.alert { padding: 10px 12px; border: 1px solid #c2410c; border-radius: 10px; background: color-mix(in srgb, #c2410c 12%, transparent); }
[hidden] { display: none !important; }

/* Telas de gestão: lista de pessoas, ações por linha. */
.wide { max-width: 760px; margin: 0 auto; padding: 32px 16px; display: grid; gap: 16px; }
.card h2 { margin: 0; font-size: 1.15rem; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; }
.row { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.who { display: grid; gap: 4px; min-width: 0; }
.who span { overflow-wrap: anywhere; }
.tags, .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions select { width: auto; flex: 1 1 140px; }
.badge.warn { border-color: #c2410c; }
.card > .secondary { justify-self: start; }

/* Painéis de estação (cozinha, balcão). */
.panel-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.panel-title { margin: 0; font-size: 1.1rem; font-weight: 700; }
.panel-meta { margin: 0; color: var(--muted); font-size: 0.9rem; }
.offline-bar { padding: 8px 16px; background: color-mix(in srgb, #c2410c 15%, transparent); color: #c2410c; font-size: 0.9rem; text-align: center; }
.call-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; padding: 16px; }
.call-card { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.call-card[data-status="PREPARING"] { border-color: var(--accent); }
.call-card[data-status="READY"] { border-color: var(--accent); border-width: 2px; }
.call-code { font-size: clamp(1.6rem, 6vw, 2.4rem); font-weight: 700; line-height: 1; }
.call-status { font-size: 0.85rem; color: var(--muted); }
.call-card[data-status="PREPARING"] .call-status,
.call-card[data-status="READY"] .call-status { color: var(--accent); font-weight: 600; }
.call-card[data-status="READY"] .call-status { font-weight: 700; }
.call-name { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-empty { padding: 48px 16px; text-align: center; color: var(--muted); }

/* Página pública do cliente. */
.customer-order { margin: 0 0 8px; font-size: 1.3rem; font-weight: 700; }
.customer-status { margin: 0; font-size: 1.1rem; color: var(--muted); }

/* Estações e aparelhos. */
.stack { display: grid; gap: 16px; }
.card h3 { margin: 8px 0 0; font-size: 1rem; }
.actions input[type="text"] { flex: 1 1 160px; width: auto; }
.checks { display: grid; gap: 4px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 400; margin: 0; }
.check input { width: 22px; min-height: 22px; height: 22px; flex: none; accent-color: var(--accent); }
.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: clamp(1.8rem, 9vw, 3rem); font-weight: 700; letter-spacing: 0.08em; }
.code-input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.4rem; letter-spacing: 0.08em; text-transform: uppercase; }
.hero .actions { margin-top: 20px; }
.guide-bar { width: 100%; height: 14px; accent-color: var(--accent); }
/* Faixa de nova versão (RFC-013) */
.w-update { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 10px 16px; background: var(--accent); color: var(--accent-text); font-weight: 700; }
.w-update button { min-height: 44px; padding: 0 16px; border: 2px solid currentColor; border-radius: 10px; background: transparent; color: inherit; font: inherit; font-weight: 800; cursor: pointer; }
.w-update button:disabled { opacity: 0.6; cursor: default; }

