/* ============================================================================
   MILHAS PLUS ANALYTICS - PREMIUM THEME
   Version: 2.0 Premium Edition
   Design System: Cyberpunk Glassmorphism with Advanced Animations
   ============================================================================ */

:root {
  /* Color Palette */
  --shell-bg: radial-gradient(120% 120% at 100% 0%, rgba(31, 255, 185, 0.12) 0%, rgba(10, 20, 32, 0.95) 45%, rgba(6, 12, 20, 1) 100%);
  --card-bg: rgba(17, 27, 40, 0.9);
  --card-border: rgba(31, 255, 185, 0.08);
  --text-primary: #e8f6ff;
  --text-secondary: rgba(232, 246, 255, 0.65);
  --accent: #1fffb9;
  --accent-soft: rgba(31, 255, 185, 0.12);
  --accent-glow: rgba(31, 255, 185, 0.3);
  --danger: #ff6b6b;
  --warning: #f2c94c;

  /* Premium Shadows */
  --shadow-soft: 0 32px 80px rgba(0, 0, 0, 0.45);
  --shadow-premium: 0 20px 60px rgba(0, 0, 0, 0.5), 0 8px 16px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(31, 255, 185, 0.15);
  --shadow-lift: 0 24px 48px rgba(31, 255, 185, 0.18), 0 8px 16px rgba(0, 0, 0, 0.4);

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-elegant: 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   GLOBAL STYLES & BASE
   ============================================================================ */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-primary);
  background: var(--shell-bg);
  background-attachment: fixed;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.dashboard-shell {
  min-height: 100vh;
  padding-bottom: 2rem;
  animation: fadeIn 0.6s ease-out;
}

.dashboard-container {
  backdrop-filter: blur(24px);
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

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

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ============================================================================
   HEADER SECTION
   ============================================================================ */

.dashboard-header {
  padding: 1.25rem 0 1rem;
  animation: slideUp 0.6s ease-out;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  animation: slideUp 0.7s ease-out 0.1s backwards;
}

.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--accent-soft);
  padding: 0.75rem;
  box-shadow:
    inset 0 0 0 1px rgba(31, 255, 185, 0.2),
    0 10px 30px rgba(31, 255, 185, 0.1);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
  animation: float 6s ease-in-out infinite;
}

.brand-logo:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow:
    inset 0 0 0 1px rgba(31, 255, 185, 0.4),
    0 15px 40px rgba(31, 255, 185, 0.2);
}

.brand-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-subtitle {
  margin: 0.35rem 0 0;
  color: var(--text-secondary);
  max-width: 36rem;
  line-height: 1.5;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.header-info {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-end;
  animation: slideUp 0.7s ease-out 0.2s backwards;
}

.header-date-inline {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(31, 255, 185, 0.2), rgba(31, 255, 185, 0.05));
  box-shadow:
    0 12px 36px rgba(31, 255, 185, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(31, 255, 185, 0.24);
  backdrop-filter: blur(18px);
  letter-spacing: 0.03em;
  transition: all var(--transition-smooth);
}

.header-date-inline:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 44px rgba(31, 255, 185, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.header-target {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.header-target:hover {
  background: rgba(31, 255, 185, 0.2);
  transform: scale(1.05);
}

/* ============================================================================
   FILTERS CARD
   ============================================================================ */

.filters-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--shadow-premium);
  margin-bottom: 2.5rem;
  backdrop-filter: blur(30px);
  transition: all var(--transition-smooth);
  animation: slideUp 0.8s ease-out 0.3s backwards;
  position: relative;
  z-index: 100;  /* CRÍTICO: Garantir que filtros fiquem acima de cards e gráficos */
}

.filters-card:hover {
  box-shadow: var(--shadow-lift);
  border-color: rgba(31, 255, 185, 0.15);
}

.filters-card .card-body {
  padding: 1.25rem 1.5rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem 1.75rem;
}

.filter-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.filter-group {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.4s ease-out;
}

.filter-control .Select__control {
  background: rgba(17, 27, 40, 0.7);
  border-radius: 12px;
  min-height: 42px;
  border: 1px solid rgba(31, 255, 185, 0.15);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-fast);
}

.filter-control .Select__control:hover {
  border-color: rgba(31, 255, 185, 0.35);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.2),
    0 4px 12px rgba(31, 255, 185, 0.1);
}

.filter-control .Select__control--is-focused {
  border-color: var(--accent);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.2),
    0 0 0 3px var(--accent-soft);
}

.filter-control .Select__value-container {
  color: var(--text-primary);
  padding: 0 12px;
}

.filter-control .Select__single-value,
.filter-control .Select__placeholder,
.filter-control .Select__multi-value__label {
  color: var(--text-primary);
}

.filter-control .Select__indicator-separator {
  display: none;
}

.filter-control .Select__multi-value {
  background: rgba(31, 255, 185, 0.15);
  border-radius: 12px;
  transition: all var(--transition-fast);
}

.filter-control .Select__multi-value:hover {
  background: rgba(31, 255, 185, 0.25);
}

.filter-control .Select__multi-value__remove {
  color: var(--accent);
  transition: all var(--transition-fast);
}

.filter-control .Select__multi-value__remove:hover {
  background: rgba(31, 255, 185, 0.3);
  color: white;
}

.filter-control .Select__menu {
  background: rgba(17, 27, 40, 0.98);
  border-radius: 16px;
  border: 1px solid rgba(31, 255, 185, 0.15);
  overflow: hidden;
  box-shadow: var(--shadow-premium);
  backdrop-filter: blur(30px);
  animation: slideUp 0.2s ease-out;
  z-index: 1000 !important;  /* CRÍTICO: Dropdown deve ficar acima de TUDO */
  position: relative;
}

.filter-control .Select__option {
  transition: all var(--transition-fast);
}

.filter-control .Select__option--is-focused {
  background: rgba(31, 255, 185, 0.12);
}

.filter-control .Select__option--is-selected {
  background: rgba(31, 255, 185, 0.25);
  color: var(--accent);
  font-weight: 600;
}

/* ============================================================================
   KPI CARDS - PREMIUM EDITION
   ============================================================================ */

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  box-shadow: var(--shadow-premium);
  backdrop-filter: blur(30px);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-elegant);
  animation: slideUp 0.6s ease-out backwards;
  height: 100%;
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(31, 255, 185, 0.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  pointer-events: none;
}

.kpi-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-lift);
  border-color: rgba(31, 255, 185, 0.2);
}

.kpi-card:hover::before {
  opacity: 1;
}

.kpi-card:nth-child(1) { animation-delay: 0.1s; }
.kpi-card:nth-child(2) { animation-delay: 0.2s; }
.kpi-card:nth-child(3) { animation-delay: 0.3s; }
.kpi-card:nth-child(4) { animation-delay: 0.4s; }
.kpi-card:nth-child(5) { animation-delay: 0.5s; }

.kpi-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  letter-spacing: 0.03em;
  font-weight: 500;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  transition: color var(--transition-smooth);
}

.kpi-card:hover .kpi-value {
  color: var(--accent);
}

.kpi-secondary-row {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 1rem;
  border-top: 1px solid rgba(31, 255, 185, 0.08);
}

.kpi-secondary-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  font-weight: 600;
}

.kpi-secondary-value {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
}

.kpi-footnote {
  display: block;
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  line-height: 1.4;
}

/* ============================================================================
   KPI TOOLTIPS
   ============================================================================ */

.tooltip-inner {
  background-color: rgba(17, 27, 40, 0.97);
  color: #e8f6ff;
  border: 1px solid rgba(31, 255, 185, 0.25);
  border-radius: 6px;
  font-size: 0.78rem;
  max-width: 260px;
  padding: 8px 12px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.tooltip .tooltip-arrow::before {
  border-top-color: rgba(17, 27, 40, 0.97);
}

/* Info icon (ℹ) — reusable across all pages */
.info-tooltip-icon {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-left: 0.5rem;
  transition: color 0.2s ease;
}
.info-tooltip-icon:hover {
  color: var(--accent);
}

/* Flex header with title + info icon */
.info-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

/* ============================================================================
   GOAL CARDS - PREMIUM EDITION
   ============================================================================ */

.goal-card {
  background: var(--card-bg);
  border-radius: 26px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-premium);
  backdrop-filter: blur(30px);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-elegant);
  animation: slideUp 0.7s ease-out backwards;
}

.goal-card:nth-child(1) { animation-delay: 0.2s; }
.goal-card:nth-child(2) { animation-delay: 0.3s; }
.goal-card:nth-child(3) { animation-delay: 0.4s; }

.goal-card-column {
  display: flex;
}

.goal-card-column .goal-card {
  flex: 1;
}

.goal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 0% 100%, rgba(31, 255, 185, 0.18) 0%, rgba(31, 255, 185, 0) 55%);
  pointer-events: none;
  opacity: 0.7;
  transition: opacity var(--transition-smooth);
}

.goal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(31, 255, 185, 0.2);
}

.goal-card:hover::before {
  opacity: 1;
}

.goal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.goal-card-header-meta {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.card-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  font-weight: 600;
}

.card-date {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
}

.goal-card-percentage {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.goal-card-value {
  margin: 1.3rem 0 0.4rem;
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.goal-card-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin: 1.3rem 0 0.4rem;
}

.goal-card-value-row .goal-card-value {
  margin: 0;
}

.goal-card-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.goal-progress {
  height: 8px;
  border-radius: 999px;
  margin: 1.2rem 0;
  background-color: rgba(232, 246, 255, 0.12);
  overflow: hidden;
  position: relative;
}

.goal-progress .progress-bar {
  border-radius: 999px;
  transition: all var(--transition-elegant);
  position: relative;
}

.goal-progress .progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Premium gradient colors for progress bars */
.goal-progress .bg-danger {
  background: linear-gradient(90deg, #dc3545 0%, #e74c3c 100%) !important;
}

.goal-progress .bg-orange {
  background: linear-gradient(90deg, #fd7e14 0%, #ff8c42 100%) !important;
}

.goal-progress .bg-warning {
  background: linear-gradient(90deg, #ffc107 0%, #f2c94c 100%) !important;
}

.goal-progress .bg-info {
  background: linear-gradient(90deg, #17a2b8 0%, #0bcf8a 100%) !important;
}

.goal-progress .bg-success {
  background: linear-gradient(90deg, #28a745 0%, #0bcf8a 100%) !important;
}

.goal-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.goal-meta {
  font-weight: 500;
  transition: color var(--transition-fast);
}

.goal-meta:hover {
  color: var(--text-primary);
}

.goal-delta {
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(31, 255, 185, 0.3);
}

/* ============================================================================
   CHART CARDS
   ============================================================================ */

.chart-card {
  background: var(--card-bg);
  border-radius: 26px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-premium);
  backdrop-filter: blur(30px);
  padding: 0.75rem;
  transition: all var(--transition-smooth);
  animation: slideUp 0.7s ease-out backwards;
}

.chart-card:hover {
  box-shadow: var(--shadow-lift);
  border-color: rgba(31, 255, 185, 0.15);
}

/* ============================================================================
   PAGINATION CONTROLS (Ranking)
   ============================================================================ */

.ranking-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
  padding: 0.5rem;
}

.ranking-pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(17, 27, 40, 0.6);
  padding: 0.5rem 1.25rem;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-smooth);
}

.ranking-pagination:hover {
  background: rgba(17, 27, 40, 0.8);
  border-color: rgba(31, 255, 185, 0.15);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 24px rgba(31, 255, 185, 0.08);
}

.ranking-nav-btn {
  min-width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  border: 1px solid var(--accent-glow);
  background: rgba(31, 255, 185, 0.08);
  color: var(--accent);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.ranking-nav-btn:hover:not(:disabled) {
  background: rgba(31, 255, 185, 0.18);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(31, 255, 185, 0.25), 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: scale(1.05);
  color: #fff;
}

.ranking-nav-btn:active:not(:disabled) {
  transform: scale(0.95);
  box-shadow: 0 0 12px rgba(31, 255, 185, 0.15), 0 2px 6px rgba(0, 0, 0, 0.25);
}

.ranking-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: rgba(232, 246, 255, 0.05);
  border-color: rgba(232, 246, 255, 0.1);
  color: rgba(232, 246, 255, 0.3);
}

.ranking-page-info {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  font-family: "Inter", sans-serif;
  letter-spacing: 0.3px;
  padding: 0 0.75rem;
  white-space: nowrap;
  user-select: none;
}

/* ============================================================================
   ALERTS & EMPTY STATES
   ============================================================================ */

.empty-alert {
  background: rgba(31, 255, 185, 0.08);
  border: 1px solid rgba(31, 255, 185, 0.18);
  color: var(--text-primary);
  border-radius: 18px;
  text-align: center;
  padding: 2rem;
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================================================
   GRID & LAYOUT
   ============================================================================ */

.goal-grid {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.row.mb-4 {
  margin-bottom: 2.5rem !important;
}

/* Prevent Bootstrap .row negative margins from causing horizontal overflow */
.row {
  margin-right: 0;
  margin-left: 0;
}

.row > * {
  padding-right: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
  padding-left: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(31, 255, 185, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(31, 255, 185, 0.05) 0%,
    rgba(31, 255, 185, 0.15) 50%,
    rgba(31, 255, 185, 0.05) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* ============================================================================
   SCROLLBAR CUSTOMIZATION
   ============================================================================ */

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(17, 27, 40, 0.5);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(31, 255, 185, 0.3);
  border-radius: 10px;
  border: 2px solid rgba(17, 27, 40, 0.5);
  transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(31, 255, 185, 0.5);
}

/* ============================================================================
   FINANCIAL SECTION
   ============================================================================ */

.financial-section {
  margin-top: 2.5rem;
  animation: slideUp 0.8s ease-out;
}

.financial-section-divider {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(31, 255, 185, 0.3) 50%,
    transparent 100%
  );
  margin: 3rem 0 2rem;
}

.financial-section-header {
  text-align: center;
  margin-bottom: 2rem;
  animation: slideUp 0.6s ease-out;
}

.financial-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.financial-section-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

/* Risk Cards */
.risk-card {
  background: var(--card-bg);
  border-radius: 22px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-premium);
  backdrop-filter: blur(30px);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-elegant);
  animation: slideUp 0.7s ease-out backwards;
}

.risk-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.risk-card--danger {
  border-color: rgba(255, 107, 107, 0.2);
}

.risk-card--danger::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top left,
    rgba(255, 107, 107, 0.1) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.risk-card--warning {
  border-color: rgba(242, 201, 76, 0.2);
}

.risk-card--warning::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top left,
    rgba(242, 201, 76, 0.1) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.risk-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.risk-card-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.risk-card-value {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.5rem 0;
  line-height: 1.2;
}

.risk-card-value--danger {
  color: var(--danger);
  text-shadow: 0 0 12px rgba(255, 107, 107, 0.3);
}

.risk-card-value--warning {
  color: var(--warning);
  text-shadow: 0 0 12px rgba(242, 201, 76, 0.3);
}

.risk-card-description {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0;
}

.financial-risk-row {
  margin-top: 1.5rem;
}

/* ============================================================================
   COMPARISON CARDS (Yesterday, Last Week, Last Month)
   ============================================================================ */

.comparison-card {
  background: var(--card-bg);
  border-radius: 22px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-premium);
  backdrop-filter: blur(30px);
  transition: all var(--transition-elegant);
  animation: slideUp 0.6s ease-out backwards;
}

.comparison-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(31, 255, 185, 0.12);
}

.comparison-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.comparison-card .card-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
}

.comparison-card-date {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.comparison-card-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.comparison-card-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.comparison-card-metric {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ============================================================================
   CLIENT SEGMENTATION
   ============================================================================ */

.client-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.client-stat {
  padding: 0.5rem 0;
}

.client-stat-value {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.client-stat--new {
  color: #4dabf7;
}

.client-stat--returning {
  color: var(--accent);
}

.client-stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.client-progress {
  height: 12px;
  border-radius: 6px;
  background: rgba(232, 246, 255, 0.08);
}

.client-top-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.client-top-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.client-top-item {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(232, 246, 255, 0.06);
}

.client-top-item:last-child {
  border-bottom: none;
}

/* ============================================================================
   SIDEBAR NAVIGATION
   ============================================================================ */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 240px;
  height: 100vh;
  background: rgba(10, 18, 30, 0.97);
  border-right: 1px solid var(--card-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  padding: 0;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.5s ease-out;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--card-border);
  text-decoration: none;
}

.sidebar-brand img {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.sidebar-brand-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sidebar-brand-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  margin: 0.125rem 0.5rem;
  border-radius: 8px;
  border-left: 3px solid transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-smooth);
}

.sidebar-nav .nav-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: rgba(31, 255, 185, 0.3);
}

.sidebar-nav .nav-link.active {
  color: var(--accent);
  background: rgba(31, 255, 185, 0.08);
  border-left-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 16px rgba(31, 255, 185, 0.06);
}

.sidebar-nav .nav-icon {
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-section-label {
  padding: 1.25rem 1.25rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(232, 246, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--card-border);
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar-user-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.sidebar-user-badge {
  font-size: 0.65rem;
  font-weight: 500;
}

.sidebar-logout-link {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.sidebar-logout-link:hover {
  color: #ff6b6b;
  text-decoration: none;
}

.sidebar-version {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Main content offset */
.main-content {
  margin-left: 240px;
  transition: margin-left var(--transition-smooth);
}

/* Mobile header (hamburger) */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(10, 18, 30, 0.97);
  border-bottom: 1px solid var(--card-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 0.75rem 1rem;
  align-items: center;
  gap: 0.75rem;
}

.mobile-header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.mobile-header-brand img {
  width: 32px;
  height: 32px;
}

.mobile-header-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 0.5rem 0.625rem;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1;
}

.sidebar-toggle-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Fix: Bootstrap offcanvas/modal backdrop blocks clicks even when closed */
.offcanvas-backdrop:not(.show),
.modal-backdrop:not(.show) {
  pointer-events: none;
}

/* Offcanvas overrides for mobile sidebar */
.sidebar-offcanvas .offcanvas-body {
  background: rgba(10, 18, 30, 0.99);
  padding: 0;
}

.sidebar-offcanvas .offcanvas-header {
  background: rgba(10, 18, 30, 0.99);
  border-bottom: 1px solid var(--card-border);
}

.sidebar-offcanvas .btn-close {
  filter: invert(1);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 992px) {
  .sidebar {
    display: none;
  }

  .mobile-header {
    display: flex;
  }

  .main-content {
    margin-left: 0;
  }

  .brand-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-info {
    align-items: flex-start;
    text-align: left;
    margin-top: 1.5rem;
  }

  .brand-logo {
    width: 76px;
    height: 76px;
  }

  .brand-title {
    font-size: 1.75rem;
  }

  .filters-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .dashboard-header {
    padding: 1rem 0 0.75rem;
  }

  .filters-card .card-body {
    padding: 1rem 1.25rem;
  }
}

@media (max-width: 576px) {
  .kpi-card {
    border-radius: 18px;
  }

  .goal-card {
    border-radius: 22px;
  }

  .brand-title {
    font-size: 1.5rem;
  }

  .brand-logo {
    width: 64px;
    height: 64px;
  }

  .goal-card-value {
    font-size: 1.875rem;
  }

  .kpi-value {
    font-size: 1.75rem;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .risk-card-value {
    font-size: 1.75rem;
  }

  .financial-section-title {
    font-size: 1.25rem;
  }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus states for accessibility */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================================
   LOGIN PAGE — SPLIT CARD
   ============================================================================ */

/* Shell: full viewport, centers the card */
.login-shell {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: radial-gradient(
    ellipse at 30% 50%,
    rgba(31, 255, 185, 0.04) 0%,
    transparent 60%
  ),
  var(--body-bg, #0a1420);
  animation: fadeIn 0.6s ease-out;
}

/* Card: the main container that holds both panels side by side */
.login-card {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 960px;
  min-height: 580px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(31, 255, 185, 0.05);
  animation: slideUp 0.6s ease-out;
}

/* -- Left panel: image -- */
.login-panel-left {
  flex: 1;
  min-height: 100%;
  position: relative;
  /* backgroundImage set inline via Dash style prop */
}

/* Subtle vignette on the image edges */
.login-panel-left::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    transparent 70%,
    rgba(17, 27, 40, 0.6) 100%
  );
  pointer-events: none;
}

/* -- Right panel: form -- */
.login-panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  gap: 1.25rem;
  max-width: 460px;
}

/* Logo */
.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--accent-soft);
  padding: 0.5rem;
  box-shadow: inset 0 0 0 1px rgba(31, 255, 185, 0.2),
    0 10px 30px rgba(31, 255, 185, 0.1);
  margin-bottom: 0.25rem;
}

/* Title */
.login-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Subtitle */
.login-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

/* -- Google sign-in button -- */
.login-google-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.login-google-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.login-google-button--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-google-icon {
  width: 20px;
  height: 20px;
}

.login-coming-soon {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* -- Divider -- */
.login-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.login-divider-line {
  flex: 1;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0;
}

.login-divider-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  text-transform: lowercase;
}

/* -- Credential form -- */
.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Input styles */
.login-input {
  background: rgba(17, 27, 40, 0.7) !important;
  border: 1px solid rgba(31, 255, 185, 0.15) !important;
  border-radius: 12px !important;
  color: var(--text-primary) !important;
  padding: 0.75rem 1rem !important;
  font-size: 0.95rem !important;
  width: 100%;
  transition: all var(--transition-fast);
}

.login-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}

.login-input::placeholder {
  color: var(--text-secondary) !important;
}

/* Button styles */
.login-button {
  width: 100%;
  padding: 0.75rem !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  background: linear-gradient(135deg, var(--accent), rgba(31, 255, 185, 0.7)) !important;
  border: none !important;
  color: #0a1420 !important;
  transition: all var(--transition-smooth);
  margin-top: 0.25rem;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(31, 255, 185, 0.3);
}

/* Alert */
.login-alert {
  width: 100%;
  border-radius: 12px !important;
  text-align: center;
  font-size: 0.9rem;
}

/* Footer text */
.login-footer-text {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.6;
}

/* -- Responsive: stack on mobile/tablet -- */
@media (max-width: 992px) {
  .login-shell {
    padding: 1rem;
  }

  .login-card {
    flex-direction: column;
    max-width: 440px;
    min-height: auto;
  }

  .login-panel-left {
    display: none;
  }

  .login-panel-right {
    max-width: 100%;
    padding: 2.5rem 2rem;
  }
}

@media (max-width: 576px) {
  .login-panel-right {
    padding: 2rem 1.5rem;
  }

  .login-logo {
    width: 60px;
    height: 60px;
  }

  .login-title {
    font-size: 1.35rem;
  }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
  body {
    background: white;
    color: black;
  }

  .sidebar,
  .mobile-header {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .dashboard-header,
  .filters-card {
    break-inside: avoid;
  }

  .chart-card,
  .kpi-card,
  .goal-card,
  .risk-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================================================
   FERRAMENTAS PAGE
   ============================================================================ */

.page-ferramentas {
  color: var(--text-primary);
}

.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: var(--transition-fast);
}

.tool-card:hover {
  border-color: rgba(31, 255, 185, 0.3);
}

.tool-card-header {
  background: rgba(31, 255, 185, 0.04);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-secondary);
}

.upload-area:hover {
  border-color: var(--accent);
  background: rgba(31, 255, 185, 0.04);
}

.cuv-text-output {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  color: var(--text-primary);
}

/* ============================================================================
   ADMIN PANEL
   ============================================================================ */

.page-admin {
  color: var(--text-primary);
}

.admin-tabs .nav-link {
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  padding: 10px 20px;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.admin-tabs .nav-link:hover {
  color: var(--accent);
  border-bottom-color: rgba(31, 255, 185, 0.3);
}

.admin-tabs .nav-link.active {
  color: var(--accent);
  background: rgba(31, 255, 185, 0.06);
  border-bottom: 2px solid var(--accent);
}

.admin-action-btn {
  font-size: 0.85rem;
}

.admin-switch .form-check-label {
  color: var(--text-primary);
}

/* ============================================================================
   NOTIFICATION CENTER
   ============================================================================ */

.notification-bell-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  position: relative;
  transition: var(--transition-fast);
  border-radius: 6px;
}

.notification-bell-btn:hover {
  background: rgba(31, 255, 185, 0.1);
}

.notification-bell-btn:hover .notification-bell-icon {
  color: var(--accent);
}

.notification-bell-icon {
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  font-style: normal;
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--danger);
  color: #fff;
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 5px;
  min-width: 16px;
  text-align: center;
  line-height: 1.2;
}
