/* ===========================================================================
   Arsenal — hoja de estilos
   Un solo archivo: la plataforma tiene ocho pantallas y partirlo en módulos
   añadiría peticiones sin ganar nada.
   =========================================================================== */

:root {
  --fondo:        #080b12;
  --panel:        #0e1219;
  --linea:        rgba(255,255,255,.09);
  --linea-fuerte: rgba(255,255,255,.18);
  --tinte:        rgba(255,255,255,.03);
  --tinte-alto:   rgba(255,255,255,.055);

  --txt:      #eef1f6;
  --txt-2:    #98a2b3;
  --txt-3:    #5d6675;
  --txt-4:    #4d5563;

  --acento:   #534AB7;
  --acento-2: #7F77DD;
  --acento-3: #AFA9EC;

  --verde:  #1D9E75;  --verde-c:  #5DCAA5;
  --rojo:   #E24B4A;  --rojo-c:   #F09595;
  --ambar:  #EF9F27;  --ambar-c:  #FAC775;
  --azul:   #378ADD;  --azul-c:   #85B7EB;

  --r:   9px;
  --r-g: 13px;
}

* { box-sizing: border-box; }

html { background: var(--fondo); }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--txt);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ======= Fondo técnico ================================================== */

.rejilla {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 34px 34px;
}

.orbe {
  position: fixed; border-radius: 50%; filter: blur(48px);
  pointer-events: none; z-index: 0;
}
.orbe-1 {
  width: 260px; height: 260px; background: rgba(83,74,183,.26);
  top: -70px; left: 22%; animation: derivar 19s ease-in-out infinite;
}
.orbe-2 {
  width: 210px; height: 210px; background: rgba(29,158,117,.16);
  bottom: -70px; right: 12%; animation: derivar-2 24s ease-in-out infinite;
}

.particula {
  position: fixed; width: 2px; height: 2px; border-radius: 50%;
  background: var(--acento-2); pointer-events: none; z-index: 0;
  animation: flotar linear infinite;
}

@keyframes derivar   { 0%,100% { transform: none } 50% { transform: translate(34px,-24px) } }
@keyframes derivar-2 { 0%,100% { transform: none } 50% { transform: translate(-28px,22px) } }
@keyframes flotar {
  0%   { transform: translateY(0);      opacity: 0 }
  12%  { opacity: .5 }
  88%  { opacity: .5 }
  100% { transform: translateY(-100vh); opacity: 0 }
}

/* ======= Estructura ===================================================== */

.marco { position: relative; z-index: 1; display: flex; min-height: 100vh; }

.lateral {
  width: 186px; flex: none; display: flex; flex-direction: column;
  border-right: 1px solid var(--linea);
  background: rgba(8,11,18,.86);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; height: 100vh;
}

.marca {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 14px; border-bottom: 1px solid var(--linea);
}
.marca-txt   { font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.marca-sub   { font-size: 8px; color: var(--txt-3); letter-spacing: .6px; line-height: 1.55; }
.marca-sub b { color: var(--rojo); font-weight: 600; }

.menu { padding: 12px 9px; flex: 1; overflow-y: auto; }
.menu-titulo {
  font-size: 9px; color: var(--txt-4); letter-spacing: .8px;
  padding: 16px 10px 6px;
}

.enlace {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r);
  color: var(--txt-2); font-size: 13px;
  border-left: 2px solid transparent;
  transition: background .18s, color .18s, padding-left .18s;
  animation: entrar-izq .4s ease-out both;
}
.enlace:hover { background: var(--tinte-alto); color: #dde3ec; padding-left: 13px; }
.enlace i     { font-size: 16px; transition: transform .18s; }
.enlace:hover i { transform: translateX(2px); }
.enlace.activo {
  background: rgba(83,74,183,.22); color: #cfc9ff;
  border-left-color: var(--acento-2);
}
.enlace .cuenta { margin-left: auto; font-size: 10px; color: var(--txt-3); }

.pie-lateral {
  border-top: 1px solid var(--linea); padding: 11px 13px;
  display: flex; align-items: center; gap: 9px;
}

.contenido { flex: 1; min-width: 0; padding: 22px 26px 40px; }

/* ======= Cabecera de pantalla =========================================== */

.cabecera {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.titulo   { font-size: 21px; font-weight: 600; margin: 0; letter-spacing: .2px; }
.subtitulo{ font-size: 12px; color: var(--txt-2); margin: 3px 0 0; }

/* ======= Avatar ========================================================= */

.avatar {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 600; flex: none;
  width: 30px; height: 30px; font-size: 11px;
  background: rgba(83,74,183,.28); color: #cfc9ff;
}
.avatar-g { width: 50px; height: 50px; font-size: 17px; }
.avatar-p { width: 26px; height: 26px; font-size: 10px; }

/* ======= Tarjetas de herramienta ======================================== */

.rejilla-tarjetas {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(266px, 1fr));
  gap: 13px;
}

.tarjeta {
  position: relative; overflow: hidden; display: block;
  background: var(--tinte); border: 1px solid var(--linea);
  border-radius: var(--r-g);
  transition: transform .22s, background .22s, border-color .22s;
  animation: subir .5s cubic-bezier(.22,1,.36,1) both;
}
.tarjeta:hover {
  transform: translateY(-4px); background: var(--tinte-alto);
  border-color: var(--linea-fuerte);
}
.tarjeta:hover .flecha { transform: none; opacity: 1; }
.tarjeta:hover .halo   { opacity: .15; }
.tarjeta:hover .icono-h{ transform: scale(1.09) rotate(-4deg); }

.franja { height: 2px; }
.halo {
  position: absolute; width: 120px; height: 120px; border-radius: 50%;
  filter: blur(38px); top: -52px; right: -30px; opacity: 0;
  transition: opacity .32s; pointer-events: none;
}
.icono-h {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; transition: transform .22s cubic-bezier(.34,1.56,.64,1);
}
.flecha {
  font-size: 11px; opacity: 0; transform: translateX(-7px);
  transition: transform .22s, opacity .22s;
}
.tarjeta-cuerpo { padding: 14px; }
.tarjeta-desc {
  font-size: 11px; color: var(--txt-2); line-height: 1.55; min-height: 34px;
}
.tarjeta-pie {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 11px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.07);
  font-size: 10px; color: var(--txt-3);
}
.tarjeta-vacia { border-style: dashed; background: transparent; }
.tarjeta-vacia:hover { transform: none; background: transparent; }

/* ======= Métricas ======================================================= */

.metricas {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin-bottom: 20px;
}
.metrica {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07);
  border-radius: 11px; padding: 11px 13px;
  transition: transform .2s, border-color .2s;
  animation: subir .45s ease-out both;
}
.metrica:hover { transform: translateY(-2px); border-color: var(--linea-fuerte); }
.metrica-et  { font-size: 9px; color: var(--txt-2); letter-spacing: .5px; }
.metrica-val { font-size: 22px; font-weight: 600; margin-top: 2px; }

/* ======= Paneles y tablas =============================================== */

.panel {
  background: rgba(255,255,255,.025); border: 1px solid var(--linea);
  border-radius: 12px; overflow: hidden;
  animation: subir .45s ease-out both;
}
.panel-pad { padding: 15px; }

.tabla { width: 100%; border-collapse: collapse; }
.tabla th {
  text-align: left; font-size: 9px; font-weight: 500; color: var(--txt-2);
  letter-spacing: .6px; padding: 10px 13px;
  border-bottom: 1px solid var(--linea); white-space: nowrap;
}
.tabla td {
  padding: 10px 13px; border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: 12px; vertical-align: middle;
}
.tabla tbody tr { transition: background .16s; }
.tabla tbody tr:hover { background: rgba(255,255,255,.04); }
.tabla tbody tr:last-child td { border-bottom: none; }
.tabla tbody tr:hover .acciones { opacity: 1; }
.acciones { opacity: 0; transition: opacity .2s; display: flex; gap: 3px; justify-content: flex-end; }
.fila-baja { opacity: .5; }
.fila-baja .nombre { text-decoration: line-through; }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.tenue   { color: var(--txt-3); }
.tenue-2 { color: var(--txt-4); }
.mini    { font-size: 9px; }
.nota { font-size: 10px; color: var(--txt-4); line-height: 1.6; margin-top: 12px; }

/* ======= Insignias ====================================================== */

.insignia {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9px; padding: 3px 8px; border-radius: 20px;
  letter-spacing: .3px; white-space: nowrap;
}
.i-admin  { background: rgba(83,74,183,.22);  color: var(--acento-3); }
.i-neutra { background: rgba(255,255,255,.06);color: var(--txt-2); }
.i-bien   { background: rgba(29,158,117,.16); color: var(--verde-c); }
.i-aviso  { background: rgba(239,159,39,.16); color: var(--ambar-c); }
.i-error  { background: rgba(226,75,74,.16);  color: var(--rojo-c); }
.i-azul   { background: rgba(55,138,221,.16); color: var(--azul-c); }

/* ======= Formularios ==================================================== */

.etiqueta {
  display: block; font-size: 9px; color: var(--txt-2);
  letter-spacing: .7px; margin-bottom: 6px;
}
input[type=text], input[type=password], input[type=email], select, textarea {
  width: 100%; background: rgba(255,255,255,.04);
  border: 1px solid var(--linea); border-radius: var(--r);
  padding: 9px 12px; color: var(--txt); font-size: 13px;
  font-family: inherit; transition: border-color .2s, background .2s;
}
input:hover, select:hover, textarea:hover { border-color: rgba(127,119,221,.45); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--acento-2); background: rgba(255,255,255,.06);
}
input::placeholder { color: var(--txt-4); }
select option { background: var(--panel); }
.campo { margin-bottom: 14px; }
.ayuda { font-size: 10px; color: var(--txt-4); margin-top: 5px; line-height: 1.5; }

.opcion {
  border: 1px solid var(--linea); border-radius: 10px; padding: 11px 12px;
  cursor: pointer; transition: border-color .18s, background .18s;
}
.opcion:hover { border-color: rgba(127,119,221,.5); }
.opcion.sel   { border-color: rgba(127,119,221,.55); background: rgba(83,74,183,.16); }
.opcion input { display: none; }

.pastilla {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; padding: 5px 10px; border-radius: 20px;
  border: 1px solid var(--linea); color: var(--txt-3);
  cursor: pointer; transition: border-color .18s, background .18s, color .18s;
}
.pastilla:hover { border-color: rgba(127,119,221,.45); }
.pastilla input { display: none; }

/* ======= Botones ======================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid transparent; border-radius: var(--r);
  padding: 9px 15px; font-size: 12px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: background .18s, transform .12s, border-color .18s;
}
.btn:active { transform: scale(.985); }
.btn-1 { background: var(--acento); color: #fff; }
.btn-1:hover { background: #5f56c9; }
.btn-2 { background: rgba(255,255,255,.04); border-color: var(--linea); color: var(--txt-2); }
.btn-2:hover { background: var(--tinte-alto); color: var(--txt); }
.btn-x { background: rgba(226,75,74,.16); color: var(--rojo-c); }
.btn-x:hover { background: rgba(226,75,74,.26); }
.btn-bloque { width: 100%; padding: 11px; font-size: 13px; }

.icono-btn {
  width: 26px; height: 26px; border-radius: 7px; border: none;
  background: transparent; color: var(--txt-3); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .16s, color .16s;
}
.icono-btn:hover { background: rgba(127,119,221,.24); color: #cfc9ff; }
.icono-btn.peligro:hover { background: rgba(226,75,74,.22); color: var(--rojo-c); }

/* ======= Avisos ========================================================= */

.aviso {
  display: flex; gap: 10px; border-radius: 10px; padding: 11px 13px;
  font-size: 11px; line-height: 1.6; margin-bottom: 13px;
  animation: subir .35s ease-out both;
}
.aviso i { font-size: 16px; flex: none; margin-top: 1px; }
.a-info  { background: rgba(55,138,221,.09);  border: 1px solid rgba(55,138,221,.26);  color: #9fc0dd; }
.a-exito { background: rgba(29,158,117,.09);  border: 1px solid rgba(29,158,117,.26);  color: #93c4b0; }
.a-error { background: rgba(226,75,74,.09);   border: 1px solid rgba(226,75,74,.28);   color: #dda3a3; }
.a-warning,
.a-aviso { background: rgba(239,159,39,.09);  border: 1px solid rgba(239,159,39,.28);  color: #d9b478; }

/* ======= Acceso ========================================================= */

.centrado {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; z-index: 1;
}
.caja {
  width: 100%; max-width: 366px; padding: 30px 26px;
  background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px; backdrop-filter: blur(10px);
  animation: subir .5s cubic-bezier(.22,1,.36,1) both;
}

.clave-caja {
  display: flex; align-items: center; gap: 10px;
  background: #05070b; border: 1px solid rgba(127,119,221,.4);
  border-radius: var(--r); padding: 12px 13px;
}
.clave-txt {
  flex: 1; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--acento-3); word-break: break-all; line-height: 1.5;
}

.barra-fuerza { display: flex; gap: 4px; margin-top: 7px; }
.barra-fuerza span {
  flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.1);
  transition: background .25s;
}

/* ======= Interruptor ==================================================== */

.interruptor {
  width: 32px; height: 18px; border-radius: 20px; border: none;
  background: rgba(255,255,255,.1); position: relative; cursor: pointer;
  transition: background .2s; flex: none; padding: 0;
}
.interruptor::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--txt-3); transition: transform .2s, background .2s;
}
.interruptor.on { background: rgba(29,158,117,.45); }
.interruptor.on::after { transform: translateX(14px); background: var(--verde-c); }

/* ======= Casillas de la matriz ========================================== */

.casilla {
  width: 23px; height: 23px; border-radius: 6px; margin: 0 auto;
  border: 1px solid var(--linea-fuerte); cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: transform .15s, background .18s, border-color .18s;
}
.casilla:hover { transform: scale(1.14); }
.casilla input { display: none; }
.casilla i { font-size: 14px; opacity: 0; transition: opacity .15s; }
.casilla.on i { opacity: 1; animation: marcar .3s cubic-bezier(.34,1.56,.64,1); }
.casilla.bloqueada { border-style: dashed; cursor: not-allowed; opacity: .4; }

/* ======= Bitácora ======================================================= */

.dia {
  padding: 7px 13px; background: rgba(255,255,255,.03);
  border-bottom: 1px solid rgba(255,255,255,.06);
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: 9px; color: var(--txt-2); letter-spacing: .6px;
}
.evento {
  display: grid; grid-template-columns: 66px 26px minmax(0,1fr) 112px 100px;
  gap: 10px; padding: 9px 13px; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.04);
  border-left: 2px solid transparent;
  transition: background .16s, border-color .16s;
  animation: subir .35s ease-out both;
}
.evento:hover { background: rgba(255,255,255,.04); border-left-color: rgba(127,119,221,.5); }
.ev-icono {
  width: 22px; height: 22px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.t-neutro i { color: var(--txt-2); }   .t-neutro .ev-icono { background: rgba(255,255,255,.06); }
.t-bien   i { color: var(--verde-c); } .t-bien   .ev-icono { background: rgba(29,158,117,.16); }
.t-aviso  i { color: var(--ambar); }   .t-aviso  .ev-icono { background: rgba(239,159,39,.16); }
.t-aviso  .ev-nombre { color: var(--ambar); }
.t-error  i { color: var(--rojo-c); }  .t-error  .ev-icono { background: rgba(226,75,74,.18); }
.t-error  .ev-nombre { color: var(--rojo-c); }

/* ======= Filtros ======================================================== */

.filtros { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 13px; }
.filtro {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.04); border: 1px solid var(--linea);
  border-radius: 8px; padding: 5px 10px; font-size: 11px; color: var(--txt-2);
  transition: background .16s, color .16s, border-color .16s;
}
.filtro:hover { background: var(--tinte-alto); color: #dde3ec; }
.filtro.on { background: rgba(226,75,74,.15); border-color: rgba(226,75,74,.4); color: var(--rojo-c); }
.filtro select {
  background: transparent; border: none; color: inherit; font-size: 11px;
  padding: 0; width: auto; cursor: pointer;
}
.filtro select:focus { outline: none; background: transparent; }

.paginacion {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 13px; font-size: 10px; color: var(--txt-4);
}

/* ======= Diálogo ======================================================== */

.velo {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(4,6,10,.72); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.dialogo {
  width: 100%; max-width: 366px; background: var(--panel);
  border: 1px solid rgba(255,255,255,.13); border-radius: 14px;
  overflow: hidden; animation: entrar-dialogo .4s cubic-bezier(.22,1,.36,1) both;
}
.dialogo-cuerpo { padding: 20px 18px; }
.circulo-icono {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 13px; font-size: 22px;
}

/* ======= Animaciones ==================================================== */

@keyframes subir       { from { opacity:0; transform: translateY(14px) } to { opacity:1; transform:none } }
@keyframes entrar-izq  { from { opacity:0; transform: translateX(-9px) } to { opacity:1; transform:none } }
@keyframes entrar-dialogo { from { opacity:0; transform: translateY(18px) scale(.97) } to { opacity:1; transform:none } }
@keyframes marcar      { 0% { transform: scale(.4) } 60% { transform: scale(1.2) } 100% { transform: scale(1) } }
@keyframes latir       { 0%,100% { opacity:1; transform: scale(1) } 50% { opacity:.35; transform: scale(.8) } }
@keyframes girar       { to { transform: rotate(360deg) } }
@keyframes trazar      { to { stroke-dashoffset: 0 } }
@keyframes anillo      { 0% { transform: scale(.9); opacity:.5 } 70%,100% { transform: scale(1.9); opacity:0 } }
@keyframes menguar     { from { width: 100% } to { width: 0 } }

.late { animation: latir 1.9s ease-in-out infinite; }
.punto { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }

/* Logotipo */
.logo-anillo { transform-origin: center; animation: girar 16s linear infinite; }
.logo-marco  { stroke-dasharray: 130; stroke-dashoffset: 130; animation: trazar 1.2s ease-out both; }
.logo-cruz   { stroke-dasharray: 60;  stroke-dashoffset: 60;  animation: trazar 1.2s ease-out .3s both; }
.logo-halo   { animation: anillo 3s ease-out infinite; }

/* Quien prefiera menos movimiento, no lo ve. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ======= Pantallas estrechas ============================================ */

@media (max-width: 820px) {
  .lateral { width: 58px; }
  .marca-txt, .marca-sub, .enlace span, .menu-titulo, .pie-lateral div { display: none; }
  .enlace { justify-content: center; padding: 10px 0; }
  .enlace:hover { padding-left: 0; }
  .contenido { padding: 16px 14px 32px; }
  .evento { grid-template-columns: 56px 24px minmax(0,1fr); }
  .evento .ev-usuario, .evento .ev-ip { display: none; }
}
