@font-face { font-family: Archivo; src: url(/fonts/archivo.woff2) format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/mono.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --desk: #33373b; --desk-2: #42474c; --sheet: #fff; --ink: #232629; --muted: #5e656b; --line: #d8dadc;
  --orange: #f39114; --orange-deep: #a85800; --foam: #fbefd6; --bad: #a32a1c;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { color: var(--ink); font: 400 16px/1.45 Archivo, Arial, sans-serif; font-variant-numeric: tabular-nums; }
h1, h2, p, ol { margin: 0; }
h1, h2 { font-stretch: 80%; font-weight: 650; line-height: 1.15; }
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; font-stretch: 85%; font-weight: 650; margin: 0 0 6px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
[hidden] { display: none !important; }

.field { display: flex; flex-direction: column; gap: 4px; }
label { font-size: 14px; font-weight: 500; color: var(--muted); }
input:not([type=checkbox]), select { border: 1px solid #8f969c; padding: 10px 12px; min-height: 46px; width: 100%; background: #fff; }
.code { font-size: 26px; letter-spacing: 8px; font-weight: 600; text-align: center; }
.primary { background: var(--orange); color: var(--ink); border: 0; padding: 12px 18px; min-height: 48px; font-weight: 700; cursor: pointer; }
.primary[disabled] { opacity: .6; cursor: progress; }
.plain { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 8px; cursor: pointer; }
.ghost { background: #fff; border: 1px solid var(--ink); padding: 7px 12px; font-weight: 600; cursor: pointer; }
.error { color: var(--bad); font-weight: 600; }
.error:empty { display: none; }
.hint { font-size: 14px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: center; font-size: 16px; color: var(--ink); }
.check input { width: 20px; height: 20px; accent-color: var(--orange-deep); }
.secret { font: 500 15px/1.5 Consolas, Menlo, monospace; word-break: break-all; background: #f1f2f3; padding: 10px; }
.sign { font-size: 13px; color: var(--muted); }
.sign code { font: 500 14px "JetBrains Mono", Consolas, Menlo, monospace; color: var(--ink); }
.sign > span { margin-left: 12px; }
/* The exit(0) credit links to exitzero.co.in, with a blinking block cursor as on roshanfoams.com (Build 16.2). */
.sign .x0 { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 1px; vertical-align: middle; }
.sign .caret { display: inline-block; width: .58em; height: 1.12em; margin-left: 2px; background: #1BA34B; border-radius: 1px; animation: x0caret 1.06s steps(1, end) infinite; }
@keyframes x0caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sign .caret { animation: none; } }
.row { display: flex; gap: 10px; align-items: center; }

/* Sign-in: foam slabs beside a single sheet of paper. */
body.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); background: var(--desk); }
.stack { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 48px 0; overflow: hidden; }
.stack span { display: block; height: 58px; background: var(--orange); }
.stack span:nth-child(1) { width: 62%; }
.stack span:nth-child(2) { width: 78%; background: #f6b45c; }
.stack span:nth-child(3) { width: 70%; }
.stack span:nth-child(4) { width: 92%; background: #efa646; }
.stack span:nth-child(5) { width: 84%; }
.stack span:nth-child(6) { width: 66%; background: #f6b45c; }
.stack span:nth-child(7) { width: 88%; background: #efa646; }
.stack span:nth-child(8) { width: 74%; }
.sheet { background: var(--sheet); padding: 40px 56px 28px; display: flex; flex-direction: column; justify-content: center; gap: 28px; min-height: 100vh; }
.logo { width: 190px; height: auto; align-self: flex-start; }
.sheet form { display: flex; flex-direction: column; gap: 14px; }
.steps { padding-left: 20px; }
.qr { width: 190px; height: 190px; align-self: flex-start; border: 1px solid var(--line); }
details summary { cursor: pointer; color: var(--orange-deep); font-weight: 600; }

/* Signed-in pages. */
body.desk { min-height: 100vh; display: grid; grid-template-columns: auto minmax(0, 1fr); background: var(--desk); }
.brand { display: flex; align-items: center; gap: 12px; font-stretch: 80%; font-weight: 650; font-size: 20px; color: var(--ink); text-decoration: none; padding: 8px 0; }
.brand img { height: 34px; width: auto; }
.maincol { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
#view { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 24px; }
.sign.dark { color: #d4d7da; padding: 0 24px 18px; max-width: 1280px; margin: 0 auto; width: 100%; }
.sign.dark code { color: #fff; }
.hello { color: #fff; margin-bottom: 22px; }
.hello h1 { font-size: 42px; }
.hello p { color: #d4d7da; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.tile { background: #fff; padding: 20px 22px; border-left: 10px solid var(--orange); display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.tile.soon { border-left-color: #8f969c; }
.tile strong { font-size: 21px; font-stretch: 85%; }
.tile small { color: var(--muted); font-size: 14px; }
.page { background: #fff; padding: 24px 28px; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th { font-size: 13px; text-align: left; color: var(--muted); padding: 7px 8px; border-bottom: 1px solid var(--ink); }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tag { background: var(--foam); padding: 1px 7px; white-space: nowrap; font-size: 14px; }
.tag.off { background: #f1f2f3; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; }
.acts button { background: none; border: 0; color: var(--orange-deep); font-weight: 650; text-decoration: underline; cursor: pointer; padding: 2px 4px; }
.acts select { min-height: 32px; padding: 2px 6px; width: auto; }
.acts a { color: var(--orange-deep); font-weight: 650; padding: 2px 4px; }
td a, .stacked p a { color: var(--orange-deep); font-weight: 600; }
.num { text-align: right; white-space: nowrap; }
.minus { color: var(--bad); font-weight: 650; }
.plus { color: #1f5130; font-weight: 650; }
.tag.bad { background: #f7ddd9; color: var(--bad); font-weight: 600; }
.tag.ok { background: #e3efe2; }
.upper { text-transform: uppercase; }
.back { color: var(--muted); font-size: 14px; }
.search { max-width: 420px; margin-bottom: 12px; }
.filters { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.filters .search { margin: 0; flex: 1 1 280px; }
.filters .check { padding-bottom: 12px; }
.next { margin-top: 14px; }
.acts.inline { display: inline-flex; margin-left: 6px; }
.stacked { display: flex; flex-direction: column; gap: 20px; }
.stacked .bar { margin-bottom: 0; }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 2px; background: var(--line); border: 2px solid var(--line); }
.figures > div { background: #fff; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.figures span, .figures small { color: var(--muted); font-size: 14px; }
.figures strong { font-size: 24px; font-stretch: 85%; font-weight: 650; }
.figures .lead { background: var(--foam); }
.figures .alert { background: #f7ddd9; color: var(--bad); }
.figures .alert span { color: var(--bad); }
.facts { display: flex; gap: 32px; margin: 0; flex-wrap: wrap; }
.facts dt { font-size: 14px; color: var(--muted); }
.facts dd { margin: 0; }
.plainlist { list-style: none; margin: 0; padding: 0; }
.plainlist li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
table.compact { min-width: 520px; }
.two-col table.compact { min-width: 0; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.picks { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid #8f969c; max-height: 300px; overflow-y: auto; }
.picks li.hint { padding: 10px 12px; }
.picks button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; cursor: pointer; text-align: left; }
.picks button:hover { background: var(--foam); }
.chosen { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: var(--foam); padding: 10px 14px; }
.chosen > div:first-child { display: flex; flex-direction: column; }
.nic { display: flex; flex-direction: column; gap: 16px; }
.nic .bar { margin-bottom: 0; }
.nic fieldset { border: 1px solid var(--line); padding: 12px 14px 14px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.nic legend { font-weight: 650; font-stretch: 85%; font-size: 17px; padding: 0 6px; }
.nic .field { margin: 0; }
.flabel { font-size: 14px; color: var(--muted); }
.fixed { display: block; min-height: 24px; font-weight: 500; }
.nic .field:has(> .fixed) { display: flex; flex-direction: column; gap: 2px; }
.billgrid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.billmain { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.billside { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 12px; }
.billside .primary { width: 100%; }
.chosen .hint { display: block; }
#billTo { display: flex; flex-direction: column; gap: 10px; }
#more { border: 1px solid var(--line); padding: 10px 14px; }
#more summary { cursor: pointer; font-weight: 650; }
.moreBody { display: flex; flex-direction: column; gap: 14px; padding-top: 10px; }
.narrowField { max-width: 320px; }
.size { display: flex; align-items: center; gap: 4px; }
.size input { width: 48px; flex: 0 1 48px; min-width: 0; }
.size input:first-child { flex: 1 1 66px; width: 66px; }
.size span { color: var(--muted); font-size: 13px; }
.extra { display: none; }
.showExtra .extra { display: table-cell; }
pre.json { max-height: 60vh; overflow: auto; background: #f1f2f3; padding: 12px; font-size: 13px; margin: 0; }
.share { margin: 0; flex: 0 1 220px; }
.actionsRow { align-items: flex-end; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
table.lines { min-width: 800px; }
.showExtra table.lines { min-width: 1020px; }
table.lines th { font-size: 13px; padding: 6px 4px; white-space: normal; }
table.lines td { padding: 3px; vertical-align: middle; }
table.lines td.num { font-size: 15px; white-space: nowrap; padding: 3px 6px; }
table.lines input, table.lines select { min-height: 40px; padding: 6px; width: 100%; }
table.lines .sl { width: 30px; text-align: center; }
table.lines th:nth-child(2), table.lines td:nth-child(2) { width: 104px; min-width: 104px; }
table.lines th:nth-child(4), table.lines td:nth-child(4) { width: 112px; min-width: 112px; }
table.lines th:nth-child(5), table.lines td:nth-child(5) { width: 64px; }
table.lines th:nth-child(6), table.lines td:nth-child(6),
table.lines th:nth-child(7), table.lines td:nth-child(7) { width: 78px; }
table.lines .extra { width: 66px; }
table.lines td.desc { min-width: 230px; }
.force .danger { width: 100%; }
.stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; counter-reset: stage; }
.stages li { counter-increment: stage; padding: 10px 12px; background: #f1f2f3; color: var(--muted); font-size: 15px; }
.stages li::before { content: counter(stage) ". "; font-weight: 650; }
.stages li.done { background: #e3efe2; color: var(--ink); }
.credit { padding: 14px 16px; border-left: 10px solid var(--orange); background: var(--foam); display: flex; flex-direction: column; gap: 8px; }
.credit strong { font-size: 19px; font-stretch: 85%; font-weight: 650; }
.credit.ok { background: #e3efe2; border-left-color: #3f7a3a; }
.credit.none { background: #f1f2f3; border-left-color: #8f969c; }
.credit.blocked { background: #f7ddd9; border-left-color: var(--bad); }
.credit.blocked > strong { color: var(--bad); }
.sums { margin: 0; display: flex; flex-direction: column; gap: 3px; }
.sums > div { display: flex; justify-content: space-between; gap: 12px; }
.sums dt { color: var(--muted); }
.credit .sums dt { color: var(--ink); }
.sums dd { margin: 0; font-weight: 500; text-align: right; }
.sums .big { font-size: 19px; font-weight: 650; padding: 2px 0; }
.sums .big dt { color: var(--ink); }
.sums .big dd { font-weight: 650; }
.totals.narrow { max-width: 340px; margin-left: auto; width: 100%; }
.force { display: flex; flex-direction: column; gap: 6px; }
textarea { border: 1px solid #8f969c; padding: 10px 12px; width: 100%; resize: vertical; background: #fff; }
.danger { background: var(--bad); color: #fff; border: 0; padding: 12px 18px; min-height: 48px; font-weight: 700; cursor: pointer; }
.danger[disabled] { opacity: .6; cursor: progress; }
a.ghost { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.filebtn { color: var(--ink); font-size: 16px; }
.filebtn:focus-within { outline: 3px solid var(--orange); outline-offset: 2px; }
.filebtn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
[hidden] { display: none !important; }
#importNote:empty { display: none; }
a.primary { display: inline-flex; align-items: center; text-decoration: none; }
.wrapRow { flex-wrap: wrap; }
dialog { border: 0; padding: 24px; width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(25, 27, 29, .65); }
dialog form { display: flex; flex-direction: column; gap: 12px; }
dialog.wide { max-height: calc(100vh - 32px); }

@media (max-width: 860px) {
  body.auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .stack { padding: 0; gap: 5px; }
  .stack span { height: 10px; }
  .stack span:nth-child(n+5) { display: none; }
  .sheet { min-height: 0; padding: 24px 20px; justify-content: flex-start; }
  .logo { width: 150px; }
  #view { padding: 16px 12px; }
  .page { padding: 18px 14px; }
  .sign.dark { padding: 0 16px 16px; }
  .hello h1 { font-size: 32px; }
  .two, .billgrid { grid-template-columns: minmax(0, 1fr); }
  .billside { position: static; }
  .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Prints: tax invoice, estimate, packing list and gate pass (Build 16.4: Roshan's colours, a large centred logo with a light ISO mark). */
.invoice { background: #fff; padding: 24px 28px; display: flex; flex-direction: column; gap: 14px; max-width: 1000px; margin: 0 auto; font-size: 14px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.draftnote { background: #f7ddd9; color: var(--bad); font-weight: 650; padding: 8px 12px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.brand-logo { position: relative; display: grid; place-items: center; padding: 6px 70px; }
.brand-logo img { position: relative; height: 104px; width: auto; display: block; }
.brand-logo.small { padding: 2px 26px; }
.brand-logo.small img { height: 60px; }
.brand-address { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.brand-title { align-self: stretch; margin-top: 4px; background: linear-gradient(90deg, var(--orange-deep), var(--orange) 30%, var(--orange) 70%, var(--orange-deep)); color: #fff; font-size: 20px; font-stretch: 85%; letter-spacing: .14em; text-transform: uppercase; padding: 6px 12px; }
.docinfo { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.docinfo .party { flex: 1 1 auto; border-left: 4px solid var(--orange); background: #fffaf2; padding: 8px 12px; }
.docinfo .party h3, .inv-parties h3 { font-size: 12px; color: var(--orange-deep); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 2px; }
.docmeta { margin: 0; display: grid; grid-template-columns: auto auto; gap: 3px 14px; align-content: start; background: var(--foam); padding: 8px 12px; border-top: 3px solid var(--orange); }
.docmeta div { display: contents; }
.docmeta dt { color: var(--muted); }
.docmeta dd { margin: 0; font-weight: 650; }
.docinfo .docmeta { margin-left: auto; }
.docinfo .inv-parties { flex: 1 1 auto; }
.metaqr { display: flex; gap: 12px; align-items: flex-start; }
.inv-qr { width: 150px; height: 150px; }
.inv-irn { font: 500 12px "JetBrains Mono", Consolas, monospace; word-break: break-all; margin: 0; }
.inv-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.inv-parties > div { border-left: 4px solid var(--orange); background: #fffaf2; padding: 8px 12px; }
.inv-lines { min-width: 0; font-size: 13px; border-collapse: collapse; }
.inv-lines th, .inv-lines td { padding: 5px 6px; }
.inv-lines thead th { background: #3a3f44; color: #fff; border-bottom: 3px solid var(--orange); font-weight: 650; }
/* Inside the tables stays plain (Maaz, 14 Nov 2026: too orange): white rows, thin grey lines. */
.inv-lines tbody td { border-bottom: 1px solid var(--line); background: transparent; }
.inv-foot { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.invoice .sums .big { background: var(--orange); color: var(--ink); padding: 4px 8px; }
.invoice .sums .big dt { color: var(--ink); }
.sums.bank { background: #fffaf2; border-left: 4px solid var(--orange); padding: 8px 12px; align-self: start; }
.sums.bank small { font-size: 9.5px; color: var(--muted); font-weight: 500; }
.docnote { margin-top: 8px; }
.inv-sign { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; border-top: 2px solid var(--orange); padding-top: 10px; }
.inv-sign p:last-child { text-align: right; }
@media (max-width: 640px) { .metaqr { flex-direction: column; } .docinfo { flex-direction: column; } .docinfo .docmeta { margin-left: 0; } .inv-foot { grid-template-columns: 1fr; } }

@media print {
  @page { size: A4; margin: 10mm; }
  body.desk { background: #fff; }
  .side, .mtop, .sideshade, .sign.dark, .noprint { display: none !important; }
  body.desk { display: block; }
  .maincol { min-height: 0; }
  #view { padding: 0; }
  .invoice { padding: 0; max-width: none; font-size: 11.5px; }
  .inv-lines { font-size: 11px; }
  .inv-lines tr { break-inside: avoid; }
}

.dash-card { background: #fff; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dash-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.dash-head h2 { font-size: 21px; }
.dash-head a { color: var(--orange-deep); font-weight: 650; }
.dash-empty { color: var(--muted); background: #f6f6f7; padding: 24px; text-align: center; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: Archivo, Arial, sans-serif; }
.chart .axis { font-size: 12px; fill: var(--muted); }
.chart .axis.strong { fill: var(--ink); font-weight: 700; }
.chart .val { font-size: 12.5px; font-weight: 650; fill: var(--ink); }
a.months { font-size: 12px; font-weight: 500; margin-left: 6px; color: var(--muted); }
a.months:hover { color: var(--ink); }
.chart .name { font-size: 13px; fill: var(--ink); }
.chart .grid { stroke: #eceded; }
.chart .base { stroke: var(--ink); }
.chart .avg { stroke: var(--orange-deep); stroke-dasharray: 4 4; }
.chart .dot { fill: #b7bbbf; }
.chart rect:hover { opacity: .8; }
/* Build 32: the whole month's column opens it on the ledger's monthly graph. */
.chart rect.hit { fill: transparent; cursor: pointer; }
.chart a:hover rect.hit { fill: var(--foam); opacity: 1; }
.s-sales { fill: var(--orange); background: var(--orange); }
.s-best { fill: var(--orange-deep); background: var(--orange-deep); }
.s-soft { fill: #f8c27c; background: #f8c27c; }
.s-paid, .s-ink { fill: var(--desk); background: var(--desk); }
.s-due { fill: var(--bad); background: var(--bad); }
.dash-key { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.dash-key.inline { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); }
.dash-key i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; }
.dash-key span { color: var(--muted); }
.danger { color: var(--bad) !important; }
#tabs { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
#tabs a { white-space: nowrap; }

/* Dashboard (Build 33): one white sheet, read top to bottom: the last day, the month, Outstanding, money and people. */
.dr { background: #fff; padding: 28px clamp(16px, 3vw, 40px); display: flex; flex-direction: column; gap: 30px; max-width: 1160px; margin: 0 auto; }
.dr-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; border-bottom: 3px solid var(--orange); padding-bottom: 16px; }
.dr-top h1 { font-size: 38px; font-stretch: 78%; font-weight: 700; margin: 4px 0; }
.dr-eyebrow { color: var(--orange-deep); font-weight: 650; letter-spacing: .06em; text-transform: uppercase; font-size: 13px; }
.dr-top .error { flex-basis: 100%; }
.dr-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.dr-tools .field { min-width: 170px; }
.dr-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; }
.dr-btn .ico { width: 18px; height: 18px; }
.dr-xlbtn { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 6px 10px; font-size: 14px; }
.dr-xlbtn .ico { width: 16px; height: 16px; }
.dr-sec { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dr-head { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.dr-head .ico { color: var(--orange-deep); flex: none; }
.dr-head h2 { font-size: 23px; font-stretch: 80%; flex: 1; }
.dr-acts { display: flex; gap: 10px; align-items: center; }
.dr-acts a { color: var(--orange-deep); font-weight: 650; }
.dr-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 4px 18px; }
.dr-fig { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; color: inherit; text-decoration: none; min-width: 0; }
a.dr-fig:hover strong { color: var(--orange-deep); text-decoration: underline; }
.dr-fig .dr-label { color: var(--muted); font-size: 14px; font-weight: 500; }
.dr-fig strong { font-size: 32px; font-stretch: 78%; font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; }
.dr-fig small { color: var(--muted); font-size: 14px; }
.dr-block { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dr-block h3 { font-size: 16px; margin: 0; }
.dr-split { width: 100%; height: 34px; display: block; }
.dr-legend, .dr-ages { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--muted); }
.dr-legend strong { color: var(--ink); }
.dr-legend i, .dr-ages i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; }
.dr-ages { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.dr-ages li { display: flex; flex-direction: column; gap: 1px; }
.dr-ages strong { color: var(--ink); font-size: 20px; font-stretch: 80%; }
.age1 { fill: #f6d29b; background: #f6d29b; }
.age2 { fill: #f3b04d; background: #f3b04d; }
.age3 { fill: #e08a12; background: #e08a12; }
.age4 { fill: #a85800; background: #a85800; }
.age5 { fill: #5a2f00; background: #5a2f00; }
.dr-owed { background: var(--foam); margin: 0 calc(-1 * clamp(16px, 3vw, 40px)); padding: 22px clamp(16px, 3vw, 40px); }
.dr-owed .dr-head { border-bottom-color: #e9d3a8; }
.dr-owed .wrap { background: #fff; }
.dr-owed .dr-figs > :first-child strong { font-size: 46px; }
.dr-chart { overflow-x: auto; scrollbar-width: thin; }
.dr-days { min-height: 220px; }
.dr-days .val.small { font-size: 11px; font-weight: 600; fill: var(--muted); }
.dr-days .closed { fill: var(--bad); }
.dr-days a:hover rect.hit { fill: var(--foam); }
.dr table.dr-dues { width: 100%; }
table.dr-list { width: 100%; min-width: 0; }
.dr .up { color: #1d6b34; fill: #1d6b34; font-weight: 650; }
.dr .down { color: var(--bad); fill: var(--bad); font-weight: 650; }
.dr-months tr.chosen td { background: var(--foam); }
.dr-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
@media (max-width: 700px) {
  .dr { padding: 18px 16px; gap: 24px; }
  .dr-top h1 { font-size: 30px; }
  .dr-tools { width: 100%; }
  .dr-tools .field { flex: 1 1 100%; }
  .dr-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dr-fig strong { font-size: 25px; }
  .dr-owed .dr-figs > :first-child { grid-column: 1 / -1; }
  .dr-owed .dr-figs > :first-child strong { font-size: 38px; }
  .dr-pair { grid-template-columns: 1fr; }
  .dr-head h2 { font-size: 20px; }
}
@media print {
  .dr { padding: 0; gap: 18px; }
  .dr-xl { display: none; }
  .dr-owed { margin: 0; }
  .dr-chart { overflow: visible; }
}

/* Packing list grouped by grade, as on Roshan's sheet. */
/* Build 31: the product name heading is coloured in Roshan's orange so it stands out, on screen and on the print. */
.packtable .grouphead th { background: #fbd9a6 !important; color: var(--ink); text-align: left; font-weight: 800; padding-top: 8px; border-bottom: 1px solid var(--orange); border-left: 5px solid var(--orange-deep) !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.packtable .subtotal td, .inv-lines .subtotal td { font-weight: 650; border-top: 1px solid var(--ink); }
.packtable td.weightcell[rowspan] { vertical-align: middle; font-weight: 700; border-left: 1px solid var(--line); }
.packlines input:not([type=checkbox]) { min-width: 60px; }
.packlines td:nth-child(2) input { min-width: 84px; }
.packlines td:nth-child(3) input { min-width: 110px; }
.packlines td .hint { font-size: 12px; white-space: nowrap; }
.packlines .upper::placeholder { text-transform: none; }
.billside table.compact { min-width: 0; }
.packlines td.center { text-align: center; }
.packlines input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--orange); }
.packlines tr.joined td { background: #fff6e8; }
.packlines tr.joined td.sl { box-shadow: inset 4px 0 0 var(--orange); }
.packlines tr.bgrade input::placeholder { color: #a4a9ad; font-style: italic; }
.credit.warn { background: #fdf0d9; border-left-color: #c77700; }

/* Gate pass: three copies on one A4 page. */
.gatepass { border: 1.5px solid var(--ink); border-top: 6px solid var(--orange); padding: 8px 14px 10px; display: flex; flex-direction: column; gap: 6px; break-inside: avoid; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.gp-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid #efe4d2; padding-bottom: 4px; }
.gp-title { text-align: center; }
.gatepass h2 { font-size: 20px; margin: 0; letter-spacing: .06em; }
.gatepass h3 { font-size: 12px; margin: 0; text-transform: uppercase; letter-spacing: .08em; color: var(--orange-deep); }
.gp-no { margin: 0; background: var(--foam); border-top: 3px solid var(--orange); padding: 4px 10px; display: grid; grid-template-columns: auto auto; gap: 1px 10px; font-size: 13px; }
.gp-no div { display: contents; }
.gp-no dt { color: var(--muted); }
.gp-no dd { margin: 0; font-weight: 700; }
.gp-customer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; background: #fffaf2; border-left: 4px solid var(--orange); padding: 4px 10px; }
.gp-customer span { color: var(--muted); font-size: 13px; }
.gp-customer strong { font-size: 17px; }
.gp-customer .gp-phone { margin-left: auto; color: var(--ink); font-weight: 600; }
.gp-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.gp-body dl { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 14px; align-content: start; }
.gp-body dd { font-size: 1.08em; }
.gp-body dl div { display: contents; }
.gp-body dt { color: var(--muted); }
.gp-body dd { margin: 0; font-weight: 650; }
.gp-body .gp-amount dt, .gp-body .gp-amount dd { background: var(--foam); padding: 2px 6px; font-weight: 700; color: var(--ink); }
.gp-note { font-weight: 650; font-size: 12.5px; }
.gp-remark { display: flex; align-items: baseline; gap: 10px; border: 1px dashed #c4c8cc; padding: 3px 10px; }
.gp-remark span { color: var(--muted); font-size: 13px; }
.gp-remark strong { font-size: 15px; letter-spacing: .02em; }
.gatenote { max-width: 420px; }
.splitlist { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; padding: 4px 0; }
.packlines select.hsnpick { max-width: 150px; }
.gp-sign { display: flex; justify-content: space-between; gap: 18px; font-size: 13px; margin-top: auto; padding-top: 14px; }
.gp-sign p { border-top: 1px solid var(--ink); padding-top: 3px; min-width: 200px; }
.gp-sign p span { color: var(--muted); font-size: 12px; }
.gp-sign p:last-child { text-align: right; }
.cutline { border-top: 1.5px dashed var(--ink); position: relative; margin: 14px 0; height: 0; }
.cutline span { position: absolute; left: 50%; top: -10px; transform: translateX(-50%); background: #fff; padding: 0 8px; font-size: 12px; color: var(--muted); }
@media print {
  .gatepasses { gap: 0; }
  .gatepass { height: 30.5vh; font-size: 13.5px; }
  .cutline { margin: 1.2vh 0; }
  .packtable tr { break-inside: avoid; }
  .hsnreport .bar .row, .hsnreport .back { display: none; }
}
@media (max-width: 640px) { .gp-body { grid-template-columns: 1fr; } .gp-head { grid-template-columns: 1fr; text-align: center; } .brand-logo.small { justify-self: center; } }

/* Suggestions under a text box, in place of the browser's own dropdown. */
.suggest { position: absolute; z-index: 50; list-style: none; margin: 0; padding: 4px 0; background: #fff; border: 1px solid #8f969c; box-shadow: 0 6px 18px rgba(30, 33, 36, .18); max-height: 280px; overflow-y: auto; font-size: 14px; }
.suggest li { display: flex; justify-content: space-between; gap: 14px; padding: 7px 12px; cursor: pointer; }
.suggest li strong { font-weight: 600; }
.suggest li span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.suggest li:hover, .suggest li.on { background: var(--foam); box-shadow: inset 3px 0 0 var(--orange); }
@media print { .suggest { display: none; } }

/* Attendance. */
.subtabs { display: flex; gap: 2px; flex-wrap: wrap; margin: -6px 0 18px; border-bottom: 2px solid var(--line); }
.subtabs a { padding: 8px 14px; color: var(--muted); font-weight: 650; text-decoration: none; border-bottom: 4px solid transparent; margin-bottom: -2px; }
.subtabs a[aria-current=page] { color: var(--ink); border-bottom-color: var(--orange); }
.att .figures { margin-bottom: 16px; }
.att h3 { margin-top: 18px; }
.att a { color: var(--orange-deep); }
.att a.primary { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; }
.person .face { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--line); }
.marks { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #f1f2f3; padding: 3px 8px; font-weight: 600; white-space: nowrap; }
.chip.manual { outline: 2px dashed var(--orange); }
.chip.gone { text-decoration: line-through; color: var(--muted); background: #fff; outline: 1px solid var(--line); }
.chip button { background: none; border: 0; color: var(--orange-deep); text-decoration: underline; font-size: 13px; padding: 0 2px; cursor: pointer; }
.calwrap { max-width: 420px; margin: 4px 0 18px; }
.calhead, .calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calhead span { font-size: 12px; color: var(--muted); text-align: center; }
.cal, .cal-blank { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.cal { background: #f1f2f3; color: var(--muted); }
.cal.l1 { background: #fde3bd; color: var(--ink); }
.cal.l2 { background: #f6b45c; color: var(--ink); }
.cal.l3 { background: var(--orange-deep); color: #fff; }
.cal.miss { outline: 3px solid var(--bad); outline-offset: -3px; }
.enrol { display: flex; flex-direction: column; gap: 12px; }
.camera { position: relative; width: 100%; max-width: 480px; aspect-ratio: 4 / 3; background: #232629; overflow: hidden; }
.camera video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.enrolbox { position: absolute; border: 4px solid var(--orange); border-radius: 18px; transition: all .12s linear; }
.enrolStatus { font-weight: 650; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.enrolStatus .ico { width: 22px; height: 22px; flex: none; }
.steps { display: flex; gap: 6px; max-width: 480px; }
.steps i { flex: 1; height: 12px; background: #e3e5e8; border-radius: 6px; }
.steps i.done { background: var(--orange); }
.emo { font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; font-weight: 400; }
.tag.warn { background: #fde3bd; color: #7a4300; }
.chip.k-break { background: #fde3bd; }
.chip.k-home { background: #dbe6f5; }
.chip.k-in { background: #e3efe2; }
.paircode { font-size: 40px; letter-spacing: 8px; text-align: center; font-weight: 700; }
.sign .x0 { cursor: pointer; }

/* Build 16: choosing how an order is sold on the estimate. */
.choice .row { gap: 18px; flex-wrap: wrap; }
label.radio { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; }
label.radio input { width: auto; margin: 0; }
.transportBox { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; }

/* Attendance, Build 17: shifts, leave, holidays and the monthly report. */
.att .bar button:not(.primary), .att a.button { background: #fff; border: 1px solid var(--line); padding: 10px 14px; min-height: 44px; font-weight: 650; cursor: pointer; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; }
.att button.link { background: none; border: 0; color: var(--orange-deep); text-decoration: underline; font-size: 13px; padding: 0 4px; cursor: pointer; }
.tag.leave { background: #dbe6f5; color: #1d3f6e; }
.closedday { background: #f1f2f3; padding: 10px 14px; font-weight: 650; margin: 0 0 14px; }
.cal.absent { background: #f7ddd9; color: var(--bad); }
.cal.leave { background: #dbe6f5; color: #1d3f6e; }
.cal.closed { background: #fff; color: #9aa1a8; outline: 1px dashed var(--line); outline-offset: -1px; }
.cal.late { position: relative; }
.cal.late::after { content: ""; position: absolute; right: 3px; top: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); }
.download label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.download input, .download select { min-height: 44px; }
.report-title { margin: 0 0 10px; }
.att .report-title { display: none; }
table.grid { font-size: 13px; border-collapse: collapse; }
table.grid th, table.grid td { padding: 4px 3px; text-align: center; min-width: 22px; border: 1px solid var(--line); }
table.grid th:first-child, table.grid td:first-child { text-align: left; white-space: nowrap; padding-right: 8px; min-width: 0; }
table.grid th.closed { color: #9aa1a8; }
table.grid .g-P { background: #e3efe2; }
table.grid .g-A { background: #f7ddd9; color: var(--bad); font-weight: 700; }
table.grid .g-L { background: #dbe6f5; color: #1d3f6e; }
table.grid .g-H, table.grid .g-S { color: #9aa1a8; }
table.grid .late { text-decoration: underline 2px var(--bad); }
@page report { size: A4 landscape; margin: 8mm; }
@media print {
  .report { page: report; }
  .att .subtabs, .att .noprint, .att #attError { display: none !important; }
  .att .report-title { display: block; }
  .report .figures { grid-template-columns: repeat(5, 1fr); }
  .report .wrap { overflow: visible; }
  .report table { font-size: 10px; }
  table.grid th, table.grid td { padding: 2px 1px; min-width: 0; }
  .report a { color: inherit; text-decoration: none; }
  table.grid tr, .report-sum tr { break-inside: avoid; }
  table.grid .g-P, table.grid .g-A, table.grid .g-L { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Reports (Build 17.1): the to-do box and rows still waiting for a rate or a weight. */
.todo { border-left: 4px solid #c77700; background: #fdf0d9; padding: 10px 14px; }
.todo.done { border-left-color: #2f7d4a; background: #e3f2e8; }
.todo h3 { margin-bottom: 2px; }
tr.needs td { background: #fdf0d9; }
.weightreport table input { min-height: 38px; padding: 6px 8px; max-width: 120px; text-align: right; }
.sums .sub { font-weight: 650; border-top: 1px solid var(--line); padding-top: 4px; }
.daytable .grouphead th { background: #f2f3f4; text-align: left; }
.daytable .subtotal td { font-weight: 650; border-top: 1px solid var(--ink); }
.daytable .total td { font-size: 1.05em; }
@media print { .weightreport .bar .row, .weightreport .back { display: none; } }

/* Attendance figures you can click to list those people or days (Build 17.2). */
.figures > a { background: #fff; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); cursor: pointer; }
.att .figures > a { color: var(--ink); }
.figures > a:hover { background: #fdf6ea; }
.figures > a:focus-visible { outline: 3px solid var(--orange); outline-offset: -3px; }
.figures > a.lead { background: var(--foam); }
.figures > a.alert { background: #f7ddd9; color: var(--bad); }
.att .figures > a.alert span, .att .figures > a.alert strong { color: var(--bad); }
.figures > a.on { box-shadow: inset 0 0 0 3px var(--orange); }
.showing { background: #fdf6ea; border-left: 4px solid var(--orange); padding: 8px 12px; margin: 0 0 12px; }
@media print { .showing { display: none; } }

/* Monthly report calendar (Build 17.4): a column per date with its weekday. */
table.cal-month { font-size: 13px; }
table.cal-month thead th { vertical-align: bottom; line-height: 1.1; padding: 4px 2px; min-width: 30px; }
table.cal-month thead th .wd { display: block; font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
table.cal-month thead th .dn { display: block; font-size: 14px; font-weight: 700; }
table.cal-month th.who, table.cal-month tbody th { text-align: left; white-space: nowrap; padding: 4px 8px; position: sticky; left: 0; background: #fff; z-index: 1; font-weight: 600; }
table.cal-month tbody th small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
table.cal-month td { height: 34px; font-weight: 650; }
table.cal-month .closed { background: #f1f2f3; }
table.cal-month thead th.closed .dn, table.cal-month thead th.closed .wd { color: #9aa1a8; }
table.cal-month thead th.today { background: var(--orange); }
table.cal-month thead th.today .wd, table.cal-month thead th.today .dn { color: var(--ink); }
table.cal-month td.today { box-shadow: inset 2px 0 0 var(--orange), inset -2px 0 0 var(--orange); }
table.cal-month td.g-future { background: repeating-linear-gradient(135deg, #fff 0 4px, #f3f4f5 4px 8px); }
table.cal-month td.g-none { color: #c4c8cc; font-weight: 400; }
@media print {
  table.cal-month thead th { min-width: 0; }
  table.cal-month thead th .wd { font-size: 7px; }
  table.cal-month thead th .dn { font-size: 10px; }
  table.cal-month td { height: auto; }
  table.cal-month .closed, table.cal-month thead th.today, table.cal-month td.g-future { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media print {
  table.cal-month tbody th { padding: 2px 4px; font-size: 10px; }
  table.cal-month tbody th small { font-size: 8px; }
  .figures > a.on { box-shadow: none; }
}

/* Packing list and estimate prints: clean vertical lines between columns (Maaz, 14 Nov 2026). */
.inv-lines.ruled { border: 1px solid #9aa0a6; }
.inv-lines.ruled th, .inv-lines.ruled td { border-left: 1px solid #c4c8cc; border-right: 1px solid #c4c8cc; }
.inv-lines.ruled thead th { border-left-color: #5a6066; border-right-color: #5a6066; }
.inv-lines.ruled .grouphead th { border-left: 1px solid #c4c8cc; border-right: 1px solid #c4c8cc; }
/* Every cell centred on these two prints (Maaz, 14 Nov 2026); the grade headings stay on the left. */
.inv-lines.ruled th, .inv-lines.ruled td { text-align: center; }
.inv-lines.ruled .grouphead th { text-align: left; }

/* A faint logo behind the tax invoice. */
.invoice.watermark { position: relative; isolation: isolate; }
.invoice.watermark::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url(/img/re-logo.png) center 45% / min(70%, 560px) auto no-repeat; opacity: .07; }
@media print { .invoice.watermark::before { position: fixed; } }

/* Packing list print, compact (Maaz, 14 Nov 2026): a smaller letterhead, tighter rows and a slim foot, so more bundles fit on a page. */
.invoice.packprint { gap: 8px; }
.packprint .brand { gap: 2px; }
.packprint .brand-logo { padding: 0 40px; }
.packprint .brand-logo img { height: 58px; }
.packprint .brand-address { font-size: 11px; line-height: 1.3; }
.packprint .brand-title { font-size: 15px; padding: 3px 10px; margin-top: 2px; }
.packprint .docinfo { gap: 10px; }
.packprint .docinfo .party, .packprint .docmeta { padding: 4px 10px; }
.packprint .docmeta { gap: 1px 12px; }
.packprint .inv-lines { font-size: 11.5px; }
.packprint .inv-lines th, .packprint .inv-lines td { padding: 2px 5px; line-height: 1.25; }
.packprint .packtable .grouphead th { padding: 3px 6px; }
.packprint .inv-foot { grid-template-columns: minmax(0, 1fr) 280px; gap: 12px; }
.packprint .inv-foot .sums div { padding: 0; }
.packprint .sums.bank { padding: 4px 10px; }
.packprint .invoice .sums .big, .packprint .sums .big { font-size: 15px; padding: 2px 8px; }
@media print {
  .invoice.packprint { font-size: 10.5px; }
  .packprint .inv-lines { font-size: 10.5px; }
  .packprint .inv-lines th, .packprint .inv-lines td { padding: 1.5px 4px; }
  .packprint .inv-foot { break-inside: avoid; }
}
/* Build 17.10: tick up to 3 roles for a user. */
fieldset.roles { border: 1px solid var(--line); padding: 10px 14px 12px; margin: 0 0 12px; gap: 8px; }
fieldset.roles legend { font-weight: 650; padding: 0 6px; }
fieldset.roles .check:has(input:disabled) { color: var(--muted); }

/* Bill from several packing lists on one vehicle (Maaz, 14 Nov 2026). */
fieldset.together { border: 1px solid var(--line); padding: 8px 12px 10px; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
fieldset.together legend { font-weight: 650; padding: 0 4px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; }
label.check input { width: 20px; height: 20px; accent-color: var(--orange); }
/* Build 17.14: Sundays and public holidays worked are paid 1½ days, highlighted for payroll. */
.report-sum .pay, mark.pay { background: #ffe08a; color: #6b4e00; }
mark.pay { padding: 0 4px; font-weight: 700; }
table.grid .g-half { background: #ffe08a; color: #6b4e00; font-weight: 700; font-size: 11px; }
@media print { .report-sum .pay, mark.pay, table.grid .g-half { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* Accounts (Build 18.0): Tally-style two-sided reports. */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
td.indent { padding-left: 28px; }
tr.group td { background: var(--soft, #f6f3ee); }
tr.muted td { color: var(--muted); }

/* Keyboard control (Build 18.2). */
kbd { font: 600 13px/1 "JetBrains Mono", ui-monospace, monospace; border: 1px solid var(--line); border-bottom-width: 2px; padding: 2px 6px; background: #fff; color: var(--ink); white-space: nowrap; }
#view table:not(.lines) tbody tr:has(:focus-visible), #view table:not(.lines) tbody tr:focus-visible { background: var(--foam); outline: 2px solid var(--orange); outline-offset: -2px; }
#view table:not(.lines) tbody tr:has(:focus-visible) a:focus-visible { outline: 0; }
.tile:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.hello .keyhint { color: #d4d7da; margin-top: 8px; }
.hello .install { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; color: #d4d7da; font-size: 14px; }
.hello .install[hidden] { display: none; }
dialog.goto { width: min(520px, calc(100vw - 32px)); }
.gotolist { list-style: none; margin: 0; padding: 0; max-height: min(420px, 55vh); overflow-y: auto; border: 1px solid var(--line); }
.gotolist li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 12px; cursor: pointer; }
.gotolist li.on { background: var(--orange); color: var(--ink); font-weight: 650; }
.gotolist li.none { color: var(--muted); cursor: default; }
dialog:has(table.keys) { width: min(640px, calc(100vw - 32px)); }
table.keys { min-width: 0; width: 100%; }
table.keys th, table.keys td { padding: 5px 8px; vertical-align: top; }
table.keys th { text-align: left; width: 1%; white-space: nowrap; padding-right: 14px; font-weight: 400; }
@media print { #keysHelp { display: none; } }

/* Build 22: Accounts > Entries. A row opens the entry; a cancelled one is greyed. */
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--foam); }
tr.off td { color: #777; text-decoration: line-through; }
tr.off td:last-child, tr.off td:nth-last-child(2), tr.off td:nth-last-child(3) { text-decoration: none; }
#jTable input, #gTable input, #gTaxes input { width: 100%; min-width: 120px; }

/* Build 24: block stock. Amber for "make more", narrow count and level boxes. */
.tag.warn { background: #fdf0c8; color: #7a5200; font-weight: 600; }
table.stock input { width: 90px; text-align: right; }
table.stock input.saved { border-color: #3c7d3a; }

/* GSTR-1 draft (Build 25) */
.gapnote { background: #fdf0d9; border-left: 4px solid #c77700; padding: 12px 16px; }
.gapnote ul { margin: 6px 0 0; padding-left: 20px; }
a.linkbutton { display: inline-flex; align-items: center; text-decoration: none; }

/* Monthly sales sheet (Build 26), laid out as the workbook: brands left, grades and totals right */
.salesgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; align-items: start; }
.salescol { display: grid; gap: 16px; }
.salesblock { width: 100%; min-width: 0; }
.salesblock th.sectionhead { background: #fdebd3; text-align: center; font-size: 16px; }
.salesblock tr.muted td { color: #8a9095; }
.salesblock .subtotal td { font-weight: 650; border-top: 1px solid var(--ink); }

/* Build 27.1: bills waiting more than 30 minutes for Tally, on Home and the Tally page. */
.tally-alert { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; margin: 0 0 14px; border-left: 10px solid var(--bad); background: #fdecea; color: var(--ink); }
.tally-alert strong { color: var(--bad); }
.tally-alert a { color: var(--orange-deep); font-weight: 650; }
.tally-alert.held { border-left-color: var(--orange); background: var(--foam); }
.tally-alert.held strong { color: var(--orange-deep); }

/* Build 28: dates that should not break over lines in wide tables. */
.nowrap { white-space: nowrap; }

/* Build 29: Balance Sheet and Profit & Loss groups that open into what is under them, as in Tally. */
button.drill { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
button.drill:hover { color: var(--orange-deep); text-decoration: underline; }
td.indent2 { padding-left: 52px; }

/* The menu on the left (Build 30): groups of pages with icons, a page's tabs under it, folds to icons. */
.side { --side-w: 256px; position: sticky; top: 0; height: 100vh; width: var(--side-w); background: #fff; display: flex; flex-direction: column; border-right: 1px solid var(--line); z-index: 30; }
.sidetop { display: flex; align-items: center; gap: 6px; padding: 10px 10px 8px 16px; min-height: 64px; }
.side .brand, .mtop .brand { flex-direction: row; text-align: left; }
.side .brand { flex: 1; min-width: 0; gap: 8px; font-size: 18px; padding: 4px 0; }
.side .brand img { height: 26px; flex: none; }
.side .brand .navlabel { white-space: normal; line-height: 1.05; font-size: 17px; overflow: hidden; }
.sidefold, .sideclose, .navtoggle, .menubtn { background: none; border: 0; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.sidefold, .sideclose { width: 40px; height: 40px; }
.sidefold:hover, .sideclose:hover, .navtoggle:hover { color: var(--ink); background: #f1f2f3; }
.sideclose { display: none; }
#tabs { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 2px 10px 12px; scrollbar-width: thin; }
.navgroup + .navgroup { margin-top: 10px; }
.navhead { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 4px; }
#tabs ul { list-style: none; margin: 0; padding: 0; }
.ico { flex: none; display: block; }
.navlink, .navbtn { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 10px; color: var(--muted); font-weight: 600; text-decoration: none; border-radius: 6px; position: relative; width: 100%; }
.navlink:hover, button.navbtn:hover { background: #f1f2f3; color: var(--ink); }
.navlink[aria-current=page] { background: var(--foam); color: var(--ink); }
.navlink[aria-current=page]::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 4px; background: var(--orange); border-radius: 0 3px 3px 0; }
.navlink[aria-current=page] .ico { color: var(--orange-deep); }
.navlabel { min-width: 0; }
.navrow { display: flex; align-items: center; gap: 2px; }
.navrow .navlink { flex: 1; min-width: 0; }
.navtoggle { width: 34px; height: 34px; border-radius: 6px; }
.navtoggle .ico { width: 18px; height: 18px; transition: transform .15s; }
.navitem.open > .navrow .navtoggle .ico { transform: rotate(90deg); }
#tabs .navsub { display: none; margin: 2px 0 6px 21px; padding-left: 10px; border-left: 2px solid var(--line); }
#tabs .navitem.open > .navsub { display: block; }
.navsubhead { display: none; }
.subitem { display: block; padding: 6px 10px; color: var(--muted); font-size: 15px; font-weight: 550; text-decoration: none; border-radius: 5px; }
.subitem:hover { background: #f1f2f3; color: var(--ink); }
.subitem[aria-current=page] { color: var(--ink); font-weight: 700; background: var(--foam); }
.sidefoot { border-top: 1px solid var(--line); padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
button.navbtn { background: none; border: 0; cursor: pointer; text-align: left; font-size: 15px; }
.whobox { color: var(--ink); font-size: 14px; font-weight: 600; min-height: 48px; }
.whobox .navlabel { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.whobox #who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.whobox small { color: var(--muted); font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A page's tabs are in the menu, so the page does not repeat them. */
.desk #view nav.subtabs { display: none; }
.mtop, .sideshade { display: none; }

@media (min-width: 861px) {
  .rail .side { --side-w: 68px; }
  .rail .side .navlabel, .rail .navhead, .rail .navtoggle, .rail .side .brand .navlabel { display: none; }
  .rail .sidetop { flex-direction: column; padding: 10px 8px 6px; gap: 4px; }
  .rail .side .brand { flex: none; justify-content: center; }
  .rail .side .brand img { height: 22px; }
  .rail #tabs { padding: 2px 8px 12px; }
  .rail .navgroup + .navgroup { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
  .rail .navlink, .rail .navbtn { justify-content: center; padding: 0; gap: 0; }
  .rail .navlink[aria-current=page]::before { left: -8px; }
  .rail .sidefoot { padding: 8px; }
  .rail #tabs .navitem.open > .navsub { display: none; }
  /* Folded: hovering or moving onto a page with tabs opens them beside its icon. */
  .rail #tabs .navitem.fly > .navsub { display: block; position: fixed; left: calc(var(--side-w) - 4px); width: 230px; max-height: calc(100vh - 16px); overflow-y: auto; margin: 0; padding: 6px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--orange); box-shadow: 0 8px 24px rgba(0, 0, 0, .22); z-index: 40; }
  .rail .navitem.fly .navsubhead { display: block; font-weight: 700; padding: 6px 10px 4px; color: var(--ink); }
}

@media (max-width: 860px) {
  body.desk { grid-template-columns: minmax(0, 1fr); }
  .mtop { display: flex; align-items: center; gap: 6px; background: #fff; padding: 4px 12px 4px 4px; min-height: 56px; position: sticky; top: 0; z-index: 20; }
  .mtop .brand { font-size: 18px; gap: 10px; }
  .mtop .brand img { height: 28px; }
  .menubtn { width: 48px; height: 48px; color: var(--ink); }
  .maincol { min-height: calc(100vh - 56px); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; height: auto; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .2s ease; z-index: 50; box-shadow: none; }
  .menuopen .side { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .sidefold { display: none; }
  .sideclose { display: grid; }
  .menuopen .sideshade { display: block; position: fixed; inset: 0; background: rgba(25, 27, 29, .55); border: 0; z-index: 45; padding: 0; }
  .navlink { min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) { .side, .navtoggle .ico { transition: none; } }

/* Blocks in groups (Build 30.1): Home and the front page of each section, with an icon on each block. */
.tilegroup + .tilegroup { margin-top: 26px; }
.tilegroup .tiles { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tilehead { color: #d4d7da; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 10px; font-stretch: 100%; }
.tile.icotile { flex-direction: row; align-items: flex-start; gap: 16px; }
.tile.icotile .ico { width: 30px; height: 30px; color: var(--orange-deep); margin-top: 2px; }
.tiletext { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tiletext > span { color: var(--muted); font-size: 15px; }
.tile:hover, .tile:focus-visible { background: var(--foam); }
.sectionhome { margin-bottom: 22px; }
.sectionhome h1 { font-size: 40px; }
@media (max-width: 860px) { .sectionhome h1 { font-size: 30px; } }
