/* VisionQuantech App 01 — GST Billing. Mobile-first, offline-capable. */
:root {
  --bg: #f4f6fb; --card: #ffffff; --ink: #1a2333; --muted: #6b7686;
  --brand: #1d4ed8; --brand-d: #1e40af; --ok: #047857; --warn: #b45309;
  --bad: #b91c1c; --line: #e3e8f0; --radius: 12px;
}
* { 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;
}
/* top bar */
.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 */
.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; }
/* layout */
.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; }
.err { color: var(--bad); font-size: 12px; margin: 4px 0; }
.okmsg { color: var(--ok); font-size: 13px; }
/* forms */
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);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
input.bad, select.bad { border-color: var(--bad); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
/* buttons */
.btn {
  display: inline-block; border: 0; border-radius: 10px; padding: 12px 18px;
  font-size: 15px; font-weight: 700; cursor: pointer; background: var(--brand); color: #fff;
  width: 100%; margin-top: 12px;
}
.btn:active { background: var(--brand-d); }
.btn.sec { background: #e8eefc; color: var(--brand); }
.btn.ghost { background: none; color: var(--brand); border: 1px dashed var(--brand); }
.btn.danger { background: var(--bad); }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; margin-top: 8px; }
.btnrow { display: flex; gap: 8px; } .btnrow .btn { margin-top: 8px; }
/* invoice list */
.inv { padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.inv:last-child { border-bottom: 0; }
.inv .no { font-weight: 700; }
.inv .meta { font-size: 12px; color: var(--muted); }
.inv .amt { font-weight: 700; color: var(--brand); float: right; }
/* tables */
table.tax { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
table.tax th, table.tax td { border: 1px solid var(--line); padding: 6px 8px; text-align: right; }
table.tax th:first-child, table.tax td:first-child { text-align: left; }
table.tax th { background: #eef2fa; }
/* items */
.itembox { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; position: relative; }
.itembox .rm { position: absolute; top: 6px; right: 6px; border: 0; background: none; color: var(--bad); font-size: 18px; cursor: pointer; }
.suggest { border: 1px solid var(--line); border-radius: 8px; max-height: 180px; overflow: auto; margin-top: 4px; background: #fff; }
.suggest div { padding: 8px 10px; font-size: 13px; border-bottom: 1px solid var(--line); cursor: pointer; }
.suggest div:last-child { border-bottom: 0; }
.suggest div:hover, .suggest div:focus { background: #eef2fa; }
.suggest .rate { color: var(--ok); font-weight: 700; }
/* summary strip */
.sumgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat .v { font-size: 19px; font-weight: 800; }
.stat .l { font-size: 11px; color: var(--muted); }
/* invoice preview */
.invhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.badge { display: inline-block; font-size: 11px; padding: 3px 10px; border-radius: 20px; background: #e8eefc; color: var(--brand); font-weight: 700; }
.badge.igst { background: #fef3c7; color: #92400e; }
.words { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 8px; }
/* plan */
.plan { border: 2px solid var(--brand); border-radius: var(--radius); padding: 16px; background: #fff; }
.plan .price { font-size: 30px; font-weight: 800; color: var(--brand); }
.plan ul { padding-left: 18px; font-size: 14px; }
.pend { background: #fef3c7; border: 1px solid #f59e0b; border-radius: 8px; padding: 10px; font-size: 13px; margin-top: 10px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }
.search { margin-bottom: 10px; }
.kv { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.kv b { font-weight: 700; }
pre.json { background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 8px; font-size: 11px; overflow: auto; max-height: 320px; white-space: pre-wrap; word-break: break-all; }
@media (min-width: 600px) { .row3 { grid-template-columns: 1fr 1fr 1fr; } }
