#weighbridge { gap: 0; grid-template-columns: minmax(0,1fr); background: #fff; border: 1px solid #dde3e9; border-radius: 6px; letter-spacing: 0; }
#weighbridge > * { min-width: 0; }
.app:has(#weighbridge.active) #exportRecon { display: none; }
#weighbridge [hidden] { display: none !important; }
#weighbridge h3 { margin: 0 0 14px; font-size: 16px; letter-spacing: 0; }
.wb-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #e1e6ec; }
.wb-toolbar label { min-width: 140px; }
.wb-toolbar input, .wb-toolbar select, #wbDialog input, #wbDialog select, #wbDialog textarea, #wbDialog button, #weighbridge button { border-radius: 6px; letter-spacing: 0; }
.wb-toolbar #wbSource { min-width: 170px; max-width: 260px; }
.wb-status { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 13px; color: #b45309; }
.wb-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.wb-status.online { color: #087f67; }
.wb-status.offline, .wb-status.source_error { color: #c33035; }
.wb-band { padding: 20px; border-bottom: 1px solid #e1e6ec; }
.wb-live { display: grid; grid-template-columns: 1fr 1fr; }
.wb-live > div { display: grid; align-content: start; gap: 8px; }
.wb-live > div + div { border-left: 1px solid #e1e6ec; padding-left: 24px; }
.wb-live strong { font-size: 30px; font-variant-numeric: tabular-nums; line-height: 1.2; letter-spacing: 0; }
.wb-live span:last-child { font-size: 12px; color: #687588; }
.wb-chart { height: 220px; width: 100%; position: relative; }
.wb-chart canvas { width: 100%; height: 100%; display: block; }
#wbChartEmpty { position: absolute; inset: 0; display: grid; place-items: center; color: #7b8797; font-size: 14px; }
.wb-tabs { align-items: center; }
.wb-tabs [role=tab] { background: transparent; color: #596579; border: 1px solid transparent; box-shadow: none; }
.wb-tabs [aria-selected=true] { color: #087f67; background: #e8f6f1; border-color: #bde3d7; }
#weighbridge .wb-tabs [role=tab]:hover:not(:disabled) { color: #086652; background: #dcf0e8; border-color: #bde3d7; }
.wb-tabs .wb-event-filter { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: auto; }
.wb-event-filter input { width: 16px; height: 16px; min-height: 16px; }
.wb-event-filter label:last-child { display: flex; align-items: center; gap: 8px; min-width: auto; }
.wb-tag.update { color: #346479; background: #edf5fa; }
.wb-table-wrap { width: 100%; overflow: auto; max-height: 620px; }
.wb-table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 13px; }
.wb-table th { position: sticky; top: 0; background: #f2f5f8; z-index: 1; }
.wb-table th, .wb-table td { padding: 12px 14px; border-bottom: 1px solid #e7ebef; text-align: left; white-space: nowrap; }
.wb-table td.wb-message { white-space: normal; min-width: 220px; max-width: 430px; line-height: 1.55; }
.wb-table td.wb-party-cell { white-space: normal; min-width: 190px; max-width: 300px; line-height: 1.5; }
.wb-table td.wb-raw-weight { white-space: normal; min-width: 100px; text-align: right; font-variant-numeric: tabular-nums; }
.wb-table th.num, .wb-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.wb-audit-table { min-width: 1200px; }
.wb-event-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 12px; margin-bottom: 12px; background: #f8fafc; border: 1px solid #e5eaf0; border-radius: 6px; font-size: 13px; color: #334155; }
.wb-alert-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: #334155; background: #f8fafc; border: 1px solid #e5eaf0; border-radius: 6px; padding: 8px 12px; }
.wb-company-bar { align-items: center; background: #f5f9f7; border-bottom: 1px solid #d5e6df; padding: 10px 18px; gap: 10px; }
.wb-company-label { font-size: 13px; font-weight: 600; color: #26413b; white-space: nowrap; }
.wb-company-pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#weighbridge .wb-company-pills button { background: #fff; color: #405165; border: 1px solid #cad5df; box-shadow: none; padding: 7px 14px; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
#weighbridge .wb-company-pills button[aria-selected=true] { background: #0d7a64; color: #fff; border-color: #0d7a64; font-weight: 600; }
#weighbridge .wb-company-pills button:hover:not([aria-selected=true]) { background: #eaf4f0; border-color: #9ecfc0; color: #0a614f; }
.wb-pill-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #c33035; color: #fff; font-size: 11px; font-weight: 700; }
#weighbridge .wb-company-pills button[aria-selected=true] .wb-pill-badge { background: #fff; color: #0d7a64; }
.wb-company-hint { margin-left: auto; font-size: 12px; }
.wb-company-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; background: #f8fafc; }
.wb-company-card { background: #fff; border: 1px solid #d7e2ec; border-top: 3px solid #0d7a64; border-radius: 6px; padding: 14px 16px; display: grid; gap: 10px; }
.wb-company-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wb-company-card-head strong { font-size: 15px; color: #172536; }
.wb-company-card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wb-company-card-stats div { display: grid; gap: 3px; }
.wb-company-card-stats span { font-size: 12px; color: #64748b; }
.wb-company-card-stats b { font-size: 18px; color: #0f172a; font-variant-numeric: tabular-nums; }
.wb-company-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; background: #eaf4f0; color: #0b6b57; font-weight: 600; }
.wb-company-badge.pending { background: #fff5e3; color: #9b620f; }
.wb-company-badge.system { background: #edf2f7; color: #475569; }
.wb-supplier-split { margin-top: 4px; font-size: 12px; color: #475569; line-height: 1.5; }
.wb-verify-company-tag { font-size: 13px; font-weight: 600; color: #0b6b57; background: #eaf4f0; padding: 6px 10px; border-radius: 5px; }
.wb-alert-group-title { margin: 8px 0 2px; font-size: 14px; color: #1e293b; border-left: 3px solid #0d7a64; padding-left: 8px; }
.wb-table td.wb-empty { text-align: center; padding: 42px 14px; color: #7b8797; }
.wb-tag { display: inline-block; padding: 3px 7px; border-radius: 4px; color: #9f3737; background: #fdf0f0; font-size: 12px; }
.wb-tag.reviewed { color: #087f67; background: #edf8f3; }
.wb-tag.followup { color: #9b620f; background: #fff5e3; }
.wb-error { padding: 12px 18px; color: #a52626; background: #fff0ef; margin: 0; font-size: 13px; overflow-wrap: anywhere; }
#wbCount { padding: 12px 18px; }
#wbDialog { width: min(1000px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 20px; border: 1px solid #d5dce5; border-radius: 8px; color: #192431; }
#wbDialog::backdrop { background: #11182780; }
.wb-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.wb-dialog-head h3 { margin: 0; font-size: 18px; }
#wbDialog form { display: grid; gap: 14px; margin-top: 16px; }
.wb-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#wbDialog .wb-error { margin-bottom: 12px; border-radius: 4px; }
.wb-token { font-family: Consolas, monospace; word-break: break-all; }
.wb-version { border-top: 1px solid #dfe5ec; margin-top: 18px; padding-top: 14px; }
.wb-version h4 { font-size: 14px; margin: 0 0 10px; }
.wb-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wb-detail-grid div { display: grid; gap: 4px; overflow-wrap: anywhere; font-size: 14px; }
.wb-detail-grid dt { color: #687588; font-size: 12px; }
.wb-detail-grid dd { margin: 0; }
.wb-review-list { padding: 12px 0; border-top: 1px solid #e1e6ec; font-size: 13px; }
.wb-mode { display: flex; gap: 0; border: 1px solid #cbd5df; border-radius: 6px; overflow: hidden; }
#weighbridge .wb-mode button { border: 0; border-radius: 0; box-shadow: none; background: #fff; color: #49576a; }
#weighbridge .wb-mode [aria-pressed=true] { background: #147e68; color: #fff; }
.wb-report-metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.wb-report-metrics div { display: grid; gap: 8px; }
.wb-report-metrics strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.wb-report-metrics span { font-size: 13px; color: #687588; }
.wb-board-notice { margin: 0; padding: 12px 20px; color: #78520b; background: #fff9e9; font-size: 13px; overflow-wrap: anywhere; }
.wb-board-notice:empty { display: none; }
.wb-report-scroll { overflow-x: auto; }
.wb-report-table { min-width: 650px; }
.wb-report-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.wb-excluded { display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 13px; color: #647184; }
.wb-excluded strong { margin-left: 6px; color: #a34428; }
#wbBoardSettings { margin-left: auto; }
#wbDialog fieldset { border: 0; border-top: 1px solid #e1e6ec; padding: 16px 0 0; margin: 8px 0; min-width: 0; }
#wbDialog legend { padding-right: 12px; font-weight: 600; }
.wb-rule-row { display: grid; grid-template-columns: minmax(110px,1fr) minmax(140px,1.5fr) 125px 110px 95px 40px; align-items: end; gap: 10px; padding: 10px 0; border-bottom: 1px solid #e1e6ec; }
.wb-rule-row > label { min-width: 0; }
.wb-comparison { min-width: 540px; }
.wb-comparison td { white-space: normal; overflow-wrap: anywhere; max-width: 300px; }
#wbDialog .wb-rule-row button { width: 40px; height: 40px; padding: 0; }
.wb-detail-pager { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 14px; }
.wb-mobile-only { display: none; }
.wb-diagnostic-lists { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin-top: 18px; font-size: 13px; }
.wb-diagnostic-lists summary { cursor: pointer; padding: 8px 0; }
.wb-diagnostic-lists ul { list-style: none; margin: 8px 0; padding: 0; }
.wb-diagnostic-lists li { display: flex; gap: 12px; justify-content: space-between; padding: 8px 0; border-top: 1px solid #e1e6ec; }
.wb-diagnostic-lists li span { overflow-wrap: anywhere; }
.wb-diagnostic-lists li strong { flex-shrink: 0; font-weight: 500; }
.wb-tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: #c33035; color: #fff; font-size: 12px; font-weight: 700; }
.wb-alerts-banner { margin: 12px 18px 0; padding: 10px 14px; border-radius: 6px; font-size: 13px; background: #edf8f3; color: #087f67; border: 1px solid #bde3d7; }
.wb-alerts-banner.error { background: #fff0ef; color: #a52626; border-color: #f3c2c0; }
.wb-verify-settings { background: #f8fafc; }
.wb-alert-list { display: grid; gap: 14px; }
.wb-alert-card { border: 1px solid #dde3e9; border-left: 4px solid #c33035; border-radius: 6px; padding: 14px 16px; background: #fff; display: grid; gap: 10px; }
.wb-alert-card.explained { border-left-color: #087f67; opacity: 0.92; }
.wb-alert-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.wb-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wb-compare-box { background: #f8fafc; border: 1px solid #e5eaf0; border-radius: 6px; padding: 10px 12px; font-size: 13px; display: grid; gap: 4px; }
.wb-compare-box h4 { margin: 0 0 4px; font-size: 13px; color: #49576a; }
.wb-review-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wb-review-form input { flex: 1; min-width: 220px; }
.wb-history-list { margin: 0; padding-left: 18px; font-size: 12px; color: #596579; display: grid; gap: 4px; }
@media(max-width: 700px) {
  .wb-compare-grid { grid-template-columns: 1fr; }
  .app:has(#weighbridge.active) > .side { height: 210px; position: static; overflow: auto; }
  .wb-toolbar { padding: 12px; gap: 10px; }
  .wb-toolbar label { flex: 1; min-width: 130px; }
  .wb-toolbar #wbSource { width: 100%; min-width: 0; max-width: none; }
  .wb-band { padding: 16px 12px; }
  .wb-live { grid-template-columns: 1fr; gap: 18px; }
  .wb-live > div + div { padding: 16px 0 0; border-left: 0; border-top: 1px solid #e1e6ec; }
  .wb-live strong { font-size: 27px; }
  .wb-tabs .wb-event-filter { margin-left: 0; flex: initial; }
  .wb-chart { height: 180px; }
  .wb-form-row, .wb-detail-grid { grid-template-columns: 1fr 1fr; }
  .wb-report-metrics { grid-template-columns: 1fr 1fr; }
  .wb-report-metrics > div:first-child { grid-column: 1 / -1; }
  .wb-report-metrics div + div { border-top: 1px solid #e1e6ec; padding-top: 12px; }
  .wb-rule-row { grid-template-columns: minmax(0,1fr) 90px 40px; }
  .wb-rule-row label:first-child { grid-column: 1 / -1; }
  .wb-rule-row label:nth-child(2) { grid-column: 1 / -1; }
  .wb-rule-row label:nth-child(3) { grid-column: 1 / -1; }
  .wb-comparison { min-width: 0; table-layout: fixed; font-size: 12px; }
  .wb-comparison th, .wb-comparison td { padding: 10px 6px; white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
  .wb-comparison th:first-child { width: 26%; }
  .wb-diagnostic-lists { grid-template-columns: 1fr; }
  #wbBoardUpdated { flex-basis: 100%; }
  #wbUnmatchedCustomers { min-width: 0; table-layout: fixed; }
  #wbUnmatchedCustomers th, #wbUnmatchedCustomers td { white-space: normal; overflow-wrap: anywhere; padding: 10px 5px; min-width: 0; }
  #wbUnmatchedCustomers th:first-child { width: 24%; }
  #wbUnmatchedCustomers th:nth-child(2) { width: 32%; }
  .wb-company-bar { padding: 10px 12px; }
  .wb-company-hint { margin-left: 0; flex-basis: 100%; }
  .wb-company-split { grid-template-columns: 1fr; }
  #wbSupplierReport, #wbMaterialReport { min-width: 0; table-layout: fixed; }
  #wbSupplierReport th, #wbSupplierReport td, #wbMaterialReport th, #wbMaterialReport td { padding: 12px 5px; white-space: normal; overflow-wrap: anywhere; }
  #wbSupplierReport th:nth-child(2), #wbSupplierReport td:nth-child(2), #wbSupplierReport th:nth-child(5), #wbSupplierReport td:nth-child(5), #wbMaterialReport th:first-child, #wbMaterialReport td:first-child { display: none; }
  #wbSupplierReport th:first-child, #wbMaterialReport th:nth-child(2) { width: 38%; }
  #wbSupplierReport th:nth-child(3), #wbMaterialReport th:nth-child(3) { width: 12%; }
  #wbSupplierReport th:nth-child(4), #wbMaterialReport th:nth-child(4) { width: 27%; }
  #wbSupplierReport button, #wbMaterialReport button { padding: 8px 5px; width: 100%; }
  #wbSupplierReport .wb-mobile-only, #wbMaterialReport .wb-mobile-only { display: block; color: #687588; font-size: 11px; line-height: 1.5; margin-top: 5px; }
}
