/* Reset and Base Styles */
/* Dashboard main container - no background, no shadow, no border radius */
/* Dashboard main container - add border, rounded corners, white background */
.cashflow-dashboard {
  max-width: 900px;
  margin: 32px auto;
  background: #fff;
  border-radius: 18px;
  padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
  box-shadow: 0 4px 32px rgba(28, 26, 75, 0.1);
  border: 2px solid #ececec;
  position: relative;
  overflow: visible;
  color: #111827;
  min-height: 520px;
  min-height: 600px;
}

/* Header */
/* Header - remove background, soften spacing, dark text */
/* Header - align left, fix spacing, font weight */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 38px 38px 0 38px;
  color: #111827;
}

/* Title - dark text, no extra color */
/* Title - left align, bold, uppercase, spacing */
.header-left .dashboard-title {
  font-size: 22px;
  font-weight: 900;
  color: #111827;
  line-height: 1.1;
  margin: 0;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: left;
}

/* Toggle buttons */
/* Toggle container - remove background, spacing */
.toggle-container {
  display: flex;
  gap: 8px;
  background: none;
  padding: 0;
  border-radius: 0;
}

/* Toggle button - flat, dark text, no background */
.toggle-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

/* Toggle button active - bold border, accent text */
.toggle-btn.active {
  background: #f3f4f6;
  color: #6658f6;
  border: 2px solid #6658f6;
}

/* Subtitle - dark text */
/* Subtitle - uppercase, bold, spacing, left align */
.header-left .subtitle {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #111827;
  text-align: left;
}

/* Header right - no change needed */
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.mode-info {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

/* Mode label - dark text */
/* Mode label - uppercase, bold, spacing */
.mode-label {
  font-size: 15px;
  color: #111827;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Info icon - flat, dark text */
/* Info icon - circle, border, center, accent color */
.info-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #ececec;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6658f6;
  cursor: pointer;
  transition: box-shadow 0.2s ease;
  position: relative;
  box-shadow: 0 2px 8px rgba(28, 26, 75, 0.08);
}

/* Info icon hover - accent border */
/* Info icon hover - accent border */
.info-icon:hover {
  border-color: #6658f6;
  box-shadow: 0 4px 16px rgba(102, 88, 246, 0.12);
  background: #f3f4ff;
}

/* Toggle controls - remove background, spacing */
/* Toggle controls - pill background, spacing */
.toggle-controls {
  display: flex;
  background: #f6f6f6;
  border-radius: 12px;
  padding: 4px 10px;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(28, 26, 75, 0.04);
  margin-top: 10px;
}

/* Toggle button (controls) - match above */
/* Toggle button - pill, bold, spacing, shadow */
.toggle-btn {
  padding: 8px 24px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #111827;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  transition: background 0.2s, color 0.2s;
  min-width: 60px;
  box-shadow: none;
}

/* Toggle button hover - accent border */
/* Toggle button hover - accent background */
.toggle-btn:hover {
  background: #ececec;
  color: #6658f6;
}

/* Toggle button active - bold border, accent text */
/* Toggle button active - accent background, bold */
.toggle-btn.active {
  background: #6658f6;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(102, 88, 246, 0.1);
}

/* Chart Container */
/* Chart container - flat, no shadow, no border radius, tighter spacing */
/* Chart container - white, rounded, border, shadow, spacing */
.chart-container {
  height: 340px;
  background: #fff;
  margin: 24px 38px 0 38px;
  border-radius: 14px;
  padding: 24px 24px 0 24px;
  position: relative;
  display: none; /* Hidden by default */
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.28s ease;
  box-shadow: 0 2px 12px rgba(18, 20, 58, 0.08);
  border: 1px solid #ececec;
}

/* Chart container show - no change needed */
.chart-container.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

#main-chart {
  width: 100% !important;
  height: 100% !important;
}

/* Bottom Metrics */
/* Bottom metrics - flat, no shadow, no border radius, tighter spacing */
/* Bottom metrics - white, rounded, border, shadow, spacing */
.bottom-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: #fff;
  margin: 24px 38px 0 38px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(18, 20, 58, 0.08);
  border: 1px solid #ececec;
}

/* Metric item - flat, tighter padding */
/* Metric item - border right, spacing, font */
.metric-item {
  padding: 24px 0 18px 0;
  text-align: center;
  border-right: 1px solid #ececec;
  background: #fff;
  transition: none;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
}

/* Metric item hover - no effect */
/* Metric item hover - no effect */
.metric-item:hover {
  /* no effect */
}

/* Metric item last child - no border */
/* Metric item last child - no border */
.metric-item:last-child {
  border-right: none;
}

/* Metric value - slightly larger, bold */
/* Metric value - larger, bold, spacing */
.metric-value {
  font-size: 34px;
  font-weight: 900;
  color: #111827;
  margin-bottom: 8px;
  letter-spacing: 1px;
  transition: none;
}

.metric-value.updated {
  transform: scale(1.05);
  color: #3b82f6;
}

.metric-value.negative {
  color: #e53935;
}

.metric-value.positive {
  color: #0ea37a;
}

/* Metric label - slightly larger */
/* Metric label - uppercase, bold, spacing */
.metric-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Tooltip Styles */
.info-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  right: -20px;
  width: 320px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.info-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.tooltip-arrow {
  position: absolute;
  top: -6px;
  right: 30px;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 2px;
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}

.tooltip-header {
  background: linear-gradient(135deg, #6658f6 0%, #7c5cf6 50%, #9a62f5 100%);
  color: white;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  border-radius: 12px 12px 0 0;
  text-align: center;
  text-transform: uppercase;
}

.tooltip-content {
  padding: 20px;
  font-size: 13px;
  line-height: 1.6;
  color: #374151;
}

/* Footer Note */
/* Footer note - dark text, tighter spacing */
/* Footer note - smaller, muted, spacing */
.footer-note {
  font-size: 11px;
  color: #b0b0b0;
  text-align: center;
  font-style: italic;
  line-height: 1.4;
  padding: 18px 38px 24px 38px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    gap: 18px;
    align-items: center;
    text-align: center;
    padding: 18px 0 0 0;
  }

  .header-right {
    align-items: center;
    width: 100%;
  }

  .toggle-controls {
    width: 100%;
    justify-content: center;
  }

  .bottom-metrics {
    grid-template-columns: repeat(2, 1fr);
    margin: 0 0 12px 0;
  }

  .chart-container {
    margin: 0 0 12px 0;
    padding: 12px 0 0 0;
  }

  .footer-note {
    padding: 0 0 12px 0;
  }

  .info-tooltip {
    width: 240px;
    right: -20px;
  }
}

@media (max-width: 480px) {
  .bottom-metrics {
    grid-template-columns: 1fr;
  }

  .metric-item {
    border-right: none;
    border-bottom: none;
  }

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

  .toggle-btn {
    flex: 1;
    min-width: auto;
  }
}
