/* ============================================================
   Pedidos (MME) — Base: tokens, tipografía, botones, formularios, badges.
   Paleta sacada del logo de Presto!: rojo Presto, queso, albahaca.
   Los colores de marca (--brand, --accent) los sobreescribe cada tienda.
   ============================================================ */
:root {
  --brand: #CC1B26;
  --brand-600: #A7161F;
  --accent: #FFC93C;
  --basil: #1E8449;
  --basil-50: #E8F5EC;
  --amber: #B45309;
  --amber-50: #FEF3C7;
  --info: #1D4ED8;
  --info-50: #E0E7FF;
  --ink: #1C1917;
  --ink-2: #44403C;
  --muted: #6B6560;
  --line: #E7E5E4;
  --bg: #FFFFFF;
  --bg-2: #F5F5F4;
  --surface: #FFFFFF;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(28, 25, 23, .06), 0 8px 24px rgba(28, 25, 23, .08);
  --shadow-lg: 0 12px 40px rgba(28, 25, 23, .18);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Baloo 2", "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--ink); background: var(--bg-2);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-600); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 .8em; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font: 600 15px/1.2 var(--font);
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { border-color: #D6D3D1; background: #FAFAF9; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-ok { background: var(--basil); border-color: var(--basil); color: #fff; }
.btn-ok:hover { filter: brightness(.94); background: var(--basil); }
.btn-wa { background: #1FA855; border-color: #1FA855; color: #fff; }
.btn-wa:hover { background: #178D47; border-color: #178D47; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(28, 25, 23, .06); border-color: transparent; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn-lg { min-height: 54px; padding: 14px 24px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-danger { color: #9F1239; border-color: #FECDD3; }
.btn-danger:hover { background: #FFF1F2; border-color: #FDA4AF; }
form.inline { display: inline; margin: 0; }

/* ---------- Formularios ---------- */
label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; color: var(--ink-2); }
.field { margin-bottom: 14px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number],
input[type=search], input[type=url], input[type=date], input[type=time], input[type=color], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font: 15px/1.3 var(--font); color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
input[type=color] { padding: 4px; width: 64px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.row-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.row-3 { display: grid; gap: 12px; grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 560px) { .row-2, .row-3 { grid-template-columns: 1fr; } }

/* ---------- Avisos ---------- */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin: 0 0 14px; font-weight: 500; border: 1px solid transparent; }
.alert-ok { background: var(--basil-50); color: #14532D; border-color: #BBE5C8; }
.alert-err { background: #FFF1F2; color: #9F1239; border-color: #FECDD3; }
.alert-warn { background: var(--amber-50); color: #78350F; border-color: #FDE68A; }
.alert-info { background: var(--info-50); color: #1E3A8A; border-color: #C7D2FE; }

/* ---------- Badges de estado ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-pending { background: var(--amber-50); color: var(--amber); }
.st-confirmed { background: #F1F5F9; color: #334155; }
.st-preparing { background: var(--info-50); color: var(--info); }
.st-oven { background: #FFEDD5; color: #C2410C; }
.st-ready { background: var(--basil-50); color: var(--basil); }
.st-out { background: #EDE9FE; color: #6D28D9; }
.st-delivered { background: #F5F5F4; color: #57534E; }
.st-cancelled { background: #F5F5F4; color: #A8A29E; text-decoration: line-through; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: #F5F5F4; color: var(--ink-2); }
.ch-ifood { background: #EA1D2C; color: #fff; }
.ch-99food { background: #FFDD00; color: #1C1917; }
.ch-whatsapp { background: #DCFCE7; color: #166534; }
.ch-web { background: #FEE2E2; color: var(--brand-600); }
.ch-counter, .ch-phone { background: #E7E5E4; color: var(--ink-2); }
.pay-pending { color: var(--amber); font-weight: 700; }
.pay-paid { color: var(--basil); font-weight: 700; }

/* ---------- Tarjetas y tablas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h h2, .card-h h3 { margin: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.off td { color: #A8A29E; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

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