:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #2b2118;
  background: #fff8ee;
  --card: #ffffff;
  --primary: #8a4b08;
  --primary-2: #b86c17;
  --muted: #74685e;
  --border: #eadfce;
  --ok: #146c43;
  --danger: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; background: #fff8ee; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity:.5; cursor:not-allowed; }
.hidden { display: none !important; }
.shell { max-width: 760px; margin: 0 auto; padding: 16px 14px 96px; }
.topbar { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:16px; }
.brand h1 { margin:0; font-size:1.35rem; }
.brand p { margin:.2rem 0 0; color:var(--muted); font-size:.9rem; }
.top-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:7px; max-width:260px; }
.card { background:var(--card); border:1px solid var(--border); border-radius:18px; padding:16px; box-shadow:0 6px 18px rgba(89,55,18,.06); margin-bottom:14px; }
.card h2, .card h3 { margin-top:0; }
label { display:block; font-weight:650; margin:12px 0 6px; }
input, select { width:100%; border:1px solid #d8c9b7; border-radius:12px; padding:12px; background:#fff; }
.primary, .secondary, .danger, .quick-btn { border:0; border-radius:12px; padding:12px 14px; font-weight:700; }
.primary { background:var(--primary); color:#fff; }
.secondary { background:#f3e7d6; color:#5f3507; }
.danger { background:#fff0ef; color:var(--danger); border:1px solid #f0c8c4; }
.compact { padding:7px 9px; }
.install { padding:7px 9px; background:#e8f6ef; color:var(--ok); }
.full { width:100%; }
.row { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.metric { padding:12px; border-radius:14px; background:#fffaf3; border:1px solid var(--border); }
.metric b { display:block; font-size:1.2rem; margin-top:3px; }
.metric small { display:block; color:var(--muted); margin-top:3px; }
.muted { color:var(--muted); }
.small { font-size:.88rem; }
.status { display:inline-flex; padding:5px 9px; border-radius:999px; background:#f2eadf; font-size:.8rem; font-weight:700; }
.status.open { color:var(--ok); background:#e8f6ef; }
.nav { position:fixed; left:50%; transform:translateX(-50%); bottom:10px; width:min(730px,calc(100% - 20px)); background:#fff; border:1px solid var(--border); border-radius:16px; padding:7px; display:grid; grid-template-columns:repeat(5,1fr); box-shadow:0 10px 28px rgba(48,31,14,.18); z-index:10; }
.nav button { border:0; background:transparent; padding:8px 2px; border-radius:10px; font-weight:700; color:#6f6257; font-size:.82rem; }
.nav button span { display:block; font-size:1.05rem; margin-bottom:1px; }
.nav button.active { background:#f3e7d6; color:#5f3507; }
.product { display:flex; justify-content:space-between; gap:10px; align-items:center; border:1px solid var(--border); border-radius:14px; padding:12px; margin-bottom:10px; }
.product-name { font-weight:800; }
.product small { display:block; color:var(--muted); margin-top:2px; }
.qty { display:flex; align-items:center; gap:8px; }
.qty button { width:38px; height:38px; border-radius:10px; border:0; background:#f3e7d6; font-weight:900; font-size:1.2rem; }
.qty span { min-width:24px; text-align:center; font-weight:800; }
.notice { padding:10px 12px; border-radius:12px; margin:10px 0; font-size:.9rem; }
.notice.error { color:var(--danger); background:#fff0ef; }
.notice.ok { color:var(--ok); background:#e8f6ef; }
.list { margin:0; padding:0; list-style:none; }
.list li { display:flex; justify-content:space-between; gap:10px; padding:9px 0; border-bottom:1px solid #f0e7dc; }
.list li:last-child { border-bottom:0; }
.login-wrap { min-height:100vh; display:grid; place-items:center; padding:16px; }
.login { width:min(430px,100%); }
.tabs > section { display:none; }
.tabs > section.active { display:block; }
hr { border:0; border-top:1px solid var(--border); margin:16px 0; }
.section-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.section-head h2 { margin-bottom:4px; }
.section-head p { margin:0; }
.range-select { width:auto; min-width:108px; padding:9px 10px; }
.report-row { margin:14px 0; }
.report-row:first-child { margin-top:4px; }
.report-line { display:flex; justify-content:space-between; gap:12px; align-items:baseline; margin-bottom:6px; }
.report-line strong { font-size:.95rem; }
.report-line span { color:var(--muted); font-size:.88rem; white-space:nowrap; }
.bar-track { height:9px; border-radius:999px; background:#f2e8dc; overflow:hidden; }
.bar-fill { height:100%; min-width:2px; border-radius:999px; background:linear-gradient(90deg,var(--primary),var(--primary-2)); }
.history-list { display:grid; gap:9px; }
.history-item { border:1px solid var(--border); border-radius:14px; padding:11px 12px; display:grid; grid-template-columns:1fr auto; gap:4px 12px; }
.history-date { font-weight:800; text-transform:capitalize; }
.history-sales { font-weight:800; text-align:right; }
.history-meta { color:var(--muted); font-size:.85rem; }
.history-profit { color:var(--ok); font-size:.85rem; text-align:right; }
.empty { color:var(--muted); padding:8px 0; }
@media (max-width:520px) {
  .row,.grid { grid-template-columns:1fr; }
  .topbar { align-items:flex-start; }
  .section-head { align-items:stretch; }
  .range-select { min-width:96px; }
  .nav button { font-size:.72rem; }
}

/* v0.3: reapertura y anulaciones */
.sales-list { display:grid; gap:9px; }
.sale-history { border:1px solid var(--border); border-radius:14px; padding:11px 12px; display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.sale-history-main { min-width:0; }
.sale-history-side { display:flex; flex-direction:column; align-items:flex-end; gap:8px; white-space:nowrap; }
.sale-time { color:var(--muted); font-size:.82rem; font-weight:500; margin-left:5px; }
.sale-items { margin-top:4px; font-size:.9rem; }
.sale-meta { margin-top:3px; color:var(--muted); font-size:.82rem; }
.sale-void-reason { margin-top:5px; color:var(--danger); font-size:.82rem; }
.sale-history.voided { opacity:.72; background:#faf6f2; }
.sale-history.voided .sale-history-side > strong { text-decoration:line-through; }
#closedDayInfo { margin:12px 0 16px; }
@media (max-width:520px) {
  .sale-history { align-items:stretch; }
  .sale-history-side { min-width:105px; }
}
