/*
 * Badgers Claw Global Theme Contract Enforcer v1.0.0
 * Purpose: make every panel page/module consume one shared theme contract.
 *
 * Client/custom theme rule:
 *   A custom theme should override the variables on body only:
 *   --nxt-panel-bg, --nxt-panel-card, --nxt-panel-card-2,
 *   --nxt-panel-side, --nxt-panel-text, --nxt-panel-muted,
 *   --nxt-panel-accent, --nxt-panel-accent-2, --nxt-panel-border,
 *   --nxt-panel-border-soft, --nxt-panel-border-strong, --nxt-panel-ring.
 *
 * This file should stay loaded last. It uses variables, not fixed colors,
 * so uploaded themes can change the entire panel without chasing modules.
 */

body.nxt-theme-default{
  --nxt-panel-bg:#07111f;--nxt-panel-card:rgba(12,28,48,.94);--nxt-panel-card-2:rgba(17,38,64,.94);--nxt-panel-side:#07111f;--nxt-panel-text:#eaf4ff;--nxt-panel-muted:#9fb8d8;--nxt-panel-accent:#36a3ff;--nxt-panel-accent-2:#19d3ff;--nxt-panel-border:rgba(54,163,255,.24);--nxt-panel-border-soft:rgba(54,163,255,.10);--nxt-panel-border-strong:rgba(54,163,255,.46);--nxt-panel-ring:rgba(54,163,255,.16);
}
body.nxt-theme-hud_blue{
  --nxt-panel-bg:#07111f;--nxt-panel-card:rgba(9,29,52,.94);--nxt-panel-card-2:rgba(14,45,78,.94);--nxt-panel-side:#06172a;--nxt-panel-text:#eaf4ff;--nxt-panel-muted:#9fc2e8;--nxt-panel-accent:#22b8ff;--nxt-panel-accent-2:#38d9ff;--nxt-panel-border:rgba(34,184,255,.24);--nxt-panel-border-soft:rgba(34,184,255,.10);--nxt-panel-border-strong:rgba(34,184,255,.48);--nxt-panel-ring:rgba(34,184,255,.16);
}
body.nxt-theme-neon_green{
  --nxt-panel-bg:#04110d;--nxt-panel-card:rgba(6,34,25,.94);--nxt-panel-card-2:rgba(9,52,37,.94);--nxt-panel-side:#03100b;--nxt-panel-text:#eafff8;--nxt-panel-muted:#a8ead2;--nxt-panel-accent:#37ffb1;--nxt-panel-accent-2:#17d86b;--nxt-panel-border:rgba(55,255,177,.24);--nxt-panel-border-soft:rgba(55,255,177,.10);--nxt-panel-border-strong:rgba(55,255,177,.48);--nxt-panel-ring:rgba(55,255,177,.16);
}
body.nxt-theme-stealth_ops{
  --nxt-panel-bg:#05070d;--nxt-panel-card:rgba(12,15,25,.95);--nxt-panel-card-2:rgba(22,26,38,.95);--nxt-panel-side:#05070d;--nxt-panel-text:#eef2ff;--nxt-panel-muted:#aeb8ce;--nxt-panel-accent:#9aa6bd;--nxt-panel-accent-2:#5b6470;--nxt-panel-border:rgba(154,166,189,.22);--nxt-panel-border-soft:rgba(154,166,189,.09);--nxt-panel-border-strong:rgba(154,166,189,.40);--nxt-panel-ring:rgba(154,166,189,.12);
}
body.nxt-theme-midnight_purple{
  --nxt-panel-bg:#09071a;--nxt-panel-card:rgba(24,17,48,.94);--nxt-panel-card-2:rgba(38,28,72,.94);--nxt-panel-side:#0b0820;--nxt-panel-text:#f5f0ff;--nxt-panel-muted:#c4b5fd;--nxt-panel-accent:#a78bfa;--nxt-panel-accent-2:#7c3aed;--nxt-panel-border:rgba(167,139,250,.24);--nxt-panel-border-soft:rgba(167,139,250,.10);--nxt-panel-border-strong:rgba(167,139,250,.48);--nxt-panel-ring:rgba(167,139,250,.16);
}
body.nxt-theme-dev_silver{
  --nxt-panel-bg:#10141b;--nxt-panel-card:rgba(34,39,48,.94);--nxt-panel-card-2:rgba(45,51,62,.94);--nxt-panel-side:#0b0f15;--nxt-panel-text:#f6f8fb;--nxt-panel-muted:#c5ccd8;--nxt-panel-accent:#d7dde8;--nxt-panel-accent-2:#aeb7c6;--nxt-panel-border:rgba(215,221,232,.24);--nxt-panel-border-soft:rgba(215,221,232,.10);--nxt-panel-border-strong:rgba(215,221,232,.42);--nxt-panel-ring:rgba(215,221,232,.13);
}

/* compatibility aliases consumed by old modules and future uploaded themes */
body[class*="nxt-theme-"]:not(.nxt-theme-disabled),
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) *{
  --nxt-theme-bg:var(--nxt-panel-bg) !important;
  --nxt-theme-card:var(--nxt-panel-card) !important;
  --nxt-theme-card-2:var(--nxt-panel-card-2) !important;
  --nxt-theme-text:var(--nxt-panel-text) !important;
  --nxt-theme-muted:var(--nxt-panel-muted) !important;
  --nxt-theme-accent:var(--nxt-panel-accent) !important;
  --nxt-theme-border:var(--nxt-panel-border) !important;
  --nxt-theme-border-soft:var(--nxt-panel-border-soft) !important;
  --nxt-theme-border-strong:var(--nxt-panel-border-strong) !important;
  --nxt-theme-ring:var(--nxt-panel-ring) !important;
  --nxt-accent:var(--nxt-panel-accent) !important;
  --hud-accent:var(--nxt-panel-accent) !important;
  --theme-accent:var(--nxt-panel-accent) !important;
  --accent:var(--nxt-panel-accent) !important;
  --cw-accent:var(--nxt-panel-accent) !important;
  --cw-border:var(--nxt-panel-border) !important;
  --nx-accent:var(--nxt-panel-accent) !important;
  --nx-border:var(--nxt-panel-border) !important;
  --chd-accent:var(--nxt-panel-accent) !important;
  --bdr:var(--nxt-panel-border) !important;
  --bdr2:var(--nxt-panel-border-strong) !important;
  --nxt-panel-line:var(--nxt-panel-border) !important;
  --bs-primary:var(--nxt-panel-accent) !important;
  --tblr-primary:var(--nxt-panel-accent) !important;
}

body[class*="nxt-theme-"]:not(.nxt-theme-disabled),
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) .page,
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) .page-wrapper,
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) .main-content,
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) .page-content,
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) .container-fluid,
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) .content-page{
  background:
    radial-gradient(circle at top left, color-mix(in srgb,var(--nxt-panel-accent) 16%,transparent), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb,var(--nxt-panel-bg) 94%,#000 6%), color-mix(in srgb,var(--nxt-panel-bg) 84%,#000 16%)) !important;
  color:var(--nxt-panel-text) !important;
}

/* shell/sidebar/topbar */
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(.vertical-menu,.panel-sidebar,.navbar-vertical,aside.navbar,#sidebar-menu-wrap,.app-menu,.left-side-menu,.side-nav){
  background:linear-gradient(180deg,color-mix(in srgb,var(--nxt-panel-side) 96%,#000 4%),color-mix(in srgb,var(--nxt-panel-side) 82%,#000 18%)) !important;
  border-color:var(--nxt-panel-border) !important;
  color:var(--nxt-panel-text) !important;
}
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(.topbar,.navbar-custom,.header-navbar,.hud-control-layer,.nxt-hud-bar,.page-header,.topnav,.navbar){
  background:linear-gradient(180deg,color-mix(in srgb,var(--nxt-panel-card-2) 92%,transparent),color-mix(in srgb,var(--nxt-panel-bg) 92%,#000 8%)) !important;
  border-color:var(--nxt-panel-border) !important;
  color:var(--nxt-panel-text) !important;
}

/* real cards, sections, standalone module islands */
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(
.card,.card-body,.card-header,.dashboard-card,.dashboard-ref-panel,.stat-card,.widget-card,.metric-card,.badgersclaw-card,
.nxt-module-shell,.nxt-module-grid,.nxt-menu-card,.nxt-section-card,.nxt-box,.nxt-box-body,.nxt-box-head,.module-card,.module-panel,.module-box,
.chd-card,.chd-frame,.chd-stat,.chd-note,.chd-endpoint,.chd-table-clean,.chd-portal-table,
.pia-card,.vpn-card,.webview-card,.frame-card,.output-card,.preview-card,.source-image,.output-sizes,
.custom-webviews-menu-card,.custom-webviews-section-card,.custom-webviews-box,.custom-webviews-preview,.custom-webviews-preview-viewport,.custom-webviews-preview-box,.custom-webviews-upload-card,.custom-webviews-endpoint,
.nxt-api-helper-shell,.nxt-api-hero,.nxt-api-cats,.nxt-api-list,.nxt-api-row,.nxt-api-endpoint-drawer,.nxt-api-endpoint-item,.nxt-api-countbox,
#badgerbuilder-native .hero,#badgerbuilder-native .card,#badgerbuilder-native .nxt-card,#badgerbuilder-native .alert,#badgerbuilder-native .builder-preview-wrap,#badgerbuilder-native .builder-preview-head,#badgerbuilder-native pre,
.icon-maker-shell,.icon-maker-card,.icon-maker-panel,.nxt-icon-card,.nxt-builder-card,.nxt-tool-card,
.tmdb-app,.tmdb-shell,.tmdb-card,.tmdb-panel,.tmdb-section,.tmdb-toolbar,.tmdb-sidebar,.tmdb-main,
.bc-ls-page .bc-card,.bc-ls-page .bc-metrics div,.bc-ls-page .bc-field,.bc-ls-page .bc-map-legend,.bc-ls-page .bc-api-hit,.bc-ls-page .bc-row,
.api-detail-card,.api-detail-card .endpoint-row,.api-detail-card .api-root-code,
.security-status-line,.security-kill-row,.security-qr-box,
.panel,.section,.glass,.box,.table-responsive,.modal-content,.dropdown-menu,
.nxt-theme-row-btn,.nxt-shortcut-row,.shortcut-row,.theme-row,.login-theme-row,.panel-theme-row
){
  background:
    radial-gradient(circle at top left, color-mix(in srgb,var(--nxt-panel-accent) 8%,transparent), transparent 34%),
    linear-gradient(180deg,color-mix(in srgb,var(--nxt-panel-card) 96%,transparent),color-mix(in srgb,var(--nxt-panel-bg) 90%,#000 10%)) !important;
  border-color:var(--nxt-panel-border) !important;
  outline-color:var(--nxt-panel-border-soft) !important;
  color:var(--nxt-panel-text) !important;
  box-shadow:0 14px 32px rgba(0,0,0,.24),0 0 14px var(--nxt-panel-ring) !important;
}

/* buttons, pills, nav items */
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(
.btn,.button,button,.nxt-btn,.chd-btn-green,.chd-btn-outline-green,.api-copy-btn,.custom-webviews-btn,.custom-webviews-mini-btn,.custom-webviews-size-btn,
.nxt-module-menu a,.nxt-module-menu button,.chd-nav,.nav-link,.nxt-menu-card a,.custom-webviews-menu a,#sidebar-menu-wrap a,.panel-sidebar .nav-link,.navbar-vertical .nav-link,aside.navbar .nav-link,
#badgerbuilder-native button,#badgerbuilder-native .download,
.tmdb-tabs a,.tmdb-tabs button,.tab,.tabs button,.nav-tabs .nav-link,.xc-tab,.portal-tab,.nxt-layout-select label,.pill,.badge,
.nxt-theme-row-btn,.nxt-shortcut-row,.shortcut-row,.theme-row,.login-theme-row,.panel-theme-row
){
  background:linear-gradient(180deg,color-mix(in srgb,var(--nxt-panel-card-2) 92%,transparent),color-mix(in srgb,var(--nxt-panel-bg) 92%,#000 8%)) !important;
  border-color:var(--nxt-panel-border) !important;
  color:var(--nxt-panel-text) !important;
  box-shadow:0 8px 20px rgba(0,0,0,.22),inset 0 0 0 1px var(--nxt-panel-border-soft) !important;
}
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(
.btn:hover,button:hover,.nxt-btn:hover,.nav-link:hover,.nav-link.active,#sidebar-menu-wrap a:hover,#sidebar-menu-wrap a.active,.panel-sidebar .nav-link:hover,.panel-sidebar .nav-link.active,.navbar-vertical .nav-link:hover,.navbar-vertical .nav-link.active,
.nxt-module-menu a:hover,.nxt-module-menu a.active,.chd-nav:hover,.chd-nav.active,.custom-webviews-menu a:hover,.custom-webviews-menu a.active,
.nav-tabs .nav-link.active,.portal-tab.active,.xc-tab.active,.tab.active,.tabs button.active,.pill.active,#badgerbuilder-native button:hover,
.nxt-theme-row.is-active .nxt-theme-row-btn,.nxt-theme-row-btn:hover,.nxt-shortcut-row:hover,.shortcut-row:hover
){
  background:linear-gradient(180deg,color-mix(in srgb,var(--nxt-panel-accent) 18%,var(--nxt-panel-card-2)),color-mix(in srgb,var(--nxt-panel-card) 94%,#000 6%)) !important;
  border-color:var(--nxt-panel-border-strong) !important;
  color:var(--nxt-panel-text) !important;
  box-shadow:0 0 18px var(--nxt-panel-ring),inset 0 0 0 1px var(--nxt-panel-border-soft) !important;
}

/* forms */
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(input,textarea,select,.form-control,.form-select,.input-group-text,.custom-select,
.chd-field .form-control,.chd-field select,.nxt-field input,.nxt-field textarea,.nxt-field select,
.custom-webviews-field input,.custom-webviews-field textarea,.custom-webviews-field select,
#badgerbuilder-native input,#badgerbuilder-native select,#badgerbuilder-native textarea,
.tmdb-card input,.tmdb-card select,.tmdb-card textarea,.tmdb-panel input,.tmdb-panel select,.tmdb-panel textarea,.tmdb-app input,.tmdb-app select,.tmdb-app textarea,.tmdb-shell input,.tmdb-shell select,.tmdb-shell textarea){
  background:linear-gradient(180deg,color-mix(in srgb,var(--nxt-panel-bg) 84%,#fff 4%),color-mix(in srgb,var(--nxt-panel-bg) 90%,#000 10%)) !important;
  border-color:var(--nxt-panel-border) !important;
  color:var(--nxt-panel-text) !important;
  box-shadow:inset 0 0 0 1px var(--nxt-panel-border-soft) !important;
}
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(input,textarea,select,.form-control,.form-select)::placeholder{color:var(--nxt-panel-muted)!important;opacity:1!important}
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(input:focus,textarea:focus,select:focus,.form-control:focus,.form-select:focus){
  border-color:var(--nxt-panel-border-strong) !important;
  box-shadow:0 0 0 1px var(--nxt-panel-border-soft),0 0 16px var(--nxt-panel-ring),inset 0 0 0 1px var(--nxt-panel-border-soft) !important;
}
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) input[type="file"]::file-selector-button{
  background:linear-gradient(180deg,var(--nxt-panel-card-2),var(--nxt-panel-card)) !important;
  color:var(--nxt-panel-text) !important;
  border:1px solid var(--nxt-panel-border) !important;
  border-radius:8px !important;
}

/* tables and logs */
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(table,.table,.bc-table,.nxt-box table,.chd-table-clean,.chd-portal-table,.custom-webviews-media-table){
  background:color-mix(in srgb,var(--nxt-panel-bg) 86%,#000 14%) !important;
  border-color:var(--nxt-panel-border) !important;
  color:var(--nxt-panel-text) !important;
}
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(td,th,.table td,.table th,.bc-table td,.bc-table th,.nxt-box td,.nxt-box th,.chd-table-clean td,.chd-table-clean th,.custom-webviews-media-table td,.custom-webviews-media-table th){
  background:color-mix(in srgb,var(--nxt-panel-card) 72%,transparent) !important;
  border-color:var(--nxt-panel-border-soft) !important;
  color:var(--nxt-panel-text) !important;
}

/* text */
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(h1,h2,h3,h4,h5,h6,label,strong,.card-title,.nxt-section-title,.nxt-box-head,.custom-webviews-menu-title,.custom-webviews-box-head,
.chd-kicker,.chd-title,.chd-section-title,.chd-subhead,.chd-list-title,.nxt-menu-title,.nxt-module-header h1,#badgerbuilder-native .hero h1,#badgerbuilder-native .hero span,
.tmdb-title,.tmdb-kicker,.nxt-api-title,.nxt-api-small-title,.bc-ls-page .bc-head,.api-detail-card-head,.endpoint-label){color:var(--nxt-panel-text)!important;text-shadow:none!important}
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(a,.text-primary,.nxt-hint,.chd-mini-note,.muted,.text-muted,.text-secondary,small,.small,.form-text,.custom-webviews-upload-note,.bc-muted){color:var(--nxt-panel-muted)!important}

/* preserve semantic danger/success while still fitting theme shell */
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(.btn-danger,.nxt-danger,.text-danger,.badge.bg-danger,.alert-danger,.danger,.kill-switch,.emergency,.security-kill-row){border-color:rgba(255,110,125,.55)!important}
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(.btn-success,.badge.bg-success,.alert-success,.ready,.status-ready){border-color:rgba(120,255,190,.42)!important}

/* Remove ghost-wrapper frames without touching real cards. */
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(
.dashboard-widget-shell,.dashboard-widget-wrap,.dashboard-section-shell,.dashboard-section-wrap,.dashboard-row-shell,.dashboard-panel-shell,.dashboard-ref-shell,.dashboard-ghost-shell,.dashboard-frame-shell,.dashboard-empty-shell,.dashboard-placeholder-shell,
.hud-shell,.hud-panel-shell,.nxt-ghost-shell,.nxt-panel-shell,.nxt-content-shell,.nxt-section-shell,.nxt-widget-shell,.nxt-widget-wrapper,.nxt-widget-outer,.nxt-panel-block,.nxt-panel-section,.nxt-content-wrap,.nxt-content-wrapper,
.module-shell,.module-wrapper,.module-container,.module-section,.utility-shell,.utility-wrapper,.tool-shell,.tool-wrapper,.api-shell,.api-wrapper
):not(.card):not(.stat-card):not(.metric-card):not(.dashboard-ref-stat):not(.nxt-module-shell):not(.tmdb-shell):not(.icon-maker-shell){
  background:transparent !important;border-color:transparent !important;box-shadow:none !important;outline:0 !important;
}

body[class*="nxt-theme-"]:not(.nxt-theme-disabled) ::-webkit-scrollbar-thumb{background:linear-gradient(180deg,var(--nxt-panel-accent),var(--nxt-panel-accent-2))!important;border-radius:999px!important;box-shadow:0 0 18px var(--nxt-panel-ring)!important}
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) ::selection{background:color-mix(in srgb,var(--nxt-panel-accent) 42%,transparent)!important;color:var(--nxt-panel-text)!important}

@media(max-width:900px){
  body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(.nxt-module-grid,.chd-shell,.nxt-content-grid,.custom-webviews-grid,.custom-webviews-content-grid){grid-template-columns:1fr!important}
}

/* BB44_DIVIDER_CASCADE_FINAL_FIX_START
   Purpose: remove phantom lined-box/divider artifacts that were being reintroduced
   by the final theme enforcer and RC normalizer after the dashboard/widget CSS loaded.
   This targets micro-status rows, metric summaries, and small status grids only;
   it keeps the main card shells intact. */
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(
  .dashboard-login-watch-summary,
  .dashboard-login-watch-summary > *,
  .dashboard-login-watch-metric,
  .dashboard-login-watch-metric > *,
  .dashboard-login-watch-row,
  .dashboard-login-watch-row > *,
  .security-status-line,
  .security-status-line > *,
  .security-runtime-status,
  .security-runtime-status > *,
  .security-status-grid,
  .security-status-grid > *,
  .security-mini-status,
  .security-mini-status > *,
  .login-watch-summary,
  .login-watch-summary > *,
  .login-watch-metric,
  .login-watch-metric > *,
  .status-line,
  .status-line > *,
  .metric-line,
  .metric-line > *,
  .mini-status-line,
  .mini-status-line > *
){
  border-top:0 !important;
  border-bottom:0 !important;
  border-left:0 !important;
  border-right:0 !important;
  outline:0 !important;
  box-shadow:none !important;
  background-image:none !important;
}

body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(
  .dashboard-login-watch-summary,
  .dashboard-login-watch-metric,
  .security-status-line,
  .security-runtime-status,
  .security-status-grid,
  .security-mini-status,
  .login-watch-summary,
  .login-watch-metric,
  .status-line,
  .metric-line,
  .mini-status-line
){
  background:transparent !important;
}

body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(
  .dashboard-login-watch-summary::before,
  .dashboard-login-watch-summary::after,
  .dashboard-login-watch-metric::before,
  .dashboard-login-watch-metric::after,
  .dashboard-login-watch-row::before,
  .dashboard-login-watch-row::after,
  .security-status-line::before,
  .security-status-line::after,
  .security-runtime-status::before,
  .security-runtime-status::after,
  .security-status-grid::before,
  .security-status-grid::after,
  .status-line::before,
  .status-line::after,
  .metric-line::before,
  .metric-line::after
){
  content:none !important;
  display:none !important;
  border:0 !important;
  box-shadow:none !important;
  background:none !important;
}

body[class*="nxt-theme-"]:not(.nxt-theme-disabled) .dashboard-login-watch-summary{
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:10px !important;
  padding:0 !important;
}
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) .dashboard-login-watch-metric{
  padding:0 !important;
  min-height:auto !important;
  border-radius:0 !important;
}

/* Stop global table dividers from painting tiny status/metric stacks as boxed rows. */
body[class*="nxt-theme-"]:not(.nxt-theme-disabled) :is(
  .dashboard-login-watch-card,
  .security-card,
  .badgersclaw-card,
  .dashboard-ref-panel
) :is(.dashboard-login-watch-summary,.security-status-line,.security-runtime-status,.status-line,.metric-line) :is(table,.table,tbody,tr,td,th){
  border:0 !important;
  box-shadow:none !important;
  background:transparent !important;
}

@media (max-width: 768px){
  body[class*="nxt-theme-"]:not(.nxt-theme-disabled) .dashboard-login-watch-summary{
    grid-template-columns:1fr !important;
    gap:6px !important;
  }
}
/* BB44_DIVIDER_CASCADE_FINAL_FIX_END */

