/* ═══════════════════════════════════════════════════════════
   Admin ASPE — Autonomous Security Posture Evolution
   ═══════════════════════════════════════════════════════════ */

.aspe-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: aspe-spin .5s linear infinite;
  vertical-align: middle;
}
@keyframes aspe-spin { to { transform: rotate(360deg); } }

.aspe-dashboard { padding: 0; }

/* KPI Grid */
.aspe-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.aspe-kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--text3);
}
.aspe-kpi--pending  { border-left-color: var(--warn); }
.aspe-kpi--approved { border-left-color: var(--accent); }
.aspe-kpi--rejected { border-left-color: var(--danger); }
.aspe-kpi--implemented { border-left-color: #6366f1; }

.aspe-kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.aspe-kpi-label {
  font-size: 0.82rem;
  color: var(--text3);
  margin-top: 4px;
}

/* Actions Row */
.aspe-actions-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.aspe-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.aspe-filters select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}
.aspe-filters select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Panel */
.aspe-panel { margin-bottom: 20px; }

/* Priority list */
.aspe-proposal-list {
  display: flex;
  flex-direction: column;
}
.aspe-priority-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.aspe-priority-item:last-child { border-bottom: none; }
.aspe-priority-item:hover { background: var(--bg); }

.aspe-priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  margin-top: 2px;
}
.aspe-priority-badge.p1 { background: var(--danger); }
.aspe-priority-badge.p2 { background: var(--warn); }
.aspe-priority-badge.p3 { background: var(--text3); }

.aspe-priority-content { flex: 1; min-width: 0; }
.aspe-priority-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 2px;
}
.aspe-priority-source {
  font-size: 0.78rem;
  color: var(--text3);
}
.aspe-priority-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Table */
.aspe-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.aspe-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg);
  color: var(--text3);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.aspe-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.aspe-table tr:hover td { background: var(--bg); }
.aspe-table tr:last-child td { border-bottom: none; }

/* Badges */
.aspe-sev {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.aspe-sev.critical { background: #fde8e8; color: #b91c1c; }
.aspe-sev.high     { background: #fef3c7; color: #92400e; }
.aspe-sev.medium   { background: #e0f2fe; color: #0369a1; }
.aspe-sev.low      { background: #ecfdf5; color: #065f46; }

.aspe-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}
.aspe-status-badge.pending     { background: #fef3c7; color: #92400e; }
.aspe-status-badge.approved    { background: #ecfdf5; color: #065f46; }
.aspe-status-badge.rejected    { background: #fde8e8; color: #b91c1c; }
.aspe-status-badge.implemented { background: #ede9fe; color: #5b21b6; }

.aspe-provider-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--text2);
}

.aspe-source-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  background: #f1f5f9;
  color: var(--text3);
}

/* Action buttons */
.aspe-btn {
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.aspe-btn:hover { opacity: 0.85; }
.aspe-btn.approve { background: #ecfdf5; color: #065f46; }
.aspe-btn.reject  { background: #fde8e8; color: #b91c1c; }
.aspe-btn.detail  { background: #f1f5f9; color: var(--text2); }

/* Benchmark Coverage */
.aspe-bench-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.aspe-bench-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
}
.aspe-bench-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 8px;
}
.aspe-bench-bar-wrap {
  background: var(--border);
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.aspe-bench-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}
.aspe-bench-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text3);
}
.aspe-bench-pct {
  font-weight: 700;
  font-size: 1.2rem;
}

/* Empty state */
.aspe-empty {
  text-align: center;
  padding: 24px;
  color: var(--text3);
  font-size: 0.9rem;
}

/* Modal detail */
#aspe-detail-body .aspe-detail-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.88rem;
}
#aspe-detail-body .aspe-detail-label {
  font-weight: 600;
  color: var(--text3);
  min-width: 110px;
}
#aspe-detail-body .aspe-detail-value {
  color: var(--text);
  word-break: break-word;
}
#aspe-detail-body .aspe-detail-desc {
  background: var(--bg);
  border-radius: 8px;
  padding: 14px;
  font-size: 0.85rem;
  color: var(--text2);
  margin: 12px 0;
  line-height: 1.5;
}
.aspe-detail-comment {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 60px;
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .aspe-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .aspe-actions-row { flex-direction: column; align-items: stretch; }
  .aspe-table { font-size: 0.78rem; }
  .aspe-table th, .aspe-table td { padding: 8px 10px; }
}
