/* ========================================================== */
/* ===== SUPER DASHBOARD ===================================== */
/* ========================================================== */
.super-dash { padding: 18px; }

/* ----- Filter Bar ----- */
.super-filterbar {
  background: #fff; border-radius: 14px; padding: 12px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px; position: sticky; top: 60px; z-index: 49;
}
.sfb-range { display: inline-flex; background: #f1f3f5; border-radius: 10px; padding: 3px; gap: 2px; }
.sfb-range-btn {
  background: transparent; border: none; padding: 6px 14px; border-radius: 8px;
  font-size: .85rem; font-weight: 500; cursor: pointer; color: #555;
  transition: all .15s;
}
.sfb-range-btn:hover { background: rgba(0,0,0,.05); }
.sfb-range-btn.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(13,79,138,.3); }
.sfb-rangelabel { font-size: .85rem; color: #666; margin-left: auto; }

/* ----- Hero panel ----- */
.super-hero {
  display: grid; grid-template-columns: 220px 1fr; gap: 16px;
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border-radius: 18px; padding: 20px; margin-bottom: 16px;
  box-shadow: 0 4px 18px rgba(0,0,0,.08);
}
.health-orb {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #28a745, #20c997);
  border-radius: 16px; color: #fff; padding: 24px 12px;
  position: relative; overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.health-orb.level-good { background: linear-gradient(135deg, #28a745, #20c997); }
.health-orb.level-warning { background: linear-gradient(135deg, #ffc107, #fd7e14); }
.health-orb.level-critical { background: linear-gradient(135deg, #dc3545, #c2185b); animation: pulse-orb 2s infinite; }
@keyframes pulse-orb { 0%,100% { box-shadow: 0 6px 20px rgba(220,53,69,.3); } 50% { box-shadow: 0 6px 30px rgba(220,53,69,.7); } }
.health-orb .ho-score { font-size: 3.5rem; font-weight: 700; line-height: 1; }
.health-orb .ho-label { font-size: .9rem; margin-top: 6px; font-weight: 500; opacity: .95; }

.hero-alerts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.hero-alert {
  background: #fff; border-radius: 14px; padding: 14px 12px;
  border: 2px solid #dee2e6; text-align: center;
  cursor: pointer; transition: all .18s;
}
.hero-alert:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.hero-alert.overdue { border-color: #dc3545; background: linear-gradient(135deg, #fff5f5, #fff); }
.hero-alert.overdue .ha-num { color: #dc3545; }
.hero-alert.warning { border-color: #ffc107; background: linear-gradient(135deg, #fffbeb, #fff); }
.hero-alert.warning .ha-num { color: #f57c00; }
.hero-alert.primary { border-color: #0d6efd; background: linear-gradient(135deg, #f0f7ff, #fff); }
.hero-alert.primary .ha-num { color: #0d6efd; }
.hero-alert .ha-num { font-size: 2rem; font-weight: 700; line-height: 1; }
.hero-alert .ha-lbl { font-size: .78rem; color: #555; margin-top: 4px; }

/* ----- KPI grid ----- */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.kpi-card {
  background: #fff; border-radius: 14px; padding: 14px;
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  transition: all .15s;
  cursor: pointer;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.kpi-icon {
  width: 48px; height: 48px; border-radius: 12px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.kpi-body { min-width: 0; }
.kpi-label { font-size: .75rem; color: #777; font-weight: 500; }
.kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; color: var(--primary-dark); }
.kpi-sub { font-size: .72rem; color: #888; display: flex; gap: 4px; align-items: center; }
.kpi-spark svg.spark { width: 80px; height: 30px; opacity: .8; }

.delta { font-size: .68rem; font-weight: 600; padding: 1px 6px; border-radius: 8px; }
.delta.up { background: #d4edda; color: #155724; }
.delta.down { background: #f8d7da; color: #721c24; }
.delta.zero { background: #e9ecef; color: #555; }

/* ----- Compliance Heatmap ----- */
.heatmap-wrap { overflow-x: auto; max-height: 480px; overflow-y: auto; }
.heatmap { border-collapse: collapse; font-size: .78rem; width: 100%; }
.heatmap th, .heatmap td { border: 1px solid #e9ecef; padding: 6px 8px; text-align: center; min-width: 60px; }
.heatmap th.hm-corner { background: var(--primary-dark); color: #fff; text-align: left; position: sticky; left: 0; top: 0; z-index: 10; min-width: 200px; }
.heatmap th.hm-col-header { background: var(--primary); color: #fff; font-weight: 600; position: sticky; top: 0; z-index: 5; }
.heatmap td.hm-row-header { background: #f5f9fc; text-align: left; font-weight: 500; min-width: 200px; position: sticky; left: 0; z-index: 4; }
.heatmap .hm-cell { cursor: pointer; transition: all .12s; font-weight: 600; }
.heatmap .hm-cell:hover { transform: scale(1.05); z-index: 3; position: relative; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.heatmap .hm-cell.hm-empty { background: #fff; color: #ccc; }
.heatmap .hm-cell.hm-cool { background: #e3f2fd; color: #1565c0; }
.heatmap .hm-cell.hm-warm { background: #ffe0b2; color: #e65100; }
.heatmap .hm-cell.hm-hot { background: #ef9a9a; color: #b71c1c; }

/* ----- Critical Alerts ----- */
.alert-item {
  display: grid; grid-template-columns: 40px 1fr auto;
  gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 10px; margin-bottom: 8px;
  cursor: pointer; transition: all .15s;
}
.alert-item:hover { transform: translateX(4px); }
.alert-item.danger { background: #fff5f5; border-left: 4px solid #dc3545; }
.alert-item.warning { background: #fffbeb; border-left: 4px solid #ffc107; }
.alert-item.primary { background: #f0f7ff; border-left: 4px solid #0d6efd; }
.alert-item .ai-icon { width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.05); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.alert-item.danger .ai-icon { color: #dc3545; }
.alert-item.warning .ai-icon { color: #f57c00; }
.alert-item.primary .ai-icon { color: #0d6efd; }
.alert-item .ai-label { font-weight: 600; font-size: .9rem; }
.alert-item .ai-sub { font-size: .75rem; color: #777; }
.alert-item .ai-arrow { color: #aaa; font-size: .8rem; }

/* ----- Leaderboard ----- */
.lb-row {
  display: grid; grid-template-columns: 28px 1fr 80px 40px;
  align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f1f3f5;
  font-size: .88rem;
}
.lb-row:last-child { border: none; }
.lb-rank { font-weight: 700; color: var(--primary); text-align: center; }
.lb-row:nth-child(1) .lb-rank { color: #ffc107; font-size: 1.05rem; }
.lb-row:nth-child(2) .lb-rank { color: #6c757d; }
.lb-row:nth-child(3) .lb-rank { color: #cd7f32; }
.lb-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-bar { background: #e9ecef; height: 8px; border-radius: 4px; overflow: hidden; }
.lb-bar-fill { background: linear-gradient(90deg, var(--primary), var(--accent)); height: 100%; transition: width .3s; }
.lb-count { text-align: right; font-weight: 600; color: var(--primary); font-size: .85rem; }

/* ----- Activity Feed ----- */
.activity-scroll { max-height: 360px; overflow-y: auto; padding-right: 4px; }
.af-item {
  display: grid; grid-template-columns: 32px 1fr auto;
  gap: 8px; align-items: center;
  padding: 8px; border-radius: 8px; margin-bottom: 4px;
  cursor: pointer; transition: all .12s;
  font-size: .82rem;
}
.af-item:hover { background: #f8f9fa; }
.af-icon { width: 32px; height: 32px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: .8rem; flex-shrink: 0; }
.af-user { font-weight: 600; color: var(--primary-dark); }
.af-meta { font-size: .68rem; color: #888; display: flex; gap: 4px; align-items: center; }
.af-meta .chip { font-size: .65rem; padding: 1px 6px; }
.af-detail { font-weight: 600; color: var(--accent); font-size: .85rem; }

/* ----- Responsive ----- */
@media (max-width: 992px) {
  .super-hero { grid-template-columns: 1fr; }
  .hero-alerts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .super-dash { padding: 10px; }
  .super-filterbar { padding: 8px; gap: 6px; }
  .sfb-range-btn { padding: 5px 8px; font-size: .75rem; }
  .health-orb .ho-score { font-size: 2.5rem; }
  .hero-alerts { grid-template-columns: 1fr 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
