.supply-hero { min-height: 0; grid-template-columns: 1fr auto; padding: 24px 28px; }
[hidden] { display: none !important; }
.report-charts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.report-charts h3 { margin: 0 0 14px; font-size: var(--inventory-text-body); }
.report-charts select { display: block; margin: 8px 0 14px; padding: 8px; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; background: white; }
.chart-row { display: grid; grid-template-columns: minmax(90px,1fr) 1fr auto; align-items: center; gap: 10px; margin: 14px 0; font-size: var(--inventory-text-small); }
.chart-row > span { overflow-wrap: anywhere; }
.chart-row strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.chart-track { height: 12px; background: #eef2f7; border-radius: 4px; overflow: hidden; }
.chart-track i { display: block; height: 100%; }
@media (max-width: 1100px) { .report-charts { grid-template-columns: 1fr; } }
.supply-hero h1 { font-size: clamp(26px, 2.5vw, 34px); letter-spacing: -.025em; }
.supply-hero > div { position: relative; z-index: 1; }
.supply-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; padding: 0 0 20px; }
.supply-toolbar h1 { margin: 0 0 6px; font-size: 1.5rem; }
.supply-toolbar p { margin: 0; max-width: 78ch; line-height: 1.65; color: var(--muted); font-size: var(--inventory-text-small); }
@media (max-width: 600px) { .supply-toolbar { flex-direction: column; align-items: flex-start; } }
.display-controls { display: flex; gap: 12px; align-items: center; }
.display-controls label { display: grid; gap: 6px; color: var(--muted); font-size: var(--inventory-text-small); }
.display-controls select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--text); }
.panel { border-radius: 14px; padding: 22px; }
.panel h2 { font-size: 1.3125rem; letter-spacing: -.02em; }
td { font-size: var(--inventory-text-table); padding: var(--inventory-cell-y) var(--inventory-cell-x); }
.cell-main { font-size: var(--inventory-text-body); }
.table-shell { max-height: 65vh; border-radius: 10px; }
thead th { position: sticky; top: 0; z-index: 1; background: #f7f9fc; font-size: var(--inventory-text-table); }
.cell-sub { font-size: var(--inventory-text-small); }
tbody tr:hover { background: #f4f8ff; }
main > .panel { margin-bottom: 20px; }
.supply-filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; }
.supply-filter-title { margin: 0 0 12px; color: var(--muted); font-size: var(--inventory-text-small); }
.supply-detail-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 12px; }
.supply-detail-meta p { margin: 0; color: var(--muted); font-size: var(--inventory-text-small); }
.supply-detail-meta .head-actions { flex-wrap: wrap; }
.supply-filters label { display: grid; gap: 7px; color: var(--muted); font-size: var(--inventory-text-small); }
.supply-filters label.wide { flex: 1; min-width: 220px; }
.supply-filters :is(input,select) { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: white; }
.dialog-body { padding: 20px 26px; overflow: auto; }
.dialog { max-height: calc(100dvh - 24px); width: min(960px, calc(100% - 28px)); }
#message:not(:empty), #editMessage:not(:empty), #importSummary:not(:empty) { padding: 14px 18px; border-radius: 12px; background: var(--blue-soft); color: var(--blue-strong); }
#message[data-error="true"], #editMessage[data-error="true"] { background: var(--red-soft); color: var(--red); }
#matchResults { display: flex; flex-wrap: wrap; gap: 8px; max-height: 280px; overflow-y: auto; align-content: start; }
.match-candidate { display: grid; gap: 5px; text-align: left; max-width: 100%; white-space: normal; }
.match-candidate :is(strong,small) { overflow-wrap: anywhere; }
.match-candidate strong { font-size: var(--inventory-text-body); }
.match-candidate small { font-size: var(--inventory-text-small); line-height: 1.5; color: var(--muted); }
.match-candidate[data-recommended="true"] { background: var(--blue-soft); border-color: #aac7ff; }
.reference-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.reference-actions small { color: var(--muted); line-height: 1.6; }
.supply-muted { color: var(--muted); font-size: var(--inventory-text-small); }
td .row-button { white-space: nowrap; }
td.number { text-align: right; font-variant-numeric: tabular-nums; }
button:disabled { opacity: .5; cursor: not-allowed; }
.quantity-conversion { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px 16px; border: 1px solid #d5e4ff; border-radius: 12px; background: var(--blue-soft); color: var(--blue-strong); }
.quantity-conversion > div { min-width: 0; flex: 1 1 220px; overflow-wrap: anywhere; }
.quantity-conversion strong { display: block; font-size: var(--inventory-text-body); font-variant-numeric: tabular-nums; }
.quantity-conversion small { display: block; margin-top: 5px; font-size: var(--inventory-text-small); line-height: 1.6; }
.quantity-conversion .button { flex: 0 1 auto; white-space: normal; }
.quantity-conversion[data-state="review"] { color: #7a4d06; background: #fffbf0; border-color: #eee0bb; }
.quantity-totals { display: flex; gap: 8px 24px; flex-wrap: wrap; color: var(--muted); font-size: var(--inventory-text-small); line-height: 1.6; }
.quantity-totals strong { color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .supply-filters label { width: calc(50% - 7px); min-width: 0; } .supply-filters :is(input,select) { width: 100%; min-width: 0; } .supply-filters label.wide { flex-basis: 100%; } .supply-hero { padding: 24px; grid-template-columns: 1fr; } .display-controls { flex-wrap: wrap; } .dialog-body { padding: 16px; } }
/* Shared meaning and order: purchase blue on the left, supply teal on the right. */
.price-cost { color:#225bb1; }
.price-sale { color:#08796b; }
.price-cost input { background:#f5f9ff; border-color:#bed3f3; }
.price-sale input { background:#f2faf7; border-color:#b4ded3; }
.unit-correction-panel { background:#f5f8fc; padding:14px; border:1px solid #d8e2ee; border-radius:12px; }
.unit-correction-panel > div { display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; }
#editDialog .quantity-conversion { padding:14px 16px; gap:12px; }
#editDialog .quantity-conversion strong { font-size: var(--inventory-text-body); }
#editDialog .quantity-conversion small { font-size: var(--inventory-text-small); }
#editDialog .field small { font-size: var(--inventory-text-small); line-height:1.5; }
#editDialog .ledger-evidence { border-bottom:1px solid #e2e8f0; padding-bottom:12px; }
#editDialog .ledger-evidence summary { cursor:pointer; font-size: var(--inventory-text-small); color: var(--muted); }
#editDialog .ledger-evidence > .form-grid { padding-top:14px; }
/* A compact review surface; evidence and optional controls remain accessible. */
#editDialog { width:min(820px,calc(100% - 24px)); }
#editDialog header { padding:20px 24px; }
#editDialog header h2 { font-size: 1.375rem; }
#editDialog header > div { min-width:0; }
#editDialog header > button { flex-shrink:0; white-space:nowrap; }
#editDialog header p { font-size: var(--inventory-text-small); line-height:1.5; margin:6px 0 0; }
#editDialog .form-grid { gap:14px 18px; }
#editDialog .field { min-width:0; font-size: var(--inventory-text-small); gap:7px; }
#editDialog label.field { align-content:start; }
#editDialog :is(#evidenceDetails,#matchingDetails):not([open]) { grid-column:auto; padding-bottom:8px; }
#editDialog :is(input:not([type="hidden"]),select,textarea) { min-width:0; width:100%; box-sizing:border-box; font-size: var(--inventory-text-body); padding:10px 12px; border-radius:10px; }
#editDialog .quantity-conversion { padding:10px 14px; }
#editDialog .quantity-totals { padding:14px; background:#f7f9fc; border-radius:12px; }
#editDialog .quantity-totals strong { font-size: 1.125rem; }
#editDialog .reference-actions .button { padding:8px 12px; font-size: var(--inventory-text-small); }
#editDialog footer { padding:16px 24px; gap:12px; flex-wrap:wrap; }
#editDialog footer > span { font-size: var(--inventory-text-small); }
#editDialog #editMessage:empty,#matchResults:empty { display:none; }
@media(max-width:600px) {
  #editDialog header,#editDialog footer { padding:14px 16px; }
  #editDialog .form-grid { grid-template-columns:1fr; }
  #editDialog footer > div { display:flex; width:100%; gap:8px; }
  #editDialog footer .button { flex:1; min-width:0; white-space:normal; }
}

@media (max-width: 760px) {
  .supply-filters { gap: 12px; }
  .supply-filters > .button { flex: 1 1 140px; }
  .chart-row { grid-template-columns: minmax(0, 1fr) auto; }
  .chart-row .chart-track { grid-column: 1; grid-row: 2; }
  .chart-row strong { grid-column: 2; grid-row: 1 / span 2; }
  .quantity-conversion > div { flex-basis: 100%; }
  #editDialog .reference-actions .button { font-size: var(--inventory-text-control); }
}
