/* Sala de IAs · Centro de Proyectos — estilos (vidrio claro "AI command center") */

:root {
  --naranja: #ff8a1f;
  --morado: #8b5cf6;
  --verde: #10b981;
  --azul: #38bdf8;
  --azul-proceso: #3b82f6;
  --rojo: #e11d2a;
  --tinta: #1c2440;
  --tenue: #5d6784;
  --muy-tenue: #8a93ab;
  --borde: rgba(255, 255, 255, .9);
  --vidrio: rgba(255, 255, 255, .78);
  --sombra: 0 12px 32px rgba(40, 90, 170, .16), 0 2px 6px rgba(40, 90, 170, .08);
  --fuente: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .75, .25, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--fuente);
  color: var(--tinta);
  background: #dfe9f5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
/* Letterbox: el mismo arte difuminado */
body::before {
  content: "";
  position: fixed;
  inset: -60px;
  background: url(../assets/escena_v2.jpg) center / cover no-repeat;
  filter: blur(28px) saturate(1.1) brightness(1.05);
  z-index: -2;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(240, 246, 255, .35);
  z-index: -1;
}
button, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.defs-globales { position: absolute; width: 0; height: 0; overflow: hidden; }
.cargando #app { opacity: 0; }
.noscript { position: fixed; inset: auto 0 40% 0; text-align: center; font-size: 20px; }

.vidrio {
  background: var(--vidrio);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--borde);
  box-shadow: var(--sombra), inset 0 1px 0 rgba(255, 255, 255, .9);
  border-radius: 20px;
}
.vidrio-fuerte {
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--borde);
}

/* Colores por IA */
[data-ia="claude"], .etq-claude, .aporte-claude, .burbuja-claude {
  --c: #ff8a1f; --c2: #ea6a00; --c3: #c2570c; --cs: rgba(255, 138, 31, .35);
}
[data-ia="super-boss"], .etq-super-boss, .aporte-super-boss, .burbuja-super-boss {
  --c: #8b5cf6; --c2: #6d28d9; --c3: #6d28d9; --cs: rgba(139, 92, 246, .35);
}
[data-ia="chatgpt"], .etq-chatgpt, .aporte-chatgpt, .burbuja-chatgpt {
  --c: #10b981; --c2: #047857; --c3: #047857; --cs: rgba(16, 185, 129, .35);
}

/* ======================================================================
   Escritorio: lienzo 1920x1080 escalado
   ====================================================================== */
.modo-escritorio body { overflow: hidden; height: 100%; }
.modo-escritorio #app {
  position: absolute;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(20, 40, 90, .18);
}
.modo-escritorio #escena-wrap { position: absolute; inset: 0; z-index: 0; }
.modo-escritorio #encabezado {
  position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h);
  z-index: 10; border-radius: 0; border-width: 0 0 1px 0;
}
.modo-escritorio #panel-proyectos {
  position: absolute; left: var(--x); top: var(--y); width: var(--w); max-height: var(--hMax); z-index: 10;
}
.modo-escritorio #panel-tareas {
  position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); z-index: 10;
}
.modo-escritorio .tarjeta {
  position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); z-index: 10;
}
.modo-escritorio #areas-tel { display: none !important; }

/* ======================================================================
   Escena
   ====================================================================== */
#escenario {
  position: absolute;
  left: 0; top: 0;
  width: 1920px; height: 1080px;
  overflow: hidden;
  transform-origin: 0 0;
}
#fondo {
  position: absolute; left: 0; top: 0;
  width: 1920px; height: 1080px;
  display: block;
  transform-origin: 50% 55%;
  user-select: none;
  -webkit-user-drag: none;
}
#mesa-svg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
#capa-figuras, #capa-etiquetas, #capa-nodos, #capa-burbujas { position: absolute; inset: 0; pointer-events: none; }

.figura { position: absolute; }
.figura img {
  display: block; width: 100%; height: 100%;
  transform-origin: 50% 100%;
  /* --dur = ciclo completo (sube y baja) */
  animation: respirar calc(var(--dur, 5s) / 2) ease-in-out var(--ret, 0s) infinite alternate;
  will-change: transform;
}
@keyframes respirar {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-3px) scale(1.012); }
}
.halo-pos { position: absolute; mix-blend-mode: screen; }
.halo {
  width: 100%; height: 100%; border-radius: 50%;
  opacity: .25;
  animation: pulso-halo calc(var(--dur, 5s) / 2) ease-in-out var(--ret, 0s) infinite alternate;
}
.halo-claude { background: radial-gradient(circle closest-side, rgba(255, 138, 31, .6), rgba(255, 138, 31, .2) 55%, transparent); }
.halo-super-boss { background: radial-gradient(circle closest-side, rgba(139, 92, 246, .6), rgba(139, 92, 246, .2) 55%, transparent); }
.halo-chatgpt { background: radial-gradient(circle closest-side, rgba(16, 185, 129, .6), rgba(16, 185, 129, .2) 55%, transparent); }
@keyframes pulso-halo { from { opacity: .25; } to { opacity: .5; } }

/* Mesa holográfica */
.anillo { animation: girar-a var(--dur, 40s) linear infinite; }
.anillo.dir-b { animation-name: girar-b; }
.barrido { animation: girar-a var(--dur, 9s) linear infinite; }
@keyframes girar-a { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -1000; } }
@keyframes girar-b { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 1000; } }
.disco-brillo { animation: respira-disco 6s ease-in-out infinite alternate; }
@keyframes respira-disco { from { opacity: .65; } to { opacity: 1; } }
.linea-nodo {
  fill: none; stroke: #7dd3fc; stroke-opacity: .9; stroke-width: 2;
  stroke-dasharray: 1; stroke-dashoffset: 0;
}
.pulso {
  fill: none; stroke: #ffffff; stroke-width: 3.4; stroke-linecap: round;
  stroke-dasharray: .05 .95; opacity: .95;
  animation: fluir 3.2s linear infinite;
}
@keyframes fluir { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -1; } }
.part {
  fill: #e0fbff; opacity: 0;
  transform-box: fill-box;
  animation: subir var(--d, 6s) linear var(--r, 0s) infinite;
}
@keyframes subir {
  0% { opacity: 0; transform: translateY(0); }
  15% { opacity: .85; }
  100% { opacity: 0; transform: translateY(-80px); }
}

/* Etiquetas de las IAs */
.etq-pos {
  position: absolute;
  transform-origin: 50% 50%;
  transform: translate(-50%, -50%) scale(var(--k, 1));
}
.etq-pos[data-ancla="izq"] { transform-origin: 0 50%; transform: translate(0, -50%) scale(var(--k, 1)); }
.etq-pos[data-ancla="der"] { transform-origin: 100% 50%; transform: translate(-100%, -50%) scale(var(--k, 1)); }
.etiqueta {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 20px 9px 9px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid var(--borde);
  box-shadow: 0 10px 26px var(--cs), 0 2px 6px rgba(30, 50, 100, .1), inset 0 1px 0 #fff;
  white-space: nowrap;
}
.etq-ico {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--c), var(--c2));
  box-shadow: 0 4px 12px var(--cs), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.etq-ico svg { width: 24px; height: 24px; }
.etq-txt { display: flex; flex-direction: column; gap: 2px; }
.etq-nombre {
  display: block;
  font-size: 20px; font-weight: 800; letter-spacing: 2.5px; color: var(--tinta); line-height: 1.1;
}
.etq-rol { font-size: 14px; font-weight: 600; color: var(--c3); }

/* Dueno: grabado en el respaldo. (left, top) = centro de "DUENO" (32px, line-height 1) */
#dueno-grabado {
  position: absolute;
  transform: translate(-50%, -16px) scale(var(--k, 1));
  transform-origin: 50% 16px;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none; text-align: center;
}
.m-nombre {
  font-size: 32px; font-weight: 800; letter-spacing: 9px; padding-left: 9px;
  color: #2b3245;
  /* brillo blanco abajo + sombra interior suave arriba = grabado */
  text-shadow: 0 1px 0 rgba(255, 255, 255, .9), 0 -1px 1px rgba(0, 0, 0, .28), 0 0 2px rgba(43, 50, 69, .25);
  line-height: 1;
}
.m-rol {
  margin-top: 6px; font-size: 11px; font-weight: 700; letter-spacing: 4px; padding-left: 4px;
  color: #5b6478; line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .85);
}

/* Nodos de áreas */
.nodo-pos {
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--k, 1));
  /* flotado: usa la propiedad translate para no pisar el transform */
  animation: flotar calc(var(--fd, 6s) / 2) ease-in-out var(--fr, 0s) infinite alternate;
}
@keyframes flotar { from { translate: 0 2px; } to { translate: 0 -2px; } }
.nodo {
  pointer-events: auto;
  position: relative;
  display: block;
  min-width: 138px;
  padding: 8px 14px 9px;
  border-radius: 14px;
  border: 1px solid rgba(165, 243, 252, .95);
  background: linear-gradient(180deg, rgba(23, 105, 170, .66), rgba(10, 60, 125, .58));
  -webkit-backdrop-filter: blur(8px) saturate(1.4);
  backdrop-filter: blur(8px) saturate(1.4);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, .35), 0 0 18px rgba(56, 189, 248, .55), inset 0 0 14px rgba(125, 211, 252, .35);
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform .22s var(--ease), box-shadow .22s, background .22s;
}
.nodo:hover, .nodo:focus-visible, .nodo.demo-hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 0 0 1px rgba(165, 243, 252, .9), 0 0 30px rgba(56, 189, 248, .85), inset 0 0 18px rgba(165, 243, 252, .5);
}
.nodo.activo {
  background: linear-gradient(180deg, rgba(56, 189, 248, .95), rgba(14, 116, 190, .9));
  border-color: #fff;
  box-shadow: 0 0 0 2px #fff, 0 0 30px rgba(56, 189, 248, .95);
}
.nodo-cuerpo { display: block; }
.nodo-nombre {
  display: block; font-size: 15px; font-weight: 800; letter-spacing: 2.4px; white-space: nowrap;
  text-shadow: 0 0 8px rgba(125, 211, 252, .9);
}
.nodo-fila { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.nodo-cifra { font-size: 13px; font-weight: 700; color: #cffafe; font-variant-numeric: tabular-nums; }
.mini-barra {
  flex: 1; min-width: 44px; height: 5px; border-radius: 3px; overflow: hidden;
  background: rgba(255, 255, 255, .24);
}
.mini-barra > span {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #67e8f9, #a7f3d0);
}
.nodo-mas { border-style: dashed; }
/* Área con tareas en revisión o en proceso: pulso suave */
.nodo-vivo::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  animation: pulso-nodo 2.6s ease-out infinite;
}
@keyframes pulso-nodo {
  0% { box-shadow: 0 0 0 0 rgba(165, 243, 252, .75); }
  70%, 100% { box-shadow: 0 0 0 12px rgba(165, 243, 252, 0); }
}
.nodo-punto { display: none; }

/* Tooltip de nodo */
.tooltip-nodo {
  position: absolute; z-index: 30;
  width: 340px;
  transform: translate(-50%, -100%);
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .93);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--borde);
  box-shadow: var(--sombra);
  pointer-events: none;
  font-size: 14px;
}
.tooltip-nodo::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; width: 16px; height: 16px;
  background: rgba(255, 255, 255, .93); transform: translateX(-50%) rotate(45deg);
  border-right: 1px solid var(--borde); border-bottom: 1px solid var(--borde);
}
.tt-titulo { margin: 0; font-weight: 800; letter-spacing: 2px; font-size: 15px; color: #0c4a6e; }
.tt-sub { margin: 2px 0 8px; color: var(--tenue); font-size: 13px; }
.tt-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.tt-lista li { display: flex; gap: 7px; align-items: center; font-size: 13px; line-height: 1.3; }
.tt-lista b { color: #0369a1; }
.tt-tit { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-cifra { margin-left: auto; }
.tt-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muy-tenue); }
.dot-pendiente { background: var(--naranja); }
.dot-trabajando { background: var(--azul-proceso); }
.dot-revision { background: var(--morado); }
.dot-listo { background: var(--verde); }
.tt-mas { margin: 6px 0 0; font-size: 12px; color: var(--tenue); }
.tt-pista { margin: 8px 0 0; font-size: 12px; color: #0284c7; font-weight: 700; }

/* Burbujas de diálogo */
.burbuja {
  position: absolute; z-index: 25;
  width: max-content; max-width: 290px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--borde);
  border-left: 4px solid var(--c);
  box-shadow: 0 12px 30px var(--cs), 0 2px 6px rgba(30, 50, 100, .1);
  font-size: 15px; line-height: 1.4; color: var(--tinta);
  opacity: 0;
  transform: translate(0, -100%) scale(.92);
  transform-origin: 0 100%;
  transition: opacity .25s ease, transform .3s var(--ease);
}
.burbuja p { margin: 0; }
.burbuja-izq { transform: translate(-100%, -100%) scale(.92); transform-origin: 100% 100%; border-left: 1px solid var(--borde); border-right: 4px solid var(--c); }
.burbuja.visible { opacity: 1; transform: translate(0, -100%) scale(1); }
.burbuja-izq.visible { transform: translate(-100%, -100%) scale(1); }

/* ======================================================================
   HUD
   ====================================================================== */
#encabezado {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  gap: 20px;
}
.marca { display: flex; align-items: center; gap: 14px; min-width: 0; }
.marca-img { height: 40px; width: auto; display: block; }
.titulo { margin: 0; font-size: 30px; font-weight: 800; color: #1c2440; letter-spacing: 1.2px; white-space: nowrap; }
.t-punto { color: var(--azul); }
.sep { width: 1px; height: 30px; background: rgba(28, 36, 64, .2); }
.empresa { color: var(--rojo); font-size: 14px; font-weight: 800; letter-spacing: 3px; white-space: nowrap; }
.enc-der { display: flex; align-items: center; gap: 22px; }
.reloj-bloque { text-align: right; }
.reloj { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.datos-edad { font-size: 13px; color: var(--tenue); display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 2px; white-space: nowrap; }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--muy-tenue); flex: none; }
.led.fresco { background: var(--verde); box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }
.led.tibio { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }
.led.viejo { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }
.estado-api { color: #b45309; font-weight: 700; }
.aprobar-wrap { display: inline-block; border-radius: 12px; }

.btn-aprobar {
  position: relative; overflow: hidden;
  height: 50px; padding: 0 26px;
  border: 0; border-radius: 12px;
  font-size: 20px; font-weight: 800; letter-spacing: 1px; color: #fff;
  background: linear-gradient(180deg, #e11d2a, #c8102e);
  box-shadow: 0 8px 22px rgba(225, 29, 42, .35), inset 0 1px 0 rgba(255, 255, 255, .35);
  cursor: pointer; white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .18s, filter .18s;
}
.btn-aprobar::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .95) 50%, transparent 70%) -200% 0 / 250% 100% no-repeat;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: borde-btn 6s ease-in-out infinite;
  pointer-events: none;
}
.btn-aprobar::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .4), transparent);
  transform: skewX(-20deg);
  animation: brillo-btn 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes brillo-btn { 0%, 80% { left: -60%; } 100% { left: 130%; } }
@keyframes borde-btn { 0%, 72% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.btn-aprobar:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(225, 29, 42, .45), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-aprobar:not(:disabled):active { transform: translateY(1px); }
.btn-aprobar:disabled { cursor: not-allowed; filter: saturate(.55) opacity(.7); }
.btn-aprobar:disabled::before, .btn-aprobar:disabled::after { display: none; }
.btn-aprobar.es-aprobado { background: linear-gradient(180deg, #10b981, #059669); box-shadow: 0 8px 22px rgba(16, 185, 129, .35); filter: none; cursor: default; }
.btn-aprobar.es-nada { background: #cfd6e2; color: #5b6478; box-shadow: none; filter: none; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.btn-aprobar.destello { animation: destello 1.4s ease-out; }
@keyframes destello {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .7); }
  60% { box-shadow: 0 0 0 18px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 8px 22px rgba(16, 185, 129, .35); }
}

/* Paneles */
.panel { display: flex; flex-direction: column; overflow: hidden; padding-top: 16px; }
.panel-cab { display: flex; align-items: center; justify-content: space-between; padding: 0 18px 12px; }
.panel-titulo {
  margin: 0; font-size: 16px; font-weight: 800; letter-spacing: 3px; color: var(--tinta);
  display: flex; align-items: center; gap: 10px;
}
.ico-cab {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  box-shadow: 0 4px 10px rgba(37, 99, 235, .3);
}
.ico-cab svg { width: 18px; height: 18px; }
.conteo-cab {
  min-width: 30px; height: 30px; padding: 0 9px; border-radius: 15px;
  display: grid; place-items: center;
  background: rgba(56, 189, 248, .14); color: #0369a1;
  font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums;
}

.lista-proyectos { list-style: none; margin: 0; padding: 4px 12px 14px; overflow: auto; display: grid; gap: 10px; min-height: 0; }
.proy {
  width: 100%; display: flex; gap: 12px; text-align: left;
  padding: 12px; border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, .95);
  background: rgba(255, 255, 255, .6);
  cursor: pointer;
  transition: background .2s, box-shadow .2s, border-color .2s;
}
.proy:hover { background: rgba(255, 255, 255, .92); }
.proy.sel {
  border-color: var(--azul);
  background: rgba(240, 249, 255, .96);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .18), 0 6px 20px rgba(56, 189, 248, .32);
}
.proy-ico {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px; letter-spacing: 1px; color: #fff;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  box-shadow: 0 4px 10px rgba(99, 102, 241, .3);
}
.proy-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.proy-titulo {
  font-weight: 700; font-size: 15px; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.proy-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.proy-pct { font-weight: 800; font-size: 15px; color: #0369a1; font-variant-numeric: tabular-nums; }
.proy-nota { font-size: 11px; color: #047857; font-weight: 600; }
.barra { height: 6px; border-radius: 3px; background: rgba(28, 36, 64, .08); overflow: hidden; }
.barra > span {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #6366f1);
  transition: width .9s var(--ease);
}

/* Chips */
.chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: 11px; font-size: 12px; font-weight: 700; white-space: nowrap;
  background: rgba(28, 36, 64, .07); color: #475069;
}
.est-nuevo { background: rgba(56, 189, 248, .16); color: #0369a1; }
.est-propuesto { background: rgba(255, 138, 31, .16); color: #c2570c; }
.est-aprobado { background: rgba(16, 185, 129, .16); color: #047857; }
.est-en_ejecucion { background: rgba(59, 130, 246, .14); color: #1d4ed8; }
.est-en_revision { background: rgba(139, 92, 246, .15); color: #6d28d9; }
.est-entregado { background: rgba(5, 150, 105, .2); color: #065f46; }
.est-pausado { background: rgba(234, 179, 8, .2); color: #854d0e; }
.est-cancelado { background: rgba(225, 29, 42, .13); color: #b91c1c; }
.tarea-pendiente { background: rgba(255, 138, 31, .16); color: #c2570c; }
.tarea-trabajando { background: rgba(59, 130, 246, .14); color: #1d4ed8; }
.tarea-revision { background: rgba(139, 92, 246, .15); color: #6d28d9; }
.tarea-listo { background: rgba(16, 185, 129, .16); color: #047857; }
.dec-propuesta { background: rgba(255, 138, 31, .16); color: #c2570c; }
.dec-aprobada { background: rgba(16, 185, 129, .16); color: #047857; }
.chip-tipo { background: rgba(56, 189, 248, .15); color: #0369a1; }

/* Tareas */
.filtro-area { padding: 0 18px 10px; }
.chip-filtro {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 34px; padding: 0 14px; border-radius: 17px;
  border: 1px solid rgba(56, 189, 248, .6);
  background: rgba(56, 189, 248, .14); color: #0369a1;
  font-weight: 700; font-size: 13px; cursor: pointer;
}
.chip-filtro:hover { background: rgba(56, 189, 248, .24); }
.tareas-cuerpo { flex: 1; min-height: 0; overflow: auto; padding: 0 12px 16px; overscroll-behavior: contain; }
.grupo { margin-bottom: 12px; }
.grupo-pendiente { --gc: var(--naranja); --gs: rgba(255, 138, 31, .2); }
.grupo-trabajando { --gc: var(--azul-proceso); --gs: rgba(59, 130, 246, .2); }
.grupo-revision { --gc: var(--morado); --gs: rgba(139, 92, 246, .2); }
.grupo-listo { --gc: var(--verde); --gs: rgba(16, 185, 129, .2); }
.grupo-cab {
  display: flex; align-items: center; gap: 8px; padding: 6px;
  position: sticky; top: 0; z-index: 1;
  background: rgba(248, 251, 255, .94); border-radius: 10px;
}
.g-punto { width: 10px; height: 10px; border-radius: 50%; background: var(--gc); box-shadow: 0 0 0 3px var(--gs); flex: none; }
.grupo-cab h3 { margin: 0; flex: 1; font-size: 13px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; }
.g-cuenta {
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: #fff; background: var(--gc);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 3px 8px var(--gs);
}
.g-lista { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.tarea {
  width: 100%; min-height: 44px;
  display: flex; align-items: flex-start; gap: 9px; text-align: left;
  padding: 9px 10px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .95);
  background: rgba(255, 255, 255, .62);
  cursor: pointer;
  transition: background .18s, box-shadow .18s;
}
.tarea:hover { background: #fff; box-shadow: 0 4px 14px rgba(40, 90, 170, .12); }
.casilla {
  flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 5px;
  border: 2px solid rgba(28, 36, 64, .25); background: #fff;
  display: grid; place-items: center;
}
.casilla.marcada { background: var(--verde); border-color: var(--verde); color: #fff; }
.casilla svg { width: 12px; height: 12px; }
.tarea-txt { flex: 1; min-width: 0; }
.tarea-linea {
  font-size: 13px; line-height: 1.32;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tarea-id { color: #0369a1; font-weight: 800; }
.tarea.hecha .tarea-linea { color: var(--tenue); }
.tarea-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.badge-ok {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .3px; white-space: nowrap;
  padding: 2px 7px; border-radius: 8px; background: rgba(225, 29, 42, .1); color: #b91c1c;
}
.badge-reasig {
  display: inline-block; font-size: 10.5px; font-weight: 700; white-space: nowrap;
  padding: 2px 7px; border-radius: 8px; background: rgba(139, 92, 246, .12); color: #6d28d9;
}
.g-vacio { margin: 4px 6px 6px; font-size: 13px; color: var(--muy-tenue); font-style: italic; }
.grupo-cab .g-vacio { margin: 0; font-size: 12px; white-space: nowrap; }
.mini-ok, .mini-reasig {
  flex: none; height: 16px; min-width: 16px; padding: 0 4px; border-radius: 8px;
  display: none; place-items: center;
  font-size: 9px; font-weight: 800; letter-spacing: .2px; line-height: 1; color: #fff;
}
.mini-ok { background: var(--rojo); box-shadow: 0 2px 5px rgba(225, 29, 42, .3); }
.mini-reasig { background: var(--morado); box-shadow: 0 2px 5px rgba(139, 92, 246, .3); }

/* Escritorio: filas compactas de una línea para que quepan todos los grupos sin scroll */
.modo-escritorio .tareas-cuerpo { padding-bottom: 12px; }
.modo-escritorio .grupo { margin-bottom: 4px; }
.modo-escritorio .grupo-cab { height: 30px; padding: 0 6px; }
.modo-escritorio .grupo-cab h3 { font-size: 12px; letter-spacing: 1.4px; }
.modo-escritorio .g-cuenta { min-width: 22px; height: 22px; border-radius: 11px; font-size: 12px; }
.modo-escritorio .g-lista { margin-top: 3px; gap: 3px; }
.modo-escritorio .tarea {
  height: 32px; min-height: 32px; padding: 0 8px; gap: 7px;
  align-items: center; border-radius: 9px;
}
.modo-escritorio .casilla { width: 14px; height: 14px; margin-top: 0; border-width: 1.5px; border-radius: 4px; }
.modo-escritorio .casilla svg { width: 10px; height: 10px; }
.modo-escritorio .tarea-linea {
  display: block; font-size: 12.5px; line-height: 30px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.modo-escritorio .tarea-badges { display: none; }
.modo-escritorio .mini-ok, .modo-escritorio .mini-reasig { display: grid; }
.modo-escritorio .tarea .av { width: 20px; height: 20px; font-size: 10px; }
.modo-escritorio .tarea .av .corona { width: 13px; height: 11px; }
.vacio { padding: 18px; color: var(--tenue); text-align: center; font-size: 14px; list-style: none; margin: 0; }

/* Avatares */
.av {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #fff; line-height: 1;
  box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, .15);
}
.av > span[aria-hidden] { display: grid; place-items: center; }
.av-claude { background: var(--naranja); }
.av-super-boss { background: var(--morado); }
.av-chatgpt { background: var(--verde); }
.av-dueno { background: #8b93a7; }
.av-otro { background: #94a3b8; }
.av .corona { width: 14px; height: 12px; }

/* Decisiones */
.decisiones { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(28, 36, 64, .08); }
.sub-titulo { display: flex; align-items: center; gap: 8px; margin: 0 6px 8px; font-size: 13px; font-weight: 800; letter-spacing: 2px; }
.mini-cuenta {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center;
  font-size: 12px; background: rgba(56, 189, 248, .14); color: #0369a1;
}
.decision { border-radius: 12px; background: rgba(255, 255, 255, .62); border: 1px solid rgba(255, 255, 255, .95); margin-bottom: 6px; }
.decision summary {
  cursor: pointer; list-style: none; min-height: 44px;
  padding: 9px 10px; display: flex; flex-direction: column; gap: 4px; border-radius: 12px;
}
.decision summary::-webkit-details-marker { display: none; }
.decision[open] summary { padding-bottom: 6px; }
.d-cab { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.d-fecha { font-size: 11.5px; color: var(--tenue); }
.d-tema { font-size: 13px; font-weight: 700; }
.d-texto { padding: 0 10px 8px; font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; color: #374160; }
.d-pie { display: flex; align-items: center; gap: 7px; padding: 0 10px 10px; font-size: 11.5px; color: var(--tenue); }

/* Tarjetas de las IAs */
.tarjeta {
  display: flex; gap: 16px; align-items: stretch;
  padding: 14px 16px 14px 22px;
  overflow: hidden;
  transition: transform .22s var(--ease), box-shadow .22s;
}
.tarjeta::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, var(--c), var(--c2));
}
.tarjeta::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(120% 90% at 0% 0%, var(--cs), transparent 45%);
  opacity: .35;
}
.tarjeta:hover, .tarjeta.demo-hover { transform: translateY(-2px); box-shadow: 0 16px 36px var(--cs), inset 0 1px 0 #fff; }
.modo-tel .tarjeta { position: relative; }
.t-ico {
  flex: none; width: 54px; height: 54px; border-radius: 16px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--c), var(--c2));
  box-shadow: 0 8px 18px var(--cs), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.t-ico svg { width: 28px; height: 28px; }
.t-cuerpo { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.t-cab { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.t-nombre { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 19px; font-weight: 800; letter-spacing: 2px; white-space: nowrap; }
.t-nombre .corona { width: 20px; height: 16px; }
.t-rol { flex: 1; min-width: 0; font-size: 12.5px; color: var(--tenue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-fila { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.t-titulo { flex: 1; min-width: 0; margin: 0; font-size: 14.5px; font-weight: 700; color: var(--c3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-fecha { flex: none; font-size: 12px; color: var(--tenue); font-weight: 600; white-space: nowrap; }
.t-resumen {
  margin: 0; font-size: 13.5px; line-height: 1.36; color: #3a4462;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.sin-aporte .t-titulo { color: var(--muy-tenue); font-weight: 600; font-style: italic; }
.t-abrir {
  position: relative; z-index: 1;
  flex: none; align-self: center;
  width: 44px; height: 44px; padding: 0 0 3px 2px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .95);
  background: linear-gradient(135deg, var(--c), var(--c2));
  color: #fff; font-size: 26px; line-height: 1;
  display: grid; place-items: center;
  box-shadow: 0 6px 16px var(--cs);
  cursor: pointer;
  transition: transform .2s var(--ease);
}
.t-abrir:hover { transform: translateX(2px) scale(1.06); }
.t-abrir:disabled { background: #d5dae4; box-shadow: none; cursor: default; transform: none; }

/* ======================================================================
   Modal / detalle
   ====================================================================== */
.modal-abierto body { overflow: hidden; }
.capa-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; justify-content: flex-end;
  background: rgba(18, 28, 56, .28);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.capa-modal.centro { justify-content: center; align-items: center; padding: 20px; }
.modal {
  position: relative;
  display: flex; flex-direction: column;
  color: var(--tinta);
  box-shadow: 0 20px 60px rgba(20, 40, 90, .3);
}
.modal-drawer { width: min(580px, 100vw); height: 100%; border-radius: 22px 0 0 22px; }
.modal-centro { width: min(640px, 100%); max-height: min(90vh, 920px); border-radius: 22px; }
.modal-cerrar {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(28, 36, 64, .12); background: #fff;
  font-size: 18px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(20, 40, 90, .1);
}
.modal-cerrar:hover { background: #f1f5fb; }
.modal-contenido { flex: 1; min-height: 0; overflow: auto; padding: 28px 30px 32px; overscroll-behavior: contain; }

.det-cab { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-right: 50px; }
.det-id {
  font-weight: 800; font-size: 14px; color: #fff; padding: 3px 10px; border-radius: 9px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
}
.det-titulo { margin: 10px 50px 4px 0; font-size: 22px; line-height: 1.25; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.det-titulo .corona { width: 26px; height: 21px; flex: none; }
.det-proy { margin: 0; color: var(--tenue); font-size: 14px; }
.det-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin: 18px 0 0; }
.det-grid .ancho { grid-column: 1 / -1; }
.det-grid dt { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muy-tenue); }
.det-grid dd { margin: 4px 0 0; font-size: 14px; }
.persona { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.det-sec h3 { margin: 22px 0 8px; font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: #0369a1; }
.det-sec p { margin: 0; font-size: 14px; line-height: 1.5; }
.tenue { color: var(--tenue); }
.chico { font-size: 12.5px !important; margin-top: 8px !important; }
.notas {
  list-style: none; margin: 0; font-size: 13px; line-height: 1.5;
  background: rgba(28, 36, 64, .045); padding: 4px 12px; border-radius: 10px;
  overflow-wrap: anywhere;
}
.notas li { padding: 6px 0; }
.notas li + li { border-top: 1px solid rgba(28, 36, 64, .07); }
.nota-fecha { color: var(--tenue); white-space: nowrap; }
.deps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dep {
  width: 100%; min-height: 44px;
  display: flex; align-items: center; gap: 8px; text-align: left;
  padding: 8px 10px; border-radius: 10px;
  border: 1px solid rgba(28, 36, 64, .1); background: rgba(255, 255, 255, .8);
  cursor: pointer; font-size: 13px;
}
.dep:hover:not(:disabled) { background: #fff; border-color: var(--azul); }
.dep:disabled { cursor: default; opacity: .7; }
.dep b { color: #0369a1; }
.dep-tit { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aviso-ok {
  margin: 16px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13.5px;
  background: rgba(225, 29, 42, .07); border-left: 3px solid var(--rojo); color: #7f1d1d;
}
.nota-reasig {
  margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13px;
  background: rgba(139, 92, 246, .08); border-left: 3px solid var(--morado); color: #4c1d95;
}
.fila-reasignar { display: flex; gap: 10px; }
.fila-reasignar select {
  flex: 1; min-width: 0; height: 46px; padding: 0 12px; border-radius: 12px;
  border: 1px solid rgba(28, 36, 64, .18); background: #fff; font-size: 15px;
}
.btn-azul {
  height: 46px; padding: 0 20px; border: 0; border-radius: 12px;
  background: linear-gradient(180deg, #3b82f6, #2563eb); color: #fff; font-weight: 800;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .3); cursor: pointer;
}
.btn-azul:disabled, .fila-reasignar select:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.md { font-size: 14.5px; line-height: 1.58; margin-top: 12px; overflow-wrap: anywhere; }
.md h4 { margin: 18px 0 6px; font-size: 15.5px; font-weight: 800; color: var(--tinta); }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 4px 0; }
.md code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .9em; background: rgba(28, 36, 64, .07); padding: 1px 5px; border-radius: 5px; }
.aporte-cab { display: flex; align-items: center; gap: 14px; padding-right: 50px; }
.aporte-cab .det-titulo { margin: 0; }
.aporte-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0 0; font-size: 13px; }
.bitacora { list-style: none; margin: 0; padding: 0; }
.bitacora li { padding: 10px 0; border-bottom: 1px solid rgba(28, 36, 64, .08); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.bit-fecha { font-size: 12px; color: var(--tenue); }
.bitacora p { flex-basis: 100%; margin: 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }

.modal-sobre { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--rojo); }
.objetivo { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--tenue); }
.res-aprob {
  display: flex; gap: 18px; align-items: center; margin-top: 18px;
  padding: 14px 16px; border-radius: 16px; background: rgba(56, 189, 248, .08); border: 1px solid rgba(56, 189, 248, .2);
}
.res-total { display: flex; flex-direction: column; align-items: center; min-width: 74px; font-size: 13px; color: var(--tenue); }
.res-num { font-size: 36px; font-weight: 800; color: var(--tinta); line-height: 1; }
.res-resp { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.res-resp li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.res-resp b { margin-left: auto; font-variant-numeric: tabular-nums; }
.lista-ok { list-style: none; margin: 0; padding: 0; }
.lista-ok li { padding: 7px 0; border-bottom: 1px solid rgba(28, 36, 64, .07); font-size: 13.5px; line-height: 1.4; }
.lista-ok b { color: var(--rojo); margin-right: 4px; }
.campo-nota { display: block; margin-top: 18px; font-size: 14px; font-weight: 700; }
#nota-sala {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border-radius: 12px; border: 1px solid rgba(28, 36, 64, .18); background: #fff;
  font-size: 15px; resize: vertical; min-height: 76px;
}
.nota-cuenta { text-align: right; font-size: 12px; color: var(--tenue); margin-top: 4px; }
.letra-chica { margin: 12px 0 0; font-size: 12px; color: var(--tenue); line-height: 1.45; }
.acciones { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.btn-sec {
  height: 46px; padding: 0 20px; border-radius: 12px;
  border: 1px solid rgba(28, 36, 64, .16); background: #fff; font-weight: 700; cursor: pointer;
}
.btn-sec:hover { background: #f3f6fb; }
.btn-rojo {
  height: 46px; padding: 0 22px; border: 0; border-radius: 12px;
  background: linear-gradient(180deg, #e11d2a, #c8102e); color: #fff; font-weight: 800;
  box-shadow: 0 8px 20px rgba(225, 29, 42, .3); cursor: pointer;
}
.btn-rojo:disabled, .btn-sec:disabled { opacity: .6; cursor: progress; }

/* Toasts */
.toasts {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  max-width: min(92vw, 540px);
  padding: 12px 18px 12px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, .95);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--borde);
  box-shadow: 0 14px 34px rgba(20, 40, 90, .22);
  font-size: 15px; font-weight: 600;
  animation: toast-in .35s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.toast-ico {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px;
  background: var(--verde);
}
.toast-error { border-left: 4px solid var(--rojo); }
.toast-error .toast-ico { background: var(--rojo); }
.toast-info .toast-ico { background: var(--azul-proceso); }

.confeti { position: fixed; inset: 0; pointer-events: none; z-index: 300; }
.confeti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; }

/* ======================================================================
   Teléfono (ancho < 900 o retrato)
   ====================================================================== */
.modo-tel body { overflow-x: hidden; }
.modo-tel #app {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  max-width: 760px; margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 12px 32px;
}
.modo-tel #encabezado { order: 1; flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; }
.modo-tel .marca { flex-wrap: wrap; gap: 6px 12px; }
.modo-tel .marca-img { height: 36px; }
.modo-tel .titulo { font-size: 20px; line-height: 1.15; white-space: normal; letter-spacing: .8px; }
.modo-tel .t1, .modo-tel .t2 { display: block; }
.modo-tel .t-punto, .modo-tel .sep { display: none; }
.modo-tel .empresa { flex-basis: 100%; font-size: 12px; }
.modo-tel .enc-der { flex-direction: column; align-items: stretch; gap: 10px; }
.modo-tel .reloj-bloque { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 12px; text-align: left; }
.modo-tel .reloj { font-size: 14px; }
.modo-tel .datos-edad { margin: 0; }
.modo-tel .aprobar-wrap { display: block; }
.modo-tel .btn-aprobar { width: 100%; height: 52px; font-size: 18px; }

.modo-tel #escena-wrap {
  order: 2; position: relative; width: 100%;
  overflow: hidden; border-radius: 20px;
  border: 1px solid var(--borde); box-shadow: var(--sombra);
}
.modo-tel .etiqueta { padding: 6px 14px; border-radius: 14px; }
.modo-tel .etq-ico, .modo-tel .etq-rol { display: none; }
.modo-tel .etq-nombre { font-size: 22px; letter-spacing: 2px; }
.modo-tel .nodo {
  pointer-events: none; min-width: 0; padding: 0; border: 0;
  background: none; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.modo-tel .nodo-cuerpo { display: none; }
.modo-tel .nodo-punto {
  display: block; width: 14px; height: 14px; border-radius: 50%;
  background: #e0fbff;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, .95), 0 0 12px 4px rgba(56, 189, 248, .75);
}
.modo-tel .nodo.activo .nodo-punto { background: #fff; box-shadow: 0 0 0 3px #fff, 0 0 18px 7px rgba(56, 189, 248, .95); }
.modo-tel .tooltip-nodo, .modo-tel #capa-burbujas { display: none !important; }

.modo-tel #areas-tel { order: 3; padding: 14px; }
.areas-tel-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.area-tel {
  min-height: 52px; padding: 8px 12px; border-radius: 14px; text-align: left; cursor: pointer;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 8px;
  color: #fff;
  border: 1px solid rgba(165, 243, 252, .95);
  background: linear-gradient(180deg, rgba(23, 105, 170, .85), rgba(10, 60, 125, .8));
  box-shadow: 0 0 12px rgba(56, 189, 248, .4), inset 0 0 10px rgba(125, 211, 252, .3);
}
.area-tel.activo { background: linear-gradient(180deg, rgba(56, 189, 248, .98), rgba(14, 116, 190, .92)); border-color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 18px rgba(56, 189, 248, .8); }
.area-tel-nombre { font-size: 13px; font-weight: 800; letter-spacing: 1.6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.area-tel-cifra { font-size: 13px; font-weight: 700; color: #cffafe; font-variant-numeric: tabular-nums; }
.area-tel .mini-barra { grid-column: 1 / -1; }

.modo-tel #tarjetas-ias { order: 4; display: flex; flex-direction: column; gap: 12px; }
.modo-tel .tarjeta { padding: 14px 14px 14px 20px; gap: 12px; }
.modo-tel .t-ico { width: 46px; height: 46px; border-radius: 14px; }
.modo-tel .t-cab { flex-wrap: wrap; gap: 2px 10px; }
.modo-tel .t-rol { flex-basis: 100%; white-space: normal; }
.modo-tel .t-nombre { font-size: 17px; }
.modo-tel #panel-proyectos { order: 5; }
.modo-tel #panel-tareas { order: 6; }
.modo-tel .lista-proyectos, .modo-tel .tareas-cuerpo { overflow: visible; }
.modo-tel .grupo-cab { position: static; }
.modo-tel .modal-drawer { border-radius: 0; }
.modo-tel .modal-contenido { padding: 22px 18px 28px; }
.modo-tel .det-grid { grid-template-columns: 1fr; }
.modo-tel .res-aprob { flex-direction: column; align-items: stretch; }
.modo-tel .res-resp { grid-template-columns: 1fr; }
.modo-tel .acciones button { flex: 1; }
.modo-tel .toasts { bottom: max(16px, env(safe-area-inset-bottom)); width: 92vw; }

/* ======================================================================
   ?demo=1 (recorrido para video: sin cursor ni anillos de foco)
   ====================================================================== */
.demo, .demo * { cursor: none !important; }
.demo :focus-visible { outline: none; }
.proy.demo-resalte { animation: resalte-proy 1.8s var(--ease); }
@keyframes resalte-proy {
  0%, 100% { transform: none; }
  35% { transform: scale(1.035); box-shadow: 0 0 0 5px rgba(56, 189, 248, .35), 0 10px 30px rgba(56, 189, 248, .5); }
}
.aprobar-wrap.demo-brillo { animation: brillo-aprobar 1.3s ease-out 2; }
.aprobar-wrap.demo-brillo .btn-aprobar { filter: brightness(1.12); }
.aprobar-wrap.demo-brillo .btn-aprobar::after { animation: brillo-btn 1.3s ease-in-out 2; }
@keyframes brillo-aprobar {
  0% { box-shadow: 0 0 0 0 rgba(225, 29, 42, .6); }
  100% { box-shadow: 0 0 0 18px rgba(225, 29, 42, 0); }
}

/* ======================================================================
   Iteración 3: figuras 3D articuladas
   ====================================================================== */
#lienzo-3d {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
  pointer-events: none;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  /* despega el holograma del fondo claro */
  filter: drop-shadow(0 2px 6px rgba(30, 50, 110, .22));
}
.modo-tel #lienzo-3d { filter: none; }
#calib-capa { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; pointer-events: none; z-index: 40; }
.con-3d .halo-pos { display: none; }
/* Un nodo destella cuando una IA lo toca o Super Boss lo señala */
.nodo.nodo-destello { animation: nodo-destello 1s var(--ease); }
@keyframes nodo-destello {
  0% { box-shadow: 0 0 0 2px #fff, 0 0 46px rgba(255, 255, 255, .95), inset 0 0 22px rgba(255, 255, 255, .8); filter: brightness(1.5); }
  100% { box-shadow: 0 0 0 1px rgba(56, 189, 248, .35), 0 0 18px rgba(56, 189, 248, .55), inset 0 0 14px rgba(125, 211, 252, .35); filter: none; }
}
.modo-tel .nodo.nodo-destello .nodo-punto { animation: punto-destello 1s ease-out; }
@keyframes punto-destello { 0% { box-shadow: 0 0 0 4px #fff, 0 0 26px 12px #fff; } }
/* La tarjeta de la IA que está hablando */
.tarjeta.hablando { box-shadow: 0 0 0 2px var(--c), 0 14px 34px var(--cs), inset 0 1px 0 #fff; }
.tarjeta.hablando .t-ico { animation: ico-habla 1.1s ease-in-out infinite alternate; }
@keyframes ico-habla { to { box-shadow: 0 0 0 6px var(--cs), 0 8px 18px var(--cs); } }

/* Mesa en espera de debate */
.nodo-apagado {
  display: block; width: 26px; height: 26px; border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, .9); background: rgba(10, 60, 125, .45);
  box-shadow: 0 0 0 4px rgba(10, 60, 125, .12), 0 0 12px rgba(56, 189, 248, .4);
}
.nodo-apagado-pos { animation: none; }
.mesa-espera #mesa-svg { opacity: .55; filter: saturate(.6); }
.aviso-mesa {
  position: absolute; transform: translate(-50%, -50%) scale(var(--k, 1));
  padding: 8px 20px; border-radius: 999px;
  font-size: 17px; font-weight: 800; letter-spacing: 4px; color: #fff; white-space: nowrap;
  background: linear-gradient(180deg, rgba(23, 105, 170, .78), rgba(10, 60, 125, .72));
  border: 1px solid rgba(165, 243, 252, .95);
  box-shadow: 0 0 22px rgba(56, 189, 248, .6);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: aviso-respira 2.8s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes aviso-respira { from { box-shadow: 0 0 12px rgba(56, 189, 248, .45); } to { box-shadow: 0 0 30px rgba(56, 189, 248, .9); } }

/* Proyectos: pie con "+ NUEVO PROYECTO", badge de espera y prioridad */
.panel-pie { padding: 0 12px 14px; }
.nuevo-wrap { display: block; border-radius: 14px; }
.btn-nuevo {
  width: 100%; height: 42px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 13.5px; font-weight: 800; letter-spacing: 1.8px; color: #b91c1c;
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1.5px dashed rgba(225, 29, 42, .45);
  box-shadow: inset 0 1px 0 #fff;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s, transform .18s var(--ease);
}
.btn-nuevo .mas {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 18px; line-height: 1; color: #fff; padding-bottom: 2px;
  background: linear-gradient(180deg, #e11d2a, #c8102e); box-shadow: 0 3px 8px rgba(225, 29, 42, .35);
}
.btn-nuevo:not(:disabled):hover { background: rgba(255, 255, 255, .95); border-color: var(--rojo); border-style: solid; box-shadow: 0 6px 18px rgba(225, 29, 42, .18); transform: translateY(-1px); }
.btn-nuevo:disabled { cursor: not-allowed; opacity: .55; filter: saturate(.4); }
.proy-meta-izq { justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
.prio-alta { background: rgba(225, 29, 42, .12); color: #b91c1c; }
.prio-media { background: rgba(245, 158, 11, .16); color: #92400e; }
.prio-baja { background: rgba(56, 189, 248, .14); color: #0369a1; }
.badge-debate {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  font-size: 10.5px; font-weight: 700; color: #6d28d9; white-space: nowrap;
  padding: 3px 8px; border-radius: 9px; background: rgba(139, 92, 246, .1);
}
.punto-debate { width: 7px; height: 7px; border-radius: 50%; background: var(--morado); animation: punto-latido 1.6s ease-in-out infinite; }
@keyframes punto-latido { 50% { box-shadow: 0 0 0 5px rgba(139, 92, 246, 0); opacity: .45; } 0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, .45); } }
.proy-espera .proy-ico { background: linear-gradient(135deg, #a78bfa, #6366f1); }

/* TAREAS: estado vacío de "esperando debate" */
.espera-debate {
  margin: 8px 6px; padding: 22px 18px; border-radius: 18px; text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(237, 233, 254, .55));
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: inset 0 1px 0 #fff;
}
.espera-ico { display: flex; justify-content: center; gap: 7px; margin-bottom: 12px; }
.espera-ico span { width: 13px; height: 13px; border-radius: 50%; animation: espera-salto 1.4s ease-in-out infinite; }
.espera-ico span:nth-child(1) { background: var(--naranja); }
.espera-ico span:nth-child(2) { background: var(--morado); animation-delay: .18s; }
.espera-ico span:nth-child(3) { background: var(--verde); animation-delay: .36s; }
@keyframes espera-salto { 0%, 60%, 100% { transform: none; opacity: .55; } 30% { transform: translateY(-6px); opacity: 1; } }
.espera-titulo { margin: 0; font-size: 16px; font-weight: 800; color: #4c1d95; }
.espera-obj {
  margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: #3a4462; text-align: left;
  max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}
.espera-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 0; text-align: left; }
.espera-datos dt { font-size: 10.5px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muy-tenue); }
.espera-datos dd { margin: 4px 0 0; font-size: 13px; font-weight: 600; }
.espera-nota {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin: 16px 0 0; padding-top: 12px; border-top: 1px solid rgba(28, 36, 64, .08);
  font-size: 12.5px; font-weight: 700; color: #6d28d9;
}
.espera-nota .corona { width: 18px; height: 15px; flex: none; }

/* Formulario: nuevo proyecto */
.form-nuevo { margin-top: 16px; }
.campo { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.campo > label, .campo > legend { display: block; margin-bottom: 6px; padding: 0; font-size: 14px; font-weight: 700; }
.campo input[type="text"], .campo input[type="date"], .campo textarea {
  display: block; width: 100%; padding: 10px 12px;
  border-radius: 12px; border: 1px solid rgba(28, 36, 64, .18); background: #fff;
  font: inherit; font-size: 15px; color: var(--tinta);
  transition: border-color .15s, box-shadow .15s;
}
.campo input[type="text"], .campo input[type="date"] { height: 46px; }
.campo textarea { resize: vertical; min-height: 116px; line-height: 1.45; }
.campo input:focus, .campo textarea:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(56, 189, 248, .25); }
.campo [aria-invalid="true"] { border-color: var(--rojo); box-shadow: 0 0 0 3px rgba(225, 29, 42, .12); }
.campo-pie { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; min-height: 17px; font-size: 12px; }
.campo-error { color: #b91c1c; font-weight: 600; }
.contador { color: var(--tenue); margin-left: auto; font-variant-numeric: tabular-nums; }
.campo-fila { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.segmentado {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; height: 46px;
  border-radius: 13px; background: rgba(28, 36, 64, .06); border: 1px solid rgba(28, 36, 64, .08);
}
.seg { position: relative; display: grid; place-items: center; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--tenue); }
.seg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg:has(input:checked) { background: #fff; color: var(--tinta); box-shadow: 0 2px 8px rgba(20, 40, 90, .14); }
.seg-alta:has(input:checked) { color: #b91c1c; }
.seg-media:has(input:checked) { color: #92400e; }
.seg-baja:has(input:checked) { color: #0369a1; }
.seg:has(input:focus-visible) { outline: 3px solid var(--azul); outline-offset: 1px; }
.form-error {
  margin: 4px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  background: rgba(225, 29, 42, .08); border-left: 3px solid var(--rojo); color: #7f1d1d;
}
.btn-rojo:disabled { cursor: not-allowed; }
.modo-tel .campo-fila { grid-template-columns: 1fr; gap: 0; }

/* ======================================================================
   Sin animación (?anim=0 o prefers-reduced-motion)
   ====================================================================== */
.sin-anim *, .sin-anim *::before, .sin-anim *::after {
  animation: none !important;
  transition: none !important;
}
.sin-anim .part { opacity: .4; }
.sin-anim .halo { opacity: .38; }
.sin-anim .pulso { display: none; }
.sin-anim .nodo-pos { translate: none; }
.sin-anim #lienzo-3d { filter: none; }
.sin-anim .btn-aprobar::before, .sin-anim .btn-aprobar::after { display: none; }

/* Revisión Super Boss: evitar desborde horizontal de filas de una línea (grid + nowrap) */
.g-lista { grid-template-columns: minmax(0, 1fr); }
.g-lista > li { min-width: 0; }
.tarea { min-width: 0; max-width: 100%; overflow: hidden; }
.tareas-cuerpo { overflow-x: hidden; }
