/**
 * ImPax Platform v3.0 - Component Styles
 */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-border-light);
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-xs);
  border-radius: var(--radius-md);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.btn-send {
  background: var(--color-primary);
  color: white;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
}

.btn-send:hover {
  background: var(--color-primary-hover);
}

/* Quick Action Buttons */
.quick-btn {
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-xs);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-btn:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* Mode Toggle */
.mode-toggle {
  display: flex;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-1);
}

.mode-btn {
  background: transparent;
  color: var(--color-text-secondary);
  border: none;
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-btn:hover {
  color: var(--color-text-primary);
}

.mode-btn.active {
  background: var(--color-primary);
  color: white;
}

/* Cards */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

/* Overview hero card with theme-aware gradient */
.card.overview-hero {
  background: linear-gradient(135deg, rgba(20, 26, 46, 0.95), rgba(18, 29, 52, 0.95));
}

[data-theme="light"] .card.overview-hero {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(6, 182, 212, 0.08));
  border-color: var(--color-border);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Metric Cards */
.metric-card {
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
}

.metric-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  order: 2; /* Label appears below the value */
}

.metric-value {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  order: 1; /* Value appears first (above the label) */
}

.metric-change {
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.metric-change.positive {
  color: var(--color-success);
}

.metric-change.negative {
  color: var(--color-error);
}

/* Chat Messages */
.message {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  max-width: 85%;
  margin-bottom: var(--space-3);
}

.message.user {
  background: var(--color-primary);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: var(--radius-sm);
}

.message.assistant {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  margin-right: auto;
  border-bottom-left-radius: var(--radius-sm);
}

.message.system {
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  text-align: center;
  max-width: 100%;
  font-size: var(--font-size-sm);
}

.message.debug {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--color-info);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  white-space: pre-wrap;
  max-width: 100%;
}

/* Input Fields */
.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.input::placeholder {
  color: var(--color-text-muted);
}

/* Status Indicators */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-warning);
}

/* Support both direct class and parent-based class */
.status-dot.connected,
.is-connected .status-dot {
  background: var(--color-success);
}

.status-dot.disconnected,
.is-disconnected .status-dot {
  background: var(--color-error);
}

.status-dot.connecting,
.is-connecting .status-dot {
  background: var(--color-warning);
  animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Connection Status */
.connection-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.connection-status:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text-primary);
}

/* Connection status row with icon and text */
.connection-status .status-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
}

.connection-status .status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.connection-status .status-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* Connecting spinner animation */
.connection-status.is-connecting .status-icon svg {
  animation: spin 1s linear infinite;
}

/* Connection details (port & table count) */
.status-details {
  flex-basis: 100%;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  padding-left: calc(20px + var(--space-2)); /* Align with text after icon */
  margin-top: calc(-1 * var(--space-1));
  opacity: 0.75;
}

.connection-status.is-connected .status-details {
  color: var(--color-success);
  opacity: 0.85;
}

/* Last connected timestamp */
.status-timestamp {
  flex-basis: 100%;
  font-size: 10px;
  color: var(--color-text-muted);
  padding-left: calc(20px + var(--space-2));
  opacity: 0.6;
}

/* Connection status variations */
.connection-status.is-connected .status-icon {
  color: var(--color-success);
}

.connection-status.is-disconnected .status-icon {
  color: var(--color-error);
}

.connection-status.is-degraded .status-icon {
  color: var(--color-warning);
}

.connection-status.is-connecting .status-icon {
  color: var(--color-warning);
}

/* Data Freshness Indicator */
.data-freshness {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  user-select: none;
  transition: all var(--transition-fast);
}

.data-freshness:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text-primary);
}

.data-freshness .freshness-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
}

.data-freshness .freshness-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.data-freshness .freshness-text {
  font-size: 11px;
  white-space: nowrap;
  opacity: 0.85;
}

/* Freshness status colors */
.data-freshness.fresh .freshness-icon {
  color: var(--color-success);
}

.data-freshness.acceptable .freshness-icon {
  color: var(--color-info);
}

.data-freshness.stale .freshness-icon {
  color: var(--color-warning);
}

.data-freshness.critical .freshness-icon {
  color: var(--color-error);
}

.data-freshness.fresh .freshness-text {
  color: var(--color-success);
}

.data-freshness.stale .freshness-text,
.data-freshness.critical .freshness-text {
  color: var(--color-warning);
}

.ml-service-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.ml-service-status:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text-primary);
}

.ml-service-status .ml-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
}

.ml-service-status .ml-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ml-service-status .ml-text {
  font-size: var(--font-size-xs);
}

.ml-service-status.available .ml-icon,
.ml-service-status.available .ml-text {
  color: var(--color-success);
}

.ml-service-status.unavailable .ml-icon,
.ml-service-status.unavailable .ml-text {
  color: var(--color-warning);
}

/* Loading States */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Pulse Animation */
.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-full);
}

.badge-primary {
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-primary-light);
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

.badge-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
}

/* Tooltip */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  font-size: var(--font-size-xs);
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: var(--z-tooltip);
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

/* ============================================================================
   RADAR DIMENSION LEGEND WITH TOOLTIPS
   ============================================================================ */

.radar-dimension-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.dimension-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  cursor: help;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.dimension-label:hover {
  background: var(--color-bg-card);
  color: var(--color-text-primary);
}

.dimension-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dimension-label .help-icon {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-left: 2px;
  opacity: 0.6;
}

.dimension-label:hover .help-icon {
  opacity: 1;
}

/* Extended tooltip for radar dimensions - allows multi-line content */
.dimension-label.tooltip::after {
  white-space: normal;
  max-width: 280px;
  text-align: left;
  line-height: 1.5;
  padding: 10px 12px;
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
  z-index: var(--z-dropdown);
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}

.dropdown-item {
  display: block;
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.table th {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  background: var(--color-bg-tertiary);
}

.table tr:hover td {
  background: var(--color-bg-tertiary);
}

/* Typing Indicator Animation */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-sm);
  max-width: 85%;
  margin-right: auto;
  margin-bottom: var(--space-3);
}

.typing-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  color: white;
  flex-shrink: 0;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-text-muted);
  animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Assistant Message with Avatar */
.message-with-avatar {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.message-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  color: white;
  flex-shrink: 0;
}

.message-content {
  flex: 1;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-primary);
  max-width: calc(85% - 40px);
}

.message-content p {
  margin: 0;
  line-height: 1.5;
}

.message-content strong {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

/* Debug Output Styling */
.debug-section {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
}

.debug-section-title {
  font-weight: var(--font-weight-semibold);
  color: var(--color-info);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.debug-section-content {
  color: var(--color-text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}

/* Query Status Display */
.query-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.query-status-icon {
  width: 16px;
  height: 16px;
}

.query-status-text {
  flex: 1;
}

.query-status.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.query-status.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
}

/* Insights Panel Styling */
.insight-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}

.insight-item:last-child {
  border-bottom: none;
}

.insight-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.insight-value {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

/* DAX Query Expandable Section (Plan3 style) */
.dax-query-details {
  margin: var(--space-3) 0;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

.dax-query-summary {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

.dax-query-summary:hover {
  color: var(--color-text-primary);
}

.dax-query-details[open] .dax-query-summary {
  border-bottom: 1px solid var(--color-border);
}

.dax-query-code {
  margin: 0;
  padding: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
}

/* Topic Pills with Icons */
.topic-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.topic-pill:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.topic-pill:active {
  transform: translateY(0);
}

/* Proactive Intelligence Pills - Special styling for AI-powered features */
.topic-pill-proactive {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.15));
  border-color: rgba(139, 92, 246, 0.4);
  color: #a78bfa;
}

.topic-pill-proactive:hover {
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  border-color: #8b5cf6;
  color: white;
}

/* Insight Cards Grid (Plan3 style - 2x2 or 4 column) */
.ask-viz-insights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
  .ask-viz-insights {
    grid-template-columns: repeat(4, 1fr);
  }
}

.insight-card {
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  border-left: 3px solid var(--color-primary);
}

.insight-card .insight-label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.insight-card .insight-value {
  display: block;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}

/* Gauge Chart Component */
.gauge-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
}

.gauge-card-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
}

.gauge-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

.gauge-svg {
  width: 100%;
  max-width: 200px;
  height: auto;
}

.gauge-value-arc {
  transition: stroke-dashoffset 0.6s ease-out;
}

.gauge-value-text {
  font-family: var(--font-mono);
}

.gauge-card-description {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  line-height: var(--line-height-relaxed);
}

/* Treemap Component */
.treemap-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: var(--space-2);
  min-height: 200px;
}

.treemap-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  text-align: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: default;
}

.treemap-cell:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.treemap-cell-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.treemap-cell-value {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: white;
}

.treemap-cell-subtext {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.7);
  margin-top: var(--space-1);
}

/* Treemap cell sizes - Europe spans 2 columns */
.treemap-cell.cell-large {
  grid-column: span 2;
}

/* ============================================================================
   THEME TOGGLE (Settings Page)
   ============================================================================ */
.theme-toggle-group {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.theme-toggle-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  background: var(--color-bg-tertiary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  min-width: 100px;
}

.theme-toggle-btn:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-border-light);
}

.theme-toggle-btn.active {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.theme-toggle-btn .theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.theme-toggle-btn.active .theme-icon {
  background: var(--color-accent);
  color: var(--color-bg-primary);
}

.theme-toggle-btn .theme-icon svg {
  stroke: currentColor;
}

.theme-toggle-btn .theme-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
}

.theme-toggle-btn.active .theme-label {
  color: var(--color-accent);
}

/* Card subtitle for settings */
.card-subtitle {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

/* ============================================================================
   MoM CHANGE BADGES (Trend Indicators)
   ============================================================================ */
.mom-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 8px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.mom-badge-up {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.mom-badge-down {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-error);
}

.mom-badge-neutral {
  background: rgba(100, 116, 139, 0.15);
  color: var(--color-text-muted);
}

/* For metrics where down is good (like cost) */
.mom-badge-up.inverted {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-error);
}

.mom-badge-down.inverted {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.mom-badge .trend-arrow {
  font-size: 10px;
  line-height: 1;
}

/* Metric change row with MoM badge */
.metric-change-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.metric-change-row .metric-period {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

/* ============================================================================
   VOICE INPUT BUTTON
   ============================================================================ */
.ask-voice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

.ask-voice-btn:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border-color: var(--color-border-light);
}

.ask-voice-btn:disabled,
.ask-voice-btn.is-loading {
  opacity: 0.65;
  cursor: wait;
}

.ask-voice-btn .voice-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* Recording state */
.ask-voice-btn.recording {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--color-error);
  color: var(--color-error);
  animation: pulse-recording 1.5s ease-in-out infinite;
}

.ask-voice-btn.recording .voice-icon {
  stroke: var(--color-error);
}

@keyframes pulse-recording {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

/* Voice status indicator */
.ask-voice-btn .voice-status {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.ask-voice-btn.recording .voice-status {
  opacity: 1;
  color: var(--color-error);
}

/* Unsupported state */
.ask-voice-btn.unsupported {
  opacity: 0.5;
  cursor: not-allowed;
}

.ask-voice-btn.unsupported:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

/* ========================================
   Settings Toggle Switch
   ======================================== */

.settings-toggle {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.settings-toggle:hover {
  background: var(--color-bg-tertiary);
}

.settings-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--color-text-secondary);
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.settings-toggle input:checked + .toggle-slider {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.settings-toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: white;
}

.settings-toggle input:focus-visible + .toggle-slider {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.toggle-label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.toggle-title {
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

.toggle-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ========================================
   Dashboard Builder
   ======================================== */

.dashboard-builder-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-4);
  height: calc(100vh - 140px);
  min-height: 500px;
}

/* Sidebar */
.dashboard-sidebar {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dashboard-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.dashboard-sidebar-header h3 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  margin: 0;
}

.dashboard-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2);
}

.dashboard-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--space-1);
}

.dashboard-list-item:hover {
  background: var(--color-bg-tertiary);
}

.dashboard-list-item.active {
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid var(--color-primary);
}

.dashboard-item-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  flex: 1;
}

.dashboard-item-name {
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-item-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.dashboard-item-actions {
  display: flex;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.dashboard-list-item:hover .dashboard-item-actions {
  opacity: 1;
}

/* Widget Library */
.widget-library {
  border-top: 1px solid var(--color-border);
  padding: var(--space-3);
  max-height: 200px;
  overflow-y: auto;
}

.widget-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.widget-library-header h4 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  margin: 0;
}

.widget-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.widget-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: grab;
  transition: all var(--transition-fast);
  font-size: var(--font-size-sm);
}

.widget-list-item:hover {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.1);
}

.widget-list-item:active {
  cursor: grabbing;
}

.widget-type-icon {
  font-size: var(--font-size-base);
}

.widget-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Dashboard Canvas */
.dashboard-canvas {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dashboard-canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.dashboard-info h2 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin: 0;
}

.dashboard-info p {
  margin: var(--space-1) 0 0 0;
}

.dashboard-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

/* Dashboard Grid Layouts */
.dashboard-grid {
  flex: 1;
  padding: var(--space-4);
  overflow-y: auto;
  display: grid;
  gap: var(--space-4);
  align-content: start;
}

.dashboard-layout-2-col {
  grid-template-columns: repeat(2, 1fr);
}

.dashboard-layout-3-col {
  grid-template-columns: repeat(3, 1fr);
}

.dashboard-layout-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Empty States */
.empty-canvas {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
}

.empty-canvas-content {
  text-align: center;
  max-width: 400px;
}

.empty-canvas-content svg {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.empty-canvas-content h3 {
  margin: 0 0 var(--space-2) 0;
  font-size: var(--font-size-xl);
}

.empty-canvas-content p {
  color: var(--color-text-muted);
  margin: 0 0 var(--space-4) 0;
}

.dashboard-drop-zone {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-secondary);
  color: var(--color-text-muted);
  min-height: 200px;
}

.dashboard-drop-zone svg {
  margin-bottom: var(--space-3);
  opacity: 0.5;
}

.dashboard-drop-zone.drag-over {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.1);
}

.empty-state {
  padding: var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
}

.empty-state.small {
  padding: var(--space-2);
}

.empty-state p {
  margin: var(--space-1) 0;
}

/* Widget Cards */
.widget-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 250px;
  transition: all var(--transition-fast);
}

.widget-card:hover {
  border-color: var(--color-border-light);
  box-shadow: var(--shadow-md);
}

.widget-card.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.widget-card.drag-over {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.widget-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.widget-card-header h4 {
  flex: 1;
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-card-actions {
  display: flex;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.widget-card:hover .widget-card-actions {
  opacity: 1;
}

.widget-card-body {
  flex: 1;
  padding: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.widget-card-footer {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-tertiary);
}

.widget-card-footer span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
}

/* Icon Buttons */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.btn-icon-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-error);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.modal-body {
  padding: var(--space-4);
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-4);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.form-input,
.form-select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

/* Layout Options */
.layout-options {
  display: flex;
  gap: var(--space-3);
}

.layout-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.layout-option input {
  display: none;
}

.layout-preview {
  display: grid;
  gap: 2px;
  width: 60px;
  height: 40px;
  padding: 4px;
  background: var(--color-bg-tertiary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.layout-preview span {
  background: var(--color-text-muted);
  border-radius: 2px;
  opacity: 0.3;
}

.layout-option input:checked + .layout-preview {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.1);
}

.layout-option input:checked + .layout-preview span {
  background: var(--color-primary);
  opacity: 0.6;
}

.layout-2col {
  grid-template-columns: 1fr 1fr;
}

.layout-3col {
  grid-template-columns: 1fr 1fr 1fr;
}

.layout-grid {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.layout-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Schema Status Display */
.schema-status {
  padding: var(--space-3);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
}

.schema-status-loading {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.schema-status-error {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-error);
  font-size: var(--font-size-sm);
}

.schema-status-warning {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-warning);
  font-size: var(--font-size-sm);
}

.schema-status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.schema-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.schema-stat-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}

.schema-stat-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.schema-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.schema-meta-item strong {
  color: var(--color-text-primary);
}

/* ========================================
   Overview Page Styles (ImPax 2.0 Design)
   ======================================== */

/* Welcome Hero Section */
.overview-welcome-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-8) var(--space-6);
  margin-bottom: var(--space-6);
  gap: var(--space-6);
}

.overview-hero-content {
  flex: 1;
  text-align: left;
}

.overview-hero-status {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.overview-status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.overview-status-live {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.overview-status-ai {
  background: rgba(6, 182, 212, 0.15);
  color: var(--color-primary);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.overview-status-alerts {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.overview-status-alerts:hover {
  background: rgba(245, 158, 11, 0.25);
}

.overview-status-alerts.critical {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.overview-status-alerts.critical:hover {
  background: rgba(239, 68, 68, 0.25);
}

@media (max-width: 768px) {
  .overview-welcome-hero {
    flex-direction: column;
    text-align: center;
  }

  .overview-hero-content {
    text-align: center;
  }

  .overview-hero-status {
    justify-content: center;
    width: 100%;
  }
}

.overview-welcome-title {
  font-size: 2.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-4) 0;
  font-style: italic;
}

.overview-welcome-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  max-width: 700px;
  margin: 0;
  line-height: 1.6;
}

/* Module Cards Grid - 3x2 layout */
.overview-modules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

@media (max-width: 1024px) {
  .overview-modules-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .overview-modules-grid {
    grid-template-columns: 1fr;
  }
}

/* Module Cards */
.overview-module-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.overview-module-card:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-border-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.overview-module-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-4);
}

.overview-module-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
}

.overview-module-icon svg {
  width: 32px;
  height: 32px;
}

.overview-module-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-2) 0;
}

.overview-module-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
  flex-grow: 1;
}

.overview-module-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  font-size: var(--font-size-sm);
}

/* Status Dots */
.status-dot-live,
.status-dot-sample {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot-live {
  background: #06b6d4;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
  animation: pulse-live 2s ease-in-out infinite;
}

.status-dot-sample {
  background: #f59e0b;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Platform Highlights Footer */
.overview-highlights {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.35), rgba(15, 23, 42, 0)),
    var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
}

.overview-highlights-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-4) 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.overview-highlights-content {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-6);
}

.overview-highlights-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-5);
}

.overview-highlight-stat {
  text-align: left;
}

.overview-highlight-value {
  font-size: 1.6rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.1;
  margin-bottom: var(--space-1);
}

.overview-highlight-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.overview-highlights-brand {
  display: flex;
  align-items: center;
  padding-left: var(--space-6);
  border-left: 1px solid var(--color-border);
}

.overview-avision-logo {
  height: 40px;
  width: auto;
  opacity: 0.9;
}

/* Legacy support for old stat classes */
.overview-stat {
  text-align: center;
}

.overview-stat-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.overview-stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

@media (max-width: 960px) {
  .overview-highlights-content {
    grid-template-columns: 1fr;
  }

  .overview-highlights-brand {
    border-left: none;
    padding-left: 0;
    justify-content: flex-start;
  }
}

/* ========================================
   Alerts UI Components
   ======================================== */

/* Alert Badge (for nav/header) */
.alert-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.alert-badge.critical {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-error);
}

.alert-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning);
}

.alert-badge.ok {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
}

/* Alert List */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-bg-tertiary);
  border-left: 3px solid transparent;
}

.alert-item.critical {
  border-left-color: var(--color-error);
  background: rgba(239, 68, 68, 0.08);
}

.alert-item.warning {
  border-left-color: var(--color-warning);
  background: rgba(245, 158, 11, 0.08);
}

.alert-icon {
  font-size: var(--font-size-lg);
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
  min-width: 0;
}

.alert-title {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}

.alert-message {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.alert-value {
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}

/* Threshold Config */
.threshold-grid {
  display: grid;
  gap: var(--space-4);
}

.threshold-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.threshold-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.threshold-name {
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

.threshold-current {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.threshold-inputs {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.threshold-input {
  width: 80px;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  text-align: center;
}

.threshold-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.threshold-level {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.threshold-level-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.threshold-level.warning .threshold-level-label {
  color: var(--color-warning);
}

.threshold-level.critical .threshold-level-label {
  color: var(--color-error);
}

/* Responsive */
@media (max-width: 768px) {
  .overview-quick-actions {
    grid-template-columns: 1fr !important;
  }

  .threshold-item {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .threshold-inputs {
    justify-content: flex-start;
  }
}

/* ============================================================================
   AVIATION CONTROL TOWER DESIGN SYSTEM
   Signature visual elements for the radar/mission control aesthetic
   ============================================================================ */

/* Scan-line texture overlay (subtle CRT effect) */
.main-content::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(16, 185, 129, 0.006) 2px,
    rgba(16, 185, 129, 0.006) 4px
  );
  pointer-events: none;
  z-index: 9998;
}

/* Card Corner Accents - Signature element */
.metric-card,
.card,
.hub-card,
.widget-card {
  position: relative;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
}

.metric-card::before,
.metric-card::after,
.card::before,
.card::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid var(--color-primary);
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.metric-card::before,
.card::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.metric-card::after,
.card::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

.metric-card:hover::before,
.metric-card:hover::after,
.card:hover::before,
.card:hover::after {
  opacity: 1;
}

/* Radar Pulse Status Indicator */
.status-dot-live,
.status-dot.connected,
.is-connected .status-dot {
  background: var(--color-primary);
  box-shadow:
    0 0 6px var(--color-primary),
    0 0 12px var(--color-primary-glow);
  animation: radar-pulse 2s ease-in-out infinite;
}

@keyframes radar-pulse {
  0%, 100% {
    box-shadow:
      0 0 6px var(--color-primary),
      0 0 12px var(--color-primary-glow);
  }
  50% {
    box-shadow:
      0 0 8px var(--color-primary),
      0 0 20px var(--color-primary-glow),
      0 0 40px rgba(16, 185, 129, 0.15);
  }
}

/* Primary button with glow effect */
.btn-primary {
  background: var(--color-primary);
  color: white;
  font-weight: var(--font-weight-semibold);
  border: none;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
  transition: all var(--transition-fast);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

/* Active nav item with left accent bar */
.nav-item.active {
  background: linear-gradient(
    90deg,
    rgba(16, 185, 129, 0.15) 0%,
    transparent 100%
  );
  color: var(--color-primary);
  border-left: 3px solid var(--color-primary);
  margin-left: -3px;
}

.nav-item:hover:not(.active) {
  background: linear-gradient(
    90deg,
    rgba(16, 185, 129, 0.08) 0%,
    transparent 100%
  );
  border-left: 2px solid rgba(16, 185, 129, 0.4);
  margin-left: -2px;
}

/* Staggered page load animations */
.metric-card,
.card,
.hub-card,
.overview-module-card {
  opacity: 0;
  transform: translateY(16px);
  animation: card-enter 0.4s ease forwards;
}

.metric-card:nth-child(1), .hub-card:nth-child(1), .overview-module-card:nth-child(1) { animation-delay: 0.05s; }
.metric-card:nth-child(2), .hub-card:nth-child(2), .overview-module-card:nth-child(2) { animation-delay: 0.1s; }
.metric-card:nth-child(3), .hub-card:nth-child(3), .overview-module-card:nth-child(3) { animation-delay: 0.15s; }
.metric-card:nth-child(4), .hub-card:nth-child(4), .overview-module-card:nth-child(4) { animation-delay: 0.2s; }
.metric-card:nth-child(5), .hub-card:nth-child(5), .overview-module-card:nth-child(5) { animation-delay: 0.25s; }
.metric-card:nth-child(6), .hub-card:nth-child(6), .overview-module-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes card-enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Insight values with accent color */
.insight-value,
.metric-value {
  color: var(--color-primary);
}

/* Topic pills with glow on hover */
.topic-pill:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
  transform: translateY(-2px);
}

/* Proactive/AI pills with gradient */
.topic-pill-proactive {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(16, 185, 129, 0.15));
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--color-primary);
}

.topic-pill-proactive:hover {
  background: linear-gradient(135deg, #06b6d4, #10b981);
  border-color: var(--color-primary);
  color: white;
}

/* Navigation badges updated */
.nav-badge.live {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 0 8px var(--color-primary-glow);
}

.nav-badge.ai {
  background: linear-gradient(135deg, #06b6d4, #10b981);
  color: white;
}

/* Chart container subtle glow */
.ask-viz-chart {
  border: 1px solid var(--color-border);
  box-shadow: inset 0 0 40px rgba(16, 185, 129, 0.02);
}

/* AI Insights section styling */
.ask-ai-insights {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.05), rgba(16, 185, 129, 0.05));
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.ask-ai-insights-list li::before {
  content: '✓';
  font-weight: 700;
  color: var(--color-primary);
}

/* Welcome card with subtle gradient */
.ask-welcome-card {
  background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
  border: 1px solid var(--color-border);
}

.ask-welcome-logo {
  background:
    radial-gradient(circle at 30% 30%, rgba(16, 185, 129, 0.25), transparent 50%),
    linear-gradient(135deg, #0a0f1a, #1a2332);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--color-primary);
}

/* Message styling */
.message.user,
.ask-message.from-user .ask-message-body {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* Answer feedback buttons */
.ask-feedback {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.5rem;
  padding-top: 0.375rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.ask-fb-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s, border-color 0.2s;
}
.ask-fb-btn:hover { opacity: 0.9; border-color: rgba(255,255,255,0.3); }
.ask-fb-btn.active { opacity: 1; border-color: var(--color-primary); }
.ask-fb-btn.active[data-fb="negative"] { border-color: #ef4444; }

/* Resolver badge updates */
.ask-resolver-badge.resolver-cached {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--color-primary);
}

/* Input focus states */
.input:focus,
.ask-input:focus,
.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Send button */
.ask-send-btn,
.btn-send {
  background: var(--color-primary);
  color: white;
  font-weight: var(--font-weight-semibold);
}

.ask-send-btn:hover,
.btn-send:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
}

/* Chart type toggle active state */
.chart-type-btn.active,
.ask-mode-btn.active {
  background: var(--color-primary);
  color: white;
}

/* Export button hover */
.export-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Page header with subtle top glow */
.page-header {
  background:
    radial-gradient(1200px 120px at 50% 0%, rgba(16, 185, 129, 0.06), transparent 70%),
    linear-gradient(180deg, rgba(10, 15, 26, 0.35), rgba(10, 15, 26, 0));
  border: 1px solid var(--color-border);
}

/* Quick action buttons */
.quick-btn:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

/* Overview module cards */
.overview-module-card:hover {
  border-color: var(--color-border-light);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 24px rgba(16, 185, 129, 0.08);
}

/* Overview status badges */
.overview-status-live {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.overview-status-ai {
  background: rgba(6, 182, 212, 0.15);
  color: var(--color-accent);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Scrollbar with accent color */
::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.25);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.4);
}

/* Selection color */
::selection {
  background-color: var(--color-primary);
  color: white;
}

/* Modal overlay with deeper blur */
.modal-overlay {
  background: rgba(10, 15, 26, 0.85);
  backdrop-filter: blur(8px);
}

/* Connection status connected state */
.connection-status.is-connected .status-icon {
  color: var(--color-primary);
}

/* Progress bars with gradient */
.progress-bar.progress-cyan {
  background: linear-gradient(90deg, #06b6d4, #10b981);
}

/* Data table value highlights */
.ask-viz-table .value-currency {
  color: var(--color-primary);
}

.ask-viz-table .value-positive {
  color: var(--color-primary);
}

/* Badge updates */
.badge-success {
  background: rgba(0, 255, 157, 0.1);
  color: var(--color-primary);
}

/* ================================================
   Drill-Down Breadcrumb & Filter Chips
   ================================================ */

.drill-context-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

/* Breadcrumb Trail */
.drill-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.breadcrumb-item {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.breadcrumb-item:hover {
  background: var(--color-bg-card);
  color: var(--color-text-primary);
}

.breadcrumb-item.breadcrumb-root {
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
}

.breadcrumb-item.active {
  background: var(--color-primary);
  color: white;
  font-weight: var(--font-weight-medium);
  cursor: default;
}

.breadcrumb-item.active:hover {
  background: var(--color-primary);
  color: white;
}

.breadcrumb-separator {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  user-select: none;
}

/* Filter Chips */
.filter-chips {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
}

.chip-label {
  color: var(--color-text-secondary);
  text-transform: capitalize;
}

.chip-value {
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
}

/* Clear Filters Button */
.clear-filters-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-left: auto;
}

.clear-filters-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
}

.clear-filters-btn svg {
  width: 14px;
  height: 14px;
}

/* Light Mode Overrides */
[data-theme="light"] .drill-context-bar {
  background: rgba(241, 245, 249, 0.8);
  border-color: #e2e8f0;
}

[data-theme="light"] .breadcrumb-item:hover {
  background: white;
}

[data-theme="light"] .filter-chip {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

/* Drill-Down Loading State */
.drill-loading .ask-viz-chart {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* Chart drill transition */
.ask-viz-chart {
  transition: opacity 0.15s ease;
}

/* Breadcrumb disabled state during loading */
.drill-context-bar.is-loading .breadcrumb-item:not(.active) {
  pointer-events: none;
  opacity: 0.6;
}

/* Breadcrumb item with level indicator */
.breadcrumb-item[title] {
  position: relative;
}

/* Clear filters button disabled state */
.clear-filters-btn:disabled,
.clear-filters-btn.is-loading {
  pointer-events: none;
  opacity: 0.5;
}

/* ============================================================================
   PERFORMANCE ANALYTICS PAGE STYLES
   Resolution Package Analyzer - matches HTML prototype exactly
   ============================================================================ */

/* Package color variables */
.performance-page {
  --package-a: #3b82f6;
  --package-b: #10b981;
  --package-c: #f59e0b;
  --package-d: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  padding: 32px;
  max-width: 1600px;
  margin: 0 auto;
}

/* Page Header */
.performance-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.header-left h1,
.performance-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  color: var(--color-text-primary);
}

.header-left p,
.performance-subtitle {
  color: var(--color-text-muted);
  font-size: 14px;
  margin: 0;
}

.header-right {
  display: flex;
  gap: 12px;
}

/* Package Legend */
.package-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.pkg-a { background: var(--package-a); }
.legend-dot.pkg-b { background: var(--package-b); }
.legend-dot.pkg-c { background: var(--package-c); }
.legend-dot.pkg-d { background: var(--package-d); }

/* Info Callout */
.info-callout {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.info-icon {
  color: var(--package-a);
  font-size: 18px;
  flex-shrink: 0;
}

.info-text {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.info-text strong {
  color: var(--color-text-primary);
}

/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 1200px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Styles */
.card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}

.card.full-width {
  grid-column: 1 / -1;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.card-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.card-body {
  padding: 20px;
}

/* View Toggle */
.view-toggle {
  display: flex;
  background: var(--color-bg-tertiary);
  border-radius: 6px;
  padding: 3px;
}

.view-toggle-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  padding: 6px 12px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.view-toggle-btn.active {
  background: var(--package-a);
  color: white;
}

/* Radar Charts Grid (2x2) */
.radar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.radar-item {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.radar-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.radar-item-title {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.consistency-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
}

.consistency-high {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.consistency-medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.consistency-low {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}

.radar-canvas-container {
  position: relative;
  height: 200px;
}

/* Summary Radar */
.summary-radar-container {
  position: relative;
  height: 350px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Scatter Container */
.scatter-container {
  position: relative;
  height: 350px;
}

/* Dimension Stats */
.dimension-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 768px) {
  .dimension-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.dimension-card {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
}

.dimension-label {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.dimension-value {
  font-size: 24px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 4px;
}

.dimension-detail {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Stats Table */
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.stats-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--color-bg-primary);
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--color-border);
}

.stats-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.stats-table tr:last-child td {
  border-bottom: none;
}

.stats-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.package-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.package-indicator {
  width: 4px;
  height: 28px;
  border-radius: 2px;
}

.metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.metric-sd {
  color: var(--color-text-muted);
  font-size: 11px;
}

.metric-good { color: var(--accent-emerald); }
.metric-warning, .metric-neutral { color: var(--color-text-primary); }
.metric-bad { color: var(--accent-rose); }

.metric-bar {
  width: 60px;
  height: 6px;
  background: var(--color-bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 3px;
}

.quality-score {
  font-size: 16px;
  font-weight: 600;
}

.quality-score.excellent { color: var(--accent-emerald); }
.quality-score.good { color: var(--color-text-primary); }
.quality-score.fair { color: var(--accent-amber); }
.quality-score.poor { color: var(--accent-rose); }

/* Rank Badges */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
}

.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #000; }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #000; }
.rank-3 { background: linear-gradient(135deg, #cd7c32, #b5651d); color: #000; }
.rank-4 { background: var(--color-bg-tertiary); color: var(--color-text-muted); }

/* Filter Button */
.filter-btn {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

/* Loading States */
.radar-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px;
  color: var(--color-text-muted);
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--package-a);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.table-loading,
.no-data {
  text-align: center;
  color: var(--color-text-muted);
  padding: 24px !important;
}

/* Error Message */
.error-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
  border-radius: 8px;
}

/* =============================================================================
   COMPREHENSIVE ANALYTICAL REPORT STYLES
   ============================================================================= */

/* Report Container */
.comprehensive-report {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* Report Sections */
.report-section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
}

.section-header {
  margin-bottom: 24px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  color: white;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.section-description {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* =============================================================================
   EXECUTIVE SUMMARY
   ============================================================================= */

.executive-summary {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(6, 182, 212, 0.05));
  border-color: rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .executive-summary {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(6, 182, 212, 0.08));
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kpi-card {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.kpi-value.highlight {
  color: var(--color-primary);
}

.kpi-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Insights Row */
.insights-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .insights-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.insight-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 18px;
}

.insight-card.positive {
  border-left: 4px solid var(--accent-emerald);
}

.insight-card.opportunity {
  border-left: 4px solid var(--accent-amber);
}

.insight-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.insight-content {
  flex: 1;
  min-width: 0;
}

.insight-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.insight-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.insight-detail {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.insight-value {
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.insight-value.good {
  color: var(--accent-emerald);
}

.insight-value.warning {
  color: var(--accent-amber);
}

/* =============================================================================
   PACKAGE COMPARISON SECTION
   ============================================================================= */

.comparison-layout {
  display: grid;
  gap: 24px;
}

.comparison-row {
  display: grid;
  gap: 24px;
}

@media (min-width: 992px) {
  .comparison-row {
    grid-template-columns: 1fr 1fr;
  }
}

.comparison-card {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 20px;
}

.comparison-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dimension Leaders (4-column grid) */
.dimension-leaders {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 768px) {
  .dimension-leaders {
    grid-template-columns: repeat(4, 1fr);
  }
}

.leader-card {
  background: var(--color-bg-tertiary);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.leader-dimension {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.leader-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-value {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-emerald);
}

/* =============================================================================
   SEGMENT ANALYSIS (Passenger Type, etc.)
   ============================================================================= */

.segment-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .segment-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .segment-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.segment-card {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.segment-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.segment-header {
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.segment-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.segment-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.segment-count {
  font-size: 12px;
  color: var(--color-text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.segment-metrics {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.segment-metric {
  text-align: center;
}

.segment-metric-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.segment-metric-value {
  font-size: 16px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--color-text-primary);
}

.segment-metric-value.good {
  color: var(--accent-emerald);
}

.segment-metric-value.warning {
  color: var(--accent-amber);
}

.segment-metric-value.bad {
  color: var(--accent-rose);
}

.segment-radar {
  padding: 0 16px 16px;
}

.segment-radar-container {
  position: relative;
  height: 180px;
}

/* =============================================================================
   AIRPORT ANALYSIS (Top/Bottom)
   ============================================================================= */

.airport-analysis {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .airport-analysis {
    grid-template-columns: repeat(2, 1fr);
  }
}

.airport-column {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}

.airport-column-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.airport-column.top-performers .airport-column-header {
  background: rgba(16, 185, 129, 0.08);
}

.airport-column.bottom-performers .airport-column-header {
  background: rgba(244, 63, 94, 0.08);
}

.airport-column-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.airport-column-icon {
  font-size: 18px;
}

.airport-list {
  padding: 12px;
}

.airport-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 8px;
  transition: background 0.2s;
}

.airport-card:hover {
  background: var(--color-bg-tertiary);
}

.airport-rank {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.top-performers .airport-rank {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.bottom-performers .airport-rank {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}

.airport-info {
  flex: 1;
  min-width: 0;
}

.airport-code {
  font-size: 15px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--color-text-primary);
}

.airport-stats {
  font-size: 12px;
  color: var(--color-text-muted);
}

.airport-score {
  text-align: right;
}

.airport-score-value {
  font-size: 18px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.top-performers .airport-score-value {
  color: var(--accent-emerald);
}

.bottom-performers .airport-score-value {
  color: var(--accent-rose);
}

.airport-score-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

/* =============================================================================
   TIME ANALYSIS
   ============================================================================= */

.time-analysis {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.timeline-container {
  position: relative;
  height: 300px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 20px;
}

.time-metrics-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 768px) {
  .time-metrics-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

.time-metric-card {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
}

.time-metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.time-metric-value {
  font-size: 22px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}

/* Trend Indicators */
.trend-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
}

.trend-indicator.up {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.trend-indicator.down {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}

.trend-indicator.stable {
  background: rgba(148, 163, 184, 0.15);
  color: var(--color-text-muted);
}

.trend-value {
  font-family: 'JetBrains Mono', monospace;
}

/* =============================================================================
   LOADING & ERROR STATES FOR REPORT
   ============================================================================= */

.report-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  text-align: center;
}

.report-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.report-loading-text {
  font-size: 14px;
  color: var(--color-text-muted);
}

.report-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  background: rgba(244, 63, 94, 0.05);
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-radius: 12px;
}

.report-error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.report-error-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-rose);
  margin-bottom: 8px;
}

.report-error-message {
  font-size: 13px;
  color: var(--color-text-muted);
  max-width: 400px;
}

/* =============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================= */

@media (max-width: 640px) {
  .comprehensive-report {
    padding: 16px;
    gap: 24px;
  }

  .report-section {
    padding: 16px;
  }

  .kpi-value {
    font-size: 22px;
  }

  .section-title {
    font-size: 16px;
  }

  .segment-grid {
    grid-template-columns: 1fr;
  }

  .airport-analysis {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   INSIGHTS HUB - TAB NAVIGATION
   ============================================================================= */

.insights-hub {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* =============================================================================
   INSIGHTS - GLOBAL SEARCH BAR
   ============================================================================= */

.insights-search-section {
  padding: 16px 24px 8px;
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.insights-search-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 16px;
  max-width: 600px;
  position: relative;
}

.insights-search-icon {
  font-size: 16px;
  opacity: 0.6;
}

.insights-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-text-primary);
  font-size: 14px;
  outline: none;
}

.insights-search-input::placeholder {
  color: var(--color-text-muted);
}

.insights-search-btn {
  padding: 6px 16px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.insights-search-btn:hover {
  background: var(--color-primary-hover);
}

/* Search Dropdown */
.insights-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-width: 600px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 100;
  display: none;
  margin-top: 4px;
}

.insights-search-dropdown.active {
  display: block;
}

.search-dropdown-section {
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
}

.search-dropdown-section:last-child {
  border-bottom: none;
}

.search-dropdown-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.search-result-item:hover {
  background: var(--color-bg-tertiary);
}

.search-result-icon {
  font-size: 16px;
  opacity: 0.7;
}

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.search-result-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
}

.search-no-results,
.search-loading {
  padding: 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* Recent Searches Bar */
.insights-recent-searches {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.recent-label {
  margin-right: 8px;
}

.recent-search-link {
  color: var(--color-primary);
  text-decoration: none;
}

.recent-search-link:hover {
  text-decoration: underline;
}

/* =============================================================================
   INSIGHTS - BREADCRUMB NAVIGATION
   ============================================================================= */

.insights-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 24px;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.breadcrumb-item {
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s;
}

.breadcrumb-item:hover:not(.active) {
  color: var(--color-primary);
}

.breadcrumb-item.active {
  color: var(--color-text-primary);
  font-weight: 500;
  cursor: default;
}

.breadcrumb-separator {
  color: var(--color-text-muted);
  margin: 0 4px;
}

/* =============================================================================
   INSIGHTS - GLOBAL FILTERS BAR
   ============================================================================= */

.insights-filters-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 20px;
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.filter-select {
  padding: 4px 10px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-primary);
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.filter-select:focus {
  border-color: var(--color-primary);
}

.filter-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 3px 8px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  font-size: 11px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.filter-chip:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-border-light);
}

.filter-chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* Disabled filter chips - dimension not yet in data model */
.filter-chip.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.filter-group-disabled {
  opacity: 0.5;
}

.filter-group-disabled .filter-label {
  position: relative;
}

.filter-group-disabled .filter-label::after {
  content: ' (coming soon)';
  font-size: 9px;
  color: var(--color-text-muted);
  font-style: italic;
}

.filter-divider {
  width: 1px;
  height: 20px;
  background: var(--color-border);
  display: none; /* Hide dividers to save space */
}

/* =============================================================================
   INSIGHTS - EXECUTIVE SUMMARY BANNER
   ============================================================================= */

.exec-summary {
  display: flex;
  gap: 24px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--color-bg-card) 0%, var(--color-bg-secondary) 100%);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  margin-bottom: 20px;
}

.exec-item {
  flex: 1;
  text-align: center;
  padding: 12px;
  border-right: 1px solid var(--color-border);
}

.exec-item:last-child {
  border-right: none;
}

.exec-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.exec-label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.exec-change {
  font-size: 12px;
  font-weight: 500;
}

.exec-change.positive {
  color: var(--color-success);
}

.exec-change.negative {
  color: var(--color-danger);
}

/* Key Insight Banner */
.insight-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  margin-bottom: 20px;
}

.insight-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.insight-text {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.insight-text strong {
  color: var(--color-text-primary);
}

/* Package Legend Bar */
.package-legend-bar {
  display: flex;
  gap: 24px;
  padding: 12px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

/* =============================================================================
   INSIGHTS - FLIGHT DETAIL PAGE
   ============================================================================= */

.flight-detail-page {
  padding: 24px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-secondary);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: all 0.15s;
}

.back-btn:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

/* Flight Info Card */
.flight-info-card {
  display: flex;
  gap: 24px;
  padding: 24px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  margin-bottom: 20px;
}

.flight-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 30px;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  min-width: 120px;
}

.flight-badge.severe {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.flight-badge.moderate {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.flight-badge-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.flight-badge-number {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.flight-badge-status {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-danger);
  margin-top: 4px;
}

.flight-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.flight-details-row {
  display: flex;
  gap: 32px;
}

.flight-detail-item {
  display: flex;
  gap: 8px;
}

.flight-detail-label {
  font-size: 13px;
  color: var(--color-text-muted);
}

.flight-detail-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.flight-detail-value.disruption-weather {
  color: var(--color-warning);
}

.flight-detail-value.disruption-network {
  color: var(--color-primary);
}

.flight-detail-value.disruption-technical {
  color: var(--color-danger);
}

/* Resolution Summary */
.drilldown-summary {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.drilldown-stat {
  flex: 1;
  text-align: center;
  padding: 16px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.drilldown-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.drilldown-stat-value.score-good {
  color: var(--color-success);
}

.drilldown-stat-value.score-medium {
  color: var(--color-warning);
}

.drilldown-stat-value.score-bad {
  color: var(--color-danger);
}

.drilldown-stat-label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Flight Detail Grid */
.flight-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding-left: 16px;
  border-left: 2px solid var(--color-border);
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
}

.timeline-item.alert::before {
  background: var(--color-warning);
}

.timeline-item.action::before {
  background: var(--color-success);
}

.timeline-item.milestone::before {
  background: var(--color-primary);
}

.timeline-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  min-width: 50px;
}

.timeline-event {
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* Passenger List */
.passenger-list-card {
  margin-top: 20px;
}

.passenger-search {
  padding: 6px 12px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-primary);
  font-size: 12px;
  outline: none;
  width: 200px;
}

.passenger-search::placeholder {
  color: var(--color-text-muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.status-badge.resolved {
  color: var(--color-success);
}

.status-badge.pending {
  color: var(--color-warning);
}

.status-badge.no\ response {
  color: var(--color-warning);
}

/* Load More */
.load-more {
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  cursor: pointer;
}

.load-more:hover {
  background: var(--color-bg-tertiary);
}

/* Tab Navigation Bar */
.insights-tabs {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  flex-shrink: 0;
}

.insights-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px 24px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 200px;
  text-align: left;
}

.insights-tab:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-border-light);
}

.insights-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.insights-tab .tab-icon {
  font-size: 18px;
  opacity: 0.7;
}

.insights-tab.active .tab-icon {
  opacity: 1;
  color: white;
}

.insights-tab .tab-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.insights-tab.active .tab-label {
  color: white;
}

.insights-tab .tab-question {
  font-size: 11px;
  color: var(--color-text-muted);
}

.insights-tab.active .tab-question {
  color: rgba(255, 255, 255, 0.8);
}

/* Tab Content Area */
.insights-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.tab-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  gap: 16px;
  color: var(--color-text-muted);
}

/* =============================================================================
   INSIGHTS PAGES - COMMON STYLES
   ============================================================================= */

.insights-page {
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.insights-page .page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
}

.insights-page .page-header-content {
  flex: 1;
}

.insights-page .page-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.insights-page .page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.insights-page .page-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.insights-page .page-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 8px 0 0;
}

/* Analysis Sections */
.analysis-section {
  margin-bottom: 32px;
}

.analysis-section .section-header {
  margin-bottom: 20px;
}

.analysis-section .section-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.analysis-section .section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  color: white;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.analysis-section .section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.analysis-section .section-description {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
}

/* Analytics Grid */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.analytics-grid .card.span-2 {
  grid-column: span 2;
}

.analytics-grid .card.full-width {
  grid-column: 1 / -1;
}

@media (max-width: 992px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  .analytics-grid .card.span-2 {
    grid-column: span 1;
  }
}

/* Chart Cards */
.chart-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
}

.chart-container {
  position: relative;
  height: 300px;
}

/* Recommendation Card */
.recommendation-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
  border-color: rgba(16, 185, 129, 0.3);
}

.recommendation-content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.recommendation-icon {
  font-size: 32px;
  color: var(--accent-emerald);
}

.recommendation-text {
  flex: 1;
}

.recommendation-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-emerald);
  margin-bottom: 6px;
}

.recommendation-detail {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* =============================================================================
   SEGMENT ANALYSIS PAGE
   ============================================================================= */

.segment-card .segment-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

.segment-card .segment-recommendation {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  font-size: 12px;
}

.segment-card .rec-label {
  color: var(--color-text-muted);
}

.segment-card .rec-value {
  color: var(--color-text-primary);
  font-weight: 500;
}

/* Airport Comparison */
.airport-comparison {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .airport-comparison {
    grid-template-columns: 1fr;
  }
}

.airport-metrics-mini {
  display: flex;
  gap: 12px;
}

.airport-metric-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.airport-metric-mini .metric-label {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.airport-metric-mini .metric-value {
  font-size: 13px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.airport-metric-mini .metric-value.good {
  color: var(--accent-emerald);
}

.airport-metric-mini .metric-value.bad {
  color: var(--accent-rose);
}

/* Segment Insights */
.segment-insight,
.insights-callout {
  margin-top: 16px;
  padding: 16px;
  background: var(--color-bg-tertiary);
  border-radius: 10px;
}

.insight-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.insight-callout .insight-icon {
  font-size: 20px;
}

.insight-callout .insight-text {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.insight-item:last-child {
  margin-bottom: 0;
}

.insight-item .insight-bullet {
  color: var(--color-text-muted);
}

/* Future Section */
.future-section .future-notice {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--color-bg-tertiary);
  border: 1px dashed var(--color-border);
  border-radius: 12px;
}

.future-notice .future-icon {
  font-size: 36px;
  opacity: 0.5;
}

.future-notice .future-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.future-notice .future-description {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* =============================================================================
   TRENDS & ALERTS PAGE
   ============================================================================= */

.trends-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 992px) {
  .trends-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .trends-summary {
    grid-template-columns: 1fr;
  }
}

.trend-metric-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.trend-metric-card .trend-metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.trend-metric-card .trend-metric-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.trend-metric-card .trend-detail {
  font-size: 12px;
  color: var(--color-text-muted);
}

.trend-metric-card .trend-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
}

.trend-metric-card .trend-indicator.up {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.trend-metric-card .trend-indicator.down {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}

.trend-metric-card .trend-indicator.stable {
  background: rgba(148, 163, 184, 0.15);
  color: var(--color-text-muted);
}

/* Alerts Grid */
.alerts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .alerts-grid {
    grid-template-columns: 1fr;
  }
}

.alert-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.alert-card.critical {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.3);
}

.alert-card.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
}

.alert-card.positive {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.alert-card.info {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
}

.alert-card .alert-icon {
  font-size: 20px;
}

.alert-card.critical .alert-icon { color: var(--accent-rose); }
.alert-card.warning .alert-icon { color: var(--accent-amber); }
.alert-card.positive .alert-icon { color: var(--accent-emerald); }
.alert-card.info .alert-icon { color: var(--color-primary); }

.alert-card .alert-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.alert-card .alert-message {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

/* MoM Table */
.mom-table-container {
  overflow-x: auto;
}

.mom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}

.mom-table th {
  text-align: left;
  padding: 14px 16px;
  background: var(--color-bg-tertiary);
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--color-border);
}

.mom-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.mom-table tr:last-child td {
  border-bottom: none;
}

.mom-table .metric-name {
  font-weight: 500;
  color: var(--color-text-primary);
}

.mom-table .metric-value {
  font-family: 'JetBrains Mono', monospace;
}

.mom-table .metric-change {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

.mom-table .metric-change.positive {
  color: var(--accent-emerald);
}

.mom-table .metric-change.negative {
  color: var(--accent-rose);
}

.mom-table .metric-status {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* =============================================================================
   RESPONSIVE ADJUSTMENTS FOR INSIGHTS HUB
   ============================================================================= */

@media (max-width: 768px) {
  .insights-tabs {
    padding: 12px 16px;
  }

  .insights-tab {
    min-width: 160px;
    padding: 12px 16px;
  }

  .insights-tab .tab-question {
    display: none;
  }

  .insights-page {
    padding: 16px;
  }

  .insights-page .page-title {
    font-size: 20px;
  }

  .package-legend {
    display: none;
  }
}

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-6);
  text-align: center;
  color: var(--color-text-secondary);
}

.empty-state-icon {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.empty-state-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  max-width: 400px;
  margin-bottom: var(--space-6);
}

/* ========================================
   Commercial Hub
   ======================================== */

.commercial-hub-stats {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.commercial-hub-stat {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  padding: var(--space-2) var(--space-4);
}

.commercial-hub-stat-value {
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
}

.commercial-hub-stat-label {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.commercial-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

@media (max-width: 1024px) {
  .commercial-hub-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .commercial-hub-grid {
    grid-template-columns: 1fr;
  }
}

.hub-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  min-height: 200px;
}

.hub-card:hover {
  background: var(--color-bg-secondary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.hub-card-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: var(--space-1);
}

.hub-card-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0;
}

.hub-card-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
  flex-grow: 1;
}

.hub-card-link {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  margin-top: var(--space-2);
  transition: opacity 0.15s ease;
}

.hub-card-link:hover {
  opacity: 0.8;
}
