/* NUCLEAR OPTION: High-priority table overrides 
   This file ensures our table styles take precedence over Bootstrap
   in all environments by loading with maximum weight (999) */

/* Universal table selector - catches ALL tables regardless of classes */
table,
.table,
table.table,
div table,
.paragraph-text table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: 1px solid var(--white) !important;
  font-family: var(--font-family-body) !important;
  font-size: var(--font-size-sm) !important;
  font-weight: var(--font-weight-normal) !important;
  margin: var(--space-lg) 0 !important;
  width: 100% !important;
  border-radius: 10px !important;
}

/* Universal cell borders - light borders with grey row backgrounds */
table td,
table th,
.table td,
.table th,
table.table td,
table.table th,
div table td,
div table th,
.paragraph-text table td,
.paragraph-text table th {
  border: 1px solid var(--white) !important;
  padding: var(--space-md) var(--space-lg) !important;
  background-color: var(--greyLight) !important;
  box-shadow: none !important;
}

/* Alternating row colors for better readability */
table tbody tr:nth-child(even) td,
.table tbody tr:nth-child(even) td,
table.table tbody tr:nth-child(even) td,
div table tbody tr:nth-child(even) td,
.paragraph-text table tbody tr:nth-child(even) td {
  background-color: var(--greyLighter) !important;
}

/* Force table headers with maximum specificity */
table thead th,
table thead td,
.table thead th,
.table thead td,
table.table thead th,
table.table thead td,
div table thead th,
div table thead td,
.paragraph-text table thead th,
.paragraph-text table thead td {
  background-color: var(--greyHeader) !important;
  color: var(--white) !important;
  font-weight: var(--font-weight-bold) !important;
  border: 1px solid var(--white) !important;
}

/* Bootstrap neutralizers with maximum force */
table.table,
.table {
  --bs-table-color: var(--textColor) !important;
  --bs-table-bg: transparent !important;
  --bs-table-border-color: var(--white) !important;
  --bs-table-striped-color: var(--textColor) !important;
  --bs-table-striped-bg: transparent !important;
  --bs-table-hover-color: var(--textColor) !important;
  --bs-table-hover-bg: transparent !important;
  color: var(--textColor) !important;
  background-color: transparent !important;
  border-color: var(--white) !important;
}

/* Neutralise Bootstrap variants with maximum force */
.table-striped > tbody > tr:nth-of-type(odd) > * { 
  background-color: transparent !important; 
}
.table-hover > tbody tr:hover > * { 
  background-color: transparent !important; 
}
.table-borderless > :not(caption) > * > * { 
  border-bottom-width: 0 !important; 
}

/* Force borders on tables that might not have classes */
table[align] td,
table[align] th {
  border: 1px solid var(--white) !important;
}

table[align] {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: 1px solid var(--white) !important;
}