/* ==========================================================================
   SickleCare Corporate Theme System
   Melian Foundation Tanzania - Sickle Cell Project
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

:root {
  /* Brand Core Colors */
  --corp-navy-dark: #0f172a;
  --corp-navy: #1e293b;
  --corp-slate: #334155;
  --corp-slate-light: #64748b;
  --corp-slate-muted: #94a3b8;
  --corp-border: #e2e8f0;
  --corp-bg: #f8fafc;
  --corp-card-bg: #ffffff;
  
  /* Primary & Accents */
  --corp-primary: #2563eb;
  --corp-primary-hover: #1d4ed8;
  --corp-primary-light: #eff6ff;
  --corp-accent-teal: #0d9488;
  --corp-accent-cyan: #0ea5e9;
  --corp-accent-indigo: #4f46e5;
  
  /* Clinical Status Badges & Indicators */
  --status-hbaa-color: #059669;
  --status-hbaa-bg: #ecfdf5;
  --status-hbaa-border: #a7f3d0;

  --status-hbas-color: #d97706;
  --status-hbas-bg: #fffbeb;
  --status-hbas-border: #fde68a;

  --status-hbss-color: #dc2626;
  --status-hbss-bg: #fef2f2;
  --status-hbss-border: #fecaca;

  --status-invalid-color: #7c3aed;
  --status-invalid-bg: #f5f3ff;
  --status-invalid-border: #ddd6fe;

  --status-info-color: #0284c7;
  --status-info-bg: #f0f9ff;
  --status-info-border: #bae6fd;

  /* Typography & Shadows */
  --font-family-base: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 10px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 30px -10px rgba(15, 23, 42, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & typography */
body {
  font-family: var(--font-family-base) !important;
  background-color: var(--corp-bg) !important;
  color: var(--corp-slate) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-family-base) !important;
  color: var(--corp-navy-dark) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

/* Card Modernization */
.card, .dashboard-card {
  background: var(--corp-card-bg) !important;
  border: 1px solid var(--corp-border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  transition: var(--transition-normal) !important;
}

.card:hover, .dashboard-card:hover {
  box-shadow: var(--shadow-lg) !important;
  transform: translateY(-2px);
}

.card .header, .card .card-header {
  border-bottom: 1px solid #f1f5f9 !important;
  padding: 18px 24px !important;
  background: transparent !important;
}

.card .header h2, .card .card-header h5 {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: var(--corp-navy) !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card .body, .card .card-body {
  padding: 20px 24px !important;
}

/* Corporate Stat Scorecard */
.stat-scorecard {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--corp-border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--transition-normal);
}

.stat-scorecard:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-scorecard::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--corp-primary);
}

.stat-scorecard.card-hbaa::before { background: var(--status-hbaa-color); }
.stat-scorecard.card-hbas::before { background: var(--status-hbas-color); }
.stat-scorecard.card-hbss::before { background: var(--status-hbss-color); }
.stat-scorecard.card-invalid::before { background: var(--status-invalid-color); }

.stat-scorecard .stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-scorecard .stat-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--corp-slate-light);
}

.stat-scorecard .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-scorecard .stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--corp-navy-dark);
  line-height: 1.1;
  margin-bottom: 6px;
}

.stat-scorecard .stat-footer {
  font-size: 0.82rem;
  color: var(--corp-slate-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Clinical Status Badges */
.badge-corp {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-hbaa {
  color: var(--status-hbaa-color);
  background: var(--status-hbaa-bg);
  border: 1px solid var(--status-hbaa-border);
}

.badge-hbas {
  color: var(--status-hbas-color);
  background: var(--status-hbas-bg);
  border: 1px solid var(--status-hbas-border);
}

.badge-hbss {
  color: var(--status-hbss-color);
  background: var(--status-hbss-bg);
  border: 1px solid var(--status-hbss-border);
}

.badge-invalid {
  color: var(--status-invalid-color);
  background: var(--status-invalid-bg);
  border: 1px solid var(--status-invalid-border);
}

.badge-info {
  color: var(--status-info-color);
  background: var(--status-info-bg);
  border: 1px solid var(--status-info-border);
}

/* Top Navbar & Header Modernization */
.navbar-corp {
  background: #ffffff !important;
  border-bottom: 1px solid var(--corp-border) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03) !important;
  padding: 12px 24px !important;
}

aside.minileftbar {
  background: var(--corp-navy-dark) !important;
  box-shadow: var(--shadow-lg) !important;
}

aside.minileftbar .menu_list li a {
  color: #94a3b8 !important;
  transition: var(--transition-fast) !important;
}

aside.minileftbar .menu_list li a:hover, aside.minileftbar .menu_list li.active a {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: var(--radius-sm);
}

aside.sidebar {
  background: #ffffff !important;
  border-right: 1px solid var(--corp-border) !important;
}

/* Corporate Buttons */
.btn-corp {
  background: var(--corp-primary) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border-radius: var(--radius-sm) !important;
  padding: 10px 20px !important;
  border: none !important;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2) !important;
  transition: var(--transition-fast) !important;
}

.btn-corp:hover {
  background: var(--corp-primary-hover) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
  transform: translateY(-1px);
}

.btn-corp-secondary {
  background: #f1f5f9 !important;
  color: var(--corp-slate) !important;
  font-weight: 600 !important;
  border-radius: var(--radius-sm) !important;
  padding: 10px 20px !important;
  border: 1px solid var(--corp-border) !important;
  transition: var(--transition-fast) !important;
}

.btn-corp-secondary:hover {
  background: #e2e8f0 !important;
  color: var(--corp-navy-dark) !important;
}

/* Input Fields & Forms */
.form-control-corp {
  background-color: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: var(--radius-sm) !important;
  padding: 12px 16px !important;
  font-size: 0.95rem !important;
  color: var(--corp-navy-dark) !important;
  transition: var(--transition-fast) !important;
}

.form-control-corp:focus {
  border-color: var(--corp-primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
  outline: none !important;
}

/* Table Modernization */
.table-corp {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.table-corp th {
  background: #f8fafc !important;
  color: var(--corp-slate-light) !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 14px 16px !important;
  border-bottom: 2px solid var(--corp-border) !important;
}

.table-corp td {
  padding: 14px 16px !important;
  vertical-align: middle !important;
  border-bottom: 1px solid #f1f5f9 !important;
  color: var(--corp-slate) !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
}

.table-corp tbody tr:hover {
  background-color: #f8fafc !important;
}

/* DataTables Corporate Styling */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--corp-primary) !important;
  color: white !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
}

.dataTables_wrapper .dataTables_filter input {
  border: 1.5px solid #cbd5e1 !important;
  border-radius: var(--radius-sm) !important;
  padding: 6px 12px !important;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Login Page Specific Styling */
.login-page-container {
  min-height: 100vh;
  display: flex;
  background: #f8fafc;
}

.login-hero-side {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0284c7 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.login-hero-side::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
}

.login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: #ffffff;
}

.login-card-corp {
  width: 100%;
  max-width: 420px;
}

/* ==========================================================================
   Executive Clinical Dashboard Component System & Animations
   ========================================================================== */

/* Keyframe Animations */
@keyframes pulseGlow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes floatSoft {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
  100% { transform: translateY(0px); }
}

/* Animation Delays */
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }
.delay-5 { animation-delay: 0.40s; }

/* Pulsing Live Badge Dot */
.live-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  animation: pulseGreen 2s infinite;
}

/* Modern Executive Header */
.dashboard-page-header {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--corp-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.dashboard-page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--corp-primary) 0%, var(--corp-accent-cyan) 100%);
}

/* Executive KPI Scorecards */
.kpi-scorecard {
  background: #ffffff;
  border: 1px solid var(--corp-border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-md);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-scorecard:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
}

.kpi-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: transform 0.3s ease;
}

.kpi-scorecard:hover .kpi-icon-wrapper {
  transform: scale(1.08);
}

.kpi-icon-primary { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); color: #2563eb; }
.kpi-icon-success { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); color: #10b981; }
.kpi-icon-info { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); color: #0284c7; }
.kpi-icon-warning { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); color: #f59e0b; }
.kpi-icon-purple { background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%); color: #7c3aed; }

.kpi-val {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--corp-navy-dark);
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--corp-slate-light);
  margin-bottom: 4px;
}

.kpi-subtext {
  font-size: 0.82rem;
  color: var(--corp-slate-light);
  font-weight: 500;
}

/* Phenotype & Diagnostic Summary Box */
.phenotype-summary-container {
  background: #ffffff;
  border: 1px solid var(--corp-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
}

.phenotype-item-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.phenotype-item-card:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Gradients for Progress Bars */
.bg-gradient-primary {
  background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%) !important;
}

.bg-gradient-success {
  background: linear-gradient(90deg, #059669 0%, #10b981 100%) !important;
}

.bg-gradient-info {
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 100%) !important;
}

.bg-gradient-warning {
  background: linear-gradient(90deg, #d97706 0%, #f59e0b 100%) !important;
}

.bg-gradient-danger {
  background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%) !important;
}

.bg-gradient-purple {
  background: linear-gradient(90deg, #7c3aed 0%, #8b5cf6 100%) !important;
}

/* Target Scorecards */
.target-metric-card {
  border: 1px solid var(--corp-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.target-metric-card:hover {
  box-shadow: var(--shadow-md);
}

.target-metric-card.yearly { border-left: 4px solid #2563eb; }
.target-metric-card.quarterly { border-left: 4px solid #10b981; }
.target-metric-card.monthly { border-left: 4px solid #0284c7; }
.target-metric-card.quality { border-left: 4px solid #7c3aed; }

.target-progress-bar {
  height: 8px;
  border-radius: 999px;
  background-color: #f1f5f9;
  overflow: hidden;
}

.target-progress-bar .progress-bar {
  border-radius: 999px;
  transition: width 1s ease-in-out;
}

/* Table Enhancements */
.executive-table-wrapper {
  background: #ffffff;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.executive-table {
  width: 100%;
  margin-bottom: 0;
}

.executive-table thead th {
  background-color: #f8fafc;
  color: var(--corp-slate-light);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 18px;
  border-bottom: 1px solid var(--corp-border);
}

.executive-table tbody td {
  padding: 14px 18px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  color: var(--corp-slate);
}

.executive-table tbody tr {
  transition: background-color 0.2s ease;
}

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

/* Facility Rank Badge */
.facility-rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
}

.rank-1 { background: #fef3c7; color: #d97706; border: 1px solid #fde68a; }
.rank-2 { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.rank-3 { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.rank-other { background: #f8fafc; color: #94a3b8; border: 1px solid #e2e8f0; }

/* Filter Card Styling */
.filter-card {
  background: #f8fafc;
  border: 1px solid var(--corp-border);
  border-radius: var(--radius-md);
  padding: 18px;
}

.form-select-custom {
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--corp-navy-dark);
  transition: var(--transition-fast);
  width: 100%;
}

.form-select-custom:focus {
  border-color: var(--corp-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

/* Mobile Responsive Tweaks */
@media (max-width: 768px) {
  .dashboard-page-header {
    padding: 16px;
  }
  .kpi-scorecard {
    padding: 18px;
  }
  .kpi-val {
    font-size: 1.8rem;
  }
  .phenotype-summary-container {
    padding: 16px;
  }
}

