h1 { font-family: Arial, Helvetica, sans-serif; }

/* ============================================
   CASH FLOW TABLE STYLES
   ============================================ */

/* Cash Flow Modal */
.cashflow-modal-content {
  max-width: 95vw;
  width: 95vw;
  height: 90vh;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cashflow-modal-content .modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 1.5rem;
}

/* Summary Cards */
.cashflow-summary {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.summary-card {
  background: rgba(255, 255, 255, 0.95);
  padding: 1.25rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.summary-card.highlight {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.summary-card i {
  font-size: 2rem;
  color: #667eea;
  min-width: 40px;
  text-align: center;
}

.summary-card.highlight i {
  color: white;
}

.summary-label {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.summary-card.highlight .summary-label {
  color: rgba(255, 255, 255, 0.9);
}

.summary-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1e293b;
}

.summary-card.highlight .summary-value {
  color: white;
}

/* Table Container */
.cashflow-table-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 2rem;
  border: 1px solid #e5e7eb;
}

.table-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 600px;
}

.cashflow-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.813rem;
  font-family: Arial, sans-serif;
}

.cashflow-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Main category headers - similar to image */
.cashflow-table th.main-category {
  background: #2563eb; /* Deep blue like in image */
  color: white;
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-weight: 700;
  border: 1px solid #1e40af;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.cashflow-table th.capex-header {
  background: #ec4899; /* Pink for CAPEX */
  border-color: #db2777;
}

.cashflow-table th.operations-header {
  background: #6366f1; /* Purple for Operations */
  border-color: #4f46e5;
}

.cashflow-table th.cashflow-header {
  background: #06b6d4; /* Teal/Cyan for Cash Flows */
  border-color: #0891b2;
}

/* Sub headers */
.cashflow-table th {
  background: #dbeafe; /* Light blue */
  color: #1e40af;
  padding: 0.625rem 0.5rem;
  text-align: center;
  font-weight: 600;
  border: 1px solid #93c5fd;
  white-space: nowrap;
  font-size: 0.75rem;
}

.cashflow-table th.sticky-col {
  position: sticky;
  left: 0;
  z-index: 11;
  background: #1e3a8a; /* Dark blue for sticky column */
  color: white;
  font-weight: 700;
}

/* Table body cells */
.cashflow-table td {
  padding: 0.5rem 0.625rem;
  border: 1px solid #d1d5db;
  text-align: center;
  background: white;
  font-size: 0.813rem;
}

/* Alternating row colors - like in image */
.cashflow-table tbody tr:nth-child(even) td {
  background: #f9fafb;
}

.cashflow-table tbody tr:nth-child(odd) td {
  background: white;
}

.cashflow-table td.sticky-col {
  position: sticky;
  left: 0;
  z-index: 5;
  background: #f3f4f6;
  font-weight: 700;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.08);
  border-right: 2px solid #9ca3af;
}

.cashflow-table tbody tr:nth-child(even) td.sticky-col {
  background: #e5e7eb;
}

.cashflow-table td.year-cell {
  font-size: 0.875rem;
  color: #111827;
  font-weight: 700;
}

/* Number formatting - RTL with proper alignment */
.cashflow-table td.number-cell {
  font-family: Arial, sans-serif;
  text-align: right;
  direction: ltr;
  padding-left: 0.5rem;
  padding-right: 0.75rem;
  font-weight: 500;
}

/* Negative numbers in RED - like in image */
.cashflow-table td.number-cell.negative {
  color: #dc2626;
  font-weight: 700;
}

/* Positive numbers in dark green */
.cashflow-table td.number-cell.positive {
  color: #065f46;
  font-weight: 600;
}

/* Zero values */
.cashflow-table td.number-cell.zero {
  color: #6b7280;
  font-weight: 400;
}

/* Special column highlighting */
.cashflow-table td.noi-cell {
  background: #fef3c7;
  font-weight: 700;
}

.cashflow-table tbody tr:nth-child(even) td.noi-cell {
  background: #fde68a;
}

.cashflow-table td.cumulative-cell {
  background: #dbeafe;
  font-weight: 700;
  color: #1e40af;
}

.cashflow-table tbody tr:nth-child(even) td.cumulative-cell {
  background: #bfdbfe;
}

.cashflow-table td.dscr-cell {
  background: #fed7aa;
  font-weight: 700;
}

.cashflow-table tbody tr:nth-child(even) td.dscr-cell {
  background: #fdba74;
}

/* Row hover effect - subtle */
.cashflow-table tbody tr:hover td {
  background: #e0e7ff !important;
}

.cashflow-table tbody tr:hover td.sticky-col {
  background: #c7d2fe !important;
}

/* Total/Summary rows at bottom */
.cashflow-table tfoot tr {
  background: #1e3a8a;
  color: white;
  font-weight: 700;
}

.cashflow-table tfoot td {
  background: #1e3a8a;
  color: white;
  font-weight: 700;
  border-color: #1e40af;
  padding: 0.75rem 0.625rem;
}

/* Charts Section */
.cashflow-charts {
  margin-top: 2rem;
}

.chart-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.chart-container {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  height: 350px;
}

.chart-container canvas {
  max-height: 100%;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .chart-row {
    grid-template-columns: 1fr;
  }
  
  .summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .cashflow-modal-content {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .cashflow-table {
    font-size: 0.75rem;
  }
  
  .cashflow-table th,
  .cashflow-table td {
    padding: 0.5rem 0.375rem;
  }
  
  .summary-grid {
    grid-template-columns: 1fr;
  }
  
  .chart-container {
    height: 300px;
  }
}

/* Print Styles */
@media print {
  .cashflow-modal-content .modal-header button {
    display: none;
  }
  
  .cashflow-table {
    font-size: 0.7rem;
  }
  
  .cashflow-charts {
    page-break-before: always;
  }
}
/* ============================================
   SCENARIO TABS STYLES
   ============================================ */

#project-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.scenario-tab-btn {
  white-space: nowrap;
  min-width: fit-content;
}

.scenario-tab-btn.active {
  border-bottom: 3px solid #3b82f6;
}

.data-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.data-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Responsive tabs */
@media (max-width: 768px) {
  #project-tabs {
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
  }
  
  .tab-btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
  }
}

/* ============================================
   CASH FLOW INSIGHTS STYLES (Phase 1)
   ============================================ */

.cashflow-insights {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  border-radius: 12px;
  border: 2px solid #e5e7eb;
}

.insights-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.insights-header h3 {
  font-size: 1.75rem;
  font-weight: bold;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.insights-header i {
  color: #667eea;
  font-size: 2rem;
}

/* Insights Row - 2 cards per row */
.insights-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Insight Cards with gradients */
.insight-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.insight-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Gradient variations */
.insight-card.gradient-purple {
  border-left: 5px solid #9333ea;
}

.insight-card.gradient-blue {
  border-left: 5px solid #3b82f6;
}

.insight-card.gradient-green {
  border-left: 5px solid #10b981;
}

.insight-card.gradient-orange {
  border-left: 5px solid #f59e0b;
}

.insight-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.gradient-purple .insight-icon {
  background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
  color: white;
}

.gradient-blue .insight-icon {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.gradient-green .insight-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.gradient-orange .insight-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.insight-content {
  flex: 1;
}

.insight-label {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.insight-value {
  font-size: 2rem;
  font-weight: bold;
  color: #1e293b;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.insight-desc {
  font-size: 0.875rem;
  color: #94a3b8;
  font-style: italic;
}

/* Metrics Grid - 6 items in 2 rows */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.metric-item {
  background: white;
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  border: 1px solid #e5e7eb;
}

.metric-item:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.metric-item i {
  font-size: 1.5rem;
  color: #667eea;
  min-width: 35px;
  text-align: center;
}

.metric-label {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: bold;
  color: #1e293b;
}

.metric-value.positive {
  color: #10b981;
}

.metric-value.warning {
  color: #f59e0b;
}

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

/* ============================================
   WARNINGS & RECOMMENDATIONS (Phase 3)
   ============================================ */

.cashflow-warnings-recommendations {
  margin: 2rem 0;
}

.warnings-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.warnings-header h3 {
  font-size: 1.75rem;
  font-weight: bold;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.warnings-header i {
  color: #f59e0b;
  font-size: 2rem;
}

.warnings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Warning Cards */
.warning-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-left: 5px solid #94a3b8;
}

.warning-card.risk-high {
  border-left-color: #ef4444;
}

.warning-card.risk-medium {
  border-left-color: #f59e0b;
}

.warning-card.risk-low {
  border-left-color: #10b981;
}

.warning-card.sustainability-excellent {
  border-left-color: #10b981;
}

.warning-card.sustainability-good {
  border-left-color: #3b82f6;
}

.warning-card.sustainability-fair {
  border-left-color: #f59e0b;
}

.warning-card.sustainability-poor {
  border-left-color: #ef4444;
}

.warning-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.warning-header i {
  font-size: 1.5rem;
  color: #667eea;
}

.warning-header h4 {
  font-size: 1.125rem;
  font-weight: bold;
  color: #1e293b;
  margin: 0;
}

/* Risk Score Circle */
.risk-score {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.score-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border: 5px solid;
}

.score-circle.score-high {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

.score-circle.score-medium {
  background: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
  color: #f59e0b;
}

.score-circle.score-low {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
  color: #10b981;
}

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

.score-max {
  font-size: 0.875rem;
}

.risk-level {
  font-size: 1.25rem;
  font-weight: bold;
  color: #1e293b;
}

/* Sustainability Progress Bar */
.sustainability-score {
  margin-bottom: 1rem;
}

.score-progress {
  margin-bottom: 0.75rem;
}

.progress-bar {
  height: 12px;
  background: #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  transition: width 0.5s ease;
}

.progress-fill.progress-excellent {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.progress-fill.progress-good {
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.progress-fill.progress-fair {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.progress-fill.progress-poor {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.score-label {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 600;
}

.sustainability-level {
  font-size: 1.125rem;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  display: inline-block;
}

.sustainability-level.level-excellent {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.sustainability-level.level-good {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.sustainability-level.level-fair {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.sustainability-level.level-poor {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Warning List */
.warning-list {
  margin-top: 1rem;
}

.warning-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  background: #f8fafc;
}

.warning-item.severity-high {
  background: rgba(239, 68, 68, 0.05);
  border-left: 3px solid #ef4444;
}

.warning-item.severity-medium {
  background: rgba(245, 158, 11, 0.05);
  border-left: 3px solid #f59e0b;
}

.warning-item i {
  color: #ef4444;
  font-size: 1.125rem;
  margin-top: 0.125rem;
}

.warning-item.severity-medium i {
  color: #f59e0b;
}

.warning-message {
  font-size: 0.875rem;
  color: #1e293b;
  font-weight: 600;
}

.warning-years {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* Strength and Issue Lists */
.strength-list, .issue-list {
  margin-top: 1rem;
}

.strength-list h5, .issue-list h5 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.strength-item, .issue-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  font-size: 0.875rem;
  color: #1e293b;
}

.strength-item i {
  color: #10b981;
}

.issue-item i {
  color: #ef4444;
}

/* Recommendations Section */
.recommendations-section {
  margin-top: 2rem;
}

.recommendations-section h4 {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1e293b;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.recommendations-section h4 i {
  color: #f59e0b;
  font-size: 1.75rem;
}

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

.recommendation-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-top: 4px solid #94a3b8;
  transition: transform 0.2s;
}

/* Badge styles */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  background: #10b981;
  color: white;
}

/* Scenario selection modal animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

#scenario-selection-modal {
  animation: fadeIn 0.2s ease-out;
}

#scenario-selection-modal > div {
  animation: slideUp 0.3s ease-out;
}

.recommendation-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.recommendation-card.priority-critical {
  border-top-color: #ef4444;
}

.recommendation-card.priority-high {
  border-top-color: #f59e0b;
}

.recommendation-card.priority-medium {
  border-top-color: #3b82f6;
}

.rec-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.rec-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.rec-header h5 {
  font-size: 1.125rem;
  font-weight: bold;
  color: #1e293b;
  margin: 0 0 0.25rem 0;
}

.rec-category {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.priority-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  margin-left: auto;
}

.priority-badge.priority-critical {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.priority-badge.priority-high {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.priority-badge.priority-medium {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.rec-description {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 1rem;
}

.rec-actions {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rec-actions li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: #1e293b;
  border-top: 1px solid #f1f5f9;
}

.rec-actions li:first-child {
  border-top: none;
}

.rec-actions li i {
  color: #667eea;
  margin-top: 0.25rem;
}

/* Charts Section Title */
.charts-section-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1e293b;
  margin: 2rem 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid #667eea;
}

.charts-section-title i {
  color: #667eea;
  font-size: 1.75rem;
}

/* Responsive Design for Insights */
@media (max-width: 1024px) {
  .insights-row {
    grid-template-columns: 1fr;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 768px) {
  .cashflow-insights {
    padding: 1rem;
  }
  
  .insights-header h3 {
    font-size: 1.5rem;
  }
  
  .insight-card {
    padding: 1rem;
    flex-direction: column;
    text-align: center;
  }
  
  .insight-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  
  .insight-value {
    font-size: 1.5rem;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   CASH FLOW DASHBOARD (Phase 4)
   ============================================ */

.cashflow-dashboard {
  padding: 1rem;
}

.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-header h3 {
  font-size: 1.75rem;
  font-weight: bold;
  color: #1e293b;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-header i {
  color: #f59e0b;
}

.header-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-left: 5px solid;
}

.stat-card.best {
  border-left-color: #10b981;
}

.stat-card.worst {
  border-left-color: #ef4444;
}

.stat-card i {
  font-size: 2.5rem;
}

.stat-card.best i {
  color: #10b981;
}

.stat-card.worst i {
  color: #ef4444;
}

.stat-label {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: bold;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.stat-score {
  font-size: 0.875rem;
  color: #94a3b8;
}

.dashboard-leaders {
  margin-bottom: 2rem;
}

.dashboard-leaders h3 {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1e293b;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-leaders h3 i {
  color: #667eea;
}

.leaders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.leader-card {
  background: white;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s;
}

.leader-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.leader-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.leader-title {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.leader-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.leader-value {
  font-size: 1.125rem;
  font-weight: bold;
  color: #667eea;
}

.dashboard-ranking h3 {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1e293b;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-ranking h3 i {
  color: #667eea;
}

.ranking-table-container {
  overflow-x: auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
}

.ranking-table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.ranking-table th {
  padding: 1rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ranking-table td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #e5e7eb;
}

.ranking-table tbody tr:hover {
  background: #f8fafc;
}

.rank-cell {
  font-weight: bold;
  color: #667eea;
}

.name-cell {
  font-weight: 600;
  color: #1e293b;
}

.grade-cell {
  font-size: 1.25rem;
  font-weight: bold;
  text-align: center;
}

.grade-A {
  color: #10b981;
}

.grade-B {
  color: #3b82f6;
}

.grade-C {
  color: #f59e0b;
}

.grade-D {
  color: #ef4444;
}

.grade-F {
  color: #dc2626;
}

.score-cell {
  font-weight: bold;
  color: #667eea;
}

.risk-cell {
  font-weight: 600;
}

.risk-cell.risk-low {
  color: #10b981;
}

.risk-cell.risk-medium {
  color: #f59e0b;
}

.risk-cell.risk-high {
  color: #ef4444;
}

.rank-1 {
  background: rgba(16, 185, 129, 0.05);
}

@media (max-width: 768px) {
  .leaders-grid {
    grid-template-columns: 1fr;
  }
  
  .ranking-table {
    font-size: 0.75rem;
  }
  
  .ranking-table th,
  .ranking-table td {
    padding: 0.5rem;
  }
}

/* ==================== PRESET BUTTONS ==================== */
.preset-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: #0ea5e9;
}

.preset-btn:active {
  transform: translateY(0);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==================== ENHANCED RANKING TABLE ==================== */
.ranking-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

.ranking-table th {
  font-weight: 600;
  font-size: 0.875rem;
}

.ranking-table td {
  font-size: 0.875rem;
}


/* ============================================
   TOGGLE SWITCH FOR MANUAL OVERRIDE
   ============================================ */

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e0;
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #4f46e5;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

/* ============================================
   DASHBOARD CHARTS STYLES (v2.11.3 - NEW DESIGN)
   ============================================ */

/* Section Headers */
.dashboard-comprehensive-section,
.dashboard-metrics-section {
  margin: 2.5rem 0;
}

.section-header {
  margin-bottom: 2rem;
  text-align: center;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.section-title i {
  font-size: 2rem;
  color: #3b82f6;
  animation: pulse 2s infinite;
}

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

.section-title h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.section-description {
  font-size: 1rem;
  color: #64748b;
  margin: 0;
  max-width: 700px;
  margin: 0 auto;
}

/* Comprehensive Chart Cards (Full Width) */
.comprehensive-chart-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  transition: transform 0.3s, box-shadow 0.3s;
}

.comprehensive-chart-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.chart-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-bottom: 2px solid #cbd5e1;
}

.chart-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chart-info h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 0.25rem 0;
}

.chart-info p {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

.chart-body {
  padding: 2rem;
  background: white;
}

.chart-body canvas {
  max-height: 400px !important;
}

/* Metrics Grid (4 Cards) */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.metric-chart-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  border-top: 4px solid;
  transition: transform 0.2s, box-shadow 0.2s;
}

.metric-chart-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.irr-card { border-top-color: #f59e0b; }
.npv-card { border-top-color: #10b981; }
.dscr-card { border-top-color: #3b82f6; }
.health-card { border-top-color: #ef4444; }

.metric-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.irr-card .metric-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.npv-card .metric-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.dscr-card .metric-icon {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.health-card .metric-icon {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.metric-title h5 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 0.25rem 0;
}

.metric-label {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-chart {
  padding: 1.5rem;
  background: white;
}

.metric-chart canvas {
  max-height: 250px !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .section-title h3 {
    font-size: 1.35rem;
  }
  
  .section-title i {
    font-size: 1.5rem;
  }
  
  .chart-header {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
  }
  
  .chart-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .metric-header {
    padding: 1rem;
  }
  
  .metric-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
}

/* ============================================
   OLD STYLES (KEPT FOR COMPATIBILITY)
   ============================================ */

/* Comprehensive Trends Section */
.dashboard-trends {
  margin: 2rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-trends h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e3a8a;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-trends h3 i {
  font-size: 1.75rem;
  color: #3b82f6;
}

.trends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
}

.trend-card {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.trend-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.trend-card h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
  text-align: center;
}

.trend-card .chart-container {
  position: relative;
  height: 350px;
  width: 100%;
}

/* Basic Comparison Charts Section */
.dashboard-aggregate {
  margin: 2rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-aggregate h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-aggregate h3 i {
  font-size: 1.75rem;
  color: #f59e0b;
}

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

.aggregate-card {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.aggregate-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.aggregate-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
  text-align: center;
}

.aggregate-card .chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* Responsive Design for Charts */
@media (max-width: 1200px) {
  .trends-grid {
    grid-template-columns: 1fr;
  }
  
  .aggregate-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-trends,
  .dashboard-aggregate {
    padding: 1rem;
  }
  
  .trends-grid,
  .aggregate-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .trend-card .chart-container {
    height: 250px;
  }
  
  .aggregate-card .chart-container {
    height: 200px;
  }
  
  .dashboard-trends h3,
  .dashboard-aggregate h3 {
    font-size: 1.25rem;
  }
  
  .trend-card h4,
  .aggregate-card h4 {
    font-size: 0.95rem;
  }
}
