/* BB61 Panel-Wide Theme Cleanup v1.0.0
   Purpose: final non-destructive theme contract layer for panel custom UI.
   Keeps Bootstrap/Tabler vendor CSS intact, but forces custom HUD/module surfaces,
   pills, shortcuts, selectors, search/input wrappers, endpoint/url boxes, and status
   badges to follow the selected Panel Theme instead of old blue/red/purple fallbacks. */

:root {
  --bb61-theme: var(--bs-theme, var(--nxt-theme-primary, var(--nxt-panel-accent, #ffaa00)));
  --bb61-theme-rgb: var(--bs-theme-rgb, var(--nxt-theme-rgb, var(--nxt-panel-accent-rgb, 255,170,0)));
  --bb61-surface: var(--nxt-theme-card, var(--nxt-panel-card, rgba(12,18,28,.92)));
  --bb61-surface-2: var(--nxt-theme-card-2, var(--nxt-panel-card-2, rgba(16,24,38,.86)));
  --bb61-border: rgba(var(--bb61-theme-rgb), .22);
  --bb61-border-strong: rgba(var(--bb61-theme-rgb), .46);
  --bb61-glow: rgba(var(--bb61-theme-rgb), .14);
  --bb61-text: rgba(240,246,255,.92);
  --bb61-muted: rgba(220,232,248,.62);
}

/* Top shortcut bar: remove old hardcoded blue/red/purple visual fallback. */
.nxt-hud-topbar-shortcuts,
.nxt-hud-shortcut,
.nxt-hud-shortcut-warning,
.nxt-hud-shortcut-danger {
  --shortcut-accent: var(--bb61-theme) !important;
  --shortcut-accent-rgb: var(--bb61-theme-rgb) !important;
}

.nxt-hud-shortcut,
.nxt-hud-shortcut-warning,
.nxt-hud-shortcut-danger {
  color: var(--bb61-text) !important;
  border-color: var(--bb61-border) !important;
  background:
    linear-gradient(180deg, rgba(var(--bb61-theme-rgb), .075), rgba(255,255,255,.025)),
    color-mix(in srgb, var(--bb61-surface-2) 86%, transparent) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 10px 22px rgba(0,0,0,.14) !important;
}

.nxt-hud-shortcut i,
.nxt-hud-shortcut-warning i,
.nxt-hud-shortcut-danger i {
  color: var(--bb61-theme) !important;
}

.nxt-hud-shortcut:hover,
.nxt-hud-shortcut:focus,
.nxt-hud-shortcut-warning:hover,
.nxt-hud-shortcut-warning:focus,
.nxt-hud-shortcut-danger:hover,
.nxt-hud-shortcut-danger:focus {
  border-color: var(--bb61-border-strong) !important;
  background:
    linear-gradient(180deg, rgba(var(--bb61-theme-rgb), .14), rgba(var(--bb61-theme-rgb), .055)),
    color-mix(in srgb, var(--bb61-surface-2) 88%, transparent) !important;
  box-shadow: 0 0 0 1px rgba(var(--bb61-theme-rgb), .16), 0 14px 30px var(--bb61-glow) !important;
}

/* Custom module surfaces: reduce ghost/fade boxes and force theme-aware standard surface. */
.bc-api-helper-shell,
.bc-api-sidebar,
.bc-api-detail,
.bc-api-endpoint-card,
.bc-api-search,
.utility-search-wrap,
.utility-sidebar,
.utility-workspace,
.utility-launcher,
.utility-tool-card,
.security-center,
.bb56-security-shell,
.bb56-security-surface,
.dashboard-ref-panel,
.nx-workspace-card,
.badgersclaw-card:not(.modal-content),
.hud-card,
.nxt-card {
  border-color: rgba(var(--bb61-theme-rgb), .18) !important;
  background:
    linear-gradient(180deg, rgba(var(--bb61-theme-rgb), .045), rgba(255,255,255,.018)),
    color-mix(in srgb, var(--bb61-surface) 92%, transparent) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 14px 34px rgba(0,0,0,.18) !important;
}

/* Kill nested ghost overlays on custom surfaces only. */
.bc-api-helper-shell::before,
.bc-api-helper-shell::after,
.utility-search-wrap::before,
.utility-search-wrap::after,
.utility-sidebar::before,
.utility-sidebar::after,
.utility-workspace::before,
.utility-workspace::after,
.security-center::before,
.security-center::after,
.bb56-security-shell::before,
.bb56-security-shell::after,
.bb56-security-surface::before,
.bb56-security-surface::after {
  content: none !important;
  display: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Inputs/search/url boxes: one clean surface, no box-in-box bright fallback. */
.bc-api-search input,
.bc-api-url-box,
.utility-search-wrap input,
.utility-search-wrap .form-control,
.security-center input,
.security-center .form-control,
.bb56-security-shell input,
.bb56-security-shell .form-control,
.bb56-security-surface input,
.bb56-security-surface .form-control,
.form-control.theme-surface,
input.theme-surface {
  color: var(--bb61-text) !important;
  background: rgba(4,9,17,.58) !important;
  border-color: rgba(var(--bb61-theme-rgb), .18) !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.28) !important;
  -webkit-text-fill-color: var(--bb61-text) !important;
}

.bc-api-url-box {
  background: rgba(4,9,17,.64) !important;
  color: rgba(238,247,255,.92) !important;
}

/* Selectors, category buttons, utility badges, and endpoint action buttons. */
.bc-api-group-head i,
.bc-api-search i,
.bc-api-app-icon,
.utility-category-icon,
.utility-search-icon,
.utility-tool-icon {
  color: var(--bb61-theme) !important;
}

.bc-api-app-btn.active,
.bc-api-app-btn:hover,
.utility-category-btn.active,
.utility-category-btn:hover,
.utility-tool-card:hover,
.bc-api-copy,
.btn.theme-btn-primary,
button.theme-btn-primary,
a.theme-btn-primary {
  border-color: var(--bb61-border-strong) !important;
  background:
    linear-gradient(180deg, rgba(var(--bb61-theme-rgb), .15), rgba(var(--bb61-theme-rgb), .06)),
    color-mix(in srgb, var(--bb61-surface-2) 88%, transparent) !important;
  color: #fff !important;
  box-shadow: 0 0 0 1px rgba(var(--bb61-theme-rgb), .10), 0 12px 26px rgba(var(--bb61-theme-rgb), .10) !important;
}

.bc-api-count-chip,
.bc-api-total,
.badge.theme-badge,
.status-chip,
.utility-category-badge,
.security-status-pill,
.bb56-status-pill {
  color: var(--bb61-text) !important;
  border-color: rgba(var(--bb61-theme-rgb), .30) !important;
  background: rgba(var(--bb61-theme-rgb), .11) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055) !important;
}

/* Prevent specific module category badges from forcing cyan/purple/green/yellow/pink. */
.utility-category-badge.crypto,
.utility-category-badge.encode,
.utility-category-badge.generator,
.utility-category-badge.converter,
.utility-category-badge.developer {
  color: var(--bb61-text) !important;
  background: rgba(var(--bb61-theme-rgb), .11) !important;
  border: 1px solid rgba(var(--bb61-theme-rgb), .26) !important;
}

/* Native switches/toggles: clear on/off state while following panel theme. */
.form-check-input:checked,
input[type="checkbox"].form-check-input:checked {
  background-color: var(--bb61-theme) !important;
  border-color: var(--bb61-theme) !important;
  box-shadow: 0 0 0 .18rem rgba(var(--bb61-theme-rgb), .18) !important;
}

.form-check-input:focus,
input[type="checkbox"].form-check-input:focus {
  border-color: rgba(var(--bb61-theme-rgb), .50) !important;
  box-shadow: 0 0 0 .18rem rgba(var(--bb61-theme-rgb), .16) !important;
}

/* Keep dropdowns and modals above module surfaces after native conversions. */
.dropdown-menu { z-index: 2147481000 !important; }
.modal { z-index: 2147483000 !important; }
.modal-backdrop { z-index: 2147482500 !important; }
