/* VisionQuantech App 02 — Dues Tracker. Mobile-first, offline-capable.
 * Same design language as App 01 (GST Billing). */
:root {
  --bg: #f4f6fb; --card: #ffffff; --ink: #1a2333; --muted: #6b7686;
  --brand: #0d7a3f; --brand-d: #0a5f31; --ok: #047857; --warn: #b45309;
  --bad: #b91c1c; --line: #e3e8f0; --radius: 12px; --wa: #1da851;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45;
  max-width: 720px; margin: 0 auto; min-height: 100vh; padding-bottom: 84px;
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand); color: #fff; padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.topbar .logo { font-weight: 800; font-size: 17px; letter-spacing: .3px; }
.topbar .sub { font-size: 11px; opacity: .85; }
.topbar .net { margin-left: auto; font-size: 11px; padding: 3px 10px; border-radius: 20px; background: rgba(255,255,255,.2); }
.topbar .net.off { background: #b45309; }
.nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 720px; background: var(--card);
  border-top: 1px solid var(--line); display: flex; z-index: 20;
}
.nav button {
  flex: 1; border: 0; background: none; padding: 10px 4px 12px;
  font-size: 11px; color: var(--muted); cursor: pointer;
}
.nav button .ic { font-size: 20px; display: block; }
.nav button.active { color: var(--brand); font-weight: 700; }
.view { display: none; padding: 14px 14px 20px; }
.view.active { display: block; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(20,30,60,.05);
}
.card h3 { margin: 0 0 10px; font-size: 15px; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0; }
.hint-inline { font-size: 11px; color: var(--muted); font-weight: 400; }
.err { color: var(--bad); font-size: 12px; margin: 4px 0; }
.okmsg { color: var(--ok); font-size: 13px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 10px 12px; font-size: 15px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink); font-family: inherit;
}
input[type="file"] { padding: 8px; font-size: 13px; }
textarea { resize: vertical; }
.btn {
  display: inline-block; width: 100%; padding: 12px; margin-top: 12px;
  background: var(--brand); color: #fff; border: 0; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.btn:active { background: var(--brand-d); }
.btn.ghost { background: #eef2f7; color: var(--ink); font-weight: 600; }
.btn.danger { background: var(--bad); }
.btn.wa { background: var(--wa); }
.rowbtns { display: flex; gap: 8px; }
.rowbtns .btn, .rowbtns select { margin-top: 8px; }
.linkbtn { background: none; border: 0; color: var(--brand); font-size: 14px; font-weight: 700; cursor: pointer; padding: 6px 0 10px; }
/* dashboard */
.hero { background: linear-gradient(135deg, #0d7a3f, #12a356); color: #fff; border: 0; }
.hero-label { font-size: 12px; opacity: .85; }
.hero-amt { font-size: 34px; font-weight: 800; margin: 4px 0; }
.hero-sub { font-size: 12px; opacity: .9; }
.buckets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.bucket { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.bucket .bl { font-size: 11px; color: var(--muted); font-weight: 700; }
.bucket .bv { font-size: 17px; font-weight: 800; margin-top: 2px; }
.bucket.b-90 .bv { color: var(--bad); }
.bucket.b-6190 .bv { color: var(--warn); }
/* lists */
.cust { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 8px; background: #fff; cursor: pointer; }
.cust .nm { font-weight: 700; font-size: 15px; }
.cust .amt { font-weight: 800; font-size: 17px; color: var(--bad); margin-top: 2px; }
.cust .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.flag { display: inline-block; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 12px; margin: 2px 4px 0 0; }
.flag.risk { background: #fee2e2; color: #b91c1c; }
.flag.watch { background: #fef3c7; color: #b45309; }
.flag.nocontact { background: #e0e7ff; color: #3730a3; }
.pri { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.pri .rank { font-size: 20px; font-weight: 800; color: var(--brand); min-width: 30px; text-align: center; }
.pri .pnm { font-weight: 700; }
.pri .pmeta { font-size: 12px; color: var(--muted); }
.pri .pamt { margin-left: auto; font-weight: 800; color: var(--bad); white-space: nowrap; }
/* detail */
.duerow { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.duerow .dr-top { display: flex; justify-content: space-between; align-items: baseline; }
.duerow .dr-amt { font-weight: 800; }
.duerow .dr-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.badge { display: inline-block; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 12px; background: #eef2f7; color: var(--muted); }
.badge.od30 { background: #fef3c7; color: #b45309; }
.badge.od60 { background: #ffedd5; color: #c2410c; }
.badge.od90 { background: #fee2e2; color: #b91c1c; }
.badge.up { background: #dcfce7; color: #047857; }
.payrow { font-size: 13px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.payrow:last-child { border-bottom: 0; }
/* modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(10,20,40,.55); z-index: 50; padding: 20px 14px; overflow-y: auto; }
.modal.open { display: block; }
.modal-card { background: #fff; border-radius: 14px; padding: 16px; max-width: 520px; margin: 6vh auto; }
.modal-card h3 { margin-top: 0; }
.preview { background: #f8fafc; border: 1px dashed var(--line); border-radius: 10px; padding: 12px; font-size: 13px; white-space: pre-wrap; }
.actionbar { display: flex; gap: 8px; margin-top: 10px; }
.actionbar .btn { margin-top: 0; font-size: 13px; padding: 10px 6px; }
.empty { text-align: center; padding: 26px 10px; color: var(--muted); }
.empty .big { font-size: 34px; display: block; margin-bottom: 6px; }
