/* =========================================================
   Kairos UI · piezas modulares para cualquier pantalla
   Oscuro por defecto; claro con la clase .claro en <html>.
   ========================================================= */
@font-face { font-family: 'Cinzel'; src: url('../../fuentes/Cinzel-Regular.ttf?v=1') format('truetype'); }
@font-face { font-family: 'Inter'; src: url('../../fuentes/Inter-Variable.ttf?v=1') format('truetype'); font-weight: 100 900; font-display: block; }

/* ---------- tokens ---------- */
:root {
  /* superficies */
  --fondo: #030200; --panel: #0a0907; --tarjeta: #0e0c0a; --suave: #1a1816; --suave-2: #23201d;
  /* texto */
  --texto: #e8dfd2; --texto-2: #b9ad9c; --texto-3: #6f675f; --linea: rgba(232,223,210,.10); --linea-2: rgba(232,223,210,.18);
  /* acción */
  --boton-fondo: #e8dfd2; --boton-texto: #030200;
  /* señal: el único color fuera de la piedra, solo para lo que exige atención (vencido, error, caída) */
  --senal: #c27a5c; --senal-suave: rgba(194,122,92,.14);
  /* series de gráficas: de la piedra clara al grafito */
  --s1: #e8dfd2; --s2: #b9ad9c; --s3: #857b70; --s4: #554e47; --s5: #2f2b27;
  /* forma */
  --r-s: 6px; --r: 10px; --r-l: 14px; --r-xl: 18px;
  --e1: 4px; --e2: 8px; --e3: 12px; --e4: 16px; --e5: 24px; --e6: 32px; --e7: 48px;
  --sombra: 0 10px 30px rgba(0,0,0,.35);
}
.claro {
  --fondo: #fbf9f6; --panel: #f3efe8; --tarjeta: #ffffff; --suave: #f0ebe3; --suave-2: #e4ddd2;
  --texto: #1a1816; --texto-2: #5f5954; --texto-3: #8a8178; --linea: rgba(26,24,22,.10); --linea-2: rgba(26,24,22,.16);
  --boton-fondo: #1a1816; --boton-texto: #fbf9f6;
  --senal: #a8553a; --senal-suave: rgba(168,85,58,.10);
  --s1: #1a1816; --s2: #5f5954; --s3: #958b80; --s4: #c4b9ac; --s5: #e4ddd2;
  --sombra: 0 10px 30px rgba(26,24,22,.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--fondo); color: var(--texto); font-family: 'Inter', system-ui, sans-serif; font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
.num, time, .tnum { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 1px solid var(--texto-2); outline-offset: 2px; }
img { display: block; max-width: 100%; }

/* ---------- tipografía ---------- */
.t-marca { font-family: 'Cinzel'; font-weight: 400; letter-spacing: .42em; }
.t-1 { font-size: 30px; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
.t-2 { font-size: 20px; font-weight: 600; line-height: 1.25; }
.t-3 { font-size: 15px; font-weight: 600; }
.t-cuerpo { font-size: 14px; }
.t-chico { font-size: 12.5px; color: var(--texto-2); }
.t-mini { font-size: 11px; color: var(--texto-3); font-weight: 500; }
.t-2nd { color: var(--texto-2); }

/* ---------- botones ---------- */
.btn { font: 500 13px 'Inter'; border-radius: 8px; padding: 9px 14px; cursor: pointer; border: 1px solid var(--linea-2); background: transparent; color: var(--texto); display: inline-flex; align-items: center; gap: 8px; transition: transform .15s cubic-bezier(.16,1,.3,1), background .15s; white-space: nowrap; }
.btn:hover { background: var(--suave); }
.btn:active { transform: scale(.97); }
.btn.lleno { background: var(--boton-fondo); color: var(--boton-texto); border-color: var(--boton-fondo); }
.btn.lleno:hover { opacity: .9; }
.btn.plano { border-color: transparent; color: var(--texto-2); }
.btn.chico { padding: 6px 10px; font-size: 12px; border-radius: 7px; }
.btn.grande { padding: 12px 20px; font-size: 14px; border-radius: 10px; }
.btn.senal { border-color: var(--senal); color: var(--senal); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.grupo-btn { display: flex; gap: var(--e2); flex-wrap: wrap; }

/* ---------- campos ---------- */
.campo { display: grid; gap: 6px; align-content: start; }
.entrada { height: 40px; }
.campo label { font-size: 12.5px; font-weight: 500; color: var(--texto-2); }
.entrada { font: 400 14px 'Inter'; color: var(--texto); background: var(--suave); border: 1px solid var(--linea); border-radius: var(--r); padding: 10px 12px; width: 100%; }
.entrada::placeholder { color: var(--texto-3); }
.entrada:focus { outline: none; border-color: var(--texto-2); }
.campo .ayuda { font-size: 12px; color: var(--texto-3); }
.campo.error .entrada { border-color: var(--senal); }
.campo.error .ayuda { color: var(--senal); }
select.entrada { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--texto-2) 50%), linear-gradient(135deg, var(--texto-2) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.interruptor { width: 36px; height: 21px; border-radius: 20px; background: var(--suave-2); position: relative; display: inline-block; vertical-align: middle; }
.interruptor::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--texto-2); transition: transform .2s; }
.interruptor.on { background: var(--boton-fondo); }
.interruptor.on::after { transform: translateX(15px); background: var(--boton-texto); }

/* ---------- selección: vistas, pestañas, filtros ---------- */
.vistas { display: inline-flex; background: var(--suave); border-radius: 9px; padding: 3px; }
.vistas a { font-size: 13px; font-weight: 500; padding: 6px 13px; border-radius: 7px; color: var(--texto-2); text-decoration: none; }
.vistas a.activa { background: var(--fondo); color: var(--texto); }
.pestanas { display: flex; gap: var(--e5); border-bottom: 1px solid var(--linea); }
.pestanas a { font-size: 13.5px; font-weight: 500; padding: 10px 0; color: var(--texto-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pestanas a.activa { color: var(--texto); border-color: var(--texto); }
.filtros { display: flex; gap: 6px; flex-wrap: wrap; }
.filtro { font-size: 12.5px; font-weight: 500; padding: 6px 11px; border-radius: 20px; border: 1px solid var(--linea-2); color: var(--texto-2); }
.filtro.activo { background: var(--boton-fondo); border-color: var(--boton-fondo); color: var(--boton-texto); }
.estado { font-size: 12px; font-weight: 600; }
.estado.senal { color: var(--senal); }
.estado.apagado { color: var(--texto-3); font-weight: 500; }

/* ---------- agentes y tareas (se ven, no se les escribe) ---------- */
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar.chico { width: 24px; height: 24px; }
.avatar.grande { width: 56px; height: 56px; }
.tarea { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; background: var(--suave); border-radius: var(--r); padding: 10px 12px; min-width: 0; }
.tarea > div { min-width: 0; }
.tarea b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tarea span { display: block; font-size: 12px; color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra { height: 3px; background: var(--suave-2); border-radius: 3px; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--texto); border-radius: 3px; }
.tarea .barra { grid-column: 1 / -1; height: 2px; }
.tareas { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }

/* ---------- chat con Kairos ---------- */
.chat-cab { display: flex; align-items: center; justify-content: space-between; }
.chat-cab h2 { font-family: 'Cinzel'; font-weight: 400; font-size: 20px; letter-spacing: .42em; }
.msg .quien { font-size: 12px; font-weight: 600; color: var(--texto-2); margin-bottom: 6px; }
.msg .quien time { font-weight: 400; color: var(--texto-3); margin-left: 8px; }
.msg .burbuja { font-size: 15px; line-height: 1.55; }
.msg.yo { margin-left: auto; max-width: 82%; text-align: right; }
.msg.yo .burbuja { background: var(--suave); padding: 11px 16px; border-radius: 14px 14px 4px 14px; display: inline-block; text-align: left; }
.msg.k { max-width: 90%; }
.msg .acciones { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.resumen { margin-top: 10px; border: 1px solid var(--linea); border-radius: var(--r); overflow: hidden; }
.resumen > div { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 10px 14px; font-size: 14px; border-top: 1px solid var(--linea); }
.resumen > div:first-child { border-top: 0; }
.resumen time, .resumen .num { color: var(--texto-2); }
.adjunto { margin-top: 10px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--linea); border-radius: var(--r); padding: 10px 12px; }
.adjunto .hoja-ico { width: 34px; height: 42px; border-radius: 4px; background: var(--suave-2); flex: none; display: grid; place-items: end center; padding-bottom: 5px; font-size: 9px; font-weight: 700; color: var(--texto-2); }
.adjunto b { display: block; font-size: 13.5px; font-weight: 600; }
.adjunto span { font-size: 12px; color: var(--texto-2); }
.pensando { display: inline-flex; gap: 4px; }
.pensando i { width: 6px; height: 6px; border-radius: 50%; background: var(--texto-3); animation: latir 1.2s infinite; }
.pensando i:nth-child(2) { animation-delay: .2s; } .pensando i:nth-child(3) { animation-delay: .4s; }
@keyframes latir { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.caja-texto { display: flex; align-items: center; gap: 12px; background: var(--suave); border: 1px solid var(--linea); border-radius: 12px; padding: 7px 7px 7px 16px; }
.caja-texto textarea { flex: 1; resize: none; background: transparent; border: 0; color: var(--texto); font: 400 15px/22px 'Inter'; height: 44px; padding-top: 11px; }
.caja-texto textarea:focus { outline: none; }
.caja-texto textarea::placeholder { color: var(--texto-3); }

/* comentar algo de la herramienta: lo eliges y le escribes a Kairos sobre eso */
.sobre { display: flex; align-items: center; gap: 10px; background: var(--suave); border-radius: var(--r); padding: 9px 10px 9px 12px; }
.sobre div { flex: 1; min-width: 0; }
.sobre b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sobre span { display: block; font-size: 12px; color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comentar { display: grid; gap: 10px; }
[data-ref] { cursor: pointer; }
.elegido { outline: 2px solid var(--texto) !important; outline-offset: 1px; position: relative; z-index: 2; }

/* ---------- módulos y tablero ---------- */
.tablero { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--e4); }
.m-2 { grid-column: span 2; } .m-3 { grid-column: span 3; } .m-4 { grid-column: span 4; } .m-5 { grid-column: span 5; }
.m-6 { grid-column: span 6; } .m-7 { grid-column: span 7; } .m-8 { grid-column: span 8; } .m-12 { grid-column: span 12; }
@media (max-width: 1100px) { .m-2, .m-3 { grid-column: span 6; } .m-4, .m-5, .m-6, .m-7, .m-8 { grid-column: span 12; } }
@media (max-width: 640px) { .tablero > * { grid-column: span 12; } }
.modulo { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--r-l); padding: 18px 20px 20px; min-width: 0; container-type: inline-size; display: flex; flex-direction: column; }
.modulo.sin-relleno { padding: 0; overflow: hidden; }
.modulo-cab { display: flex; align-items: center; justify-content: space-between; gap: var(--e3); margin-bottom: var(--e4); min-height: 28px; }
.modulo-cab h3 { font-size: 14px; font-weight: 600; }
.modulo-cab h3 span { font-weight: 400; color: var(--texto-2); margin-left: 6px; }
.modulo.sin-relleno .modulo-cab { padding: 16px 20px 0; }

/* indicadores */
.kpi .etiqueta { font-size: 12.5px; color: var(--texto-2); font-weight: 500; }
.kpi .valor { font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .pie { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12.5px; color: var(--texto-2); }
.delta { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.baja { color: var(--senal); }
.kpi .spark { position: relative; height: 44px; margin-top: 12px; width: 100%; min-width: 0; overflow: hidden; }
.kpi .spark canvas { display: block; max-width: 100%; }
@container (max-width: 220px) { .kpi .valor { font-size: 24px; } }

.grafica { position: relative; height: var(--alto, 220px); width: 100%; }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--texto-2); }
.leyenda i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }

/* metas / avance contra objetivo */
.metas { display: grid; gap: 14px; }
.meta .fila { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.meta .fila span { color: var(--texto-2); font-variant-numeric: tabular-nums; }
.meta .barra { height: 6px; }
.meta .barra i.senal { background: var(--senal); }

/* mapa de calor (semana x hora, o lo que sea) */
.calor { display: grid; grid-template-columns: 34px repeat(var(--cols, 12), 1fr); gap: 3px; font-size: 10.5px; color: var(--texto-3); align-items: center; }
.calor i { aspect-ratio: 1.5; border-radius: 3px; background: var(--texto); }
.calor .h { text-align: center; }

/* embudo */
.embudo { display: grid; gap: 6px; }
.embudo div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.embudo .franja { height: 30px; border-radius: 6px; background: var(--s2); display: flex; align-items: center; padding: 0 10px; color: var(--boton-texto); font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; margin: 0 auto; }
.embudo span { color: var(--texto-2); font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }

/* ranking */
.ranking { display: grid; gap: 10px; }
.ranking div { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13px; }
.ranking div .barra { grid-column: 1 / -1; height: 4px; }
.ranking div span { font-variant-numeric: tabular-nums; color: var(--texto-2); }

/* ---------- herramientas ---------- */
/* tabla */
.tabla-env { overflow: auto; }
.tabla { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.tabla th { text-align: left; font-size: 12px; font-weight: 600; color: var(--texto-2); padding: 9px 12px; border-bottom: 1px solid var(--linea-2); white-space: nowrap; position: sticky; top: 0; background: var(--tarjeta); }
.tabla td { padding: 10px 12px; border-bottom: 1px solid var(--linea); white-space: nowrap; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla .num { text-align: right; }
.tabla tr.total td { font-weight: 600; border-top: 1px solid var(--linea-2); }
.tabla.hoja th, .tabla.hoja td { border-right: 1px solid var(--linea); }
.tabla .persona { display: flex; align-items: center; gap: 10px; }
.tabla .persona i { width: 26px; height: 26px; border-radius: 50%; background: var(--suave-2); display: grid; place-items: center; font-style: normal; font-size: 10.5px; font-weight: 600; flex: none; }

/* agenda */
.agenda { display: grid; grid-template-columns: 40px repeat(var(--dias, 5), 1fr); grid-template-rows: 34px var(--alto, 260px); }
.agenda .dia { font-size: 11.5px; color: var(--texto-2); text-align: center; border-bottom: 1px solid var(--linea); }
.agenda .dia b { font-size: 14px; color: var(--texto); margin-left: 4px; }
.agenda .horas { position: relative; }
.agenda .horas span { position: absolute; right: 8px; font-size: 10.5px; color: var(--texto-3); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.agenda .col { position: relative; border-left: 1px solid var(--linea); background-image: repeating-linear-gradient(to bottom, var(--linea) 0 1px, transparent 1px var(--paso, 16.6667%)); }
.evento { position: absolute; left: 3px; right: 3px; background: var(--tarjeta); border: 1px solid var(--linea-2); border-radius: 7px; padding: 5px 7px; overflow: hidden; font-size: 11.5px; }
.claro .evento { background: #fff; }
.evento b { display: block; font-weight: 600; line-height: 1.25; }
.evento time { color: var(--texto-2); font-size: 10.5px; }
.evento.fuerte { background: var(--boton-fondo); border-color: var(--boton-fondo); color: var(--boton-texto); }
.evento.fuerte time { color: var(--boton-texto); opacity: .75; }
.evento.propuesto { border-style: dashed; background: transparent; }
.evento.encima { left: 42%; box-shadow: 0 0 0 2px var(--tarjeta); }
.evento.junto { border-color: var(--texto-2); }
.evento.junto li { list-style: none; color: var(--texto-2); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* explorador de archivos */
.ruta { display: flex; gap: 6px; font-size: 12.5px; color: var(--texto-2); align-items: center; }
.ruta b { color: var(--texto); font-weight: 600; }
.archivos { display: grid; }
.archivo { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 12px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--linea); font-size: 13px; }
.archivo:last-child { border-bottom: 0; }
.archivo .tipo { width: 26px; height: 32px; border-radius: 4px; background: var(--suave-2); display: grid; place-items: end center; padding-bottom: 4px; font-size: 7.5px; font-weight: 700; color: var(--texto-2); letter-spacing: .02em; }
.archivo .tipo.carpeta { height: 22px; width: 28px; border-radius: 3px 6px 4px 4px; padding: 0; }
.archivo span { color: var(--texto-2); font-size: 12px; font-variant-numeric: tabular-nums; }

/* visor de PDF */
.visor { background: var(--panel); border-radius: var(--r); padding: 18px; display: grid; grid-template-columns: 64px 1fr; gap: 16px; }
.miniaturas { display: grid; gap: 10px; align-content: start; }
.miniaturas i { aspect-ratio: .77; border-radius: 3px; background: var(--tarjeta); border: 1px solid var(--linea); }
.claro .miniaturas i { background: #fff; }
.miniaturas i.activa { outline: 2px solid var(--texto); }
.pagina { background: #fdfcfa; color: #1a1816; border-radius: 3px; padding: 28px 30px; aspect-ratio: .77; max-height: 420px; margin: 0 auto; width: 100%; max-width: 330px; box-shadow: 0 4px 18px rgba(0,0,0,.18); font-size: 7.5px; overflow: hidden; }
.pagina h4 { font-size: 11px; margin-bottom: 4px; }
.pagina .linea-t { height: 4px; background: #e4ddd2; border-radius: 2px; margin: 5px 0; }
.pagina .resalte { background: rgba(26,24,22,.08); outline: 1.5px solid #1a1816; border-radius: 2px; padding: 2px 3px; margin: 6px -3px; }

/* visor de imagen */
.imagen-visor { position: relative; border-radius: var(--r); overflow: hidden; background: #000; }
.imagen-visor img { width: 100%; height: 260px; object-fit: cover; }
.imagen-visor .marca-punto { position: absolute; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #e8dfd2; background: rgba(3,2,0,.55); color: #e8dfd2; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.imagen-visor .barra-visor { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: space-between; align-items: center; color: #e8dfd2; font-size: 12px; }
.imagen-visor .barra-visor .vistas { background: rgba(3,2,0,.6); }
.imagen-visor .barra-visor .vistas a { color: #b9ad9c; }
.imagen-visor .barra-visor .vistas a.activa { background: #e8dfd2; color: #030200; }

/* tablero de tareas */
.columnas { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 12px; }
.columna-t { background: var(--panel); border-radius: var(--r); padding: 10px; display: grid; gap: 8px; align-content: start; }
.columna-t > header { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; padding: 2px 4px 4px; }
.columna-t > header span { color: var(--texto-3); font-weight: 500; }
.tarjeta-t { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 9px; padding: 10px 11px; display: grid; gap: 8px; font-size: 12.5px; }
.claro .tarjeta-t { background: #fff; }
.tarjeta-t b { font-weight: 600; line-height: 1.3; }
.tarjeta-t .pie-t { display: flex; justify-content: space-between; align-items: center; color: var(--texto-2); font-size: 11.5px; }

/* actividad / línea de tiempo */
.actividad { display: grid; }
.paso { display: grid; grid-template-columns: 18px 1fr auto; gap: 12px; position: relative; padding-bottom: 16px; font-size: 13px; }
.paso::before { content: ""; position: absolute; left: 8px; top: 16px; bottom: 0; width: 1px; background: var(--linea-2); }
.paso:last-child { padding-bottom: 0; }
.paso:last-child::before { display: none; }
.paso > i { width: 9px; height: 9px; border-radius: 50%; background: var(--texto); margin: 5px 0 0 4px; }
.paso.falta > i { background: transparent; border: 1.5px solid var(--texto-3); }
.paso span { display: block; color: var(--texto-2); font-size: 12px; }
.paso time { color: var(--texto-3); font-size: 12px; }

/* documento / texto con cambios */
.documento { background: var(--panel); border-radius: var(--r); padding: 22px 24px; font-size: 13.5px; line-height: 1.65; }
.documento h4 { font-size: 15px; margin-bottom: 8px; }
.documento del { color: var(--texto-3); }
.documento ins { text-decoration: none; background: var(--suave-2); border-radius: 3px; padding: 0 3px; }

/* ---------- armazón de la app: riel + chat + herramienta ---------- */
.app { display: grid; grid-template-columns: 96px minmax(340px, 1fr) minmax(0, 1.4fr); height: 820px; border: 1px solid var(--linea); border-radius: var(--r-xl); overflow: hidden; background: var(--fondo); }
.app > * { min-height: 0; min-width: 0; }
.riel { border-right: 1px solid var(--linea); display: flex; flex-direction: column; align-items: center; padding: 20px 0; gap: 4px; }
.riel > img { width: 36px; height: 36px; border-radius: 8px; margin-bottom: 20px; }
.riel a { width: 80px; padding: 10px 0; border-radius: 9px; text-align: center; text-decoration: none; color: var(--texto-2); font-size: 11px; font-weight: 500; }
.riel a.activo { background: var(--suave); color: var(--texto); }
.riel .yo { margin-top: auto; width: 32px; height: 32px; border-radius: 50%; background: var(--suave-2); display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.lado-chat { display: flex; flex-direction: column; border-right: 1px solid var(--linea); }
.lado-chat > header { padding: 0 24px; height: 64px; box-sizing: border-box; border-bottom: 1px solid var(--linea); flex: none; }
.lado-chat .tareas { padding: 14px 24px; border-bottom: 1px solid var(--linea); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lado-chat .mensajes { flex: 1; min-height: 0; overflow: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.lado-chat .escribir { padding: 12px 24px 20px; }
.lado-h { display: flex; flex-direction: column; background: var(--panel); }
.lado-h > header { display: flex; align-items: center; justify-content: space-between; padding: 0 22px; height: 64px; box-sizing: border-box; border-bottom: 1px solid var(--linea); flex: none; }
.lado-h > header h2 { font-size: 16px; font-weight: 600; }
.lado-h > header h2 span { font-weight: 400; color: var(--texto-2); margin-left: 6px; }
.lado-h .cuerpo { flex: 1; min-height: 0; overflow: auto; padding: 18px 22px; }
.lado-h .cuerpo .modulo { background: var(--tarjeta); }

/* =========================================================
   Segunda tanda: más piezas
   ========================================================= */

/* personas (de carne y hueso: iniciales, nunca agentes) */
.persona-ini { width: 32px; height: 32px; border-radius: 50%; background: var(--suave-2); display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 600; flex: none; color: var(--texto); }
.persona-ini.chico { width: 24px; height: 24px; font-size: 9.5px; }
.personas { display: flex; }
.personas .persona-ini { border: 2px solid var(--tarjeta); margin-left: -8px; }
.personas .persona-ini.chico { margin-left: -4px; }
.personas .persona-ini:first-child { margin-left: 0; }

/* etiquetas y contadores */
.etiqueta-t { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--suave); color: var(--texto-2); white-space: nowrap; }
.etiqueta-t.fuerte { background: var(--boton-fondo); color: var(--boton-texto); }
.etiqueta-t.senal { background: var(--senal-suave); color: var(--senal); }
.etiqueta-t.borde { background: transparent; border: 1px solid var(--linea-2); }
.contador { min-width: 18px; height: 18px; border-radius: 9px; background: var(--boton-fondo); color: var(--boton-texto); font-size: 10.5px; font-weight: 700; display: inline-grid; place-items: center; padding: 0 5px; }

/* menú y paleta de búsqueda */
.menu { background: var(--tarjeta); border: 1px solid var(--linea-2); border-radius: 12px; box-shadow: var(--sombra); padding: 6px; min-width: 220px; }
.menu a { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--texto); text-decoration: none; }
.menu a:hover, .menu a.activo { background: var(--suave); }
.menu a kbd { font: 500 11px 'Inter'; color: var(--texto-3); }
.menu a.peligro { color: var(--senal); }
.menu hr { border: 0; border-top: 1px solid var(--linea); margin: 6px 4px; }
.menu .grupo { font-size: 11px; color: var(--texto-3); font-weight: 600; padding: 8px 10px 4px; }
.paleta { background: var(--tarjeta); border: 1px solid var(--linea-2); border-radius: 14px; box-shadow: var(--sombra); overflow: hidden; }
.paleta .entrada { border: 0; border-bottom: 1px solid var(--linea); border-radius: 0; background: transparent; height: 50px; font-size: 15px; padding: 0 18px; }
.paleta .menu { border: 0; box-shadow: none; border-radius: 0; }
.paleta .menu a span { color: var(--texto-2); font-size: 12px; }

/* avisos */
.aviso { display: flex; align-items: center; gap: 14px; background: var(--texto); color: var(--fondo); border-radius: 12px; padding: 12px 14px 12px 16px; font-size: 13.5px; box-shadow: var(--sombra); }
.aviso .btn { color: var(--fondo); border-color: transparent; margin-left: auto; }
.aviso .btn:hover { background: transparent; text-decoration: underline; }
.franja-aviso { display: flex; align-items: center; gap: 12px; border: 1px solid var(--linea-2); border-radius: var(--r); padding: 12px 14px; font-size: 13.5px; }
.franja-aviso.senal { border-color: var(--senal); background: var(--senal-suave); }
.franja-aviso b { font-weight: 600; }
.franja-aviso .btn { margin-left: auto; }

/* bandera roja: algo delicado que el líder tiene que autorizar */
.bandera { border: 1px solid var(--senal); border-radius: var(--r-l); background: var(--tarjeta); overflow: hidden; }
.bandera > header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--senal-suave); color: var(--senal); font-size: 13px; font-weight: 600; }
.bandera > header time { margin-left: auto; font-weight: 500; color: var(--texto-2); }
.bandera .cuerpo-b { padding: 18px; display: grid; gap: 14px; }
.bandera .cuerpo-b h4 { font-size: 17px; font-weight: 600; line-height: 1.3; }
.bandera dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 13px; }
.bandera dt { color: var(--texto-2); }
.bandera dd { font-variant-numeric: normal; }
.bandera .grupo-btn { padding-top: 4px; }

/* diálogo */
.dialogo { background: var(--tarjeta); border: 1px solid var(--linea-2); border-radius: var(--r-xl); box-shadow: var(--sombra); padding: 24px; display: grid; gap: 16px; max-width: 420px; }
.dialogo h4 { font-size: 17px; font-weight: 600; }
.dialogo p { color: var(--texto-2); font-size: 14px; }
.dialogo .grupo-btn { justify-content: flex-end; }

/* pasos de un proceso */
.pasos-h { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 8px; }
.pasos-h div { border-top: 3px solid var(--suave-2); padding-top: 10px; font-size: 12.5px; color: var(--texto-3); }
.pasos-h div b { display: block; font-size: 13px; color: var(--texto-2); font-weight: 600; }
.pasos-h div.hecho { border-color: var(--texto); }
.pasos-h div.hecho b, .pasos-h div.actual b { color: var(--texto); }
.pasos-h div.actual { border-image: linear-gradient(90deg, var(--texto) 50%, var(--suave-2) 50%) 1; }

/* rango y paginación */
.rango-v { position: relative; height: 4px; border-radius: 4px; background: var(--suave-2); margin: 14px 0; }
.rango-v i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--texto); }
.rango-v b { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: var(--fondo); border: 2px solid var(--texto); transform: translate(-50%, -50%); }
.paginas { display: flex; gap: 4px; align-items: center; font-size: 13px; }
.paginas a { min-width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--texto-2); text-decoration: none; padding: 0 8px; }
.paginas a.activa { background: var(--suave); color: var(--texto); font-weight: 600; }

/* calendario chico para escoger fecha */
.mes { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 12.5px; text-align: center; font-variant-numeric: tabular-nums; }
.mes span { color: var(--texto-3); font-size: 11px; padding: 6px 0; }
.mes a { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; color: var(--texto); text-decoration: none; }
.mes a.fuera { color: var(--texto-3); }
.mes a.hoy { box-shadow: inset 0 0 0 1px var(--texto-2); }
.mes a.elegida { background: var(--boton-fondo); color: var(--boton-texto); font-weight: 600; }
.mes a.en-rango { background: var(--suave); border-radius: 0; }

/* subir archivos */
.soltar { border: 1.5px dashed var(--linea-2); border-radius: var(--r-l); padding: 26px; text-align: center; display: grid; gap: 6px; place-items: center; font-size: 13.5px; }
.soltar span { color: var(--texto-2); font-size: 12.5px; }
.subiendo { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; font-size: 13px; }
.subiendo .barra { grid-column: 2 / -1; margin-top: -4px; }

/* carga y vacío */
.esqueleto { background: linear-gradient(90deg, var(--suave) 0%, var(--suave-2) 50%, var(--suave) 100%); background-size: 200% 100%; animation: brillo 1.4s infinite linear; border-radius: 6px; height: 12px; }
@keyframes brillo { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.vacio { text-align: center; padding: 30px 10px; display: grid; gap: 8px; place-items: center; }
.vacio img { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; opacity: .85; }
.vacio b { font-size: 15px; font-weight: 600; }
.vacio span { color: var(--texto-2); font-size: 13px; }

/* notificaciones / bandeja */
.bandeja { display: grid; }
.correo { display: grid; grid-template-columns: 32px 1fr auto; gap: 4px 12px; padding: 12px 6px; border-bottom: 1px solid var(--linea); font-size: 13px; align-items: start; }
.correo:last-child { border-bottom: 0; }
.correo .persona-ini { grid-row: span 2; }
.correo b { font-weight: 600; }
.correo p { grid-column: 2 / -1; color: var(--texto-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.correo time { color: var(--texto-3); font-size: 12px; }
.correo.nuevo b::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--texto); margin-right: 7px; vertical-align: 2px; }

/* cuentas conectadas */
.cuenta { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--linea); }
.cuenta:last-child { border-bottom: 0; }
.cuenta .logo-c { width: 40px; height: 40px; border-radius: 10px; background: var(--tarjeta); border: 1px solid var(--linea); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.cuenta .logo-c svg { width: 19px; height: 19px; fill: var(--texto); }
.cuenta b { display: block; font-size: 13.5px; font-weight: 600; }
.cuenta span { font-size: 12.5px; color: var(--texto-2); }

/* uso del mes */
.uso-total { display: flex; align-items: baseline; gap: 10px; }
.uso-total .t-1 { font-variant-numeric: tabular-nums; }
.uso-barra { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--suave-2); margin: 14px 0 10px; }
.uso-barra i { display: block; height: 100%; }

/* junta terminada */
.video { position: relative; border-radius: var(--r); overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.video img { width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.video .reproducir { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(232,223,210,.92); color: #030200; border: 0; font-weight: 600; padding: 10px 18px; border-radius: 22px; }
.video .linea-v { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 10px; color: #e8dfd2; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.video .linea-v div { flex: 1; height: 3px; background: rgba(232,223,210,.3); border-radius: 3px; position: relative; }
.video .linea-v div i { position: absolute; left: 0; top: 0; bottom: 0; background: #e8dfd2; border-radius: 3px; }
.transcripcion { display: grid; gap: 12px; font-size: 13px; }
.transcripcion div { display: grid; grid-template-columns: 44px 1fr; gap: 10px; }
.transcripcion time { color: var(--texto-3); font-size: 11.5px; padding-top: 2px; }
.transcripcion b { font-weight: 600; margin-right: 6px; }
.transcripcion .resaltado { background: var(--suave); border-radius: 6px; padding: 6px 8px; margin: -6px -8px; }
.pendientes { display: grid; gap: 10px; }
.pendiente { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: 13px; padding-bottom: 10px; border-bottom: 1px solid var(--linea); }
.pendiente:last-child { border-bottom: 0; padding-bottom: 0; }
.pendiente span { color: var(--texto-2); font-size: 12px; }

/* cronograma (gantt) */
.gantt { display: grid; grid-template-columns: 150px 1fr; font-size: 12.5px; }
.gantt .cab { display: grid; grid-template-columns: repeat(var(--sem, 8), 1fr); color: var(--texto-3); font-size: 11px; border-bottom: 1px solid var(--linea); padding-bottom: 6px; }
.gantt .fila-g { display: contents; }
.gantt .nombre { padding: 9px 0; border-bottom: 1px solid var(--linea); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 10px; }
.gantt .pista { position: relative; border-bottom: 1px solid var(--linea); background-image: repeating-linear-gradient(90deg, var(--linea) 0 1px, transparent 1px calc(100% / var(--sem, 8))); }
.gantt .pista i { position: absolute; top: 9px; height: 16px; border-radius: 5px; background: var(--s2); }
.gantt .pista i.hecho { background: var(--texto); }
.gantt .pista i.senal { background: var(--senal); }
.gantt .hoy-g { position: absolute; top: 0; bottom: 0; width: 1.5px; background: var(--texto); }

/* organigrama del mapa vivo */
.organigrama { display: grid; justify-items: center; gap: 0; }
.nodo { background: var(--tarjeta); border: 1px solid var(--linea-2); border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; min-width: 190px; font-size: 13px; position: relative; }
.nodo b { display: block; font-weight: 600; }
.nodo div span { display: block; color: var(--texto-2); font-size: 11.5px; }
.nodo div { min-width: 0; }
.nodo.vacante { border-style: dashed; }
.nodo.vacante .persona-ini { background: transparent; border: 1px dashed var(--texto-3); color: var(--texto-3); }
.conector { width: 1px; height: 22px; background: var(--linea-2); }
.rama { display: flex; gap: 18px; position: relative; padding-top: 22px; width: 100%; }
.rama > div > .nodo { width: 100%; min-width: 0; }
.rama::before { content: ""; position: absolute; top: 0; left: var(--izq, 25%); right: var(--der, 25%); height: 1px; background: var(--linea-2); }
.rama > div { display: grid; justify-items: center; position: relative; flex: 1 1 0; min-width: 0; }
.rama > div::before { content: ""; position: absolute; top: -22px; left: 50%; width: 1px; height: 22px; background: var(--linea-2); }

/* proceso en pasos (flujo) */
.flujo { display: flex; align-items: stretch; gap: 0; }
.flujo .caja-f { border: 1px solid var(--linea-2); border-radius: 10px; padding: 9px 10px; font-size: 12px; background: var(--tarjeta); flex: 1 1 0; min-width: 0; }
.flujo .flecha { align-self: center; flex: none; }
.flujo .caja-f b { display: block; font-weight: 600; }
.flujo .caja-f span { color: var(--texto-2); font-size: 11.5px; }
.flujo .caja-f.bandera-f { border-color: var(--senal); }
.flujo .caja-f.bandera-f span { color: var(--senal); }
.flujo .flecha { width: 16px; height: 1px; background: var(--texto-3); position: relative; }
.flujo .flecha::after { content: ""; position: absolute; right: 0; top: -3px; border-left: 6px solid var(--texto-3); border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent; }

/* galería */
.galeria { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.galeria img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.galeria .mas-g { aspect-ratio: 1; border-radius: 8px; background: var(--suave); display: grid; place-items: center; font-weight: 600; color: var(--texto-2); }

/* factura / recibo */
.recibo { background: #fdfcfa; color: #1a1816; border-radius: 6px; padding: 22px 24px; font-size: 12px; box-shadow: 0 4px 18px rgba(0,0,0,.14); }
.recibo header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 16px; }
.recibo header b { font-size: 15px; }
.recibo table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.recibo td { padding: 6px 0; border-bottom: 1px solid #ece6dc; }
.recibo td:last-child { text-align: right; }
.recibo tr.t td { border: 0; font-weight: 700; font-size: 13.5px; padding-top: 10px; }

/* mosaico de proporciones (treemap simple) */
.mosaico { display: grid; grid-template-columns: 5fr 3fr 2fr; grid-template-rows: 1fr 1fr; gap: 4px; height: 210px; }
.mosaico div { border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; justify-content: space-between; font-size: 12px; font-weight: 600; }
.mosaico div span { font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; }

/* retención por grupo (cohortes) */
.cohortes { display: grid; grid-template-columns: 70px repeat(6, 1fr); gap: 3px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.cohortes span { color: var(--texto-3); padding: 6px 0; }
.cohortes i { font-style: normal; border-radius: 4px; display: grid; place-items: center; padding: 6px 0; font-weight: 600; }

/* año de actividad (tipo contribuciones) */
.anio { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.anio i { aspect-ratio: 1; border-radius: 2px; background: var(--texto); }

/* tabla con minigráficas */
.tabla td canvas { display: block; }
.mini { width: 90px; height: 26px; position: relative; }

@media (prefers-reduced-motion: reduce) { .btn, .interruptor::after { transition: none; } .pensando i { animation: none; opacity: .6; } }
