/* FÁBRICA 4.0 · Gestor de tareas — identidad UIDGSM
   Navy #13294B (Pantone 289 C) · Azul #1D6FA4 (Pantone 7692 C) · Rojo #C8102E (Pantone 186 C) */

:root {
  --navy: #13294b;
  --navy-2: #1b3560;
  --navy-3: #24426f;
  --azul: #1d6fa4;
  --azul-suave: #e8f1f8;
  --rojo: #c8102e;
  --verde: #0f8a5f;
  --ambar: #b45309;

  --fondo: #fbfcfd;
  --superficie: #ffffff;
  --gris-1: #f4f6f9;
  --gris-2: #eaeef3;
  --borde: #e1e6ed;
  --borde-fuerte: #cdd5df;
  --texto: #1a2433;
  --texto-2: #4b586b;
  --texto-3: #7a8699;

  --radio: 10px;
  --sombra-1: 0 1px 2px rgba(19, 41, 75, 0.06), 0 1px 1px rgba(19, 41, 75, 0.04);
  --sombra-2: 0 6px 20px rgba(19, 41, 75, 0.1), 0 2px 6px rgba(19, 41, 75, 0.06);
  --sombra-3: 0 18px 50px rgba(19, 41, 75, 0.18), 0 4px 12px rgba(19, 41, 75, 0.08);

  --fuente: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --titulos: "Space Grotesk", "Inter", system-ui, sans-serif;
  --curva: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--fuente);
  font-size: 14px;
  line-height: 1.45;
  color: var(--texto);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--titulos); margin: 0; letter-spacing: -0.01em; color: var(--navy); }
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.92em; background: var(--gris-1); padding: 1px 6px; border-radius: 5px; }
:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; border-radius: 6px; }
.suave { color: var(--texto-3); }
.centrado { text-align: center; display: block; margin-inline: auto; }
.espacio { flex: 1; }
.texto-peligro { color: var(--rojo); }
[hidden] { display: none !important; }

/* ── Botones y campos ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--borde-fuerte); border-radius: 8px;
  background: var(--superficie); color: var(--texto);
  font-weight: 500; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn:hover { background: var(--gris-1); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn svg { width: 16px; height: 16px; }
.btn.primario { background: var(--azul); border-color: var(--azul); color: #fff; }
.btn.primario:hover { background: #185d8a; }
.btn.peligro { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.btn.peligro:hover { background: #a50d26; }
.btn.fantasma { border-color: transparent; background: transparent; color: var(--texto-2); }
.btn.fantasma:hover { background: var(--gris-2); }
.btn.chico { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.ancho { width: 100%; justify-content: center; height: 40px; }
.btn:disabled { opacity: 0.6; }
.btn-link { background: none; border: 0; padding: 0; color: var(--azul); font-weight: 500; }
.btn-link:hover { text-decoration: underline; }
.btn-link.chico { font-size: 12px; color: var(--texto-3); }

.icono-btn {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: transparent; color: var(--texto-2);
  transition: background 0.15s, color 0.15s;
}
.icono-btn:hover { background: var(--gris-2); color: var(--texto); }
.icono-btn.chico { width: 26px; height: 26px; }
.icono-btn.chico svg { width: 16px; height: 16px; }
.icono-btn.mini { width: 22px; height: 22px; }
.icono-btn.mini svg { width: 14px; height: 14px; }

.campo {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--borde-fuerte); border-radius: 8px;
  background: var(--superficie); font: inherit; color: var(--texto);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.campo { height: auto; padding: 9px 12px; resize: vertical; }
.campo:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(29, 111, 164, 0.15); }
.campo.chico { height: 30px; width: auto; padding: 0 8px; font-size: 13px; }
select.campo { padding-right: 28px; }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 500; font-size: 13px; color: var(--texto-2); }
.form .acciones, .acciones { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.error { color: var(--rojo); min-height: 1.2em; margin: 0; font-size: 13px; }

.pildora {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--gris-2); color: var(--texto-2); white-space: nowrap;
}
.pildora.ok { background: #dcf3e9; color: #0b6b49; }
.prio-alta { background: #fde4e8; color: var(--rojo); }
.prio-media { background: #fdf0d9; color: #9a4a06; }
.prio-baja { background: #e3eef7; color: #185d8a; }

.etiqueta {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, white);
}
.etiqueta button { border: 0; background: none; padding: 0 0 0 2px; color: inherit; font-size: 14px; line-height: 1; opacity: 0.6; }
.etiqueta button:hover { opacity: 1; }
.etiqueta.mas { --c: var(--texto-3); }
.etiqueta-proyecto {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  font-size: 12px; color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.etiqueta-proyecto::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--c); flex: none; }

.cuadro { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: var(--c); flex: none; }
.cuadro.grande { width: 34px; height: 34px; border-radius: 9px; }
.cuadro.xl { width: 40px; height: 40px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }

/* Avatares */
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--c, var(--azul)); color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}
.avatar.chico { width: 24px; height: 24px; font-size: 10px; }
.avatar.mini { width: 20px; height: 20px; font-size: 9px; }
.avatar.grande { width: 40px; height: 40px; font-size: 14px; }
.avatar.vacio { background: transparent; color: var(--texto-3); border: 1.5px dashed var(--borde-fuerte); }

/* Círculo de completar */
.check {
  display: inline-grid; place-items: center; flex: none;
  width: 20px; height: 20px; padding: 0; border-radius: 50%;
  border: 1.5px solid var(--borde-fuerte); background: var(--superficie); color: var(--texto-3);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.check svg { width: 13px; height: 13px; stroke-width: 2.6; opacity: 0.35; }
.check:hover { border-color: var(--verde); color: var(--verde); }
.check:hover svg { opacity: 1; }
.check.hecho { background: var(--verde); border-color: var(--verde); color: #fff; }
.check.hecho svg { opacity: 1; }
.check.mini { width: 16px; height: 16px; }
.check.mini svg { width: 11px; height: 11px; }
.check.festejo { animation: festejo 0.45s var(--curva); }
@keyframes festejo { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.tachada > .titulo, .tachada .celda-titulo .titulo, .tachada h4, .titulo-tarea.tachada { color: var(--texto-3); }

/* ── Pantalla de acceso ───────────────────────────────────────────────── */

body.acceso {
  min-height: 100%;
  background: var(--navy) url("/login-bg.jpg") center / cover no-repeat;
}
body.acceso #app { grid-template-columns: 1fr; height: auto; min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 18px; padding: 24px; }
.acceso-caja {
  width: min(400px, 100%); background: var(--superficie); border-radius: 16px;
  padding: 32px; box-shadow: var(--sombra-3); animation: entra 0.35s var(--curva);
}
.acceso-caja h1 { font-size: 22px; margin-bottom: 2px; }
.acceso-marca { display: flex; align-items: center; gap: 14px; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--borde); }
.acceso-marca img { width: 60px; height: auto; }
.acceso-marca strong { display: block; font-family: var(--titulos); font-size: 20px; color: var(--navy); letter-spacing: 0.02em; }
.acceso-marca span { color: var(--texto-3); font-size: 13px; }
.acceso-pie { color: rgba(255, 255, 255, 0.6); font-size: 12px; margin: 0; text-align: center; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Estructura principal ─────────────────────────────────────────────── */

#app { height: 100vh; display: grid; grid-template-columns: 252px 1fr; }
#principal { position: relative; min-width: 0; height: 100vh; display: flex; flex-direction: column; }
#vista { flex: 1; overflow: auto; outline: none; }
.menu-movil { display: none; }
#velo { display: none; }

/* Barra lateral */
#barra {
  background: var(--navy); color: #dbe4f0;
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 10px; overflow-y: auto; height: 100vh;
}
.marca { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.marca img { background: #fff; border-radius: 8px; padding: 3px; width: 38px; height: auto; }
.marca strong { display: block; font-family: var(--titulos); color: #fff; font-size: 16px; letter-spacing: 0.03em; }
.marca span { font-size: 12px; color: #9fb2cc; }
.buscar-btn {
  display: flex; align-items: center; gap: 8px; margin: 0 2px 8px; height: 34px; padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px;
  background: rgba(255, 255, 255, 0.06); color: #b9c8db; text-align: left;
}
.buscar-btn span { flex: 1; }
.buscar-btn svg { width: 16px; height: 16px; }
.buscar-btn kbd { font-family: inherit; font-size: 11px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 4px; padding: 0 5px; }
.buscar-btn:hover { background: rgba(255, 255, 255, 0.1); }
#barra nav { display: grid; gap: 1px; }
#barra nav a {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
  border-radius: 8px; color: #dbe4f0; font-weight: 500;
  transition: background 0.15s;
}
#barra nav a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#barra nav a:hover { background: rgba(255, 255, 255, 0.07); text-decoration: none; }
#barra nav a.activo { background: rgba(255, 255, 255, 0.14); color: #fff; }
#barra nav a svg { width: 18px; height: 18px; opacity: 0.85; }
.contador { background: var(--rojo); color: #fff; font-size: 11px; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }
.nav-titulo { display: flex; align-items: center; justify-content: space-between; padding: 18px 10px 4px; font-size: 12px; font-weight: 600; color: #8ea3bf; text-transform: uppercase; letter-spacing: 0.06em; }
.nav-titulo .icono-btn { color: #b9c8db; }
.nav-titulo .icono-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-proyectos { flex: 1; align-content: start; }
.nav-vacio { color: #8ea3bf; font-size: 13px; padding: 4px 10px; }
.perfil {
  display: flex; align-items: center; gap: 10px; padding: 10px; margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1); color: #dbe4f0; border-radius: 0 0 8px 8px;
}
.perfil:hover, .perfil.activo { background: rgba(255, 255, 255, 0.07); text-decoration: none; }
.perfil strong { display: block; color: #fff; font-weight: 600; font-size: 13px; }
.perfil span { font-size: 12px; color: #9fb2cc; }

/* Cabeceras de vista */
.cabecera-vista, .cabecera-proyecto { padding: 22px 32px 0; }
.cabecera-vista { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--borde); flex-wrap: wrap; }
.titulo-vista { display: flex; align-items: center; gap: 12px; min-width: 0; }
.titulo-vista h1 { font-size: 22px; }
.descripcion-proyecto { margin: 2px 0 0; color: var(--texto-3); font-size: 13px; max-width: 70ch; }
.cabecera-proyecto { background: var(--superficie); border-bottom: 1px solid var(--borde); position: sticky; top: 0; z-index: 5; }
.pestañas-vista { display: flex; gap: 2px; margin-top: 14px; }
.pestañas-vista a {
  padding: 8px 12px; color: var(--texto-2); font-weight: 500; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.pestañas-vista a:hover { color: var(--texto); text-decoration: none; }
.pestañas-vista a.activa { color: var(--navy); border-bottom-color: var(--azul); }
.barra-herramientas { display: flex; align-items: center; gap: 6px; padding: 10px 0; border-top: 1px solid var(--borde); flex-wrap: wrap; }

/* ── Lista ────────────────────────────────────────────────────────────── */

.tabla-lista { padding: 0 32px 60px; min-width: 760px; }
.tabla-cab, .fila {
  display: grid; grid-template-columns: minmax(280px, 1fr) 150px 130px 110px 190px; align-items: center;
}
.tabla-lista.mis .tabla-cab, .tabla-lista.mis .fila { grid-template-columns: minmax(280px, 1fr) 220px 140px 110px; }
.tabla-cab {
  position: sticky; top: 0; z-index: 2; background: var(--fondo);
  font-size: 12px; color: var(--texto-3); font-weight: 500; border-bottom: 1px solid var(--borde); height: 36px;
}
.vista-lista .tabla-cab { top: 0; }
.tabla-cab > span, .fila > span { padding: 0 10px; min-width: 0; }
.tabla-cab > span + span, .fila > span + span { border-left: 1px solid var(--borde); height: 100%; display: flex; align-items: center; }
.fila {
  min-height: 40px; border-bottom: 1px solid var(--borde); background: var(--superficie);
  cursor: pointer; transition: background 0.12s;
}
.fila:hover { background: #f7f9fc; }
.celda-titulo { display: flex; align-items: center; gap: 10px; min-width: 0; position: relative; }
.celda-titulo .titulo { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.celda-titulo strong { display: block; }
.celda-titulo small { display: block; color: var(--texto-3); font-size: 12px; }
.asa {
  position: absolute; left: -18px; width: 10px; height: 16px; opacity: 0; cursor: grab;
  background-image: radial-gradient(circle, var(--texto-3) 1.2px, transparent 1.4px);
  background-size: 5px 5px;
}
.fila:hover .asa { opacity: 0.8; }
.meta { display: inline-flex; gap: 8px; color: var(--texto-3); font-size: 12px; }
.meta span { display: inline-flex; align-items: center; gap: 3px; }
.meta svg { width: 13px; height: 13px; }
.celda-btn {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 28px; padding: 2px 6px;
  border: 1px solid transparent; border-radius: 6px; background: none; color: var(--texto-2); font-size: 13px;
}
.celda-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.celda-btn:not(:disabled):hover { border-color: var(--borde-fuerte); background: var(--superficie); }
.celda-btn:disabled { pointer-events: none; }
.celda-btn svg { width: 15px; height: 15px; }
.guion { color: var(--borde-fuerte); display: inline-flex; }
.fila:hover .guion { color: var(--texto-3); }
.fecha { font-size: 13px; color: var(--texto-2); white-space: nowrap; }
.fecha.vencida { color: var(--rojo); font-weight: 500; }
.fecha.pronto { color: var(--verde); font-weight: 500; }
.etiquetas { display: flex; gap: 4px; overflow: hidden; }

.grupo { margin-top: 18px; }
.grupo-titulo {
  display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 6px 0;
  border-bottom: 1px solid var(--borde);
}
.grupo-titulo small { color: var(--texto-3); font-family: var(--fuente); font-weight: 500; font-size: 12px; }
.grupo-titulo .icono-btn { opacity: 0; }
.grupo-titulo:hover .icono-btn, .grupo-titulo .icono-btn:focus-visible { opacity: 1; }
.plegar { border: 0; background: none; padding: 2px; border-radius: 4px; display: grid; color: var(--texto-3); }
.plegar svg { width: 16px; height: 16px; transform: rotate(90deg); transition: transform 0.18s var(--curva); }
.plegada .plegar svg { transform: rotate(0); }
.plegada [data-items] { display: none; }
.agregar-fila {
  display: block; width: 100%; text-align: left; height: 38px; padding: 0 0 0 40px;
  border: 0; border-bottom: 1px solid var(--borde); background: none; color: var(--texto-3);
}
.agregar-fila:hover { color: var(--texto); background: #f7f9fc; }
.fila.nueva { grid-template-columns: 1fr; cursor: default; }
.fila.nueva .celda-titulo { padding: 0 10px; }
.entrada-rapida { flex: 1; border: 0; outline: none; font: inherit; height: 38px; background: transparent; }
.agregar-seccion {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; border: 0; background: none;
  color: var(--texto-2); font-weight: 600; font-family: var(--titulos); font-size: 15px; padding: 6px 0;
}
.agregar-seccion:hover { color: var(--azul); }

/* Arrastrar */
.arrastrando { opacity: 0.35; }
.marca-soltar { height: 3px; background: var(--azul); border-radius: 2px; margin: -1px 0; position: relative; z-index: 3; }
.marca-soltar::before { content: ""; position: absolute; left: -3px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--azul); }

/* ── Tablero ──────────────────────────────────────────────────────────── */

.vista-tablero { height: calc(100vh - 152px); overflow-x: auto; }
.tablero { display: flex; gap: 14px; padding: 18px 32px 24px; height: 100%; align-items: flex-start; }
.columna {
  flex: 0 0 290px; max-height: 100%; display: flex; flex-direction: column;
  background: var(--gris-1); border-radius: 12px; border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.columna.zona-activa { border-color: var(--azul); background: var(--azul-suave); }
.columna header { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; }
.columna header h3 { font-size: 14px; }
.columna header small { color: var(--texto-3); font-weight: 500; }
.columna-items { display: grid; gap: 8px; padding: 2px 10px 12px; overflow-y: auto; align-content: start; }
.tarjeta-tarea {
  background: var(--superficie); border: 1px solid var(--borde); border-radius: 10px; padding: 12px;
  box-shadow: var(--sombra-1); cursor: pointer; display: grid; gap: 10px;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.tarjeta-tarea:hover { border-color: var(--borde-fuerte); box-shadow: var(--sombra-2); }
.tarjeta-tarea.tachada { opacity: 0.72; }
.tarjeta-sup { display: flex; gap: 8px; align-items: flex-start; }
.tarjeta-sup h4 { font-family: var(--fuente); font-size: 14px; font-weight: 500; color: var(--texto); line-height: 1.35; word-break: break-word; }
.tarjeta-sup .check { margin-top: 1px; }
.tarjeta-etiquetas { display: flex; flex-wrap: wrap; gap: 4px; }
.tarjeta-inf { display: flex; align-items: center; gap: 4px; }
.celda-btn.solo-avatar { padding: 0; border-radius: 50%; }
.tarjeta-inf .avatar.vacio, .tarjeta-inf .guion { opacity: 0; transition: opacity 0.15s; }
.tarjeta-tarea:hover .tarjeta-inf .avatar.vacio, .tarjeta-tarea:hover .tarjeta-inf .guion { opacity: 1; }
.tarjeta-tarea.nueva { padding: 8px 12px; cursor: default; }
.tarjeta-tarea.nueva .entrada-rapida { height: 30px; }
.agregar-tarjeta { display: flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--texto-3); padding: 8px 4px; border-radius: 8px; }
.agregar-tarjeta:hover { background: var(--gris-2); color: var(--texto); }
.agregar-tarjeta svg { width: 16px; height: 16px; }
.agregar-columna {
  flex: 0 0 240px; height: 48px; flex-direction: row; align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: 1.5px dashed var(--borde-fuerte); color: var(--texto-2); font-weight: 500;
}
.agregar-columna:hover { background: var(--gris-1); }

/* ── Calendario ───────────────────────────────────────────────────────── */

.calendario-envoltura { display: grid; grid-template-columns: 1fr 240px; gap: 18px; padding: 16px 32px 32px; }
.cal-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.cal-nav h2 { font-size: 18px; min-width: 190px; text-align: center; }
.cal-grilla {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--borde); border-left: 1px solid var(--borde); background: var(--superficie);
  border-radius: 10px; overflow: hidden;
}
.cal-dia-nombre { padding: 6px 8px; font-size: 12px; color: var(--texto-3); font-weight: 500; border-right: 1px solid var(--borde); border-bottom: 1px solid var(--borde); background: var(--fondo); }
.cal-dia { min-height: 118px; padding: 4px; border-right: 1px solid var(--borde); border-bottom: 1px solid var(--borde); display: flex; flex-direction: column; gap: 3px; transition: background 0.12s; }
.cal-dia.finde { background: #fafbfd; }
.cal-dia.fuera .cal-num { color: var(--borde-fuerte); }
.cal-dia.zona-activa { background: var(--azul-suave); }
.cal-num { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--texto-2); padding: 2px 4px; }
.cal-dia.hoy .cal-num span { background: var(--rojo); color: #fff; border-radius: 999px; padding: 1px 7px; font-weight: 600; }
.cal-mas { opacity: 0; }
.cal-dia:hover .cal-mas { opacity: 1; }
.cal-tareas { display: grid; gap: 3px; }
.chip-cal {
  display: flex; align-items: center; gap: 5px; padding: 3px 5px; border-radius: 6px;
  background: var(--azul-suave); border: 1px solid #cfe0ee; font-size: 12px; cursor: pointer; min-width: 0;
}
.chip-cal span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-cal:hover { border-color: var(--azul); }
.chip-cal.vencida { background: #fdecef; border-color: #f6c4cd; }
.chip-cal.tachada { background: var(--gris-1); border-color: var(--borde); color: var(--texto-3); }
.sin-fecha { background: var(--superficie); border: 1px solid var(--borde); border-radius: 10px; padding: 14px; align-self: start; position: sticky; top: 12px; transition: background 0.12s; }
.sin-fecha h3 { font-size: 14px; }
.sin-fecha h3 small { color: var(--texto-3); font-family: var(--fuente); }
.sin-fecha p { font-size: 12px; margin: 4px 0 10px; }
.sin-fecha.zona-activa { background: var(--azul-suave); }

/* ── Cronograma ───────────────────────────────────────────────────────── */

.vista-cronograma { padding: 14px 32px 32px; }
.gantt-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.gantt-nav .suave { margin-left: 10px; font-size: 12px; }
.gantt {
  --fila: 38px; display: grid; grid-template-columns: 280px 1fr; border: 1px solid var(--borde);
  border-radius: 10px; background: var(--superficie); max-height: calc(100vh - 230px); overflow-y: auto; overflow-x: hidden;
}
.gantt-izq { border-right: 1px solid var(--borde); position: relative; z-index: 2; background: var(--superficie); }
.gantt-cab-izq { height: 56px; display: flex; align-items: flex-end; padding: 0 12px 8px; font-size: 12px; color: var(--texto-3); border-bottom: 1px solid var(--borde); position: sticky; top: 0; background: var(--superficie); z-index: 3; }
.gantt-seccion { height: 32px; display: flex; align-items: center; padding: 0 12px; font-family: var(--titulos); font-weight: 600; color: var(--navy); background: var(--gris-1); border-bottom: 1px solid var(--borde); position: relative; z-index: 1; }
.gantt-seccion.vacia { background: rgba(244, 246, 249, 0.85); }
.gantt-fila-izq { height: var(--fila); display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--gris-2); cursor: pointer; font-size: 13px; }
.gantt-fila-izq span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-fila-izq:hover { background: #f7f9fc; }
.gantt-der { overflow-x: auto; overflow-y: hidden; }
.gantt-lienzo { position: relative; }
.gantt-cab { position: sticky; top: 0; z-index: 3; background: var(--superficie); border-bottom: 1px solid var(--borde); height: 56px; }
.gantt-meses { display: flex; height: 26px; }
.gantt-meses span { padding: 5px 8px; font-size: 12px; font-weight: 600; color: var(--navy); border-left: 1px solid var(--borde); white-space: nowrap; overflow: hidden; text-transform: capitalize; }
.gantt-dias { display: flex; height: 30px; }
.gantt-dias span { width: var(--dia); flex: none; display: grid; place-items: center; font-size: 10px; color: var(--texto-3); line-height: 1.1; text-transform: uppercase; }
.gantt-dias span b { font-size: 12px; color: var(--texto-2); font-weight: 500; }
.gantt-dias span.finde { background: var(--gris-1); }
.gantt-dias span.hoy b { background: var(--rojo); color: #fff; border-radius: 999px; padding: 0 5px; }
.gantt-fondo { position: absolute; inset: 56px 0 0 0; display: flex; pointer-events: none; }
.gantt-fondo i { width: var(--dia); flex: none; border-left: 1px solid var(--gris-1); }
.gantt-fondo i.finde { background: rgba(244, 246, 249, 0.7); }
.gantt-hoy { position: absolute; top: 56px; bottom: 0; width: 2px; background: var(--rojo); opacity: 0.7; z-index: 1; pointer-events: none; }
.gantt-fila { height: var(--fila); position: relative; border-bottom: 1px solid var(--gris-2); }
.gantt-barra {
  position: absolute; top: 6px; height: 26px; display: flex; align-items: center; gap: 6px; padding: 0 8px 0 4px;
  background: var(--c); color: #fff; border-radius: 7px; font-size: 12px; font-weight: 500; cursor: grab;
  box-shadow: var(--sombra-1); user-select: none; touch-action: none; margin-left: 2px; min-width: 0;
  transition: box-shadow 0.15s;
}
.gantt-barra:hover { box-shadow: var(--sombra-2); }
.gantt-barra:active { cursor: grabbing; }
.gantt-barra span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-barra .avatar { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85); }
.gantt-barra.hecha { opacity: 0.45; }
.gantt-barra.corta { overflow: visible; }
.gantt-barra.corta > span { position: absolute; left: calc(100% + 8px); color: var(--texto); font-weight: 500; max-width: 260px; pointer-events: none; }
.gantt-barra.vencida { box-shadow: 0 0 0 2px var(--rojo); }
.gantt-borde { position: absolute; right: 0; top: 0; bottom: 0; width: 9px; cursor: ew-resize; border-radius: 0 7px 7px 0; }
.gantt-borde:hover { background: rgba(255, 255, 255, 0.3); }
.gantt-sin { position: absolute; left: 8px; top: 8px; height: 22px; font-size: 12px; border: 1px dashed var(--borde-fuerte); border-radius: 6px; background: var(--superficie); color: var(--texto-3); padding: 0 8px; position: sticky; }
.gantt-sin:hover { color: var(--azul); border-color: var(--azul); }
.gantt-fuera { position: sticky; left: 8px; top: 10px; display: inline-block; margin: 10px 8px; font-size: 12px; color: var(--texto-3); }

/* ── Inicio ───────────────────────────────────────────────────────────── */

.inicio { max-width: 1060px; margin: 0 auto; padding: 36px 32px 60px; }
.fecha-hoy { text-align: center; color: var(--texto-2); margin: 0 0 4px; font-weight: 500; }
.inicio h1 { text-align: center; font-size: 30px; }
.resumen-chips { display: flex; justify-content: center; gap: 8px; margin: 16px 0 28px; flex-wrap: wrap; }
.resumen-chips span { background: var(--gris-1); border-radius: 999px; padding: 6px 14px; color: var(--texto-2); font-size: 13px; }
.resumen-chips b { color: var(--navy); }
.resumen-chips .alerta { background: #fdecef; }
.resumen-chips .alerta b { color: var(--rojo); }
.tarjetas-inicio { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: 14px; padding: 18px 20px; box-shadow: var(--sombra-1); }
.tarjeta header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.tarjeta h2 { font-size: 17px; flex: 1; }
.ver-todo { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 500; }
.ver-todo svg { width: 14px; height: 14px; }
.pestañas { display: flex; gap: 4px; border-bottom: 1px solid var(--borde); margin-bottom: 4px; }
.pestañas button { border: 0; background: none; padding: 8px 10px; color: var(--texto-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pestañas button.activa { color: var(--navy); border-color: var(--azul); }
.lista-simple { list-style: none; margin: 0; padding: 0; }
.fila-simple { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--gris-2); cursor: pointer; border-radius: 6px; }
.fila-simple:hover { background: #f7f9fc; }
.fila-simple .titulo { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila-simple .etiqueta-proyecto { max-width: 160px; }
.fila-simple.vacio, .lista-simple .vacio { color: var(--texto-3); cursor: default; padding: 18px 4px; list-style: none; }
.lista-proyectos { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lista-proyectos a { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; color: var(--texto); }
.lista-proyectos a:hover { background: #f7f9fc; text-decoration: none; }
.lista-proyectos a > div { flex: 1; min-width: 0; }
.lista-proyectos strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista-proyectos span { font-size: 12px; color: var(--texto-3); }
.progreso { height: 5px; border-radius: 3px; background: var(--gris-2); margin-top: 6px; overflow: hidden; }
.progreso i { display: block; height: 100%; background: var(--c); border-radius: 3px; transition: width 0.4s var(--curva); }
.pct { font-size: 13px; color: var(--texto-2); font-weight: 600; width: 40px; text-align: right; }

/* Mis tareas */
.tabla-lista.mis { padding-top: 6px; }
.interruptor { display: inline-flex; align-items: center; gap: 8px; color: var(--texto-2); cursor: pointer; user-select: none; }
.interruptor input { position: absolute; opacity: 0; }
.interruptor span { width: 32px; height: 18px; border-radius: 9px; background: var(--borde-fuerte); position: relative; transition: background 0.15s; }
.interruptor span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 0.18s var(--curva); box-shadow: var(--sombra-1); }
.interruptor input:checked + span { background: var(--azul); }
.interruptor input:checked + span::after { transform: translateX(14px); }
.interruptor input:focus-visible + span { outline: 2px solid var(--azul); outline-offset: 2px; }

/* Bandeja */
.bandeja { list-style: none; margin: 0 auto; padding: 16px 32px 60px; max-width: 820px; }
.bandeja li { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 10px; cursor: pointer; border-bottom: 1px solid var(--gris-2); }
.bandeja li:hover { background: #f7f9fc; }
.bandeja li > div { flex: 1; }
.bandeja p { margin: 0; }
.bandeja small { color: var(--texto-3); }
.bandeja li.nuevo p { font-weight: 600; color: var(--navy); }
.punto { width: 9px; height: 9px; border-radius: 50%; background: var(--azul); margin-top: 6px; flex: none; }
.vacio-grande { text-align: center; padding: 80px 20px; color: var(--texto-3); display: block !important; border: 0 !important; cursor: default !important; }
.vacio-grande h2 { color: var(--texto-2); font-size: 18px; margin-bottom: 6px; }

/* Equipo */
.tabla-equipo { padding: 0 32px; }
.tabla-equipo .tabla-cab, .tabla-equipo .fila { grid-template-columns: minmax(240px, 1fr) 160px 170px 110px 260px; cursor: default; }
.tabla-equipo .fila { min-height: 56px; }
.tabla-equipo .fila:hover { background: var(--superficie); }
.tabla-equipo .fila.inactivo { opacity: 0.55; }
.tabla-equipo select { height: 30px; border: 1px solid var(--borde-fuerte); border-radius: 6px; padding: 0 6px; font: inherit; background: var(--superficie); }
.acciones-fila { gap: 6px; justify-content: flex-end; }
.nota { margin: 18px 32px; padding: 12px 16px; background: var(--azul-suave); border-radius: 10px; color: var(--texto-2); font-size: 13px; }
.credenciales { display: grid; gap: 8px; margin: 14px 0; background: var(--gris-1); border-radius: 10px; padding: 14px; }
.credenciales small { display: block; color: var(--texto-3); font-size: 12px; }
.credenciales code { font-size: 15px; background: none; padding: 0; user-select: all; }

/* Cuenta */
.cuenta { display: grid; gap: 16px; max-width: 520px; padding: 24px 32px; justify-items: start; }
.cuenta .tarjeta { width: 100%; }
.cuenta h2 { font-size: 16px; margin-bottom: 12px; }
.cuenta dl { display: grid; grid-template-columns: 90px 1fr; gap: 8px; margin: 0; }
.cuenta dt { color: var(--texto-3); }
.cuenta dd { margin: 0; }

/* ── Panel de tarea ───────────────────────────────────────────────────── */

#panel-tarea {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100vw); z-index: 30;
  background: var(--superficie); box-shadow: var(--sombra-3); border-left: 1px solid var(--borde);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.24s var(--curva);
}
#panel-tarea.abierto { transform: none; }
.panel-cab { display: flex; align-items: center; gap: 4px; padding: 10px 14px; border-bottom: 1px solid var(--borde); }
.btn.completar .check { pointer-events: none; }
.btn.completar.hecho { background: #dcf3e9; border-color: #9fd9c1; color: #0b6b49; }
.panel-cuerpo { flex: 1; overflow-y: auto; padding: 16px 24px 30px; }
.miga { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; color: var(--texto-3); flex-wrap: wrap; }
.titulo-tarea {
  width: 100%; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; margin-left: -8px;
  font-family: var(--titulos); font-size: 22px; font-weight: 600; color: var(--navy); resize: none; overflow: hidden; background: none;
}
.titulo-tarea:hover:not([readonly]) { border-color: var(--borde-fuerte); }
.titulo-tarea:focus { outline: none; border-color: var(--azul); }
.campos { display: grid; grid-template-columns: 140px 1fr; align-items: center; gap: 6px 10px; margin: 14px 0 6px; }
.campos dt { color: var(--texto-3); font-size: 13px; }
.campos dd { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 30px; }
.etiquetas-panel .etiqueta { height: 24px; }
.panel-sub { font-size: 14px; margin: 22px 0 8px; display: flex; align-items: center; gap: 8px; }
.panel-sub small { font-family: var(--fuente); color: var(--texto-3); font-weight: 500; }
.descripcion {
  width: 100%; min-height: 80px; border: 1px solid var(--borde); border-radius: 8px; padding: 10px 12px;
  font: inherit; color: var(--texto); resize: none; overflow: hidden; background: var(--superficie);
}
.descripcion:hover:not([readonly]) { border-color: var(--borde-fuerte); }
.descripcion:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(29, 111, 164, 0.12); }
.subtareas, .enlaces, .comentarios { list-style: none; margin: 0; padding: 0; }
.subtareas li { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-bottom: 1px solid var(--gris-2); cursor: pointer; border-radius: 6px; }
.subtareas li:hover { background: #f7f9fc; }
.subtareas .titulo { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subtareas .ir { color: var(--texto-3); opacity: 0; display: inline-flex; }
.subtareas li:hover .ir { opacity: 1; }
.agregar-sub { margin-top: 6px; border-style: dashed; }
.enlaces li { display: flex; align-items: center; gap: 8px; padding: 7px 6px; border-bottom: 1px solid var(--gris-2); }
.enlaces li svg { color: var(--texto-3); width: 16px; height: 16px; }
.enlaces a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.enlaces small { color: var(--texto-3); font-size: 12px; }
.form-enlace { display: grid; grid-template-columns: 1fr 160px auto; gap: 6px; margin-top: 8px; }
.form-enlace .campo { height: 32px; font-size: 13px; }
.form-enlace .btn { height: 32px; }
.comentarios li { display: flex; gap: 10px; padding: 8px 0; }
.comentarios .actividad { color: var(--texto-3); font-size: 12px; align-items: center; padding: 4px 0; }
.comentarios .actividad svg { width: 16px; height: 16px; }
.comentario > div { flex: 1; min-width: 0; }
.comentario .autor { display: flex; align-items: center; gap: 8px; margin: 0; }
.comentario .autor small { color: var(--texto-3); }
.comentario .autor .btn-link { margin-left: auto; opacity: 0; }
.comentario:hover .autor .btn-link { opacity: 1; }
.comentario .texto { margin: 2px 0 0; white-space: pre-wrap; word-break: break-word; }
.panel-pie { border-top: 1px solid var(--borde); padding: 12px 16px; background: var(--fondo); }
.panel-pie form { display: flex; gap: 10px; align-items: flex-end; }
.panel-pie textarea { resize: none; min-height: 38px; max-height: 200px; }
.panel-cargando { display: grid; place-items: center; height: 100%; min-height: 200px; }
.panel-error { padding: 40px; text-align: center; }
.girando { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--gris-2); border-top-color: var(--azul); animation: gira 0.8s linear infinite; }
body.acceso .girando { border-color: rgba(255, 255, 255, 0.2); border-top-color: #fff; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ── Emergentes, modales y avisos ─────────────────────────────────────── */

.emergente {
  position: fixed; z-index: 60; min-width: 200px; max-width: 300px; max-height: 340px;
  background: var(--superficie); border: 1px solid var(--borde); border-radius: 10px; box-shadow: var(--sombra-3);
  padding: 4px; display: flex; flex-direction: column; animation: aparece 0.12s var(--curva);
}
.emergente-buscar { border: 0; border-bottom: 1px solid var(--borde); padding: 8px 10px; font: inherit; outline: none; margin-bottom: 4px; }
.emergente-lista { overflow-y: auto; display: grid; }
.emergente-lista button {
  display: flex; align-items: center; gap: 8px; text-align: left; border: 0; background: none;
  padding: 7px 10px; border-radius: 6px; min-height: 34px;
}
.emergente-lista button:hover, .emergente-lista button:focus-visible { background: var(--gris-1); outline: none; }
.emergente-lista button.activo { background: var(--azul-suave); font-weight: 600; }
@keyframes aparece { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }

.modal-fondo {
  position: fixed; inset: 0; z-index: 50; background: rgba(19, 41, 75, 0.38);
  display: grid; place-items: start center; padding: 12vh 16px 16px; animation: fundido 0.15s;
}
.modal-fondo.sale { opacity: 0; transition: opacity 0.15s; }
@keyframes fundido { from { opacity: 0; } }
.modal {
  width: min(440px, 100%); background: var(--superficie); border-radius: 14px; box-shadow: var(--sombra-3);
  animation: entra 0.2s var(--curva); max-height: 80vh; display: flex; flex-direction: column;
}
.modal.ancho { width: min(600px, 100%); }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 0 20px; }
.modal h2 { font-size: 17px; }
.modal-cuerpo { padding: 12px 20px 20px; overflow-y: auto; }
.modal-cuerpo p { margin: 0 0 10px; }
.resultados { display: grid; margin-top: 8px; }
.resultados button { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: none; padding: 9px 8px; border-radius: 8px; }
.resultados button:hover { background: var(--gris-1); }
.resultados span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resultados small { color: var(--texto-3); }
.resultados .tachada span { color: var(--texto-3); text-decoration: line-through; }
.colores { border: 0; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.colores legend { font-weight: 500; font-size: 13px; color: var(--texto-2); margin-bottom: 6px; padding: 0; }
.color-opcion input { position: absolute; opacity: 0; }
.color-opcion i { display: block; width: 28px; height: 28px; border-radius: 8px; background: var(--c); cursor: pointer; transition: transform 0.12s; }
.color-opcion input:checked + i { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.color-opcion input:focus-visible + i { outline: 2px solid var(--azul); outline-offset: 4px; }
.color-opcion i:hover { transform: scale(1.08); }
.fecha-oculta { position: fixed; opacity: 0; width: 1px; height: 1px; border: 0; padding: 0; }

#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; justify-items: center; }
.toast { background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--sombra-2); font-weight: 500; animation: entra 0.2s var(--curva); transition: opacity 0.3s, transform 0.3s; }
.toast.error { background: var(--rojo); }
.toast.sale { opacity: 0; transform: translateY(6px); }

/* Solo lectura: ocultar controles de edición que hayan quedado */
body.solo-lectura .asa, body.solo-lectura .cal-mas { display: none; }
body.solo-lectura .check { pointer-events: none; }

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .tarjetas-inicio { grid-template-columns: 1fr; }
  .calendario-envoltura { grid-template-columns: 1fr; }
  .sin-fecha { position: static; }
}
@media (max-width: 820px) {
  #app { grid-template-columns: 1fr; }
  #barra { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform 0.24s var(--curva); }
  #app.barra-abierta #barra { transform: none; box-shadow: var(--sombra-3); }
  #app.barra-abierta #velo { display: block; position: fixed; inset: 0; background: rgba(19, 41, 75, 0.3); z-index: 35; }
  .menu-movil { display: inline-grid; position: absolute; top: 14px; left: 10px; z-index: 10; background: var(--superficie); box-shadow: var(--sombra-1); }
  .cabecera-vista, .cabecera-proyecto { padding-left: 56px; padding-right: 16px; }
  .tabla-lista, .tabla-equipo { padding: 0 16px 40px; }
  .vista-lista, .tabla-equipo { overflow-x: auto; }
  .tablero { padding: 14px 16px; }
  .calendario-envoltura, .vista-cronograma { padding: 12px 16px; }
  .cal-dia { min-height: 80px; }
  .inicio { padding: 24px 16px 40px; }
  .gantt { grid-template-columns: 160px 1fr; }
  .form-enlace { grid-template-columns: 1fr; }
  .campos { grid-template-columns: 110px 1fr; }
  .panel-cuerpo { padding: 14px 16px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
