:root {
  --lp-bg: #06091a;
  --lp-surface: #0a0f28;
  --lp-surface2: #0d1435;
  --lp-border: rgba(0,72,255,0.14);
  --lp-primary: #0048FF;
  --lp-primary-lt: #4d7bff;
  --lp-cyan: #00c8ff;
  --lp-yellow: #ffe992;
  --lp-text: #e8f0ff;
  --lp-muted: #7a96c2;
  --lp-grad: linear-gradient(135deg, #0048FF 0%, #00c8ff 100%);
  --lp-grad-gold: linear-gradient(135deg, #0048FF 0%, #ffe992 100%);
  --lp-orange: #0048FF;
  --lp-orange-lt: #4d7bff;
  --lp-blue: #00c8ff;
}

body.semaica-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 100% 55% at 50% -5%, rgba(0,72,255,.18) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 90% 90%, rgba(0,200,255,.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 35% at 10% 80%, rgba(0,72,255,.06) 0%, transparent 55%),
    var(--lp-bg);
  color: var(--lp-text);
  position: relative;
  overflow-x: hidden;
}

body.semaica-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 40L40 0M-10 10L10 -10M30 50L50 30' stroke='%230048FF' stroke-opacity='0.035' stroke-width='1'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%230048FF' fill-opacity='0.022'%3E%3Ccircle cx='30' cy='30' r='1'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -2;
}

/* ============================================================
   CONTENT — NO crea stacking context propio (sin z-index),
   así el sidebar position:fixed compite a nivel del body.
   min-height: calc(100vh - 56px) asegura que el contenido
   siempre llene la pantalla aunque haya poco contenido.
   ============================================================ */
body.semaica-shell .app-shell-content {
  flex: 1 0 auto;               /* crece, no se encoge */
  min-height: calc(100vh - 56px); /* previene que el footer suba */
  background: linear-gradient(180deg, rgba(10,15,40,.42) 0%, rgba(6,9,26,.68) 100%);
  position: relative;
  /* SIN z-index — no crear stacking context que atrape al sidebar */
}

body.semaica-shell .app-shell-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 100% at 50% 0%, rgba(0,72,255,.07), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   NAVBAR — sticky en tope; z-index menor que sidebar
   ============================================================ */
body.semaica-shell #header-navbar {
  background: rgba(6, 9, 26, 0.88);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 1px 0 rgba(0,72,255,0.12), 0 6px 26px rgba(0,0,0,.28);
  border-bottom: 1px solid rgba(0,72,255,.14);
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* ============================================================
   SIDEBAR — z-index máximo: sobre navbar (1000) y footer.
   Como .app-shell-content YA NO tiene z-index propio,
   el sidebar position:fixed compite en el stacking context
   del body y SIEMPRE gana frente al footer.
   ============================================================ */
body.semaica-shell .sidebar-custom {
  z-index: 1050 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0;
  height: 100vh !important;
  background: linear-gradient(
    180deg,
    rgba(0, 15, 60, 0.85) 0%,
    rgba(6, 9, 26, 0.94) 100%
  ) !important;
  backdrop-filter: blur(14px) saturate(140%) !important;
  border-right: 1px solid rgba(0,72,255,.20) !important;
  box-shadow: 2px 0 28px rgba(0,0,0,.42) !important;
}

/* ============================================================
   FOOTER — siempre al fondo del flujo; z-index bajo porque
   el sidebar ya está en un stacking context superior.
   ============================================================ */
body.semaica-shell .app-shell-footer {
  flex-shrink: 0;
  background:
    radial-gradient(ellipse 90% 100% at 50% 0%, rgba(0,72,255,.12) 0%, transparent 70%),
    linear-gradient(180deg, rgba(10,15,40,.96) 0%, rgba(6,9,26,.98) 100%);
  border-top: 1px solid rgba(0,72,255,.16);
  position: relative;
  z-index: 10;  /* bajo — sidebar (1050) siempre lo tapa */
}

body.semaica-shell .app-shell-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,72,255,.35), rgba(0,200,255,.22), rgba(0,72,255,.35), transparent);
}

body.semaica-shell .app-shell-footer a {
  transition: color .2s ease;
}

body.semaica-shell .app-shell-footer a:hover {
  color: var(--lp-cyan) !important;
}
