.resultados-page {
  --resultados-surface: var(--resumo-surface);
  --resultados-surface-2: var(--resumo-surface-2);
  --resultados-border: var(--resumo-border);
  --resultados-border-strong: var(--resumo-border-strong);
  --resultados-title: var(--resumo-title);
  --resultados-label: var(--resumo-label);
  --resultados-muted: var(--resumo-muted);
  --resultados-positive: var(--resumo-positive);
  --resultados-negative: var(--resumo-negative);
  --resultados-accent: #49d19a;
  --resultados-accent-soft: rgba(75, 205, 149, 0.12);
  --resultados-accent-border: rgba(75, 205, 149, 0.45);
  --resultados-focus: var(--resumo-focus, rgba(75, 205, 149, 0.12));
  --resultados-hover: rgba(255, 255, 255, 0.04);
  --resultados-active: rgba(255, 255, 255, 0.06);
  --resultados-table-head: rgba(16, 18, 22, 0.98);
  --resultados-table-cell: rgba(255, 255, 255, 0.02);
  --resultados-table-cell-alt: rgba(255, 255, 255, 0.03);
  --resultados-axis: #afb6c5;
  --resultados-grid: rgba(255, 255, 255, 0.08);
  --resultados-chart-series: #b7c7be;
  --resultados-chart-average: #f2c84b;
  --resultados-tooltip-bg: #0f1317;
  --resultados-tooltip-text: #f5f7fa;
  --resultados-tooltip-border: rgba(255, 255, 255, 0.12);
  --resultados-logo-surface: #ffffff;
  --resultados-card-shadow: var(--resumo-shadow);
}

body.light-mode .resultados-page,
[data-theme="light"] .resultados-page,
body.light .resultados-page,
[data-bs-theme="light"] .resultados-page {
  --resultados-accent: #15794f;
  --resultados-accent-soft: rgba(21, 121, 79, 0.1);
  --resultados-accent-border: rgba(21, 121, 79, 0.35);
  --resultados-hover: rgba(16, 24, 40, 0.03);
  --resultados-active: rgba(16, 24, 40, 0.05);
  --resultados-table-head: rgba(255, 255, 255, 0.95);
  --resultados-table-cell: rgba(8, 9, 10, 0.02);
  --resultados-table-cell-alt: rgba(8, 9, 10, 0.04);
  --resultados-axis: #536072;
  --resultados-grid: rgba(16, 24, 40, 0.1);
  --resultados-chart-series: #7f948a;
  --resultados-chart-average: #d79d0d;
  --resultados-tooltip-bg: #ffffff;
  --resultados-tooltip-text: #101828;
  --resultados-tooltip-border: rgba(8, 9, 10, 0.12);
  --resultados-logo-surface: #f7f8fb;
}

.resultados-title-row {
  align-items: flex-end;
}

.resultados-content-shell {
  position: relative;
  min-height: 320px;
}

.resultados-content-shell.is-loading > *:not(.resultados-shell-loader) {
  opacity: 0.28;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.resultados-shell-loader {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  padding-top: 10px;
  z-index: 4;
}

.resultados-shell-loader-card {
  height: 72px;
  border-radius: 16px;
  border: 1px solid var(--resultados-border);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: resultados-shimmer 1.8s linear infinite;
}

.resultados-shell-loader-short {
  height: 220px;
}

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

  100% {
    background-position: -200% 0;
  }
}

.resultados-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.resultados-table-section,
.resultados-related {
  border-radius: 12px;
  border: 1px solid var(--resultados-border);
  background: var(--resultados-surface);
  box-shadow: var(--resultados-card-shadow);
}

.resultados-controls-panel {
  padding: 14px 14px 0;
}

.resultados-controls-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.resultados-select-group,
.resultados-range-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.resultados-range-label,
.resultados-toolbar-label {
  color: var(--resultados-label);
  font-size: 14px;
  font-weight: 500;
}

.resultados-select {
  min-width: 150px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--resultados-border);
  background: var(--resultados-surface-2);
  color: var(--resultados-title);
  padding: 0 14px;
  font-size: 13px;
}

.resultados-select:focus {
  outline: none;
  border-color: var(--resultados-accent-border);
  box-shadow: 0 0 0 4px var(--resultados-focus);
}

.resultados-select-small {
  min-width: 92px;
}

.resultados-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0 14px;
}

.resultados-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.resultados-action-btn,
.resultados-column-menu-btn,
.resultados-chart-toggle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--resultados-border);
  background: transparent;
  color: var(--resultados-label);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.resultados-action-btn:hover,
.resultados-column-menu-btn:hover,
.resultados-chart-toggle:hover,
.resultados-chart-toggle.is-active {
  border-color: var(--resultados-accent-border);
  background: var(--resultados-accent-soft);
  color: var(--resultados-accent);
  transform: translateY(-1px);
}

.resultados-action-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.resultados-action-btn:focus-visible,
.resultados-column-menu-btn:focus-visible,
.resultados-chart-toggle:focus-visible,
.resultados-header-trigger:focus-visible,
.resultados-cell-trigger:focus-visible,
.resultados-pagination-btn:focus-visible,
.resultados-primary-btn:focus-visible,
.resultados-secondary-btn:focus-visible,
.resultados-modal-close:focus-visible {
  outline: none;
  border-color: var(--resultados-accent-border);
  box-shadow: 0 0 0 4px var(--resultados-focus);
}

.resultados-columns-menu {
  min-width: 220px;
  padding: 8px;
}

.resultados-dropdown-menu {
  border-radius: 14px;
  border: 1px solid var(--resultados-border);
  background: var(--resultados-surface);
  box-shadow: var(--resultados-card-shadow);
  padding: 8px;
}

.resultados-dropdown-menu .dropdown-item {
  border-radius: 10px;
  color: var(--resultados-title);
}

.resultados-dropdown-menu .dropdown-item:hover,
.resultados-dropdown-menu .dropdown-item:focus {
  background: var(--resultados-hover);
  color: var(--resultados-title);
}

.resultados-column-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
}

.resultados-column-toggle .form-check-input:checked {
  background-color: var(--resultados-accent);
  border-color: var(--resultados-accent);
}

.resultados-column-toggle .form-check-input {
  margin: 0;
}

.resultados-table-shell {
  border-top: 1px solid var(--resultados-border);
}

.resultados-table-scroll {
  overflow: auto;
  max-height: 560px;
}

.resultados-table {
  width: max-content;
  min-width: 1480px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.resultados-table col.resultados-col-period {
  width: 240px;
}

.resultados-table col.resultados-col-metric {
  width: 210px;
}

.resultados-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 14px;
  border-bottom: 1px solid var(--resultados-border);
  border-right: 1px solid var(--resultados-border);
  background: var(--resultados-table-head);
  color: var(--resultados-title);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.resultados-table thead th:first-child {
  left: 0;
  z-index: 7;
  background: transparent;
  isolation: isolate;
}

.resultados-table thead th:first-child,
.resultados-table tbody td:first-child {
  width: 240px;
  min-width: 240px;
  max-width: 240px;
}

.resultados-table thead th:not(:first-child),
.resultados-table tbody td:not(:first-child) {
  width: 210px;
  min-width: 210px;
}

.resultados-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--resultados-border);
  border-right: 1px solid var(--resultados-border);
  background: var(--resultados-table-cell);
  color: var(--resultados-title);
  font-size: 13px;
  font-weight: 600;
  vertical-align: middle;
  white-space: nowrap;
}

.resultados-table tbody tr:nth-child(even) td {
  background: var(--resultados-table-cell-alt);
}

.resultados-table tbody tr:hover td {
  background: var(--resultados-hover);
}

.resultados-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 6;
  background: transparent;
  background-clip: padding-box;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 1px 0 0 var(--resultados-border);
}

.resultados-table thead th:first-child {
  box-shadow: 1px 0 0 var(--resultados-border);
}

.resultados-table thead th:first-child::before,
.resultados-table tbody td:first-child::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}

.resultados-table thead th:first-child::before {
  background: var(--resultados-table-head);
}

.resultados-table tbody td:first-child::before {
  background: var(--resultados-surface);
}

.resultados-table thead th:first-child > *,
.resultados-table tbody td:first-child > * {
  position: relative;
  z-index: 1;
}

.resultados-table thead th:first-child .resultados-th-inner {
  width: 100%;
  box-sizing: border-box;
}

.resultados-th-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.resultados-header-trigger,
.resultados-cell-trigger {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  text-align: left;
  white-space: nowrap;
}

.resultados-header-trigger:hover,
.resultados-cell-trigger:hover {
  color: var(--resultados-accent);
}

.resultados-period-cell {
  min-width: 130px;
  white-space: nowrap;
  box-sizing: border-box;
}

.resultados-period-cell-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.resultados-period-cell-inner > span {
  display: inline-block;
  vertical-align: middle;
}

.resultados-cell-value {
  white-space: nowrap;
}

.resultados-partial-badge {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 8px;
  border-radius: 999px;
  border: 1px solid #f2c84b;
  color: #f2c84b;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.resultados-cell-value.is-negative,
.resultados-cell-trigger.is-negative {
  color: var(--resultados-negative);
}

.resultados-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--resultados-muted);
  font-size: 15px;
}

.resultados-shell-error {
  border-radius: 16px;
  border: 1px solid rgba(234, 75, 106, 0.22);
  background: rgba(234, 75, 106, 0.08);
  color: var(--resultados-title);
}

.resultados-table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  flex-wrap: wrap;
}

.resultados-count-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.resultados-count-pill,
.resultados-market-pill {
  border-radius: 999px;
  border: 1px solid var(--resultados-border);
  background: var(--resultados-surface-2);
  color: var(--resultados-label);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
}

.resultados-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
}

.resultados-pagination-current {
  min-width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--resultados-border);
  background: var(--resultados-surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--resultados-title);
  font-size: 14px;
  font-weight: 700;
}

.resultados-pagination-text {
  color: var(--resultados-label);
  font-size: 14px;
  font-weight: 600;
}

.resultados-pagination-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--resultados-border);
  background: var(--resultados-surface-2);
  color: var(--resultados-title);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.resultados-pagination-btn:disabled {
  opacity: 0.42;
}

.resultados-section-title {
  padding: 18px 18px 8px;
  color: var(--resultados-title);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.resultados-related-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  padding: 8px 18px 18px;
}

.resultados-related-card {
  color: var(--resultados-title);
  text-decoration: none;
}

.resultados-related-card-media {
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  border: 1px solid var(--resultados-border);
  background: var(--resultados-logo-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
  margin-bottom: 10px;
}

.resultados-related-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.resultados-related-card-ticker {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--resultados-title);
}

.resultados-related-card-name {
  display: block;
  color: var(--resultados-muted);
  font-size: 13px;
  line-height: 1.3;
}

.resultados-aux-modal-content,
.resultados-detail-modal-content {
  border-radius: 18px;
  border: 1px solid var(--resultados-border-strong);
  background: var(--resultados-surface);
  color: var(--resultados-title);
  overflow: hidden;
}

.resultados-aux-modal-content .modal-header,
.resultados-detail-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--resultados-border);
}

.resultados-aux-modal-content .modal-footer,
.resultados-detail-modal-footer {
  border-top: 1px solid var(--resultados-border);
}

.resultados-filter-input {
  border-radius: 12px;
  border: 1px solid var(--resultados-border);
  background: var(--resultados-surface-2);
  color: var(--resultados-title);
}

.resultados-filter-input:focus {
  border-color: var(--resultados-accent-border);
  box-shadow: 0 0 0 4px var(--resultados-focus);
  background: var(--resultados-surface-2);
  color: var(--resultados-title);
}

.resultados-filter-helper {
  color: var(--resultados-muted);
  margin: 0;
  font-size: 13px;
}

.resultados-primary-btn,
.resultados-secondary-btn {
  min-height: 42px;
  border-radius: 12px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
}

.resultados-primary-btn {
  border: 1px solid var(--resultados-accent-border);
  background: var(--resultados-accent);
  color: #071b12;
}

.resultados-primary-btn:hover {
  filter: brightness(1.02);
  color: #071b12;
}

.resultados-secondary-btn {
  border: 1px solid var(--resultados-border);
  background: var(--resultados-surface-2);
  color: var(--resultados-title);
}

.resultados-secondary-btn:hover {
  background: var(--resultados-hover);
  color: var(--resultados-title);
}

.resultados-modal-close {
  filter: invert(1) grayscale(1) brightness(200%);
  opacity: 0.9;
}

body.light-mode .resultados-page .resultados-modal-close,
[data-theme="light"] .resultados-page .resultados-modal-close,
body.light .resultados-page .resultados-modal-close,
[data-bs-theme="light"] .resultados-page .resultados-modal-close {
  filter: none;
}

.resultados-detail-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.resultados-detail-modal-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--resultados-accent-border);
  background: var(--resultados-accent-soft);
  color: var(--resultados-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.resultados-detail-modal-body {
  padding: 0;
}

.resultados-detail-loading {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.resultados-detail-skeleton {
  border-radius: 16px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: resultados-shimmer 1.8s linear infinite;
}

.resultados-detail-skeleton-metrics {
  height: 120px;
}

.resultados-detail-skeleton-chart {
  height: 320px;
}

.resultados-detail-error {
  margin: 22px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(234, 75, 106, 0.32);
  background: rgba(234, 75, 106, 0.12);
  color: var(--resultados-title);
}

.resultados-detail-content {
  display: flex;
  flex-direction: column;
}

.resultados-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--resultados-border);
}

.resultados-detail-metric {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resultados-detail-metric span {
  color: var(--resultados-label);
  font-size: 13px;
}

.resultados-detail-metric strong {
  color: var(--resultados-title);
  font-size: 18px;
  line-height: 1.1;
}

.resultados-detail-chart-wrap {
  padding: 18px;
}

.resultados-detail-chart-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 18px;
}

.resultados-detail-canvas-wrap {
  height: 320px;
  border-radius: 16px;
  border: 1px solid var(--resultados-border);
  background: var(--resultados-surface-2);
  padding: 14px;
}

.resultados-detail-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.resultados-detail-modal-footer {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.resultados-detail-history {
  color: var(--resultados-muted);
  font-size: 14px;
}

.resultados-detail-close-btn {
  min-width: 120px;
}

.resultados-pagination-btn:hover:not(:disabled) {
  background: var(--resultados-hover);
}

@media (max-width: 991px) {
  .resultados-related-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

@media (max-width: 767px) {
  .resultados-title-row,
  .resultados-controls-row,
  .resultados-toolbar,
  .resultados-table-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .resultados-select-group,
  .resultados-range-group,
  .resultados-toolbar-actions {
    width: 100%;
  }

  .resultados-select,
  .resultados-select-small {
    flex: 1;
    min-width: 0;
  }

  .resultados-toolbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .resultados-table {
    min-width: 760px;
  }

  .resultados-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 16px;
  }

  .resultados-detail-metrics {
    grid-template-columns: 1fr;
  }

  .resultados-detail-canvas-wrap {
    height: 280px;
  }

  .resultados-detail-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .resultados-detail-close-btn {
    width: 100%;
  }
}
