/* ===== DigiGlobal Billing — brand: red #E3262F, black #121212, Lato ===== */
:root {
  --red: #E3262F; --red-dk: #C41C24; --red-lt: #FDECEC;
  --ink: #121212; --ink2: #3a3a3a; --muted: #777; --line: #E7E7E7;
  --bg: #F4F4F5; --card: #fff; --green: #12884A; --wa: #25D366;
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Lato', system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }
a { color: var(--red); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }

/* nav */
.topnav { background: #fff; border-bottom: 3px solid var(--red); display: flex; align-items: center; gap: 24px; padding: 10px 24px; position: sticky; top: 0; z-index: 20; }
.brand img { height: 30px; display: block; }
.navlinks { display: flex; gap: 4px; overflow-x: auto; flex: 1; justify-content: flex-end; }
.navlinks a { color: var(--ink2); font-weight: 600; padding: 8px 12px; border-radius: 8px; white-space: nowrap; font-size: 13px; }
.navlinks a:hover { background: var(--bg); }
.navlinks a.on { background: var(--ink); color: #fff; }
.navlinks a.muted { color: var(--muted); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 9px; padding: 10px 16px; font: 700 13px 'Lato', sans-serif; cursor: pointer; white-space: nowrap; color: var(--ink); background: #fff; line-height: 1.2; }
.btn.red { background: var(--red); color: #fff; } .btn.red:hover { background: var(--red-dk); }
.btn.dark { background: var(--ink); color: #fff; } .btn.dark:hover { background: #333; }
.btn.ghost { background: #fff; border: 1px solid var(--line); }
.btn.ghost:hover { border-color: #bbb; }
.btn.wa { background: var(--wa); color: #fff; }
.btn.sm { padding: 7px 12px; font-size: 12px; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .6; cursor: wait; }
.danger { color: var(--red) !important; }
.icon-btn { font-size: 12px; font-weight: 600; color: var(--ink2); padding: 5px 9px; border-radius: 6px; border: 1px solid var(--line); background: #fff; margin-left: 4px; }
.icon-btn:hover { border-color: var(--red); color: var(--red); }
.linkbtn { background: none; border: 0; color: var(--red); cursor: pointer; font: inherit; font-size: 12px; }

/* page */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 24px; font-weight: 800; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lead { color: var(--muted); margin: -8px 0 18px; max-width: 720px; }
.card { background: var(--card); border-radius: var(--r); padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04); border: 1px solid #ececec; }
.card.flush { padding: 0; overflow: hidden; }
.card h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; background: #E8F6EE; color: var(--green); border: 1px solid #c6ead6; }
.flash.err { background: var(--red-lt); color: var(--red-dk); border-color: #f6c5c7; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: var(--r); padding: 16px; border: 1px solid #ececec; position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red); }
.stat:nth-child(2)::before { background: var(--green); } .stat:nth-child(4)::before, .stat:nth-child(5)::before { background: var(--ink); }
.stat span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat b { display: block; font-size: 20px; font-weight: 800; margin: 4px 0 2px; }
.stat small { color: var(--muted); font-size: 12px; }
.green { color: var(--green); } .redtxt { color: var(--red); }

/* search + tabs */
.searchbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.searchbar input { flex: 1; min-width: 200px; }
.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tabs a { padding: 6px 12px; border-radius: 7px; color: var(--ink2); font-weight: 600; font-size: 12px; }
.tabs a.on { background: var(--red); color: #fff; }

/* list table */
table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 14px; background: #fafafa; border-bottom: 1px solid var(--line); }
.list td { padding: 12px 14px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.list tbody tr { cursor: pointer; } .list tbody tr:hover { background: #fffafa; }
.list .sub { color: var(--muted); font-size: 12px; }
.list .empty { text-align: center; color: var(--muted); padding: 40px; cursor: default; }
.svc tr { cursor: default; }
.r { text-align: right; } .c { text-align: center; } .nowrap { white-space: nowrap; }
.type-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: var(--ink); vertical-align: middle; }
.type-dot.invoice { background: var(--red); } .type-dot.quotation { background: #8a8a8a; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; background: #eee; color: var(--ink2); white-space: nowrap; }
.badge.sent, .badge.issued { background: #EAF1FF; color: #2453B8; }
.badge.accepted, .badge.paid { background: #E3F5EA; color: var(--green); }
.badge.rejected, .badge.unpaid { background: var(--red-lt); color: var(--red-dk); }
.badge.partial { background: #FFF4DB; color: #9A6500; }

/* forms */
label { display: block; font-size: 12px; font-weight: 600; color: var(--ink2); margin-bottom: 12px; }
label small { font-weight: 500; color: var(--muted); margin-left: 6px; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid #dcdcdc; border-radius: 8px; font: 400 14px 'Lato', sans-serif; color: var(--ink); background: #fff; }
textarea { resize: vertical; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(227,38,47,.12); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 .card { margin-bottom: 0; } .grid2 { margin-bottom: 16px; }
.preset { display: flex; gap: 10px; align-items: center; }
.preset select { margin: 0; min-width: 260px; }
.chk { display: flex; gap: 6px; align-items: center; margin: 0; white-space: nowrap; }
.chk input { width: auto; margin: 0; }

.items-head, .item { display: grid; grid-template-columns: 1fr 70px 110px 120px 120px 32px; gap: 8px; align-items: start; }
.items-head { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 0 0 6px; letter-spacing: .04em; border-bottom: 2px solid var(--ink); margin-bottom: 8px; }
.item { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.item input, .item textarea { margin: 0; }
.it-desc textarea { margin-top: 5px; font-size: 12px; color: var(--ink2); }
.item .amt { padding-top: 10px; font-weight: 700; }
.del { border: 0; background: var(--bg); border-radius: 6px; height: 38px; cursor: pointer; color: var(--muted); }
.del:hover { background: var(--red-lt); color: var(--red); }
#addRow { margin-top: 10px; }
.totals-edit { display: grid; grid-template-columns: 1fr 300px; gap: 24px; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; align-items: start; }
.totals-edit .row2 { max-width: 360px; }
.totals-edit dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0; }
.totals-edit dt { color: var(--muted); } .totals-edit dd { margin: 0; text-align: right; font-weight: 600; }
.totals-edit .grand { font-size: 17px; font-weight: 800; color: var(--ink); border-top: 2px solid var(--red); padding-top: 8px; }
.savebar { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%); padding: 18px 0 6px; text-align: right; }
.savebar .btn { padding: 13px 28px; font-size: 14px; }

/* proposal editor */
.plan-pick { display: grid; gap: 10px; margin-bottom: 8px; }
.pick { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; margin: 0; }
.pick:has(input:checked) { border-color: var(--red); background: #fffafa; }
.pick input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--red); flex: none; }
.pick b { display: block; font-size: 14px; color: var(--ink); }
.pick small { display: block; color: var(--muted); font-weight: 400; margin: 2px 0 0; font-size: 12px; }
.help { color: var(--muted); font-size: 12px; margin: 4px 0 16px; }
.help code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.more-sec { border-top: 1px solid var(--line); padding-top: 12px; }
.more-sec summary { cursor: pointer; font-weight: 700; color: var(--red); font-size: 13px; }
.muted-s { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }

/* services */
.grid-svc { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.cat-head { padding: 12px 16px; font-weight: 800; background: var(--ink); color: #fff; font-size: 14px; display: flex; justify-content: space-between; }
.cat-head span { background: var(--red); border-radius: 20px; padding: 0 9px; font-size: 12px; }
.sticky { position: sticky; top: 80px; }
.dlg-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* login */
.login-card { max-width: 380px; margin: 9vh auto 0; background: #fff; border-radius: 16px; padding: 32px; border-top: 5px solid var(--red); box-shadow: 0 10px 30px rgba(0,0,0,.06); }
.login-logo { height: 40px; display: block; margin: 0 auto 10px; }
.login-card h2 { text-align: center; font-size: 15px; color: var(--muted); font-weight: 600; margin-bottom: 22px; }

/* view toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; background: #fff; border: 1px solid #ececec; border-radius: var(--r); padding: 10px 12px 10px 18px; }
.tb-title { display: flex; flex-direction: column; } .tb-title b { font-size: 16px; font-weight: 800; }
.tb-title span, .tb-title .back { font-size: 12px; color: var(--muted); font-weight: 600; }
.tb-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tb-actions form { margin: 0; }
.more { position: relative; }
.more .menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); min-width: 210px; padding: 6px; z-index: 30; }
.more.open .menu { display: block; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; font: 400 13px 'Lato', sans-serif; color: var(--ink); border-radius: 7px; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--bg); }

.dlg { border: 0; border-radius: 16px; padding: 0; width: min(520px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dlg::backdrop { background: rgba(18,18,18,.55); }
.dlg-body { padding: 22px; }
.dlg h3 { font-size: 17px; font-weight: 800; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.wa-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--wa); }
.phone { display: flex; align-items: center; margin-top: 5px; }
.phone span { padding: 10px 12px; border: 1px solid #dcdcdc; border-right: 0; border-radius: 8px 0 0 8px; background: #fafafa; }
.phone input { margin: 0; border-radius: 0 8px 8px 0; }
.hint { font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.paylist { font-size: 13px; background: var(--bg); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.paylist div { padding: 3px 0; }

/* ================= DOCUMENT TEMPLATE (A4 = 794px) ================= */
.doc-wrap { display: flex; justify-content: center; }
.doc-scale { width: 794px; flex: none; }
.doc { width: 794px; background: #fff; color: #1d1d1f; box-shadow: 0 4px 24px rgba(0,0,0,.08); padding: 34px 52px 40px; font: 400 12.5px/1.6 'Lato', 'Helvetica Neue', Arial, sans-serif; }
body.exporting .doc { box-shadow: none; }
.doc b, .doc strong { font-weight: 700; }
.doc .hl { color: var(--red); font-style: normal; }
.doc .det { color: #8a8a8a; font-size: 11px; font-weight: 400; }
.doc .kicker { font-size: 9.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--red); margin-bottom: 6px; }
.doc .kicker.grey { color: #8a8a8a; }
.doc hr.rule { border: 0; border-top: 1px solid #e6e6e6; margin: 26px 0; }
.doc .avoid { break-inside: avoid; page-break-inside: avoid; }

/* header */
.dg-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 18px; border-bottom: 1px solid #e6e6e6; margin-bottom: 26px; }
.dg-logo { height: 36px; }
.dg-contact { display: flex; gap: 28px; }
.dg-contact span { display: block; font-size: 8.5px; letter-spacing: .2em; text-transform: uppercase; color: #8a8a8a; font-weight: 700; }
.dg-contact b { font-size: 13px; font-weight: 700; color: #1d1d1f; white-space: nowrap; }
.dg-contact.light span { color: #9a9a9a; } .dg-contact.light b { color: #fff; font-size: 14px; }

/* hero */
.hero { display: grid; grid-template-columns: 1fr 268px; gap: 30px; align-items: start; }
.hero h1 { font-size: 27px; line-height: 1.22; font-weight: 900; color: #1d1d1f; margin: 4px 0 14px; letter-spacing: -.01em; }
.hero .lead { font-size: 13.5px; line-height: 1.7; color: #333; margin: 0; }
.info-card { border: 1px solid #e3e3e3; border-radius: 12px; padding: 16px 16px 6px; }
.info-card .kicker { margin-bottom: 10px; }
.ic-row { display: flex; justify-content: space-between; gap: 10px; align-items: flex-end; padding: 7px 0; border-bottom: 1px solid #ececec; font-size: 12px; }
.ic-row:last-child { border-bottom: 0; }
.ic-row span { color: #777; white-space: nowrap; }
.ic-row b { text-align: right; font-weight: 700; color: #1d1d1f; }
.ic-row .blank { display: inline-block; width: 90px; border-bottom: 1px dashed #bbb; }
.hero-total { margin-top: 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero-total span:first-child { font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: #8a8a8a; font-weight: 700; }
.hero-total b { font-size: 24px; font-weight: 900; color: var(--red); }
.inv-meta { display: flex; gap: 26px; margin-top: 4px; }
.inv-meta span { display: block; font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: #8a8a8a; font-weight: 700; }
.inv-meta b { font-size: 13px; }
.from-line { margin-top: 14px; font-size: 11px; color: #666; }

/* section heads */
.sec-head { margin-bottom: 16px; }
.sec-head h2 { font-size: 19px; font-weight: 900; color: #1d1d1f; }
.sec-head p { color: #777; margin: 6px 0 0; max-width: 560px; line-height: 1.65; }
.sec-head.side { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: start; }
.sec-head.side p { margin: 0; padding-top: 2px; }

/* chips + glance cards */
.chip { display: inline-block; background: #FDECEC; color: var(--red); font-size: 9px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; padding: 5px 9px; border-radius: 6px; line-height: 1.4; }
.glance { display: grid; gap: 12px; }
.glance.cols-4 { grid-template-columns: repeat(4, 1fr); } .glance.cols-3 { grid-template-columns: repeat(3, 1fr); }
.glance.cols-2 { grid-template-columns: repeat(2, 1fr); } .glance.cols-1 { grid-template-columns: 1fr; }
.g-card { border: 1px solid #e3e3e3; border-radius: 12px; padding: 12px 12px 14px; }
.g-name { display: block; font-size: 12.5px; font-weight: 700; margin: 10px 0 12px; line-height: 1.35; }
.g-price { font-size: 21px; font-weight: 900; color: var(--red); line-height: 1.1; }
.g-price small { font-size: 11px; color: #777; font-weight: 400; margin-left: 2px; }
.g-note { font-size: 11px; color: #777; margin-top: 6px; line-height: 1.45; }

/* plan cards */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.plan-card { border: 1px solid #e3e3e3; border-radius: 14px; overflow: hidden; }
.pc-top { padding: 16px 18px 14px; border-bottom: 1px solid #ececec; }
.pc-top h3 { font-size: 16px; font-weight: 900; margin: 12px 0 8px; line-height: 1.3; }
.pc-price { font-size: 21px; font-weight: 900; color: #1d1d1f; }
.pc-price span { font-size: 12px; color: #8a8a8a; font-weight: 400; }
.pc-top p { margin: 8px 0 0; color: #333; line-height: 1.6; }
.pc-body { padding: 14px 18px 16px; }
.pc-body .kicker { margin: 4px 0 10px; }
ul.checks { list-style: none; padding: 0; margin: 0 0 6px; }
ul.checks li { position: relative; padding-left: 24px; margin: 0 0 8px; line-height: 1.5; color: #2a2a2a; }
ul.checks li::before { content: ''; position: absolute; left: 0; top: 1px; width: 15px; height: 15px; border-radius: 50%; background: #FDECEC; }
ul.checks li::after { content: ''; position: absolute; left: 5px; top: 4px; width: 4px; height: 7px; border: solid var(--red); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pc-note { border-top: 1px solid #ececec; padding-top: 10px; margin-top: 10px; color: #8a8a8a; line-height: 1.6; }
.pc-note .hl { color: #1d1d1f; font-weight: 700; }
.opts { margin-bottom: 14px; }
.opt { display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 8px; background: #fafafa; border: 1px solid #ececec; border-radius: 9px; padding: 9px 12px; margin-bottom: 8px; }
.o-name { color: var(--red); font-size: 10.5px; font-weight: 700; }
.opt b { font-size: 13px; white-space: nowrap; }
.o-price { font-weight: 700; white-space: nowrap; } .o-price small { color: #8a8a8a; font-weight: 400; }

/* tables */
.tbl-card { border: 1px solid #e3e3e3; border-radius: 12px; overflow: hidden; }
table.dg-table { width: 100%; border-collapse: collapse; }
.dg-table th { text-align: left; background: #fafafa; font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: #8a8a8a; font-weight: 700; padding: 11px 14px; border-bottom: 1px solid #e6e6e6; }
.dg-table td { padding: 11px 14px; border-bottom: 1px solid #efefef; vertical-align: top; font-size: 12px; line-height: 1.55; }
.dg-table tr:last-child td { border-bottom: 0; }
.dg-table tr { break-inside: avoid; page-break-inside: avoid; }
.dg-table .r { text-align: right; } .dg-table .c { text-align: center; }
.yearly td:first-child { font-size: 11.5px; width: 36%; }
.yearly td.r { white-space: nowrap; color: #444; }
.timeline .tl-n { color: var(--red); font-weight: 700; width: 34px; }
.timeline .tl-d { white-space: nowrap; font-weight: 700; }
.foot-note { color: #777; margin: 12px 0 0; line-height: 1.6; }

/* totals */
.sum { display: grid; grid-template-columns: 1fr 280px; gap: 22px; margin-top: 16px; align-items: start; }
.soft-box { background: #fafafa; border: 1px solid #ececec; border-radius: 10px; padding: 11px 14px; margin-bottom: 10px; }
.soft-box .kicker { margin-bottom: 3px; }
.soft-box p { margin: 0; }
.tot-card { border: 1px solid #e3e3e3; border-radius: 12px; overflow: hidden; }
.t-row { display: flex; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid #efefef; }
.t-row span { color: #666; }
.t-row:last-child { border-bottom: 0; }
.t-row.grand { background: var(--red); color: #fff; font-size: 15px; }
.t-row.grand span, .t-row.due span { color: #fff; font-weight: 700; }
.t-row.grand b { font-weight: 900; }
.t-row.due { background: #161618; color: #fff; }

/* terms */
.terms-cols { display: grid; gap: 22px; }
.terms-cols.cols-3 { grid-template-columns: repeat(3, 1fr); } .terms-cols.cols-2 { grid-template-columns: repeat(2, 1fr); } .terms-cols.cols-1 { grid-template-columns: 1fr; }
.tcol { border-top: 3px solid var(--red); padding-top: 12px; }
.tcol h4 { font-size: 13.5px; font-weight: 900; margin: 0 0 10px; }
.tcol ul, .terms-plain ul { margin: 0; padding-left: 16px; }
.tcol li, .terms-plain li { margin: 0 0 8px; line-height: 1.55; color: #2a2a2a; }
.tcol li::marker { color: #1d1d1f; }
.terms-plain { color: #444; }

/* acceptance */
.accept-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.acc { display: flex; align-items: center; gap: 12px; border: 1px solid #e3e3e3; border-radius: 10px; padding: 12px 14px; }
.acc .box { flex: none; width: 15px; height: 15px; border: 1.5px solid #555; border-radius: 3px; }
.acc-t { flex: 1; font-size: 12px; line-height: 1.45; color: #444; }
.acc-t b { color: #1d1d1f; }
.acc-p { white-space: nowrap; font-size: 12px; }
.sign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 6px; }
.sign-card { border: 1px solid #e3e3e3; border-radius: 12px; padding: 14px 16px 6px; }
.sign-card h4 { font-size: 13px; font-weight: 900; margin: 0 0 6px; }
.sign-card .sl { color: #8a8a8a; font-size: 11.5px; padding: 16px 0 6px; border-bottom: 1px solid #dcdcdc; }
.sign-card .sl:last-child { border-bottom-color: #dcdcdc; margin-bottom: 8px; }
.sign-card.mini { width: 260px; }
.inv-end { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 26px; gap: 20px; }
.thanks { font-size: 17px; font-weight: 900; color: var(--red); }

/* pay card (invoice) */
.pay-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; border: 1px solid #e3e3e3; border-radius: 12px; padding: 12px 14px; }
.pay-card .ic-row { padding: 4px 0; font-size: 11.5px; }
.pay-card > div:first-child { flex: 1; }
.upi { text-align: center; font-size: 10.5px; color: #777; line-height: 1.4; }
.upi .qr { width: 104px; height: 104px; padding: 5px; border: 2px solid var(--red); border-radius: 10px; margin: 0 auto 6px; background: #fff; }
.upi .qr img, .upi .qr canvas { display: block; width: 90px; height: 90px; }

/* dark contact band */
.dg-band { background: #161618; border-radius: 12px; padding: 22px 26px; display: flex; justify-content: space-between; align-items: center; margin-top: 30px; }
.band-logo { display: flex; align-items: center; gap: 10px; }
.band-logo img { width: 34px; height: 34px; border-radius: 8px; }
.band-logo span { font: 800 22px 'Montserrat', 'Lato', sans-serif; color: #fff; letter-spacing: -.01em; }
.band-logo i { font-style: normal; color: var(--red); }

/* misc */
.rich p { margin: 0 0 8px; color: #333; }
.rich h4 { font-size: 13px; font-weight: 900; margin: 12px 0 6px; }
.rich ul { margin: 0 0 6px; padding-left: 16px; }
.rich li { margin: 0 0 5px; }
.scope { column-count: 2; column-gap: 28px; }
.page-break { break-after: page; page-break-after: always; height: 0; }
.doc .badge { font-size: 10px; padding: 3px 9px; }

/* public page */
body.public .toolbar { position: sticky; top: 10px; z-index: 10; box-shadow: 0 4px 16px rgba(0,0,0,.06); }

/* responsive */
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid2, .grid-svc, .totals-edit { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 640px) {
  .wrap { padding: 16px 12px 50px; }
  .topnav { padding: 8px 12px; gap: 10px; }
  .brand img { height: 24px; }
  .hide-sm { display: none; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .preset { flex-wrap: wrap; } .preset select { min-width: 0; }
  .items-head { display: none; }
  .item { grid-template-columns: 1fr 1fr 1fr 34px; }
  .item .it-desc { grid-column: 1 / -1; }
  .item .amt { grid-column: 1 / 4; text-align: right; padding-top: 0; }
  .item .del { grid-row: 2; grid-column: 4; }
  .tb-actions .btn { padding: 9px 12px; }
  .stat b { font-size: 17px; }
}

/* print (browser "Save as PDF" fallback) */
@media print {
  @page { size: A4; margin: 10mm 0 12mm; }
  body { background: #fff; }
  .topnav, .no-print, .toolbar, .flash, dialog { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .doc-scale { zoom: 1 !important; }
  .doc { box-shadow: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
