/* LN_OV/css/styles.css */
/* Login moderno con glassmorphism + animaciones */

:root{
  --bg1:#0f172a;        /* slate-900 */
  --bg2:#111827;        /* gray-900 */
  --card:#0b1220cc;     /* glass */
  --accent:#22d3ee;     /* cyan-400 */
  --accent2:#a78bfa;    /* violet-400 */
  --text:#e5e7eb;       /* gray-200 */
  --muted:#94a3b8;      /* slate-400 */
  --danger:#ef4444;     /* red-500 */
  --shadow:0 20px 60px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
html,body{height:100%}
body.login-body{
  margin:0; font-family:ui-sans-serif,system-ui,Segoe UI,Roboto,Arial;
  color:var(--text); background:radial-gradient(1200px 800px at 80% -20%, #1e293b 0%, #0b1020 60%, #050816 100%);
  overflow:hidden;
}

/* fondo animado */
.bg-anim{
  position:fixed; inset:0;
  background:
    radial-gradient(600px 400px at 20% 30%, rgba(34,211,238,.15), transparent 60%),
    radial-gradient(700px 500px at 80% 70%, rgba(167,139,250,.12), transparent 60%);
  filter:saturate(1.2);
  animation:bgPulse 12s ease-in-out infinite alternate;
}
@keyframes bgPulse{
  0%{filter:saturate(1.1) hue-rotate(0deg)}
  100%{filter:saturate(1.4) hue-rotate(12deg)}
}

/* partículas */
.particles{position:fixed; inset:0; pointer-events:none}
.particles span{
  position:absolute; width:6px; height:6px; border-radius:999px;
  background:linear-gradient(145deg, var(--accent), var(--accent2));
  box-shadow:0 0 16px rgba(34,211,238,.6), 0 0 30px rgba(167,139,250,.35);
  opacity:.7; animation:float 12s linear infinite;
}
.particles span:nth-child(1){top:10%; left:8%; animation-duration:11s}
.particles span:nth-child(2){top:20%; left:86%; animation-duration:14s}
.particles span:nth-child(3){top:40%; left:12%; animation-duration:13s}
.particles span:nth-child(4){top:76%; left:20%; animation-duration:12s}
.particles span:nth-child(5){top:68%; left:80%; animation-duration:15s}
.particles span:nth-child(6){top:30%; left:55%}
.particles span:nth-child(7){top:85%; left:45%}
.particles span:nth-child(8){top:58%; left:10%}
.particles span:nth-child(9){top:12%; left:65%}
.particles span:nth-child(10){top:50%; left:90%}
@keyframes float{
  0%{transform:translateY(0) translateX(0)}
  50%{transform:translateY(-30px) translateX(10px)}
  100%{transform:translateY(0) translateX(0)}
}

/* layout */
.login-wrapper{
  position:relative; z-index:1; height:100%; display:grid; place-items:center; padding:24px;
}
.login-card{
  width:min(440px, 94vw); padding:28px 28px 22px;
  background:var(--card); backdrop-filter: blur(14px) saturate(1.2);
  border:1px solid rgba(255,255,255,.08);
  border-radius:24px; box-shadow:var(--shadow);
  transform:translateY(10px) scale(.98);
  animation:cardIn .7s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes cardIn{
  to{transform:translateY(0) scale(1)}
}

/* header */
.logo-title{display:grid; place-items:center; gap:8px; margin-bottom:18px}
.logo-orb{
  width:72px; height:72px; border-radius:999px;
  background:radial-gradient(circle at 30% 30%, var(--accent) 0%, var(--accent2) 60%, transparent 62%),
             radial-gradient(circle at 70% 70%, rgba(255,255,255,.15) 0%, transparent 60%);
  box-shadow:0 12px 40px rgba(34,211,238,.25), inset 0 0 30px rgba(167,139,250,.25);
  animation:orb 5s ease-in-out infinite alternate;
}
@keyframes orb{
  0%{transform:rotate(0deg)}
  100%{transform:rotate(12deg)}
}
h1{margin:0; font-size:28px; letter-spacing:.5px}
h1 span{color:var(--accent)}
.subtitle{margin:0; color:var(--muted); font-size:14px}

/* form */
.login-form{display:grid; gap:14px; margin-top:8px}
.field label{display:block; font-size:13px; color:#cbd5e1; margin:6px 0}
.input-wrap{position:relative}
.input-wrap input{
  width:100%; padding:12px 44px 12px 12px; border-radius:14px;
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.08);
  color:var(--text); outline:none;
  transition:box-shadow .2s, transform .06s, border-color .2s;
}
.input-wrap input:focus{
  border-color:rgba(34,211,238,.55);
  box-shadow:0 0 0 4px rgba(34,211,238,.15);
}
.input-wrap .reveal{
  position:absolute; top:50%; right:8px; transform:translateY(-50%);
  width:36px; height:36px; border-radius:10px; border:0; cursor:pointer;
  background:rgba(255,255,255,.08); display:grid; place-items:center;
  transition:transform .08s ease, background .2s;
}
.input-wrap .reveal:hover{background:rgba(255,255,255,.14)}
.input-wrap .reveal:active{transform:translateY(-50%) scale(.97)}
.input-wrap .reveal svg{width:18px; height:18px; fill:#cbd5e1}

small{color:#94a3b8}

/* botón principal */
.btn-primary{
  margin-top:6px; width:100%;
  padding:12px 16px; border:0; border-radius:14px; cursor:pointer;
  color:#06121e; font-weight:700; letter-spacing:.3px;
  background:linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow:0 10px 30px rgba(34,211,238,.25);
  transition:transform .08s ease, filter .2s, box-shadow .2s;
}
.btn-primary:hover{filter:saturate(1.1)}
.btn-primary:active{transform:scale(.98)}

/* alertas */
.alert{
  display:flex; gap:10px; align-items:flex-start; padding:10px 12px;
  border-radius:12px; margin:4px 0 10px; font-size:14px;
  border:1px solid rgba(255,255,255,.08); background:rgba(239,68,68,.08);
}
.alert.error svg{width:20px; height:20px; fill:var(--danger)}
.alert span{color:#fecaca}

/* footer */
.login-footer{margin-top:16px; text-align:center}
.login-footer small{color:#93c5fd}

/* responsivo */
@media (max-width:420px){
  .login-card{padding:22px 20px}
}

/* ===========================
   LAYOUT APLICACIÓN (DASHBOARD)
   =========================== */

body.app-body{
  margin:0;
  font-family:ui-sans-serif,system-ui,Segoe UI,Roboto,Arial;
  color:var(--text);
  background:radial-gradient(1200px 800px at 80% -20%, #1e293b 0%, #0b1020 60%, #050816 100%);
  height:100vh;
  overflow:hidden;
}

.app-shell{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:260px minmax(0,1fr);
  height:100vh;
  padding:20px;
  gap:18px;
}

/* Sidebar */
.app-sidebar{
  background:var(--card);
  backdrop-filter:blur(14px) saturate(1.2);
  border-radius:22px;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:var(--shadow);
  padding:18px 16px;
  display:flex;
  flex-direction:column;
}

.app-sidebar-header{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:18px;
}
.app-sidebar-logo{
  width:40px;
  height:40px;
  border-radius:999px;
  background:radial-gradient(circle at 30% 30%, var(--accent) 0%, var(--accent2) 60%, transparent 62%);
  box-shadow:0 8px 24px rgba(34,211,238,.3), inset 0 0 18px rgba(167,139,250,.25);
}
.app-sidebar-title{
  display:flex;
  flex-direction:column;
}
.app-sidebar-title strong{
  font-size:16px;
  letter-spacing:.4px;
}
.app-sidebar-title span{
  font-size:12px;
  color:var(--muted);
}

.app-nav{
  list-style:none;
  margin:0;
  padding:4px 0;
  flex:1;
  overflow:auto;
}
.app-nav-section-label{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:var(--muted);
  margin:12px 4px 4px;
}
.app-nav-item{
  margin:2px 0;
}
.app-nav-button{
  width:100%;
  border:0;
  background:transparent;
  color:var(--text);
  font-size:13px;
  text-align:left;
  padding:9px 10px;
  border-radius:12px;
  display:flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  transition:background .16s ease, transform .06s ease, box-shadow .16s ease;
}
.app-nav-button-icon{
  width:24px;
  height:24px;
  border-radius:9px;
  display:grid;
  place-items:center;
  background:rgba(15,23,42,.9);
  border:1px solid rgba(148,163,184,.4);
  font-size:14px;
}
.app-nav-button span{
  flex:1;
}
.app-nav-button small{
  display:block;
  font-size:11px;
  color:var(--muted);
}
.app-nav-button:hover{
  background:rgba(15,23,42,.9);
  box-shadow:0 0 0 1px rgba(148,163,184,.45);
}
.app-nav-button:active{
  transform:scale(.98);
}
.app-nav-button.is-active{
  background:linear-gradient(135deg, rgba(34,211,238,.12), rgba(167,139,250,.16));
  box-shadow:0 0 0 1px rgba(94,234,212,.6);
}

/* Footer sidebar */
.app-sidebar-footer{
  margin-top:10px;
  padding-top:8px;
  border-top:1px solid rgba(148,163,184,.25);
  font-size:11px;
  color:var(--muted);
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.app-user-pill{
  display:flex;
  align-items:center;
  gap:8px;
}
.app-user-avatar{
  width:22px;
  height:22px;
  border-radius:999px;
  background:radial-gradient(circle at 30% 30%, var(--accent) 0%, transparent 70%);
  border:1px solid rgba(148,163,184,.6);
}
.app-logout{
  color:var(--muted);
  text-decoration:none;
  font-size:11px;
}
.app-logout:hover{
  color:#bfdbfe;
}

/* Main */
.app-main{
  background:var(--card);
  backdrop-filter:blur(16px) saturate(1.2);
  border-radius:22px;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:var(--shadow);
  padding:18px 18px 14px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

/* Main header */
.app-main-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.app-main-title{
  display:flex;
  flex-direction:column;
}
.app-main-title h2{
  margin:0;
  font-size:18px;
  letter-spacing:.4px;
}
.app-main-title p{
  margin:0;
  font-size:12px;
  color:var(--muted);
}
.app-main-badges{
  display:flex;
  gap:8px;
  align-items:center;
}
.badge{
  font-size:11px;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.45);
  color:var(--muted);
}
.badge-accent{
  border-color:rgba(34,211,238,.8);
  color:#a5f3fc;
}

/* Contenido scroll */
.app-content-scroll{
  flex:1;
  overflow:auto;
  padding-top:4px;
}

/* Tarjeta de descripción central */
.app-section-hero{
  padding:14px 14px 12px;
  border-radius:18px;
  border:1px solid rgba(148,163,184,.35);
  background:radial-gradient(circle at 0% 0%, rgba(34,211,238,.08) 0%, transparent 55%),
             radial-gradient(circle at 100% 100%, rgba(167,139,250,.08) 0%, transparent 55%),
             rgba(15,23,42,.85);
  display:flex;
  gap:16px;
  align-items:flex-start;
  margin-bottom:14px;
}
.app-section-hero-icon{
  width:40px;
  height:40px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:rgba(15,23,42,.95);
  border:1px solid rgba(148,163,184,.7);
  font-size:20px;
}
.app-section-hero-body h3{
  margin:0 0 4px;
  font-size:16px;
}
.app-section-hero-body p{
  margin:0;
  font-size:13px;
  color:var(--muted);
}
.app-section-hero-tags{
  margin-top:6px;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.app-tag{
  font-size:10px;
  padding:3px 7px;
  border-radius:999px;
  background:rgba(15,23,42,.9);
  border:1px solid rgba(148,163,184,.4);
  color:var(--muted);
}

/* Grid de tarjetas secundarias */
.app-section-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(200px,1fr));
  gap:10px;
  margin-bottom:12px;
}
.app-section-card{
  padding:10px 11px;
  border-radius:14px;
  border:1px solid rgba(148,163,184,.35);
  background:rgba(15,23,42,.9);
  display:flex;
  flex-direction:column;
  gap:4px;
}
.app-section-card strong{
  font-size:13px;
}
.app-section-card p{
  margin:0;
  font-size:12px;
  color:var(--muted);
}
.app-section-card span{
  font-size:11px;
  color:#e5e7eb;
}

/* Botón de acción principal en contenido */
.app-section-actions{
  margin-top:6px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.app-section-btn{
  border:0;
  border-radius:999px;
  padding:7px 12px;
  font-size:12px;
  cursor:pointer;
  background:linear-gradient(135deg, var(--accent), var(--accent2));
  color:#06121e;
  font-weight:600;
  box-shadow:0 8px 24px rgba(34,211,238,.25);
}
.app-section-btn.secondary{
  background:rgba(15,23,42,.9);
  color:var(--muted);
  box-shadow:none;
  border:1px solid rgba(148,163,184,.5);
}

/* Responsive */
@media (max-width:880px){
  .app-shell{
    grid-template-columns:1fr;
    padding:14px;
  }
  .app-sidebar{
    flex-direction:row;
    align-items:flex-start;
    gap:14px;
    height:auto;
  }
  .app-sidebar-header{
    margin-bottom:0;
  }
  .app-nav{
    flex:1;
    max-height:180px;
  }
}

/* ===========================
   NAV LATERAL DESPLEGABLE
   =========================== */

.app-nav-group{
  margin-bottom:6px;
}

.app-nav-group-header{
  width:100%;
  border:0;
  background:transparent;
  padding:6px 8px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  cursor:pointer;
  transition:background .16s ease, box-shadow .16s ease;
}

.app-nav-group-header-left{
  display:flex;
  flex-direction:column;
}

.app-nav-group-header-title{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:var(--muted);
}

.app-nav-group-header-sub{
  font-size:10px;
  color:#64748b;
}

.app-nav-group-header-icon{
  width:20px;
  height:20px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.4);
  display:grid;
  place-items:center;
  font-size:11px;
  color:var(--muted);
  transform:rotate(0deg);
  transition:transform .16s ease, background .16s ease, border-color .16s ease;
}

.app-nav-group.is-open .app-nav-group-header{
  background:rgba(15,23,42,.9);
  box-shadow:0 0 0 1px rgba(148,163,184,.45);
}

.app-nav-group.is-open .app-nav-group-header-icon{
  transform:rotate(90deg);
  background:rgba(15,23,42,.9);
  border-color:rgba(94,234,212,.8);
  color:#a5f3fc;
}

/* cuerpo colapsable */
.app-nav-group-body{
  padding-top:4px;
  padding-bottom:2px;
  max-height:0;
  overflow:hidden;
  opacity:0;
  transition:max-height .24s ease, opacity .2s ease;
}

.app-nav-group.is-open .app-nav-group-body{
  max-height:1200px;
  opacity:1;
  overflow:visible;
}

/* Ajuste pequeño a los botones de menú dentro del grupo */
.app-nav-button{
  margin:2px 0;
}

/* ===========================
   TOGGLE MENÚ / RESPONSIVE
   =========================== */

.app-main-toggle{
  border:0;
  background:rgba(15,23,42,.95);
  border-radius:999px;
  width:34px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  padding:0;
  margin-right:6px;
  box-shadow:0 0 0 1px rgba(148,163,184,.4);
}
.app-main-toggle span{
  display:block;
  width:16px;
  height:2px;
  border-radius:999px;
  background:#e5e7eb;
  margin:2px 0;
  transition:transform .16s ease, opacity .16s ease;
}
body.app-body.menu-open .app-main-toggle span:nth-child(1){
  transform:translateY(4px) rotate(45deg);
}
body.app-body.menu-open .app-main-toggle span:nth-child(2){
  opacity:0;
}
body.app-body.menu-open .app-main-toggle span:nth-child(3){
  transform:translateY(-4px) rotate(-45deg);
}

.app-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.82);
  backdrop-filter:blur(2px);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease;
  z-index:25;
}
body.app-body.menu-open .app-backdrop{
  opacity:1;
  pointer-events:auto;
}

@media (min-width:881px){
  body.app-body.menu-collapsed .app-shell{
    grid-template-columns:82px minmax(0,1fr);
  }

  body.app-body.menu-collapsed .app-sidebar{
    padding-inline:10px;
  }

  body.app-body.menu-collapsed .app-sidebar-scroll{
    padding:12px 8px 10px 8px;
  }

  body.app-body.menu-collapsed .app-sidebar-title span,
  body.app-body.menu-collapsed .app-sidebar-title strong,
  body.app-body.menu-collapsed .app-nav-group-header-left,
  body.app-body.menu-collapsed .app-nav-button span small,
  body.app-body.menu-collapsed .app-nav-button span,
  body.app-body.menu-collapsed .app-sidebar-footer .app-user-pill > div,
  body.app-body.menu-collapsed .app-sidebar-footer .app-logout{
    display:none;
  }

  body.app-body.menu-collapsed .app-nav-group-header{
    padding:6px 0;
    justify-content:center;
  }

  body.app-body.menu-collapsed .app-nav-group-body{
    padding:2px 0 6px;
  }

  body.app-body.menu-collapsed .app-nav-button{
    justify-content:center;
    padding:8px 6px;
    margin:4px 0;
  }

  body.app-body.menu-collapsed .app-nav-button .app-nav-button-icon{
    width:32px;
    height:32px;
  }

  body.app-body.menu-collapsed .app-sidebar-footer{
    justify-content:center;
  }
}

/* ============================
   LAYOUT DASHBOARD + SCROLL
   ============================ */

html, body{
  height:100%;
}

body.app-body{
  margin:0;
  font-family:ui-sans-serif,system-ui,Segoe UI,Roboto,Arial;
  color:var(--text);
  background:radial-gradient(1200px 800px at 80% -20%, #1e293b 0%, #0b1020 60%, #050816 100%);
}

.app-shell{
  position:relative;
  display:grid;
  grid-template-columns:320px minmax(0,1fr);
  height:100vh;
  max-height:100vh;
  overflow:hidden;
}

.app-sidebar{
  position:relative;
  display:flex;
  flex-direction:column;
  height:100%;
  min-height:0;
}

.app-sidebar-scroll{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:visible;
  padding:8px 18px 10px 18px;
  box-sizing:border-box;
}

.app-nav{
  margin:10px 0 12px;
  padding:0;
  list-style:none;
  overflow:visible;
}

.app-sidebar-footer{
  padding:12px 22px 20px;
  border-top:1px solid rgba(148,163,184,.35);
}

.app-sidebar-scroll::-webkit-scrollbar{
  width:6px;
}
.app-sidebar-scroll::-webkit-scrollbar-track{
  background:transparent;
}
.app-sidebar-scroll::-webkit-scrollbar-thumb{
  background:rgba(148,163,184,.45);
  border-radius:999px;
}
.app-sidebar-scroll::-webkit-scrollbar-thumb:hover{
  background:rgba(148,163,184,.8);
}
.app-sidebar-scroll{
  scrollbar-width:thin;
  scrollbar-color:rgba(148,163,184,.6) transparent;
}

@media (max-width:880px){
  .app-shell{
    grid-template-columns:minmax(0,1fr);
  }
}

/* ===== Footer sidebar: usuario + cerrar sesión ===== */

.app-sidebar-footer{
  padding:10px 22px 18px;
  border-top:1px solid rgba(148,163,184,.45);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.app-user-pill{
  display:flex;
  align-items:center;
  gap:10px;
  background:transparent;
  padding:0;
  border-radius:0;
  box-shadow:none;
}

.app-user-avatar{
  width:18px;
  height:18px;
  border-radius:999px;
  background:radial-gradient(circle at 30% 30%, #22d3ee 0%, #a855f7 55%, #020617 80%);
  box-shadow:0 0 12px rgba(56,189,248,.85);
}

.app-user-pill > div{
  display:flex;
  flex-direction:column;
}

.app-user-pill > div div:first-child{
  font-size:11px;
  font-weight:600;
}

.app-user-pill > div div:last-child{
  font-size:10px;
  color:var(--muted);
}

.app-logout{
  font-size:11px;
  color:#e5e7eb;
  text-decoration:none;
  white-space:nowrap;
  transition:color .15s ease, transform .1s ease;
}

.app-logout:hover{
  color:var(--accent);
  transform:translateY(-1px);
}

.app-nav-group-header,
.app-nav-button span,
.app-nav-group-header-sub{
  text-align:left;
}

.app-nav-button span{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
}

.app-nav-item{
  justify-content:flex-start;
}

/* ===========================
   AJUSTE: ICONOS CON COLOR (FontAwesome)
   =========================== */

.app-nav-button-icon i{
  color:var(--accent);
  filter:drop-shadow(0 6px 14px rgba(34,211,238,.18));
}

.app-nav-button.is-active .app-nav-button-icon i{
  color:#a5f3fc;
}

/* ===========================
   SUBMENU (Anticipos / Configuración)
   =========================== */

.app-nav-submenu{
  margin:2px 0;
}

.app-nav-submenu-toggle{
  position:relative;
  padding-right:40px;
}

.app-nav-submenu-caret{
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  width:26px;
  height:26px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:rgba(15,23,42,.75);
  border:1px solid rgba(148,163,184,.35);
  box-shadow:0 0 0 1px rgba(34,211,238,.10), 0 10px 28px rgba(0,0,0,.25);
}

.app-nav-submenu-caret i{
  color:#a5f3fc;
  font-size:12px;
  transition:transform .18s ease;
}

/* CERRADO */
.app-nav-submenu-body{
  max-height:0;
  overflow:hidden;
  opacity:0;
  transform:translateY(-2px);
  transition:max-height .22s ease, opacity .18s ease, transform .18s ease;
}

/* ABIERTO */
.app-nav-submenu.is-open .app-nav-submenu-body{
  max-height:360px;
  opacity:1;
  transform:translateY(0);
  overflow:visible;
  padding:6px 6px 10px 6px;
}

.app-nav-submenu.is-open .app-nav-submenu-caret i{
  transform:rotate(180deg);
}

.app-nav-submenu-link{
  margin:2px 0;
}

.app-nav-submenu.is-open .app-nav-submenu-link:hover{
  box-shadow:0 0 0 1px rgba(34,211,238,.18);
}

.app-nav-submenu .app-nav-submenu-toggle.is-active{
  background:linear-gradient(135deg, rgba(34,211,238,.10), rgba(167,139,250,.12));
  box-shadow:0 0 0 1px rgba(94,234,212,.35);
}