/* Unlayered table safety patch — must load after legacy style.css and layered table CSS */

.dashboard-layout .dashboard-source-panel .table-wrap > table,
.dashboard-layout #hydraDashProfitPanels .table-wrap > table,
.dashboard-layout #hydraDashTopProducts .table-wrap > table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.dashboard-layout .dashboard-source-panel .table-wrap th,
.dashboard-layout .dashboard-source-panel .table-wrap td,
.dashboard-layout #hydraDashProfitPanels .table-wrap th,
.dashboard-layout #hydraDashProfitPanels .table-wrap td,
.dashboard-layout #hydraDashTopProducts .table-wrap th,
.dashboard-layout #hydraDashTopProducts .table-wrap td {
  box-sizing: border-box !important;
  vertical-align: middle !important;
  line-height: 1.4 !important;
  padding: 12px 14px !important;
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: "tnum" !important;
}

body.use-new-ui.route-dashboard .dashboard-layout .dashboard-source-panel .table-wrap th,
body.use-new-ui.route-dashboard .dashboard-layout #hydraDashProfitPanels .table-wrap th,
body.use-new-ui.route-dashboard .dashboard-layout #hydraDashTopProducts .table-wrap th {
  height: 44px !important;
  font-size: var(--type-admin-label, 14px) !important;
  font-weight: 650 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: #475569 !important;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
  white-space: nowrap !important;
}

body.use-new-ui.route-dashboard .dashboard-layout .dashboard-source-panel .table-wrap td,
body.use-new-ui.route-dashboard .dashboard-layout #hydraDashProfitPanels .table-wrap td,
body.use-new-ui.route-dashboard .dashboard-layout #hydraDashTopProducts .table-wrap td {
  height: 50px !important;
  font-size: var(--type-admin-base, 16px) !important;
  font-weight: 520 !important;
  color: #0f172a !important;
}

.dashboard-layout .dashboard-source-panel .table-wrap th,
.dashboard-layout #hydraDashProfitPanels .table-wrap th,
.dashboard-layout #hydraDashTopProducts .table-wrap th {
  height: 44px !important;
  font-size: 16px !important;
  font-weight: 650 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: #475569 !important;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
  white-space: nowrap !important;
}

.dashboard-layout .dashboard-source-panel .table-wrap td,
.dashboard-layout #hydraDashProfitPanels .table-wrap td,
.dashboard-layout #hydraDashTopProducts .table-wrap td {
  height: 50px !important;
  font-size: 18px !important;
  font-weight: 520 !important;
  color: #0f172a !important;
}

/* 6-column financial/source tables */
.dashboard-layout .dashboard-source-panel .table-wrap th:nth-child(1),
.dashboard-layout .dashboard-source-panel .table-wrap td:nth-child(1),
.dashboard-layout #hydraDashProfitPanels .table-wrap th:nth-child(1),
.dashboard-layout #hydraDashProfitPanels .table-wrap td:nth-child(1) {
  width: 22% !important;
  text-align: left !important;
}

.dashboard-layout .dashboard-source-panel .table-wrap th:nth-child(2),
.dashboard-layout .dashboard-source-panel .table-wrap td:nth-child(2),
.dashboard-layout #hydraDashProfitPanels .table-wrap th:nth-child(2),
.dashboard-layout #hydraDashProfitPanels .table-wrap td:nth-child(2) {
  width: 14% !important;
  text-align: right !important;
}

.dashboard-layout .dashboard-source-panel .table-wrap th:nth-child(3),
.dashboard-layout .dashboard-source-panel .table-wrap td:nth-child(3),
.dashboard-layout .dashboard-source-panel .table-wrap th:nth-child(4),
.dashboard-layout .dashboard-source-panel .table-wrap td:nth-child(4),
.dashboard-layout .dashboard-source-panel .table-wrap th:nth-child(5),
.dashboard-layout .dashboard-source-panel .table-wrap td:nth-child(5),
.dashboard-layout .dashboard-source-panel .table-wrap th:nth-child(6),
.dashboard-layout .dashboard-source-panel .table-wrap td:nth-child(6),
.dashboard-layout #hydraDashProfitPanels .table-wrap th:nth-child(3),
.dashboard-layout #hydraDashProfitPanels .table-wrap td:nth-child(3),
.dashboard-layout #hydraDashProfitPanels .table-wrap th:nth-child(4),
.dashboard-layout #hydraDashProfitPanels .table-wrap td:nth-child(4),
.dashboard-layout #hydraDashProfitPanels .table-wrap th:nth-child(5),
.dashboard-layout #hydraDashProfitPanels .table-wrap td:nth-child(5),
.dashboard-layout #hydraDashProfitPanels .table-wrap th:nth-child(6),
.dashboard-layout #hydraDashProfitPanels .table-wrap td:nth-child(6) {
  width: 16% !important;
  text-align: right !important;
}

.dashboard-layout .dashboard-src-oc-cell {
  white-space: normal !important;
  text-align: right !important;
}

.dashboard-layout .dash-src-uni-inline {
  font-size: var(--type-kpi-meta, 16px) !important;
  font-weight: 500 !important;
}

/* Top products 3-column tables */
.dashboard-layout #hydraDashTopProducts .table-wrap th:nth-child(1),
.dashboard-layout #hydraDashTopProducts .table-wrap td:nth-child(1) {
  width: 56% !important;
  text-align: left !important;
}

.dashboard-layout #hydraDashTopProducts .table-wrap th:nth-child(2),
.dashboard-layout #hydraDashTopProducts .table-wrap td:nth-child(2) {
  width: 28% !important;
  text-align: right !important;
}

.dashboard-layout #hydraDashTopProducts .table-wrap th:nth-child(3),
.dashboard-layout #hydraDashTopProducts .table-wrap td:nth-child(3) {
  width: 16% !important;
  text-align: right !important;
}

/* Money/margin stronger consistency */
.dashboard-layout .dashboard-source-panel .money-col,
.dashboard-layout #hydraDashProfitPanels .money-col,
.dashboard-layout #hydraDashTopProducts .money-col {
  text-align: right !important;
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: "tnum" !important;
}

.dashboard-layout .dashboard-source-panel td:last-child span,
.dashboard-layout #hydraDashProfitPanels td:last-child span {
  display: inline-block !important;
  min-width: 48px !important;
  text-align: right !important;
  font-weight: 520 !important;
}
