/**
 * Dark Trading Terminal Theme - Hyperdash Style
 *
 * Warm brown-black palette with orange accent.
 * All colors, fonts, radii and shadows defined here.
 */

/* ============================================
   Design Tokens - Hyperdash Style
   ============================================ */

.theme-dashboard-dark,
.theme-dashboard-dark body {
  /* ========== Background Colors ========== */
  --color-bg-page: #100e0a;
  --color-bg-surface: #141210;
  --color-bg-surface-elevated: #191613;
  --color-bg-surface-subtle: #0d0b09;
  --color-bg-row-hover: rgba(255, 255, 255, 0.04);

  /* ========== Border Colors ========== */
  --color-border-subtle: rgba(255, 255, 255, 0.04);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.16);
  --color-border-accent: #ed3602;

  /* ========== Text Colors ========== */
  --color-text-primary: #ffffff;
  --color-text-secondary: #d5d1cd;
  --color-text-muted: #928d86;
  --color-text-disabled: rgba(255, 255, 255, 0.24);
  --color-text-inverse: #100e0a;

  /* ========== Primary Colors ========== */
  --color-primary-base: #fd4612;
  --color-primary-soft: rgba(253, 70, 18, 0.12);
  --color-primary-hover: #fd5e32;
  --color-primary-active: #ed3602;

  /* ========== Accent Colors ========== */
  --color-accent-blue: #5897d7;
  --color-accent-purple: #8258d7;
  --color-accent-teal: #3dcdb1;
  --color-accent-yellow: #ffd230;

  /* ========== Status Colors ========== */
  --color-status-danger: #d44b62;
  --color-status-danger-soft: rgba(212, 75, 98, 0.12);
  --color-status-warning: #ffd230;
  --color-status-warning-soft: rgba(255, 210, 48, 0.12);
  --color-status-success: #22c55e;
  --color-status-success-soft: rgba(34, 197, 94, 0.12);
  --color-status-neutral-soft: rgba(148, 163, 184, 0.12);
  --color-status-neutral-border: rgba(148, 163, 184, 0.4);
  --color-status-neutral-text: #CBD5F5;

  /* ========== PnL Colors ========== */
  --color-pnl-positive: #5cc09b;
  --color-pnl-negative: #d44b62;
  --color-pnl-neutral: #928d86;
  --color-pnl-bg-positive: rgba(92, 192, 155, 0.08);
  --color-pnl-bg-negative: rgba(212, 75, 98, 0.08);

  /* ========== Input Colors ========== */
  --color-input-surface: rgba(255, 255, 255, 0.08);
  --color-input-border: rgba(255, 255, 255, 0.08);
  --color-input-focus: rgba(255, 255, 255, 0.16);

  /* ========== Typography ========== */
  --font-family-base: "Inter", system-ui, -apple-system, sans-serif;
  --font-family-mono: "Geist Mono", ui-monospace, "SF Mono", monospace;

  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-md: 14px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* ========== Radius ========== */
  --radius-xs: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-pill: 9999px;

  /* ========== Shadows ========== */
  --shadow-subtle: none;
  --shadow-glow-primary: 0 0 12px rgba(253, 70, 18, 0.2);
  --shadow-inset-ring: 0 0 0 1px rgba(0, 0, 0, 0.16);

  /* ========== Legacy Compatibility ========== */
  --bg-body: var(--color-bg-page);
  --bg-panel: var(--color-bg-surface);
  --bg-panel-hover: var(--color-bg-surface-elevated);
  --bg-card: var(--color-bg-surface);
  --bg-input: var(--color-input-surface);
  --border-subtle: var(--color-border-subtle);
  --border-hover: var(--color-border-strong);
  --border-focus: var(--color-border-accent);
  --text-primary: var(--color-text-primary);
  --text-secondary: var(--color-text-secondary);
  --text-muted: var(--color-text-muted);
  --accent-positive: var(--color-pnl-positive);
  --accent-negative: var(--color-pnl-negative);
  --accent-info: var(--color-accent-blue);
  --accent-warning: var(--color-status-warning);
  --bg-profit-soft: var(--color-pnl-bg-positive);
  --bg-loss-soft: var(--color-pnl-bg-negative);
  --accent: var(--color-primary-base);
  --accent-dark: var(--color-primary-active);
  --accent-light: var(--color-primary-soft);
  --surface: var(--color-bg-surface);
  --surface-alt: var(--color-bg-surface-elevated);
}

.theme-dashboard-dark,
.theme-dashboard-dark *,
.theme-dashboard-dark *::before,
.theme-dashboard-dark *::after {
  box-sizing: border-box;
}

/* ============================================
   Base Theme Application
   ============================================ */

.theme-dashboard-dark {
  background: var(--color-bg-page) !important;
  color: var(--color-text-primary) !important;
  min-height: 100vh;
  font-family: var(--font-family-base);
  overflow-x: hidden;
}

.theme-dashboard-dark body {
  background: var(--color-bg-page) !important;
  color: var(--color-text-primary) !important;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ============================================
   Typography
   ============================================ */

.theme-dashboard-dark h1 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary) !important;
}

.theme-dashboard-dark h2 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary) !important;
}

.theme-dashboard-dark h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary) !important;
}

.theme-dashboard-dark h4,
.theme-dashboard-dark h5,
.theme-dashboard-dark h6,
.theme-dashboard-dark .title {
  color: var(--color-text-primary) !important;
}

.theme-dashboard-dark .subtitle,
.theme-dashboard-dark .heading {
  color: var(--color-text-secondary) !important;
}

.theme-dashboard-dark p,
.theme-dashboard-dark .content {
  color: var(--color-text-primary);
}

.theme-dashboard-dark .muted {
  color: var(--color-text-muted) !important;
}

/* Monospace font for addresses, hashes, CA */
.theme-dashboard-dark .mono,
.theme-dashboard-dark .text-mono,
.theme-dashboard-dark code,
.theme-dashboard-dark pre {
  font-family: var(--font-family-mono);
}

/* Labels and captions */
.theme-dashboard-dark .label,
.theme-dashboard-dark .caption {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}

/* ============================================
   Cards & Panels
   ============================================ */

.theme-dashboard-dark .box,
.theme-dashboard-dark .card,
.theme-dashboard-dark .panel {
  background: var(--color-bg-surface) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-subtle) !important;
  color: var(--color-text-primary) !important;
  transition: all 0.2s ease;
}

.theme-dashboard-dark .box:hover,
.theme-dashboard-dark .card:hover,
.theme-dashboard-dark .panel:hover {
  background: var(--color-bg-surface-elevated) !important;
  border-color: var(--color-border-strong) !important;
}

.theme-dashboard-dark .card-content {
  color: var(--color-text-primary);
}

/* Panel sub-components (Bulma) */
.theme-dashboard-dark .panel-heading {
  background: var(--color-bg-surface-elevated) !important;
  color: var(--color-text-primary) !important;
  border-bottom: 1px solid var(--color-border) !important;
}

.theme-dashboard-dark .panel-block,
.theme-dashboard-dark .panel-tabs {
  border-bottom: 1px solid var(--color-border-subtle) !important;
}

.theme-dashboard-dark .panel-block:last-child {
  border-bottom: none !important;
}

/* ============================================
   Tables - Trading Terminal Style
   ============================================ */

.theme-dashboard-dark .table {
  background: transparent;
  color: var(--color-text-primary);
  width: 100%;
  table-layout: auto;
}

.theme-dashboard-dark .table-container {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-subtle) transparent;
}

.theme-dashboard-dark .table-container::-webkit-scrollbar {
  height: 8px;
}

.theme-dashboard-dark .table-container::-webkit-scrollbar-track {
  background: var(--color-bg-page);
}

.theme-dashboard-dark .table-container::-webkit-scrollbar-thumb {
  background: var(--color-border-subtle);
  border-radius: var(--radius-xs);
}

.theme-dashboard-dark .table-container::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* Baseline for all Bulma table header cells, including key/value row headers. */
.theme-dashboard-dark .table th {
  background: transparent !important;
  border-color: var(--color-border-subtle) !important;
  color: var(--color-text-secondary) !important;
}

/* Table header - compact terminal style */
.theme-dashboard-dark .table thead th {
  background: var(--color-bg-surface) !important;
  color: var(--color-text-muted) !important;
  border-bottom: 1px solid var(--color-border) !important;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0;
  padding: 8px 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Table rows */
.theme-dashboard-dark .table tbody td {
  border-color: var(--color-border-subtle) !important;
  color: var(--color-text-primary);
  padding: 0.75rem 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Text alignment */
.theme-dashboard-dark .table tbody td.text-right,
.theme-dashboard-dark .table tbody td[style*="text-align: right"] {
  text-align: right;
}

.theme-dashboard-dark .table tbody td.text-center,
.theme-dashboard-dark .table tbody td[style*="text-align: center"] {
  text-align: center;
}

.theme-dashboard-dark .table tbody tr {
  background: transparent;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
}

.theme-dashboard-dark .table tbody tr:hover {
  background: var(--color-bg-row-hover) !important;
  border-left-color: var(--color-primary-base) !important;
}

.theme-dashboard-dark .table.is-striped tbody tr:nth-child(even) {
  background: var(--color-bg-surface-subtle);
}

.theme-dashboard-dark .table.is-striped tbody tr:nth-child(even):hover {
  background: var(--color-bg-row-hover) !important;
}

/* Data cell utilities */
.theme-dashboard-dark .hd-cell,
.theme-dashboard-dark .hd-cell-mono {
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
}

.theme-dashboard-dark .hd-cell-mono {
  font-family: var(--font-family-mono);
  text-transform: uppercase;
}

/* ============================================
   Buttons - Trading Terminal Style
   ============================================ */

.theme-dashboard-dark .button {
  border-radius: var(--radius-md) !important;
  font-weight: var(--font-weight-medium);
  transition: all 0.15s ease;
  border-width: 1px;
  font-family: var(--font-family-base);
}

/* Primary button - glass bevel effect */
.theme-dashboard-dark .button.is-primary,
.theme-dashboard-dark .button.is-link {
  background: var(--color-primary-base) !important;
  border: none !important;
  border-radius: var(--radius-xs) !important;
  color: #fff !important;
  font-weight: 500;
  box-shadow: var(--shadow-inset-ring);
  position: relative;
  overflow: hidden;
  transition: background 0.15s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-dashboard-dark .button.is-primary::after,
.theme-dashboard-dark .button.is-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.32),
    rgba(255, 255, 255, 0.04)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 1px;
  pointer-events: none;
}

.theme-dashboard-dark .button.is-primary:hover,
.theme-dashboard-dark .button.is-link:hover {
  background: var(--color-primary-hover) !important;
  box-shadow: var(--shadow-glow-primary);
}

.theme-dashboard-dark .button.is-primary:active,
.theme-dashboard-dark .button.is-link:active {
  background: var(--color-primary-active) !important;
  transform: scale(0.98);
}

/* Secondary (outline) button */
.theme-dashboard-dark .button.is-light {
  background: transparent !important;
  border-color: var(--color-border-subtle) !important;
  color: var(--color-text-primary) !important;
}

.theme-dashboard-dark .button.is-light:hover {
  background: var(--color-bg-surface-subtle) !important;
  border-color: var(--color-border-strong) !important;
  color: var(--color-text-primary) !important;
}

/* Ghost / Text button */
.theme-dashboard-dark .button.is-ghost,
.theme-dashboard-dark .button.is-text {
  background: transparent !important;
  border-color: transparent !important;
  color: var(--color-text-secondary) !important;
}

.theme-dashboard-dark .button.is-ghost:hover,
.theme-dashboard-dark .button.is-text:hover {
  background: var(--color-bg-surface-subtle) !important;
  color: var(--color-text-primary) !important;
}

/* Icon buttons */
.theme-dashboard-dark .button.is-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-surface-subtle) !important;
  border-color: var(--color-border-subtle) !important;
}

.theme-dashboard-dark .button.is-icon:hover {
  background: var(--color-bg-row-hover) !important;
}

/* ============================================
   Chips / Tags / Badges
   ============================================ */

.theme-dashboard-dark .tag,
.theme-dashboard-dark .chip {
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  padding: 0.25rem 0.75rem;
}

/* Inactive filter/tab */
.theme-dashboard-dark .tag.is-light,
.theme-dashboard-dark .chip.is-inactive {
  background: var(--color-bg-surface-subtle) !important;
  color: var(--color-text-secondary) !important;
  border: 1px solid var(--color-border-subtle);
}

/* Active filter/tab */
.theme-dashboard-dark .tag.is-primary,
.theme-dashboard-dark .chip.is-active {
  background: var(--color-primary-soft) !important;
  color: var(--color-primary-base) !important;
  border: 1px solid var(--color-border-accent);
}

/* Status tags */
.theme-dashboard-dark .tag.is-success,
.theme-dashboard-dark .tag.is-success.is-light {
  background: var(--color-status-success-soft) !important;
  color: var(--color-status-success) !important;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.theme-dashboard-dark .tag.is-danger {
  background: var(--color-status-danger-soft) !important;
  color: var(--color-status-danger) !important;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.theme-dashboard-dark .tag.is-warning {
  background: var(--color-status-warning-soft) !important;
  color: var(--color-status-warning) !important;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.theme-dashboard-dark .tag.is-info {
  background: var(--color-status-neutral-soft) !important;
  color: var(--color-accent-blue) !important;
  border: 1px solid rgba(34, 211, 238, 0.3);
}

.theme-dashboard-dark .tag.is-link,
.theme-dashboard-dark .tag.is-link.is-light {
  background: var(--color-status-neutral-soft) !important;
  color: var(--color-accent-blue) !important;
  border: 1px solid var(--color-status-neutral-border);
}

.theme-dashboard-dark .tag.is-dark,
.theme-dashboard-dark .tag.is-dark.is-light,
.theme-dashboard-dark .tag.is-black,
.theme-dashboard-dark .tag.is-black.is-light {
  background: var(--color-bg-surface-subtle) !important;
  color: var(--color-text-secondary) !important;
  border: 1px solid var(--color-border);
}

/* ============================================
   PnL / Profit-Loss Semantic Classes
   ============================================ */

/* Bulma text helpers */
.theme-dashboard-dark .has-text-grey,
.theme-dashboard-dark .has-text-grey-light {
  color: var(--color-text-muted) !important;
}

.theme-dashboard-dark .has-text-link,
.theme-dashboard-dark .has-text-info {
  color: var(--color-accent-blue) !important;
}

.theme-dashboard-dark .has-text-warning {
  color: var(--color-status-warning) !important;
  font-weight: var(--font-weight-medium);
}

.theme-dashboard-dark .has-text-dark,
.theme-dashboard-dark .has-text-black {
  color: var(--color-text-primary) !important;
}

/* Positive values */
.theme-dashboard-dark .text-profit,
.theme-dashboard-dark .text-positive,
.theme-dashboard-dark .has-text-success {
  color: var(--color-pnl-positive) !important;
  font-weight: var(--font-weight-medium);
}

.theme-dashboard-dark .badge-profit,
.theme-dashboard-dark .bg-profit {
  background: var(--color-pnl-bg-positive) !important;
  color: var(--color-pnl-positive) !important;
}

/* Negative values */
.theme-dashboard-dark .text-loss,
.theme-dashboard-dark .text-negative,
.theme-dashboard-dark .has-text-danger {
  color: var(--color-pnl-negative) !important;
  font-weight: var(--font-weight-medium);
}

.theme-dashboard-dark .badge-loss,
.theme-dashboard-dark .bg-loss {
  background: var(--color-pnl-bg-negative) !important;
  color: var(--color-pnl-negative) !important;
}

/* Neutral values */
.theme-dashboard-dark .text-neutral,
.theme-dashboard-dark .text-muted-pnl {
  color: var(--color-pnl-neutral) !important;
}

/* ============================================
   Form Elements
   ============================================ */

.theme-dashboard-dark .input,
.theme-dashboard-dark .select select,
.theme-dashboard-dark .textarea {
  height: 36px;
  background: var(--color-input-surface) !important;
  border: 1px solid var(--color-input-border) !important;
  border-radius: var(--radius-xs);
  font-size: var(--font-size-sm);
  letter-spacing: 0.01em;
  color: var(--color-text-primary) !important;
  font-family: var(--font-family-base);
  transition: border-color 0.2s ease-in-out;
}

.theme-dashboard-dark .textarea {
  height: auto;
}

.theme-dashboard-dark .input:hover,
.theme-dashboard-dark .select select:hover,
.theme-dashboard-dark .textarea:hover {
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.theme-dashboard-dark .input:focus,
.theme-dashboard-dark .select select:focus,
.theme-dashboard-dark .textarea:focus {
  border-color: var(--color-input-focus) !important;
  box-shadow: none !important;
}

.theme-dashboard-dark .input::placeholder,
.theme-dashboard-dark .textarea::placeholder {
  color: var(--color-text-muted) !important;
}

.theme-dashboard-dark .label {
  color: var(--color-text-secondary) !important;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   Navigation Bar
   ============================================ */

.theme-dashboard-dark .navbar {
  background: var(--color-bg-surface-elevated) !important;
  border-bottom: 1px solid var(--color-border) !important;
  box-shadow: var(--shadow-subtle);
  height: 60px;
  min-height: 60px;
  padding: 0 0.9rem;
}

.theme-dashboard-dark .app-navbar {
  position: relative;
  z-index: 40;
}

.theme-dashboard-dark .app-navbar .navbar-brand,
.theme-dashboard-dark .app-navbar .navbar-menu,
.theme-dashboard-dark .app-navbar .navbar-start,
.theme-dashboard-dark .app-navbar .navbar-end {
  align-items: center;
  min-height: 60px;
}

.theme-dashboard-dark .app-navbar-brand {
  gap: 0.5rem;
  min-height: 60px;
  padding: 0.55rem 0.9rem 0.55rem 0.25rem;
}

.theme-dashboard-dark .app-navbar-logo {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.theme-dashboard-dark .app-navbar-brand-copy {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
}

.theme-dashboard-dark .app-navbar-brand-name {
  color: var(--color-text-primary);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
}

.theme-dashboard-dark .app-navbar-brand-context {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.theme-dashboard-dark .navbar-item,
.theme-dashboard-dark .navbar-item:visited,
.theme-dashboard-dark .navbar-link,
.theme-dashboard-dark .navbar-link:visited {
  color: var(--color-text-secondary) !important;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.theme-dashboard-dark .app-navbar .navbar-start > .navbar-item:not(.has-dropdown),
.theme-dashboard-dark .app-navbar .navbar-link {
  min-height: 36px;
  margin: 0 0.12rem;
  padding: 0.48rem 0.72rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  line-height: 1.1;
}

.theme-dashboard-dark .app-navbar .navbar-link {
  padding-right: 1.85rem;
}

.theme-dashboard-dark .app-navbar .navbar-start > .navbar-item.has-dropdown {
  padding: 0;
}

.theme-dashboard-dark .navbar-item.is-active,
.theme-dashboard-dark .navbar-item:hover,
.theme-dashboard-dark .navbar-link:hover {
  background: var(--color-bg-surface-subtle) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text-primary) !important;
}

.theme-dashboard-dark .app-navbar .navbar-start > .navbar-item.is-active,
.theme-dashboard-dark .navbar-link.is-active {
  color: var(--color-text-primary) !important;
  background: var(--color-bg-surface-subtle) !important;
  border-color: var(--color-border-strong) !important;
  box-shadow: inset 0 -2px 0 var(--color-primary-base);
}

.theme-dashboard-dark .app-navbar .navbar-item:focus-visible,
.theme-dashboard-dark .app-navbar .navbar-link:focus-visible,
.theme-dashboard-dark .app-navbar .button:focus-visible {
  outline: 2px solid var(--color-primary-base);
  outline-offset: 2px;
}

.theme-dashboard-dark .navbar-item.has-text-weight-semibold {
  color: var(--color-text-primary) !important;
  font-weight: var(--font-weight-semibold);
}

.theme-dashboard-dark .navbar-link::after {
  border-color: var(--color-text-secondary) !important;
  right: 0.85rem;
}

.theme-dashboard-dark .navbar-link:hover::after,
.theme-dashboard-dark .navbar-link.is-active::after {
  border-color: var(--color-text-primary) !important;
}

.theme-dashboard-dark .navbar-dropdown {
  background: var(--color-bg-surface-elevated) !important;
  min-width: 13rem;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-md) !important;
  padding: 0.45rem !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

.theme-dashboard-dark .app-nav-dropdown-wide {
  min-width: 15rem;
}

.theme-dashboard-dark .navbar-dropdown .navbar-item {
  color: var(--color-text-secondary) !important;
  min-height: 32px;
  padding: 0.42rem 0.55rem;
  border-radius: var(--radius-xs);
  font-size: var(--font-size-sm);
  line-height: 1.2;
}

.theme-dashboard-dark .navbar-dropdown .navbar-item:hover {
  background: var(--color-bg-surface-subtle) !important;
  color: var(--color-text-primary) !important;
}

.theme-dashboard-dark .navbar-dropdown .navbar-item.is-active {
  color: var(--color-primary-hover) !important;
  background: var(--color-primary-soft) !important;
  box-shadow: none !important;
  font-weight: var(--font-weight-semibold);
}

.theme-dashboard-dark .navbar-dropdown .navbar-label {
  display: block;
  padding: 0.55rem 0.55rem 0.25rem;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-transform: uppercase;
}

.theme-dashboard-dark .navbar-divider {
  background: var(--color-border-subtle) !important;
  margin: 0.35rem 0;
}

.theme-dashboard-dark .navbar-end .button {
  margin: 0;
}

.theme-dashboard-dark .app-navbar-logout-form {
  margin: 0;
}

.theme-dashboard-dark .navbar-end .button.is-light {
  background: var(--color-bg-surface-subtle);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.theme-dashboard-dark .navbar-end .button.is-light:hover {
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  border-color: var(--color-border-strong);
}

.theme-dashboard-dark .navbar-burger {
  width: 44px;
  min-height: 44px;
  margin-left: auto;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
}

.theme-dashboard-dark .navbar-burger:hover,
.theme-dashboard-dark .navbar-burger.is-active {
  background: var(--color-bg-surface-subtle);
  color: var(--color-text-primary);
}

.theme-dashboard-dark .navbar-burger span {
  background-color: currentColor;
  height: 1px;
}

.signal-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin: 0.25rem 0 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-border);
}

.signal-nav-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.signal-nav-label {
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.signal-section-nav .buttons {
  margin-bottom: 0;
}

.signal-section-nav .button {
  min-width: 0;
}

@media screen and (max-width: 1023px) {
  .theme-dashboard-dark .navbar {
    height: auto;
    min-height: 60px;
    padding: 0 0.65rem;
  }

  .theme-dashboard-dark .app-navbar .navbar-brand {
    min-height: 60px;
  }

  .theme-dashboard-dark .navbar-menu {
    display: none;
    margin: 0 -0.65rem;
    padding: 0.35rem 0.65rem 0.85rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-surface-elevated);
    box-shadow: none;
  }

  .theme-dashboard-dark .navbar-menu.is-active {
    display: block;
  }

  .theme-dashboard-dark .app-navbar .navbar-start > .navbar-item:not(.has-dropdown),
  .theme-dashboard-dark .app-navbar .navbar-link {
    min-height: 40px;
    margin: 0.12rem 0;
    padding: 0.62rem 0.75rem;
  }

  .theme-dashboard-dark .app-navbar .navbar-start > .navbar-item.has-dropdown {
    display: block;
  }

  .theme-dashboard-dark .navbar-dropdown {
    display: block;
    min-width: 0;
    margin: 0.1rem 0 0.5rem 0.75rem;
    padding: 0.25rem 0 0.25rem 0.55rem !important;
    border: 0 !important;
    border-left: 1px solid var(--color-border) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .theme-dashboard-dark .navbar-dropdown .navbar-item {
    min-height: 40px;
  }

  .theme-dashboard-dark .navbar-end {
    border-top: 1px solid var(--color-border-subtle);
    margin-top: 0.45rem;
    padding-top: 0.55rem;
  }

  .theme-dashboard-dark .navbar-end .navbar-item {
    padding-right: 0;
    padding-left: 0;
  }

  .signal-section-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .signal-nav-group {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }
}

@media screen and (min-width: 1024px) {
  .theme-dashboard-dark .navbar-menu {
    display: flex;
  }

  .theme-dashboard-dark .navbar-burger {
    display: none;
  }

  .theme-dashboard-dark .app-nav-group:focus-within .navbar-dropdown {
    display: block;
  }
}

/* ============================================
   Stat Cards (Metrics)
   ============================================ */

.theme-dashboard-dark .stat-card {
  background: var(--color-bg-surface) !important;
  border: 1px solid var(--color-border-subtle) !important;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.theme-dashboard-dark .stat-card .stat-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.theme-dashboard-dark .stat-card .stat-value {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.theme-dashboard-dark .stat-card .stat-trend {
  font-size: var(--font-size-sm);
  margin-top: 0.25rem;
}

/* ============================================
   Chart Container
   ============================================ */

.theme-dashboard-dark .chart-container {
  background: var(--color-bg-surface) !important;
  border: 1px solid var(--color-border-subtle) !important;
  border-radius: var(--radius-md);
  padding: 1rem;
}

/* Chart grid lines */
.theme-dashboard-dark .chart-grid {
  stroke: rgba(148, 163, 184, 0.15);
}

/* Chart axis labels */
.theme-dashboard-dark .chart-axis-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  font-family: var(--font-family-mono);
}

/* ============================================
   Code & Pre blocks
   ============================================ */

.theme-dashboard-dark pre,
.theme-dashboard-dark .code-block {
  background: var(--color-bg-surface) !important;
  border: 1px solid var(--color-border-subtle) !important;
  color: var(--color-text-primary) !important;
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-family-mono);
  font-size: var(--font-size-sm);
}

.theme-dashboard-dark code {
  background: var(--color-bg-surface-subtle) !important;
  color: var(--color-accent-blue) !important;
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-family-mono);
  font-size: 0.9em;
}

/* ============================================
   Pagination
   ============================================ */

.theme-dashboard-dark .pagination .pagination-link,
.theme-dashboard-dark .pagination .pagination-previous,
.theme-dashboard-dark .pagination .pagination-next {
  background: var(--color-bg-surface) !important;
  border-color: var(--color-border-subtle) !important;
  color: var(--color-text-primary) !important;
  border-radius: var(--radius-md);
}

.theme-dashboard-dark .pagination .pagination-link.is-current {
  background: var(--color-primary-base) !important;
  border-color: var(--color-primary-base) !important;
  color: var(--color-text-inverse) !important;
}

.theme-dashboard-dark .pagination .pagination-link:hover,
.theme-dashboard-dark .pagination .pagination-previous:hover,
.theme-dashboard-dark .pagination .pagination-next:hover {
  background: var(--color-bg-surface-subtle) !important;
  border-color: var(--color-border-strong) !important;
}

/* ============================================
   Notifications & Alerts
   ============================================ */

.theme-dashboard-dark .notification {
  background: var(--color-bg-surface) !important;
  border: 1px solid var(--color-border-subtle) !important;
  color: var(--color-text-primary) !important;
  border-radius: var(--radius-md);
}

.theme-dashboard-dark .notification.is-danger {
  background: var(--color-status-danger-soft) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: var(--color-status-danger) !important;
}

.theme-dashboard-dark .notification.is-success {
  background: var(--color-pnl-bg-positive) !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
  color: var(--color-pnl-positive) !important;
}

.theme-dashboard-dark .notification.is-info {
  background: var(--color-status-neutral-soft) !important;
  border-color: rgba(34, 211, 238, 0.3) !important;
  color: var(--color-accent-blue) !important;
}

.theme-dashboard-dark .notification.is-warning {
  background: var(--color-status-warning-soft) !important;
  border-color: rgba(234, 179, 8, 0.3) !important;
  color: var(--color-status-warning) !important;
}

/* ============================================
   Field Reference / Details
   ============================================ */

.theme-dashboard-dark .field-reference {
  background: var(--color-bg-surface) !important;
  border: 1px solid var(--color-border-subtle) !important;
  border-radius: var(--radius-md) !important;
  color: var(--color-text-primary) !important;
  padding: 1rem 1.25rem !important;
  margin-bottom: 1.5rem !important;
  transition: all 0.2s ease;
}

.theme-dashboard-dark .field-reference:hover {
  border-color: var(--color-border-accent) !important;
}

.theme-dashboard-dark .field-reference summary {
  color: var(--color-text-primary) !important;
  font-weight: var(--font-weight-semibold) !important;
  font-size: var(--font-size-sm) !important;
  cursor: pointer !important;
  padding: 0.5rem 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  user-select: none;
  transition: color 0.15s ease;
}

.theme-dashboard-dark .field-reference summary:hover {
  color: var(--color-primary-base) !important;
}

.theme-dashboard-dark .field-reference[open] summary {
  margin-bottom: 1rem !important;
  border-bottom: 1px solid var(--color-border-subtle) !important;
  padding-bottom: 0.75rem !important;
}

.theme-dashboard-dark .field-reference ul,
.theme-dashboard-dark .field-reference ol,
.theme-dashboard-dark .field-reference li {
  color: var(--color-text-secondary) !important;
  line-height: 1.6 !important;
}

.theme-dashboard-dark .field-reference strong {
  color: var(--color-text-primary) !important;
  font-weight: var(--font-weight-semibold) !important;
}

/* ============================================
   Section & Container
   ============================================ */

.theme-dashboard-dark .section {
  background: var(--color-bg-page) !important;
  padding: 1.5rem clamp(0.875rem, 3vw, 1.5rem);
}

.theme-dashboard-dark .container {
  background: transparent;
  min-width: 0;
}

.theme-dashboard-dark .container.app-container {
  max-width: min(1800px, 100%) !important;
  min-width: 0;
}

.theme-dashboard-dark .box,
.theme-dashboard-dark .card,
.theme-dashboard-dark .panel,
.theme-dashboard-dark .content,
.theme-dashboard-dark .columns,
.theme-dashboard-dark .column,
.theme-dashboard-dark .table-container,
.theme-dashboard-dark pre {
  max-width: 100%;
  min-width: 0;
}

.theme-dashboard-dark pre {
  overflow-x: auto;
}

/* ============================================
   Sticky Elements
   ============================================ */

.theme-dashboard-dark .sticky-header {
  position: sticky;
  top: 0;
  background: var(--color-bg-surface-elevated) !important;
  border-bottom: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-subtle);
  z-index: 10;
  padding: 1rem 0;
}

/* ============================================
   Utility Classes
   ============================================ */

.theme-dashboard-dark .pagination-summary {
  color: var(--color-text-secondary) !important;
  font-size: var(--font-size-sm);
}

.theme-dashboard-dark .doc-hint {
  color: var(--color-accent-blue) !important;
  font-size: 0.8rem;
  margin-left: 0.25rem;
  cursor: help;
}

.theme-dashboard-dark .doc-hint:hover {
  color: var(--color-primary-base) !important;
}

/* Links */
.theme-dashboard-dark a {
  color: var(--color-accent-blue);
  transition: color 0.15s ease;
}

.theme-dashboard-dark a:hover {
  color: var(--color-primary-base);
}

.theme-dashboard-dark a.has-text-weight-semibold {
  color: var(--color-text-primary);
}

.theme-dashboard-dark a.has-text-weight-semibold:hover {
  color: var(--color-accent-blue);
}

/* ============================================
   Address / Hash Display
   ============================================ */

.theme-dashboard-dark .address,
.theme-dashboard-dark .hash,
.theme-dashboard-dark .ca {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  word-break: break-all;
}

.theme-dashboard-dark .address:hover,
.theme-dashboard-dark .hash:hover,
.theme-dashboard-dark .ca:hover {
  color: var(--color-text-primary);
}

/* ============================================
   Custom Tooltip
   ============================================ */

.theme-dashboard-dark .custom-tooltip {
  background: var(--color-bg-surface-elevated) !important;
  color: var(--color-text-primary) !important;
  box-shadow: var(--shadow-subtle), 0 0 0 1px var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-size: var(--font-size-sm);
  line-height: 1.4;
  max-width: 300px;
  min-width: 150px;
  z-index: 10000;
}

.theme-dashboard-dark .custom-tooltip::before {
  border-top-color: var(--color-bg-surface-elevated);
}

/* ============================================
   Docs Page Specific
   ============================================ */

.theme-dashboard-dark .docs-toc,
.theme-dashboard-dark .sticky-menu {
  background: var(--color-bg-surface) !important;
  color: var(--color-text-primary) !important;
  border-color: var(--color-border-subtle) !important;
  box-shadow: var(--shadow-subtle) !important;
  border-radius: var(--radius-md);
}

.theme-dashboard-dark .docs-toc a {
  color: var(--color-text-secondary) !important;
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  margin: 0.25rem 0;
}

.theme-dashboard-dark .docs-toc a:hover {
  color: var(--color-primary-base) !important;
  background: var(--color-primary-soft) !important;
}

.theme-dashboard-dark .menu-label {
  color: var(--color-text-primary) !important;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border-subtle);
}

.theme-dashboard-dark .doc-anchor-label {
  color: var(--color-accent-blue) !important;
  background: var(--color-status-neutral-soft) !important;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
  display: inline-block;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-xs);
}

.theme-dashboard-dark .card-section {
  background: var(--color-bg-surface) !important;
  border-color: var(--color-border-subtle) !important;
  box-shadow: var(--shadow-subtle) !important;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.theme-dashboard-dark .card-section:hover {
  border-color: var(--color-border-strong) !important;
}

.theme-dashboard-dark .doc-section h2,
.theme-dashboard-dark .doc-section h3,
.theme-dashboard-dark .doc-section h4 {
  color: var(--color-text-primary) !important;
  font-weight: var(--font-weight-semibold);
}

.theme-dashboard-dark .doc-section h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-left: 3px solid var(--color-primary-base);
  padding-left: 1rem;
}

.theme-dashboard-dark .doc-section p {
  color: var(--color-text-primary) !important;
  line-height: 1.7;
}

.theme-dashboard-dark .doc-section ul li,
.theme-dashboard-dark .doc-section ol li {
  color: var(--color-text-secondary) !important;
  line-height: 1.6;
}

.theme-dashboard-dark .doc-section code {
  background: var(--color-bg-surface-subtle) !important;
  color: var(--color-accent-blue) !important;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
  font-size: 0.9em;
  border: 1px solid var(--color-border-subtle);
  font-family: var(--font-family-mono);
}

.theme-dashboard-dark .doc-section a {
  color: var(--color-accent-blue) !important;
  text-decoration: underline;
  text-decoration-color: rgba(34, 211, 238, 0.3);
  transition: all 0.15s ease;
}

.theme-dashboard-dark .doc-section a:hover {
  color: var(--color-primary-base) !important;
  text-decoration-color: var(--color-primary-base);
}

/* ============================================
   Fix any remaining hardcoded colors
   ============================================ */

.theme-dashboard-dark [style*="background: #fff"],
.theme-dashboard-dark [style*="background:#fff"],
.theme-dashboard-dark [style*="background: white"],
.theme-dashboard-dark [style*="background:white"] {
  background: var(--color-bg-surface) !important;
  color: var(--color-text-primary) !important;
}

.theme-dashboard-dark [style*="color: #"],
.theme-dashboard-dark [style*="color:#"] {
  /* Let inline styles override, but ensure visibility */
}

/* Ensure all text elements are visible */
.theme-dashboard-dark li,
.theme-dashboard-dark ul,
.theme-dashboard-dark ol {
  color: var(--color-text-primary);
}

.theme-dashboard-dark .menu-list a {
  color: var(--color-text-secondary) !important;
}

.theme-dashboard-dark .menu-list a:hover {
  color: var(--color-primary-base) !important;
}

/* ============================================
   Wallet Summary Strip
   ============================================ */

.theme-dashboard-dark .wallet-detail-hero {
  padding: 1rem 1.15rem 1.15rem !important;
}

.wallet-detail-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.wallet-back-link {
  padding-left: 0 !important;
}

.wallet-action-row {
  justify-content: flex-end;
  margin-bottom: 0 !important;
}

.wallet-identity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 34%);
  gap: 1rem;
  align-items: start;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.wallet-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem !important;
  line-height: 1.15;
}

.wallet-full-address {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.wallet-status-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.wallet-behavior-tag {
  cursor: help;
}

.wallet-behavior-tag:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(88, 151, 215, 0.35);
}

.wallet-kpi-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) repeat(7, minmax(112px, 1fr));
  gap: 0;
  margin-top: 1rem;
  overflow-x: auto;
}

.wallet-kpi {
  min-height: 76px;
  padding: 0.35rem 0.8rem;
  border-right: 1px solid var(--color-border-subtle);
}

.wallet-kpi:first-child {
  padding-left: 0;
}

.wallet-kpi:last-child {
  border-right: 0;
  padding-right: 0;
}

.wallet-kpi-primary .summary-value {
  font-size: 1.25rem !important;
}

.wallet-kpi-note {
  display: block;
  margin-top: 0.2rem;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: 1.25;
}

.wallet-kpi-freshness .summary-value {
  font-size: var(--font-size-md) !important;
}

.theme-dashboard-dark .wallet-shadow-panel {
  border-color: rgba(255, 210, 48, 0.18) !important;
}

.wallet-shadow-panel .level {
  gap: 1rem;
}

.wallet-shadow-panel .level-right p {
  max-width: 40rem;
  overflow-wrap: anywhere;
}

.wallet-summary-strip {
  margin-bottom: 0.5rem !important;
}

.wallet-summary-strip .box.summary-metric {
  padding: 0.75rem 1rem !important;
  margin-bottom: 0 !important;
  text-align: center;
}

.wallet-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--color-border);
}

.wallet-section-heading {
  min-width: 0;
}

.wallet-section-heading .tags {
  margin-bottom: 0;
}

.wallet-section-kicker {
  margin-bottom: 0.2rem;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.wallet-section-title {
  margin-bottom: 0.25rem !important;
  line-height: 1.15;
}

.wallet-section-description {
  max-width: 58rem;
  margin-bottom: 0 !important;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: 1.45;
}

.wallet-section-meta,
.wallet-section-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  min-width: 0;
}

.wallet-section-meta .wallet-section-description {
  max-width: 42rem;
  overflow-wrap: anywhere;
  text-align: right;
}

.wallet-section-count {
  color: var(--color-text-secondary) !important;
  font-family: var(--font-family-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wallet-table-note {
  margin-bottom: 0.85rem;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.wallet-inline-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.wallet-empty-state {
  margin-bottom: 0 !important;
  padding: 0.95rem 1rem !important;
  border: 1px dashed var(--color-border);
  background: var(--color-bg-surface-subtle) !important;
  color: var(--color-text-muted) !important;
  font-size: var(--font-size-sm);
  line-height: 1.45;
}

.wallet-callout {
  margin-bottom: 1rem !important;
  padding: 0.75rem 0.85rem !important;
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface-subtle) !important;
  color: var(--color-text-secondary) !important;
  font-size: var(--font-size-xs);
  line-height: 1.45;
}

.theme-dashboard-dark .wallet-callout.is-warning {
  border-color: rgba(255, 210, 48, 0.18) !important;
  background: var(--color-status-warning-soft) !important;
}

.wallet-chart-help {
  margin-bottom: 0.5rem !important;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.wallet-chart-frame {
  position: relative;
  height: 260px;
}

.wallet-chart-frame.is-compact {
  height: 240px;
}

.wallet-subsection-title {
  margin-top: 1.5rem !important;
}

.wallets-list-head {
  margin-bottom: 1rem;
}

.wallet-list-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 1rem;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-border-subtle);
}

.wallet-list-summary-item {
  min-width: 0;
  padding: 0.7rem 0.85rem;
  background: var(--color-bg-surface-subtle);
}

.wallet-list-summary-label,
.wallet-list-result-label,
.wallet-list-active-filter-label {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.wallet-list-summary-value {
  display: block;
  overflow: hidden;
  color: var(--color-text-primary);
  font-family: var(--font-family-mono);
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-list-filter-panel {
  margin-bottom: 1rem;
  padding: 0.95rem 1rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-surface-subtle);
}

.wallet-list-filter-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border-subtle);
}

.wallet-list-active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border-subtle);
}

.wallet-list-active-filter-label {
  margin-right: 0.15rem;
  margin-bottom: 0;
}

.wallet-list-active-filter {
  max-width: min(20rem, 100%);
  border-color: var(--color-border-subtle) !important;
  color: var(--color-text-secondary) !important;
  font-size: var(--font-size-xs) !important;
}

.wallet-list-active-filter code {
  display: inline-block;
  max-width: 12rem;
  overflow: hidden;
  color: var(--color-text-primary) !important;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.wallet-list-filter-grid {
  margin-top: 0.75rem !important;
}

.wallet-list-filter-actions,
.wallet-list-actions,
.wallet-list-risk-stack,
.wallet-list-flags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.wallet-list-filter-actions {
  justify-content: flex-end;
  min-width: fit-content;
}

.wallets-list-table th,
.wallets-list-table td {
  vertical-align: middle !important;
}

.wallets-list-table {
  min-width: 1120px;
}

.wallets-list-table thead th {
  white-space: nowrap;
}

.wallets-list-table tbody td {
  border-color: var(--color-border-subtle) !important;
}

.wallets-list-address {
  max-width: 12rem;
}

.wallet-list-number {
  font-variant-numeric: tabular-nums;
}

.wallet-list-mini-note {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  white-space: nowrap;
}

.wallet-list-last-seen {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  white-space: nowrap;
}

.wallet-list-flags {
  min-width: 9rem;
}

.wallet-list-actions {
  flex-wrap: nowrap;
}

.wallet-list-result-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-surface-subtle);
}

.wallet-list-result-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 0.75rem;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.wallet-list-result-meta span {
  white-space: nowrap;
}

.wallets-list-empty code {
  color: var(--color-text-secondary);
}

.wallet-list-empty-title {
  margin-bottom: 0.25rem !important;
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
}

.wallet-list-empty-copy {
  margin-bottom: 0 !important;
}

.wallet-list-empty-action {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.wallets-list-pagination-summary {
  margin-top: 1rem;
}

.summary-label {
  font-size: var(--font-size-xs) !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted) !important;
  margin-bottom: 0.25rem !important;
}

.summary-value {
  font-size: var(--font-size-lg) !important;
  font-weight: var(--font-weight-semibold) !important;
  margin: 0 !important;
}

@media (max-width: 1023px) {
  .wallet-identity-row {
    grid-template-columns: 1fr;
  }

  .wallet-status-stack {
    justify-content: flex-start;
  }

  .wallet-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow-x: visible;
    background: var(--color-border-subtle);
  }

  .wallet-kpi,
  .wallet-kpi:first-child,
  .wallet-kpi:last-child {
    padding: 0.65rem 0.75rem;
    border-right: 0;
    background: var(--color-bg-surface);
  }
}

@media (max-width: 640px) {
  .wallet-detail-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .wallet-action-row {
    justify-content: flex-start;
  }

  .wallet-kpi-grid {
    grid-template-columns: 1fr;
  }

  .wallet-shadow-panel .level {
    display: block;
  }

  .wallet-shadow-panel .level-right {
    justify-content: flex-start;
    margin-top: 0.75rem;
    text-align: left !important;
  }

  .wallet-section-head {
    flex-direction: column;
  }

  .wallet-section-meta,
  .wallet-section-actions {
    justify-content: flex-start;
  }

  .wallet-section-meta .wallet-section-description {
    text-align: left;
  }

  .wallet-list-filter-toolbar {
    flex-direction: column;
  }

  .wallet-list-filter-actions {
    justify-content: flex-start;
  }

  .wallet-list-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallet-list-result-note,
  .wallet-list-result-meta {
    justify-content: flex-start;
  }
}

/* ============================================
   Detail Label (replaces inline styles)
   ============================================ */

.detail-label {
  font-weight: 500;
  color: var(--color-text-secondary);
  width: 160px;
  white-space: nowrap;
  cursor: help;
}

/* ============================================
   Copy Button
   ============================================ */

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  color: var(--color-text-muted);
  opacity: 0.5;
  transition: opacity 0.15s;
  vertical-align: middle;
}

.copy-btn:hover {
  opacity: 1;
  color: var(--color-primary-base);
}

.copy-btn.copied {
  opacity: 1;
  color: var(--color-pnl-positive);
}

.wallet-address-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ============================================
   Risk Mismatch Indicator
   ============================================ */

.risk-mismatch {
  display: inline-block;
  font-size: 0.7em;
  padding: 0.1em 0.4em;
  border-radius: var(--radius-xs);
  background: var(--color-status-warning-soft);
  color: var(--color-status-warning);
  margin-left: 0.25rem;
  font-weight: 500;
}

/* ============================================
   Code Block (for ML explainer)
   ============================================ */

.theme-dashboard-dark .code-block {
  background: var(--color-bg-surface-subtle);
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85em;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-subtle);
}

/* ============================================
   Shared Term Tooltips
   ============================================ */

.term-tooltip {
  cursor: help;
  text-decoration: underline dotted rgba(57, 74, 92, 0.45);
  text-underline-offset: 3px;
}

.term-tooltip:hover,
.term-tooltip:focus {
  color: var(--accent-dark);
  text-decoration-color: var(--accent);
  outline: none;
}

.term-tooltip:focus-visible {
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(39, 128, 227, 0.25);
}

.theme-dashboard-dark .term-tooltip {
  text-decoration: underline dotted rgba(213, 209, 205, 0.45);
}

.theme-dashboard-dark th .term-tooltip,
.theme-dashboard-dark td .term-tooltip {
  color: inherit;
}

.theme-dashboard-dark .term-tooltip:hover,
.theme-dashboard-dark .term-tooltip:focus {
  color: var(--color-text-primary);
  text-decoration-color: var(--color-accent-blue);
  outline: none;
}

.theme-dashboard-dark .term-tooltip:focus-visible {
  border-radius: var(--radius-xs);
  box-shadow: 0 0 0 2px rgba(88, 151, 215, 0.35);
}

.token-kv-table {
  table-layout: fixed;
}

.token-kv-table th:first-child,
.token-kv-table td:first-child {
  width: 34%;
}

.token-kv-table th,
.token-kv-table td {
  vertical-align: top;
}

.token-inline-reference {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* ============================================
   Signal Detail Page
   ============================================ */

.theme-dashboard-dark .signal-detail-page {
  display: grid;
  gap: 1.35rem;
}

.theme-dashboard-dark .signal-detail-header {
  margin-bottom: 0;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--color-border);
}

.theme-dashboard-dark .signal-detail-page .subtitle {
  margin-top: 0.2rem;
  color: var(--color-text-muted) !important;
}

.theme-dashboard-dark .signal-metric-card {
  height: 100%;
  min-height: 104px;
  padding: 0.95rem 1.1rem;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-border-strong);
  border-radius: var(--radius-md);
}

.theme-dashboard-dark .signal-metric-card .heading {
  margin-bottom: 0.45rem;
  color: var(--color-text-muted) !important;
  font-size: var(--font-size-xs);
  letter-spacing: 0.04em;
}

.theme-dashboard-dark .signal-metric-card .title {
  margin-bottom: 1rem;
  color: var(--color-text-primary) !important;
  line-height: 1;
}

.theme-dashboard-dark .signal-metric-card .is-size-7 {
  color: var(--color-text-secondary);
}

.theme-dashboard-dark .signal-metric-score {
  border-left-color: var(--color-primary-base);
}

.theme-dashboard-dark .signal-metric-live {
  border-left-color: var(--color-pnl-positive);
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.08), var(--color-bg-surface) 42%);
}

.theme-dashboard-dark .signal-metric-stale {
  border-left-color: var(--color-status-warning);
  background: linear-gradient(90deg, rgba(255, 210, 48, 0.08), var(--color-bg-surface) 42%);
}

.theme-dashboard-dark .signal-metric-age {
  border-left-color: var(--color-accent-blue);
}

.theme-dashboard-dark .signal-metric-paper {
  border-left-color: var(--color-accent-teal);
}

.theme-dashboard-dark .signal-callout {
  height: 100%;
  overflow: hidden;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.theme-dashboard-dark .signal-callout .message-header {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.75rem 1rem;
  background: var(--color-bg-surface-elevated);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
}

.theme-dashboard-dark .signal-callout .message-header p {
  color: inherit;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
}

.theme-dashboard-dark .signal-callout .message-body {
  min-height: 96px;
  padding: 1rem 1.15rem;
  border: 0;
  color: var(--color-text-secondary);
  line-height: 1.55;
}

.theme-dashboard-dark .signal-callout .message-body ul {
  margin-left: 1.05rem;
  color: inherit;
}

.theme-dashboard-dark .signal-callout .message-body li {
  color: inherit;
}

.theme-dashboard-dark .signal-callout .message-body li + li {
  margin-top: 0.35rem;
}

.theme-dashboard-dark .signal-callout-positive {
  border-color: rgba(34, 197, 94, 0.32);
}

.theme-dashboard-dark .signal-callout-positive .message-header {
  background: rgba(34, 197, 94, 0.13);
  color: #90e8b1;
}

.theme-dashboard-dark .signal-callout-positive .message-body {
  background: rgba(34, 197, 94, 0.045);
}

.theme-dashboard-dark .signal-callout-risk {
  border-color: rgba(255, 210, 48, 0.34);
}

.theme-dashboard-dark .signal-callout-risk .message-header {
  background: rgba(255, 210, 48, 0.13);
  color: #ffe58a;
}

.theme-dashboard-dark .signal-callout-risk .message-body {
  background: rgba(255, 210, 48, 0.045);
}

.theme-dashboard-dark .signal-callout-unknown {
  border-color: rgba(88, 151, 215, 0.34);
}

.theme-dashboard-dark .signal-callout-unknown .message-header {
  background: rgba(88, 151, 215, 0.15);
  color: #9fc8f1;
}

.theme-dashboard-dark .signal-callout-unknown .message-body {
  background: rgba(88, 151, 215, 0.05);
}

.theme-dashboard-dark .signal-panel {
  height: 100%;
  padding: 1.25rem 1.35rem;
}

.theme-dashboard-dark .signal-panel > .title {
  margin-bottom: 1rem;
  color: var(--color-text-primary) !important;
  font-size: var(--font-size-lg);
}

.theme-dashboard-dark .signal-kv-table {
  margin-bottom: 0;
  table-layout: fixed;
}

.theme-dashboard-dark .signal-kv-table tbody tr {
  border-left: 0;
  background: transparent !important;
}

.theme-dashboard-dark .signal-kv-table tbody tr:hover {
  background: var(--color-bg-row-hover) !important;
  border-left-color: transparent !important;
}

.theme-dashboard-dark .signal-kv-table th,
.theme-dashboard-dark .signal-kv-table td {
  padding: 0.72rem 0.9rem;
  border: 0 !important;
  border-bottom: 1px solid var(--color-border-subtle) !important;
  vertical-align: top;
}

.theme-dashboard-dark .signal-kv-table tr:last-child th,
.theme-dashboard-dark .signal-kv-table tr:last-child td {
  border-bottom: 0 !important;
}

.theme-dashboard-dark .signal-kv-table th {
  width: 34%;
  background: transparent !important;
  color: var(--color-text-muted) !important;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.theme-dashboard-dark .signal-kv-table td {
  background: transparent !important;
  color: var(--color-text-primary) !important;
}

.theme-dashboard-dark .signal-detail-page .table:not(.signal-kv-table) tbody td {
  color: var(--color-text-secondary);
}

.theme-dashboard-dark .signal-detail-page .table:not(.signal-kv-table) tbody td:first-child,
.theme-dashboard-dark .signal-detail-page .table:not(.signal-kv-table) tbody td .has-text-weight-semibold {
  color: var(--color-text-primary);
}

.theme-dashboard-dark .signal-detail-page .text-muted {
  color: var(--color-text-muted) !important;
}

.theme-dashboard-dark .signal-detail-page th .term-tooltip {
  color: var(--color-text-muted);
}

@media screen and (max-width: 768px) {
  .theme-dashboard-dark .signal-detail-header {
    align-items: flex-start !important;
  }

  .theme-dashboard-dark .signal-detail-header .level-right {
    margin-top: 0.75rem;
  }

  .theme-dashboard-dark .signal-panel {
    padding: 1rem;
  }

  .theme-dashboard-dark .signal-kv-table {
    table-layout: auto;
  }

  .theme-dashboard-dark .signal-kv-table th,
  .theme-dashboard-dark .signal-kv-table td {
    display: block;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .theme-dashboard-dark .signal-kv-table th {
    padding-bottom: 0.2rem;
    border-bottom: 0 !important;
  }

  .theme-dashboard-dark .signal-kv-table td {
    padding-top: 0;
  }
}

/* ============================================
   Mobile Layout Safety
   ============================================ */

@media screen and (max-width: 768px) {
  .theme-dashboard-dark .section {
    padding: 1rem max(0.875rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-bottom)) max(0.875rem, env(safe-area-inset-right));
  }

  .theme-dashboard-dark .container.app-container {
    width: 100%;
  }

  .theme-dashboard-dark .container.app-container .columns {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .theme-dashboard-dark .container.app-container .column {
    min-width: 0;
  }

  .theme-dashboard-dark code {
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .theme-dashboard-dark pre code {
    white-space: pre !important;
    overflow-wrap: normal;
    word-break: normal;
  }

  .theme-dashboard-dark .app-container p,
  .theme-dashboard-dark .app-container li,
  .theme-dashboard-dark .app-container strong,
  .theme-dashboard-dark .app-container a,
  .theme-dashboard-dark .app-container .title,
  .theme-dashboard-dark .app-container .subtitle {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .theme-dashboard-dark .app-container table {
    max-width: 100%;
    display: block;
    overflow-x: auto;
  }

  .theme-dashboard-dark .table-container table {
    display: table;
  }

  .theme-dashboard-dark .app-container iframe,
  .theme-dashboard-dark .app-container canvas,
  .theme-dashboard-dark .app-container img {
    max-width: 100%;
  }
}

/* ============================================
   Custom Scrollbars
   ============================================ */

/* Firefox scrollbar fallback */
.theme-dashboard-dark {
  scrollbar-color: rgba(255, 255, 255, 0.20) transparent;
  scrollbar-width: thin;
}

.theme-dashboard-dark ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.theme-dashboard-dark ::-webkit-scrollbar-track {
  background: transparent;
}

.theme-dashboard-dark ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.20);
  border: 2px solid transparent;
  border-radius: 4px;
  background-clip: content-box;
}

.theme-dashboard-dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.30);
  border: 2px solid transparent;
  background-clip: content-box;
}

/* ============================================
   Shimmer Animations
   ============================================ */

@keyframes hd-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.theme-dashboard-dark .shimmer-green {
  background: linear-gradient(
    90deg,
    rgba(92, 192, 155, 0.06) 0%,
    rgba(92, 192, 155, 0.14) 50%,
    rgba(92, 192, 155, 0.06) 100%
  );
  background-size: 200% 100%;
  animation: hd-shimmer 1.8s infinite;
}

.theme-dashboard-dark .shimmer-red {
  background: linear-gradient(
    90deg,
    rgba(212, 75, 98, 0.06) 0%,
    rgba(212, 75, 98, 0.14) 50%,
    rgba(212, 75, 98, 0.06) 100%
  );
  background-size: 200% 100%;
  animation: hd-shimmer 1.8s infinite;
}

/* ============================================
   Live Pulse Indicator
   ============================================ */

@keyframes hd-pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.theme-dashboard-dark .live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-pnl-positive);
  position: relative;
}

.theme-dashboard-dark .live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--color-pnl-positive);
  animation: hd-pulse-ring 1.5s infinite;
}
