/* ===================== THEME CSS VARIABLES ===================== */
:root {
  --brand-50:  #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-300: #93c5fd;
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-800: #1e40af;
  --brand-900: #1e3a8a;
  --sidebar-bg: #ffffff;
  --sidebar-bg-dark: #0f172a;
  /* Background color variables */
  --page-bg:       #f8fafc;
  --page-bg-dark:  #020617;
  --card-bg:       #ffffff;
  --card-bg-dark:  #0f172a;
  --panel-bg:      #ffffff;
  --panel-bg-dark: #0f172a;
}
/* BG variable overrides */
body { background-color: var(--page-bg) !important; }
.dark body { background-color: var(--page-bg-dark) !important; }
#mainScrollArea { background-color: var(--page-bg) !important; }
.dark #mainScrollArea { background-color: var(--page-bg-dark) !important; }
.bg-swatch-active {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
}
/* Midnight Indigo */
[data-theme="midnight-indigo"] {
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;
  --brand-900: #312e81;
  --sidebar-bg: #1e1b4b;
  --sidebar-bg-dark: #13104a;
}
/* Emerald Forest */
[data-theme="emerald-forest"] {
  --brand-50:  #ecfdf5;
  --brand-100: #d1fae5;
  --brand-200: #a7f3d0;
  --brand-300: #6ee7b7;
  --brand-400: #34d399;
  --brand-500: #10b981;
  --brand-600: #059669;
  --brand-700: #047857;
  --brand-800: #065f46;
  --brand-900: #064e3b;
  --sidebar-bg: #1a2433;
  --sidebar-bg-dark: #111c2a;
}
/* Crimson Dusk */
[data-theme="crimson-dusk"] {
  --brand-50:  #fff1f2;
  --brand-100: #ffe4e6;
  --brand-200: #fecdd3;
  --brand-300: #fda4af;
  --brand-400: #fb7185;
  --brand-500: #f43f5e;
  --brand-600: #e11d48;
  --brand-700: #be123c;
  --brand-800: #9f1239;
  --brand-900: #881337;
  --sidebar-bg: #ffffff;
  --sidebar-bg-dark: #1c1917;
}
/* Cyber Amber */
[data-theme="cyber-amber"] {
  --brand-50:  #fffbeb;
  --brand-100: #fef3c7;
  --brand-200: #fde68a;
  --brand-300: #fcd34d;
  --brand-400: #fbbf24;
  --brand-500: #f59e0b;
  --brand-600: #d97706;
  --brand-700: #b45309;
  --brand-800: #92400e;
  --brand-900: #78350f;
  --sidebar-bg: #0f172a;
  --sidebar-bg-dark: #060d1a;
}
/* Ocean Teal */
[data-theme="ocean-teal"] {
  --brand-50:  #f0fdfa;
  --brand-100: #ccfbf1;
  --brand-200: #99f6e4;
  --brand-300: #5eead4;
  --brand-400: #2dd4bf;
  --brand-500: #14b8a6;
  --brand-600: #0d9488;
  --brand-700: #0f766e;
  --brand-800: #115e59;
  --brand-900: #134e4a;
  --sidebar-bg: #134e4a;
  --sidebar-bg-dark: #0a2e2b;
}
/* Violet Luxe */
[data-theme="violet-luxe"] {
  --brand-50:  #f5f3ff;
  --brand-100: #ede9fe;
  --brand-200: #ddd6fe;
  --brand-300: #c4b5fd;
  --brand-400: #a78bfa;
  --brand-500: #8b5cf6;
  --brand-600: #7c3aed;
  --brand-700: #6d28d9;
  --brand-800: #5b21b6;
  --brand-900: #4c1d95;
  --sidebar-bg: #2e1065;
  --sidebar-bg-dark: #1e0a45;
}

/* Apply CSS vars to Tailwind brand classes */
.bg-brand-50  { background-color: var(--brand-50) !important; }
.bg-brand-100 { background-color: var(--brand-100) !important; }
.bg-brand-200 { background-color: var(--brand-200) !important; }
.bg-brand-500 { background-color: var(--brand-500) !important; }
.bg-brand-600 { background-color: var(--brand-600) !important; }
.bg-brand-700 { background-color: var(--brand-700) !important; }
.bg-brand-800 { background-color: var(--brand-800) !important; }
.bg-brand-900 { background-color: var(--brand-900) !important; }
.text-brand-300 { color: var(--brand-300) !important; }
.text-brand-400 { color: var(--brand-400) !important; }
.text-brand-500 { color: var(--brand-500) !important; }
.text-brand-600 { color: var(--brand-600) !important; }
.text-brand-700 { color: var(--brand-700) !important; }
.border-brand-600 { border-color: var(--brand-600) !important; }
.ring-brand-600 { --tw-ring-color: var(--brand-600) !important; }
.focus\:ring-brand-600:focus { --tw-ring-color: var(--brand-600) !important; }
.hover\:bg-brand-700:hover { background-color: var(--brand-700) !important; }
.dark .dark\:text-brand-300 { color: var(--brand-300) !important; }
.dark .dark\:text-brand-400 { color: var(--brand-400) !important; }
.dark .dark\:text-brand-500 { color: var(--brand-500) !important; }
.dark .dark\:bg-brand-950 { background-color: color-mix(in srgb, var(--brand-900) 60%, #000) !important; }

/* Theme panel animations */
#themeSwitcherPanel {
  transition: opacity 0.2s ease, transform 0.2s ease;
}
#themeSwitcherPanel.hidden {
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  display: block !important;
}
#themeSwitcherPanel.panel-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
.theme-swatch {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.theme-swatch:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.theme-swatch.active-swatch {
  outline: 2.5px solid white;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0,0,0,0.25);
}

/* Beat body { font-family: Inter !important } and hide icon-name FOUC on hard refresh */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal !important;
  font-style: normal !important;
  line-height: 1 !important;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  display: inline-block;
  width: 1em;
  height: 1em;
  overflow: hidden;
  flex-shrink: 0;
  speak: never;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'liga';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}
/* Until webfont is ready, don't flash "dashboard" / "menu_open" as readable text */
html:not(.ms-fonts-ready) .material-symbols-outlined {
  color: transparent !important;
}
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.6);
}
.sparkline-canvas {
  width: 100% !important;
  height: 38px !important;
}


/* ===================== PORTAL BRIDGE STYLES ===================== */
html, body { height: 100%; }
body {
  margin: 0 !important;
  padding: 0 !important;
  font-family: Inter, system-ui, sans-serif !important;
  color: #1e293b;
  background-color: var(--page-bg) !important;
}
body.pubad-app-shell { overflow: hidden !important; }
html.dark body,
.dark body { color: #e2e8f0; background-color: var(--page-bg-dark) !important; }

#mainSidebar { background-color: var(--sidebar-bg); }
.dark #mainSidebar { background-color: var(--sidebar-bg-dark); }

.nav-btn.active-nav {
  color: var(--brand-700) !important;
  background-color: var(--brand-50) !important;
  border-left: 2px solid var(--brand-600);
}
.dark .nav-btn.active-nav {
  color: var(--brand-400) !important;
  background-color: color-mix(in srgb, var(--brand-900) 45%, transparent) !important;
}

/* Compact sidebar — keep expand button visible.
   html[data-sidebar="compact"] is set in the head, before the sidebar paints,
   so a reload does not open the menu and then snap it shut. */
#mainSidebar.sidebar-compact,
#mainSidebar.w-16,
html[data-sidebar="compact"] #mainSidebar {
  width: 4.5rem !important;
}
html[data-sidebar="compact"] #mainSidebar .sidebar-label,
html[data-sidebar="compact"] #mainSidebar .sidebar-category,
html[data-sidebar="compact"] #brandText {
  display: none !important;
}
.sidebar-wordmark {
  display: block;
  height: 1.7rem;
  width: auto;
  max-width: 9.75rem;
}
.sidebar-mark {
  display: none;
  height: 1.85rem;
  width: auto;
}
#mainSidebar.sidebar-compact .sidebar-wordmark,
html[data-sidebar="compact"] #mainSidebar .sidebar-wordmark {
  display: none !important;
}
#mainSidebar.sidebar-compact .sidebar-mark,
html[data-sidebar="compact"] #mainSidebar .sidebar-mark {
  display: block !important;
}
#mainSidebar.sidebar-compact .sidebar-wordmark-link,
html[data-sidebar="compact"] #mainSidebar .sidebar-wordmark-link {
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.dark .sidebar-wordmark {
  filter: brightness(0) invert(1);
}
#mainSidebar.sidebar-compact .sidebar-brand-row,
html[data-sidebar="compact"] #mainSidebar .sidebar-brand-row {
  height: auto !important;
  min-height: 4rem;
  padding: 0.65rem 0.4rem !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
}
#mainSidebar.sidebar-compact .sidebar-collapse-btn,
html[data-sidebar="compact"] #mainSidebar .sidebar-collapse-btn {
  display: inline-flex !important;
  width: 2rem;
  height: 2rem;
  margin: 0 auto;
}
#mainSidebar.sidebar-compact .sidebar-nav,
html[data-sidebar="compact"] #mainSidebar .sidebar-nav {
  padding-left: 0.45rem !important;
  padding-right: 0.45rem !important;
}
#mainSidebar.sidebar-compact .nav-btn,
html[data-sidebar="compact"] #mainSidebar .nav-btn {
  justify-content: center !important;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
  border-left-width: 0 !important;
}
#mainSidebar.sidebar-compact .nav-btn.active-nav,
html[data-sidebar="compact"] #mainSidebar .nav-btn.active-nav {
  border-left: 0 !important;
  box-shadow: inset 0 0 0 1.5px var(--brand-600);
}
#mainSidebar.sidebar-compact .sidebar-footer,
html[data-sidebar="compact"] #mainSidebar .sidebar-footer {
  padding: 0.5rem 0.4rem !important;
}
#mainSidebar.sidebar-compact .sidebar-footer a,
html[data-sidebar="compact"] #mainSidebar .sidebar-footer a {
  justify-content: center !important;
  padding: 0.35rem !important;
}

.pubad-card {
  background: var(--card-bg);
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.dark .pubad-card {
  background: var(--card-bg-dark);
  border-color: #1e293b;
}

.pubad-toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  background: #0f172a;
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  pointer-events: none;
}
.pubad-toast.show { opacity: 1; transform: translateY(0); }

#sidebarOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 35;
}
#sidebarOverlay.show { display: block; }

@media (max-width: 1023px) {
  #mainSidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 40;
  }
  #mainSidebar.mobile-open { transform: translateX(0); }
}

/* Bootstrap / DataTables polish to match demo */
.card, .pubad-card .card {
  background: var(--card-bg) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}
.dark .card {
  background: var(--card-bg-dark) !important;
  border-color: #1e293b !important;
  color: #e2e8f0;
}
.card-header, .card-title, .card-body { border-color: #e2e8f0 !important; }
.dark .card-header, .dark .card-title { color: #f8fafc; border-color: #1e293b !important; }

.btn {
  font-family: Inter, system-ui, sans-serif !important;
  font-weight: 600 !important;
  border-radius: 0.5rem !important;
  font-size: 0.75rem !important;
  line-height: 1.25rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem;
  box-shadow: none !important;
}
.btn-sm {
  padding: 0.35rem 0.7rem !important;
  font-size: 0.75rem !important;
  border-radius: 0.5rem !important;
}
.btn-primary,
.btn-check:checked + .btn-primary {
  background-color: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
  color: #fff !important;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--brand-700) !important;
  border-color: var(--brand-700) !important;
  color: #fff !important;
}
.btn-outline-secondary {
  border-color: #e2e8f0 !important;
  color: #475569 !important;
  background: #fff !important;
}
.btn-outline-secondary:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
.dark .btn-outline-secondary {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

.input-group {
  display: flex !important;
  align-items: stretch !important;
  flex-wrap: nowrap !important;
}
.input-group > .form-control {
  border-radius: 0 !important;
}
.input-group > :first-child {
  border-top-left-radius: 0.5rem !important;
  border-bottom-left-radius: 0.5rem !important;
}
.input-group > :last-child {
  border-top-right-radius: 0.5rem !important;
  border-bottom-right-radius: 0.5rem !important;
}
.input-group-text {
  background: #fff !important;
  border-color: #e2e8f0 !important;
  color: #64748b !important;
  font-size: 0.8125rem !important;
  display: inline-flex !important;
  align-items: center !important;
}
.dark .input-group-text {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}
.input-group .btn {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

.form-control, .form-select, .dt-search input, .dataTables_filter input,
.dt-length select, .dataTables_length select {
  border-radius: 0.5rem !important;
  border-color: #e2e8f0 !important;
  font-size: 0.8125rem !important;
  background-color: #f8fafc !important;
  min-height: 2.25rem;
}
.dark .form-control, .dark .form-select,
.dark .dt-search input, .dark .dataTables_filter input,
.dark .dt-length select, .dark .dataTables_length select {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

table.dataTable, .table {
  font-size: 0.75rem !important;
  color: #475569 !important;
}
.dark table.dataTable, .dark .table { color: #cbd5e1 !important; }
table.dataTable thead th, .table thead th,
.table-dark {
  background: #f8fafc !important;
  color: #334155 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px !important;
  font-weight: 700 !important;
  border-color: #e2e8f0 !important;
}
.dark table.dataTable thead th, .dark .table thead th, .dark .table-dark {
  background: rgba(30, 41, 59, 0.7) !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}
table.dataTable tbody tr:hover, .table-hover tbody tr:hover {
  background-color: #f8fafc !important;
}
.dark table.dataTable tbody tr:hover, .dark .table-hover tbody tr:hover {
  background-color: rgba(30, 41, 59, 0.4) !important;
}

.drill-report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.85rem;
}
.drill-report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}
.drill-report-daterange {
  max-width: 22rem;
  flex: 1 1 16rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  border-radius: 0.5rem;
  overflow: hidden;
}
.drill-report-daterange .form-control {
  border-left: 0 !important;
  border-right: 0 !important;
  background: #fff !important;
}
.dark .drill-report-daterange .form-control {
  background: #0f172a !important;
}
.drill-report-daterange .btn-primary {
  min-width: 2.5rem;
  padding-left: 0.8rem !important;
  padding-right: 0.8rem !important;
}
.drill-report-tabs {
  display: inline-flex !important;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  background: #f1f5f9 !important;
  border-radius: 0.55rem !important;
  border: 1px solid #e2e8f0;
}
.dark .drill-report-tabs {
  background: #1e293b !important;
  border-color: #334155;
}
.drill-report-tabs .drill-report-tab {
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #64748b !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  border-radius: 0.4rem !important;
  padding: 0.4rem 0.9rem !important;
  box-shadow: none !important;
  min-height: 2rem;
}
.drill-report-tabs .drill-report-tab:hover {
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.75) !important;
}
.dark .drill-report-tabs .drill-report-tab:hover {
  color: #f8fafc !important;
  background: rgba(15, 23, 42, 0.55) !important;
}
.drill-report-tabs .drill-report-tab.active,
.drill-report-tabs .btn-check:checked + .drill-report-tab {
  background-color: var(--brand-600) !important;
  color: #fff !important;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25) !important;
}
#drill_export_btn {
  min-height: 2.25rem;
  padding: 0.45rem 0.95rem !important;
  border-radius: 0.5rem !important;
}
.drill-dimension-link { color: var(--brand-600) !important; }
.drill-dimension-link:hover { color: var(--brand-700) !important; }

/* Header controls polish */
#globalSearchInput {
  border-radius: 0.5rem !important;
  min-height: 2rem;
}
#chart_date_range {
  border-radius: 0.5rem !important;
  min-height: 2.4rem !important;
  padding-left: 2.25rem !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  font-size: 0.75rem !important;
  font-weight: 600;
}
.dark #chart_date_range {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
#copyPostbackUrl {
  min-height: 2rem;
  border-radius: 0.5rem !important;
  padding: 0.4rem 0.75rem !important;
}

.daterangepicker { font-family: Inter, sans-serif; z-index: 1050 !important; }
.select2-container--default .select2-selection--single {
  border-radius: 0.5rem !important;
  border-color: #e2e8f0 !important;
  height: 38px !important;
  display: flex !important;
  align-items: center;
}

.alert { border-radius: 0.75rem; font-size: 0.875rem; }

.page-search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 15rem;
  max-height: 18rem;
  overflow: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  z-index: 80;
  padding: 0.25rem;
}
.dark .page-search-results {
  background: #0f172a;
  border-color: #334155;
}
.page-search-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 0.5rem;
  padding: 0.5rem 0.65rem;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}
.page-search-item.is-active,
.page-search-item:hover {
  background: var(--brand-50);
  color: var(--brand-700);
}
.dark .page-search-item { color: #e2e8f0; }
.dark .page-search-item.is-active,
.dark .page-search-item:hover {
  background: rgba(37, 99, 235, 0.18);
  color: #fff;
}
.page-search-empty {
  padding: 0.65rem;
  font-size: 12px;
  color: #94a3b8;
}

/* Sort control sits beside the column name. SVG, so it does not depend on an icon font. */
table.dataTable thead > tr > th.dt-orderable-asc,
table.dataTable thead > tr > th.dt-orderable-desc,
table.dataTable thead > tr > td.dt-orderable-asc,
table.dataTable thead > tr > td.dt-orderable-desc {
  white-space: nowrap;
}
table.dataTable thead .dt-column-header {
  display: inline-flex !important;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
}
table.dataTable thead > tr > th span.dt-column-order,
table.dataTable thead > tr > td span.dt-column-order {
  position: static !important;
  display: inline-block !important;
  flex: 0 0 18px;
  width: 18px !important;
  height: 18px !important;
  margin-left: 0.2rem;
  vertical-align: middle;
  border-radius: 5px;
  background-color: #e2e8f0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23475569' d='M8 1.4 11.4 5.4H4.6z'/%3E%3Cpath fill='%23475569' d='M8 14.6 4.6 10.6h6.8z'/%3E%3C/svg%3E") !important;
}
table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order,
table.dataTable thead > tr > td.dt-ordering-asc span.dt-column-order {
  background-color: #dbeafe;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%232563eb' d='M8 2.2 12.2 8H3.8z'/%3E%3C/svg%3E") !important;
}
table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order,
table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order {
  background-color: #dbeafe;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%232563eb' d='M8 13.8 3.8 8h8.4z'/%3E%3C/svg%3E") !important;
}
table.dataTable thead span.dt-column-order:before,
table.dataTable thead span.dt-column-order:after {
  content: none !important;
  display: none !important;
}
.dark table.dataTable thead span.dt-column-order {
  background-color: #334155;
}
.dark table.dataTable thead th.dt-ordering-asc span.dt-column-order,
.dark table.dataTable thead th.dt-ordering-desc span.dt-column-order,
.dark table.dataTable thead td.dt-ordering-asc span.dt-column-order,
.dark table.dataTable thead td.dt-ordering-desc span.dt-column-order {
  background-color: rgba(37, 99, 235, 0.28);
}

/* Pre commission rate opens in a modal */
.rate-hover-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 1.75rem;
  margin: 0.25rem 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.rate-hover-preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 800;
  color: #0f172a;
}
.dark .rate-hover-preview { color: #fff; }
.rate-hover-icon {
  flex-shrink: 0;
  font-size: 16px;
  color: #059669;
}
.rate-modal[hidden] { display: none !important; }
.rate-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.rate-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}
.rate-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(34rem, calc(100vw - 2rem));
  max-height: min(80vh, 40rem);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}
.dark .rate-modal-dialog {
  background: #0f172a;
  border-color: #334155;
}
.rate-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}
.dark .rate-modal-head { border-bottom-color: #334155; }
.rate-modal-kicker {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #059669;
}
.rate-modal-head h2 {
  margin: 0.15rem 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}
.dark .rate-modal-head h2 { color: #fff; }
.rate-modal-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.5rem;
  background: #f1f5f9;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.rate-modal-close:hover { background: #e2e8f0; }
.dark .rate-modal-close { background: #1e293b; color: #cbd5e1; }
.rate-modal-body {
  overflow: auto;
  padding: 0.85rem 1rem;
}
.rate-modal-box {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
  padding: 0.85rem 1rem;
}
.dark .rate-modal-box {
  background: #1e293b;
  border-color: #334155;
}
.rate-modal-box p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
  color: #0f172a;
}
.rate-modal-box p + p { margin-top: 0.45rem; }
.dark .rate-modal-box p { color: #e2e8f0; }
.rate-modal-foot {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid #e2e8f0;
}
.dark .rate-modal-foot { border-top-color: #334155; }
.rate-modal-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.25rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 0.6rem;
  background: var(--brand-600);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.rate-modal-copy:hover { filter: brightness(0.95); }
.rate-modal-copy .material-symbols-outlined { font-size: 16px; }
