/* 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;}
}

/* Money right aligned (design audit 2026-09-26): a booking's Total. */
@media (min-width:761px){ .row.order > :nth-child(4){text-align:right;padding-right:16px;} }
/* Bars or a line beside the company sales chart's ranges. */
.sales-chart-type{ display:inline-flex; align-items:center; gap:8px; margin-left:auto; }

/* The dashboard's order panels (2026-10-01). */
.ord-book-figs{ display:grid; grid-template-columns:1fr 1fr; border-bottom:1px solid var(--line); }
.ord-book-fig{ display:flex; flex-direction:column; gap:2px; padding:10px 16px; min-width:0; }
.ord-book-fig + .ord-book-fig{ border-left:1px solid var(--line); }
.ord-book-label{ font-size:12px; color:var(--ink-soft); }
.ord-book-value{ font-family:var(--font-display); font-size:22px; font-weight:600; font-variant-numeric:tabular-nums; }
.ord-book-sub{ font-size:11px; color:var(--ink-soft); }
.ord-book-sub.up, .ord-top-change.up{ color:var(--sage-ink, var(--ink)); font-weight:600; }
.ord-book-sub.down, .ord-top-change.down{ color:var(--brick); font-weight:600; }
.ord-book-day{ flex:none; width:92px; font-size:12px; color:var(--ink-soft); }
.ord-top-rank{ flex:none; width:16px; font-size:12px; color:var(--ink-soft); text-align:right; }
.ord-top-change{ flex:none; width:52px; text-align:right; font-size:11px; color:var(--ink-soft); }
.dp-ord-top .dp-head .dp-range + .dp-range{ margin-left:6px; }
@container (max-width:600px){ .dp-ord-top .dp-head{ flex-wrap:wrap; } .dp-ord-top .dp-head .dp-title{ flex:1 0 100%; } .dp-ord-top .dp-head .dp-range{ margin-left:0; } }
