/* ─── Accounting tab ──────────────────────────────────────────────────────────────
   Fourth derivative of the workspace archetype (shared.css owns .pathbar, .workspace,
   .workspace-rail/-row, .workspace-panel/-head/-body and both folds). What's left here
   is the three grid columns, the inspector's own fields, and the quote tables' cells.
   The controls strip, its uppercase mini-labels, the revision block, the footer and the
   save bar are all gone — the path bar, the pane's filter row and the inspector carry
   what they carried.
   ───────────────────────────────────────────────────────────────────────────────── */

/* quotes · the open quote · its properties — the columns are all this derivative adds */
.accounting-workspace { --rail-w: 14rem; --panel-w: 19rem; grid-template-columns: var(--rail-col) minmax(0, 1fr) var(--panel-col); }

/* the pane is a column of chrome and one scrolling view, not a scroller itself */
.accounting-pane { display: flex; flex-direction: column; overflow: hidden; }
.accounting-section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* one view of a section's pane, Quote Builder's three or a cert's two */
.accounting-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.accounting-section .table-scroll { flex: 1; min-height: 0; margin-bottom: 0; }
.accounting-section .tab-bar { flex: none; }
/* the Material view nests its table one level deeper, so that wrapper passes the height through */
#quote-material-summary { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* the list's name reads first */
.quote-name-cell { font-weight: 600; }

/* ─── Inspector ─── */

/* the title, fields, meta list and empty line all come from .panel-* in shared.css now */
.accounting-insp-fields { display: flex; flex-direction: column; gap: 0.7rem; min-height: 0; flex: 1; }
/* a cert's filed PDFs · flex: none, so a long list keeps its height and pushes the Delete button down instead of running under it */
.accounting-file-list { display: flex; flex-direction: column; gap: 0.4rem; flex: none; }

.quote-totals { display: flex; flex-direction: column; gap: 0.25rem; }
.quote-total-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-sub);
}
.quote-total-line b { font-size: 0.95rem; font-weight: 680; color: var(--text); font-variant-numeric: tabular-nums; }
/* the number people came for reads one size up from the rest */
.quote-total-line--lead b { font-size: 1.2rem; }

/* ─── Part search ─── */

.quote-search-wrap { position: relative; }

/* ─── Quote tables ─── */

.quote-parts-cell { line-height: 1.6; white-space: normal; }
.quote-qty-cell   { text-align: center; }

.quote-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.quote-qty-btn {
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.quote-qty-btn:hover { background: var(--row-hover); }

.quote-qty-val {
  min-width: 1.4rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.quote-summary-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.75rem 0 0.6rem;
  color: var(--text);
}

.quote-summary-total td {
  border-top: 2px solid var(--border);
  background: var(--surface);
}

.quote-odoo-warning {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--warning);
  background: var(--warning-bg);
  color: var(--text);
  border-radius: 4px;
  font-size: 0.85rem;
}

.quote-row-warn {
  color: var(--warning);
}


/* ─── Sales Pricing · rail and pane, no inspector ─────────────────────────────── */
.pricing-workspace { --rail-w: 14rem; grid-template-columns: var(--rail-col) minmax(0, 1fr); }
.pricing-scroll { overflow: auto; padding: 0.75rem 1rem; gap: 1rem; }
.pricing-block { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }
.pricing-block .data-table input, .pricing-block .data-table select { width: 100%; min-width: 5rem; }
/* numbers stay narrow so the material picker keeps its width in an eleven-column table */
.pricing-block .data-table td.num input[type="number"] { width: 6.5rem; min-width: 0; }
.pricing-block .data-table select[data-field="material_id"] { min-width: 9.5rem; }
.pricing-block .data-table td.num, .pricing-block .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pricing-block .data-table td.num { white-space: nowrap; }
.pricing-block .data-table th { white-space: normal; vertical-align: bottom; }
.pricing-diff-up { color: var(--warning); }
.pricing-diff-down { color: var(--info-color); }
/* a line whose customer price isn't the purchase price · green when the customer pays more than we do, red when less · the row tints and the customer price takes the colour */
.pricing-price-above td { background: var(--success-bg); }
.pricing-price-above .pricing-customer { color: var(--success); font-weight: 600; }
.pricing-price-above .pricing-gap { color: var(--success); font-weight: 600; }
.pricing-price-below td { background: var(--danger-bg); }
.pricing-price-below .pricing-customer { color: var(--danger); font-weight: 600; }
.pricing-price-below .pricing-gap { color: var(--danger); font-weight: 600; }
/* a dollar difference · green when we come out ahead, red when behind */
/* the build-up's total as it's typed · the figure the revision sets, and for a purchase price the one Odoo must match */
.pricing-build-total { display: inline-flex; flex-direction: column; padding: 0.25rem 0.75rem; border: 2px solid var(--accent, var(--border)); border-radius: 6px; line-height: 1.2; }
.pricing-build-total-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.pricing-build-total-value { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pricing-expected { font-weight: 600; }
/* the same price per sheet, under its $/m² · full colour, since sheets are what we buy */
.pricing-per-sheet { display: block; font-size: 0.85em; font-weight: 500; }
/* bulk entry · one row per material, narrow inputs, a percentage beside what it's of */
.pricing-block .pricing-bulk td.num input[type="number"] { width: 6rem; }
.pricing-block .pricing-bulk select { width: auto; min-width: 0; }
.pricing-bulk td:first-child { white-space: nowrap; }
.pricing-block .pricing-bulk td.num input[type="number"] { width: 5.5rem; }
.pricing-bulk-pct { display: inline-flex; gap: 0.25rem; align-items: center; }
.pricing-bulk-changed td { background: var(--warning-bg); }
/* a revision in the history · a voided one struck through, kept for the record */
.pricing-rev { display: flex; gap: 0.5rem; align-items: center; justify-content: space-between; padding: 0.1rem 0; }
.pricing-rev-voided > span { text-decoration: line-through; opacity: 0.6; }
/* the later prices a back-dated save would leave in force */
.pricing-later-list { max-height: 14rem; overflow: auto; margin: 0.5rem 0; padding-left: 1.25rem; }
.pricing-later-choice { display: flex; gap: 0.5rem; align-items: center; font-weight: 600; }
.pricing-money-up { color: var(--success); font-weight: 600; }
.pricing-money-down { color: var(--danger); font-weight: 600; }
.pricing-internal-only td { color: var(--text-faint); font-style: italic; }
.pricing-total-row td { font-weight: 600; border-top: 2px solid var(--border); }
