/* orders/module.css: the Orders tab, the order form and the order block. */

/* The tab's rows: company (with the line summary beside it), lines, date,
   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 a Pending row carries more buttons than a Paid one and
   an auto track would size to each. Measured for the three-button case. */
.row.order{grid-template-columns:minmax(0,1.3fr) minmax(0,1.3fr) minmax(0,0.7fr) minmax(0,0.7fr) 300px;}
.row.order .primary-text,
.row.order .sub-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.row.order .order-actions{white-space:normal;}

/* The form's line: service, qty, unit, price, subtotal, remove. */
.line-item-row.order-line{grid-template-columns:minmax(0,1.6fr) 72px 64px minmax(0,0.9fr) minmax(0,0.7fr) auto;}
/* The read-only block's line: no remove column. */
.line-item-row.order-view{grid-template-columns:minmax(0,1.6fr) minmax(0,0.6fr) minmax(0,0.8fr) minmax(0,0.8fr);}

.order-block{border:1px solid var(--line);border-radius:8px;background:var(--paper-raised);margin-bottom:12px;overflow:hidden;}
.order-block-head{display:flex;justify-content:space-between;align-items:center;padding:11px 14px;border-bottom:1px solid var(--line);background:var(--subtle-bg);flex-wrap:wrap;gap:8px;}
.order-block-meta{display:flex;align-items:center;gap:10px;font-size:13px;flex-wrap:wrap;}
.order-total{font-family:var(--font-mono);font-weight:500;}
.order-actions{display:flex;gap:6px;flex-wrap:wrap;}
.order-total-line{display:flex;justify-content:flex-end;gap:8px;margin-top:10px;font-size:14px;font-weight:500;}
.checkbox-group{display:flex;gap:14px;flex-wrap:wrap;}

/* Due-date groups. Also defined by cadences; either module may be off. */
.day-group{margin-bottom:16px;}
.day-group-head{font-family:var(--font-mono);font-size:11px;text-transform:uppercase;letter-spacing:0.05em;color:var(--text-muted);margin-bottom:6px;}
.day-group-head.overdue{color:var(--brick);}
.day-group-head.today{color:var(--mustard);}

/* The calendar's due-date pill. */
.cal-orders{background:var(--brick-soft);color:#5A2A26;}
html[data-scheme="dark"] .cal-orders{color:#F0C4BE;}

@media (max-width:760px){
  .row.order{grid-template-columns:1fr;gap:4px;}
  .row.order .primary-text,.row.order .sub-text{white-space:normal;}
  .line-item-row.order-line{grid-template-columns:1fr 1fr;}
  .line-item-row.order-view{grid-template-columns:1fr 1fr;}
}
