/**
 * style.css
 * Estilos modernos Enterprise para la plataforma Antiplagio Universitario.
 * Paleta académica, Glassmorphism, Bento Grid, micro-interacciones y estilos de impresión.
 * Autor: Alejandro (AlaTeam Solutions)
 */

:root {
  --bg-main: #0b0f19;
  --bg-card: rgba(18, 24, 38, 0.85);
  --bg-card-hover: rgba(25, 34, 54, 0.95);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;

  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #0ea5e9;

  --highlight-a-bg: rgba(239, 68, 68, 0.28);
  --highlight-a-border: #ef4444;
  --highlight-b-bg: rgba(59, 130, 246, 0.28);
  --highlight-b-border: #3b82f6;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(99, 102, 241, 0.07) 0%, transparent 40%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================================================
   HEADER
   ========================================================= */
.app-header {
  border-bottom: 1px solid var(--border-color);
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

.brand h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-tag {
  font-size: 0.72rem;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
}

.subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.ram-badge {
  display: flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-success);
  box-shadow: 0 0 10px var(--color-success);
}

/* =========================================================
   MAIN LAYOUT & MODE SELECTOR
   ========================================================= */
.main-content {
  flex: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

.mode-selector-section {
  margin-bottom: 1.5rem;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .mode-tabs {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 550px) {
  .mode-tabs {
    grid-template-columns: 1fr;
  }
}

.mode-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: var(--transition);
}

.mode-tab:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.mode-tab.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(79, 70, 229, 0.15));
  border-color: var(--accent-blue);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.25);
}

.tab-icon {
  font-size: 1.4rem;
}

.tab-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.tab-text strong {
  font-size: 0.92rem;
  color: var(--text-primary);
}

.tab-text small {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* =========================================================
   SAMPLES BAR
   ========================================================= */
.samples-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.samples-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.samples-buttons {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-sample {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
}

.btn-sample:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.dot-danger { background-color: var(--color-danger); }
.dot-purple { background-color: var(--accent-purple); }
.dot-warning { background-color: var(--color-warning); }
.dot-success { background-color: var(--color-success); }

/* =========================================================
   INPUT GRID & DRAG AND DROP
   ========================================================= */
.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .input-grid {
    grid-template-columns: 1fr;
  }
}

.text-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

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

.card-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.pill-a {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.pill-b {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.card-title h2 {
  font-size: 1.05rem;
  font-weight: 600;
}

.card-stats {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* DROP ZONE */
.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  background: rgba(11, 15, 25, 0.4);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  margin-bottom: 0.85rem;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.08);
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  pointer-events: none;
}

.drop-zone-content svg {
  color: var(--accent-blue);
}

.drop-zone-content p {
  font-size: 0.88rem;
  color: var(--text-primary);
}

.drop-zone-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.file-badge {
  margin-top: 0.4rem;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
}
.file-badge.hidden { display: none; }

.textarea-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 0.5rem 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.textarea-divider::before, .textarea-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}
.textarea-divider span {
  padding: 0 0.5rem;
}

.textarea-wrapper textarea {
  width: 100%;
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 180px;
  outline: none;
  transition: var(--transition);
}

.textarea-wrapper textarea:focus {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(11, 15, 25, 0.8);
}

/* ACTION BAR */
.action-bar, .action-bar-center {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.btn-primary-large {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 1rem 2.4rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  transition: var(--transition);
}

.btn-primary-large:hover {
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 255, 0.5);
}

.btn-primary-large:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.9rem 2.2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  transition: var(--transition);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 255, 0.5);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* =========================================================
   ALERTS & REPORTS
   ========================================================= */
.alert-box {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.alert-box.hidden { display: none; }
.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.evasion-alert {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(18, 24, 38, 0.9));
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.evasion-alert.hidden { display: none; }
.evasion-icon { font-size: 1.8rem; }
.evasion-details strong { color: #c084fc; font-size: 0.95rem; }
.evasion-details p { color: #e9d5ff; font-size: 0.85rem; }

/* RESULTS SECTION */
.results-section {
  animation: fadeIn 0.4s ease-out;
}
.results-section.hidden { display: none; }

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

.report-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}
.report-top-bar h2 { font-size: 1.3rem; font-weight: 700; }
.report-meta { font-size: 0.82rem; color: var(--text-muted); }

.report-actions-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-print {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-print-annotated {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}
.btn-print-annotated:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.7);
  color: #ffffff;
}

.btn-print-certificate {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}
.btn-print-certificate:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.7);
  color: #ffffff;
}

.scan-options-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0 1.25rem 0;
}

.scan-option-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.scan-option-label:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}
.scan-option-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary-blue);
  cursor: pointer;
}

/* VEREDICTO BANNER */
.verdict-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
}
.verdict-banner.verdict-danger {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), var(--bg-card));
}
.verdict-banner.verdict-warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), var(--bg-card));
}
.verdict-banner.verdict-success {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), var(--bg-card));
}

.verdict-score-box { flex-shrink: 0; }
.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 5px solid var(--color-danger);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
  transition: var(--transition);
}
.score-number { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; }
.score-label { font-size: 0.65rem; text-transform: uppercase; color: var(--text-secondary); font-weight: 600; }

.verdict-info { flex: 1; }
.verdict-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.4rem; }
.verdict-badge { font-size: 0.75rem; font-weight: 700; padding: 0.25rem 0.65rem; border-radius: 9999px; text-transform: uppercase; }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-success { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }

.verdict-title { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.35rem; }
.verdict-desc { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.5; }

/* BENTO GRID DE MÉTRICAS */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
@media (max-width: 1024px) { .metrics-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .metrics-grid { grid-template-columns: 1fr; } }

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.metric-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}
.metric-title { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.4rem; }
.metric-val { font-size: 1.55rem; font-weight: 800; font-family: var(--font-mono); color: var(--text-primary); margin-bottom: 0.25rem; }
.metric-sub { font-size: 0.75rem; color: var(--text-muted); }

/* =========================================================
   AI DETECTION & BURSTINESS CARD
   ========================================================= */
.ai-detection-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), var(--bg-card));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-card);
}

.ai-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-color);
}

.ai-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.ai-icon { font-size: 1.8rem; }
.ai-title-wrap h3 { font-size: 1.15rem; font-weight: 700; color: #a5b4fc; }
.ai-title-wrap p { font-size: 0.82rem; color: var(--text-secondary); }

.ai-prob-badge {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.4);
  font-family: var(--font-mono);
}

.ai-card-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1rem;
}
@media (max-width: 800px) { .ai-card-body { grid-template-columns: 1fr; } }

.ai-metric-item {
  background: rgba(11, 15, 25, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.ai-label { font-size: 0.78rem; color: var(--text-secondary); font-weight: 600; }
.ai-metric-item strong { font-size: 1.35rem; color: var(--text-primary); font-family: var(--font-mono); }
.ai-metric-item small { font-size: 0.72rem; color: var(--text-muted); }

.ai-verdict-box {
  background: rgba(11, 15, 25, 0.4);
  border-left: 3px solid var(--accent-indigo);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.ai-verdict-box strong { font-size: 0.88rem; color: #c7d2fe; }
.ai-verdict-box p { font-size: 0.84rem; color: var(--text-secondary); margin-top: 0.2rem; }

/* =========================================================
   CORPUS & ACADEMIC MATCHES
   ========================================================= */
.corpus-results-card, .academic-results-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-card);
}
.corpus-results-card.hidden, .academic-results-card.hidden { display: none; }

.section-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-color);
}
.section-card-header h3 { font-size: 1.15rem; font-weight: 600; }

.corpus-list, .academic-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.corpus-item, .academic-item {
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}
.corpus-item:hover, .academic-item:hover {
  background: rgba(25, 34, 54, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
}

.match-info-main h4 { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.25rem; }
.match-info-meta { font-size: 0.8rem; color: var(--text-muted); }
.match-score-badge-large {
  font-size: 0.95rem;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.academic-link {
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.academic-link:hover { text-decoration: underline; }

/* =========================================================
   COMPARISON BODY & MARKS
   ========================================================= */
.comparison-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.75rem;
}

.comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}
.comparison-header h3 { font-size: 1.15rem; font-weight: 600; }
.comparison-legend { display: flex; gap: 1rem; font-size: 0.82rem; color: var(--text-secondary); }
.legend-item { display: flex; align-items: center; gap: 0.4rem; }

.comparison-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 900px) { .comparison-body { grid-template-columns: 1fr; } }

.comparison-pane {
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.pane-title { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 0.75rem; border-bottom: 1px dashed var(--border-color); padding-bottom: 0.4rem; }

.text-rendered {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

mark.mark-a {
  background-color: var(--highlight-a-bg);
  border-bottom: 2px solid var(--highlight-a-border);
  color: #fff;
  padding: 0.15rem 0.3rem;
  border-radius: 3px;
  font-weight: 500;
}
mark.mark-b {
  background-color: var(--highlight-b-bg);
  border-bottom: 2px solid var(--highlight-b-border);
  color: #fff;
  padding: 0.15rem 0.3rem;
  border-radius: 3px;
  font-weight: 500;
}

/* MATCHES DETAIL */
.sentences-matches-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}
.matches-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.matches-header h3 { font-size: 1.1rem; font-weight: 600; }
.badge-count { font-size: 0.78rem; background: rgba(255, 255, 255, 0.08); padding: 0.25rem 0.65rem; border-radius: 9999px; color: var(--text-secondary); font-family: var(--font-mono); }
.matches-list { display: flex; flex-direction: column; gap: 0.85rem; max-height: 380px; overflow-y: auto; padding-right: 0.5rem; }

.match-item {
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.match-item-top { display: flex; justify-content: space-between; align-items: center; }
.match-score-badge { font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: var(--radius-sm); background: rgba(239, 68, 68, 0.15); color: #f87171; font-family: var(--font-mono); }
.match-pair-row { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.88rem; }
.row-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.row-content-a { color: #fca5a5; border-left: 2px solid var(--color-danger); padding-left: 0.6rem; }
.row-content-b { color: #93c5fd; border-left: 2px solid var(--accent-blue); padding-left: 0.6rem; }

/* =========================================================
   MODAL CORPUS
   ========================================================= */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.hidden { display: none; }

.modal-box {
  background: #111827;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { font-size: 1.2rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-secondary); font-size: 1.6rem; cursor: pointer; }
.modal-close:hover { color: #fff; }

.modal-body { padding: 1.5rem; }
.modal-intro { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 1.25rem; line-height: 1.5; }

.corpus-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
@media (max-width: 600px) { .corpus-form-grid { grid-template-columns: 1fr; } }

.corpus-form-grid input {
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}
.corpus-form-grid input:focus { border-color: var(--accent-blue); }

.corpus-file-upload input {
  width: 100%;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.btn-corpus-submit {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
}
.btn-corpus-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4); }

.corpus-table-wrap {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  max-height: 240px;
  overflow-y: auto;
}
.corpus-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}
.corpus-table th, .corpus-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
}
.corpus-table th { background: rgba(255, 255, 255, 0.04); font-weight: 600; color: var(--text-secondary); }
.corpus-table td { color: var(--text-primary); }

/* =========================================================
   CONSOLA DE TELEMETRÍA EN VIVO (SSE LIVE MONITOR)
   ========================================================= */
.telemetry-section {
  margin-bottom: 2rem;
  animation: fadeIn 0.3s ease-out;
}
.telemetry-section.hidden { display: none; }

.telemetry-card {
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 12px 35px -10px rgba(0, 0, 0, 0.7), 0 0 20px rgba(59, 130, 246, 0.15);
}

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

.telemetry-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.telemetry-title-wrap h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.telemetry-title-wrap p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.pulse-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #38bdf8;
  box-shadow: 0 0 12px #38bdf8;
  animation: pulseGlow 1.8s infinite ease-in-out;
}

@keyframes pulseGlow {
  0% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 6px #38bdf8; }
  50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 18px #38bdf8, 0 0 30px rgba(56, 189, 248, 0.4); }
  100% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 6px #38bdf8; }
}

.telemetry-pct {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #38bdf8;
  letter-spacing: -0.02em;
}

.progress-bar-wrap {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb 0%, #06b6d4 50%, #10b981 100%);
  border-radius: 9999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

.passes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .passes-grid {
    grid-template-columns: 1fr;
  }
}

.pass-badge {
  background: rgba(11, 15, 25, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pass-badge.pending {
  opacity: 0.45;
  border-color: rgba(255, 255, 255, 0.05);
}

.pass-badge.active {
  opacity: 1;
  border-color: #38bdf8;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(15, 23, 42, 0.85));
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.25);
  transform: translateY(-2px);
}

.pass-badge.completed {
  opacity: 1;
  border-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(15, 23, 42, 0.85));
}

.pass-badge-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.pass-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.pass-badge.active .pass-number {
  background: #0284c7;
  color: #fff;
}

.pass-badge.completed .pass-number {
  background: #059669;
  color: #fff;
}

.pass-badge p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.pass-state {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.pass-badge.active .pass-state {
  color: #38bdf8;
}

.pass-badge.completed .pass-state {
  color: #34d399;
}

/* LIVE COUNTERS */
.live-counters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .live-counters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .live-counters-grid {
    grid-template-columns: 1fr;
  }
}

.counter-card {
  background: rgba(11, 15, 25, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.counter-card.counter-danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(11, 15, 25, 0.65));
}

.counter-card.counter-danger .counter-val {
  color: #f87171;
}

.counter-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.counter-val {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.counter-val-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: #38bdf8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* TERMINAL DE LOGS */
.terminal-box {
  background: #080c14;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-family: var(--font-mono);
}

.terminal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.terminal-body {
  max-height: 220px;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
  line-height: 1.5;
}

.terminal-line {
  color: #94a3b8;
  word-break: break-word;
}

.terminal-line .term-time {
  color: #475569;
  margin-right: 0.5rem;
}

.terminal-line.term-pass {
  color: #38bdf8;
  font-weight: 600;
}

.terminal-line.term-match {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.terminal-line.term-success {
  color: #34d399;
}

/* =========================================================
   VISOR INTERACTIVO DEL DOCUMENTO COMPLETO E INSPECTOR
   ========================================================= */
.document-viewer-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-card);
}

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

.viewer-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.viewer-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.viewer-legend {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.legend-chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
}

.legend-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.legend-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.viewer-body-layout {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .viewer-body-layout {
    grid-template-columns: 1fr;
  }
}

.full-document-text {
  background: rgba(11, 15, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.85;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 560px;
  overflow-y: auto;
}

mark.flagged-sentence {
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-weight: 500;
  display: inline;
}

mark.flagged-sentence.severity-high {
  background-color: rgba(239, 68, 68, 0.3);
  border-bottom: 2px solid #ef4444;
  color: #fee2e2;
}

mark.flagged-sentence.severity-medium {
  background-color: rgba(245, 158, 11, 0.3);
  border-bottom: 2px solid #f59e0b;
  color: #fef3c7;
}

mark.flagged-sentence:hover {
  filter: brightness(1.25);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

mark.flagged-sentence.selected-flag {
  outline: 2px solid #38bdf8;
  background-color: rgba(56, 189, 248, 0.35) !important;
  color: #fff !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.6);
}

/* SENTENCE INSPECTOR */
.sentence-inspector {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  position: sticky;
  top: 90px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.inspector-header h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #93c5fd;
}

.inspector-pill {
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.inspector-body label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.6rem;
  margin-bottom: 0.3rem;
  letter-spacing: 0.03em;
}

.inspector-quote {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid #ef4444;
  padding: 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.88rem;
  color: #fca5a5;
  line-height: 1.5;
  font-style: normal;
}

.inspector-source-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.4;
}

.inspector-link {
  color: #38bdf8;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.3rem;
  transition: var(--transition);
}

.inspector-link:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

.inspector-link.hidden { display: none; }

.inspector-snippet {
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.84rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* =========================================================
   TABLA DETALLADA DE ORACIONES OBSERVADAS
   ========================================================= */
.flagged-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-card);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

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

.flagged-table th {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.flagged-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}

.flagged-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.flagged-table .cell-idx {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
}

.flagged-table .cell-text {
  color: var(--text-primary);
  line-height: 1.45;
  font-weight: 500;
}

.score-badge-table {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.score-badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.score-badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.type-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.type-literal {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.type-paraphrase {
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
}

.cell-source a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 500;
}

.cell-source a:hover {
  text-decoration: underline;
}

.cell-snippet {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.4;
}

/* =========================================================
   RESUMEN DE FUENTES ENCONTRADAS
   ========================================================= */
.sources-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-card);
}

.sources-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.source-item {
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.source-item:hover {
  background: rgba(25, 34, 54, 0.8);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

.source-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 80%;
}

.source-info strong {
  font-size: 0.9rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.source-count-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 0.25rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* =========================================================
   PRINT STYLES FOR OFFICIAL REPORT
   ========================================================= */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .app-header, .mode-selector-section, .samples-bar, .audit-form, .report-top-bar button, .modal-backdrop, .app-footer {
    display: none !important;
  }
  .main-content {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .results-section {
    display: block !important;
  }
  .verdict-banner, .metric-card, .ai-detection-card, .corpus-results-card, .academic-results-card, .comparison-container, .sentences-matches-card {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    break-inside: avoid;
    margin-bottom: 1.5rem !important;
  }
  .score-circle {
    border-color: #333 !important;
    color: #000 !important;
  }
  mark.mark-a {
    background: #ffcccc !important;
    color: #900 !important;
  }
  mark.mark-b {
    background: #cce5ff !important;
    color: #004085 !important;
  }
}

/* =========================================================
   FOOTER
   ========================================================= */
.app-footer {
  border-top: 1px solid var(--border-color);
  background: rgba(11, 15, 25, 0.85);
  padding: 1.5rem 2rem;
  margin-top: auto;
  text-align: center;
}
.footer-container { max-width: 1440px; margin: 0 auto; }
.footer-container p { font-size: 0.85rem; color: var(--text-secondary); }
.footer-note { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
