/* engine-base · shell mobile-first. Los colores salen de palettes.json (--primary, --accent, --m). */
:root {
  --primary: #0B1A2E;
  --accent: #2F9BFF;
  --m: #FFB000;
  --ink: #18212e;
  --muted: #6b7684;
  --line: #e2e6ec;
  --bg: #f4f6f9;
  --card: #fff;
  --ok: #1f9d55;
  --bad: #d64545;
  --warn: #e0a100;
  --gold: #b8963e;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); font-size: 16px; padding-bottom: 84px; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
h2, h3 { margin: 4px 0 12px; color: var(--primary); }
h2 { font-size: 1.4rem; } h3 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.err { color: var(--bad); min-height: 1.2em; margin: 6px 0; font-size: .92rem; }

/* Encabezado */
.top { background: var(--primary); color: #fff; padding: 12px 16px 10px; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 10px #0003; border-bottom: 3px solid var(--accent); }
.brand { text-align: center; }
.logo { font-size: 1.5rem; font-weight: 800; letter-spacing: 5px; }
.logo .m { color: var(--m); }
.sub { font-size: .75rem; letter-spacing: 1.5px; text-transform: uppercase; opacity: .8; margin-top: 2px; }
.badge-env { position: absolute; right: 10px; top: 10px; background: var(--warn); color: #000; font-size: .65rem; font-weight: 800; padding: 3px 7px; border-radius: 6px; letter-spacing: 1px; }

/* Navegación inferior */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px #0001; }
.tabs button { flex: 1; background: none; border: 0; padding: 9px 2px 10px; color: var(--muted); font-size: .72rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 58px; }
.tabs i { font-style: normal; font-size: 1.35rem; line-height: 1; }
.tabs button.on { color: var(--primary); font-weight: 700; box-shadow: inset 0 3px 0 var(--accent); }

main { max-width: 880px; margin: 0 auto; padding: 14px 12px 12px; }
.view { animation: fade .15s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Tarjetas y filas */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; box-shadow: 0 1px 3px #0000000d; }
.pad { padding: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.list { display: flex; flex-direction: column; }
.item { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .t { font-weight: 600; }
.item .s { font-size: .85rem; color: var(--muted); }
.chip { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: #eef2f7; color: var(--ink); }
.chip.ok { background: #e3f6ea; color: var(--ok); } .chip.bad { background: #fdeaea; color: var(--bad); } .chip.warn { background: #fff4d6; color: #8a6400; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.big-icon { font-size: 2.6rem; margin: 6px 0; }

/* Controles: botones grandes */
label { display: block; font-size: .85rem; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
textarea { min-height: 90px; resize: vertical; }
input.pin { -webkit-text-security: disc; text-security: disc; letter-spacing: 6px; font-size: 1.2rem; text-align: center; }
.btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 11px 16px; border-radius: 10px; cursor: pointer; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn.big { width: 100%; font-size: 1.05rem; margin-top: 8px; min-height: 52px; }
.btn.small { min-height: 36px; padding: 6px 10px; font-size: .88rem; }
.btn:disabled { opacity: .5; cursor: default; }
.login { max-width: 380px; margin: 30px auto; }
.fab { position: fixed; right: 16px; bottom: 76px; z-index: 25; background: var(--accent); color: #fff; border: 0; border-radius: 99px; padding: 14px 20px; font-weight: 700; font-size: 1rem; box-shadow: 0 4px 14px #0004; cursor: pointer; }

/* Ajustes: menú */
.menu .item { cursor: pointer; }
.menu .item i { font-style: normal; font-size: 1.3rem; width: 30px; text-align: center; }
.menu .item::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 1.3rem; }
.back { margin-bottom: 8px; }

/* Modal, bloqueo y aviso */
.overlay { position: fixed; inset: 0; background: #0b1a2ecc; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.overlay .card { width: 100%; max-width: 420px; max-height: 92vh; overflow: auto; text-align: left; }
#lock .card { text-align: center; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; }
.modal-actions .btn { flex: 1; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; background: #1d2633; color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 70; max-width: 90vw; box-shadow: 0 4px 14px #0005; }
.toast.bad { background: var(--bad); }

/* Pie: versión visible */
.foot { text-align: center; font-size: .72rem; color: var(--muted); padding: 6px 0 14px; }
.foot .credit { color: var(--gold); }

/* Tablas simples */
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 600; }
.scroll { overflow-x: auto; }

#printArea { display: none; }

@media (min-width: 760px) {
  body { padding-bottom: 20px; }
  .tabs { position: sticky; top: 64px; bottom: auto; max-width: 880px; margin: 0 auto; border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
  .fab { bottom: 24px; }
}
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; opacity: .7; text-decoration: underline; cursor: pointer; }
