/* documents/module.css: the Invoices and Quotes tabs, the quote form and the
   signature strip. */

/* Invoices: number, company, date, due, status, total, actions. Every
   fraction minmax(0, ...) so a long company name cannot make one row resolve
   its columns differently from its neighbours; the last track FIXED, because
   an unpaid row carries Mark paid where a voided one does not. */
.row.invoices{grid-template-columns:minmax(0,1.3fr) minmax(0,1.2fr) minmax(0,0.7fr) minmax(0,0.7fr) minmax(0,0.6fr) minmax(0,0.7fr) 270px;}
/* Quotes: number, company, date, status, total, actions. */
.row.quotes{grid-template-columns:minmax(0,1.1fr) minmax(0,1.6fr) minmax(0,0.8fr) minmax(0,0.7fr) minmax(0,0.8fr) 150px;}
.row.invoices .primary-text,.row.invoices .sub-text,
.row.quotes .primary-text,.row.quotes .sub-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.row.invoices .order-actions,.row.quotes .order-actions{white-space:normal;}
/* The part-paid line ("Paid $x of $y, $z balance due") wraps above its
   buttons rather than being cut off. */
.row.invoices .order-actions .sub-text{display:block;white-space:normal;overflow:visible;margin-bottom:4px;}
/* The number is the one thing that tells two rows apart, so it is set small
   enough to show whole (INV-YYYYMMDD-NNN) in its track. */
.row.invoices .name-with-dot,.row.quotes .name-with-dot{font-size:13px;}

/* The quote form's line: service (with its detail beneath), qty, unit,
   price, subtotal, remove. The same tracks as an order line, so the two
   forms read as one form. */
.line-item-row.quote-line{grid-template-columns:minmax(0,1.6fr) 72px 64px minmax(0,0.9fr) minmax(0,0.7fr) auto;}
.line-item-row.quote-line .qli-subtotal{align-self:start;padding-top:8px;}
.qli-class-wrap{display:flex;align-items:center;gap:8px;margin-top:6px;font-size:12px;}
.qli-class-wrap select{font-size:12px;padding:3px 6px;width:auto;}

/* What has happened to a document sent for signature: one line under the
   heading, a dot for the state, the actions on the right. Its own class
   rather than the dashboard's .alert-item, which is inline-flex chrome. */
.sig-strip{display:flex;align-items:center;gap:10px;padding:9px 12px;margin:0 0 14px;border:1px solid var(--line);border-radius:8px;background:var(--subtle-bg);font-size:13px;flex-wrap:wrap;}
.sig-dot{display:inline-block;width:9px;height:9px;border-radius:50%;flex-shrink:0;}
.sig-actions{margin-left:auto;display:flex;gap:6px;flex-wrap:wrap;}

@media (max-width:760px){
  .row.invoices,.row.quotes{grid-template-columns:1fr;gap:4px;}
  .row.invoices .primary-text,.row.invoices .sub-text,
  .row.quotes .primary-text,.row.quotes .sub-text{white-space:normal;}
  .line-item-row.quote-line{grid-template-columns:1fr 1fr;}
  .sig-actions{margin-left:0;}
}

/* Money right aligned (design audit 2026-09-26): Total on invoices and quotes. */
@media (min-width:761px){
  .row.invoices > :nth-child(6){text-align:right;padding-right:16px;}
  .row.quotes > :nth-child(5){text-align:right;padding-right:16px;}
}
/* The dashboard's Open quotes: the stages as one bar, and a person's own stale age. */
.doc-stale{ display:inline-flex; align-items:center; gap:6px; margin-left:auto; font-size:12px; color:var(--ink-soft); white-space:nowrap; }
.doc-stale .dp-range{ margin-left:0; }
.doc-stack{ margin:12px 16px 6px; }
.doc-legend{ padding:0 16px 10px; flex-wrap:wrap; gap:4px 14px; }
.dp-doc-quotes .dp-head .dp-link{ margin-left:12px; }
