
/* ============================================================
   MOBILE HEADER & DRAWER BASE RULES (Hidden on Desktop)
   ============================================================ */
.mobile-header {
  display: none;
}
.sidebar-backdrop {
  display: none;
}
.sidebar-close-btn {
  display: none;
}
.sidebar-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: #111827;
  padding: 25px 15px;
  color: white;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-nav {
  flex: 1;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  padding: 10px;
  margin-bottom: 30px;
}

.logo span {
  display: block;
  font-size: 11px;
  opacity: .6;
  margin-top: 4px;
}

.sidebar button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #d1d5db;
  padding: 13px;
  text-align: left;
  border-radius: 8px;
  margin-bottom: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.sidebar button:hover,
.sidebar button.active {
  background: #2563eb;
  color: white;
  font-weight: 600;
}

.main {
  flex: 1;
  padding: 30px;
  min-width: 0;
}

.topbar {
  margin-bottom: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-user-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
}

.topbar p {
  color: #6b7280;
  margin: 4px 0 0 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.card span {
  display: block;
  color: #6b7280;
  font-size: 13px;
}

.card strong {
  display: block;
  font-size: 28px;
  margin-top: 10px;
}

.warning strong {
  color: #d97706;
}

.danger strong {
  color: #dc2626;
}

.reminder strong {
  color: #2563eb;
}

.panel {
  background: white;
  padding: 25px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-header h2 {
  margin: 0;
  font-size: 20px;
}

.panel-header p {
  color: #6b7280;
  margin-bottom: 0;
}

.btn {
  border: 0;
  padding: 10px 16px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  transition: all 0.2s;
}

.primary {
  background: #2563eb;
  color: white;
}

.primary:hover {
  background: #1d4ed8;
}

.secondary {
  background: #e5e7eb;
  color: #374151;
}

.secondary:hover {
  background: #d1d5db;
}

.search-box {
  margin-bottom: 20px;
}

.search-box input {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-family: inherit;
}

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

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

th,
td {
  padding: 13px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  font-size: 13px;
}

th {
  background: #f9fafb;
  font-weight: 700;
  color: #374151;
}

.badge {
  padding: 5px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}

.badge-active {
  background: #dcfce7;
  color: #166534;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-blue {
  background: #dbeafe;
  color: #1e40af;
}

.timeline {
  display: flex;
  align-items: stretch;
  gap: 10px;
  overflow-x: auto;
}

.timeline div {
  min-width: 120px;
  padding: 15px;
  border-left: 4px solid #2563eb;
  background: #f8fafc;
  border-radius: 6px;
}

.timeline strong {
  display: block;
}

.timeline span {
  font-size: 12px;
  color: #6b7280;
}

.timeline .expired-point {
  border-color: #dc2626;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-content {
  background: white;
  width: 850px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 12px;
  padding: 25px;
}

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

.modal-header button {
  border: 0;
  background: transparent;
  font-size: 25px;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-top: 20px;
}

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

.form-group.full {
  grid-column: 1 / -1;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 11px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-family: inherit;
  background-color: white;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.filter {
  background: #e5e7eb;
}

.filter.active {
  background: #2563eb;
  color: white;
}

.hidden {
  display: none !important;
}

/* =========================================================
   IMPACT VIEW STYLES (EXECUTIVE CLIENT PRESENTATION)
   ========================================================= */
.impact-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.impact-filter-panel {
  background: white;
}

.impact-filter-row {
  display: flex;
  align-items: flex-end;
  gap: 15px;
  flex-wrap: wrap;
}

.impact-actions-top {
  display: flex;
  gap: 8px;
}

.empty-state-box {
  text-align: center;
  padding: 60px 20px;
  background: white;
}

/* Client Header Banner */
.impact-client-banner {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
  border-radius: 14px;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  flex-wrap: wrap;
}

.client-banner-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.client-avatar {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.client-tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 700;
  color: #93c5fd;
  text-transform: uppercase;
}

.client-subinfo {
  font-size: 13px;
  color: #cbd5e1;
  margin-top: 4px;
}

.client-completion-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 12px 20px;
  border-radius: 12px;
}

.completion-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #10b981;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.completion-label strong {
  display: block;
  font-size: 15px;
  color: #ecfdf5;
}

.completion-label span {
  font-size: 12px;
  color: #a7f3d0;
}

/* Impact Summary Cards Grid */
.impact-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.impact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.impact-card .card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.impact-card .card-body {
  flex: 1;
}

.impact-card .card-sub {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

/* Charts Section */
.impact-charts-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.impact-chart-panel {
  min-height: 380px;
}

.program-legend-list {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 140px;
  overflow-y: auto;
}

.program-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 6px 10px;
  background: #f8fafc;
  border-radius: 6px;
}

.program-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 8px;
}

.timeline-summary-info {
  margin-top: 15px;
  font-size: 12px;
  color: #6b7280;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 6px;
}

/* AI Recommendation Panel */
.impact-ai-panel {
  border: 1px solid #c7d2fe;
  background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
  position: relative;
  overflow: hidden;
}

.impact-ai-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e0e7ff;
  padding-bottom: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.ai-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ai-sparkle-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.ai-badge-pill {
  background: #ede9fe;
  color: #6d28d9;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}

.ai-loading-box {
  text-align: center;
  padding: 40px 20px;
}

.ai-spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #e0e7ff;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: ai-spin 1s linear infinite;
  margin: 0 auto;
}

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

.ai-section-box {
  background: white;
  border-radius: 10px;
  padding: 18px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.ai-section-title {
  margin: 0 0 12px 0;
  font-size: 15px;
  color: #1e1b4b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-text-body {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: #334155;
}

.ai-programs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.ai-program-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s;
}

.ai-program-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  border-color: #6366f1;
}

.ai-program-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.ai-program-title {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
  margin: 0 0 8px 0;
}

.ai-program-desc {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 10px;
}

.ai-program-meta {
  font-size: 11.5px;
  color: #64748b;
  border-top: 1px dashed #cbd5e1;
  padding-top: 8px;
}

.ai-roadmap-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.ai-roadmap-step {
  background: #f8fafc;
  border-left: 4px solid #6366f1;
  border-radius: 6px;
  padding: 14px;
}

.ai-roadmap-step strong {
  display: block;
  font-size: 13px;
  color: #1e1b4b;
  margin-bottom: 4px;
}

.ai-roadmap-step p {
  margin: 0;
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
}

.ai-saran-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}

/* Participant Drill-Down Table Custom Styles */
.participant-programs-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.participant-program-tag {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12.5px;
  color: #1e293b;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

.participant-program-tag .program-bullet {
  color: #2563eb;
  font-size: 15px;
  line-height: 1;
  user-select: none;
}

.participant-program-tag .program-num {
  color: #2563eb;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.3;
  user-select: none;
}

.participant-program-tag .program-text {
  flex: 1;
}

.participant-rec-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #a7f3d0;
  padding: 8px 10px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.participant-rec-title {
  font-weight: 700;
  font-size: 12.5px;
  color: #065f46;
  display: flex;
  align-items: center;
  gap: 5px;
}

.participant-rec-schema {
  font-size: 10.5px;
  color: #047857;
  font-weight: 600;
}

/* Leveling Badge & Column Styles */
.participant-levels-col {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  align-items: center;
}

.badge-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: default;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.badge-level:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

/* Responsive Styles */
@media (max-width: 1100px) {
  .impact-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .impact-charts-row {
    grid-template-columns: 1fr;
  }
  .ai-programs-grid,
  .ai-roadmap-steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* 1. App Layout & Off-canvas Drawer Navigation */
  .app {
    flex-direction: column !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative !important;
  }

  /* Mobile Top Navbar */
  .mobile-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    background: #0f172a;
    color: white;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    width: 100%;
    box-sizing: border-box;
  }

  .btn-mobile-toggle {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
  }

  .btn-mobile-toggle:active {
    background: rgba(255, 255, 255, 0.25);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
  }

  .mobile-brand-icon {
    font-size: 18px;
  }

  .mobile-brand-sub {
    font-size: 10px;
    background: #2563eb;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
  }

  .btn-mobile-logout {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    font-size: 16px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  /* Sidebar as Drawer */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    max-width: 82vw !important;
    height: 100vh !important;
    background: #0f172a !important;
    z-index: 99999 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 6px 0 25px rgba(0, 0, 0, 0.5) !important;
    overflow-y: auto !important;
    padding: 20px 16px !important;
  }

  .sidebar.open {
    transform: translateX(0) !important;
  }

  .sidebar-header-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 20px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  .sidebar-close-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    color: white !important;
    font-size: 18px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    line-height: 1 !important;
  }

  .sidebar-backdrop {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(2px) !important;
    z-index: 99998 !important;
  }

  /* 2. Main Content Container */
  .main {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 14px 12px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* Topbar on Mobile */
  .topbar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
  }

  .topbar h1 {
    font-size: 21px !important;
    margin: 0 !important;
  }

  .topbar p {
    font-size: 12.5px !important;
    margin: 2px 0 0 0 !important;
  }

  .topbar-user-section {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-top: 8px !important;
    border-top: 1px solid #e2e8f0 !important;
    margin-top: 2px !important;
  }

  .topbar-badge {
    font-size: 11.5px !important;
    padding: 5px 10px !important;
    max-width: 72% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .btn-logout {
    font-size: 11.5px !important;
    padding: 5px 12px !important;
  }

  /* 3. Panels & Actions */
  .panel {
    padding: 16px 14px !important;
    border-radius: 12px !important;
    margin-bottom: 14px !important;
    box-sizing: border-box !important;
  }

  .panel-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
  }

  .panel-header h2 {
    font-size: 17px !important;
    line-height: 1.3 !important;
  }

  .panel-header p {
    font-size: 12.5px !important;
    margin-top: 4px !important;
  }

  .impact-actions-top {
    width: 100% !important;
  }

  .impact-actions-top .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 10px 14px !important;
    font-size: 13.5px !important;
  }

  /* 4. Filter Rows */
  .impact-filter-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .impact-filter-row .form-group {
    max-width: 100% !important;
    width: 100% !important;
  }

  .impact-filter-row select {
    width: 100% !important;
    max-width: 100% !important;
    padding: 11px 12px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
  }

  /* 5. Impact Client Banner (Partner Profile) */
  .impact-client-banner {
    padding: 16px 14px !important;
    gap: 14px !important;
    border-radius: 12px !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .client-banner-main {
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .client-avatar {
    width: 46px !important;
    height: 46px !important;
    font-size: 24px !important;
    flex-shrink: 0 !important;
    border-radius: 10px !important;
  }

  #impactClientTitle {
    font-size: 19px !important;
    margin: 2px 0 6px 0 !important;
    line-height: 1.25 !important;
  }

  .client-subinfo {
    font-size: 11px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    line-height: 1.4 !important;
  }

  .client-completion-badge {
    align-self: flex-start !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-top: 4px !important;
    padding-top: 10px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    width: 100% !important;
  }

  .completion-circle {
    width: 44px !important;
    height: 44px !important;
    font-size: 14px !important;
  }

  /* 6. KPI Metrics & Stat Cards */
  .cards {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  .impact-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .card, .impact-stat-card {
    padding: 12px 10px !important;
    gap: 8px !important;
    border-radius: 10px !important;
  }

  .card-title, .impact-stat-label {
    font-size: 11px !important;
    line-height: 1.3 !important;
  }

  .card-value, .impact-stat-number {
    font-size: 20px !important;
  }

  .impact-stat-icon {
    font-size: 20px !important;
    width: 38px !important;
    height: 38px !important;
  }

  /* 7. Charts Row */
  .impact-charts-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  .impact-chart-panel {
    min-height: auto !important;
    padding: 16px 12px !important;
  }

  .impact-chart-panel canvas {
    max-height: 250px !important;
  }

  .program-legend-list {
    max-height: 160px !important;
  }

  /* 8. Table & Smooth Horizontal Scroll */
  .table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 8px !important;
    border: 1px solid #e5e7eb !important;
    box-sizing: border-box !important;
  }

  .table-wrapper table {
    min-width: 650px !important;
  }

  th, td {
    padding: 9px 8px !important;
    font-size: 12px !important;
  }

  /* 9. AI Recommendations & Cards */
  .ai-programs-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .ai-program-card {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 14px 12px !important;
  }

  .ai-program-meta {
    width: 100% !important;
    text-align: left !important;
    border-top: 1px dashed #e2e8f0 !important;
    padding-top: 8px !important;
    margin-top: 4px !important;
  }

  /* 10. Participant Drill-Down Search & Filter */
  #impactParticipantsSection .panel-header > div:last-child {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  #filterImpactLevel, #searchImpactInput {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .impact-filter-select, .impact-search-input {
    width: 100% !important;
    font-size: 13.5px !important;
    padding: 9px 12px !important;
  }

  /* 11. Modal Dialogs */
  .modal-content {
    width: 95% !important;
    max-width: 95vw !important;
    padding: 20px 14px !important;
    margin: 10px auto !important;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .form-group.full {
    grid-column: auto !important;
  }

  /* 12. Login Screen on Mobile */
  .login-card {
    max-width: 92vw !important;
    padding: 28px 18px !important;
    border-radius: 14px !important;
  }

  .login-header h2 {
    font-size: 18px !important;
  }

  .login-header p {
    font-size: 12px !important;
  }
}

/* Print Media Styles (Executive Report PDF) */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .sidebar,
    .login-overlay,
    .topbar-user-section,
    .btn-logout,
  .no-print,
  .topbar,
  .modal {
    display: none !important;
  }
  .main {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }
  .impact-client-banner {
    background: #0f172a !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .panel {
    box-shadow: none !important;
    border: 1px solid #e5e7eb !important;
  }
  .impact-cards-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  .impact-charts-row {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}


/* ============================================================
   LOGIN SCREEN & AUTHENTICATION STYLES
   ============================================================ */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #090d16 0%, #111827 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 20px;
}

.login-card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  width: 100%;
  max-width: 440px;
  padding: 38px 34px 28px 34px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: loginSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginSlideUp {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  font-size: 28px;
  border-radius: 14px;
  margin-bottom: 12px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

.login-header h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.5px;
}

.login-header p {
  margin: 5px 0 0 0;
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.login-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-input-group {
  margin-bottom: 16px;
}

.login-input-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.login-input-wrapper {
  position: relative;
}

.login-input-wrapper input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.login-input-wrapper input:focus {
  outline: none;
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-btn-submit {
  width: 100%;
  padding: 12px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
  margin-top: 8px;
}

.login-btn-submit:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.login-footer-info {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed #e2e8f0;
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.6;
}

.login-footer-info strong {
  color: #334155;
}

.login-footer-info code {
  background: #f1f5f9;
  padding: 2px 5px;
  border-radius: 4px;
  color: #0f172a;
  font-family: monospace;
  font-weight: 600;
}

/* ============================================================
   SIDEBAR USER FOOTER & LOGOUT
   ============================================================ */
.sidebar-user-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid #1f2937;
}

.user-info-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #1f2937;
  border-radius: 8px;
  margin-bottom: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: #374151;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-role-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #60a5fa;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: #f3f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid #374151;
  color: #f87171;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

/* ============================================================
   API STATUS BANNER & LOADING OVERLAY (VERCEL DEPLOYMENT)
   ============================================================ */
.api-alert-banner {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 12px 18px;
  margin-bottom: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.api-alert-content {
  font-size: 13.5px;
  color: #92400e;
  line-height: 1.5;
}

.api-alert-content strong {
  color: #78350f;
}

.api-alert-content code {
  background: #fef3c7;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.global-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: white;
}

.global-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #1e293b;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
