:root {
  color-scheme: light;
  /* Light & Vibrant Color Palette */
  --bg-page: #f8fafc;
  --bg-panel: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-overlay: rgba(248, 250, 252, 0.95);
  --stroke: rgba(15, 23, 42, 0.1);
  --stroke-strong: rgba(15, 23, 42, 0.2);
  --stroke-glow: rgba(59, 130, 246, 0.1);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  
  /* Vibrant Accent Colors */
  --accent-primary: #3b82f6;
  --accent-secondary: #8b5cf6;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --accent-hot: #ec4899;
  --accent-teal: #14b8a6;
  --accent-amber: #f59e0b;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);
  --gradient-vibrant: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 10px 15px rgba(15, 23, 42, 0.1);
  --shadow-xl: 0 20px 25px rgba(15, 23, 42, 0.1);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
  
  /* Borders */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Spacing */
  --transition: 200ms ease;
  
  /* Fonts */
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  
  /* Standardized spacing system for responsive design */
  --spacing-xs: clamp(12px, 1vw, 16px);
  --spacing-sm: clamp(16px, 1.5vw, 24px);
  --spacing-md: clamp(24px, 2vw, 32px);
  --spacing-lg: clamp(32px, 2.5vw, 40px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: 10px;
  background: var(--bg-page);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Dashboard Container */
.dashboard-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Header - Vibrant Light Design */
.dashboard-header {
  padding: 6px 12px;
  border-bottom: 2px solid var(--stroke);
  background: var(--bg-panel);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

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

.dashboard-title {
  font-size: clamp(18px, 1.8vw + 0.5rem, 24px);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: clamp(8px, 0.8vw, 12px);
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-wrap: wrap;
}

.title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-primary);
}

.title-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.update-time {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  padding: 6px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: 999px;
}

.btn-refresh {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.btn-refresh:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
  transform: rotate(180deg);
}

/* Main Layout */
.dashboard-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 0;
}

/* Sidebar - Light Vibrant Design */
.dashboard-sidebar {
  width: clamp(260px, 20vw, 300px);
  flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 2px solid var(--stroke);
  padding: var(--spacing-sm);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.sidebar-section {
  margin-bottom: 0;
}

.sidebar-title {
  font-size: clamp(10px, 0.75vw + 0.25rem, 12px);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: clamp(8px, 0.7vw, 12px);
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.6vw, 8px);
}

.sidebar-title::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), transparent);
  margin-left: 8px;
}

/* Navigation Menu */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-btn {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all var(--transition);
  color: var(--text-secondary);
  background: transparent;
  text-align: left;
}

.nav-btn:hover {
  color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.08);
}

.nav-btn.active {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

/* Status Indicators */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex-shrink: 0;
}

.status-indicator[data-status="success"] .status-dot {
  background: var(--accent-success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-indicator[data-status="error"] .status-dot {
  background: var(--accent-danger);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.status-indicator[data-status="warning"] .status-dot {
  background: var(--accent-warning);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.status-text {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 2px solid var(--stroke);
}

.info-badge {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-primary);
}

.info-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* Social Links */
.sidebar-social {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 2px solid var(--stroke);
  justify-content: center;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  color: var(--text-secondary);
  transition: all var(--transition);
  text-decoration: none;
}

.social-link:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.social-link svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

/* Dashboard Content */
.dashboard-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-sm);
  position: relative;
  max-width: 1800px;
  margin-inline: auto;
  width: 100%;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  backdrop-filter: blur(8px);
}

.loading-overlay.visible {
  display: flex;
}

.loading-content {
  text-align: center;
  max-width: 400px;
  padding: 32px;
}

.loading-icon-wrapper {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-icon {
  width: 100%;
  height: 100%;
  color: var(--accent-primary);
  animation: rotate 1.5s linear infinite;
}

.loading-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

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

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

.loading-message {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.loading-progress {
  width: 100%;
  height: 3px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  width: 60%;
  animation: progressFlow 1.5s ease-in-out infinite;
}

@keyframes progressFlow {
  0%, 100% { width: 30%; }
  50% { width: 70%; }
}

/* View Containers */
.view-container {
  display: none;
  flex-direction: column;
  gap: 24px;
}

.view-container.active {
  display: flex;
}

.view-header {
  margin-bottom: 8px;
}

.view-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.view-title svg {
  color: var(--accent-primary);
  margin-right: 8px;
  flex-shrink: 0;
}

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

/* Storytelling Sections */
.storytelling-section {
  text-align: center;
  padding: 10px 0 8px;
  margin-bottom: 8px;
}

.story-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  background: var(--gradient-vibrant);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.story-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 400;
}

.storytelling-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 10px;
  margin: 8px 0;
  border-left: 3px solid var(--accent-primary);
}

.story-heading {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

.story-heading svg {
  color: var(--accent-primary);
  margin-right: 8px;
}

.card-title svg {
  color: var(--accent-primary);
  margin-right: 6px;
}

.story-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.story-text strong {
  color: var(--accent-primary);
  font-weight: 600;
}

.card-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* Metrics Row */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  width: 100%;
  gap: 8px;
  margin-bottom: 10px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 6px 8px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition);
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}

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

.metric-card.metric-highlight {
  border-color: var(--accent-primary);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
}

.metric-card.metric-highlight::before {
  opacity: 1;
}

.metric-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 6px;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.metric-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

.metric-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  font-weight: 600;
}

.metric-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  margin-bottom: 4px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.metric-sublabel {
  font-size: 10px;
  color: var(--text-tertiary);
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 8px;
  text-align: center;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  font-weight: 600;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 6px 8px;
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-lg);
}

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

.info-card {
  background: var(--bg-card);
  border: 2px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.info-card p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.feature-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
}

.feature-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.feature-item strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.feature-item p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

/* Charts Row */
.charts-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  width: 100%;
}

.chart-container {
  min-height: clamp(300px, 30vh, 450px);
  width: 100%;
  display: flex;
  flex-direction: column;
}

.chart-container.full-width {
  grid-column: 1 / -1;
}

.chart-container .card {
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.chart-container > div {
  flex: 1;
  min-height: clamp(280px, 28vh, 400px);
  max-height: 100%;
  width: 100%;
  overflow: hidden;
}

/* Dashboard Section Navigation */
.dashboard-section-nav {
  display: flex;
  gap: 4px;
  margin: 12px 0 10px;
  padding: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 2px solid var(--stroke);
  overflow-x: auto;
  flex-wrap: wrap;
}

.section-nav-btn {
  flex: 1;
  min-width: 110px;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.section-nav-btn:hover {
  color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.08);
}

.section-nav-btn.active {
  color: white;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-md);
}

.section-nav-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  flex-shrink: 0;
}

/* Dashboard Sections */
.dashboard-section {
  display: none;
  animation: fadeIn 0.3s ease-in;
}

.dashboard-section.active {
  display: block;
}

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

/* Tabs */
.tabs-container {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  padding: 3px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 2px solid var(--stroke);
  overflow-x: auto;
}

.tab-btn {
  padding: 6px 11px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.06);
}

.tab-btn.active {
  color: #ffffff;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-md);
}

.tab-content {
  display: none;
}

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

/* Forms */
.prediction-form-card {
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 9px;
  margin-bottom: 10px;
}

/* Predictions layout - changed from grid to stacked */
.predictions-main-col {
  width: 100%;
  margin-bottom: var(--spacing-md);
}

.predictions-side-col {
  width: 100%;
}

/* Removed grid - now using stacked layout */

.predictions-side-card {
  /* Removed height: 100% for stacked layout */
}

.predictions-side-list {
  margin-top: 12px;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-secondary);
}

.predictions-side-list li + li {
  margin-top: 6px;
}

.form-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-select {
  padding: 6px 8px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 2px solid var(--stroke);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition);
}

.form-input:hover,
.form-select:hover {
  border-color: var(--accent-primary);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Buttons */
.btn-primary {
  padding: 6px 11px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.btn-primary .btn-icon,
.btn-secondary .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

.btn-primary .btn-icon svg,
.btn-secondary .btn-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  padding: 6px 11px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
  border: 2px solid var(--stroke);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Upload Area */
.upload-area {
  border: 1px dashed var(--stroke);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 16px;
}

.upload-area:hover {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.05);
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.upload-content svg {
  color: var(--accent-primary);
}

.upload-content p {
  color: var(--text-secondary);
  font-weight: 500;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Prediction Results */
.prediction-result {
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-top: 10px;
}

.prediction-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.prediction-company {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.prediction-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.prediction-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  font-size: 11px;
  color: var(--text-secondary);
}

.prediction-chip.muted {
  opacity: 0.8;
}

.prediction-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.prediction-label {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.prediction-copy {
  font-size: 11px;
  color: var(--text-secondary);
  max-width: 420px;
}

.prediction-label.high {
  color: var(--accent-success);
}

.prediction-label.medium {
  color: var(--accent-warning);
}

.prediction-label.low {
  color: var(--accent-danger);
}

.prediction-confidence {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.prediction-confidence-block {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prediction-confidence-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.confidence-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
  border: 1px solid var(--stroke);
}

.confidence-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 260ms ease-out;
}

.prediction-confidence-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.prediction-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 4px;
  align-items: stretch;
}

.prediction-metrics {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prediction-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prediction-metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.prediction-metric-value {
  font-size: 12px;
  font-weight: 600;
}

.prediction-metric-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  font-size: 12px;
  color: var(--text-secondary);
}

.prediction-metric-pill.muted {
  opacity: 0.8;
}

.prediction-chart-wrapper {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  padding: 12px 12px 4px;
}

.prediction-chart-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.prediction-chart {
  width: 100%;
  height: 130px;
}

.batch-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.batch-summary-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  background: var(--bg-elevated);
  padding: 12px 14px;
}

.batch-summary-card.high {
  border-color: rgba(16, 185, 129, 0.4);
}

.batch-summary-card.medium {
  border-color: rgba(245, 158, 11, 0.4);
}

.batch-summary-card.low {
  border-color: rgba(239, 68, 68, 0.4);
}

.batch-summary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.batch-summary-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Model Params */
.model-params {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.param-item {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
}

.param-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.param-value {
  color: var(--accent-primary);
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Insights Tabs */
.insights-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.insight-tab-btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 2px solid var(--stroke);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.insight-tab-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.insight-tab-btn.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
}

.insight-content {
  display: none;
}

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

/* Footer */
.dashboard-footer {
  padding: 10px 14px;
  border-top: 2px solid var(--stroke);
  background: var(--bg-panel);
  flex-shrink: 0;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-section h4 {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer-section p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-elevated);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 6px;
  border: 2px solid var(--bg-elevated);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* Responsive */
@media (max-width: 1200px) {
  .metrics-row {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .charts-row {
    grid-template-columns: 1fr;
  }
  
  .dashboard-sidebar {
    width: clamp(240px, 22vw, 280px);
  }
}

/* Ultrawide display optimizations */
@media (min-width: 1920px) {
  .dashboard-content {
    max-width: 1800px;
    margin-inline: auto;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }
}

@media (min-width: 2560px) {
  .dashboard-content {
    max-width: 1800px;
    margin-inline: auto;
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
  }
}

@media (max-width: 768px) {
  .dashboard-main {
    flex-direction: column;
  }
  
  .dashboard-sidebar {
    width: 100%;
    max-height: clamp(300px, 40vh, 400px);
    border-right: none;
    border-bottom: 2px solid var(--stroke);
    padding: var(--spacing-sm);
    gap: var(--spacing-sm);
  }
  
  .metrics-row {
    grid-template-columns: 1fr;
  }
  
  .charts-row {
    grid-template-columns: 1fr;
  }

  .dashboard-content {
    padding: var(--spacing-xs);
    max-width: 100%;
  }
  
  .form-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   Global Native UI Overrides
   ============================================================================ */

/* Scrollbars - Webkit */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-page);
}

::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.4);
  border-radius: 4px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.6);
}

/* Scrollbars - Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.4) var(--bg-page);
}

/* Text Selection */
::selection {
  background: rgba(59, 130, 246, 0.25);
  color: var(--text-primary);
}

::-moz-selection {
  background: rgba(59, 130, 246, 0.25);
  color: var(--text-primary);
}

/* Inputs & Dropdowns */
input,
textarea,
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 14px;
  font: inherit;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%233b82f6' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-color: var(--accent-primary);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

/* Focus Ring */
*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

