/* =====================================================================
   invoices.css: invoices and quotes in the dashboard (loaded after crm.css)

   The status-dots design (the owner, 21 October 2026, "all yes"): a row is who it is for and what it is for on the left;
   on the right the amount in plain ink, and under it the state as a dot and its word (status.js). The amount is no
   longer green or red (14 October's rule): the dot carries the state. A late invoice is first in every list, its state in
   coral, and the one tap that fixes it (Send reminder, or Text again) sits beside it as a quiet .btn-sub. Money's two
   cards show the first five rows in a table of Customer, Number, Status and Amount (a wide screen; two lines on a phone).
   Colours are the roles colour.css names; nothing here names a raw colour.
   ===================================================================== */
/* a list of invoices or quotes: one row each (invoices.js docRow) */
.inv-list{list-style:none;margin:0;padding:0 8px 8px}
.dr-b .inv-list{padding:0}
.inv-li{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center}
.inv-li+.inv-li{box-shadow:0 -1px 0 var(--hair)}
.inv-row{grid-column:1 / -1;grid-row:1;display:grid;grid-template-columns:minmax(0,1fr) max-content 14px;grid-template-areas:"who r chev";column-gap:12px;align-items:center;width:100%;min-height:60px;padding:10px 8px 10px 12px;border:0;border-radius:var(--r-row-tint);background:transparent;color:inherit;font:inherit;text-align:start;cursor:pointer;touch-action:manipulation;transition:background-color var(--duration-quick) var(--ease-out)}
.inv-row:active{background:var(--press)}
.inv-t{grid-area:who;min-width:0}
.inv-t b{display:block;font-size:var(--fs-body);font-weight:500;line-height:1.35;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.inv-t small{display:block;margin-top:2px;font-size:var(--fs-sm);line-height:1.35;color:var(--ink-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.inv-num{display:none}
.inv-r{grid-area:r;display:flex;flex-direction:column;align-items:flex-end;gap:3px;min-width:max-content} /* the amount and its state: one column that is as wide as the longer of the two, so a state word is never cut and never under the chevron */
.inv-a{font-size:var(--fs-body);font-weight:500;line-height:1.3;color:var(--ink);white-space:nowrap}
.inv-a.void,.inv-hero b.void{color:var(--ink-3);text-decoration:line-through}
.inv-s{white-space:nowrap}
.inv-row>svg.i{grid-area:chev;width:14px;height:14px;color:var(--ink-4)}
/* plain zeros: the face's tabular zero is slashed (shell.css says the same), so figures here are plain */
.inv-a,.inv-num,.inv-card-sub{font-variant-numeric:normal;font-feature-settings:normal}
@media (hover:hover){.inv-row:hover,.inv-li.has-do:hover .inv-row{background:var(--row-hover,var(--hover))}}
/* a row with a quiet button: it sits under its state, right-aligned with the amount, and is the row's sibling (never inside it) */
.inv-li.has-do .inv-row{padding-bottom:50px}
.inv-li.has-do .row-do{grid-column:2;grid-row:1;align-self:end;margin:0 34px 10px 0;position:relative;z-index:1}
.inv-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px 4px}
/* Money: the Invoices and Quotes cards hold the rows themselves, the title with what the rows add up to under it */
.inv-card-sub{margin:2px 0 0;font-size:var(--fs-sm);color:var(--ink-3)}
.inv-card-sub b{font-weight:500;color:var(--ink-2)}
.inv-mo .cu-card-h{align-items:flex-start;justify-content:space-between;padding-top:18px;padding-bottom:10px}
.inv-mo .cu-card-h .btn-sub{margin-top:-2px}
.inv-mo .inv-list{padding:0 8px}
.inv-mo .inv-foot{padding:6px 20px 16px}
.inv-th{display:none}
/* the sheets' filter: Solid Glass's quiet tabs (the dashboard's .t-tabs), slim to look at, and a finger gets its 44 from an invisible edge */
.inv-tabs{display:flex;width:100%;margin:0 0 12px;overflow:visible} /* three tabs never scroll; a scrolling bar would also clip the 44px edge */
.inv-tabs .t-tab{flex:1 1 auto;justify-content:center;padding:0 10px}
.inv-tabs .t-tab .n{font-weight:500}
.dr-b>#sheet-rows .empty{padding:32px 16px}
@media (max-width:720px),(pointer:coarse){.inv-tabs .t-tab{height:var(--h-ctl);padding:0 8px}.inv-tabs .t-tab::after{content:"";position:absolute;inset:calc(50% - 22px) 0}}
@media (min-width:1000px){
  /* the wide card: Customer, Number, Status, Amount, with the quiet button at the end of the status */
  .inv-wide .inv-th{display:grid;grid-template-columns:minmax(0,1.3fr) 120px minmax(0,1.5fr) 110px 14px;column-gap:16px;padding:4px 8px 8px 12px;font-size:var(--fs-meta);font-weight:500;color:var(--ink-3);box-shadow:inset 0 -1px 0 var(--hair)}
  .inv-wide .inv-th span:nth-child(4){text-align:right}
  .inv-wide .inv-li{grid-template-columns:minmax(0,1.3fr) 120px minmax(0,1.5fr) 110px 14px;column-gap:16px}
  .inv-wide .inv-li+.inv-li{box-shadow:0 -1px 0 var(--hair)}
  .inv-wide .inv-th+.inv-li{box-shadow:none}
  .inv-wide .inv-r{display:contents}
  .inv-wide .inv-row{grid-template-columns:subgrid;grid-template-areas:"who num st amt chev";min-height:52px;padding:8px 8px 8px 12px}
  .inv-wide .inv-t small{display:none}
  .inv-wide .inv-num{display:block;grid-area:num;font-size:var(--fs-sm);color:var(--ink-3);white-space:nowrap}
  .inv-wide .inv-s{grid-area:st;justify-self:start;align-self:center}
  .inv-wide .inv-a{grid-area:amt;justify-self:end;align-self:center}
  .inv-wide .inv-li.has-do .inv-row{padding-bottom:8px}
  .inv-wide .inv-li.has-do .row-do{grid-column:3;grid-row:1;justify-self:end;align-self:center;margin:0}
}
@media (pointer:coarse){.inv-row{min-height:64px}.inv-li.has-do .inv-row{padding-bottom:54px}.inv-li.has-do .row-do{margin-bottom:12px}}
/* one invoice in the side sheet */
.inv-lbl{margin:0 0 8px;font-size:var(--fs-meta);font-weight:500;line-height:1.3;color:var(--ink-2)}
.inv-hero small{display:block;font-size:var(--fs-meta);line-height:1.3;color:var(--ink-2)}
.inv-hero b{display:block;margin:4px 0 8px;font-size:clamp(32px,9vw,40px);font-weight:700;letter-spacing:-.035em;line-height:1.05;color:var(--ink)}
.inv-acts{display:flex;flex-wrap:wrap;gap:8px}
.inv-acts .btn{flex:1 1 auto;justify-content:center}
.inv-how{margin:0;font-size:var(--fs-body);line-height:1.5;white-space:pre-line;overflow-wrap:anywhere}
.inv-lines-ro,.inv-hist{list-style:none;margin:0;padding:0}
.inv-lines-ro li{display:flex;justify-content:space-between;gap:16px;padding:10px 0;border-bottom:1px solid var(--line);font-size:var(--fs-body)}
.inv-lines-ro small{display:block;margin-top:2px;font-size:var(--fs-sm);color:var(--ink-2)}
.inv-tot{display:grid;gap:6px;margin:12px 0 0}
.inv-tot div{display:flex;justify-content:space-between;gap:16px;font-size:var(--fs-body)}
.inv-tot dt{color:var(--ink-2)}.inv-tot dd{margin:0}
.inv-tot .grand{padding-top:8px;border-top:1px solid var(--line);font-size:var(--fs-lg);font-weight:700}
.inv-tot .grand dt{color:var(--ink)}
.inv-hist li{padding:8px 0;border-bottom:1px solid var(--line);font-size:var(--fs-body)}
.inv-hist li:last-child,.inv-lines-ro li:last-child{border-bottom:0}
.inv-hist small{display:block;margin-top:2px;font-size:var(--fs-sm);color:var(--ink-2)}
.inv-void{align-self:flex-start;color:var(--err-ink)}
/* the draft's form: what it is for, how many, how much each, and a way to take the line out */
.inv-head,.inv-line{display:grid;grid-template-columns:minmax(0,1fr) 56px 96px 32px;gap:8px;align-items:center}
.inv-head{margin-bottom:6px;font-size:var(--fs-meta);color:var(--ink-2)}
.inv-line{margin-bottom:8px}
.inv-line .input{min-width:0;width:100%}
.inv-line [data-k="qty"],.inv-line [data-k="amount"]{text-align:end}
.inv-three{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) minmax(0,1fr);gap:12px}
.inv-two{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:12px}
.inv-err{margin:0;padding:10px 12px;border-radius:var(--r-ctl);background:var(--err-bg);color:var(--err-ink);font-size:var(--fs-sm)}
.inv-f{justify-content:flex-end}
.inv-f .btn-ghost{margin-inline-end:auto}
.inv-set{display:flex;flex-direction:column;gap:12px;margin-top:12px}
.inv-hint{margin:-6px 0 0;font-size:var(--fs-sm);line-height:1.45;color:var(--ink-2)}
.inv-rem{padding-inline:0;border-top:1px solid var(--line)}
.inv-rem .l small{color:var(--ink-2)}
.inv-days{display:grid;grid-template-columns:repeat(3,72px);gap:8px;margin:0;padding:0;border:0}
.inv-days legend{margin-bottom:6px;padding:0;font-size:var(--fs-sm);font-weight:500}
.inv-days .input{text-align:end}
@media (max-width:1000px){
  .cu-inv{order:5}
  .cu-page:is([data-view="timeline"],[data-view="jobs"],[data-view="details"]) .cu-inv{display:none}
}
@media (max-width:420px){.inv-three{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.inv-three .field:first-child{grid-column:1 / -1}
  /* the description gets a row of its own: in a column beside Qty and Each it showed about 17 characters (batch 3, 15 Oct) */
  .inv-head,.inv-line{grid-template-columns:64px minmax(0,1fr) 32px}.inv-line [data-k="text"]{grid-column:1 / -1}.inv-head{display:none}}
@media (prefers-reduced-motion:reduce){.inv-row{transition:none}}
/* quotes share the list, the sheet and the form; what is their own: two "new" buttons and the terms folded */
.inv-new{display:flex;gap:0;margin-inline-start:auto}
.cu-inv .cu-card-h{padding-inline-end:12px}
.cu-card-h .inv-new .btn{margin-inline-start:0}
.inv-terms{border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.inv-terms summary{min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:var(--fs-body);font-weight:500;cursor:pointer;list-style:none}
.inv-terms summary::-webkit-details-marker{display:none}
.inv-terms summary::after{content:"";flex:none;width:8px;height:8px;border:solid var(--ink-2);border-width:0 2px 2px 0;rotate:45deg;translate:0 -2px;transition:rotate var(--duration-quick) var(--ease-out)}
.inv-terms[open] summary::after{rotate:225deg;translate:0 2px}
@media (prefers-reduced-motion:reduce){.inv-terms summary::after{transition:none}}
.inv-terms .inv-how{margin:0 0 12px;color:var(--ink-2)}
.inv-new .btn{padding-inline:6px}
@media (max-width:720px){.inv-new{gap:8px}} /* a phone: + Quote and + Invoice are two buttons, Solid Glass's 8 apart, not one strip */
/* the "Add a line" link sits on the form's own edge: app.css gives it 10px, crm.css already zeroes it for .cu-lines (batch 3, 15 Oct) */
.inv-form .kv-add{margin-inline-start:0}
/* the QR to pay (invoices.js invQr): the code paints its own white ground and border, so it reads in both themes */
/* the draft's footer (batch review, 15 Oct): up to five buttons wrap: Delete draft at the left and Save draft on the first row, then Generate / Send / Text it as one row of equal buttons */
.inv-f{flex-wrap:wrap;gap:8px}
.inv-f>.btn-ghost{margin-inline-end:auto}
.inv-f-br{flex:0 0 100%;height:0}
.inv-f-br~.btn{flex:1 1 0;min-width:0;justify-content:center;white-space:nowrap}
.inv-g-short{display:none}
@media (max-width:520px){.inv-g-long{display:none}.inv-g-short{display:inline}}
.inv-qr{display:flex;flex-direction:column;align-items:center;gap:14px;margin-top:16px}
.modal:has(.inv-qr) h2{text-align:center}
.inv-qr-code{width:min(260px,70vw);aspect-ratio:1;overflow:hidden;border-radius:var(--r-btn)}
.inv-qr-code svg{display:block;width:100%;height:100%}
.inv-qr .inv-hint{text-align:center;max-width:36ch}
