/* Veta · Impulsa Mendoza
   Paleta tomada del sitio institucional: azul #000F9F, dorado #D5BA8C,
   grises papel. Tipografía Roboto / Roboto Slab (autohospedadas). */

@font-face {
  font-family: 'Roboto';
  src: url('/fonts/roboto-var.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto Slab';
  src: url('/fonts/roboto-slab-var.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --azul: #000F9F;
  --azul-claro: #2743C7;
  --azul-lavado: #E9EBF8;
  --tinta-1: #071051;
  --tinta-2: #030724;
  --oro: #D5BA8C;
  --oro-fuerte: #C09B5D;
  --oro-suave: #F3EADA;
  --papel: #F4F3F0;
  --blanco: #FFFFFF;
  --texto: #171923;
  --texto-suave: #62667A;
  --texto-tenue: #9CA0B0;
  --borde: #E3E1DA;
  --borde-suave: #EEEDE8;
  --rojo: #C2452D;
  --ambar: #B0741C;
  --verde: #1F6E4E;
  --sombra: 0 1px 2px rgba(7, 16, 81, .06), 0 4px 16px rgba(7, 16, 81, .07);
  --sombra-alta: 0 6px 32px rgba(3, 7, 36, .25);
  --fondo-columna: #ECEAE4;
  --slab: 'Roboto Slab', 'Georgia', serif;
  --sans: 'Roboto', 'Segoe UI', sans-serif;
  --radio: 8px;
  color-scheme: light;
}

/* ---- tema oscuro: misma marca, superficies invertidas ---- */
[data-tema='oscuro'] {
  color-scheme: dark;
  --azul: #5D76EC;
  --azul-claro: #7D92F5;
  --azul-lavado: #232B50;
  --oro-suave: #38301E;
  --oro-fuerte: #D9BC85;
  --papel: #0F1117;
  --blanco: #181B26;
  --texto: #E7E9F2;
  --texto-suave: #A9ADBE;
  --texto-tenue: #6E7386;
  --borde: #2B2F42;
  --borde-suave: #232637;
  --fondo-columna: #14161F;
  --sombra: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 16px rgba(0, 0, 0, .35);
  --sombra-alta: 0 6px 32px rgba(0, 0, 0, .65);
}
[data-tema='oscuro'] .mensaje:hover { background: rgba(255, 255, 255, .04); }
[data-tema='oscuro'] .login-error { background: #3A2222; border-color: #5A2E2E; }
[data-tema='oscuro'] .chip.rojo { background: #3A2222; }
[data-tema='oscuro'] .sub-borrar:hover { background: #3A2222; }
[data-tema='oscuro'] .chip-sub.ok { background: #1D3227; }
[data-tema='oscuro'] .tarjeta-proyecto .clave-chip {
  background: color-mix(in srgb, var(--color-proyecto, var(--azul)) 24%, #181B26);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--texto);
  background: var(--papel);
  -webkit-font-smoothing: antialiased;
}
#raiz { height: 100%; }
h1, h2, h3, h4 { font-family: var(--slab); margin: 0; font-weight: 600; }
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: var(--oro); color: var(--tinta-2); }

/* ---- micro-etiqueta institucional (estilo "CONOCÉ MÁS" del sitio) ---- */
.microlabel {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ---- barras de carga (el logo, animado) ---- */
.carga-inicial {
  height: 100%; display: grid; place-items: center; background: var(--tinta-2);
}
.barras-carga { display: flex; align-items: flex-end; gap: 5px; height: 34px; }
.barras-carga i {
  width: 7px; border-radius: 2px; background: var(--oro);
  animation: subir 1.1s ease-in-out infinite;
}
.barras-carga i:nth-child(1) { height: 30%; animation-delay: 0s; }
.barras-carga i:nth-child(2) { height: 50%; animation-delay: .12s; }
.barras-carga i:nth-child(3) { height: 70%; animation-delay: .24s; }
.barras-carga i:nth-child(4) { height: 100%; animation-delay: .36s; }
@keyframes subir {
  0%, 100% { transform: scaleY(.55); opacity: .55; }
  50% { transform: scaleY(1); opacity: 1; }
}
.barras-carga.chica { height: 20px; gap: 3px; }
.barras-carga.chica i { width: 4px; }
.cargando-vista { display: grid; place-items: center; padding: 80px 0; }
.cargando-vista .barras-carga i { background: var(--azul); }

/* =================== LOGIN =================== */
.login {
  min-height: 100%; display: grid; grid-template-columns: minmax(420px, 42%) 1fr;
}
.login-marca {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(168deg, var(--azul) 0%, var(--tinta-1) 58%, var(--tinta-2) 100%);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 52px;
}
.login-marca::after {
  /* estratos: líneas diagonales muy sutiles, guiño geológico */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(-32deg, transparent 0 26px, rgba(213, 186, 140, .05) 26px 27px);
}
.login-logo { display: flex; align-items: center; gap: 12px; }
.login-logo img { width: 30px; height: 30px; }
.login-logo strong { font-family: var(--slab); font-size: 21px; font-weight: 700; letter-spacing: .01em; }
.login-frase h1 {
  font-size: clamp(28px, 3.2vw, 42px); font-weight: 600; line-height: 1.18; max-width: 420px;
}
.login-frase h1 em { font-style: normal; color: var(--oro); }
.login-frase p { color: rgba(255, 255, 255, .65); max-width: 380px; line-height: 1.6; margin-top: 14px; }
.login-pie { color: rgba(255, 255, 255, .45); font-size: 12.5px; }
.login-pie img { display: block; margin-bottom: 8px; opacity: .9; }

.login-form-lado { display: grid; place-items: center; padding: 40px; background: var(--papel); }
.login-form { width: 100%; max-width: 360px; }
.login-form h2 { font-size: 24px; margin-bottom: 6px; }
.login-form > p { color: var(--texto-suave); margin: 0 0 28px; }
.login-error {
  background: #FBEDEA; color: var(--rojo); border: 1px solid #EFCFC7;
  border-radius: var(--radio); padding: 10px 14px; margin-bottom: 16px; font-size: 13.5px;
}

/* =================== FORMULARIOS =================== */
.campo { margin-bottom: 16px; }
.campo label {
  display: block; margin-bottom: 6px; color: var(--texto-suave);
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.campo input, .campo textarea, .campo select {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--borde);
  border-radius: var(--radio); background: var(--blanco); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.campo textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.campo input:focus, .campo textarea:focus, .campo select:focus {
  border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-lavado);
}
.campos-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--azul); color: #fff; border: none; border-radius: var(--radio);
  padding: 11px 22px; font-weight: 700; font-size: 11.5px;
  letter-spacing: .12em; text-transform: uppercase;
  transition: background .15s, transform .1s;
}
.boton:hover { background: var(--azul-claro); }
.boton:active { transform: translateY(1px); }
.boton:disabled { opacity: .55; cursor: default; }
.boton.ancho { width: 100%; }
.boton.secundario {
  background: transparent; color: var(--azul); border: 1.5px solid var(--azul);
}
.boton.secundario:hover { background: var(--azul-lavado); }
.boton.fantasma {
  background: transparent; color: var(--texto-suave); border: none;
  text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 500; padding: 8px 12px;
}
.boton.fantasma:hover { background: var(--borde-suave); color: var(--texto); }
.boton.peligro { background: var(--rojo); }
.boton.chico { padding: 7px 14px; font-size: 10.5px; }

/* =================== ESTRUCTURA =================== */
.shell { display: grid; grid-template-columns: 264px 1fr; height: 100%; }

/* ---- barra lateral ---- */
.lateral {
  background: linear-gradient(178deg, var(--tinta-1) 0%, var(--tinta-2) 88%);
  color: rgba(255, 255, 255, .78);
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.lateral::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(-32deg, transparent 0 34px, rgba(213, 186, 140, .035) 34px 35px);
}
.lateral > * { position: relative; }
.lateral-marca {
  display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.lateral-marca img { width: 26px; height: 26px; }
.lateral-marca-nombre { line-height: 1.15; }
.lateral-marca-nombre strong {
  display: block; font-family: var(--slab); font-size: 17px; font-weight: 700; color: #fff;
}
.lateral-marca-nombre span { font-size: 10.5px; color: var(--oro); letter-spacing: .1em; text-transform: uppercase; }

.lateral-scroll { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.lateral-scroll::-webkit-scrollbar { width: 8px; }
.lateral-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 4px; }

.lateral-seccion { margin-top: 18px; }
.lateral-seccion:first-child { margin-top: 4px; }
.lateral-titulo {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 10px; color: rgba(255, 255, 255, .42);
}
.lateral-titulo .mas {
  background: none; border: none; color: rgba(255, 255, 255, .42); font-size: 16px;
  line-height: 1; padding: 2px 6px; border-radius: 4px;
}
.lateral-titulo .mas:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.item-nav {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 6.5px 10px; border: none; background: none; border-radius: 6px;
  color: rgba(255, 255, 255, .78); text-align: left; font-size: 14px;
  position: relative; text-decoration: none;
}
.item-nav:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.item-nav.activo { background: rgba(213, 186, 140, .16); color: #fff; }
.item-nav.activo::before {
  content: ''; position: absolute; left: -10px; top: 5px; bottom: 5px; width: 3px;
  background: var(--oro); border-radius: 0 2px 2px 0;
}
.item-nav .icono { width: 17px; text-align: center; opacity: .8; flex: none; font-style: normal; }
.item-nav .nombre { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-nav.sin-leer .nombre { font-weight: 700; color: #fff; }
.globito {
  background: var(--oro); color: var(--tinta-2); font-size: 11px; font-weight: 700;
  border-radius: 9px; padding: 1px 7px; flex: none;
}
.punto-online {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: #3BA55D; box-shadow: 0 0 0 2px rgba(0, 0, 0, .25);
}
.punto-online.gris { background: rgba(255, 255, 255, .25); }

.lateral-yo {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, .08); background: rgba(0, 0, 0, .18);
}
.lateral-yo .datos { flex: 1; overflow: hidden; line-height: 1.25; }
.lateral-yo .datos strong { display: block; color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lateral-yo .datos span { font-size: 11.5px; color: rgba(255, 255, 255, .5); }
.lateral-yo button { background: none; border: none; color: rgba(255, 255, 255, .5); padding: 6px; border-radius: 6px; font-size: 15px; }
.lateral-yo button:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---- zona principal ---- */
.principal { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.cabecera {
  display: flex; align-items: center; gap: 14px; padding: 0 24px; height: 58px; flex: none;
  background: var(--blanco); border-bottom: 1px solid var(--borde);
}
.cabecera h2 { font-size: 17px; display: flex; align-items: center; gap: 9px; }
.cabecera .sub { color: var(--texto-suave); font-size: 13px; font-weight: 400; font-family: var(--sans); }
.cabecera .espacio { flex: 1; }

.buscador-boton {
  display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--borde);
  background: var(--papel); color: var(--texto-tenue); border-radius: 20px;
  padding: 7px 16px; font-size: 13px; min-width: 210px;
}
.buscador-boton:hover { border-color: var(--azul); color: var(--texto-suave); }
.buscador-boton kbd {
  margin-left: auto; font-family: inherit; font-size: 11px; background: var(--blanco);
  border: 1px solid var(--borde); border-radius: 4px; padding: 1px 5px;
}

.boton-campana { position: relative; background: none; border: none; font-size: 17px; padding: 8px 10px; border-radius: 8px; color: var(--texto-suave); }
.boton-campana:hover { background: var(--borde-suave); }
.boton-campana .globito { position: absolute; top: 2px; right: 0; background: var(--rojo); color: #fff; }

.contenido { flex: 1; overflow-y: auto; min-height: 0; }
.contenido.con-padding { padding: 28px 32px; }

/* =================== AVATARES =================== */
.avatar {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center; color: #fff;
  font-size: 13px; font-weight: 700; position: relative; user-select: none;
}
.avatar.chico { width: 26px; height: 26px; font-size: 10.5px; border-radius: 7px; }
.avatar.grande { width: 44px; height: 44px; font-size: 16px; border-radius: 11px; }
.avatar .estado {
  position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px;
  border-radius: 50%; background: #3BA55D; border: 2px solid var(--blanco);
}
.pila-avatares { display: flex; }
.pila-avatares .avatar { margin-left: -7px; border: 2px solid var(--blanco); }
.pila-avatares .avatar:first-child { margin-left: 0; }

/* =================== INICIO =================== */
.inicio-saludo { margin-bottom: 26px; }
.inicio-saludo h2 { font-size: 26px; font-weight: 700; }
.inicio-saludo p { color: var(--texto-suave); margin: 6px 0 0; }
.inicio-grilla { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; align-items: start; }

.panel { background: var(--blanco); border: 1px solid var(--borde); border-radius: 12px; box-shadow: var(--sombra); }
.panel-cabecera {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--borde-suave);
}
.panel-cabecera h3 { font-size: 15px; }
.panel-cuerpo { padding: 8px 0; }

.fila-tarea {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px;
  border: none; background: none; width: 100%; text-align: left; color: inherit; text-decoration: none;
}
.fila-tarea:hover { background: var(--papel); text-decoration: none; }
.fila-tarea .titulo { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.fila-tarea .clave { font-size: 12px; color: var(--texto-tenue); font-weight: 700; flex: none; }
.vence { font-size: 12px; color: var(--texto-suave); flex: none; }
.vence.vencida { color: var(--rojo); font-weight: 700; }

/* prioridad como barras ascendentes */
.prioridad { display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; flex: none; }
.prioridad i { width: 3.5px; border-radius: 1px; background: var(--borde); }
.prioridad i:nth-child(1) { height: 4px; }
.prioridad i:nth-child(2) { height: 7px; }
.prioridad i:nth-child(3) { height: 10px; }
.prioridad i:nth-child(4) { height: 13px; }
.prioridad.baja i:nth-child(-n+1) { background: var(--texto-tenue); }
.prioridad.media i:nth-child(-n+2) { background: var(--azul-claro); }
.prioridad.alta i:nth-child(-n+3) { background: var(--ambar); }
.prioridad.urgente i { background: var(--rojo); }

.feed-item { display: flex; gap: 11px; padding: 10px 20px; font-size: 13.5px; }
.feed-item .texto { flex: 1; min-width: 0; line-height: 1.45; color: var(--texto-suave); }
.feed-item .texto strong { color: var(--texto); font-weight: 600; }
.feed-item .cuando { color: var(--texto-tenue); font-size: 12px; flex: none; }

.vacio { text-align: center; padding: 46px 20px; color: var(--texto-tenue); }
.vacio .grande { font-family: var(--slab); font-size: 19px; color: var(--texto-suave); margin-bottom: 6px; font-weight: 500; }
.vacio img { width: 40px; opacity: .35; margin-bottom: 12px; }

/* =================== CHAT =================== */
.chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-mensajes { flex: 1; overflow-y: auto; padding: 18px 26px 8px; }
.chat-dia {
  display: flex; align-items: center; gap: 14px; margin: 18px 0 10px;
  color: var(--texto-tenue); font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.chat-dia::before, .chat-dia::after { content: ''; flex: 1; height: 1px; background: var(--borde); }
.mensaje { display: flex; gap: 12px; padding: 5px 8px; border-radius: 8px; }
.mensaje:hover { background: rgba(7, 16, 81, .03); }
.mensaje.seguido { padding-top: 1px; padding-bottom: 1px; }
.mensaje.seguido .avatar { visibility: hidden; height: 0; }
.mensaje-cuerpo { min-width: 0; flex: 1; }
.mensaje-cuerpo .quien { display: flex; align-items: baseline; gap: 8px; }
.mensaje-cuerpo .quien strong { font-size: 14px; }
.mensaje-cuerpo .quien span { font-size: 11.5px; color: var(--texto-tenue); }
.mensaje-texto { line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.mensaje-texto .mencion {
  background: var(--oro-suave); color: var(--oro-fuerte); font-weight: 600;
  border-radius: 4px; padding: 0 3px;
}
.mensaje-texto .ref-tarea {
  background: var(--azul-lavado); color: var(--azul); font-weight: 600;
  border-radius: 4px; padding: 0 4px; text-decoration: none;
}

.chat-escribir { padding: 10px 26px 18px; flex: none; }
.chat-composer { position: relative; }

/* desplegable de @personas y #proyectos */
.autocompletar {
  position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; z-index: 30;
  background: var(--blanco); border: 1px solid var(--borde); border-radius: 12px;
  box-shadow: var(--sombra-alta); overflow: hidden; max-height: 280px; overflow-y: auto;
  animation: entrar .12s ease-out;
}
.sug {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 14px; border: none; background: none; text-align: left; font-size: 14px;
}
.sug.activa { background: var(--azul-lavado); }
.sug-principal { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug-detalle { color: var(--texto-tenue); font-size: 12.5px; margin-left: auto; flex: none; }
.sug-clave { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: var(--texto-suave); flex: none; }
.sug-color { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.chat-caja {
  display: flex; align-items: flex-end; gap: 10px; background: var(--blanco);
  border: 1.5px solid var(--borde); border-radius: 12px; padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
}
.chat-caja:focus-within { border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-lavado); }
.chat-caja textarea {
  flex: 1; border: none; outline: none; resize: none; background: none;
  max-height: 140px; line-height: 1.5; padding: 2px 0;
}
.chat-caja .enviar {
  background: var(--azul); color: #fff; border: none; border-radius: 8px;
  width: 34px; height: 34px; display: grid; place-items: center; font-size: 15px; flex: none;
}
.chat-caja .enviar:hover { background: var(--azul-claro); }
.chat-caja .enviar:disabled { background: var(--borde); cursor: default; }
.chat-pista { font-size: 11.5px; color: var(--texto-tenue); margin: 6px 4px 0; }

.cargar-mas { display: block; margin: 0 auto 10px; }

/* =================== PROYECTOS =================== */
.grilla-proyectos {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px;
}
.tarjeta-proyecto {
  background: var(--blanco); border: 1px solid var(--borde); border-radius: 12px;
  padding: 20px; box-shadow: var(--sombra); text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.tarjeta-proyecto:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(7, 16, 81, .13); text-decoration: none; }
.tarjeta-proyecto::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--color-proyecto, var(--azul));
}
.tarjeta-proyecto .clave-chip {
  align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  color: var(--color-proyecto, var(--azul)); background: color-mix(in srgb, var(--color-proyecto, var(--azul)) 9%, white);
  border-radius: 5px; padding: 3px 8px;
}
.tarjeta-proyecto h3 { font-size: 16.5px; line-height: 1.3; }
.tarjeta-proyecto .descripcion {
  color: var(--texto-suave); font-size: 13px; line-height: 1.5; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tarjeta-proyecto .pie { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.progreso { flex: 1; margin-right: 14px; }
.progreso .pista { height: 5px; background: var(--borde-suave); border-radius: 3px; overflow: hidden; }
.progreso .lleno { height: 100%; background: linear-gradient(90deg, var(--oro-fuerte), var(--oro)); border-radius: 3px; transition: width .4s; }
.progreso .detalle { font-size: 11.5px; color: var(--texto-tenue); margin-top: 5px; }
.tarjeta-proyecto.archivado { opacity: .6; }

/* =================== TABLERO =================== */
.tablero-envoltura { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.tablero-filtros {
  display: flex; align-items: center; gap: 10px; padding: 12px 24px; flex: none;
  background: var(--blanco); border-bottom: 1px solid var(--borde);
}
.tablero-filtros input[type="search"] {
  border: 1.5px solid var(--borde); border-radius: 8px; padding: 7px 12px; outline: none; width: 200px;
  background: var(--papel);
}
.tablero-filtros input[type="search"]:focus { border-color: var(--azul); }
.tablero-filtros select {
  border: 1.5px solid var(--borde); border-radius: 8px; padding: 7px 10px; background: var(--papel); outline: none;
}
.tablero { flex: 1; overflow-x: auto; display: flex; gap: 16px; padding: 18px 24px; align-items: flex-start; }

.columna {
  background: var(--fondo-columna); border-radius: 12px; width: 296px; flex: none;
  display: flex; flex-direction: column; max-height: 100%;
}
.columna-cabecera { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.columna-cabecera h4 { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-family: var(--sans); color: var(--texto-suave); flex: 1; }
.columna-cabecera .cuenta { font-size: 12px; color: var(--texto-tenue); font-weight: 700; background: var(--blanco); border-radius: 10px; padding: 1px 8px; }
.columna-tareas { overflow-y: auto; padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 40px; }

.tarjeta-tarea {
  background: var(--blanco); border: 1px solid var(--borde); border-radius: 10px;
  padding: 11px 13px; cursor: pointer; box-shadow: 0 1px 2px rgba(7, 16, 81, .05);
  display: flex; flex-direction: column; gap: 8px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.tarjeta-tarea:hover { border-color: var(--azul-claro); }

/* arrastre de tarjetas (mouse y táctil) */
.ghost-arrastre {
  position: fixed; left: 0; top: 0; z-index: 130; margin: 0;
  pointer-events: none; opacity: .95;
  box-shadow: 0 16px 40px rgba(3, 7, 36, .32); border-color: var(--azul-claro);
}
.hueco-arrastre {
  flex: none; border: 2px dashed var(--oro-fuerte); border-radius: 10px;
  background: var(--oro-suave); animation: aparecer .12s ease-out;
}
body.arrastrando-global { user-select: none; cursor: grabbing; }
body.arrastrando-global .tarjeta-tarea { cursor: grabbing; }
.tarjeta-tarea .titulo { line-height: 1.4; font-weight: 500; font-size: 13.5px; }
.tarjeta-tarea .pie { display: flex; align-items: center; gap: 8px; }
.tarjeta-tarea .clave { font-size: 11px; font-weight: 700; color: var(--texto-tenue); letter-spacing: .04em; }
.tarjeta-tarea .pie .espacio { flex: 1; }
.etiqueta {
  font-size: 10.5px; font-weight: 600; color: var(--azul); background: var(--azul-lavado);
  border-radius: 4px; padding: 2px 6px;
}
.agregar-tarea {
  margin: 0 10px 12px; padding: 8px; border: 1.5px dashed var(--borde); border-radius: 8px;
  background: none; color: var(--texto-tenue); font-size: 13px;
}
.agregar-tarea:hover { border-color: var(--oro-fuerte); color: var(--oro-fuerte); background: var(--blanco); }
.columna-nueva {
  width: 240px; flex: none; border: 1.5px dashed var(--borde); border-radius: 12px;
  background: none; color: var(--texto-tenue); padding: 14px; font-size: 13.5px; height: fit-content;
}
.columna-nueva:hover { border-color: var(--oro-fuerte); color: var(--oro-fuerte); }

/* =================== MODALES =================== */
.telon {
  position: fixed; inset: 0; background: rgba(3, 7, 36, .55); z-index: 50;
  display: grid; place-items: center; padding: 24px; overflow-y: auto;
  animation: aparecer .14s ease-out;
}
@keyframes aparecer { from { opacity: 0; } }
.modal {
  background: var(--blanco); border-radius: 14px; box-shadow: var(--sombra-alta);
  width: 100%; max-width: 520px; max-height: calc(100vh - 48px); overflow-y: auto;
  animation: entrar .18s ease-out;
}
@keyframes entrar { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal.grande { max-width: 780px; }
.modal-cabecera {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-cabecera h3 { font-size: 18px; }
.modal-cerrar { background: none; border: none; font-size: 20px; color: var(--texto-tenue); padding: 4px 8px; border-radius: 6px; }
.modal-cerrar:hover { background: var(--borde-suave); color: var(--texto); }
.modal-cuerpo { padding: 18px 24px 24px; }
.modal-acciones { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---- detalle de tarea ---- */
.tarea-detalle { display: grid; grid-template-columns: minmax(0, 1fr) 218px; gap: 24px; }
.tarea-detalle .clave-grande { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--texto-tenue); }
.tarea-titulo-input {
  width: 100%; border: 1.5px solid transparent; border-radius: 8px; padding: 6px 8px; margin-left: -8px;
  font-family: var(--slab); font-size: 19px; font-weight: 600; background: none; outline: none;
  resize: none; overflow: hidden; line-height: 1.35; display: block;
}
.tarea-titulo-input:hover { border-color: var(--borde); }
.tarea-titulo-input:focus { border-color: var(--azul); background: var(--blanco); }
.tarea-descripcion {
  width: 100%; border: 1.5px solid transparent; border-radius: 8px; padding: 8px; margin-left: -8px;
  background: none; outline: none; resize: vertical; min-height: 70px; line-height: 1.55; color: var(--texto);
}
.tarea-descripcion:hover { border-color: var(--borde); }
.tarea-descripcion:focus { border-color: var(--azul); background: var(--blanco); }
.tarea-lado .campo { margin-bottom: 12px; }
.tarea-lado .campo select, .tarea-lado .campo input { padding: 7px 10px; font-size: 13.5px; }

/* ---- subtareas ---- */
.subtarea { display: flex; align-items: center; gap: 7px; padding: 3px 0; border-radius: 8px; }
.subtarea.sub-arrastrando { background: var(--azul-lavado); opacity: .85; }
.sub-mango {
  flex: none; display: grid; place-items: center; padding: 4px 2px;
  color: var(--texto-tenue); cursor: grab; touch-action: none; opacity: .5;
}
.subtarea:hover .sub-mango { opacity: 1; }
.sub-check {
  width: 19px; height: 19px; flex: none; padding: 0;
  border: 1.5px solid var(--borde); border-radius: 5px; background: var(--blanco);
  color: #fff; font-size: 12px; line-height: 1; display: grid; place-items: center;
  transition: background .12s, border-color .12s;
}
.sub-check:hover { border-color: var(--verde); }
.subtarea.hecha .sub-check { background: var(--verde); border-color: var(--verde); }
.sub-titulo {
  flex: 1; border: none; background: none; outline: none;
  padding: 4px 6px; border-radius: 6px; min-width: 0;
}
.sub-titulo:focus { background: var(--blanco); box-shadow: 0 0 0 1.5px var(--azul); }
.subtarea.hecha .sub-titulo { text-decoration: line-through; color: var(--texto-tenue); }
.sub-borrar {
  border: none; background: none; color: var(--texto-tenue); padding: 3px 7px;
  border-radius: 5px; opacity: 0;
}
.subtarea:hover .sub-borrar { opacity: 1; }
.sub-borrar:hover { background: #FBEDEA; color: var(--rojo); }
.sub-nueva input {
  width: 100%; margin-top: 6px; border: 1.5px dashed var(--borde); border-radius: 8px;
  padding: 8px 12px; outline: none; background: none;
}
.sub-nueva input:focus { border-style: solid; border-color: var(--azul); background: var(--blanco); }

.chip-sub {
  font-size: 11px; font-weight: 700; color: var(--texto-suave);
  background: var(--borde-suave); border-radius: 4px; padding: 2px 6px; flex: none;
}
.chip-sub.ok { color: var(--verde); background: #E4F1EA; }

.tarea-pie-modal {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--borde-suave);
}
.guardado-auto {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--texto-tenue);
}
.guardado-auto svg { color: var(--verde); }

.comentario { display: flex; gap: 10px; padding: 9px 0; }
.comentario .burbuja { flex: 1; min-width: 0; }
.comentario .quien { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.comentario .quien strong { font-size: 13.5px; }
.comentario .quien span { font-size: 11.5px; color: var(--texto-tenue); }
.comentario p { margin: 0; line-height: 1.5; white-space: pre-wrap; }
.mini-actividad { font-size: 12.5px; color: var(--texto-suave); padding: 5px 0; display: flex; gap: 8px; }
.mini-actividad .cuando { color: var(--texto-tenue); flex: none; }
.separador-seccion {
  margin: 18px 0 8px; color: var(--texto-suave); font-size: 12px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
}

/* =================== PERSONAS =================== */
.grupo-area { margin-bottom: 30px; }
.grupo-area > h3 {
  font-size: 13px; font-family: var(--sans); font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--texto-suave); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.grupo-area > h3 i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.grilla-personas { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tarjeta-persona {
  display: flex; align-items: center; gap: 12px; background: var(--blanco);
  border: 1px solid var(--borde); border-radius: 12px; padding: 13px 15px;
}
.tarjeta-persona .datos { flex: 1; min-width: 0; line-height: 1.3; }
.tarjeta-persona .datos strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tarjeta-persona .datos span { font-size: 12.5px; color: var(--texto-suave); }
.tarjeta-persona .dm { background: none; border: 1.5px solid var(--borde); border-radius: 8px; padding: 6px 9px; color: var(--texto-suave); font-size: 14px; }
.tarjeta-persona .dm:hover { border-color: var(--azul); color: var(--azul); }

/* =================== TABLA ADMIN =================== */
.tabla { width: 100%; border-collapse: collapse; background: var(--blanco); border-radius: 12px; overflow: hidden; box-shadow: var(--sombra); }
.tabla th {
  text-align: left; padding: 12px 16px; background: var(--tinta-1); color: rgba(255, 255, 255, .85);
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.tabla td { padding: 11px 16px; border-top: 1px solid var(--borde-suave); vertical-align: middle; }
.tabla tr:hover td { background: var(--papel); }
.chip {
  display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 5px; padding: 2px 8px;
  background: var(--borde-suave); color: var(--texto-suave);
}
.chip.dorado { background: var(--oro-suave); color: var(--oro-fuerte); }
.chip.rojo { background: #FBEDEA; color: var(--rojo); }

/* =================== NOTIFICACIONES / MENÚS =================== */
.menu-flotante {
  position: absolute; top: 52px; right: 18px; z-index: 60; width: 380px; max-height: 480px;
  background: var(--blanco); border: 1px solid var(--borde); border-radius: 12px;
  box-shadow: var(--sombra-alta); overflow: hidden; display: flex; flex-direction: column;
  animation: entrar .16s ease-out;
}
.menu-flotante .lista { overflow-y: auto; }
.notif {
  display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--borde-suave);
  color: inherit; text-decoration: none; font-size: 13.5px; line-height: 1.45;
}
.notif:hover { background: var(--papel); text-decoration: none; }
.notif.nueva { background: var(--oro-suave); }
.notif .cuando { color: var(--texto-tenue); font-size: 11.5px; display: block; margin-top: 2px; }
.notif .icono-tipo {
  flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--azul-lavado); color: var(--azul); font-size: 14px;
}

/* =================== BUSCADOR GLOBAL =================== */
.buscador-caja { max-width: 600px; width: 100%; margin-top: -18vh; }
.buscador-caja input {
  width: 100%; border: none; outline: none; font-size: 17px; padding: 18px 20px;
  border-bottom: 1px solid var(--borde); border-radius: 14px 14px 0 0;
}
.buscador-resultados { max-height: 420px; overflow-y: auto; padding: 8px 0; }
.buscador-grupo { padding: 8px 20px 2px; }
.resultado {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 20px; border: none; background: none; color: inherit; font-size: 14px; text-decoration: none;
}
.resultado:hover { background: var(--azul-lavado); text-decoration: none; }
.resultado .detalle { color: var(--texto-tenue); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =================== AVISOS (toasts) =================== */
.avisos { position: fixed; bottom: 22px; right: 22px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.aviso {
  background: var(--tinta-1); color: #fff; border-radius: 10px; padding: 12px 18px;
  box-shadow: var(--sombra-alta); font-size: 13.5px; max-width: 340px;
  border-left: 3px solid var(--oro); animation: entrar .2s ease-out;
}
.aviso.error { border-left-color: var(--rojo); }

/* =================== RESPONSIVE =================== */
.boton-menu { display: none; }
.tabla-envoltura { overflow-x: auto; border-radius: 12px; box-shadow: var(--sombra); }
.tabla-envoltura .tabla { box-shadow: none; min-width: 640px; }
.telon-lateral { display: none; }

/* tablet vertical: sidebar más angosta, grillas a una columna */
@media (max-width: 1000px) {
  .login { grid-template-columns: 1fr; }
  .login-marca { display: none; }
  .shell { grid-template-columns: 224px 1fr; }
  .inicio-grilla, .tarea-detalle { grid-template-columns: 1fr; }
  .buscador-boton { min-width: 0; }
  .buscador-boton kbd { display: none; }
  .cabecera .sub { display: none; }
}

/* celular y tablet chica: la barra lateral pasa a cajón deslizante */
@media (max-width: 740px) {
  .shell { grid-template-columns: 1fr; }
  .lateral {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 80;
    width: min(300px, 85vw);
    transform: translateX(-102%);
    transition: transform .22s ease-out;
    box-shadow: none;
  }
  .lateral.abierto { transform: none; box-shadow: 24px 0 60px rgba(3, 7, 36, .45); }
  .telon-lateral {
    display: block; position: fixed; inset: 0; z-index: 79;
    background: rgba(3, 7, 36, .45); animation: aparecer .2s ease-out;
  }
  .boton-menu {
    display: inline-flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--texto-suave);
    padding: 8px; margin-left: -6px; border-radius: 8px; flex: none;
  }
  .boton-menu:active { background: var(--borde-suave); }

  .principal { height: 100vh; height: 100dvh; }
  .cabecera { padding: 0 12px; gap: 8px; height: 54px; }
  .cabecera h2 { font-size: 16px; overflow: hidden; }
  .cabecera h2 > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .buscador-boton { border: none; background: none; padding: 8px; min-width: 0; font-size: 17px; }
  .buscador-texto, .buscador-boton kbd { display: none; }
  .contenido.con-padding { padding: 18px 14px; }

  /* chat */
  .chat-mensajes { padding: 12px 12px 6px; }
  .chat-escribir { padding: 8px 10px 12px; }
  .chat-pista { display: none; }
  .mensaje { padding: 5px 4px; }

  /* tablero: columnas casi a lo ancho, con scroll con imán */
  .tablero-filtros {
    padding: 10px 12px; overflow-x: auto;
    /* sombras de scroll: insinúan que hay más filtros a la derecha */
    background:
      linear-gradient(90deg, var(--blanco) 30%, transparent) 0 0,
      linear-gradient(270deg, var(--blanco) 30%, transparent) 100% 0,
      radial-gradient(farthest-side at 0 50%, rgba(7, 16, 81, .22), transparent) 0 0,
      radial-gradient(farthest-side at 100% 50%, rgba(7, 16, 81, .22), transparent) 100% 0;
    background-repeat: no-repeat;
    background-size: 44px 100%, 44px 100%, 12px 100%, 12px 100%;
    background-attachment: local, local, scroll, scroll;
  }
  .tablero-filtros input[type="search"] { width: 150px; flex: none; }
  .tablero-filtros select { flex: none; }
  .tablero {
    padding: 12px; gap: 12px;
    scroll-snap-type: x proximity; scroll-padding: 12px;
  }
  .columna, .columna-nueva { width: min(82vw, 296px); scroll-snap-align: start; }
  .cabecera .pila-avatares { display: none; }

  /* modales a pantalla (casi) completa */
  .telon { padding: 0; place-items: end center; }
  .modal {
    max-width: 100%; max-height: 96dvh;
    border-radius: 16px 16px 0 0;
    animation: subir-modal .22s ease-out;
  }
  .modal.grande { max-width: 100%; }
  .modal-cabecera { padding: 16px 18px 0; }
  .modal-cuerpo { padding: 14px 18px 28px; }
  .campos-2 { grid-template-columns: 1fr; }

  /* buscador y notificaciones ocupan el ancho */
  .telon:has(.buscador-caja) { place-items: start center; padding: 14px 10px; }
  .buscador-caja { margin-top: 0; border-radius: 14px; }
  .menu-flotante { left: 8px; right: 8px; width: auto; top: 56px; max-height: 70dvh; }

  .avisos { left: 14px; right: 14px; bottom: 14px; }
  .aviso { max-width: none; }

  .grilla-proyectos { grid-template-columns: 1fr; }
  .grilla-personas { grid-template-columns: 1fr; }
  .login-form-lado { padding: 24px 18px; }
  .fila-tarea { padding: 10px 14px; }
  .fila-tarea .vence { display: none; }
  .feed-item { padding: 10px 14px; }
}
@keyframes subir-modal { from { opacity: 0; transform: translateY(24px); } }

/* teléfonos chicos */
@media (max-width: 400px) {
  body { font-size: 14px; }
  .inicio-saludo h2 { font-size: 22px; }
  .tablero-filtros input[type="search"] { width: 120px; }
}

/* pantallas táctiles: objetivos de toque más generosos */
@media (pointer: coarse) {
  .item-nav { padding: 9px 10px; }
  .boton { padding: 12px 22px; }
  .tarjeta-tarea { padding: 13px 14px; }
  .chat-caja .enviar { width: 44px; height: 44px; }
  .modal-cerrar { padding: 10px 14px; font-size: 22px; }
  .tarjeta-persona .dm { padding: 11px 13px; }
  .sub-borrar { opacity: 1; }
  .sub-check { width: 24px; height: 24px; }
  .boton-campana, .boton-menu, .buscador-boton { min-width: 44px; min-height: 44px; }
}
