/* =============================================================================
   Executive Dashboard Styles
   Healthcare-focused, professional design for C-suite consumption
   ============================================================================= */

.dashboard-container {
  /* Fluid width with a sensible cap for large displays */
  width: min(96vw, 1600px);
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
}

/* Subtle cosmic field to feel futuristic without noise */
.dashboard-container::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60vmax 60vmax at 20% 0%, rgb(126 34 206 / 14%), transparent 60%),
    radial-gradient(50vmax 50vmax at 90% 30%, rgb(6 182 212 / 12%), transparent 60%),
    radial-gradient(40vmax 40vmax at 10% 90%, rgb(244 63 94 / 10%), transparent 60%);
  filter: blur(2px) saturate(105%);
}

/* Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.header-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 0.5rem;
}

.subtitle {
  /* Improve contrast for readability on dark background */
  color: #d1d5db;
  font-size: 1.1rem;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn-secondary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgb(13 148 136 / 15%);
  border: 1px solid #0d9488;
  border-radius: 8px;
  color: #5eead4;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgb(168 85 247 / 20%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgb(168 85 247 / 30%);
}

.time-filter {
  padding: 0.75rem 1rem;
  background: var(--glass-background);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: #e5e7eb;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.time-filter:hover {
  border-color: var(--glass-border-strong);
}

.time-filter:focus {
  outline: none;
  border-color: var(--color-secondary-400);
  box-shadow: 0 0 0 3px rgb(6 182 212 / 18%);
}

/* Key Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--glass-background);
  backdrop-filter: blur(var(--blur-md));
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-glass-sm);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--color-primary-500) 0%, var(--color-secondary-500) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glass-md);
  border-color: var(--glass-border-strong);
}

.metric-card.primary {
  background: var(--gradient-card);
  border-color: var(--color-primary-400);
}

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

.metric-icon {
  display: none;
  /* Remove emoji-style icons for a cleaner, scientific look */
}

.metric-content {
  flex: 1;
}

.metric-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: #f9fafb;
  line-height: 1.2;
}

.metric-label {
  color: var(--color-neutral-200);
  font-size: 0.9rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

.metric-change {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-neutral-300);
}

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

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

/* Sparklines */
.sparkline {
  margin-top: 0.75rem;
  opacity: 0.7;
  color: var(--color-secondary-400, #22d3ee);
  transition: opacity 0.3s ease;
}

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

.metric-card.primary .sparkline {
  color: #f97316;
}

/* Charts Row */
.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--glass-background);
  backdrop-filter: blur(var(--blur-md));
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.chart-card:hover {
  border-color: var(--glass-border-strong);
  box-shadow: var(--shadow-glass-md);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.chart-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #f9fafb;
  margin: 0;
}

.chart-info {
  color: #d1d5db;
  font-size: 0.9rem;
}

.chart-container {
  position: relative;
  height: 340px;
}

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

/* Action Items Section */
.action-items-section {
  margin-bottom: 2rem;
}

.section-header {
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #f9fafb;
  margin: 0 0 0.5rem;
}

.section-header p {
  color: #9ca3af;
  font-size: 1rem;
  margin: 0;
}

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

.action-item {
  background: var(--glass-background);
  backdrop-filter: blur(var(--blur-md));
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.action-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: #6b7280;
}

.action-item[data-priority="high"]::before {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.action-item[data-priority="medium"]::before {
  background: linear-gradient(90deg, #f97316 0%, #ea580c 100%);
}

.action-item[data-priority="low"]::before {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.action-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glass-md);
  border-color: var(--glass-border-strong);
}

.action-header {
  margin-bottom: 1rem;
}

.priority-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.priority-badge.high {
  background: rgb(239 68 68 / 20%);
  color: #fca5a5;
  border: 1px solid #ef4444;
}

.priority-badge.medium {
  background: rgb(249 115 22 / 20%);
  color: #fdba74;
  border: 1px solid #f97316;
}

.priority-badge.low {
  background: rgb(16 185 129 / 20%);
  color: #6ee7b7;
  border: 1px solid #10b981;
}

.action-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f9fafb;
  margin: 0;
}

.action-description {
  color: #d1d5db;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.action-impact,
.action-recommendation {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: rgb(55 65 81 / 50%);
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.action-impact strong,
.action-recommendation strong {
  color: #f97316;
  display: block;
  margin-bottom: 0.25rem;
}

.action-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #374151;
}

.btn-action {
  flex: 1;
  padding: 0.625rem 1rem;
  background: var(--gradient-primary);
  border: none;
  border-radius: 6px;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgb(126 34 206 / 35%);
}

.btn-secondary-small {
  padding: 0.625rem 1rem;
  background: rgb(13 148 136 / 15%);
  border: 1px solid #0d9488;
  border-radius: 6px;
  color: #5eead4;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary-small:hover {
  background: rgb(13 148 136 / 25%);
  border-color: #2dd4bf;
}

/* Table Section */
.table-section {
  margin-bottom: 2rem;
}

.table-container {
  background: var(--glass-background);
  backdrop-filter: blur(var(--blur-md));
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
}

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

.data-table thead {
  background: rgb(126 34 206 / 10%);
}

.data-table th {
  padding: 1rem 1.5rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-primary-300);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--glass-border);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.2s ease;
}

.data-table tbody tr:hover {
  background: rgb(126 34 206 / 7%);
}

.data-table td {
  padding: 1rem 1.5rem;
  color: #d1d5db;
  font-size: 0.95rem;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-badge.good {
  background: rgb(16 185 129 / 20%);
  color: #6ee7b7;
  border: 1px solid #10b981;
}

.status-badge.moderate {
  background: rgb(249 115 22 / 20%);
  color: #fdba74;
  border: 1px solid #f97316;
}

.status-badge.low {
  background: rgb(239 68 68 / 20%);
  color: #fca5a5;
  border: 1px solid #ef4444;
}

/* Quick Links Section */
.quick-links-section {
  margin-bottom: 2rem;
}

.quick-links-section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #f9fafb;
  margin: 0 0 1.5rem;
}

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

.quick-link-card {
  background: var(--glass-background);
  backdrop-filter: blur(var(--blur-md));
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.quick-link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgb(126 34 206 / 12%) 0%, rgb(6 182 212 / 12%) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.quick-link-card:hover::before {
  opacity: 1;
}

.quick-link-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glass-lg);
  border-color: var(--glass-border-strong);
}

.link-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 2px 8px rgb(126 34 206 / 30%));
}

.link-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f9fafb;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.link-description {
  color: #d1d5db;
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

/* Responsive Design */
@media (width <=768px) {
  .dashboard-container {
    padding: 1rem;
  }

  .dashboard-header {
    flex-direction: column;
    gap: 1rem;
  }

  .header-content h1 {
    font-size: 2rem;
  }

  .header-actions {
    width: 100%;
    flex-direction: column;
  }

  .btn-secondary,
  .time-filter {
    width: 100%;
  }

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

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

  .action-items-grid {
    grid-template-columns: 1fr;
  }

  .quick-links-grid {
    grid-template-columns: 1fr;
  }

  .table-container {
    overflow-x: auto;
  }

  .chart-container {
    height: 250px;
  }
}

/* Ultra-wide enhancements for executive desktops */
@media (width >=1280px) {
  .metrics-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .charts-row {
    grid-template-columns: repeat(2, minmax(480px, 1fr));
  }

  .chart-container {
    height: 420px;
  }

  .metric-value {
    font-size: 2.5rem;
  }
}

/* Print Styles */
@media print {
  .dashboard-header .header-actions {
    display: none;
  }

  .action-footer {
    display: none;
  }

  .quick-links-section {
    display: none;
  }

  .dashboard-container {
    background: white;
  }

  .metric-card,
  .chart-card,
  .action-item,
  .table-container,
  .quick-link-card {
    background: white;
    border-color: #ccc;
    box-shadow: none;
  }

  .metric-value,
  .chart-header h2,
  .section-header h2,
  .action-header h3,
  .data-table th {
    color: #000;
  }
}

/* =============================================================
   Completeness + Top Insights (lightweight styles)
   ============================================================= */
.completeness-section {
  margin-bottom: 2rem;
}

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

.completeness-card {
  background: var(--glass-background);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.completeness-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .5rem;
}

.comp-label {
  color: #e5e7eb;
  font-weight: 600;
}

.comp-value {
  color: #9ca3af;
  font-size: .9rem;
}

.progress {
  background: rgb(0 0 0 / 25%);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--color-primary-500), var(--color-secondary-500));
  height: 100%;
  width: 0;
  transition: width .6s ease;
}

.comp-percent {
  color: #d1d5db;
  font-size: .85rem;
  margin-top: .5rem;
}

.top-section {
  margin-bottom: 2rem;
}

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

.top-card {
  background: var(--glass-background);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.top-list {
  list-style: decimal inside;
  margin: 0;
  padding: 0;
}

.top-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: .5rem;
  padding: .5rem 0;
  border-bottom: 1px dashed #374151;
}

.top-list li:last-child {
  border-bottom: 0;
}

.top-list .name {
  color: #f9fafb;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.top-list .meta {
  color: #9ca3af;
}

.top-list .count {
  color: #fbbf24;
  font-weight: 700;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.tag {
  background: rgb(13 148 136 / 15%);
  color: #5eead4;
  border: 1px solid #0d9488;
  border-radius: 999px;
  padding: .35rem .75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.tag i {
  font-style: normal;
  color: #2dd4bf;
  font-weight: 700;
}
