

.badge-muted {
  background: rgba(53, 80, 111, 0.12);
  color: var(--text-700);
}

.surface-muted {
  background: var(--surface-muted);
}

.trade-ticket-section {
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
}

.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-500);
  font-size: 0.92rem;
}

.danger-zone {
  border: 1px solid rgba(195, 63, 54, 0.18);
  background: rgba(255, 244, 243, 0.85);
}

.list-compact {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding-left: 1rem;
}

.app-toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(360px, calc(100vw - 24px));
}

.app-toast {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(215, 226, 240, 0.9);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 32px rgba(16, 42, 86, 0.18);
  animation: toast-in 0.18s ease-out;
}

.app-toast__body {
  min-width: 0;
}

.app-toast__title {
  margin: 0 0 0.15rem;
  font-size: 0.92rem;
  font-weight: 800;
}

.app-toast__message {
  margin: 0;
  color: var(--text-700);
  font-size: 0.92rem;
  line-height: 1.45;
}

.app-toast__close {
  min-width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-500);
  font-size: 1.1rem;
}

.app-toast--success {
  border-color: rgba(31, 143, 87, 0.22);
}

.app-toast--danger {
  border-color: rgba(195, 63, 54, 0.24);
}

.app-toast--warning {
  border-color: rgba(181, 114, 7, 0.24);
}

.app-toast--success .app-toast__title {
  color: var(--success-600);
}

.app-toast--danger .app-toast__title {
  color: var(--danger-600);
}

.app-toast--warning .app-toast__title {
  color: var(--warning-600);
}

.app-toast--info .app-toast__title {
  color: var(--brand-700);
}

.app-confirm__message {
  color: var(--text-700);
  line-height: 1.55;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 991.98px) {
  .page-hero {
    padding: 0.52rem 0.62rem;
  }

  .card-body,
  .card-header {
    padding-inline: 0.62rem;
  }

  .toolbar-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .split-grid,
  .workbench-grid,
  .dashboard-main-grid,
  .dashboard-hero-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 767.98px) {
  body {
    background-size: auto, auto, auto;
  }

  .page-title {
    font-size: 1.14rem;
  }

  .page-actions,
  .section-actions,
  .toolbar-row {
    width: 100%;
  }

  .page-actions .btn,
  .section-actions .btn,
  .toolbar-row .btn {
    flex: 1 1 100%;
    min-height: 36px;
  }

  .toolbar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table > :not(caption) > * > * {
    padding: 0.34rem 0.4rem;
  }

  .app-toast-stack {
    left: 12px;
    right: 12px;
    width: auto;
  }
}

@media (orientation: landscape) and (max-width: 991.98px) {
  .chart-stage {
    min-height: 360px;
  }
}

html[data-theme="dark"] body {
  background:
    radial-gradient(1200px 420px at -10% -20%, rgba(29, 78, 216, 0.28) 0%, transparent 58%),
    radial-gradient(920px 340px at 120% -15%, rgba(14, 116, 144, 0.22) 0%, transparent 56%),
    linear-gradient(180deg, #0b1522 0%, var(--page-bg) 100%);
}

html[data-theme="dark"] body::before {
  opacity: 0.16;
}

html[data-theme="dark"] .navbar {
  background: linear-gradient(90deg, rgba(15, 42, 86, 0.96), rgba(24, 77, 156, 0.92)) !important;
  border-bottom-color: rgba(103, 136, 178, 0.34);
  box-shadow: 0 10px 28px rgba(5, 15, 35, 0.38);
}

html[data-theme="dark"] .navbar .nav-link {
  color: rgba(235, 244, 255, 0.84);
}

html[data-theme="dark"] .navbar .nav-link:hover,
html[data-theme="dark"] .navbar .nav-link:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .navbar .nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

html[data-theme="dark"] .navbar-toolbar {
  color: #d7e8fb;
}

html[data-theme="dark"] .navbar .btn-outline-light {
  color: #eaf3ff;
  border-color: rgba(197, 220, 247, 0.58);
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .navbar .btn-outline-light:hover {
  color: #ffffff;
  border-color: rgba(216, 234, 255, 0.7);
  background: rgba(255, 255, 255, 0.16);
}

html[data-theme="dark"] .page-hero,
html[data-theme="dark"] .card,
html[data-theme="dark"] .app-toast,
html[data-theme="dark"] .modal-content {
  background: linear-gradient(180deg, rgba(19, 31, 47, 0.99), rgba(13, 22, 33, 0.97));
}

html[data-theme="dark"] .page-hero {
  border-color: rgba(144, 172, 206, 0.26);
}

html[data-theme="dark"] .page-hero::after,
html[data-theme="dark"] .surface-accent::before {
  background: linear-gradient(90deg, rgba(123, 184, 255, 0.92), rgba(90, 160, 255, 0.42), transparent 72%);
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
  background: linear-gradient(180deg, rgba(23, 38, 58, 0.99), rgba(16, 27, 42, 0.99));
  border-color: rgba(138, 165, 197, 0.32);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] textarea.form-control,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple {
  background: rgba(16, 26, 39, 0.98);
  color: var(--text-900);
  border-color: rgba(144, 172, 206, 0.4);
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] textarea.form-control::placeholder {
  color: #8ea8c8;
}

html[data-theme="dark"] .table-wrap {
  border: 1px solid rgba(117, 145, 177, 0.28);
  background: rgba(10, 18, 29, 0.55);
}

html[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-900);
  --bs-table-color-state: var(--text-900);
  --bs-table-color-type: var(--text-900);
  --bs-table-striped-bg: rgba(93, 132, 176, 0.1);
  --bs-table-striped-color: var(--text-900);
  --bs-table-hover-bg: rgba(59, 130, 246, 0.14);
  --bs-table-hover-color: var(--text-900);
  --bs-table-active-bg: rgba(88, 155, 238, 0.2);
  --bs-table-active-color: var(--text-900);
  --bs-table-border-color: rgba(117, 145, 177, 0.28);
  color: var(--text-900);
  background-color: rgba(15, 26, 40, 0.62);
}

html[data-theme="dark"] .table .text-dark {
  color: var(--text-900) !important;
}

html[data-theme="dark"] .table > :not(caption) > * > * {
  border-bottom-color: rgba(117, 145, 177, 0.25);
}

html[data-theme="dark"] .table thead th {
  background: rgba(24, 39, 59, 0.98);
  border-bottom-color: rgba(130, 158, 190, 0.44);
  color: var(--text-700);
  box-shadow: inset 0 -1px 0 rgba(130, 158, 190, 0.32);
}

html[data-theme="dark"] .table tbody tr:nth-child(odd) {
  background: rgba(20, 34, 52, 0.34);
}

html[data-theme="dark"] .table tbody tr:nth-child(even) {
  background: rgba(13, 24, 37, 0.22);
}

html[data-theme="dark"] .table tbody tr:hover {
  background: rgba(59, 130, 246, 0.16);
}

html[data-theme="dark"] .table tbody tr:hover > * {
  background-color: rgba(59, 130, 246, 0.22) !important;
}

html[data-theme="dark"] .danger-zone {
  background: rgba(86, 24, 22, 0.32);
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .helper-note,
html[data-theme="dark"] .form-note,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .inline-note,
html[data-theme="dark"] .card-subtitle,
html[data-theme="dark"] .status-inline,
html[data-theme="dark"] .metric-card .metric-label,
html[data-theme="dark"] .metric-card .metric-hint {
  color: var(--text-500) !important;
}

html[data-theme="dark"] .page-title,
html[data-theme="dark"] .section-heading,
html[data-theme="dark"] .metric-card .metric-value,
html[data-theme="dark"] .asset-hero__value,
html[data-theme="dark"] .kpi-mini__value,
html[data-theme="dark"] .summary-strip__value,
html[data-theme="dark"] .table,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .navbar-brand,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
  color: var(--text-900) !important;
}

html[data-theme="dark"] .metric-card .metric-value {
  text-shadow: 0 0 0 transparent, 0 2px 10px rgba(0, 0, 0, 0.16);
}

html[data-theme="dark"] .page-subtitle,
html[data-theme="dark"] .asset-hero__meta,
html[data-theme="dark"] .hero-tag,
html[data-theme="dark"] .kpi-mini__label,
html[data-theme="dark"] .summary-strip__label {
  color: var(--text-700) !important;
}

html[data-theme="dark"] .hero-tag {
  border-color: rgba(144, 172, 206, 0.34);
  background: rgba(20, 34, 50, 0.86);
}

html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .kpi-mini,
html[data-theme="dark"] .summary-strip__item {
  background:
    linear-gradient(180deg, rgba(24, 39, 58, 0.98), rgba(15, 26, 40, 0.98)),
    linear-gradient(120deg, rgba(123, 184, 255, 0.08), transparent 68%);
  border-color: rgba(144, 172, 206, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .text-success {
  color: var(--success-600) !important;
}

html[data-theme="dark"] .text-danger {
  color: var(--danger-600) !important;
}

html[data-theme="dark"] .kpi-positive {
  color: var(--ds-up) !important;
}

html[data-theme="dark"] .kpi-negative {
  color: var(--ds-down) !important;
}

html[data-theme="dark"] .badge-muted {
  background: rgba(173, 198, 228, 0.12);
  color: var(--text-700);
}

html[data-theme="dark"] .badge-soft {
  background: rgba(59, 130, 246, 0.2);
  color: var(--brand-800);
}

html[data-theme="dark"] .badge.text-bg-light,
html[data-theme="dark"] .text-bg-light {
  background: rgba(143, 197, 253, 0.12) !important;
  color: var(--text-900) !important;
  border-color: rgba(144, 172, 206, 0.34) !important;
}

html[data-theme="dark"] .bg-secondary {
  background-color: rgba(117, 145, 177, 0.78) !important;
}

html[data-theme="dark"] .table-light {
  --bs-table-bg: rgba(144, 172, 206, 0.18);
  --bs-table-color: var(--text-900);
  --bs-table-border-color: rgba(144, 172, 206, 0.34);
}

html[data-theme="dark"] .table-warning {
  --bs-table-bg: rgba(176, 126, 45, 0.24);
  --bs-table-color: #ffe6bf;
  --bs-table-border-color: rgba(232, 183, 104, 0.38);
}

html[data-theme="dark"] .btn-primary {
  border-color: #5ea4ff;
  background: linear-gradient(180deg, #3f89f2, #225dba);
}

html[data-theme="dark"] .btn-outline-primary {
  color: #dcecff;
  border-color: rgba(144, 172, 206, 0.44);
  background: rgba(31, 49, 73, 0.85);
}

html[data-theme="dark"] .btn-outline-secondary {
  color: var(--text-700);
  border-color: rgba(144, 172, 206, 0.36);
  background: rgba(28, 42, 61, 0.78);
}

html[data-theme="dark"] .btn-outline-danger {
  color: #ffd0cb;
  border-color: rgba(255, 155, 147, 0.4);
  background: rgba(72, 26, 25, 0.5);
}

html[data-theme="dark"] .btn-outline-light {
  color: var(--text-900);
  border-color: rgba(223, 236, 255, 0.42);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .btn-outline-light:hover,
html[data-theme="dark"] .btn-outline-light:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

html[data-theme="dark"] .navbar .nav-link {
  color: rgba(239, 246, 255, 0.86);
}

html[data-theme="dark"] .navbar .nav-link.active {
  background: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .table a,
html[data-theme="dark"] .page-eyebrow {
  color: var(--brand-700);
}

html[data-theme="dark"] .app-toast {
  border-color: rgba(117, 145, 177, 0.34);
}

html[data-theme="dark"] .app-toast__message,
html[data-theme="dark"] .app-confirm__message {
  color: var(--text-700);
}

html[data-theme="dark"] .theme-switch {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .btn-theme-toggle {
  color: rgba(245, 249, 255, 0.78);
}

html[data-theme="dark"] .btn-theme-toggle.is-active {
  color: #08111e;
  background: linear-gradient(180deg, rgba(245, 249, 255, 0.92), rgba(221, 234, 255, 0.84));
}

html[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(1) brightness(1.25);
  opacity: 1;
}

html[data-theme="dark"] .nav-tabs {
  border-bottom-color: rgba(117, 145, 177, 0.3);
}

html[data-theme="dark"] .nav-tabs .nav-link {
  color: var(--text-500);
  border-color: transparent;
}

html[data-theme="dark"] .nav-tabs .nav-link.active {
  color: var(--text-900);
  background: rgba(20, 32, 48, 0.95);
  border-color: rgba(117, 145, 177, 0.3) rgba(117, 145, 177, 0.3) transparent;
}

html[data-theme="dark"] .trade-ticket-section {
  background: rgba(22, 34, 51, 0.9);
  border-color: rgba(117, 145, 177, 0.32) !important;
}

html[data-theme="dark"] .select2-dropdown,
html[data-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
  background: rgba(16, 26, 39, 0.98);
  color: var(--text-900);
  border-color: rgba(144, 172, 206, 0.4);
}

html[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice {
  background: rgba(59, 130, 246, 0.2);
  color: var(--text-900);
  border-color: rgba(144, 172, 206, 0.36);
}

html[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: var(--text-700);
}

html[data-theme="dark"] canvas {
  filter: saturate(0.94) brightness(0.92);
}

.strategy-total-input,.holding-lots-input {
    min-height: 26px;
}