:root {
  --primario: #1e40af;
  --fondo: #f5f7fb;
  --borde: #e5e7eb;
}
body { background: var(--fondo); font-family: "Inter", "Segoe UI", system-ui, sans-serif; color: #1f2937; }
.barra { background: linear-gradient(90deg, #0f172a, #1e3a8a); box-shadow: 0 2px 8px rgba(15, 23, 42, .15); }
.barra .nav-link { color: rgba(255, 255, 255, .85); }
.barra .nav-link:hover { color: #fff; }
.chip-dataset { background: rgba(255, 255, 255, .12); color: #fff; padding: .3rem .75rem; border-radius: 999px; font-size: .85rem; white-space: nowrap; }
.card { border: 1px solid var(--borde); border-radius: .75rem; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }
.card-header { background: #fff; border-bottom: 1px solid var(--borde); font-weight: 600; border-radius: .75rem .75rem 0 0 !important; }
.metrica .card-body { padding: 1rem 1.1rem; }
.encabezado h1 { font-weight: 700; }
.modulo { transition: transform .15s ease, box-shadow .15s ease; color: inherit; text-decoration: none; }
.modulo:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(30, 64, 175, .12); color: inherit; }
.modulo .icono { width: 44px; height: 44px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; background: #eff6ff; color: var(--primario); }
.tabla-scroll { overflow: auto; }
.tabla-scroll thead th { position: sticky; top: 0; z-index: 1; }
table.dataframe { font-size: .875rem; }
.cargando { position: fixed; inset: 0; background: rgba(255, 255, 255, .8); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.login-fondo { min-height: 100vh; background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #2563eb 100%); }
.pre-reglas { max-height: 420px; overflow: auto; background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: .5rem; font-size: .8rem; }
.badge-cat { font-weight: 500; }
.lista-cols .form-check { margin-bottom: .15rem; }
.calidad-alta { border-left: 4px solid #16a34a; }
.calidad-buena { border-left: 4px solid #2563eb; }
.calidad-moderada { border-left: 4px solid #ca8a04; }
.calidad-baja { border-left: 4px solid #dc2626; }
.img-arbol { max-width: 100%; height: auto; }
.conclusion { background: #eff6ff; border-color: #bfdbfe; }
.conclusion li { margin-bottom: .25rem; }
.conclusion-aviso { background: #fffbeb; border-color: #fde68a; }
.paso { width: 26px; height: 26px; border-radius: 50%; background: var(--primario); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; margin-right: .5rem; }
.muestra-com { background: #f8fafc; border-left: 3px solid #93c5fd; padding: .35rem .6rem; margin-bottom: .35rem; font-size: .85rem; border-radius: 0 .35rem .35rem 0; }
.sugerencia { border-left: 4px solid var(--primario); }
details.avanzado > summary { cursor: pointer; color: var(--primario); font-weight: 500; }
.lista-hojas { max-height: 520px; overflow-y: auto; }
.lista-hojas .seleccionada:not(.active) { background: #eff6ff; border-left: 3px solid var(--primario); }
.chip-col { background: #f8fafc; border: 1px solid var(--borde); border-radius: 999px; padding: .15rem .6rem; font-size: .8rem; white-space: nowrap; }
.selector-hoja .dropdown-menu { max-height: 70vh; overflow-y: auto; min-width: 280px; }
.selector-hoja .dropdown-item.active { background: var(--primario); }

/* ——— Análisis cualitativo ——— */
.nav-qda .nav-link { color: #475569; font-size: .9rem; }
.nav-qda .nav-link.active { color: var(--primario); font-weight: 600; }
.punto { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.qda-arbol { max-height: calc(100vh - 290px); overflow-y: auto; }
.qda-codigo { display: flex; align-items: center; gap: .4rem; padding: .3rem .4rem; border-radius: .4rem; cursor: pointer; font-size: .87rem; }
.qda-codigo:hover { background: #f1f5f9; }
.qda-codigo.activo { background: #dbeafe; font-weight: 600; }
.qda-texto { line-height: 1.75; font-size: .95rem; white-space: normal; user-select: text; }
.qda-marca { padding: 0 0 2px; border-radius: 2px; cursor: pointer; color: inherit; }
.qda-chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid; border-radius: 999px; padding: .05rem .5rem; font-size: .75rem; background: #fff; }
.qda-barra { position: absolute; z-index: 1500; background: #fff; border: 1px solid var(--borde); border-radius: .6rem; box-shadow: 0 8px 24px rgba(15, 23, 42, .18); padding: .4rem; display: flex; gap: .35rem; align-items: center; }
.qda-avisos { position: fixed; right: 16px; bottom: 16px; z-index: 3000; max-width: 360px; }
.qda-lista-segs { max-height: 50vh; overflow-y: auto; font-size: .83rem; }
.qda-seg-item { border-left: 3px solid #cbd5e1; padding: .3rem .5rem; margin-bottom: .4rem; color: inherit; text-decoration: none; }
.qda-seg-item:hover { background: #f8fafc; }
.qda-panel-sticky { position: sticky; top: 12px; }
.qda-lienzo { position: relative; display: inline-block; max-width: 100%; cursor: crosshair; user-select: none; }
.qda-lienzo img { max-width: 100%; display: block; }
.qda-area { position: absolute; border: 2px solid; background: rgba(37, 99, 235, .12); pointer-events: none; }
.qda-area.nueva { border-color: #2563eb; border-style: dashed; }
.qda-area .etq { position: absolute; top: -1.4em; left: -2px; font-size: .7rem; color: #fff; padding: 0 .3rem; white-space: nowrap; border-radius: 3px 3px 0 0; }
.qda-transcripcion { max-height: 420px; overflow-y: auto; }
.qda-linea { padding: .25rem .5rem; border-radius: .3rem; cursor: pointer; }
.qda-linea:hover { background: #f1f5f9; }
.qda-linea-activa { background: #fef9c3 !important; }
.qda-retrato { display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; max-width: 420px; }
.qda-retrato span { aspect-ratio: 1; border-radius: 2px; }
.nube-palabras { line-height: 2.1; text-align: center; }
.nube-palabras a { display: inline-block; margin: 0 .35rem; text-decoration: none; font-weight: 600; }
.nube-palabras a:hover { text-decoration: underline; }
.kwic td.izq { text-align: right; color: #475569; white-space: nowrap; overflow: hidden; max-width: 340px; }
.kwic td.term { font-weight: 700; color: var(--primario); white-space: nowrap; }
.kwic td.der { color: #475569; white-space: nowrap; overflow: hidden; max-width: 340px; }
.resumen-celda textarea { font-size: .8rem; min-width: 220px; }
#redMapa { height: calc(100vh - 260px); min-height: 480px; border: 1px solid var(--borde); border-radius: .75rem; background: #fff; }
