:root {
  --nav: #0d2b5c; --nav2: #0a2350; --nav-ink: #dbe4f3; --nav-active: #133b78; --accent: #1f6fd1; --accent-ink: #fff;
  --bg: #f2f4f8; --card: #fff; --ink: #1d2533; --muted: #6b7587; --line: #e2e6ee; --line2: #eef1f6;
  --green: #148a55; --green-bg: #e5f5ed; --red: #c4321c; --red-bg: #fcebe7; --amber: #a86400; --amber-bg: #fdf3df;
  --blue: #1f5fbf; --blue-bg: #e7eefb; --purple: #6b3fc2; --purple-bg: #f0eafb; --teal: #0f7d79; --teal-bg: #e2f4f3;
  --radius: 10px; --sidebar: 250px; --top: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14.5px/1.5 "Segoe UI", Roboto, "Noto Sans Bengali", "Nirmala UI", "SolaimanLipi", "Hind Siliguri", system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-height: 38px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 111, 209, .15); }
input[type=checkbox] { width: 17px; height: 17px; min-height: 0; padding: 0; accent-color: var(--accent); vertical-align: middle; }
input:disabled, input[readonly] { background: #f6f7fa; }
textarea { resize: vertical; font-family: ui-monospace, Consolas, monospace; }
code { font-size: 12.5px; background: var(--line2); padding: 1px 6px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.neg { color: var(--red); } .pos { color: var(--green); }
.money, .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.print-only { display: none; }

/* ---------- shell ---------- */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--top); z-index: 30; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; min-width: 0; }
.brand .cname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo, .login-logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #c2185b, #5e35b1 55%, var(--nav)); color: #fff; font-weight: 700; flex: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.user-chip { position: relative; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.user-chip:hover { background: var(--line2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--nav); color: #fff; display: grid; place-items: center; font-weight: 600; }
.uname { display: flex; flex-direction: column; line-height: 1.2; }
.uname small { color: var(--muted); }
.dropdown { position: absolute; right: 0; top: 44px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 200px; padding: 6px; z-index: 40; }
.dropdown button { display: flex; gap: 8px; align-items: center; width: 100%; border: 0; background: none; padding: 9px 10px; text-align: left; cursor: pointer; border-radius: 6px; }
.dropdown button:hover { background: var(--line2); }
.icon-btn { border: 0; background: none; cursor: pointer; padding: 8px; border-radius: 8px; display: grid; place-items: center; font-size: 17px; color: var(--muted); }
.icon-btn:hover { background: var(--line2); }
.menu-btn { display: none; }

.sidebar { position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--sidebar); z-index: 25; overflow-y: auto; background: linear-gradient(180deg, var(--nav), var(--nav2)); border-left: 6px solid transparent; border-image: linear-gradient(180deg, #d81b60, #8e24aa, #5e35b1) 1; }
.sidebar nav { padding: 6px 0 30px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; border: 0; background: none; color: var(--nav-ink); font-size: 14px; cursor: pointer; text-align: left; text-decoration: none !important; }
.nav-item svg { flex: none; font-size: 14px; opacity: .9; }
.nav-item span { flex: 1; }
.nav-item .chev { font-size: 10px; opacity: .7; transition: transform .15s; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active, .nav-item.in { background: var(--nav-active); color: #fff; }
.nav-group.open > .nav-item .chev { transform: rotate(-90deg); }
.nav-item.soon { opacity: .55; }
.nav-sub { background: rgba(0,0,0,.18); padding: 4px 0; }
.nav-sub a { display: block; padding: 8px 16px 8px 44px; color: #b9c6dd; font-size: 13.5px; text-decoration: none; }
.nav-sub a:hover { color: #fff; }
.nav-sub a.active { color: #fff; font-weight: 600; background: rgba(255,255,255,.07); box-shadow: inset 3px 0 0 #64a6ff; }
.content { margin-left: var(--sidebar); padding: calc(var(--top) + 18px) 22px 40px; min-height: 100vh; }
.scrim { position: fixed; inset: 0; background: rgba(10, 20, 40, .4); z-index: 20; }

/* ---------- components ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line2); gap: 8px; }
.card-head h3 { font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 500; white-space: nowrap; min-height: 38px; }
.btn:hover { border-color: #c7cfdc; background: #fafbfd; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #185fb6; }
.btn.danger { color: var(--red); }
.btn.primary.danger, .modal-foot .btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { border-color: transparent; background: none; padding: 6px 8px; min-height: 32px; color: var(--muted); }
.btn.ghost:hover { background: var(--line2); color: var(--ink); }
.btn.ghost.danger:hover { color: var(--red); background: var(--red-bg); }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.big { padding: 12px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; margin-top: 10px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--line2); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.badge.green { background: var(--green-bg); color: var(--green); } .badge.red { background: var(--red-bg); color: var(--red); }
.badge.blue { background: var(--blue-bg); color: var(--blue); } .badge.warn { background: var(--amber-bg); color: var(--amber); }
.badge.purple { background: var(--purple-bg); color: var(--purple); }
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.alert.err { background: var(--red-bg); color: var(--red); } .alert.warn { background: var(--amber-bg); color: var(--amber); }
.loading, .empty { padding: 28px; text-align: center; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-width: 0; }
.field .lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field .req { color: var(--red); }
.field .hint { font-size: 12px; color: var(--muted); }
.field.end { justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 6px 0 10px; }
.input-add { display: flex; gap: 6px; }
.input-add .btn { flex: none; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters > * { flex: 0 1 auto; }
.filters.in-card { margin: 0; align-items: flex-end; }
.filters.in-card .field { margin: 0; min-width: 160px; }
.filters select { width: auto; min-width: 170px; }
.search-box { position: relative; display: flex; align-items: center; min-width: 220px; flex: 1 1 240px; max-width: 420px; }
.search-box svg { position: absolute; left: 11px; color: var(--muted); font-size: 13px; }
.search-box input { padding-left: 32px; }
.search-box.big { max-width: none; }
.search-box.big input { min-height: 44px; font-size: 15px; }
.date-range { display: flex; align-items: center; gap: 6px; }
.date-range input { width: 150px; }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--blue-bg); color: var(--blue); padding: 2px 8px; border-radius: 6px; font-size: 12.5px; margin: 2px; font-family: ui-monospace, Consolas, monospace; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 2px; font-weight: 700; }
.chips, .perm-chips { display: flex; flex-wrap: wrap; gap: 2px; }
.perm-chips .chip { font-family: inherit; background: var(--line2); color: var(--ink); }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 10px 12px; background: #f8f9fc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tfoot td { background: #f8f9fc; border-top: 1px solid var(--line); }
.tbl tr.clickable { cursor: pointer; } .tbl tr.clickable:hover td { background: #f7faff; }
.tbl .r { text-align: right; } .tbl .c { text-align: center; }
.tbl tbody tr:last-child td { border-bottom: 0; }

.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(13, 25, 48, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 14px; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 520px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line2); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 16px 18px; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line2); }
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1d2533; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 360px; }
.toast.err { background: var(--red); }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, var(--nav) 0%, #3a2a7a 60%, #8e1e5c 100%); }
.login-card { background: #fff; width: 100%; max-width: 380px; border-radius: 14px; padding: 30px 28px; box-shadow: 0 24px 60px rgba(0,0,0,.3); text-align: center; }
.login-card .login-logo { width: 52px; height: 52px; font-size: 26px; border-radius: 12px; margin-bottom: 10px; }
.login-card .field { text-align: left; }
.login-card .btn { margin-top: 6px; min-height: 44px; }

/* ---------- dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat.clickable { cursor: pointer; } .stat.clickable:hover { border-color: #c7cfdc; }
.stat-ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none; background: var(--line2); color: var(--muted); }
.stat.teal .stat-ic { background: var(--teal-bg); color: var(--teal); } .stat.green .stat-ic { background: var(--green-bg); color: var(--green); }
.stat.blue .stat-ic { background: var(--blue-bg); color: var(--blue); } .stat.purple .stat-ic { background: var(--purple-bg); color: var(--purple); }
.stat.amber .stat-ic { background: var(--amber-bg); color: var(--amber); } .stat.red .stat-ic { background: var(--red-bg); color: var(--red); }
.stat-l { font-size: 12.5px; color: var(--muted); }
.stat-v { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 210px; padding-top: 16px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar { width: 100%; max-width: 30px; background: linear-gradient(180deg, #3d8bef, var(--accent)); border-radius: 4px 4px 0 0; }
.bar-val { font-size: 10px; color: var(--muted); margin-bottom: 2px; white-space: nowrap; }
.bar-lbl { font-size: 10.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; }

/* ---------- purchase / POS ---------- */
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); max-height: 340px; overflow-y: auto; }
.ac-item { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line2); }
.ac-item.hi, .ac-item:hover { background: var(--blue-bg); }
.ac-stock { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.lines { margin-top: 12px; }
.line { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: #fcfdff; }
.line-main { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.line-name { flex: 1 1 220px; padding-bottom: 12px; }
.line-nums { display: flex; gap: 8px; align-items: flex-end; }
.line-nums .field { width: 110px; margin-bottom: 0; }
.line-total { min-width: 110px; text-align: right; font-weight: 700; padding-bottom: 9px; }
.line .field textarea { margin-top: 2px; }
.sn-row { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.sn-row .btn { margin-left: auto; }
.sn-pick { margin-top: 10px; max-height: 340px; overflow-y: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.sn-pick label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.sn-pick label.on { border-color: var(--accent); background: var(--blue-bg); }
.totals-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
.totals > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; }
.totals > div input { width: 140px; text-align: right; }
.totals .gt { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 18px; font-weight: 700; padding: 9px 0; margin: 4px 0; }
.totals .btn { margin-top: 10px; }
.pos-change { color: var(--green); font-weight: 700; }
.pos { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
.pos-right { position: sticky; top: calc(var(--top) + 14px); }
.pos-search { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }

/* ---------- invoice ---------- */
.invoice { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; max-width: 860px; }
.inv-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 12px; }
.inv-head h2 { font-size: 22px; }
.inv-title { text-align: right; }
.inv-title h3 { font-size: 18px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.inv-to { margin-bottom: 12px; }
.inv-tbl { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.inv-tbl th { background: #f2f4f8; text-align: left; padding: 7px 8px; font-size: 13px; border: 1px solid var(--line); }
.inv-tbl td { padding: 7px 8px; border: 1px solid var(--line); vertical-align: top; }
.inv-tbl .r { text-align: right; }
.sn-list { font-size: 12px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
.inv-sum { margin-left: auto; width: 300px; }
.inv-sum > div { display: flex; justify-content: space-between; padding: 3px 0; }
.inv-sum .gt { font-weight: 700; border-top: 1px solid var(--ink); padding-top: 6px; margin-top: 3px; }
.inv-sign { display: flex; justify-content: space-between; margin: 60px 0 14px; gap: 40px; }
.inv-sign div { border-top: 1px solid var(--ink); padding-top: 4px; min-width: 180px; text-align: center; font-size: 13px; margin-left: auto; }
.inv-sign div:first-child:not(:last-child) { margin-left: 0; margin-right: auto; }
.inv-foot { text-align: center; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; margin-bottom: 6px; }

/* ---------- misc pages ---------- */
.report-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 14px; align-items: start; }
.report-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; position: sticky; top: calc(var(--top) + 14px); }
.report-nav button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 7px; cursor: pointer; }
.report-nav button:hover { background: var(--line2); }
.report-nav button.on { background: var(--blue-bg); color: var(--blue); font-weight: 600; }
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; margin: 0; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; }
.warranty-form { display: flex; gap: 10px; }
.warranty-form .search-box { flex: 1; }
.perm-tbl td, .perm-tbl th { padding: 8px 10px; }
.soon-page { text-align: center; padding: 50px 20px; }
.soon-page h1 { margin-bottom: 10px; }
.soon-page p { max-width: 560px; margin: 14px auto 0; color: var(--muted); }


/* ================= phase 2 ================= */
.mono { font-family: ui-monospace, Consolas, monospace; }
.date-nav { display: flex; gap: 4px; align-items: center; } .date-nav input { width: 160px; } .date-nav .btn { padding: 8px 10px; }
.stats.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.mini { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.mini span { font-size: 12.5px; color: var(--muted); } .mini b { font-size: 18px; font-variant-numeric: tabular-nums; } .mini small { color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.tabs button, .tabs a { border: 0; background: none; padding: 8px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.tabs .on { color: var(--accent); border-bottom-color: var(--accent); }
.tab-n { background: var(--line2); color: var(--ink); border-radius: 99px; font-size: 11px; padding: 0 7px; }
.status-flow { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; width: fit-content; max-width: 100%; }
.status-flow button { border: 0; border-right: 1px solid var(--line); background: none; padding: 8px 14px; cursor: pointer; color: var(--muted); }
.status-flow button:last-child { border-right: 0; } .status-flow button.on { background: var(--accent); color: #fff; font-weight: 600; }
.job-card h4 { margin: 16px 0 8px; display: flex; gap: 10px; align-items: center; }
.job-card .dl { margin-bottom: 8px; } .inv-sum input { width: 130px; text-align: right; min-height: 32px; padding: 4px 8px; }
.sn-pick.inline { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-height: none; margin-top: 6px; }
.big-num { font-size: 22px; font-weight: 700; padding: 4px 0; }
.plan-preview { margin-top: 8px; padding: 10px 14px; background: var(--blue-bg); border-radius: 8px; }
.progress { width: 100px; height: 7px; border-radius: 99px; background: var(--line2); overflow: hidden; } .progress i { display: block; height: 100%; background: var(--green); }
tr.late td { background: #fff6f4; }
.sec-title { font-size: 15px; display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.acc-card { border-radius: 14px; padding: 16px; color: #fff; cursor: pointer; position: relative; box-shadow: 0 6px 16px rgba(15, 30, 60, .12); transition: transform .12s; }
.acc-card:hover { transform: translateY(-2px); } .acc-card.off { opacity: .55; }
.acc-card.cash { background: linear-gradient(135deg, #0f766e, #14b8a6); } .acc-card.bank { background: linear-gradient(135deg, #1e3a8a, #3b82f6); } .acc-card.mobile { background: linear-gradient(135deg, #9d174d, #ec4899); }
.acc-top { display: flex; align-items: center; gap: 8px; font-weight: 600; } .acc-top span { flex: 1; } .acc-top .icon-btn { color: rgba(255,255,255,.8); padding: 4px; }
.acc-bal { font-size: 24px; font-weight: 700; margin: 14px 0 4px; } .acc-no { font-size: 12.5px; opacity: .85; font-family: ui-monospace, Consolas, monospace; }
.statement { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; max-width: 900px; }
.st-head { text-align: center; margin-bottom: 14px; } .st-head h3 { color: var(--accent); margin-top: 4px; }
.statement h4 { margin: 16px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--ink); text-transform: uppercase; font-size: 13px; letter-spacing: .04em; }
.st-line { display: flex; justify-content: space-between; padding: 4px 0; } .st-line.ind { padding-left: 18px; color: #3a4456; }
.st-line.b { font-weight: 700; } .st-line.top { border-top: 1px solid var(--line); margin-top: 2px; padding-top: 6px; }
.st-net { display: flex; justify-content: space-between; margin-top: 16px; padding: 12px 16px; border-radius: 10px; font-size: 19px; font-weight: 700; }
.st-net.pos { background: var(--green-bg); color: var(--green); } .st-net.neg { background: var(--red-bg); color: var(--red); }
.grid-2.tight { grid-template-columns: 1fr 1fr; gap: 28px; }
.mbars { display: flex; gap: 8px; align-items: flex-end; height: 220px; }
.mbar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; } .mbar span { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.mbar-cols { flex: 1; width: 100%; display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.mbar-cols i, .legend i { display: inline-block; width: 30%; max-width: 14px; border-radius: 3px 3px 0 0; }
.mbar-cols i.s, .legend i.s { background: #3b82f6; } .mbar-cols i.e, .legend i.e { background: #f59e0b; } .mbar-cols i.p, .legend i.p { background: #10b981; } .mbar-cols i.l { background: #ef4444; }
.legend { display: flex; gap: 16px; justify-content: center; margin-top: 8px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 12px; height: 12px; border-radius: 3px; }
.offer-tag { font-size: 12px; color: var(--purple); margin-top: 2px; } .offer-tag s { color: var(--muted); }
.report-nav .rn-group { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px 4px; }

/* ================= dashboard ================= */
.dash { display: flex; flex-direction: column; gap: 14px; }
.dash-hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 22px 24px; border-radius: 16px; color: #fff;
  background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.14), transparent 40%), linear-gradient(120deg, #0d2b5c 0%, #3a2a7a 55%, #8e1e5c 100%); box-shadow: 0 10px 30px rgba(13, 43, 92, .25); }
.dash-hero h1 { font-size: 24px; margin: 2px 0; } .hero-greet { opacity: .85; font-size: 14px; } .hero-date { opacity: .75; font-size: 13px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.hero { background: #fff; color: var(--nav); border-color: #fff; font-weight: 600; }
.btn.hero.ghosty { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); }
.btn.hero.ghosty:hover { background: rgba(255,255,255,.22); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { position: relative; overflow: hidden; border-radius: 14px; padding: 16px 18px; color: #fff; min-height: 118px; box-shadow: 0 6px 18px rgba(20, 40, 80, .12); }
.kpi.clickable { cursor: pointer; } .kpi.clickable:hover { filter: brightness(1.05); }
.kpi::after { content: ''; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.1); }
.kpi.k-blue { background: linear-gradient(135deg, #1d4ed8, #3b82f6); } .kpi.k-teal { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.kpi.k-amber { background: linear-gradient(135deg, #b45309, #f59e0b); } .kpi.k-purple { background: linear-gradient(135deg, #6d28d9, #a855f7); }
.kpi-ic { position: absolute; right: 16px; top: 16px; font-size: 22px; opacity: .85; z-index: 1; }
.kpi-l { font-size: 13px; opacity: .9; } .kpi-v { font-size: 26px; font-weight: 700; margin: 4px 0; font-variant-numeric: tabular-nums; }
.kpi-s { font-size: 12.5px; opacity: .9; display: flex; gap: 4px; align-items: center; } .kpi-s a { color: #fff; text-decoration: underline; }
.month-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ms { padding: 12px 16px; border-right: 1px solid var(--line2); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ms:last-child { border-right: 0; } .ms span { font-size: 12px; color: var(--muted); } .ms b { font-size: 17px; font-variant-numeric: tabular-nums; }
.ms em { font-style: normal; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 3px; } .ms em.up { color: var(--green); } .ms em.down { color: var(--red); }
.ms.hl { background: linear-gradient(180deg, #f2fbf6, #fff); } .ms.hl b { color: var(--green); }
.alerts { display: flex; gap: 8px; flex-wrap: wrap; }
.alert-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; font-size: 13px; font-weight: 500; text-decoration: none !important; border: 1px solid; }
.alert-chip.red { background: var(--red-bg); color: var(--red); border-color: #f5c9bf; } .alert-chip.amber { background: var(--amber-bg); color: var(--amber); border-color: #f2dcae; }
.alert-chip.blue { background: var(--blue-bg); color: var(--blue); border-color: #c9d8f4; } .alert-chip.purple { background: var(--purple-bg); color: var(--purple); border-color: #dccff4; }
.alert-chip.slate { background: #eef1f6; color: #3a4456; border-color: #dde2ea; }
.dgrid { display: grid; gap: 14px; } .dgrid.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .dgrid.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; min-width: 0; }
.panel-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line2); color: var(--muted); }
.panel-h h3 { font-size: 14.5px; color: var(--ink); flex: 1; } .panel-a { font-size: 12.5px; }
.panel-b { padding: 12px 16px; flex: 1; overflow-x: auto; }
.chart-wrap { position: relative; } .area-chart { width: 100%; height: auto; display: block; }
.area-chart .grid { stroke: #edf0f5; } .area-chart .axis { font-size: 10.5px; fill: #8a94a6; } .area-chart .hover-line { stroke: #b8c2d3; stroke-dasharray: 3 3; }
.chart-tip { position: absolute; top: 4px; transform: translateX(-50%); background: #1d2533; color: #fff; padding: 8px 10px; border-radius: 8px; font-size: 12px; pointer-events: none; white-space: nowrap; z-index: 2; }
.chart-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; } .donut { width: 170px; height: 170px; }
.donut-l { font-size: 9px; fill: #8a94a6; } .donut-v { font-size: 15px; font-weight: 700; fill: #1d2533; }
.donut-legend { width: 100%; } .donut-legend div { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; } .donut-legend span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-list { display: flex; flex-direction: column; gap: 6px; }
.acc-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; background: #f7f9fc; }
.acc-row svg { flex: none; } .acc-row span { flex: 1; } .acc-row.cash svg { color: var(--teal); } .acc-row.bank svg { color: var(--blue); } .acc-row.mobile svg { color: #db2777; }
.acc-total { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 15px; } .acc-total b { font-size: 17px; }
.due-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.due { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; } .due span { font-size: 12px; } .due b { font-size: 17px; }
.due.r { background: var(--amber-bg); color: var(--amber); } .due.p { background: var(--red-bg); color: var(--red); }
.mini-title { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 10px 0 4px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line2); color: var(--ink); text-decoration: none !important; }
.list-row:last-child { border-bottom: 0; } .list-row span { display: flex; flex-direction: column; min-width: 0; } .list-row small { color: var(--muted); font-size: 12px; }
.list-row span:has(.rank) { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
.stock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stock-grid div { background: #f7f9fc; border-radius: 9px; padding: 9px 11px; display: flex; flex-direction: column; } .stock-grid span { font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.stock-grid b { font-size: 16px; } .stock-grid .warn { background: var(--red-bg); } .stock-grid .warn b { color: var(--red); }
.hbar { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 13.5px; }
.hbar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hbar-l small { color: var(--muted); margin-left: 6px; }
.hbar-t { height: 8px; background: var(--line2); border-radius: 99px; overflow: hidden; } .hbar-t i { display: block; height: 100%; border-radius: 99px; }
.rank { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line2); font-size: 11px; font-weight: 700; margin-right: 6px; flex: none; }
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pipe { border-radius: 10px; padding: 8px 4px; text-align: center; text-decoration: none !important; display: flex; flex-direction: column; }
.pipe b { font-size: 20px; } .pipe span { font-size: 11px; }
.pipe.received { background: var(--amber-bg); color: var(--amber); } .pipe.in_progress { background: var(--blue-bg); color: var(--blue); }
.pipe.waiting_parts { background: var(--purple-bg); color: var(--purple); } .pipe.ready { background: var(--green-bg); color: var(--green); }
.tbl.compact td, .tbl.compact th { padding: 7px 8px; } .empty.sm { padding: 12px; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .month-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dgrid.g-2-1, .dgrid.g-3 { grid-template-columns: minmax(0, 1fr); } .stats.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .kpi-v { font-size: 20px; } .month-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ms { border-bottom: 1px solid var(--line2); }
  .dash-hero { padding: 16px; } .dash-hero h1 { font-size: 19px; } .hero-actions .btn { flex: 1 1 45%; }
  .stats.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2.tight { grid-template-columns: 1fr; } .statement { padding: 14px; }
  .status-flow button { padding: 6px 9px; font-size: 12.5px; }
}
@media print { .dash-hero, .alerts { display: none; } .statement { border: 0; padding: 0; } .acc-card { box-shadow: none; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2, .pos { grid-template-columns: minmax(0, 1fr); } .pos-right { position: static; } }
@media (max-width: 900px) {
  .menu-btn { display: grid; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .content { margin-left: 0; padding: calc(var(--top) + 14px) 12px 40px; }
  .report-layout { grid-template-columns: 1fr; }
  .report-nav { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .report-nav button { white-space: nowrap; width: auto; }
}
@media (max-width: 640px) {
  .uname { display: none; }
  .form-grid, .form-grid.two { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  .totals-grid, .pos-search { grid-template-columns: 1fr; }
  .stat-v { font-size: 16px; }
  .line-nums { width: 100%; } .line-nums .field { flex: 1; width: auto; }
  .invoice { padding: 16px; } .inv-head { flex-direction: column; } .inv-title { text-align: left; } .inv-sum { width: 100%; }
  .sn-pick { grid-template-columns: 1fr; }
  .bar-val { display: none; } .bar-col:nth-child(even) .bar-lbl { visibility: hidden; } .bars { gap: 3px; }
  .content { overflow-x: hidden; }
  .date-range input { width: 135px; }
  .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: 8px; }
}

/* ---------- print ---------- */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 12.5px; }
  .no-print, .topbar, .sidebar, .scrim, .toasts, .page-head, .report-nav, .filters { display: none !important; }
  .content { margin: 0; padding: 0; }
  .card, .invoice { border: 0; padding: 0; margin: 0 0 10px; max-width: none; }
  .card-head { padding: 6px 0; }
  .print-only { display: block; }
  .report-layout { display: block; }
  .report-head { text-align: center; margin-bottom: 8px; }
  .tbl th, .tbl td { padding: 4px 6px; border: 1px solid #ccc; }
  .tbl th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; }
  .table-wrap { overflow: visible; }
}

/* payment method buttons */
.pay-methods { display: flex; flex-wrap: wrap; gap: 6px; }
.pm { border: 1.5px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink); }
.pm:hover { border-color: #b9c3d3; }
.pm.on { color: #fff; border-color: transparent; }
.pm.cash.on { background: #0f766e; } .pm.mobile.on { background: #db2777; } .pm.bank.on { background: #1d4ed8; }
.totals .pm-row { flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 0; }
.totals .pm-row > span { font-weight: 600; }

/* ===== quick shortcut panel (top-right) ===== */
.quick { position: relative; }
.quick-btn { display: flex; align-items: center; gap: 7px; border: 0; border-radius: 9px; padding: 8px 12px; cursor: pointer; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #0d2b5c, #1f4fa0); box-shadow: 0 2px 8px rgba(13,43,92,.25); }
.quick-btn svg { font-size: 15px; } .quick-btn.on, .quick-btn:hover { background: linear-gradient(135deg, #123a78, #2a63c2); }
.quick-panel { position: absolute; right: -6px; top: calc(100% + 8px); width: 560px; max-width: calc(100vw - 20px); z-index: 45; padding: 14px;
  background: linear-gradient(180deg, #0d2b5c, #13396f); border-radius: 12px; box-shadow: 0 18px 50px rgba(5, 20, 50, .45); animation: qp .16s ease-out; }
.quick-panel::before { content: ''; position: absolute; right: 34px; top: -7px; width: 14px; height: 14px; background: #0d2b5c; transform: rotate(45deg); }
@keyframes qp { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.qt { background: #eef1f6; border: 0; border-radius: 4px; padding: 14px 6px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: transform .1s, background .1s; }
.qt:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.25); }
.qt-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 22px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.qt-l { color: #2a7fc9; font-size: 13px; font-weight: 600; text-align: center; line-height: 1.2; }
.quick-search { position: relative; margin-top: 10px; display: flex; align-items: center; }
.quick-search svg { position: absolute; left: 12px; color: #8a94a6; }
.quick-search input { padding-left: 36px; border-radius: 4px; border: 0; min-height: 40px; }
.quick-res { margin-top: 8px; background: #fff; border-radius: 8px; max-height: 300px; overflow-y: auto; }
.qr { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 9px 12px; text-align: left; cursor: pointer; border-bottom: 1px solid var(--line2); }
.qr svg { color: var(--accent); flex: none; } .qr.hi { background: var(--blue-bg); }
.qr-m { flex: 1; display: flex; flex-direction: column; min-width: 0; } .qr-m small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-a { font-weight: 600; font-variant-numeric: tabular-nums; } .qr-s { font-size: 11.5px; background: var(--line2); padding: 1px 8px; border-radius: 99px; }
.qr-empty { padding: 14px; text-align: center; color: var(--muted); }
@media (max-width: 640px) {
  .quick-btn span { display: none; } .quick-btn { padding: 9px 11px; }
  .quick-panel { position: fixed; left: 10px; right: 10px; top: 62px; width: auto; }
  .quick-panel::before { display: none; } .quick-grid { grid-template-columns: repeat(3, 1fr); } .qt-ic { width: 44px; height: 44px; font-size: 18px; } .qt-l { font-size: 12px; }
}

/* ===== report catalogue ===== */
.rcat { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.rcat-sec { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; overflow: hidden; }
.rcat-sec h3 { background: #d5dbe5; color: #1d2533; font-size: 13.5px; text-transform: uppercase; letter-spacing: .02em; padding: 10px 14px; display: flex; gap: 8px; align-items: center; border-bottom: 2px solid #b9c3d3; }
.rcat-sec ul { list-style: none; margin: 0; padding: 8px 14px 10px; }
.rcat-sec li a { display: flex; align-items: center; gap: 6px; padding: 6px 4px; color: #2a7fc9; text-transform: uppercase; font-size: 13px; letter-spacing: .01em; border-radius: 6px; text-decoration: none; }
.rcat-sec li a:hover { background: var(--blue-bg); }
.rcat-sec li a svg { font-size: 11px; color: #1d2533; }
.rcat-sep { display: flex; align-items: center; gap: 8px; margin: 8px 0; color: #3a4456; font-size: 13px; }
.rcat-sep::before, .rcat-sep::after { content: ''; flex: 1; height: 1px; background: #e0566a; }
.rfilters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.rfilters .field { margin: 0; min-width: 170px; } .rfilters select { min-width: 200px; }
.presets { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
.presets button { border: 1px solid var(--line); background: #fff; padding: 5px 12px; border-radius: 99px; cursor: pointer; font-size: 13px; }
.presets button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.rf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.rtable td { white-space: nowrap; } .rtable td:has(> :not(.money)) { white-space: normal; }
@media (max-width: 900px) { .rcat { grid-template-columns: 1fr; } }
@media print { .rcards .mini { border: 1px solid #ccc; } .rtable td { white-space: normal; } .presets { display: none; } }
.scan-hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.scan-hint svg { color: var(--accent); flex: none; }

/* ===== A4 invoice (matches company's existing invoice) ===== */
.inv2 { background: #fff; color: #111; width: 100%; max-width: 820px; padding: 34px 40px 22px; border: 1px solid var(--line); border-radius: 6px; font-family: "DejaVu Sans", "Segoe UI", Arial, sans-serif; font-size: 13px; line-height: 1.45; position: relative; }
.inv2 b { font-weight: 700; }
.inv2-head { display: grid; grid-template-columns: 190px 1fr 270px; border-bottom: 2px solid #ddd; padding-bottom: 12px; }
.inv2-logo { display: flex; align-items: center; justify-content: center; border-right: 2px solid #ddd; padding-right: 12px; }
.inv2-logo img { max-width: 170px; max-height: 90px; object-fit: contain; }
.inv2-logo-txt { width: 70px; height: 70px; border-radius: 12px; display: grid; place-items: center; font-size: 36px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #c2185b, #5e35b1, #0d2b5c); }
.inv2-co { padding: 0 14px; border-right: 2px solid #ddd; } .inv2-co > b { font-size: 14px; }
.inv2-meta { text-align: right; padding-left: 12px; } .inv2-meta b { margin-right: 2px; }
.inv2-bar { height: 40px; margin: 0 0 4px auto; width: 260px; } .inv2-bar svg { width: 100%; height: 100%; display: block; }
.inv2-title { text-align: center; font-size: 22px; letter-spacing: .02em; margin: 22px 0 14px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.inv2-party { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px; } .inv2-pname { font-size: 15px; }
.inv2-tbl { width: 100%; border-collapse: collapse; }
.inv2-tbl th { background: #1aa3e0; color: #fff; text-align: left; padding: 7px 8px; font-weight: 700; border: 1px solid #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.inv2-tbl td { border: 1px solid #c9ced6; padding: 6px 8px; vertical-align: top; }
.inv2-tbl .r { text-align: right; } .inv2-tbl .c { text-align: center; }
.inv2-code { color: #555; } .inv2-sn td { font-size: 12.5px; } .inv2-war { color: #555; font-size: 11.5px; }
.inv2-sum td { padding: 6px 8px; } .inv2-sum td.blank { border-right: 1px solid #c9ced6; }
.inv2-words { margin: 10px 0; }
.inv2-prev { border-collapse: collapse; width: 330px; margin-bottom: 12px; }
.inv2-prev th { background: #1aa3e0; color: #fff; text-align: left; padding: 7px 8px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.inv2-prev td { border: 1px solid #c9ced6; padding: 6px 8px; } .inv2-prev .r { text-align: right; } .inv2-prev tr.b td { font-weight: 700; }
.inv2-note { margin-bottom: 8px; }
.inv2-terms ul { margin: 2px 0 0; padding-left: 0; list-style: none; } .inv2-terms li::before { content: '• '; } .inv2-terms li { font-size: 12.5px; }
.inv2-sign { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 30px; margin-top: 30px; }
.inv2-sign .inv2-sig { border-top: 1px solid #111; text-align: center; padding-top: 3px; font-size: 14px; }
.inv2-qr svg { width: 120px; height: 120px; display: block; }
.inv2-thanks { text-align: center; color: #555; font-size: 12px; margin-top: 12px; }
.inv2-foot { display: flex; justify-content: space-between; border-top: 1px solid #ddd; margin-top: 26px; padding-top: 6px; font-size: 13px; } .inv2-foot span:first-child { color: #1a3fc4; }
.logo-row { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.logo-box { width: 200px; height: 100px; border: 1px dashed #b9c3d3; border-radius: 10px; display: grid; place-items: center; background: #fafbfd; overflow: hidden; }
.logo-box img { max-width: 190px; max-height: 90px; object-fit: contain; }
.logo-row label.btn { cursor: pointer; }
.terms-preview { border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 13px; background: #fff; margin: 4px 0 10px; }
.terms-preview ul { margin: 4px 0 0; padding-left: 0; list-style: none; } .terms-preview li::before { content: '• '; }
@media (max-width: 700px) {
  .inv2 { padding: 14px; font-size: 12px; } .inv2-head { grid-template-columns: 1fr; gap: 10px; } .inv2-logo, .inv2-co { border: 0; padding: 0; justify-content: flex-start; }
  .inv2-meta { text-align: left; padding: 0; } .inv2-bar { margin: 0 0 4px; } .inv2-party { grid-template-columns: 1fr; gap: 8px; } .inv2-prev { width: 100%; } .inv2-sign { gap: 10px; } .inv2-qr svg { width: 90px; height: 90px; }
  .inv2-tbl { font-size: 11.5px; } .inv2-tbl th, .inv2-tbl td { padding: 4px; }
}
@media print {
  @page { size: A4; margin: 10mm; }
  .inv2 { border: 0; padding: 0 0 12mm; max-width: none; }
  .inv2-foot { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; background: #fff; }
  .content { min-height: 0; }
  .inv2 { font-size: 12px; line-height: 1.35; } .inv2-title { margin: 12px 0 10px; font-size: 20px; } .inv2-party { margin-bottom: 10px; }
  .inv2-tbl td, .inv2-tbl th, .inv2-prev td, .inv2-prev th { padding: 4px 7px; } .inv2-sign { margin-top: 16px; } .inv2-qr svg { width: 95px; height: 95px; }
  .inv2-thanks { margin-top: 6px; }
}

/* ===== dashboard: business overview / insights (old-system style) ===== */
.bo { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.bo-h { background: linear-gradient(180deg, #2a8fd6, #136bb0); color: #fff; font-weight: 700; font-size: 13.5px; text-transform: uppercase; letter-spacing: .02em; padding: 9px 14px; display: flex; gap: 8px; align-items: center; }
.bo-b { padding: 12px 14px 16px; }
.bo-range { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; } .bo-range input { width: 160px; min-height: 34px; padding: 5px 8px; }
.bo-go { background: #1a8ed6; color: #fff; border: 0; border-radius: 4px; padding: 0 16px; font-weight: 700; font-size: 12.5px; text-transform: uppercase; cursor: pointer; min-height: 34px; } .bo-go:hover { background: #136bb0; }
.bo-grid { display: grid; grid-template-columns: 1.1fr 1fr 1.1fr 1.1fr; gap: 18px; }
.bo-col h4 { text-align: center; font-size: 12.5px; text-transform: uppercase; color: #333; margin: 0 0 10px; }
.bo-pl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
.bo-pl b { display: block; font-size: 18px; color: #444; font-variant-numeric: tabular-nums; } .bo-pl span { font-size: 12px; color: #888; text-transform: uppercase; }
.bo-np { border-left: 4px solid #16a34a; padding: 8px 10px; } .bo-np b { color: #333; }
.bo-ie { display: flex; flex-direction: column; gap: 10px; } .bo-in { border-left: 4px solid #a3c94a; padding: 6px 10px; } .bo-ex { border-left: 4px solid #f59e0b; padding: 6px 10px; }
.bo-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.bo-tbl td { border: 1px solid #e3e7ec; padding: 6px 8px; } .bo-tbl td.r { text-align: right; white-space: nowrap; } .bo-tbl tr.b td { font-weight: 700; background: #f7f9fc; }
.bo-tbl tr:nth-child(even) td { background: #fafbfd; } .bo-tbl tr.clickable { cursor: pointer; } .bo-tbl tr.clickable:hover td { background: var(--blue-bg); }
.net-curve { width: 100%; height: auto; } .net-curve .grid { stroke: #e5e7eb; } .net-curve .axis { font-size: 9px; fill: #555; }
.bo-accs { display: flex; flex-direction: column; gap: 4px; }
.bo-acc { display: flex; align-items: center; gap: 10px; color: #fff; padding: 8px 10px; cursor: pointer; border-radius: 4px; }
.bo-acc.cash { background: #13a35a; } .bo-acc.bank { background: #3b8bc2; } .bo-acc.mobile { background: #c2397a; }
.bo-acc-ic { width: 34px; height: 34px; display: grid; place-items: center; background: rgba(0,0,0,.18); border-radius: 4px; font-size: 16px; flex: none; }
.bo-acc b { display: block; font-size: 14.5px; } .bo-acc small { font-size: 12px; opacity: .92; }
.bi-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr; gap: 16px; align-items: start; }
.bi-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bi-tile { background: #2f86c4; color: #fff; padding: 9px 11px; border-radius: 3px; cursor: pointer; } .bi-tile:hover { background: #2575ad; }
.bi-t { font-weight: 700; font-size: 13px; text-transform: uppercase; display: flex; gap: 6px; align-items: center; } .bi-v { font-size: 14px; margin-top: 2px; }
.bi-box h4 { background: #3f8fc9; color: #fff; text-align: center; font-size: 12.5px; text-transform: uppercase; margin: 0; padding: 7px; }
.bi-sub { background: #eef3f9; color: #2a7fc9; font-weight: 700; font-size: 12px; text-transform: uppercase; padding: 5px 8px; border: 1px solid #e3e7ec; border-bottom: 0; }
@media (max-width: 1250px) { .bo-grid, .bi-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .bo-grid, .bi-grid { grid-template-columns: 1fr; } .bo-range input { width: calc(50% - 4px); } .bo-go { width: 100%; } }
.cost-hint { color: #c9cfd9; font-size: 11px; font-weight: 400; letter-spacing: .02em; }
.cost-hint:hover { color: #6b7587; }
.line-desc { margin-top: 6px; min-height: 32px; padding: 5px 8px; font-size: 13px; }
label.btn.disabled { opacity: .5; pointer-events: none; }

/* ---------- v2.8: branches, approvals, paid ---------- */
.alert.info { background: var(--blue-bg); color: var(--blue); }
.paid-in { display: flex; gap: 4px; align-items: center; }
.paid-in input { flex: 1; min-width: 0; }
.full-btn { border: 1px solid var(--line); background: var(--line2); border-radius: 6px; padding: 0 8px; min-height: 34px; cursor: pointer; font-size: 12px; white-space: nowrap; color: var(--accent); }
.full-btn:hover { background: var(--blue-bg); }
.branch-sel { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.branch-sel select { min-height: 34px; padding: 4px 8px; width: auto; max-width: 170px; }
.branch-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: var(--teal-bg); color: var(--teal); font-size: 13px; font-weight: 600; white-space: nowrap; }
.branch-line { display: flex; align-items: center; gap: 6px; padding: 6px 10px; margin-bottom: 10px; border-radius: 8px; background: var(--teal-bg); color: var(--teal); }
.bell { position: relative; }
.bell-n { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 7px 12px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: #fff; }
.btn.ghost.ok { color: var(--green); } .btn.ghost.ok:hover { background: var(--green-bg); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; margin: 6px 0 14px; }
.ap-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ap-meta > div { background: var(--line2); border-radius: 8px; padding: 8px 10px; }
.ap-meta small { display: block; color: var(--muted); font-size: 11.5px; }
.ap-totals { max-width: 340px; margin: 10px 0 0 auto; }
.ap-note { width: auto; flex: 1; min-width: 120px; }
.modal-foot .btn.primary { margin-left: 0; }
.doc-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; }
.doc-head .r { text-align: right; }
.sign-row { display: flex; justify-content: space-between; margin-top: 60px; }
.sign-row > div { border-top: 1px solid var(--ink); padding-top: 4px; min-width: 180px; text-align: center; }
.inv-branch { font-size: 12px; }
@media (max-width: 700px) { .branch-sel select { max-width: 110px; } .branch-chip { font-size: 11.5px; padding: 4px 8px; } }
@media (max-width: 640px) {
  .topbar { gap: 6px; padding: 0 8px; }
  .top-right { gap: 4px; min-width: 0; }
  .brand { flex: none; } .brand .cname { display: none; }
  .branch-sel svg { display: none; }
  .branch-sel select { max-width: 92px; font-size: 12.5px; padding: 4px; }
  .branch-chip { max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
  .lang-btn { padding: 5px 7px; } .lang-btn svg { display: none; }
  .icon-btn.bell { padding: 6px; }
}
/* split payment */
.split-pay { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.sp-rows { display: flex; flex-direction: column; gap: 6px; }
.sp-row { display: grid; grid-template-columns: minmax(70px, 1fr) minmax(90px, 130px) auto; gap: 6px; align-items: center; }
.sp-row .sp-name { font-weight: 600; font-size: 13px; }
.sp-row input { text-align: right; min-height: 34px; }
.inv2-pay td { font-size: 11px; color: #444; }
.br-logo { width: 44px; height: 30px; object-fit: contain; border-radius: 4px; }
.br-logo.empty { display: inline-grid; place-items: center; background: var(--teal-bg); color: var(--teal); }
.hero-branch { display: inline-block; margin-left: 10px; padding: 2px 10px; border-radius: 99px; background: rgba(255,255,255,.18); font-size: 13px; font-weight: 600; vertical-align: middle; }
.doc-link { font-weight: 600; text-decoration: underline dotted; cursor: pointer; } @media print { .doc-link { color: inherit; text-decoration: none; } }
/* ---------- v3: super admin, subscription ---------- */
.super-shell { min-height: 100vh; background: var(--bg); }
.super-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 0 18px; height: 56px; background: #1b1440; color: #fff; }
.super-top .brand { color: #fff; } .super-top .logo { background: linear-gradient(135deg, #f59e0b, #c2185b); }
.super-top nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.super-top nav a { color: #cfc8f3; padding: 8px 12px; border-radius: 8px; display: flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; }
.super-top nav a.on, .super-top nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.super-top .lang-btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.super-content { max-width: 1280px; margin: 0 auto; padding: 20px 16px 50px; }
.super-bg { background: linear-gradient(135deg, #1b1440, #3b1a5a); }
.stat.ok .stat-v { color: var(--green); } .stat.warn .stat-v { color: var(--amber); } .stat.bad .stat-v { color: var(--red); }
.stat.clickable { cursor: pointer; }
.dot-on { color: #16a34a; font-size: 9px; vertical-align: middle; } .dot-off { color: #cbd2dc; font-size: 9px; vertical-align: middle; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); } .kv span { color: var(--muted); } .kv b { text-align: right; }
.search-in { max-width: 260px; }
.pre { white-space: pre-wrap; }
.locked-card { max-width: 460px; text-align: center; } .locked-card .login-logo { background: var(--red); }
.sub-box { display: grid; gap: 8px; text-align: left; background: var(--line2); border-radius: 10px; padding: 12px; margin: 14px 0; }
.sub-box small { display: block; color: var(--muted); font-size: 11.5px; }
.sub-banner { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
@media (max-width: 700px) { .super-top { gap: 8px; padding: 0 8px; } .super-top nav a span { display: none; } .super-top .brand span:last-child { display: none; } }
