:root{
  --lp-primary:#0b3d91;
  --lp-primary-2:#062a66;
  --lp-accent:#ff8a00;
  --lp-bg:#f5f7fb;
  --lp-card:#ffffff;
  --lp-text:#1f2937;
  --lp-muted:#6b7280;

  --bs-primary: var(--lp-primary);
  --bs-primary-rgb: 11,61,145;
  --bs-link-color: var(--lp-primary);
}

html,body{height:100%;}
body{
  background: var(--lp-bg);
  color: var(--lp-text);
}

/* Shell */
.lp-shell{
  min-height:100vh;
  display:flex;
}

/* Sidebar */
.lp-sidebar{
  width: 270px;
  background: linear-gradient(180deg, var(--lp-primary) 0%, var(--lp-primary-2) 100%);
  color:#fff;
  position:sticky;
  top:0;
  height:100vh;
  display:flex;
  flex-direction:column;
  padding: 18px 14px;
  overflow: hidden; /* el scroll va en el nav */
}

.lp-brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 10px 10px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  margin-bottom: 10px;
}

.lp-logo{
  width:44px;height:44px;
  border-radius: 14px;
  background: rgba(255,255,255,.12);
  display:flex;align-items:center;justify-content:center;
  font-weight:800;
  letter-spacing:.5px;
}

.lp-title{font-weight:800; letter-spacing:.2px; line-height:1;}
.lp-subtitle{font-size:.82rem; opacity:.78;}

.lp-nav{
  padding: 10px 6px;
  display:flex;
  flex-direction:column;
  gap:6px;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Scrollbar (discreto) */
.lp-nav::-webkit-scrollbar{width:8px;}
.lp-nav::-webkit-scrollbar-thumb{background: rgba(255,255,255,.18); border-radius: 999px;}
.lp-nav::-webkit-scrollbar-thumb:hover{background: rgba(255,255,255,.28);}
.lp-nav-link{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  color: rgba(255,255,255,.86);
  text-decoration:none;
  transition: all .15s ease;
}
.lp-nav-link:hover{
  background: rgba(255,255,255,.10);
  color:#fff;
}
.lp-nav-link.active{
  background: rgba(255,138,0,.16);
  border: 1px solid rgba(255,138,0,.35);
  color:#fff;
}
.lp-nav-link .bi{font-size:1.1rem;}

.lp-nav-divider{
  height: 1px;
  background: rgba(255,255,255,.12);
  margin: 10px 12px;
  border-radius: 999px;
}

.lp-sidebar-footer{
  margin-top:auto;
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.12);
  display:flex;
  gap:10px;
  align-items:center;
}
.lp-user-badge{
  width:38px;height:38px;border-radius: 14px;
  background: rgba(255,255,255,.12);
  display:flex;align-items:center;justify-content:center;
  font-weight:700;
}

/* Content */
.lp-content{flex:1; display:flex; flex-direction:column; min-width:0; height:100vh; overflow:hidden;}
.lp-topbar{
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(17,24,39,.08);
  position: sticky;
  top: 0;
  z-index: 1030;
}

/* Modales deben quedar siempre encima del topbar */
.modal-backdrop { z-index: 1250 !important; }
.modal         { z-index: 1350 !important; }
.modal-dialog  { z-index: 1360 !important; }
.modal-content { pointer-events: auto !important; position: relative; z-index: 1370 !important; }

/* Notificaciones (dropdown) deben quedar encima de todo */
.lp-topbar .dropdown-menu{
  z-index: 3000;
}

/* Asegura que el dropdown quede encima de tarjetas/secciones */
.lp-main{position:relative; flex:1; overflow-y:auto; overscroll-behavior:contain;}
/* Scrollbar discreto en el área principal */
.lp-main::-webkit-scrollbar{width:6px;}
.lp-main::-webkit-scrollbar-thumb{background:rgba(11,61,145,.18);border-radius:999px;}
.lp-main::-webkit-scrollbar-thumb:hover{background:rgba(11,61,145,.32);}
/* lp-content no debe crear stacking context para que los modales escapen correctamente */
.lp-topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 14px 18px;
}
.lp-topbar-title{
  font-weight:800;
  letter-spacing:.2px;
}
.lp-topbar-sub{
  font-size:.9rem;
  color: var(--lp-muted);
}
.lp-main{padding: 18px;}

/* Cards & UI polish */
.card{
  border: 0;
  background: var(--lp-card);
  box-shadow: 0 10px 30px rgba(2,6,23,.06);
  border-radius: 18px;
}
.card .card-title{font-weight:800;}
.btn{border-radius: 14px;}
.btn-accent{
  --bs-btn-bg: var(--lp-accent);
  --bs-btn-border-color: var(--lp-accent);
  --bs-btn-hover-bg: #ff9a22;
  --bs-btn-hover-border-color: #ff9a22;
  --bs-btn-active-bg: #f57f00;
  --bs-btn-active-border-color: #f57f00;
  --bs-btn-color:#fff;
}
.badge{border-radius:999px;}
.table{
  border-radius: 16px;
  overflow:hidden;
}
.table thead th{white-space:nowrap; background: #f2f5ff;}
.table tbody tr:hover{background:#fbfcff;}
.form-control, .form-select{border-radius:14px;}
.lp-hero{
  border-radius: 22px;
  padding: 18px 18px;
  background: radial-gradient(1200px 500px at 10% 10%, rgba(255,138,0,.18), transparent 55%),
              radial-gradient(900px 420px at 90% 0%, rgba(11,61,145,.25), transparent 55%),
              #ffffff;
  box-shadow: 0 10px 30px rgba(2,6,23,.06);
  border: 1px solid rgba(17,24,39,.06);
}
.lp-hero h2{font-weight:900; letter-spacing:.2px;}
.lp-kpi{
  border-radius: 18px;
  padding: 14px 14px;
  background: #fff;
  border: 1px solid rgba(17,24,39,.06);
}
.lp-kpi-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
@media (min-width: 992px){
  .lp-kpi-grid{grid-template-columns: repeat(3, minmax(0,1fr));}
}
.lp-kpi-label{font-size:.85rem; color: var(--lp-muted);}
.lp-kpi-value{font-size:1.2rem; font-weight:900;}
.lp-kpi-sub{font-size:.8rem; color: var(--lp-muted);}
.lp-kpi-accent{
  background: radial-gradient(700px 220px at 20% 0%, rgba(255,138,0,.20), transparent 60%),
              radial-gradient(700px 260px at 100% 100%, rgba(11,61,145,.20), transparent 60%),
              #fff;
  border: 1px solid rgba(255,138,0,.20);
}
.lp-kpi .k{font-size:.85rem; color: var(--lp-muted);}
.lp-kpi .v{font-size:1.2rem; font-weight:900;}
.lp-soft{color: var(--lp-muted);}
