/* Carta NFC — estilos compartidos (cliente, cocina, admin, alta) */
:root {
  --brand: #b45309;
  --brand-ink: #ffffff;
  --bg: #f7f4ef;
  --surface: #ffffff;
  --surface-2: #f1ece4;
  --text: #1f1a14;
  --muted: #6f6559;
  --line: #e4ddd2;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --info: #1d4ed8;
  --shadow: 0 1px 2px rgba(31, 26, 20, .06), 0 6px 20px rgba(31, 26, 20, .07);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120f; --surface: #1f1b17; --surface-2: #2a2520; --text: #f3ede4; --muted: #b3a797;
    --line: #3a332c; --ok: #4ade80; --warn: #fbbf24; --danger: #f87171; --info: #93c5fd;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15120f; --surface: #1f1b17; --surface-2: #2a2520; --text: #f3ede4; --muted: #b3a797;
  --line: #3a332c; --ok: #4ade80; --warn: #fbbf24; --danger: #f87171; --info: #93c5fd;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--text);
  transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 6px 10px; font-size: 14px; border-radius: 10px; }
.btn.ghost { background: transparent; }

input[type=text], input[type=number], input[type=password], input[type=url], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
textarea { min-height: 70px; resize: vertical; }
label.field { display: block; margin: 12px 0; font-size: 14px; font-weight: 600; }
label.field > span { display: block; margin-bottom: 6px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 32px; cursor: pointer; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.chip.brand { background: var(--brand); color: var(--brand-ink); }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600;
  max-width: calc(100% - 32px); text-align: center; pointer-events: none; transition: all .2s ease; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); color: #fff; }

dialog {
  border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--text);
  width: min(560px, calc(100% - 24px)); max-height: calc(100% - 24px); box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
dialog::backdrop { background: rgba(15, 10, 5, .5); }
dialog .dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
dialog .dlg-body { padding: 16px 18px; overflow: auto; max-height: 65vh; }
dialog .dlg-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.x { border: 0; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; padding: 4px 8px; color: var(--muted); }

.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.center-page .card { padding: 28px 24px; max-width: 420px; width: 100%; text-align: center; }

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px;
  font-weight: 600; white-space: nowrap; cursor: pointer; font-size: 14px;
}
.tab[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.alergenos { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.alergeno { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
