.toolbar-panel {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  padding: 18px;
  border-radius: var(--radius-xl);
  background: linear-gradient(
    180deg,
    rgba(8, 17, 33, 0.9),
    rgba(7, 14, 29, 0.96)
  );
  border: 1px solid rgba(58, 134, 255, 0.16);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.toolbar-panel-left,
.toolbar-panel-right {
  display: flex;
  align-items: center;
}

.filters-inline {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.filter-group select {
  min-width: 140px;
}

.primary-button,
.secondary-button,
.danger-button,
.edit-button,
.icon-button,
.transaction-form input,
.transaction-form select,
.filter-group select,
.table-filters input,
.table-filters select {
  font: inherit;
}

.primary-button,
.secondary-button,
.danger-button,
.edit-button {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  transition: 0.22s ease;
}

.primary-button {
  background: linear-gradient(135deg, #3a86ff, #00d9ff);
  color: #fff;
  box-shadow:
    0 0 20px rgba(58, 134, 255, 0.25),
    0 0 40px rgba(0, 217, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.primary-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 0 30px rgba(58, 134, 255, 0.35),
    0 0 60px rgba(0, 217, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.primary-button-lg {
  padding: 13px 20px;
  font-weight: 700;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(58, 134, 255, 0.16);
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(58, 134, 255, 0.24);
}

.secondary-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ghost-button {
  background: rgba(58, 134, 255, 0.08);
}

.edit-button {
  background: rgba(255, 209, 102, 0.12);
  color: #ffe6a6;
  border: 1px solid rgba(255, 209, 102, 0.22);
  padding: 8px 12px;
  margin-right: 8px;
}

.edit-button:hover {
  background: rgba(255, 209, 102, 0.18);
}

.danger-button {
  background: rgba(255, 95, 122, 0.14);
  color: #ffd7df;
  border: 1px solid rgba(255, 95, 122, 0.24);
  padding: 8px 12px;
}

.danger-button:hover {
  background: rgba(255, 95, 122, 0.2);
}

.danger-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bulk-delete-button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.bulk-delete-button:not([disabled]) {
  box-shadow: 0 0 18px rgba(255, 95, 122, 0.1);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.cards-grid-main {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cards-grid-main .stat-card:first-child {
  grid-column: span 1;
}

.summary-grid {
  margin-top: 4px;
}

.stat-card,
.panel,
.modal-content {
  position: relative;
  background: linear-gradient(
    180deg,
    rgba(8, 17, 33, 0.92),
    rgba(7, 14, 29, 0.97)
  );
  border: 1px solid rgba(58, 134, 255, 0.16);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.stat-card::after,
.panel::after,
.modal-content::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.015),
    transparent 22%
  );
  pointer-events: none;
}

.modal-confirm {
  width: min(100%, 520px);
}

.confirm-text {
  margin: 8px 0 24px;
  color: #d9e7ff;
  line-height: 1.6;
}

.moving-border {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.moving-border::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: 22px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    transparent 38%,
    rgba(58, 134, 255, 0.55) 50%,
    transparent 62%,
    transparent 100%
  );
  background-size: 220% 100%;
  background-position: 200% 0;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: borderPulse 8s linear infinite;
  opacity: 0.72;
  pointer-events: none;
}

@keyframes borderPulse {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -20% 0;
  }
}

.stat-card {
  padding: 24px;
  min-height: 142px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(58, 134, 255, 0.24);
  box-shadow:
    var(--shadow-soft),
    0 0 20px rgba(58, 134, 255, 0.06);
}

.stat-card-featured {
  min-height: 160px;
}

.stat-card-featured.feedback-positive {
  animation: balancePulsePositive 0.9s ease;
  border-color: rgba(0, 255, 156, 0.4);
  box-shadow:
    var(--shadow-soft),
    0 0 26px rgba(0, 255, 156, 0.14);
}

.stat-card-featured.feedback-positive .stat-value {
  color: var(--green);
  text-shadow: 0 0 16px rgba(0, 255, 156, 0.2);
}

.stat-card-featured.feedback-negative {
  animation: balancePulseNegative 0.9s ease;
  border-color: rgba(255, 95, 122, 0.4);
  box-shadow:
    var(--shadow-soft),
    0 0 26px rgba(255, 95, 122, 0.14);
}

.stat-card-featured.feedback-negative .stat-value {
  color: #ff9daf;
  text-shadow: 0 0 16px rgba(255, 95, 122, 0.2);
}

.stat-card-featured.feedback-neutral {
  animation: balancePulseNeutral 0.9s ease;
  border-color: rgba(58, 134, 255, 0.4);
  box-shadow:
    var(--shadow-soft),
    0 0 26px rgba(58, 134, 255, 0.14);
}

.stat-value.feedback-positive {
  animation: valueFlashPositive 0.9s ease;
}

.stat-value.feedback-negative {
  animation: valueFlashNegative 0.9s ease;
}

.stat-value.feedback-neutral {
  animation: valueFlashNeutral 0.9s ease;
}

@keyframes balancePulsePositive {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.018);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes balancePulseNegative {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.014);
  }
  60% {
    transform: scale(0.996);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes balancePulseNeutral {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.015);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes valueFlashPositive {
  0% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(0, 255, 156, 0);
  }
  40% {
    transform: scale(1.08);
    text-shadow: 0 0 18px rgba(0, 255, 156, 0.35);
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(0, 255, 156, 0);
  }
}

@keyframes valueFlashNegative {
  0% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(255, 95, 122, 0);
  }
  35% {
    transform: scale(1.06);
    text-shadow: 0 0 18px rgba(255, 95, 122, 0.35);
  }
  65% {
    transform: scale(0.98);
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(255, 95, 122, 0);
  }
}

@keyframes valueFlashNeutral {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.stat-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.stat-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  color: #dcebff;
  border: 1px solid rgba(58, 134, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.icon-balance {
  color: #cfe2ff;
}

.icon-income {
  color: var(--green);
}

.icon-expense {
  color: var(--red);
}

.icon-status {
  color: #9cc0ff;
}

.stat-label {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0;
  font-weight: 500;
}

.stat-value {
  font-size: clamp(1.9rem, 2.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.stat-value.small {
  font-size: clamp(1.5rem, 1.7vw, 2.2rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.stat-footnote {
  margin-top: 12px;
  color: var(--muted-2);
  font-size: 0.86rem;
  line-height: 1.5;
}

.stat-card.highlight-card {
  border-color: rgba(255, 209, 102, 0.3);
  box-shadow:
    var(--shadow-soft),
    0 0 22px rgba(255, 209, 102, 0.08);
}

.stat-card.highlight-card .stat-value {
  color: var(--yellow);
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.12);
}

#highestDay {
  color: var(--yellow);
}

.positive {
  color: var(--green);
  text-shadow: 0 0 12px rgba(0, 255, 156, 0.12);
}

.negative {
  color: var(--red);
  text-shadow: 0 0 12px rgba(255, 95, 122, 0.12);
}

.chart-panel,
.table-panel,
.insight-panel {
  padding: 24px;
  margin-bottom: 22px;
}

.panel-header {
  margin-bottom: 18px;
}

.panel-header-split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.panel-eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: #9ab8ef;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.42rem;
  letter-spacing: -0.02em;
}

.insight-panel.hidden {
  display: none;
}

.insight-header {
  margin-bottom: 12px;
}

.insight-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(58, 134, 255, 0.12);
  color: #9dc0ff;
  border: 1px solid rgba(58, 134, 255, 0.18);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 600;
}

.insight-text {
  margin: 0;
  color: #dce9ff;
  line-height: 1.8;
}

/* Lista de seleção única do DashNOX, baseada no seletor de tipo de operação. */
.dashnox-select-control {
  position: relative;
  display: inline-block;
  width: 100%;
  min-width: 0;
  vertical-align: middle;
}

.dashnox-native-select {
  position: absolute !important;
  inset: 0 !important;
  z-index: -1 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.dashnox-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  overflow: hidden;
  border: 1px solid rgba(var(--user-accent-rgb), 0.18);
  border-radius: 11px;
  outline: 0;
  background: var(--user-field-bg, rgba(var(--user-menu-bg-rgb), 0.88));
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.dashnox-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashnox-select-chevron {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 0.18s ease;
}

.dashnox-select-control.is-open .dashnox-select-button,
.dashnox-select-button:focus-visible {
  border-color: rgba(var(--user-accent-rgb), 0.62);
  background: rgba(var(--user-menu-bg-rgb), 0.98);
  box-shadow: 0 0 0 3px rgba(var(--user-accent-rgb), 0.1);
}

.dashnox-select-control.is-open .dashnox-select-chevron {
  transform: rotate(180deg);
}

.dashnox-select-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.dashnox-select-popover {
  position: fixed;
  z-index: 5600;
  display: grid;
  gap: 4px;
  min-width: min(250px, calc(100vw - 36px));
  max-height: min(320px, 48vh);
  padding: 8px;
  overflow-y: auto;
  border: 1px solid rgba(var(--user-accent-rgb), 0.26);
  border-radius: 15px;
  background:
    radial-gradient(circle at 18% 0%, rgba(var(--user-accent-rgb), 0.09), transparent 38%),
    rgba(var(--user-menu-bg-rgb), 0.985);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(18px);
  animation: dashnoxSelectEnter 150ms ease-out;
}

.dashnox-select-popover.opens-above {
  animation-name: dashnoxSelectEnterAbove;
}

.dashnox-select-popover.hidden {
  display: none;
}

.dashnox-select-popover button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 48px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
}

.dashnox-select-popover button:hover,
.dashnox-select-popover button:focus-visible,
.dashnox-select-popover button[aria-selected="true"] {
  outline: 0;
  border-color: rgba(var(--user-accent-rgb), 0.18);
  background: linear-gradient(90deg, rgba(var(--user-accent-rgb), 0.14), rgba(var(--user-accent-rgb), 0.035));
  box-shadow: inset 3px 0 0 var(--user-accent);
}

.dashnox-select-popover button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dashnox-select-radio {
  color: var(--user-accent);
  font-size: 1.05rem;
}

@keyframes dashnoxSelectEnter {
  from { opacity: 0; transform: translateY(-5px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dashnoxSelectEnterAbove {
  from { opacity: 0; transform: translateY(5px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
