/* Panel Infinity Growth */
:root {
  --navy: #0d1b3e;
  --navy-2: #16274f;
  --texto: #14213d;
  --texto-2: #4a5570;
  --tenue: #7b859c;
  --linea: #e3e7f0;
  --linea-2: #eef1f6;
  --fondo: #f5f7fb;
  --blanco: #fff;
  --azul: #2b59ff;
  --azul-hover: #1f47d6;
  --azul-tinte: #eaf0ff;
  --ok: #157a4a;
  --ok-tinte: #e6f5ed;
  --alerta: #b45309;
  --alerta-tinte: #fff4e5;
  --error: #b42318;
  --error-tinte: #fdecea;
  --radio: 10px;
  --sombra: 0 1px 2px rgba(13, 27, 62, .06), 0 1px 3px rgba(13, 27, 62, .04);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--texto);
  background: var(--fondo);
}
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
p { margin: 0 0 12px; }
small { font-size: 13px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tenue { color: var(--tenue); }
.nowrap { white-space: nowrap; }
.nota { color: var(--texto-2); font-size: 13.5px; }

/* ---------- Estructura ---------- */
.app { display: flex; min-height: 100vh; }
.lateral {
  width: 232px; flex-shrink: 0;
  background: var(--navy); color: #c9d1e6;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 20px 14px;
}
.lateral-marca { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 17px; padding: 4px 8px 20px; }
.lateral-marca:hover { text-decoration: none; }
.marca-logo {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--azul); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .02em;
}
.lateral-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.lateral-grupo { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #7884a3; padding: 16px 10px 6px; }
.lateral-grupo:first-child { padding-top: 0; }
.lateral-enlace { color: #c9d1e6; padding: 8px 10px; border-radius: 8px; font-weight: 500; }
.lateral-enlace:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.lateral-enlace.is-activo { background: rgba(43, 89, 255, .22); color: #fff; font-weight: 600; }
.lateral-pie { border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.lateral-usuario { display: flex; gap: 10px; align-items: center; color: #fff; padding: 6px 8px; border-radius: 8px; }
.lateral-usuario:hover, .lateral-usuario.is-activo { background: var(--navy-2); text-decoration: none; }
.lateral-usuario strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.25; }
.lateral-usuario small { display: block; color: #8f9abb; font-size: 12px; line-height: 1.3; }
.lateral-salir { background: none; border: 0; color: #8f9abb; font: inherit; font-size: 13px; padding: 4px 8px; cursor: pointer; text-align: left; }
.lateral-salir:hover { color: #fff; }
.lateral-version { font-size: 11px; color: #5e6a8a; padding: 0 8px; }

.principal { flex: 1; min-width: 0; }
.contenido { padding: 32px 40px 64px; max-width: 1240px; }
.barra-movil { display: none; }

.avatar {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--azul-tinte); color: var(--azul); font-weight: 700; font-size: 14px;
}
.lateral .avatar { background: rgba(43,89,255,.25); color: #fff; }
.avatar--cuadrado { border-radius: 8px; }

/* ---------- Cabeceras ---------- */
.cabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.cabecera-sub { color: var(--texto-2); margin: 6px 0 0; }
.miga { display: inline-block; font-size: 13px; color: var(--texto-2); margin-bottom: 6px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--azul); color: #fff; border: 1px solid var(--azul);
  font: inherit; font-weight: 600; font-size: 14px;
  padding: 9px 18px; border-radius: 999px; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover { background: var(--azul-hover); border-color: var(--azul-hover); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--secundario { background: var(--blanco); color: var(--texto); border-color: var(--linea); }
.btn--secundario:hover { background: var(--fondo); border-color: #cfd5e3; }
.btn--grande { width: 100%; padding: 12px 18px; font-size: 15px; }
.btn-texto { background: none; border: 0; padding: 4px 6px; font: inherit; font-size: 13px; color: var(--azul); cursor: pointer; font-weight: 600; }
.btn-texto:hover { text-decoration: underline; }
.btn-texto--peligro { color: var(--error); }

/* ---------- Avisos ---------- */
.aviso { border-radius: var(--radio); padding: 12px 16px; margin-bottom: 20px; border: 1px solid transparent; font-size: 14.5px; }
.aviso--ok { background: var(--ok-tinte); border-color: #bfe3cf; color: #0f5132; }
.aviso--error { background: var(--error-tinte); border-color: #f5c2bd; color: #7a1a12; }
.aviso--info { background: var(--azul-tinte); border-color: #cdd9ff; color: #1b2f73; }
.aviso--clave { background: var(--blanco); border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-tinte); }
.clave-caja { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.clave-caja code { white-space: pre; background: var(--fondo); border: 1px solid var(--linea); border-radius: 8px; padding: 10px 14px; display: block; flex: 1; min-width: 260px; overflow-x: auto; }

/* ---------- Tarjetas ---------- */
.tarjeta { background: var(--blanco); border: 1px solid var(--linea); border-radius: 12px; padding: 22px 24px; box-shadow: var(--sombra); }
.tarjeta--estrecha { max-width: 520px; }
.vacio-txt { color: var(--tenue); }
.vacio { text-align: center; padding: 48px 24px; }
.vacio h1 { margin-bottom: 12px; }

.rejilla-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.rejilla-usuarios { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 20px; align-items: start; }

/* ---------- Cifras ---------- */
.cifras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.cifra { background: var(--blanco); border: 1px solid var(--linea); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; color: var(--texto); box-shadow: var(--sombra); }
a.cifra:hover { border-color: #cdd5e5; text-decoration: none; }
.cifra-num { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.cifra-txt { color: var(--texto-2); font-size: 14px; }
.cifra--alerta .cifra-num { color: var(--alerta); }

/* ---------- Listas ---------- */
.lista-fichas, .lista-actividad, .lista-accesos, .lista-copias, .lista-equipo { list-style: none; margin: 0; padding: 0; }
.lista-fichas li + li, .lista-actividad li + li, .lista-accesos li + li, .lista-copias li + li, .lista-equipo li + li { border-top: 1px solid var(--linea-2); }
.lista-fichas a { display: grid; grid-template-columns: 1fr 120px; gap: 2px 16px; padding: 10px 0; color: var(--texto); align-items: center; }
.lista-fichas a:hover { text-decoration: none; }
.lista-fichas a:hover .lista-fichas-nombre { color: var(--azul); }
.lista-fichas-nombre { font-weight: 600; }
.lista-fichas-falta { grid-column: 1 / -1; color: var(--tenue); font-size: 13px; }
.lista-actividad li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; font-size: 14px; }
.lista-actividad time { color: var(--tenue); font-size: 12.5px; white-space: nowrap; }
.lista-actividad small { color: var(--tenue); }
.lista-accesos li, .lista-copias li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; flex-wrap: wrap; }
.lista-accesos { margin-bottom: 16px; }
.lista-equipo li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }

/* ---------- Progreso ---------- */
.progreso { display: block; height: 6px; background: var(--linea-2); border-radius: 99px; overflow: hidden; width: 100%; }
.progreso > span { display: block; height: 100%; background: var(--alerta); border-radius: 99px; }
.progreso--ok > span { background: var(--ok); }
.progreso-fila { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.progreso-fila .progreso { width: 100px; }

/* ---------- Tablas ---------- */
.tabla-envoltorio { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tarjeta .tabla { margin: -4px 0; }
.tabla th { text-align: left; font-weight: 600; color: var(--texto-2); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--linea); white-space: nowrap; }
.tabla td { padding: 12px; border-bottom: 1px solid var(--linea-2); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
div.tabla-envoltorio:not(.tarjeta .tabla-envoltorio) { background: var(--blanco); border: 1px solid var(--linea); border-radius: 12px; box-shadow: var(--sombra); }
.tabla-cliente { display: flex; gap: 12px; align-items: center; color: var(--texto); }
.tabla-cliente:hover { text-decoration: none; }
.tabla-cliente:hover strong { color: var(--azul); }
.tabla-cliente img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; border: 1px solid var(--linea-2); background: #fff; }
.tabla-cliente .avatar { width: 36px; height: 36px; }
.tabla-cliente strong { display: block; font-weight: 600; }
.tabla-cliente small { display: block; color: var(--tenue); }
.fila-apagada td { opacity: .55; }
.acciones-fila { white-space: nowrap; text-align: right; }
.acciones-fila form { display: inline; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; background: var(--azul-tinte); color: #1b3aa6; padding: 2px 9px; border-radius: 99px; margin: 2px 4px 2px 0; white-space: nowrap; }
.chip--apagado { background: var(--linea-2); color: var(--texto-2); }

/* ---------- Filtros ---------- */
.filtros { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.pestanas { display: flex; gap: 4px; background: var(--linea-2); padding: 4px; border-radius: 999px; }
.pestana { padding: 6px 14px; border-radius: 999px; color: var(--texto-2); font-weight: 600; font-size: 13.5px; }
.pestana:hover { color: var(--texto); text-decoration: none; }
.pestana.is-activa { background: var(--blanco); color: var(--texto); box-shadow: var(--sombra); }
.pestana-num { color: var(--tenue); font-weight: 500; }
.buscador input { width: 240px; }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { padding: 0; }
.form fieldset { display: flex; flex-direction: column; gap: 14px; margin-bottom: 8px; }
.form fieldset legend { font-weight: 700; margin-bottom: 4px; }
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo-etiqueta { font-weight: 600; font-size: 13.5px; color: var(--texto); }
.campo-ayuda { color: var(--tenue); font-size: 12.5px; line-height: 1.4; }
.campo-error { color: var(--error); font-size: 13px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=date], input[type=search], select, textarea {
  font: inherit; font-size: 14.5px; color: var(--texto);
  background: var(--blanco); border: 1px solid #d5dbe7; border-radius: 8px;
  padding: 9px 12px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
textarea.codigo { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-tinte); }
.campo--error input, .campo--error select, .campo--error textarea { border-color: var(--error); }
input[type=file] { font: inherit; font-size: 13.5px; }
input[type=checkbox] { accent-color: var(--azul); width: 16px; height: 16px; }

.opciones { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-top: 2px; }
.opcion { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }

.interruptor { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.interruptor input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interruptor-pista { width: 38px; height: 22px; border-radius: 99px; background: #cfd5e3; position: relative; flex-shrink: 0; transition: background .15s; }
.interruptor-pista::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.interruptor input:checked + .interruptor-pista { background: var(--ok); }
.interruptor input:checked + .interruptor-pista::after { transform: translateX(16px); }
.interruptor input:focus-visible + .interruptor-pista { box-shadow: 0 0 0 3px var(--azul-tinte); }

.color-campo { display: flex; gap: 8px; align-items: center; }
.color-campo input[type=color] { width: 42px; height: 40px; border: 1px solid #d5dbe7; border-radius: 8px; padding: 3px; background: #fff; cursor: pointer; flex-shrink: 0; }
.color-campo input[type=text] { max-width: 140px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.marca-landing { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #1b3aa6; background: var(--azul-tinte); border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: 1px; }

/* ---------- Ficha ---------- */
.cabecera--ficha { align-items: center; position: sticky; top: 0; z-index: 5; background: var(--fondo); padding: 16px 0 12px; margin: -16px 0 12px; }
.ficha-titulo { flex: 1; min-width: 260px; }
.campo-titulo input { font-size: 26px; font-weight: 800; letter-spacing: -.02em; border-color: transparent; background: transparent; padding: 2px 8px; margin-left: -9px; }
.campo-titulo input:hover { border-color: #d5dbe7; background: #fff; }
.ficha-acciones { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.estado-select select { width: auto; border-radius: 999px; padding: 8px 32px 8px 14px; font-weight: 600; font-size: 14px; }
.ficha-resumen { display: flex; flex-direction: column; gap: 8px; background: var(--alerta-tinte); border: 1px solid #f6d9ae; border-radius: 12px; padding: 14px 18px; margin-bottom: 20px; }
.ficha-resumen p { margin: 0; font-size: 14px; }
.ficha-resumen .progreso { background: rgba(180, 83, 9, .14); }
.ficha-resumen--ok { background: var(--ok-tinte); border-color: #bfe3cf; }
.ficha-resumen--ok .progreso { background: rgba(21, 122, 74, .14); }
.ficha-cuerpo { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; }
.ficha-indice { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; }
.ficha-indice a { color: var(--texto-2); padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.ficha-indice a:hover { background: var(--blanco); color: var(--texto); text-decoration: none; }
.punto-error { background: var(--error); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; min-width: 18px; height: 18px; display: inline-grid; place-items: center; padding: 0 5px; }
.ficha-secciones { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.seccion { scroll-margin-top: 96px; }
.seccion h2 { font-size: 17px; margin-bottom: 2px; }
.seccion-intro { color: var(--tenue); font-size: 13.5px; margin-bottom: 18px; }
.campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.campo--ancho { grid-column: 1 / -1; }
.campo--check { justify-content: center; }
.logo-campo { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo-campo > div:last-child { display: flex; flex-direction: column; gap: 6px; }
.logo-vista { width: 140px; height: 80px; border: 1px dashed #cfd5e3; border-radius: 10px; display: grid; place-items: center; background: repeating-conic-gradient(#f3f5f9 0% 25%, #fff 0% 50%) 50% / 14px 14px; overflow: hidden; }
.logo-vista img { max-width: 120px; max-height: 64px; object-fit: contain; }
.ficha-pie { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Actualizar ---------- */
.pasos-actualizar { margin: 20px 0 0; padding-left: 20px; color: var(--texto-2); font-size: 13.5px; }
.pasos-actualizar li + li { margin-top: 4px; }

/* ---------- Portal ---------- */
.portal-cabecera { display: flex; gap: 20px; align-items: center; margin-bottom: 28px; flex-wrap: wrap; }
.portal-logo { max-height: 64px; max-width: 180px; object-fit: contain; }

.paginacion { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }

/* ---------- Pantallas sin menú (login, instalador) ---------- */
body.simple { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; background: var(--fondo); }
.simple-caja { width: 100%; max-width: 400px; background: var(--blanco); border: 1px solid var(--linea); border-radius: 16px; padding: 32px; box-shadow: 0 10px 30px rgba(13, 27, 62, .07); }
.simple-caja--ancha { max-width: 560px; }
.simple-caja h1 { margin-bottom: 16px; font-size: 24px; }
.simple-caja .intro { color: var(--texto-2); }
.marca-simple { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 24px; color: var(--texto-2); font-size: 14px; }
.requisitos { list-style: none; padding: 12px 16px; margin: 0 0 20px; background: var(--fondo); border-radius: 10px; font-size: 13.5px; }
.requisitos li { padding: 2px 0; }
.requisitos .ok { color: var(--ok); }
.requisitos .mal { color: var(--error); font-weight: 600; }

/* ---------- Móvil ---------- */
@media (max-width: 1000px) {
  .ficha-cuerpo { grid-template-columns: minmax(0, 1fr); }
  .ficha-indice { display: none; }
  .rejilla-usuarios { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .app { display: block; }
  .lateral { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s; height: auto; }
  .lateral.is-abierto { transform: none; box-shadow: 0 0 0 100vmax rgba(13, 27, 62, .4); }
  .barra-movil { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--navy); position: sticky; top: 0; z-index: 10; }
  .barra-movil-boton { background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; font: inherit; font-weight: 600; padding: 6px 14px; border-radius: 99px; cursor: pointer; }
  .contenido { padding: 20px 16px 48px; }
  .rejilla-2, .cifras { grid-template-columns: minmax(0, 1fr); }
  .campos { grid-template-columns: minmax(0, 1fr); }
  .cabecera--ficha { top: 52px; }
  .buscador, .buscador input { width: 100%; }
  .tarjeta { padding: 18px 16px; }
  h1, .campo-titulo input { font-size: 22px; }
}
[hidden] { display: none !important; }

/* ---------- Ajustes y GoHighLevel ---------- */
.ajustes { display: flex; flex-direction: column; gap: 20px; max-width: 920px; }
.tarjeta-cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.fila-botones { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.fila-botones form { display: inline; }
.estado-ok { color: var(--ok); font-weight: 600; font-size: 14px; }
.punto-ok { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.tabla--mapeo td:first-child { width: 42%; }
.tabla--mapeo select { max-width: 100%; }
.fila-seccion td { background: var(--fondo); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-2); padding: 8px 12px; }
.pasos-ghl { padding-left: 20px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 10px; }
.pasos-ghl .clave-caja { margin-top: 8px; }
.pasos-ghl code { white-space: nowrap; }
.buscador-ghl { display: flex; gap: 10px; margin-bottom: 16px; }
.buscador-ghl input { flex: 1; }
.lista-ghl { list-style: none; margin: 0; padding: 0; }
.lista-ghl li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--linea-2); }
.lista-ghl strong { display: block; }
.lista-ghl small { display: block; margin-bottom: 4px; }
.valor-viejo { color: var(--texto-2); text-decoration: line-through; text-decoration-color: rgba(180, 35, 24, .5); }
.valor-nuevo { font-weight: 600; }
.avisos-ghl { margin: 16px 0 0; }
.avisos-ghl ul { margin: 6px 0 0; padding-left: 18px; }
