/* Pak Madina Books · warm paper, muted sage, forest green. */
@font-face { font-family: "Barlow"; src: url(fonts/Barlow-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(fonts/Barlow-Medium.ttf) format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(fonts/Barlow-SemiBold.ttf) format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(fonts/Barlow-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Cond"; src: url(fonts/BarlowSemiCondensed-SemiBold.ttf) format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Cond"; src: url(fonts/BarlowSemiCondensed-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --navy: #587464; --navy-dk: #3E574A; --red: #A75B52; --amber: #B78D5B; --green: #718B78;
  --ink: #28352E; --muted: #69746D; --line: #E3E7E0; --field: #CBD3CA; --bg: #F4F5F1; --tint: #E8EDE7;
  --green-soft: #E7ECE6; --red-soft: #F5EBE8; --amber-soft: #F5F0E5; --amber-ink: #796042; --warm: #F4F1EB;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --cond: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 20px; height: 20px; flex: none; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.b { font-weight: 700; }
.good { color: var(--green) !important; }
.bad { color: var(--red) !important; }
.warnc { color: var(--amber-ink) !important; }
.navy { color: var(--navy) !important; }
.mt { margin-top: 14px; }

.booting { display: grid; place-items: center; height: 100%; }
.boot { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.boot img { width: 40px; height: 40px; }
.noscript { padding: 24px; }

/* ---------------- sign in ---------------- */
.signin-wrap { min-height: 100%; display: grid; place-items: start center; padding: 40px 16px; }
.signin { width: 100%; max-width: 940px; }
.si-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.si-brand img { width: 46px; height: 46px; }
.si-brand b { display: block; font: 700 22px/1 var(--cond); color: var(--navy); }
.si-brand span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--red); font-weight: 700; }
.signin h1 { font: 700 34px/1.1 var(--cond); color: var(--navy); margin: 0 0 8px; }
.lead { color: var(--muted); max-width: 640px; margin: 0 0 22px; font-size: 16px; }
.si-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.si-card { display: flex; flex-direction: column; gap: 10px; }
.si-h { display: flex; align-items: center; gap: 10px; color: var(--navy); }
.si-h svg { width: 24px; height: 24px; }
.si-h h2 { margin: 0; font: 700 21px/1.2 var(--cond); }
.qr { width: 230px; height: 230px; align-self: center; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; overflow: hidden; }
.qr svg { width: 100%; height: 100%; }
.qr-wait { color: var(--muted); font-size: 14px; }
.steps { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.lbl { font-weight: 600; font-size: 14px; }
textarea { width: 100%; font: 600 18px/1.5 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; border: 1.5px solid var(--field); border-radius: 12px; padding: 12px 14px; color: var(--navy); resize: vertical; margin-top: 6px; }
textarea:focus { border-color: var(--navy); outline: none; }
.err { color: var(--red); font-weight: 600; min-height: 1.4em; margin: 0; }
.keep { display: flex; align-items: center; gap: 8px; margin-top: 18px; font-weight: 600; }
.keep input { width: 18px; height: 18px; accent-color: var(--navy); }
.foot { margin-top: 10px; }

/* ---------------- buttons, pills ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid transparent; border-radius: 12px; padding: 11px 18px; font-weight: 700; cursor: pointer; min-height: 46px; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-dk); }
.btn.primary:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--field); }
.btn.ghost:hover { border-color: var(--navy); }
.btn.danger { background: #fff; color: var(--red); border-color: #E7B9B4; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { min-height: 38px; padding: 7px 12px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; line-height: 1.4; }
.pill.good { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber-ink); }
.pill.redsoft { background: var(--red-soft); color: var(--red); }
.pill.red { background: var(--red); color: #fff; }
.pill.navy { background: var(--tint); color: var(--navy); }
.pill.grey { background: #EEF1F2; color: var(--muted); }
.pill + .pill { margin-left: 6px; }

/* ---------------- shell ---------------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100%; }
.side { background: var(--navy-dk); color: #fff; display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 8px 18px; }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 6px; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
.brand b { display: block; font: 700 19px/1.1 var(--cond); }
.brand span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #F0A49C; font-weight: 700; }
#nav { display: grid; gap: 2px; }
#nav a { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.78); padding: 10px 12px; border-radius: 10px; font-weight: 600; }
#nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
#nav a.on { background: #fff; color: var(--navy); }
.side-foot { margin-top: auto; display: grid; gap: 12px; padding: 0 6px; }
.sync { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,.85); }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: #9FB3BF; }
.sync.ok i { background: #6FD08C; }
.sync.bad i { background: #FF8A7D; }
.sync small { width: 100%; color: #FFC2BA; }
.ro { display: flex; gap: 8px; font-size: 12px; color: rgba(255,255,255,.6); margin: 0; line-height: 1.4; }
.ro svg { width: 15px; height: 15px; margin-top: 1px; }

.main { min-width: 0; display: flex; flex-direction: column; height: 100vh; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 28px; background: #fff; border-bottom: 1px solid var(--line); }
.top-t { display: flex; align-items: center; gap: 12px; min-width: 0; }
.top h1 { margin: 0; font: 700 26px/1.1 var(--cond); color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.top-a { display: flex; gap: 8px; align-items: center; }
.back { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--bg); flex: none; }
.content { flex: 1; overflow-y: auto; padding: 22px 28px 48px; }

/* ---------------- cards, rows ---------------- */
.grid { display: grid; gap: 18px; align-items: start; }
.grid.home { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); }
.grid.pnl { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid.comp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.col { display: grid; gap: 12px; min-width: 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.orders-page { display: grid; gap: 16px; max-width: 940px; }
.projections h2, .shopping-day h2 { margin: 0; color: var(--navy); font-family: var(--cond); }
.shopping-day h2 { font-size: 25px; text-decoration: underline; margin-bottom: 16px; }
.projection { background: #f3f7f8; border-radius: 12px; padding: 14px; margin-top: 12px; }
.order-line { display: flex; justify-content: space-between; gap: 18px; padding: 6px 0; }
.customer-order { display: block; width: 100%; border: 0; border-radius: 12px; background: #f3f7f8; color: var(--ink); text-align: left; padding: 12px 14px; margin-top: 8px; cursor: pointer; font: inherit; }
.customer-order:hover { background: #e9f1f3; }
.customer-order > b { display: block; font-size: 16px; color: var(--navy); }
.customer-order > small { display: block; color: var(--muted); margin-top: 5px; }
.route-day { display: grid; gap: 12px; }
.route-day h2 { text-decoration: none; margin: 0; }
.route-head, .route-cap, .box-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.route-head > div > span { display: block; color: var(--muted); margin-top: 2px; }
.shopping-total { background: var(--tint); border-radius: 12px; padding: 13px 15px; }
.shopping-total h3 { margin: 0 0 5px; color: var(--navy); font: 700 19px/1.25 var(--cond); }
.shopping-total .cap { margin: 0 0 3px; }
.box-total { border-top: 1px solid rgba(23,56,76,.16); margin-top: 6px; padding-top: 8px; color: var(--navy); text-transform: uppercase; letter-spacing: .04em; }
.box-total strong { font-size: 19px; letter-spacing: 0; text-transform: none; }
.route-cap > span { color: var(--muted); font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase; font-weight: 700; }
.route-cap .btn svg { width: 17px; height: 17px; }
.route-list { display: grid; gap: 7px; }
.route-stop { display: grid; grid-template-columns: 34px 32px minmax(0,1fr); gap: 8px; align-items: start; border-radius: 12px; padding: 10px; background: #fff; border: 1px solid var(--line); transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.route-stop.done { grid-template-columns: 32px minmax(0,1fr); background: var(--green-soft); }
.route-stop.dragging { opacity: .82; transform: scale(1.01); box-shadow: 0 10px 26px rgba(15,41,56,.18); }
.route-stop.drag-over { transform: translateY(5px); border-color: var(--navy); }
.drag { display: grid; place-items: center; width: 34px; height: 40px; border-radius: 9px; background: var(--tint); color: var(--navy); font-size: 23px; font-weight: 800; cursor: grab; user-select: none; }
.drag:active { cursor: grabbing; }
.stop-num { display: grid; place-items: center; width: 30px; height: 30px; margin-top: 5px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; }
.stop-num svg { width: 18px; height: 18px; }
.stop-num.done { background: var(--green); }
.stop-info { border: 0; background: none; color: inherit; text-align: left; padding: 1px 0; cursor: pointer; font: inherit; min-width: 0; }
.stop-info > b { display: block; color: var(--navy); font-size: 17px; }
.route-stop.done .stop-info > b { color: var(--green); }
.stop-info > small { display: block; color: var(--muted); margin-top: 2px; }
.stop-info .order-line { padding: 3px 0; color: var(--muted); }
.stop-info .order-line b { color: var(--navy); }
.stop-actions { grid-column: 3; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 4px; }
.route-stop.done .stop-actions { grid-column: 2; }
.stop-action { display: flex; justify-content: center; align-items: center; gap: 6px; border: 0; border-radius: 9px; background: var(--tint); color: var(--navy); padding: 8px 10px; cursor: pointer; font: 700 13px var(--body); }
.stop-action svg { width: 17px; height: 17px; }
.stop-action.on { background: var(--green); color: #fff; }
.route-complete { display: grid; justify-items: center; gap: 4px; padding: 18px; border-radius: 12px; background: var(--green-soft); color: var(--green); }
.route-complete > svg { width: 28px; height: 28px; }
.route-complete > b { font: 700 23px var(--cond); }
.route-complete > span { margin-bottom: 4px; }
.order-products { display: grid; gap: 7px; max-height: 310px; overflow: auto; padding: 4px 1px; }
.order-product { display: grid; grid-template-columns: auto 1fr 85px; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; }
.order-product input[type=number] { width: 100%; }
.order-home { margin-bottom: 12px; }
.card.flush { padding: 0; overflow: hidden; }
.cap { font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.big { font: 700 42px/1.05 var(--cond); color: var(--navy); font-variant-numeric: tabular-nums; }
.hero { display: block; color: inherit; }
.hero:hover, .hero-in:hover { text-decoration: none; }
.hero-in { display: block; color: inherit; }
.minis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.minis span { background: var(--tint); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.minis span:hover { background: #DCE6EC; }
.minis small { display: block; font-size: 12.5px; color: var(--muted); }
.minis b { font-size: 17px; font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; color: var(--ink); }
.row:hover { text-decoration: none; border-color: var(--field); }
.row .grow, .cust-h .grow, .pk-h .grow { flex: 1; min-width: 0; }
.row b, .cust-h b, .pk-h b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row small, .cust-h small, .pk-h small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .end, .cust-h .end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.big2 { font: 700 21px/1 var(--cond); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.red { background: var(--red); } .dot.amber { background: var(--amber); }
.ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.ic.navy { background: var(--tint); color: var(--navy); }
.ic.green { background: var(--green-soft); color: var(--green); }
.ic.amber { background: var(--amber-soft); color: var(--amber-ink); }
.ic.red { background: var(--red-soft); color: var(--red); }
.sec { font: 700 15px/1.2 var(--body); color: var(--navy); margin: 8px 0 8px; }
.feed { display: grid; gap: 8px; }
.day { font-size: 14px; color: var(--navy); margin: 10px 0 0; position: sticky; top: -22px; background: var(--bg); padding: 6px 0 2px; z-index: 1; }
.banner { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--r); padding: 12px 14px; }
.banner.warn { background: var(--amber-soft); color: var(--amber-ink); }
.banner b { display: block; }
.banner span { font-size: 13.5px; }
.banner:hover { text-decoration: none; }
.empty { display: grid; gap: 4px; text-align: center; padding: 40px 16px; color: var(--muted); }
.empty b { color: var(--ink); font-size: 17px; }

/* ---------------- P&L lines ---------------- */
.pl-line { display: flex; align-items: center; gap: 6px; padding: 8px 0 6px; color: var(--ink); }
.pl-line:hover { text-decoration: none; }
a.pl-line:hover .l { text-decoration: underline; }
.pl-line .l { flex: 1; min-width: 0; }
.pl-line .l small { display: block; color: var(--muted); font-size: 12.5px; }
.pl-line .v { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-line svg { width: 14px; height: 14px; color: var(--muted); }
.pl-line.bold .l { font-weight: 700; }
.pl-line.bold .v { font-weight: 700; font-size: 16.5px; }
.pl-line.sub { padding: 3px 0 3px 14px; }
.pl-line.sub .l { color: var(--muted); font-size: 14px; }
.rule { height: 1px; background: var(--line); margin: 10px 0 2px; }
.rule.navy { height: 1.5px; background: var(--navy); }
.warnline { display: block; color: var(--amber-ink); font-size: 13px; font-weight: 600; padding-bottom: 4px; }
.okline { display: flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; font-size: 13.5px; margin: 8px 0 0; }
.okline svg { width: 16px; height: 16px; }
.textlink { display: inline-block; margin-top: 8px; font-weight: 700; }

.pnl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg a { padding: 8px 14px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.seg a:hover { text-decoration: none; color: var(--navy); }
.seg a[aria-selected="true"] { background: var(--navy); color: #fff; }
.seg.wide { margin-bottom: 14px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper b { min-width: 170px; text-align: center; color: var(--navy); }
.ib { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.custom { display: flex; align-items: center; gap: 8px; }
select, input[type=date], .search input { font: 600 14px var(--body); color: var(--ink); background: #fff; border: 1px solid var(--field); border-radius: 10px; padding: 8px 10px; min-height: 40px; }
.legend { display: flex; gap: 16px; font-size: 12.5px; margin-top: 4px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend i.amber { background: var(--amber); } .legend i.green { background: var(--green); }
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--field); }
.chart .b-amber { fill: var(--amber); } .chart .b-green { fill: var(--green); } .chart .b-red { fill: var(--red); opacity: .85; }
.chart .revline { stroke: var(--navy); stroke-width: 2; }
.chart text { font: 600 12px var(--body); text-anchor: middle; }
.chart .mlab { fill: var(--muted); }
.chart .plab { fill: var(--green); font: 700 13px var(--cond); }
.chart .llab { fill: var(--red); font: 700 13px var(--cond); }

/* ---------------- lists ---------------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.search { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--field); border-radius: 10px; padding-left: 10px; flex: 1; min-width: 220px; max-width: 420px; }
.search svg { color: var(--muted); width: 18px; height: 18px; }
.search input { border: 0; flex: 1; min-width: 0; outline: none; }
.totals { display: flex; gap: 28px; margin: 4px 0 14px; }
.totals small { display: block; color: var(--muted); font-size: 12.5px; }
.totals b { font: 700 24px/1.1 var(--cond); color: var(--navy); font-variant-numeric: tabular-nums; }
table.list { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.list th { text-align: left; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FAFBFB; }
.list td { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list tbody tr:last-child td { border-bottom: 0; }
.list tbody tr[data-href] { cursor: pointer; }
.list tbody tr[data-href]:hover td { background: #F7FAFB; }
.list .n { text-align: right; }
.list td.wrap { white-space: normal; }
.list a { font-weight: 600; }
.list.tight td, .list.tight th { padding: 7px 10px; }
.list tfoot td { font-weight: 600; padding: 8px 10px; border-top: 1px solid var(--line); }
.mini-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink); }
.mini-row:first-of-type { border-top: 0; }
.mini-row small { display: block; color: var(--muted); font-size: 12.5px; }
.mini-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini-row.link:hover { text-decoration: none; background: #F7FAFB; }
.payment-proof-card { padding: 0 0 12px; border-top: 1px solid var(--line); }
.payment-proof-card:first-of-type { border-top: 0; }
.payment-proof-card .mini-row { border-top: 0; }
.proof-view-btn { width: 100%; margin-top: 8px; }
.cust-h, .pk-h { display: flex; align-items: center; gap: 12px; color: var(--ink); padding-bottom: 6px; }
.cust-h:hover, .pk-h:hover { text-decoration: none; }
.cust, .pickup { margin-bottom: 10px; }
.total-card { margin-top: 14px; }
.st { display: flex; gap: 6px; margin-bottom: 8px; }
.note { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin: 10px 0 0; white-space: pre-wrap; }
details summary { cursor: pointer; font-weight: 600; }
details pre { white-space: pre-wrap; font: 13px/1.5 ui-monospace, Menlo, monospace; color: var(--muted); max-height: 360px; overflow: auto; }

/* ---------------- invoice + bill pages ---------------- */
.inv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.inv-side { display: grid; gap: 12px; position: sticky; top: 0; }
.sheet-wrap { overflow: hidden; }
.bill-layout { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 18px; align-items: start; }
.photo { display: grid; gap: 12px; place-items: center; min-height: 160px; }
.photo img { max-width: 100%; max-height: 78vh; border-radius: 8px; border: 1px solid var(--line); display: block; }

/* The invoice page itself, in points so it prints on Letter exactly like the phone's PDF. */
.sheet { --accent: #17384C; width: 612pt; min-height: 792pt; background: #fff; color: #1D2B34; position: relative; padding: 39pt 42pt 70pt; transform-origin: top left; box-shadow: 0 1px 2px rgba(15,41,56,.08), 0 12px 40px rgba(15,41,56,.12); font-family: "Barlow", Arial, sans-serif; font-size: 10.5pt; line-height: 1.25; }
.sheet .lab { font-size: 7.5pt; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #5E6970; }
.sheet .lab.red { color: #B33B30; font-size: 7.9pt; }
.iv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18pt; }
.iv-brand { display: flex; align-items: flex-start; gap: 10.5pt; min-width: 0; }
.iv-logo { height: 48pt; max-width: 124pt; object-fit: contain; flex: none; }
.iv-logo.sq { width: 48pt; }
.iv-name { font: 700 23.25pt/1 var(--cond); color: var(--accent); margin-top: 1pt; }
.iv-tag { font-size: 7.9pt; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #B33B30; margin-top: 6pt; }
.iv-contact { font-size: 9pt; color: #5E6970; margin-top: 3pt; max-width: 270pt; line-height: 1.3; }
/* Halal sticker: inline after the tagline, 2.2× its font size (owner's pick) */
.iv-tag { display: flex; align-items: center; gap: 3pt; margin-top: 3pt; }
.iv-halal { width: 2.2em; height: 2.2em; flex: none; }
.iv-title { text-align: right; flex: none; }
.iv-title .t { font: 700 34.5pt/.95 var(--cond); letter-spacing: .14em; color: var(--accent); margin-right: -.14em; }
.iv-title .no { font: 600 14.25pt/1 var(--cond); letter-spacing: .03em; color: #B33B30; margin-top: 7pt; }
.iv-rule { height: 2.25pt; background: var(--accent); margin-top: 14pt; position: relative; }
.iv-rule span { position: absolute; left: 0; top: 0; height: 2.25pt; width: 57pt; background: #B33B30; }
.iv-meta { display: grid; grid-template-columns: repeat(4, 1fr); background: #F4F1EB; margin-top: 13.5pt; }
.iv-meta > div { padding: 8.25pt 9pt 9pt 12pt; border-left: .75pt solid #E3DED4; min-height: 42.75pt; }
.iv-meta > div:first-child { border-left: 0; }
.iv-meta .val { font-size: 11.25pt; font-weight: 600; margin-top: 4pt; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iv-meta .val.big { font: 700 16.5pt/1 var(--cond); color: var(--accent); margin-top: 2pt; }
.iv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 30pt; margin-top: 18pt; position: relative; }
.iv-parties .pn { font: 700 15.75pt/1.15 var(--cond); color: var(--accent); margin-top: 4pt; }
.iv-parties .pl { font-size: 9.75pt; color: #5E6970; margin-top: 2pt; line-height: 1.35; }
.iv-stamp { position: absolute; left: 466pt; top: 27pt; transform: translate(-50%, -50%) rotate(-9deg); border: 2.25pt solid #14632E; color: #14632E; border-radius: 4.5pt; background: rgba(255,255,255,.85); text-align: center; padding: 5pt 12pt 6pt; }
.iv-stamp b { display: block; font: 700 30pt/1 var(--cond); letter-spacing: .22em; margin-right: -.22em; }
.iv-stamp span { font-size: 7.5pt; font-weight: 700; letter-spacing: .12em; white-space: nowrap; }
.iv-items { width: 100%; border-collapse: collapse; margin-top: 18pt; table-layout: fixed; font-variant-numeric: tabular-nums; }
.iv-items .c-ix { width: 27pt; } .iv-items .c-pr { width: 243pt; } .iv-items .c-cs { width: 40pt; } .iv-items .c-kg { width: 60pt; } .iv-items .c-pc { width: 75pt; } .iv-items .c-am { width: 83pt; }
.iv-items thead { display: table-header-group; }
.iv-items th { font-size: 7.9pt; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--accent); text-align: left; padding: 0 0 4pt; border-bottom: 1.5pt solid var(--accent); }
.iv-items th:first-child, .iv-items td.ix { padding-left: 7.5pt; }
.iv-items th:last-child, .iv-items td:last-child { padding-right: 7.5pt; }
.iv-items td { padding: 8.25pt 0; border-bottom: .75pt solid #D8DDDF; vertical-align: top; font-size: 10.5pt; }
.iv-items tbody tr:nth-child(even) td { background: #FAF9F6; }
.iv-items tr { break-inside: avoid; }
.iv-items .n { text-align: right; white-space: nowrap; }
.iv-items td.ix { color: #5E6970; }
.iv-items td.pr b { display: block; font-weight: 600; }
.iv-items td.pr span { display: block; font-size: 8.6pt; color: #5E6970; margin-top: 1.5pt; }
.iv-items td.amt { font-weight: 600; }
.iv-sum { display: grid; grid-template-columns: 281pt 217.5pt; justify-content: space-between; margin-top: 16pt; break-inside: avoid; }
.iv-left .wt { font-size: 9.75pt; color: #5E6970; }
.iv-pay { border: .75pt solid #D8DDDF; padding: 11.25pt; margin-top: 10.5pt; }
.iv-pay .m { font-size: 11.25pt; font-weight: 600; margin-top: 5pt; }
.iv-pay .e { font-size: 11.25pt; font-weight: 700; color: var(--accent); margin-top: 3pt; }
.iv-pay .s { font-size: 9pt; color: #5E6970; margin-top: 4pt; }
.iv-tot .row { all: unset; display: flex; justify-content: space-between; font-size: 10.5pt; padding: 4.5pt 0 3.5pt; border-bottom: .75pt solid #D8DDDF; font-variant-numeric: tabular-nums; }
.iv-tot .row span:first-child { color: #5E6970; }
.iv-box { background: var(--accent); color: #fff; padding: 12pt 13.5pt; margin-top: 9pt; }
.iv-box.paid { background: #14632E; }
.iv-box .bx-l { font-size: 7.9pt; font-weight: 700; letter-spacing: .14em; color: rgba(255,255,255,.8); }
.iv-box .bx-v { font: 700 27pt/1.05 var(--cond); margin-top: 5pt; font-variant-numeric: tabular-nums; }
.iv-box .bx-s { font-size: 9pt; color: rgba(255,255,255,.9); margin-top: 3pt; }
.iv-notes { margin-top: 15pt; break-inside: avoid; }
.iv-notes p { margin: 4pt 0 0; font-size: 9.75pt; white-space: pre-wrap; }
.iv-pod { display: grid; grid-template-columns: 1fr; margin-top: 21pt; break-inside: avoid; }
.iv-pod .received-note { font-size: 8.25pt; word-spacing: 1pt; color: #5E6970; margin-bottom: 3pt; transform: translateY(-3pt); }
.iv-pod .sig { width: 72%; height: 60pt; border-bottom: 1.1pt solid #1D2B34; margin-top: 9pt; position: relative; }
.iv-pod .sig img { position: absolute; left: 6pt; bottom: 4pt; max-width: 85%; max-height: 53pt; }
.iv-pod .cap { font-size: 8.6pt; color: #5E6970; margin-top: 4pt; letter-spacing: 0; text-transform: none; font-weight: 400; }
.iv-foot { position: absolute; left: 42pt; right: 42pt; bottom: 18pt; border-top: .75pt solid #D8DDDF; padding-top: 8pt; display: flex; justify-content: space-between; align-items: flex-start; gap: 16pt; }
.iv-foot .ty { flex: 0 0 200pt; font: 600 12.75pt/1.1 var(--cond); color: var(--accent); }
.iv-foot .c { font-size: 8.25pt; color: #5E6970; text-align: right; line-height: 1.35; }
.iv-foot .terms { flex: 0 0 312pt; white-space: nowrap; }
.iv-foot .c.mid { text-align: left; }
.iv-foot .c b { color: #1D2B34; font-weight: 600; }

/* ---------------- editing: forms, pop-ups, editors ---------------- */
.fld { display: grid; gap: 5px; min-width: 0; }
.fld > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.fld input, .fld select, .fld textarea, .editor input, .editor select, .editor textarea { font: 500 15px var(--body); color: var(--ink); background: #fff; border: 1.5px solid var(--field); border-radius: 10px; padding: 9px 11px; min-height: 42px; width: 100%; }
.fld textarea, .editor textarea { resize: vertical; line-height: 1.4; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .editor input:focus, .editor select:focus, .editor textarea:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(23,56,76,.12); }
.editor input.bad, .stepper-in.bad { border-color: var(--red) !important; background: var(--red-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--navy); flex: none; }
.check input[type=date] { min-height: 34px; padding: 4px 8px; width: auto; }
.check.small { font-size: 13px; font-weight: 500; color: var(--muted); margin: 2px 0 6px; }
.form { display: grid; gap: 12px; }
.narrow { max-width: 760px; }
.btn.primary.sm, .btn.danger.sm { min-height: 38px; padding: 7px 14px; font-size: 14px; }
.btn.ghost[disabled] { opacity: .5; cursor: default; }
label.btn { cursor: pointer; }
.top-a .btn.primary { color: #fff; }
.top-a a.btn:hover { text-decoration: none; }
.act-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.act-grid .btn { width: 100%; }
.end-row { display: inline-flex; align-items: center; gap: 6px; }
.x { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
.x:hover { background: var(--red-soft); color: var(--red); }
.linkish { color: var(--navy); text-decoration: underline; cursor: pointer; }
.mini-row > a { color: var(--ink); }
.ed-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.ed-actions.left { justify-content: flex-start; margin: 0 0 12px; }
.tabs { margin-bottom: 16px; flex-wrap: wrap; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--navy-dk); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: all .2s; z-index: 50; max-width: min(560px, calc(100vw - 32px)); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--red); }

dialog.modal { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--ink); }
dialog.modal.wide { width: min(820px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(15,41,56,.45); }
.m-form { padding: 22px 24px 18px; display: grid; gap: 12px; }
.m-form h2 { margin: 0; font: 700 23px/1.2 var(--cond); color: var(--navy); }
.m-body { display: grid; gap: 12px; }
.m-actions { display: flex; justify-content: flex-end; gap: 10px; }
.send-btns { display: grid; gap: 8px; }
.sigpad { width: 100%; height: auto; aspect-ratio: 3 / 1; border: 1.5px dashed var(--field); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; }

.editor { display: grid; gap: 14px; }
.ed-top { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(140px, 1fr)); gap: 12px; align-items: end; }
.ed-top .full { grid-column: 1 / -1; margin: 0; }
.repeat { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--tint); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.chip { border: 1.5px solid var(--navy); background: #fff; color: var(--navy); font-weight: 700; border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.chip:hover { background: var(--tint); }
.chip.ghost { border-style: dashed; color: var(--muted); border-color: var(--field); }
.tablewrap { overflow-x: auto; }
table.lines { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 960px; }
.lines th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 6px; border-bottom: 1px solid var(--line); }
.lines td { padding: 8px 6px 2px; vertical-align: top; }
.lines .n { text-align: right; }
.lines td.ix { color: var(--muted); padding-top: 18px; }
.lines td.b { padding-top: 18px; font-size: 16px; }
.lines td.pn { min-width: 200px; }
.lines td.pn input { font-weight: 700; }
.lines td.pn input.sm { margin-top: 4px; font-size: 13px; font-weight: 500; min-height: 32px; padding: 5px 9px; }
.lines input.num { width: 104px; text-align: right; }
.lines td [data-out="kg"] { display: inline-block; padding-top: 10px; font-weight: 600; }
.lines td > .muted { display: inline-block; padding-top: 10px; }
.seg.mini { padding: 2px; border-radius: 10px; }
.seg.mini button { border: 0; background: none; font: 600 12.5px var(--body); color: var(--muted); padding: 7px 9px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.seg.mini button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.stepper-in { display: inline-flex; align-items: center; border: 1.5px solid var(--field); border-radius: 10px; overflow: hidden; background: #fff; }
.stepper-in button { width: 34px; height: 40px; border: 0; background: var(--tint); color: var(--navy); font-size: 20px; font-weight: 700; cursor: pointer; }
.stepper-in input { width: 54px !important; border: 0 !important; border-radius: 0 !important; text-align: center; min-height: 40px !important; padding: 0 !important; box-shadow: none !important; }
.wrow td { padding: 0 6px 10px; border-bottom: 1px solid var(--line); }
.wrow [data-out="warn"] { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.wrow [data-out="warn"] span { color: var(--amber-ink); font-weight: 600; }
.wrow [data-out="warn"] span.math { color: var(--muted); font-weight: 500; }
.ed-bottom { display: flex; gap: 20px; align-items: flex-end; }
.ed-bottom .grow { flex: 1; }
.ed-tot { text-align: right; display: grid; gap: 2px; }
.ed-tot span { color: var(--muted); font-size: 14px; }
.ed-tot b { font: 700 34px/1.05 var(--cond); color: var(--navy); font-variant-numeric: tabular-nums; }
.bill-ed { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.links input.num { width: 110px; text-align: right; font: 500 14px var(--body); border: 1.5px solid var(--field); border-radius: 8px; padding: 6px 8px; }
.links td { vertical-align: top; }
.logo-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-prev { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); }
.row-toggle { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.row-toggle .check { padding-bottom: 10px; }
.swatches { display: flex; gap: 12px; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 40px; height: 40px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.swatch input:checked + span { outline: 3px solid var(--amber); outline-offset: 2px; }
.swatch input:focus-visible + span { outline: 3px solid var(--navy); outline-offset: 2px; }

/* ---------------- payments ---------------- */
.act-row { display: flex; flex-wrap: wrap; gap: 8px; }
.alloc { display: grid; gap: 6px; max-height: 300px; overflow: auto; }
.alloc-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.alloc-row:has(input:checked) { border-color: var(--navy); }
.alloc-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--navy); flex: none; }
.alloc-row .grow { flex: 1; min-width: 0; }
.alloc-row b { display: block; }
.alloc-row small { display: block; color: var(--muted); font-size: 12.5px; }
.alloc-row input.num { width: 104px; text-align: right; font: 600 14px var(--body); border: 1.5px solid var(--field); border-radius: 8px; padding: 6px 8px; }
.alloc-row input.num:disabled { opacity: .45; }
.alloc-tot { margin: 0; text-align: right; font-size: 15px; }
.alloc-tot b { font: 700 22px var(--cond); color: var(--navy); }

/* ---------------- Analytics ---------------- */
.a-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-bottom: 16px; }
.a-filters .fld { min-width: 150px; }
.a-filters .fld input, .a-filters .fld select { min-height: 40px; padding: 7px 10px; font-size: 14px; }
.a-ptext { margin: 0 0 10px; }
.ms { position: relative; }
.ms summary { list-style: none; cursor: pointer; border: 1.5px solid var(--field); border-radius: 10px; padding: 9px 12px; background: #fff; font-size: 14px; min-height: 40px; }
.ms summary::-webkit-details-marker { display: none; }
.ms[open] summary { border-color: var(--navy); }
.ms-pop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(15,41,56,.18); padding: 10px; }
.ms-list { max-height: 260px; overflow: auto; display: grid; gap: 6px; padding: 2px; }
.ms-list .check { font-weight: 500; font-size: 14px; }
.ms-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.insights ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.insights li { padding: 8px 12px 8px 30px; border-radius: 10px; position: relative; font-size: 14.5px; }
.insights li::before { position: absolute; left: 11px; top: 8px; font-weight: 700; }
.insights li.good { background: var(--green-soft); color: var(--green); } .insights li.good::before { content: "▲"; font-size: 11px; top: 10px; }
.insights li.bad { background: var(--red-soft); color: var(--red); } .insights li.bad::before { content: "!"; }
.insights li.warn { background: var(--amber-soft); color: var(--amber-ink); } .insights li.warn::before { content: "!"; }
.insights li.info { background: var(--tint); color: var(--navy); } .insights li.info::before { content: "•"; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 8px; }
.tile { display: grid; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; color: var(--ink); align-content: start; }
a.tile:hover { text-decoration: none; border-color: var(--field); box-shadow: 0 2px 10px rgba(15,41,56,.06); }
.t-l { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.t-v { font: 700 25px/1.15 var(--cond); color: var(--navy); font-variant-numeric: tabular-nums; }
.t-s { font-size: 12px; color: var(--muted); }
.dl { font-size: 12.5px; font-weight: 700; }
.dl.up { color: var(--green); } .dl.down { color: var(--red); } .dl.flat { color: var(--muted); }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0 10px; }
.charts .wide2 { grid-column: 1 / -1; }
.chart2 { width: 100%; height: auto; display: block; }
.chart2 .grid { stroke: var(--line); }
.chart2 .ax { font: 500 11px var(--body); fill: var(--muted); }
.chart2 .ln { fill: none; stroke: var(--navy); stroke-width: 2; }
.chart2 .dot { fill: #fff; stroke: var(--navy); stroke-width: 2; }
.b-amber { fill: var(--amber); background: var(--amber); } .b-green { fill: var(--green); background: var(--green); } .b-red { fill: var(--red); background: var(--red); } .b-navy { fill: var(--navy); background: var(--navy); }
.legend i.navyl { background: var(--navy); height: 3px; width: 14px; border-radius: 2px; }
.hbars { display: grid; gap: 8px; }
.hb { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hb-l small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.hb-t { background: var(--bg); border-radius: 6px; height: 14px; overflow: hidden; }
.hb-t i { display: block; height: 100%; border-radius: 6px; }
.hb b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-bottom: 8px; }
.rep-card { display: grid; gap: 4px; color: var(--ink); }
.rep-card:hover { text-decoration: none; border-color: var(--navy); }
.rep-card b { color: var(--navy); font-size: 16px; }
.rep-card span { font-size: 13.5px; color: var(--muted); }
.rep-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 6px 0 12px; flex-wrap: wrap; }
.rep-head h2 { margin: 0; font: 700 24px/1.2 var(--cond); color: var(--navy); }
.rep-head p { margin: 2px 0 0; }
.rep-act { display: flex; gap: 8px; flex-wrap: wrap; }
table.rep td { white-space: nowrap; }
table.rep tfoot td { font-weight: 700; background: #FAFBFB; border-top: 1.5px solid var(--navy); padding: 10px 14px; }
.builder { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.builder .full { grid-column: 1 / -1; }
.mchips { display: flex; flex-wrap: wrap; gap: 6px; }
.mchip input { position: absolute; opacity: 0; }
.mchip span { display: inline-block; border: 1.5px solid var(--field); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; background: #fff; }
.mchip input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.mchip input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }
.print-only { display: none; }

/* ---------------- narrow screens ---------------- */
@media (max-width: 1100px) {
  .grid.home, .grid.pnl, .inv-layout, .bill-layout, .bill-ed { grid-template-columns: minmax(0, 1fr); }
  .ed-top { grid-template-columns: 1fr 1fr; }
  .charts { grid-template-columns: minmax(0, 1fr); }
  .inv-side { position: static; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; padding: 10px 12px; }
  .brand { padding-bottom: 8px; }
  #nav { grid-auto-flow: column; overflow-x: auto; gap: 4px; }
  #nav a { padding: 8px 10px; white-space: nowrap; }
  #nav a span { font-size: 14px; }
  .side-foot { display: none; }
  .main { height: auto; }
  .top { padding: 12px 16px; flex-wrap: wrap; }
  .content { padding: 16px 16px 40px; overflow: visible; }
  .si-grid, .grid.comp, .row2, .ed-top { grid-template-columns: minmax(0, 1fr); }
  .ed-bottom { flex-direction: column; align-items: stretch; }
  .card.flush { overflow-x: auto; }
  .top-a span { display: none; }
}

/* ---------------- printing: only the invoice ---------------- */
@page { size: letter; margin: 0; }
@media print {
  body { background: #fff; }
  .side, .top, .inv-side, .boot, .toast, dialog, .a-filters, .tabs, .rep-act, .builder { display: none !important; }
  .print-only { display: block; }
  .print-only h1 { font: 700 20pt/1.2 var(--cond); color: #17384C; margin: 0; }
  .content:has(.rep-head) { padding: 0.5in !important; }
  .app, .main, .content, .inv-layout { display: block; height: auto; overflow: visible; padding: 0; margin: 0; }
  .sheet-wrap { overflow: visible; height: auto !important; }
  .sheet { transform: none !important; box-shadow: none; min-height: 792pt; }
  .iv-foot { position: fixed; bottom: 22pt; }
}

/* Accounting 101 legend under ledger reports */
.a101 { margin-top: 14px; }
.a101 summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.a101 table { margin-top: 10px; }
.a101 ul { margin: 10px 0 0; padding-left: 18px; line-height: 1.6; }
small.block { display: block; }

/* the hidden attribute always wins over display rules like .btn */
[hidden] { display: none !important; }

/* "Desktop was updated" bar (only when a reload has to wait for an edit) */
.upd { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 14px;
  background: var(--navy); color: #fff; padding: 10px 12px 10px 18px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-weight: 600; }
.upd .btn.primary { background: #fff; color: var(--navy); }

/* ---------- supplier invoice line items & cost allocation ---------- */
.okc { color: var(--green); font-weight: 600; }
.cap-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.cap-row .cap { margin: 0; }
.pad { padding: 0 16px; }
.card.flush .cap.pad, .card.flush .cap-row.pad { padding-top: 14px; }
.card.flush p.pad { padding-bottom: 12px; }
.tscroll { overflow-x: auto; margin: 0 -4px; }
.lines-ed td { padding: 4px 4px; vertical-align: middle; }
.lines-ed input, .lines-ed select { width: 100%; min-width: 0; font: 500 14px var(--body); border: 1.5px solid var(--field); border-radius: 8px; padding: 6px 8px; background: #fff; }
.lines-ed td:first-child select { min-width: 150px; }
.lines-ed input[data-f="description"] { min-width: 170px; }
.lines-ed input.num { width: 92px; text-align: right; }
.lines-ed input.num.s { width: 64px; }
.lines-ed input.bad-in { border-color: var(--amber); background: var(--amber-soft); }
.lines-ed tfoot td { font-weight: 700; padding: 8px 4px; }
.checks { list-style: none; padding: 0; margin: 4px 0 10px; display: grid; gap: 3px; font-size: 13.5px; }
.det { margin: 4px 0 8px; }
.det summary { cursor: pointer; color: var(--navy); font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.sumtab { border-top: 2px solid var(--line); }
.sumtab td, .sumtab th { font-size: 13.5px; }
.sumtab td.n b { font-weight: 700; }
.al-line { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.al-h { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.al-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.al-row input.num { width: 110px; text-align: right; font: 600 15px var(--body); border: 1.5px solid var(--field); border-radius: 8px; padding: 7px 9px; }
.al-cost { margin-left: auto; font-size: 16px; color: var(--navy); }
.seg.sm { padding: 2px; border-radius: 10px; }
.seg.sm button { border: 0; background: none; padding: 6px 11px; border-radius: 8px; font: 600 13.5px var(--body); color: var(--muted); cursor: pointer; }
.seg.sm button[aria-checked="true"] { background: var(--navy); color: #fff; }
.fld.inline { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; }
.fld.inline span { margin: 0; white-space: nowrap; }
.al-tot { display: flex; justify-content: space-between; align-items: center; border-top: 2px solid var(--line); padding-top: 10px; margin-top: 6px; font-weight: 600; }
.al-tot b { font-size: 18px; color: var(--navy); }
.cb { border-top: 1px solid var(--line); padding: 4px 0 8px; }
.cb .mini-row { border-top: 0; padding-bottom: 2px; }
.sub-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); padding: 1px 0 1px 10px; }
.cov { font-size: 13px; display: grid; gap: 2px; margin: 6px 0; padding: 8px 10px; background: var(--tint); border-radius: 10px; }
.pick { display: grid; gap: 6px; max-height: 420px; overflow: auto; }
.pick-row { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 12px; cursor: pointer; font: 500 14.5px var(--body); color: var(--ink); }
.pick-row small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pick-row:hover { border-color: var(--navy); }
.banner .linkish { margin-top: 4px; }
.banner > div > span { display: block; }
.banner:not(.warn) { background: var(--tint); color: var(--navy); }
.bill-ed > .span2 { grid-column: 1 / -1; }
.bill-layout > .span2 { grid-column: 1 / -1; }
.bill-layout > .span2 > .card { margin: 0; }
button.linkish { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* home: gross profit received, pending + margin right-aligned under it */
.gp-block { display: inline-flex; flex-direction: column; align-items: flex-end; }
.gp-sub { margin-top: 2px; }
.pl-line .v small.pct { font-size: 12px; font-weight: 600; color: var(--muted); margin-right: 4px; }
/* supplier's item vs your product */
.prod { display: inline-block; background: var(--tint); color: var(--navy); font-weight: 700; border-radius: 6px; padding: 2px 8px; font-size: 13.5px; white-space: nowrap; }
.prod.none { background: var(--amber-soft); color: var(--amber-ink); }
.code { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.lines-ed select.prodsel { background: var(--tint); border-color: var(--navy); font-weight: 700; color: var(--navy); }
.lines-ed select.prodsel.none { background: var(--amber-soft); border-color: var(--amber); color: var(--amber-ink); }
.altab tr.grp td { border-top: 2px solid var(--line); }
.al-line.off { opacity: .6; }
.al-line .al-h { flex-direction: row; align-items: flex-start; gap: 10px; cursor: pointer; }
.al-line .al-h input[type=checkbox] { width: 18px; height: 18px; margin-top: 3px; flex: none; }
.al-line .al-h .grow { display: flex; flex-direction: column; gap: 3px; }
.pdfview { width: 100%; height: 640px; border: 0; border-radius: 10px; background: #F3F6F7; display: block; margin-bottom: 8px; }
.iv-parties.paid { min-height: 54pt; }
