/* ==========================
   KPI Dashboard Phase 1
========================== */
.kpi-page{display:flex;flex-direction:column;gap:18px}.kpi-hero{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:26px 30px;border-radius:28px;background:linear-gradient(135deg,rgba(255,255,255,.96),rgba(236,254,255,.92));border:1px solid rgba(148,163,184,.28);box-shadow:var(--shadow);position:relative;overflow:hidden}.kpi-hero:after{content:"";position:absolute;right:-70px;top:-90px;width:250px;height:250px;border-radius:50%;background:linear-gradient(135deg,rgba(45,212,191,.22),rgba(37,99,235,.12))}.kpi-hero h2{margin:0;font-size:30px;color:#082f49}.kpi-hero p:not(.eyebrow){margin:8px 0 0;color:var(--muted)}.kpi-hero-badge{position:relative;z-index:1;min-width:230px;padding:16px 18px;border-radius:24px;background:rgba(255,255,255,.82);border:1px solid rgba(20,184,166,.25);box-shadow:0 12px 24px rgba(15,23,42,.06)}.kpi-hero-badge span,.kpi-hero-badge small{display:block;color:#64748b;font-weight:700;font-size:12px}.kpi-hero-badge strong{display:block;color:#0f766e;font-size:18px;margin:4px 0}.kpi-summary-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:14px}.kpi-summary-card{min-height:112px;border-radius:24px;padding:16px;background:rgba(255,255,255,.9);border:1px solid rgba(148,163,184,.24);box-shadow:var(--shadow);display:grid;align-content:space-between;overflow:hidden;position:relative}.kpi-summary-card:before{content:"";position:absolute;right:-30px;top:-35px;width:110px;height:110px;border-radius:50%;background:rgba(20,184,166,.14)}.kpi-summary-card span,.kpi-summary-card strong,.kpi-summary-card small{position:relative;z-index:1}.kpi-summary-card span{font-weight:900;color:#0f172a}.kpi-summary-card strong{font-size:32px;color:#0f766e;text-align:right}.kpi-summary-card small{text-align:right;color:#64748b;font-weight:800}.kpi-summary-card.success strong{color:#16a34a}.kpi-summary-card.danger strong{color:#dc2626}.kpi-summary-card.wait strong{color:#2563eb}.kpi-summary-card.rate strong{color:#7c3aed}.kpi-dashboard-grid{display:grid;gap:18px}.kpi-dashboard-grid.two{grid-template-columns:1fr 1fr}.kpi-chart-card,.kpi-panel-card,.kpi-table-card,.kpi-filter-bar{background:rgba(255,255,255,.9);border:1px solid rgba(148,163,184,.24);box-shadow:var(--shadow);border-radius:26px}.kpi-chart-card{padding:20px;min-height:390px}.kpi-card-head h3{margin:0 0 4px;font-size:20px;color:#0f172a}.kpi-card-head p{margin:0 0 14px;color:#64748b;font-size:13px}.kpi-chart-wrap{height:310px}.kpi-panel-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.kpi-panel-card{padding:20px}.kpi-progress-list{display:grid;gap:12px}.kpi-progress-row{display:grid;gap:8px}.kpi-progress-label{display:flex;justify-content:space-between;gap:10px;color:#334155;font-weight:800}.kpi-progress-label span{color:#64748b}.kpi-progress-track{height:12px;background:#e2e8f0;border-radius:999px;overflow:hidden}.kpi-progress-track div{height:100%;background:linear-gradient(90deg,#0f766e,#06b6d4);border-radius:999px}.kpi-outcome-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.kpi-outcome-card{padding:14px;border-radius:18px;background:#f8fafc;border:1px solid rgba(148,163,184,.24);display:grid;gap:6px}.kpi-outcome-card strong{font-size:22px;color:#0f766e}.kpi-outcome-card span{font-weight:800;color:#0f172a;font-size:13px}.kpi-outcome-card small{color:#64748b;font-weight:800}.kpi-filter-bar{display:grid;grid-template-columns:1fr 280px 220px;gap:14px;padding:16px}.kpi-filter-bar label{display:flex;flex-direction:column;gap:6px;font-weight:900;color:#0f766e;font-size:14px}.kpi-filter-bar input,.kpi-filter-bar select{border:1px solid #5eead4;border-radius:14px;padding:12px 14px;font-family:inherit;background:#f8fafc;outline:none}.kpi-table-card{padding:20px}.kpi-table-head{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:14px}.kpi-table-head h3{margin:0;font-size:20px}.kpi-table-head p{margin:4px 0 0;color:#64748b}.kpi-table-head span{padding:8px 12px;border-radius:999px;background:#ecfeff;color:#0f766e;font-weight:900}.kpi-table-wrap{overflow:auto;border-radius:18px;border:1px solid rgba(148,163,184,.24)}.kpi-table{width:100%;border-collapse:collapse;min-width:1120px;background:#fff}.kpi-table th{position:sticky;top:0;background:#0f766e;color:#fff;text-align:left;padding:12px;font-size:13px}.kpi-table td{padding:12px;border-bottom:1px solid #e2e8f0;vertical-align:top;font-size:13px}.kpi-table tr:hover td{background:#f8fafc}.kpi-name-cell strong{display:block;color:#0f172a}.kpi-name-cell small{display:block;color:#64748b;margin-top:5px}.kpi-group-pill{display:inline-flex;padding:5px 9px;border-radius:999px;background:#e0f2fe;color:#0369a1;font-weight:900}.kpi-status{display:inline-flex;align-items:center;justify-content:center;min-width:80px;padding:6px 10px;border-radius:999px;font-weight:900;font-size:12px}.status-pass{background:#dcfce7;color:#15803d}.status-fail{background:#fee2e2;color:#b91c1c}.status-near{background:#fef3c7;color:#b45309}.status-wait{background:#dbeafe;color:#1d4ed8}.status-unknown{background:#f1f5f9;color:#475569}.kpi-empty{text-align:center;color:#64748b;font-weight:800;padding:30px!important}@media(max-width:1200px){.kpi-summary-grid{grid-template-columns:repeat(2,1fr)}.kpi-dashboard-grid.two,.kpi-panel-grid,.kpi-filter-bar{grid-template-columns:1fr}}@media(max-width:760px){.kpi-hero{flex-direction:column;align-items:flex-start}.kpi-summary-grid,.kpi-outcome-grid{grid-template-columns:1fr}.kpi-hero-badge{width:100%}}


/* ==========================
   KPI Owner Hover Card Patch
========================== */
.kpi-owner-cell {
  min-width: 180px;
}

.kpi-owner-link {
  display: inline-flex;
  align-items: center;
  gap: 0px;
  max-width: 230px;
  padding: 5px 8px;
  border-radius: 999px;
  cursor: default;
  color: #0f172a;
  font-weight: 800;
  transition: .16s ease;
  outline: none;
}

.kpi-owner-link:hover,
.kpi-owner-link:focus {
  background: #ecfeff;
  color: #0f766e;
  box-shadow: 0 0 0 3px rgba(20,184,166,.14);
}

.kpi-owner-avatar-mini {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  display: none !important;
  place-items: center;
  background: linear-gradient(135deg, #ccfbf1, #dbeafe);
  border: 1px solid rgba(20,184,166,.34);
  color: #0f766e;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.kpi-owner-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-owner-empty {
  color: #94a3b8;
  font-weight: 800;
}

.kpi-owner-hover-card {
  position: fixed;
  z-index: 99999;
  width: 330px;
  max-width: calc(100vw - 24px);
  display: none;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(20,184,166,.28);
  box-shadow: 0 24px 60px rgba(15,23,42,.22);
  backdrop-filter: blur(16px);
  pointer-events: none;
}

.kpi-owner-hover-card.show {
  display: grid;
  animation: kpiOwnerPop .14s ease-out;
}

@keyframes kpiOwnerPop {
  from { opacity: 0; transform: translateY(4px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.kpi-owner-card-photo {
  width: 92px;
  height: 112px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, #ccfbf1, #dbeafe);
  border: 1px solid rgba(148,163,184,.28);
  box-shadow: 0 10px 22px rgba(15,23,42,.10);
}

.kpi-owner-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kpi-owner-card-fallback {
  width: 100%;
  height: 100%;
  place-items: center;
  color: #0f766e;
  font-size: 26px;
  font-weight: 900;
}

.kpi-owner-card-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.kpi-owner-card-info strong {
  font-size: 17px;
  color: #0f172a;
  line-height: 1.25;
}

.kpi-owner-card-info p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.kpi-owner-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 2px;
}

.kpi-owner-card-stats span {
  padding: 6px 8px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(148,163,184,.20);
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.kpi-owner-card-stats b {
  color: #0f766e;
}

.kpi-owner-card-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.kpi-owner-card-groups span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #ecfeff;
  color: #0f766e;
  font-size: 11px;
  font-weight: 900;
}

@media(max-width:760px) {
  .kpi-owner-hover-card {
    grid-template-columns: 1fr;
    width: 270px;
  }

  .kpi-owner-card-photo {
    width: 100%;
    height: 160px;
  }
}
