/*
 * UIP LOA Projections - Application Stylesheet
 *
 * Structure:
 * - CSS variables and base reset
 * - Layout: header, navigation, main container
 * - Components: cards, metric grid, forms, buttons, tables
 * - Status badges and minimal Bootstrap-like compatibility classes used by JS-rendered HTML
 * - Alerts, loading states, tooltips
 * - Responsive adjustments and utility classes
 */
/* ==================== CSS VARIABLES ==================== */
:root {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --primary-light: #C7D2FE;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --gray: #6B7280;
  --gray-light: #F3F4F6;
  --white: #FFFFFF;
  --border: #E5E7EB;
  --text: #111827;
  --text-secondary: #374151;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --radius: 6px;
}

/* ==================== RESET & BASE ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--gray-light);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
}

/* ==================== LAYOUT ==================== */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  height: 60px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

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

.header-center {
  flex: 1;
  justify-content: center;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 20px;
}

.logo-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* App Body Layout */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: calc(100vh - 60px);
}

.sidebar-section {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
}

.sidebar-section.sidebar-bottom {
  margin-top: auto;
  border-bottom: none;
  border-top: 1px solid var(--border);
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 4px 12px;
  margin-bottom: 4px;
}

.sidebar-item {
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin-bottom: 2px;
}

.sidebar-item:hover {
  background: var(--gray-light);
  color: var(--text);
}

.sidebar-item.active {
  background: var(--primary);
  color: var(--white);
}

.sidebar-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-label {
  flex: 1;
}

/* Navigation */
.nav-tabs {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.nav-tabs-inner {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
}

.nav-tab {
  padding: 12px 20px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text);
  background: var(--gray-light);
}

.nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Main Content */
.main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: var(--gray-light);
  height: calc(100vh - 60px);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== COMPONENTS ==================== */

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* Sections */
.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.kpi-section,
.insights-section {
  margin-bottom: 24px;
}

/* Metric Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid transparent;
  transition: all 0.3s;
}

.metric-card.kpi-card {
  border-left-color: var(--primary);
}

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

.metric-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-icon {
  font-size: 16px;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.metric-change {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
}

.metric-change.positive {
  color: var(--success);
}

.metric-change.negative {
  color: var(--danger);
}

/* Chart Card */
.chart-card {
  margin-bottom: 24px;
}

.chart-container {
  padding: 20px;
  position: relative;
}

/* Insights */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.insight-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 16px;
  align-items: center;
}

.insight-icon {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--gray-light);
}

.insight-icon.warning {
  background: rgba(245, 158, 11, 0.1);
}

.insight-icon.success {
  background: rgba(16, 185, 129, 0.1);
}

.insight-icon.info {
  background: rgba(79, 70, 229, 0.1);
}

.insight-content {
  flex: 1;
}

.insight-title {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  font-weight: 500;
}

.insight-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.insight-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.insight-action {
  margin-top: 8px;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
}

/* Summary Grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 16px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.summary-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.summary-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--white);
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--gray-light);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-icon {
  font-size: 14px;
}

/* Tables */
.table-container {
  overflow: auto;
  max-height: 600px;
  margin: -20px;
  padding: 20px;
  position: relative;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  position: relative;
}

.table th {
  background: var(--gray-light);
  padding: 10px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Sticky first column for forecast table */
#forecast-table th:first-child,
#forecast-table td:first-child {
  position: sticky;
  left: 0;
  background: var(--white);
  z-index: 5;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

#forecast-table th:first-child {
  background: var(--gray-light);
  z-index: 11;
}

.table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.table tr:hover {
  background: var(--gray-light);
}

.table-number {
  text-align: right;
  font-family: 'Courier New', monospace;
  position: relative;
}

/* Visual bars in table cells */
.table-cell-bar {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 2px;
  opacity: 0.3;
  z-index: 0;
}

.table-cell-bar.positive {
  background: var(--success);
}

.table-cell-bar.negative {
  background: var(--danger);
}

.table-cell-value {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 0 4px;
  background: rgba(255, 255, 255, 0.9);
}

/* Table row emphasis states used by agents grid */
tr.table-danger {
  background: rgba(239, 68, 68, 0.08);
}

tr.table-warning {
  background: rgba(245, 158, 11, 0.08);
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Additional badges used in UI */
.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: #3B82F6;
}

/* Minimal compatibility classes for Bootstrap-like elements used in JS */
.badge-primary {
  background: rgba(59, 130, 246, 0.1);
  color: #3B82F6;
}

.badge-secondary {
  background: rgba(107, 114, 128, 0.1);
  color: #6B7280;
}

.text-muted {
  color: var(--text-secondary);
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.col-md-6 {
  width: 100%;
}

.col-md-12 {
  grid-column: 1 / -1;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card-body {
  padding: 16px;
}

/* Loading & Empty States */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state-message {
  font-size: 14px;
  margin-bottom: 20px;
}

.empty-state-action {
  margin-top: 20px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-info {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Accordion */
.accordion-container {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.accordion-section {
  border-bottom: 1px solid var(--border);
}

.accordion-section:last-child {
  border-bottom: none;
}

.accordion-header {
  width: 100%;
  padding: 16px 20px;
  border: none;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s;
  text-align: left;
}

.accordion-header:hover {
  background: var(--gray-light);
}

.accordion-header.active {
  background: var(--gray-light);
}

.accordion-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
}

.accordion-title {
  flex: 1;
}

.accordion-toggle {
  font-size: 12px;
  transition: transform 0.3s;
}

.accordion-header.active .accordion-toggle {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 20px;
  border-top: 1px solid var(--border);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .main {
    padding: 12px;
  }

  .card {
    padding: 16px;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .table {
    font-size: 12px;
  }

  .table th,
  .table td {
    padding: 8px 6px;
  }

  /* Off-canvas sidebar for mobile */
  .sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    height: calc(100vh - 60px);
    transform: translateX(-260px);
    transition: transform 0.2s ease;
    z-index: 1001;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1000;
  }

  /* Show burger */
  #sidebar-toggle {
    display: inline-flex !important;
  }
}

/* Advanced column toggle */
.hide-advanced .advanced-col {
  display: none;
}

#notification-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  width: 300px;
}

.alert .close-btn {
  position: absolute;
  top: 5px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.tooltip {
  position: absolute;
  background-color: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1001;
  pointer-events: none;
  transform: translateX(-50%);
}

/* ==================== FINANCIAL BREAKDOWN ==================== */
.financial-breakdown {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
}

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

.breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.breakdown-item.header {
  font-weight: 700;
  color: var(--text);
  background-color: var(--gray-light);
  font-size: 15px;
}

.breakdown-item.sub-item {
  padding-left: 30px;
  font-size: 13px;
}

.breakdown-item.sub-sub-item {
  padding-left: 50px;
  font-size: 12px;
  color: var(--text-secondary);
}

.breakdown-item.summary-line {
  font-weight: 700;
  border-top: 2px solid var(--text);
  margin-top: 8px;
}

.breakdown-value {
  font-weight: 700;
}

.money-in {
  color: var(--success);
}

.money-out {
  color: var(--danger);
}

.money-neutral {
  color: var(--text-secondary);
}

/* ==================== INTERACTIVE VISUALIZER ==================== */
.visualizer-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 16px 0;
}

.visualizer-section {
  background: #f8f9fa;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.visualizer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.tooltip-trigger {
  font-size: 14px;
  color: var(--primary);
  cursor: help;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.tooltip-trigger:hover {
  opacity: 1;
}

/* Waterfall Chart Styling */
.waterfall-chart {
  position: relative;
  height: 200px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
}

.waterfall-bars {
  display: flex;
  align-items: end;
  height: 100%;
  gap: 8px;
  min-width: 600px;
}

.waterfall-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 80px;
}

.waterfall-column {
  position: relative;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  border-radius: 4px 4px 0 0;
  min-height: 10px;
  width: 100%;
  transition: all 0.3s ease;
}

.waterfall-column.positive {
  background: linear-gradient(135deg, var(--success), #16A34A);
}

.waterfall-column.negative {
  background: linear-gradient(135deg, var(--danger), #DC2626);
  opacity: 0.8;
}

.waterfall-column.net {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: 2px solid var(--primary-dark);
}

.waterfall-label {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  color: var(--text-secondary);
  line-height: 1.2;
}

.waterfall-value {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  background: var(--white);
  padding: 2px 4px;
  border-radius: 2px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* Timeline Chart Styling */
.timeline-chart {
  position: relative;
  height: 150px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
}

.timeline-container {
  position: relative;
  height: 100%;
  min-width: 600px;
}

.timeline-axis {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
}

.timeline-point {
  position: absolute;
  bottom: 20px;
  transform: translateX(-50%);
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--primary);
  position: relative;
  z-index: 2;
}

.timeline-dot.upfront {
  background: var(--success);
  box-shadow: 0 0 0 2px var(--success);
}

.timeline-dot.deferred {
  background: var(--warning);
  box-shadow: 0 0 0 2px var(--warning);
}

.timeline-dot.reserve {
  background: var(--gray);
  box-shadow: 0 0 0 2px var(--gray);
}

.timeline-dot.chargeback {
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--danger);
}

.timeline-label {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
}

.timeline-amount {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
}

.timeline-flow {
  position: absolute;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  z-index: 1;
}

.timeline-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Financial Controls Styling */
.financial-timeline {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  height: 60px;
  margin-bottom: 16px;
}

.month-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  position: relative;
}

.reserve-bar,
.chargeback-bar,
.release-bar {
  width: 100%;
  border-radius: 2px 2px 0 0;
  transition: all 0.2s ease;
  cursor: pointer;
}

.reserve-bar {
  background: linear-gradient(180deg, var(--warning), #D97706);
}

.chargeback-bar {
  background: linear-gradient(180deg, var(--danger), #DC2626);
}

.release-bar {
  background: linear-gradient(180deg, var(--success), #16A34A);
}

.month-label {
  position: absolute;
  bottom: -16px;
  font-size: 8px;
  color: var(--text-secondary);
  text-align: center;
}

/* Enhanced tooltips */
.enhanced-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: var(--white);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.4;
  max-width: 300px;
  z-index: 1002;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateX(-50%);
}

.enhanced-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
}

/* Responsive adjustments for visualizers */
@media (max-width: 768px) {
  .visualizer-container {
    gap: 16px;
  }

  .visualizer-section {
    padding: 16px;
  }

  .waterfall-chart,
  .timeline-chart {
    height: 180px;
    padding: 12px;
  }

  .waterfall-bars {
    min-width: 500px;
    gap: 6px;
  }

  .waterfall-bar {
    min-width: 60px;
  }

  .timeline-container {
    min-width: 500px;
  }

  .timeline-legend {
    gap: 12px;
  }
}

/* ==================== CONFIGURATION PAGE SPACING ==================== */
.config-page .accordion-container {
  margin-top: 12px;
}

.config-page .accordion-content {
  padding: 16px 20px;
}

.config-page .accordion-content p.text-muted {
  margin: 4px 0 12px;
  padding: 0;
}

.config-page .form-row {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 16px;
}

.config-page .form-group {
  margin-bottom: 12px;
}

.config-page .form-label {
  margin-bottom: 8px;
}

.config-page hr {
  margin: 16px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

#config>.btn-group {
  margin-top: 16px;
}