:root {
  --bg: #f4f5f7; --card: #fff; --txt: #1d2330; --muted: #6b7280; --borde: #dfe3ea;
  --acento: #1f6f43; --acento-txt: #fff; --alerta: #b45309; --error: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171c; --card: #1d222a; --txt: #e8eaee; --muted: #9aa3b2; --borde: #2c333d;
          --acento: #3fa56b; --acento-txt: #08130c; --alerta: #f0a35a; --error: #f08a8a; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--txt); font: 16px/1.4 system-ui, sans-serif; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px;
       padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--borde); }
.marca { font-weight: 700; } .marca span { font-weight: 400; color: var(--muted); }
.quien { font-size: 14px; color: var(--muted); text-align: right; }
.tabs { display: flex; background: var(--card); border-bottom: 1px solid var(--borde); overflow-x: auto; }
.tabs button { flex: 1; padding: 12px 8px; background: none; border: 0; border-bottom: 3px solid transparent;
               color: var(--muted); font: inherit; white-space: nowrap; cursor: pointer; }
.tabs button.act { color: var(--txt); border-bottom-color: var(--acento); font-weight: 600; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h2 { margin: 0 0 12px; font-size: 18px; }
.card { background: var(--card); border: 1px solid var(--borde); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.aviso { color: var(--muted); } .error { color: var(--error); } .alerta { color: var(--alerta); }
input, select, textarea { width: 100%; padding: 10px; font: inherit; color: var(--txt); background: var(--bg);
                          border: 1px solid var(--borde); border-radius: 8px; }
label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
label.chk { display: flex; align-items: center; gap: 8px; color: var(--txt); font-size: 16px; }
label.chk input { width: auto; }
button.pri, button.sec { padding: 10px 16px; font: inherit; border-radius: 8px; border: 1px solid var(--acento); cursor: pointer; }
button.pri { background: var(--acento); color: var(--acento-txt); }
button.sec { background: none; color: var(--acento); }
button:disabled { opacity: .5; cursor: default; }
.fila { display: flex; gap: 10px; align-items: center; }
.fila > .crece { flex: 1; min-width: 0; }
.fam { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.art { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--borde); }
.art:last-child { border-bottom: 0; }
.art .det { flex: 1; min-width: 0; }
.art .desc { font-weight: 500; }
.precios { font-size: 14px; color: var(--muted); }
.precios b { color: var(--txt); }
.cant { width: 76px; text-align: center; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 6px 4px; border-bottom: 1px solid var(--borde); text-align: right; }
th:first-child, td:first-child { text-align: left; }
tfoot td { font-weight: 600; border-bottom: 0; }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--acento);
         color: var(--acento-txt); font-size: 12px; }
.est { font-size: 12px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--borde); color: var(--muted); }
.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 480px; margin: 0 auto; padding: 12px 16px;
         background: var(--txt); color: var(--bg); border-radius: 10px; text-align: center; }
