/* CoreDigital — app UI (live demo OMS + admin panel) */
:root {
  --navy: #0a1640; --navy2: #0f1f5c; --blue: #1d4ed8; --blue2: #2563eb; --cyan: #22d3ee;
  --ink: #0b1433; --text: #33405e; --muted: #6a7896; --bg: #f3f6fc; --card: #fff; --line: #e3e9f6;
  --wa: #25d366; --red: #dc2626; --green: #059669; --amber: #d97706;
  --grad: linear-gradient(100deg, #1d4ed8, #2563eb 40%, #06b6d4);
  --shadow: 0 1px 2px rgba(15,31,92,.05), 0 8px 24px -12px rgba(15,31,92,.16);
  --font: "Plus Jakarta Sans", "Noto Sans Sinhala", system-ui, -apple-system, Segoe UI, sans-serif;
  --side: 248px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue2); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); letter-spacing: -.01em; line-height: 1.25; }
p { margin: 0; }
button, input, select, textarea { font: inherit; }
.i { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: linear-gradient(180deg, var(--navy2), var(--navy)); color: #a9b8e0; display: flex; flex-direction: column; padding: 18px 14px; z-index: 40; transition: transform .3s; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; }
.side .brand b { color: var(--cyan); }
.side .brand .logo-mark { background: #fff; border-radius: 50%; padding: 2px; }
.side .brand small { display: block; font-size: .66rem; font-weight: 600; color: #8ea0d0; letter-spacing: .04em; }
.side .biz { margin: 0 4px 16px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.side .biz small { display: block; font-size: .68rem; color: #8ea0d0; text-transform: uppercase; letter-spacing: .08em; }
.side .biz b { color: #fff; font-size: .92rem; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #a9b8e0; font-weight: 600; font-size: .92rem; transition: background .2s, color .2s; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.on { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--cyan); }
.side nav a em { margin-left: auto; font-style: normal; font-size: .7rem; font-weight: 800; padding: 1px 8px; border-radius: 99px; background: var(--cyan); color: var(--navy); }
.side nav .sep { margin: 14px 12px 6px; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #6d80b8; }
.side .side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.side .promo { padding: 14px; border-radius: 16px; background: linear-gradient(140deg, #1d4ed8, #0891b2); color: #e0f2fe; font-size: .82rem; }
.side .promo b { display: block; color: #fff; font-size: .95rem; margin-bottom: 4px; }
.side .promo .btn { margin-top: 10px; width: 100%; background: #fff; color: var(--blue); }
.main { flex: 1; margin-left: var(--side); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: rgba(243,246,252,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 1.25rem; }
.topbar .sub { font-size: .82rem; color: var(--muted); }
.topbar .tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; align-items: center; justify-content: center; color: var(--ink); }
.content { padding: 24px 28px 60px; display: flex; flex-direction: column; gap: 20px; }
.demo-strip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 9px 28px; background: linear-gradient(90deg, #0f1f5c, #1d4ed8 60%, #0891b2); color: #dbeafe; font-size: .84rem; }
.demo-strip b { color: #fff; }
.demo-strip .pulse { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: ping 1.8s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.demo-strip .acts { margin-left: auto; display: flex; gap: 8px; }
.demo-strip a, .demo-strip button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: #fff; font-size: .8rem; font-weight: 700; cursor: pointer; }
.demo-strip .cta { background: #fff; color: var(--blue); border-color: #fff; }
.scrim { display: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: .88rem; cursor: pointer; white-space: nowrap; transition: transform .15s, box-shadow .2s, background .2s; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(37,99,235,.7); }
.btn-light { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-light:hover { border-color: #c7d6f8; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-danger { background: #fff; color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 6px 11px; font-size: .8rem; border-radius: 10px; }
.btn-icon { padding: 7px; border-radius: 10px; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-h h3 { font-size: 1rem; }
.card-h .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 18px 20px; }
.grid { display: grid; gap: 20px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: 1fr 1fr; }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 1.6fr; }

.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.kpi small { font-size: .8rem; color: var(--muted); font-weight: 600; }
.kpi b { font-size: 1.7rem; font-weight: 800; color: var(--ink); letter-spacing: -.03em; }
.kpi .ic { position: absolute; right: 16px; top: 16px; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 1.2rem; }
.kpi .trend { font-size: .76rem; font-weight: 700; }
.up { color: var(--green); } .down { color: var(--red); }
.ic-blue { background: #dbeafe; color: #1d4ed8; } .ic-amber { background: #fef3c7; color: #b45309; } .ic-violet { background: #ede9fe; color: #6d28d9; } .ic-green { background: #d1fae5; color: #047857; } .ic-cyan { background: #cffafe; color: #0e7490; } .ic-red { background: #fee2e2; color: #b91c1c; }

/* status pipeline */
.pipeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.pipeline a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); transition: transform .2s, border-color .2s; position: relative; overflow: hidden; }
.pipeline a:hover { transform: translateY(-2px); border-color: #bfd3fb; }
.pipeline a::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c); }
.pipeline small { font-size: .78rem; font-weight: 700; color: var(--muted); }
.pipeline b { font-size: 1.5rem; color: var(--ink); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.b-blue { background: #dbeafe; color: #1d4ed8; } .b-amber { background: #fef3c7; color: #b45309; } .b-violet { background: #ede9fe; color: #6d28d9; }
.b-green { background: #d1fae5; color: #047857; } .b-gray { background: #eef1f6; color: #64748b; } .b-red { background: #fee2e2; color: #b91c1c; }
.chan { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.chan i { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.chan-whatsapp i { background: #25d366; } .chan-facebook i { background: #1877f2; } .chan-instagram i { background: #e1306c; } .chan-tiktok i { background: #111827; } .chan-phone i { background: #f59e0b; } .chan-website i { background: #2563eb; }
.pay { font-size: .74rem; font-weight: 700; }
.pay.paid { color: var(--green); } .pay.unpaid { color: var(--amber); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 14px; background: #f8faff; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid #eef2fa; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: #f8fbff; }
.tbl tr.row-link { cursor: pointer; }
.tbl .code { font-weight: 800; color: var(--blue2); }
.tbl .cust b { display: block; color: var(--ink); font-weight: 700; }
.tbl .cust small { color: var(--muted); }
.tbl input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue2); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .i { width: 40px; height: 40px; color: #c7d6f8; margin-bottom: 8px; }

/* ---------- filters / forms ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 7px 13px; border-radius: 10px; font-weight: 700; font-size: .82rem; color: var(--muted); }
.tabs a:hover { background: #f1f5fd; }
.tabs a.on { background: var(--navy2); color: #fff; }
.tabs a em { font-style: normal; opacity: .7; margin-left: 4px; }
.search { position: relative; margin-left: auto; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 36px !important; width: 260px; }
.input, .field input, .field select, .field textarea, .search input, select.input { width: 100%; padding: 10px 12px; border-radius: 11px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-size: .9rem; transition: border-color .2s, box-shadow .2s; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .search input:focus { outline: none; border-color: var(--blue2); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .8rem; font-weight: 700; color: var(--ink); }
.field .hint { font-size: .76rem; color: var(--muted); font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .88rem; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--blue2); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.bulk { display: none; align-items: center; gap: 10px; padding: 10px 20px; background: #eef4ff; border-bottom: 1px solid #c7d6f8; font-weight: 600; font-size: .86rem; }
.bulk.on { display: flex; }
.bulk select { width: auto; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); font-size: .84rem; color: var(--muted); }
.pager .pg { display: flex; gap: 6px; }

/* flash / toast */
.flash { padding: 12px 16px; border-radius: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; animation: drop .4s; }
.flash.ok { background: #d1fae5; color: #065f46; } .flash.err { background: #fee2e2; color: #991b1b; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: .88rem; opacity: 0; transition: .3s; z-index: 100; box-shadow: 0 20px 40px -10px rgba(0,0,0,.4); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- charts ---------- */
.chart { position: relative; height: 240px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid-l { stroke: #eef2fa; }
.chart .ax { font-size: 10.5px; fill: var(--muted); }
.chart .ln { fill: none; stroke: var(--blue2); stroke-width: 2.5; stroke-linejoin: round; }
.chart .ar { fill: url(#cg); }
.chart .pt { fill: #fff; stroke: var(--blue2); stroke-width: 2; }
.chart .bar { fill: url(#bg); }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: .76rem; font-weight: 600; transform: translate(-50%, -120%); white-space: nowrap; opacity: 0; transition: opacity .15s; }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { width: 150px; height: 150px; flex: none; }
.legend { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: .84rem; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { margin-left: auto; color: var(--ink); }
.hbar { display: flex; flex-direction: column; gap: 12px; }
.hbar div { display: grid; grid-template-columns: 100px 1fr 40px; gap: 10px; align-items: center; font-size: .84rem; }
.hbar span { height: 10px; border-radius: 99px; background: #eef2fa; overflow: hidden; }
.hbar span i { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.hbar b { text-align: right; color: var(--ink); }

/* list items */
.list { display: flex; flex-direction: column; }
.list .li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid #eef2fa; }
.list .li:last-child { border-bottom: 0; }
.list .li b { color: var(--ink); }
.list .li .end { margin-left: auto; text-align: right; }
.av { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--grad); color: #fff; font-weight: 800; font-size: .8rem; }

/* ---------- order view ---------- */
.order-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.order-head h2 { font-size: 1.5rem; }
.order-head .tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.stepper { display: flex; align-items: flex-start; padding: 22px 20px 18px; }
.stepper .st { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; text-align: center; font-size: .8rem; color: var(--muted); }
.stepper .st::before { content: ""; position: absolute; top: 17px; left: -50%; right: 50%; height: 3px; background: #e3e9f6; z-index: 0; }
.stepper .st:first-child::before { display: none; }
.stepper .st.done::before { background: var(--blue2); }
.stepper .dot { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 3px solid #e3e9f6; color: #c2cde6; }
.stepper .st.done .dot { background: var(--blue2); border-color: var(--blue2); color: #fff; }
.stepper .st.cur .dot { box-shadow: 0 0 0 6px rgba(37,99,235,.15); }
.stepper .st b { color: var(--ink); font-size: .84rem; }
.stepper.halt .st.cur .dot { background: var(--red); border-color: var(--red); }
.timeline { display: flex; flex-direction: column; gap: 0; padding: 6px 20px 18px; }
.tl { display: flex; gap: 14px; position: relative; padding-bottom: 16px; }
.tl::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: #e3e9f6; }
.tl:last-child::before { display: none; }
.tl i { width: 14px; height: 14px; border-radius: 50%; background: var(--blue2); margin-top: 4px; flex: none; box-shadow: 0 0 0 4px #dbeafe; }
.tl b { display: block; color: var(--ink); font-size: .88rem; }
.tl small { color: var(--muted); font-size: .78rem; }
.items .li img { width: 40px; height: 40px; }
.thumb { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #e0ecff, #f0f9ff); color: var(--blue2); flex: none; font-weight: 800; font-size: .78rem; }
.totals { padding: 14px 20px; display: flex; flex-direction: column; gap: 6px; background: #f8faff; border-top: 1px solid var(--line); border-radius: 0 0 18px 18px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 1.1rem; font-weight: 800; color: var(--ink); padding-top: 6px; border-top: 1px dashed var(--line); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: .88rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); font-weight: 600; word-break: break-word; }
.status-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.status-pick label { cursor: pointer; }
.status-pick input { display: none; }
.status-pick span { display: block; text-align: center; padding: 9px 6px; border-radius: 11px; border: 1.5px solid var(--line); font-weight: 700; font-size: .8rem; transition: .15s; }
.status-pick input:checked + span { border-color: var(--blue2); background: #eef4ff; color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* ---------- new order ---------- */
.paste-box { border: 2px dashed #86efac; background: linear-gradient(180deg, #f0fdf4, #fff); border-radius: 18px; padding: 18px; }
.paste-box h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.paste-box h3 .i { color: var(--wa); }
.paste-box textarea { width: 100%; min-height: 130px; margin: 12px 0; padding: 12px; border-radius: 12px; border: 1.5px solid #bbf7d0; background: #fff; resize: vertical; font-size: .9rem; }
.paste-box textarea:focus { outline: none; border-color: var(--wa); box-shadow: 0 0 0 4px rgba(37,211,102,.15); }
.paste-box .row { display: flex; gap: 8px; flex-wrap: wrap; }
.detected { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.detected span { padding: 4px 10px; border-radius: 99px; background: #dcfce7; color: #166534; font-size: .76rem; font-weight: 700; animation: drop .3s; }
.lines { display: flex; flex-direction: column; gap: 8px; }
.line { display: grid; grid-template-columns: 1fr 90px 120px 36px; gap: 8px; align-items: center; }
.line .amt { text-align: right; font-weight: 700; color: var(--ink); font-size: .9rem; }
.summary { display: flex; flex-direction: column; gap: 8px; font-size: .92rem; }
.summary div { display: flex; justify-content: space-between; }
.summary .grand { font-size: 1.25rem; font-weight: 800; color: var(--ink); border-top: 1px dashed var(--line); padding-top: 10px; }
.flashy { animation: glow 1.2s; }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,.6); background: #f0fdf4; } 100% { box-shadow: 0 0 0 10px rgba(37,211,102,0); } }

/* products */
.stock-cell { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.stock-cell .meter { height: 6px; border-radius: 99px; background: #eef2fa; overflow: hidden; }
.stock-cell .meter i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.stock-cell.low .meter i { background: var(--red); }
.stock-cell.low b { color: var(--red); }
.qty-adj { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty-adj button { border: 0; background: #f8faff; width: 30px; height: 30px; font-weight: 800; color: var(--ink); cursor: pointer; }
.qty-adj button:hover { background: #eef4ff; }

/* modal */
dialog.modal { border: 0; border-radius: 22px; padding: 0; width: min(560px, 94vw); box-shadow: 0 40px 80px -20px rgba(0,0,0,.45); }
dialog.modal::backdrop { background: rgba(10,22,64,.45); backdrop-filter: blur(3px); }
.modal .card-h { border-bottom: 1px solid var(--line); }
.modal form { margin: 0; }
.modal .x { margin-left: auto; border: 0; background: #f1f5fd; width: 32px; height: 32px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(800px 500px at 80% 0%, #1e3a8a, transparent 70%), radial-gradient(600px 400px at 0% 100%, rgba(34,211,238,.25), transparent 70%), var(--navy); }
.auth .card { width: min(420px, 100%); padding: 34px; }
.auth .brand { display: flex; align-items: center; gap: 10px; justify-content: center; font-size: 1.3rem; font-weight: 700; color: var(--navy2); margin-bottom: 6px; }
.auth .brand b { color: var(--blue2); }
.auth h1 { text-align: center; font-size: 1.1rem; margin-bottom: 22px; color: var(--muted); font-weight: 600; }
.auth form { display: flex; flex-direction: column; gap: 14px; }

/* ---------- invoice / tracking (standalone) ---------- */
.sheet { max-width: 820px; margin: 30px auto; background: #fff; border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.sheet-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 34px 40px; background: linear-gradient(120deg, var(--navy2), var(--blue)); color: #c9d6ff; }
.sheet-h h1 { color: #fff; font-size: 2rem; letter-spacing: .04em; }
.sheet-h .brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.2rem; }
.sheet-h .brand .logo-mark { background: #fff; border-radius: 50%; padding: 2px; }
.sheet-b { padding: 30px 40px; }
.sheet .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 26px; }
.sheet .meta h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
.sheet .tbl th { background: #f3f6fc; }
.sheet .tot { margin-left: auto; width: 280px; margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.sheet .tot div { display: flex; justify-content: space-between; }
.sheet .tot .grand { font-size: 1.2rem; font-weight: 800; color: var(--ink); border-top: 2px solid var(--ink); padding-top: 8px; }
.sheet-f { padding: 20px 40px 30px; display: flex; justify-content: space-between; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); }
.print-bar { max-width: 820px; margin: 20px auto 0; display: flex; gap: 10px; justify-content: flex-end; padding: 0 10px; }
.stamp { display: inline-block; padding: 6px 14px; border: 3px solid var(--green); color: var(--green); border-radius: 10px; font-weight: 800; letter-spacing: .1em; transform: rotate(-6deg); }
.stamp.unpaid { border-color: var(--amber); color: var(--amber); }
.track-page { min-height: 100vh; padding: 30px 16px; background: radial-gradient(800px 400px at 50% 0%, #dbeafe, transparent 70%), var(--bg); }
.track-card { max-width: 560px; margin: 0 auto; }
.track-card .hero-st { padding: 28px; text-align: center; }
.track-card .big-ic { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; background: var(--grad); color: #fff; font-size: 2rem; box-shadow: 0 16px 30px -10px rgba(37,99,235,.6); }
.track-card .big-ic .i { width: 36px; height: 36px; }

@media print {
  body { background: #fff; }
  .print-bar, .no-print { display: none !important; }
  .sheet { box-shadow: none; margin: 0; max-width: none; border-radius: 0; }
  .sheet-h { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .side { transform: translateX(-100%); }
  .app.nav-open .side { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10,22,64,.4); z-index: 35; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .g3, .g2, .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .demo-strip { padding: 8px 16px; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; }
}
@media (max-width: 600px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 14px; } .kpi b { font-size: 1.3rem; } .kpi .ic { display: none; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .line { grid-template-columns: 1fr 70px 36px; }
  .line .amt { display: none; }
  .topbar .tools .btn span { display: none; }
  .topbar h1 { font-size: 1.05rem; }
  .demo-strip .txt { display: none; }
  .demo-strip .acts { margin-left: 0; }
  .stepper .st b { font-size: .72rem; }
  .stepper .st small { display: none; }
  .sheet-h, .sheet-b, .sheet-f { padding: 22px; }
  .sheet .meta { grid-template-columns: 1fr; }
  .tbl.cards thead { display: none; }
  .tbl.cards tr { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; padding: 12px 16px; border-bottom: 1px solid #eef2fa; }
  .tbl.cards td { padding: 0; border: 0; }
  .tbl.cards td.hide-m { display: none; }
  .status-pick { grid-template-columns: repeat(2, 1fr); }
}
