/* The Report centre (acc-reports.js). Its own sheet, like the slip's and the
   contract's: acc-app.css is exported to the React console. It reads the
   accounting palette (--acc-*) off :root and adds no tokens of its own. */

.rpt{display:grid;grid-template-columns:232px minmax(0,1fr);gap:16px;align-items:start}

/* the catalogue */
.rpt__nav{position:sticky;top:0;display:flex;flex-direction:column;gap:14px;padding:12px;
  background:var(--acc-surface);border:1px solid var(--acc-line);border-radius:var(--acc-r-lg);box-shadow:var(--acc-shadow)}
.rpt__navg{display:flex;flex-direction:column;gap:2px}
.rpt__navh{font-size:calc(11px * var(--acc-fs));font-weight:700;letter-spacing:.04em;text-transform:uppercase;
  color:var(--acc-ink-mute);padding:0 8px 4px}
.rpt__navbtn{display:flex;align-items:center;gap:9px;width:100%;padding:8px 10px;border:0;border-radius:8px;
  background:transparent;color:var(--acc-ink-2);font:inherit;font-size:calc(13.5px * var(--acc-fs));text-align:start;cursor:pointer}
.rpt__navbtn svg{flex:none;color:var(--acc-ink-mute)}
.rpt__navbtn:hover{background:var(--acc-hover)}
.rpt__navbtn.is-on{background:var(--acc-accent);color:var(--acc-accent-ink);font-weight:600}
.rpt__navbtn.is-on svg{color:currentColor}

/* the report */
.rpt__main{min-width:0}
.rpt__title{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 12px;margin:2px 0 12px}
.rpt__title h2{margin:0;font-size:calc(19px * var(--acc-fs));font-weight:700;color:var(--acc-ink)}
.rpt__title span{font-size:calc(13px * var(--acc-fs));color:var(--acc-ink-soft)}

.rpt__bar{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px 14px;margin-bottom:16px;padding:12px;
  background:var(--acc-surface);border:1px solid var(--acc-line);border-radius:var(--acc-r-lg)}
.rpt__f{display:flex;flex-direction:column;gap:4px;min-width:0}
.rpt__f>span{font-size:calc(11.5px * var(--acc-fs));font-weight:600;color:var(--acc-ink-soft)}
.rpt__bar select,.rpt__bar input{height:34px;padding:0 10px;border:1px solid var(--acc-line-firm);border-radius:8px;
  background:var(--acc-surface);color:var(--acc-ink);font:inherit;font-size:calc(13.5px * var(--acc-fs));min-width:0;max-width:100%}
.rpt__chips{display:flex;flex-wrap:wrap;gap:6px;flex-basis:100%}
.rpt__chip{height:30px;padding:0 12px;border:1px solid var(--acc-line-firm);border-radius:999px;background:var(--acc-surface);
  color:var(--acc-ink-2);font:inherit;font-size:calc(12.5px * var(--acc-fs));cursor:pointer;white-space:nowrap}
.rpt__chip:hover{background:var(--acc-hover)}
.rpt__chip.is-on{background:var(--acc-accent);border-color:var(--acc-accent);color:var(--acc-accent-ink);font-weight:600}
.rpt__step{display:flex;align-items:center;gap:6px}
.rpt__step .accbtn{height:34px;min-width:34px;justify-content:center;font-size:calc(18px * var(--acc-fs));line-height:1;padding:0 8px}
/* The annual report's window: From and To side by side, months then days. */
.rpt__span{display:flex;align-items:flex-end;gap:8px;min-width:0}
.rpt__span .rpt__f{flex:0 1 auto}
.rpt__span input[type="month"]{width:180px}
.rpt__span input[type="date"]{width:150px}

.rpt__kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(215px,1fr))}
.rpt__kpis .rpt__kpi{min-width:0}
.rpt__d{font-weight:700;white-space:nowrap}
.rpt__d--good{color:var(--acc-green)}
.rpt__d--bad{color:var(--acc-red)}
.acckpi__sub .rpt__d+span{color:var(--acc-ink-mute)}

.rpt__grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
.rpt__grid2>.acccard{min-width:0}
.rpt__chart{position:relative;padding:14px 16px 10px}

/* the sales grid: sortable headings, groups that open onto their invoices */
.rpt__sort{border:0;background:none;padding:0;font:inherit;color:inherit;font-weight:inherit;cursor:pointer;white-space:nowrap}
.rpt__sort:hover,.rpt__sort.is-on{color:var(--acc-accent-deep)}
.rpt__caret{width:22px;height:22px;margin-inline-end:6px;border:1px solid var(--acc-line);border-radius:6px;background:var(--acc-surface);
  color:var(--acc-ink-soft);font-size:12px;line-height:1;cursor:pointer;vertical-align:middle}
.rpt__caret.is-open{background:var(--acc-accent);border-color:var(--acc-accent);color:var(--acc-accent-ink)}
.rpt__subrow td{background:var(--acc-surface-2);font-size:calc(12.5px * var(--acc-fs))}

/* The tablet and the phone: the catalogue becomes a row of chips that scrolls
   sideways, above the report. */
@media (max-width:980px){
  .rpt{grid-template-columns:minmax(0,1fr)}
  .rpt__nav{position:static;flex-direction:row;gap:6px;padding:8px;overflow-x:auto;scrollbar-width:none}
  .rpt__nav::-webkit-scrollbar{display:none}
  .rpt__navg{flex-direction:row;gap:6px;flex:none}
  .rpt__navg+.rpt__navg{padding-inline-start:6px;border-inline-start:1px solid var(--acc-line)}
  .rpt__navh{display:none}
  .rpt__navbtn{width:auto;white-space:nowrap;padding:7px 11px;border:1px solid var(--acc-line);border-radius:999px}
  .rpt__navbtn.is-on{border-color:var(--acc-accent)}
  .rpt__grid2{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:760px){
  .rpt__bar{padding:10px;gap:10px}
  .rpt__chips{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin-inline:-2px}
  .rpt__chips::-webkit-scrollbar{display:none}
  .rpt__f{flex:1 1 140px}
  .rpt__bar select,.rpt__bar input{width:100%;height:40px;font-size:16px}
  .rpt__step{flex:1 1 100%}
  .rpt__f--year,.rpt__span{flex:1 1 100%}
  .rpt__span .rpt__f{flex:1 1 0}
  .rpt__span input[type="month"],.rpt__span input[type="date"]{width:100%}
  .rpt__step input,.rpt__step select{flex:1}
  .rpt__step .accbtn{height:40px;min-width:44px}
  .rpt__kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .rpt__navbtn{padding:9px 12px}
  .rpt__caret{width:28px;height:28px}
}

/* Reports audit, 13 Nov 2026: tables that fit their card.
   The ledger's tables never wrap (acc-app.css), so a long account or customer
   name pushed the figures past the card's edge — the position card's Change
   column, the trial balance's last total and the stock report's closing value
   were cut off. Names wrap here; figures never do. */
.rpt__main .acctable td:not(.t-num),.rpt__main .acctable th:not(.t-num){white-space:normal;overflow-wrap:anywhere}
.rpt__main .acctable .t-num{white-space:nowrap}
.rpt__grid2 .acctable td,.rpt__grid2 .acctable th{padding-inline:10px}
/* Twelve months and the year in one grid: tighter, the account name wrapping. */
.rpt__main .acctable--dense{font-size:calc(12px * var(--acc-fs))}
.rpt__main .acctable--dense td,.rpt__main .acctable--dense th{padding-inline:7px}
.rpt__main .acctable--dense td:first-child:not(.t-rn){min-width:150px}
/* A code (SKU) is read whole. */
.rpt__main .acctable td.t-mut{white-space:nowrap}
/* A VIN or code is a table cell, not an inline box (accounting.css makes .ltr inline-block). */
body.acc-fullscreen td.ltr{display:table-cell}
/* The keys the screen answers, at the end of the bar. */
.rpt__bar .rpt__keys{margin-inline-start:auto;align-self:center;display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px;
  font-size:calc(11.5px * var(--acc-fs));color:var(--acc-ink-mute)}
.rpt__keys kbd{font:600 calc(10.5px * var(--acc-fs))/1 ui-monospace,Consolas,monospace;padding:2px 5px;
  border:1px solid var(--acc-line-firm);border-bottom-width:2px;border-radius:4px;background:var(--acc-surface);color:var(--acc-ink-soft)}
@media (max-width:900px),(pointer:coarse){.rpt__bar .rpt__keys{display:none}}
/* The Print Centre's day, with a step either side (the Daily report). */
.prt-daystep{display:flex;align-items:center;gap:6px}
.prt-daystep input{flex:1;min-width:0}
.prt-daystep .accbtn{min-width:36px;justify-content:center;font-size:calc(18px * var(--acc-fs));line-height:1;padding:0 8px}

/* Printed through the Print Centre the report is the builders' tables; on a
   plain print of the screen the controls stay off the paper. */
@media print{
  .rpt__nav,.rpt__bar,.rpt__caret{display:none !important}
  .rpt{display:block}
}
.rpt-print .acckpis{display:flex;flex-wrap:wrap;gap:8px}
.rpt-print .acckpi{flex:1 1 150px;box-shadow:none;border:1px solid #d0d5dd}
.rpt-print .acckpi__chip{display:none}
.rpt-print .acccard{box-shadow:none;break-inside:avoid}
.rpt-print .rpt__grid2{grid-template-columns:minmax(0,1fr)}
.rpt-print .acccard__head{flex-wrap:wrap;gap:4px 12px}
