/**
 * Fijate Tools - Radar de vulnerabilidades y ciberseguridad CVE
 * Estilos canónicos oficiales y diseño responsive
 */

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Tema claro por defecto */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-card-hover: #f8fafc;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --accent-cyan: #0284c7;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #ef4444;
  --accent-purple: #8b5cf6;

  /* Severidades CVSS */
  --cvss-critical-bg: #fef2f2;
  --cvss-critical-text: #b91c1c;
  --cvss-critical-border: #fecaca;

  --cvss-high-bg: #fff7ed;
  --cvss-high-text: #c2410c;
  --cvss-high-border: #fed7aa;

  --cvss-medium-bg: #fefce8;
  --cvss-medium-text: #a16207;
  --cvss-medium-border: #fef08a;

  --cvss-low-bg: #f0fdf4;
  --cvss-low-text: #15803d;
  --cvss-low-border: #bbf7d0;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
}

/* Modo oscuro corporativo */
[data-theme="dark"] {
  --bg-page: #0b0f17;
  --bg-card: #131b2a;
  --bg-card-subtle: #192438;
  --bg-card-hover: #1e2c44;
  --bg-input: #101622;
  --border-color: #233149;
  --border-focus: #60a5fa;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --primary-color: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.15);
  --primary-border: #1d4ed8;

  --accent-cyan: #38bdf8;
  --accent-green: #34d399;
  --accent-amber: #fbbf24;
  --accent-rose: #f87171;
  --accent-purple: #a78bfa;

  --cvss-critical-bg: rgba(239, 68, 68, 0.15);
  --cvss-critical-text: #fca5a5;
  --cvss-critical-border: rgba(239, 68, 68, 0.4);

  --cvss-high-bg: rgba(249, 115, 22, 0.15);
  --cvss-high-text: #fdba74;
  --cvss-high-border: rgba(249, 115, 22, 0.4);

  --cvss-medium-bg: rgba(234, 179, 8, 0.15);
  --cvss-medium-text: #fde047;
  --cvss-medium-border: rgba(234, 179, 8, 0.4);

  --cvss-low-bg: rgba(16, 185, 129, 0.15);
  --cvss-low-text: #86efac;
  --cvss-low-border: rgba(16, 185, 129, 0.4);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Reset y estructura canónica */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
  width: 100%;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* Tipografías semánticas */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  margin-top: 0;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.text-mono {
  font-family: var(--font-mono);
}

/* Hero y cabecera de la herramienta */
.radar-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.radar-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.radar-hero-info {
  flex: 1 1 300px;
}

.radar-hero-title {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.radar-hero-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
  max-width: 720px;
}

.radar-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.radar-live-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: radar-pulse 2s infinite;
}

@keyframes radar-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  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);
  }
}

/* Cuadrícula de KPIs */
.kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.kpi-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  border-color: var(--primary-border);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.kpi-label {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-icon {
  color: var(--text-subtle);
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.kpi-subtext {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: 0.25rem;
}

.kpi-card.kpi-danger .kpi-value {
  color: var(--accent-rose);
}

.kpi-card.kpi-warning .kpi-value {
  color: var(--accent-amber);
}

.kpi-card.kpi-info .kpi-value {
  color: var(--accent-cyan);
}

/* Barra de pestañas principal */
.radar-tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 1px;
}

.radar-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -3px;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  min-height: 44px;
}

.radar-tab-btn:hover {
  color: var(--text-main);
}

.radar-tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.radar-tab-badge {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.radar-tab-btn.active .radar-tab-badge {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary-color);
}

/* Paneles de pestañas */
.radar-panel {
  display: none;
}

.radar-panel.active {
  display: block;
}

/* Barra de herramientas y filtros */
.radar-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.search-input-box {
  flex: 1 1 260px;
  position: relative;
  min-width: 0;
}

.search-input-box svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}

.search-input {
  width: 100%;
  min-height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem 0.5rem 2.4rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.vendor-select-box {
  flex: 0 1 200px;
  min-width: 140px;
}

.custom-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 40px;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 2.4rem 0.5rem 0.75rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.custom-select:focus {
  border-color: var(--border-focus);
}

.filter-toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.4rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.filter-toggle-chip:hover {
  border-color: var(--border-focus);
  color: var(--text-main);
}

.filter-toggle-chip.active {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--accent-rose);
  color: var(--accent-rose);
}

.filter-toggle-chip input[type="checkbox"] {
  display: none;
}

.btn-action-radar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.4rem 1rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-action-radar:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.btn-primary-radar {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

.btn-primary-radar:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* Tabla y listado KEV */
.kev-list-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.kev-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.kev-table th {
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.kev-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
  color: var(--text-main);
}

.kev-table tr:last-child td {
  border-bottom: none;
}

.kev-table tr:hover td {
  background: var(--bg-card-hover);
}

/* Badges temáticos */
.badge-cve {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--primary-color);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.badge-cve:hover {
  background: var(--primary-color);
  color: #ffffff;
}

.badge-ransomware {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.725rem;
  background: var(--cvss-critical-bg);
  color: var(--cvss-critical-text);
  border: 1px solid var(--cvss-critical-border);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.badge-vendor {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.badge-product {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.badge-date {
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--text-muted);
}

.badge-due-warning {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-amber);
  font-weight: 600;
}

/* Botón inspeccionar detalle */
.btn-inspect {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  min-height: 34px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-inspect:hover {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

/* Paginación */
.kev-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  background: var(--bg-card-subtle);
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pagination-info {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.btn-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0.25rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}

.btn-page:hover:not(:disabled) {
  border-color: var(--border-focus);
  color: var(--primary-color);
}

.btn-page.active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Buscador e inspector de CVEs */
.cve-search-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.cve-search-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cve-search-input-wrap {
  flex: 1 1 300px;
  position: relative;
}

.cve-search-input {
  width: 100%;
  min-height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease;
}

.cve-search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.cve-search-input-wrap svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
}

.cve-quick-chips {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.quick-chip-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-quick-cve {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-quick-cve:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary-color);
}

/* Ficha de detalle de CVE */
.cve-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.cve-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.cve-detail-id {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.cve-detail-title {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0;
}

.cve-score-badge {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.score-num {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1;
}

.score-meta {
  display: flex;
  flex-direction: column;
}

.score-severity {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.score-version {
  font-size: 0.7rem;
  opacity: 0.8;
}

.severity-critica {
  background: var(--cvss-critical-bg);
  color: var(--cvss-critical-text);
  border-color: var(--cvss-critical-border);
}

.severity-alta {
  background: var(--cvss-high-bg);
  color: var(--cvss-high-text);
  border-color: var(--cvss-high-border);
}

.severity-media {
  background: var(--cvss-medium-bg);
  color: var(--cvss-medium-text);
  border-color: var(--cvss-medium-border);
}

.severity-baja {
  background: var(--cvss-low-bg);
  color: var(--cvss-low-text);
  border-color: var(--cvss-low-border);
}

.cve-detail-body {
  margin-bottom: 1.5rem;
}

.cve-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.cve-desc-box {
  background: var(--bg-card-subtle);
  border-left: 4px solid var(--primary-color);
  padding: 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--text-main);
}

.cvss-vector-box {
  font-family: var(--font-mono);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  color: var(--text-muted);
  word-break: break-all;
}

.cwe-tags-list {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.cwe-tag {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ref-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ref-link-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  word-break: break-all;
}

.ref-link-item a {
  color: var(--primary-color);
  text-decoration: none;
}

.ref-link-item a:hover {
  text-decoration: underline;
}

.ref-tag {
  font-size: 0.7rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--text-subtle);
}

.cve-actions-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

/* Auditor de dependencias */
.auditor-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.auditor-header {
  margin-bottom: 1.25rem;
}

.auditor-presets-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.auditor-textarea {
  width: 100%;
  min-height: 180px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-main);
  outline: none;
  resize: vertical;
  line-height: 1.5;
  transition: border-color 0.2s ease;
}

.auditor-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.auditor-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* Resultados de auditoría */
.audit-results-card {
  margin-top: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.audit-summary-bar {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.audit-stat {
  display: flex;
  flex-direction: column;
}

.audit-stat-val {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.audit-stat-label {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.audit-pkg-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.audit-pkg-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  transition: border-color 0.2s ease;
}

.audit-pkg-card.pkg-vulnerable {
  border-color: var(--cvss-critical-border);
  background: var(--cvss-critical-bg);
}

.audit-pkg-card.pkg-safe {
  border-color: var(--cvss-low-border);
}

.audit-pkg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.audit-pkg-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.audit-pkg-version {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.audit-vuln-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  margin-top: 0.5rem;
  font-size: 0.825rem;
}

.audit-vuln-id {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary-color);
  margin-right: 0.5rem;
}

/* Modales accesibles */
.radar-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.radar-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.radar-modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.radar-modal-backdrop.open .radar-modal-container {
  transform: translateY(0);
}

.radar-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.radar-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-family: var(--font-heading);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.radar-modal-close {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
}

.radar-modal-close:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
}

.radar-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

/* Toast de aviso */
.radar-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--text-main);
  color: var(--bg-page);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.radar-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Acordeón de preguntas frecuentes SEO */
.faq-section {
  margin-top: 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.faq-title {
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card-subtle);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 1rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-question svg {
  transition: transform 0.2s ease;
  color: var(--text-subtle);
  flex-shrink: 0;
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 0 1.25rem 1.25rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.faq-item.open .faq-answer {
  display: block;
}

/* Spinner de carga */
.spin-anim {
  animation: spin 1s linear infinite;
}

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

/* Responsividad para pantallas móviles y tablets */
@media (max-width: 860px) {
  .kev-table thead {
    display: none;
  }

  .kev-table, .kev-table tbody, .kev-table tr, .kev-table td {
    display: block;
    width: 100%;
  }

  .kev-table tr {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    padding: 0.5rem;
  }

  .kev-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
  }

  .kev-table td::before {
    content: attr(data-label);
    font-size: 0.75rem;
    color: var(--text-subtle);
    font-weight: 600;
    text-transform: uppercase;
  }

  .kev-table td.cell-desc {
    display: block;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
  }

  .kev-table td.cell-desc::before {
    display: block;
    margin-bottom: 0.25rem;
  }

  .radar-hero {
    padding: 1.25rem;
  }

  .radar-hero-title {
    font-size: 1.4rem;
  }

  .kpis-grid {
    grid-template-columns: 1fr;
  }

  .radar-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input-box, .vendor-select-box, .filter-toggle-chip, .btn-action-radar {
    width: 100%;
    flex: 1 1 100%;
  }
}
