:root { --bg:#f6f7f6; --card:#fff; --ink:#1b1f1c; --muted:#5f6b63; --line:#d9dfda; --accent:#1f5c3a; --warn:#b45309; --danger:#b42318; }
@media (prefers-color-scheme: dark) { :root { --bg:#121513; --card:#1b201d; --ink:#e8ece9; --muted:#9aa89f; --line:#2c342f; --accent:#4cae7a; --warn:#f59e0b; --danger:#f97066; } }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--ink); font:16px/1.4 system-ui,-apple-system,"Segoe UI",Arial,sans-serif; }
nav { position:sticky; top:0; z-index:5; display:flex; background:var(--card); border-bottom:1px solid var(--line); }
nav button { flex:1; border:0; background:none; color:var(--muted); padding:14px 8px; font:inherit; font-weight:600; border-bottom:3px solid transparent; cursor:pointer; }
nav button.on { color:var(--accent); border-bottom-color:var(--accent); }
main { max-width:960px; margin:0 auto; padding:16px 16px 48px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:12px; margin:12px 0; }
.row { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.wrap { flex-wrap:wrap; }
.right { text-align:right; }
.muted { color:var(--muted); font-size:.9rem; }
.note { color:var(--muted); font-size:.82rem; margin:-4px 0 12px; }
.warn { color:var(--warn); font-size:.88rem; margin-top:6px; }
.tag { font-size:.7rem; font-weight:600; background:var(--line); border-radius:99px; padding:2px 8px; vertical-align:middle; }
.total { display:flex; justify-content:space-between; font-size:1.05rem; }
.bar { display:flex; gap:8px; align-items:center; }
.bar input { flex:1; min-width:0; }
.grid3 { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:8px; }
.grid2 { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:8px; margin-bottom:8px; }
label { display:flex; flex-direction:column; gap:4px; font-size:.82rem; color:var(--muted); }
label.inline { flex-direction:row; align-items:center; gap:8px; font-size:.9rem; }
input, select, button, .btn { font:inherit; color:var(--ink); background:var(--card); border:1px solid var(--line); border-radius:8px; padding:9px 10px; min-height:42px; }
input[type=checkbox] { min-height:0; width:18px; height:18px; }
button, .btn { cursor:pointer; font-weight:600; }
button.primary { width:100%; background:var(--accent); border-color:var(--accent); color:#fff; margin:8px 0; }
button.danger { color:var(--danger); }
.scroll { overflow-x:auto; margin:12px 0; border:1px solid var(--line); border-radius:10px; background:var(--card); }
table { border-collapse:collapse; width:100%; font-size:.88rem; }
th, td { padding:8px 10px; text-align:right; white-space:nowrap; border-bottom:1px solid var(--line); }
th { color:var(--muted); font-weight:600; }
.name { text-align:left; position:sticky; left:0; background:var(--card); }
tfoot td { font-weight:700; border-bottom:0; }
input.money { width:90px; min-height:34px; padding:4px 6px; text-align:right; }
.printonly { display:none; }
textarea { width:100%; font:inherit; color:var(--ink); background:var(--card); border:1px solid var(--line); border-radius:8px; padding:9px 10px; margin-bottom:8px; }
summary { cursor:pointer; } .errs { color:var(--warn); font-size:.88rem; padding-left:18px; }
#toast { position:fixed; left:50%; bottom:20px; transform:translateX(-50%); background:var(--ink); color:var(--bg); padding:10px 16px; border-radius:99px; opacity:0; pointer-events:none; transition:opacity .2s; max-width:90vw; }
#toast.show { opacity:1; }
.seg { display:flex; gap:0; margin-bottom:4px; }
.seg button { flex:1; border-radius:0; } .seg button:first-child { border-radius:8px 0 0 8px; } .seg button:last-child { border-radius:0 8px 8px 0; }
.seg button.on { background:var(--accent); border-color:var(--accent); color:#fff; }
.badge { font-size:.75rem; font-weight:700; padding:2px 10px; border-radius:99px; border:1px solid var(--line); }
.badge.pagado { color:var(--accent); border-color:var(--accent); } .badge.vencido { color:var(--danger); border-color:var(--danger); } .badge.pendiente { color:var(--warn); border-color:var(--warn); }
.warnt { color:var(--danger); font-weight:600; }
@media print {
  .noprint { display:none !important; } .printonly { display:table-cell !important; }
  body { background:#fff; color:#000; } .scroll { border:0; overflow:visible; } th,td { color:#000; }
}
