/*
 * Synertree overrides, loaded after the theme's style.bundle.css.
 * Keep theme changes here so a theme update doesn't overwrite them.
 */

/* Wider page containers on wide screens. Bootstrap stops at 1320px from
   1400px up; screens 1700px and wider get up to 1620px instead. */
@media (min-width: 1700px) {
  .container-xxl, .container-xl, .container-lg, .container-md, .container-sm, .container {
    max-width: 1620px;
  }
}

/* Solid background for sticky bars (page toolbar, chat input). Use in
   place of bg-white, which stays white in dark mode: this one follows
   the theme, matching the dark page background (#0f1014). */
.bg-surface {
  background-color: #ffffff !important;
}
[data-bs-theme="dark"] .bg-surface {
  background-color: #0f1014 !important;
}

/* Dark mode tables: grey rows and header, lighter borders.
   Bootstrap paints each cell with --bs-table-bg, so it's set on .table
   and on the light variants the theme leaves near-white with black text
   in dark mode (thead.table-light, tr.table-secondary). table-dark
   (total rows) keeps its own darker fill. Hover and striping still
   layer on top through Bootstrap's inset box-shadow. !important on
   borders beats Metronic's row styles (table-row-dashed, -bordered). */
[data-bs-theme="dark"] .table,
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-secondary {
  --bs-table-color: var(--bs-body-color);
  --bs-table-bg: #2d2d2d;
  --bs-table-border-color: #555555;
  --bs-table-striped-color: var(--bs-body-color);
  --bs-table-striped-bg: #353535;
  --bs-table-active-color: var(--bs-body-color);
  --bs-table-active-bg: #3a3a3a;
  --bs-table-hover-color: var(--bs-body-color);
  --bs-table-hover-bg: #3a3a3a;
}
/* Header and category rows a step lighter than the data rows. */
[data-bs-theme="dark"] .table > thead,
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-secondary {
  --bs-table-bg: #4d4d4d;
}
[data-bs-theme="dark"] table tr {
  background-color: #2d2d2d;
}
[data-bs-theme="dark"] table thead,
[data-bs-theme="dark"] table thead tr {
  background-color: #4d4d4d;
}
/* Frozen columns on the cash flow statements fill their cells with the
   page background so scrolling figures don't show through; match rows. */
[data-bs-theme="dark"] .frozen-table tbody tr:not([class*="table-"]) > .sticky-col-1,
[data-bs-theme="dark"] .frozen-table tbody tr:not([class*="table-"]) > .sticky-col-2,
[data-bs-theme="dark"] .frozen-table tbody tr:not([class*="table-"]) > .sticky-cols {
  background-color: #2d2d2d;
}
[data-bs-theme="dark"] table,
[data-bs-theme="dark"] table thead,
[data-bs-theme="dark"] table tbody,
[data-bs-theme="dark"] table tfoot,
[data-bs-theme="dark"] table tr,
[data-bs-theme="dark"] table th,
[data-bs-theme="dark"] table td {
  border-color: #555555 !important;
}

/* Dark mode links: teal instead of the theme's blue (#006AE6), a shade
   lighter on hover. Bootstrap builds link colours from these variables. */
[data-bs-theme="dark"] {
  --bs-link-color: #3fcfd4;
  --bs-link-color-rgb: 63, 207, 212;
  --bs-link-hover-color: #79dee1;
  --bs-link-hover-color-rgb: 121, 222, 225;
}
