
:root{
  --lpw-fp-red-1:#7d0610;
  --lpw-fp-red-2:#a90f19;
  --lpw-fp-red-3:#d61f2e;
  --lpw-fp-red-4:#ff6670;
}

/* Theme Fiestas Patrias: solo estilo. No modifica layout base. */
body.lpw-theme-fiestas-patrias{
  background:linear-gradient(135deg,#fff8f8 0%,#ffffff 54%,#fff5f5 100%)!important;
}

/* Sidebar rojo con textos blancos */
body.lpw-theme-fiestas-patrias .sidebar{
  background:linear-gradient(180deg,var(--lpw-fp-red-1) 0%,var(--lpw-fp-red-2) 52%,var(--lpw-fp-red-3) 100%)!important;
  color:#fff!important;
}

body.lpw-theme-fiestas-patrias .sidebar::before{
  content:"";
  position:absolute;
  right:-30px;
  bottom:36px;
  width:150px;
  height:150px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(255,255,255,.18) 0 26%,rgba(255,255,255,.08) 27% 62%,transparent 63%);
  pointer-events:none;
}

body.lpw-theme-fiestas-patrias .sidebar,
body.lpw-theme-fiestas-patrias .sidebar *{
  color:#fff!important;
}

body.lpw-theme-fiestas-patrias .sidebar svg{
  fill:#fff!important;
  stroke:#fff!important;
}

body.lpw-theme-fiestas-patrias .sidebar .nav-link.active,
body.lpw-theme-fiestas-patrias .sidebar a.active{
  background:rgba(255,255,255,.17)!important;
  box-shadow:inset 3px 0 0 #fff!important;
}

body.lpw-theme-fiestas-patrias .sidebar .nav-link:hover,
body.lpw-theme-fiestas-patrias .sidebar a:hover{
  background:rgba(255,255,255,.11)!important;
}

/* Tarjetas y módulos */
body.lpw-theme-fiestas-patrias .content .card,
body.lpw-theme-fiestas-patrias .content .table-card,
body.lpw-theme-fiestas-patrias .content .chart-card,
body.lpw-theme-fiestas-patrias .content .kpi-card,
body.lpw-theme-fiestas-patrias .content .widget,
body.lpw-theme-fiestas-patrias .content .section-card,
body.lpw-theme-fiestas-patrias .content .report-card,
body.lpw-theme-fiestas-patrias .content .pbi281-kpi,
body.lpw-theme-fiestas-patrias .content .exec-kpi-v274,
body.lpw-theme-fiestas-patrias .content .rrhh-kpi,
body.lpw-theme-fiestas-patrias .content .comm-kpi{
  background:linear-gradient(180deg,#fff 0%,#fffafa 100%)!important;
  border:1px solid rgba(169,15,25,.16)!important;
  border-radius:18px!important;
  box-shadow:0 10px 24px rgba(125,6,16,.07)!important;
}

body.lpw-theme-fiestas-patrias .content .kpi-card,
body.lpw-theme-fiestas-patrias .content .pbi281-kpi,
body.lpw-theme-fiestas-patrias .content .exec-kpi-v274,
body.lpw-theme-fiestas-patrias .content .rrhh-kpi,
body.lpw-theme-fiestas-patrias .content .comm-kpi{
  position:relative;
  overflow:hidden;
}

body.lpw-theme-fiestas-patrias .content .kpi-card::before,
body.lpw-theme-fiestas-patrias .content .pbi281-kpi::before,
body.lpw-theme-fiestas-patrias .content .exec-kpi-v274::before,
body.lpw-theme-fiestas-patrias .content .rrhh-kpi::before,
body.lpw-theme-fiestas-patrias .content .comm-kpi::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:4px;
  background:linear-gradient(90deg,var(--lpw-fp-red-1),var(--lpw-fp-red-3),var(--lpw-fp-red-4));
}

body.lpw-theme-fiestas-patrias h1,
body.lpw-theme-fiestas-patrias h2,
body.lpw-theme-fiestas-patrias h3,
body.lpw-theme-fiestas-patrias .page-title{
  color:#8f0c15!important;
}

body.lpw-theme-fiestas-patrias .btn.primary,
body.lpw-theme-fiestas-patrias .btn-primary,
body.lpw-theme-fiestas-patrias button.primary{
  background:linear-gradient(135deg,var(--lpw-fp-red-1),var(--lpw-fp-red-3))!important;
  border-color:var(--lpw-fp-red-2)!important;
  color:#fff!important;
}

/* Banner superior */
#lpwFiestasBanner{
  display:none;
  align-items:center;
  gap:16px;
  margin:0 0 16px;
  padding:18px 20px;
  border-radius:18px;
  border:1px solid rgba(169,15,25,.15);
  background:
    linear-gradient(125deg,rgba(255,230,230,.72),rgba(255,230,230,.72) 18%,transparent 18%) left/240px 100% no-repeat,
    linear-gradient(-120deg,rgba(255,245,245,.94),rgba(255,245,245,.94) 60%,transparent 60%) right/260px 100% no-repeat,
    linear-gradient(90deg,#fff 0%,#fffafa 100%);
  box-shadow:0 10px 24px rgba(125,6,16,.07);
}

body.lpw-theme-fiestas-patrias #lpwFiestasBanner{
  display:flex;
}

.lpw-fp-cockade{
  width:62px;
  height:62px;
  border-radius:50%;
  flex:0 0 auto;
  background:radial-gradient(circle,#fff 0 21%,#c8161d 22% 39%,#fff 40% 58%,#c8161d 59% 100%);
  box-shadow:0 0 0 4px rgba(169,15,25,.16),0 8px 18px rgba(125,6,16,.13);
}

.lpw-fp-copy{flex:1}
.lpw-fp-title{font-size:20px;font-weight:900;color:#b30f17}
.lpw-fp-msg{margin-top:4px;font-size:13px;color:#6b3b3b}

.lpw-fp-ribbon{
  white-space:nowrap;
  font-size:12px;
  font-weight:800;
  color:#a30e18;
  border:1px solid rgba(169,15,25,.22);
  border-radius:999px;
  padding:8px 12px;
  background:rgba(255,245,245,.86);
}

/* Música: izquierda para no tapar chat */
#lpwMusicControl{
  display:none;
  position:fixed;
  left:18px;
  bottom:84px;
  width:46px;
  height:46px;
  border:none;
  border-radius:999px;
  background:linear-gradient(135deg,var(--lpw-fp-red-1),var(--lpw-fp-red-3));
  color:#fff;
  cursor:pointer;
  box-shadow:0 10px 24px rgba(125,6,16,.24);
  z-index:9000;
  font-weight:700;
  align-items:center;
  justify-content:center;
}

#lpwMusicControl.show{
  display:flex;
}

#lpwMusicControl.error{
  background:#64748b!important;
}

/* Garantía: el chat nunca se oculta por el theme */
body.lpw-theme-fiestas-patrias .chat-fab{
  display:flex!important;
  visibility:visible!important;
  opacity:1!important;
  z-index:9998!important;
  right:22px!important;
  bottom:22px!important;
}

body.lpw-theme-fiestas-patrias .chat-panel{
  z-index:9999!important;
}

/* Toast */
#lpwThemeToast{
  position:fixed;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  background:#111827;
  color:#fff;
  border-radius:999px;
  padding:10px 16px;
  font-size:13px;
  box-shadow:0 12px 28px rgba(15,23,42,.28);
  opacity:0;
  pointer-events:none;
  transition:.25s;
  z-index:1000002;
}

#lpwThemeToast.show{opacity:1}

/* Modal selector */
.lpw-theme-modal-backdrop{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(15,23,42,.56);
  backdrop-filter:blur(4px);
  z-index:1000000;
}

.lpw-theme-modal-backdrop.open{display:flex}

.lpw-theme-modal{
  width:min(820px,96vw);
  max-height:92vh;
  overflow:auto;
  background:#fff;
  border-radius:18px;
  box-shadow:0 28px 80px rgba(2,6,23,.35);
  border:1px solid rgba(255,255,255,.6);
}

.lpw-theme-modal-head{
  display:flex;
  justify-content:space-between;
  gap:18px;
  padding:22px 24px 17px;
  border-bottom:1px solid #e5e7eb;
}

.lpw-theme-modal-head h3{
  margin:0;
  color:#b30f17;
  font-size:20px;
  display:flex;
  align-items:center;
  gap:9px;
}

.lpw-theme-modal-head p{
  margin:5px 0 0;
  color:#64748b;
  font-size:13px;
}

.lpw-theme-close{
  border:0;
  background:#f1f5f9;
  width:36px;
  height:36px;
  border-radius:10px;
  cursor:pointer;
  color:#475569;
}

.lpw-theme-choice-wrap{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  padding:18px 24px 0;
}

.lpw-theme-card{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px;
  border:1px solid #d7dee8;
  border-radius:14px;
  cursor:pointer;
}

.lpw-theme-card input{accent-color:#b30f17}

.lpw-theme-card .swatch{
  width:46px;
  height:46px;
  border-radius:12px;
  box-shadow:0 6px 14px rgba(15,23,42,.09);
}

.lpw-theme-card .swatch.corporate{background:linear-gradient(135deg,#0f172a,#1d4ed8)}
.lpw-theme-card .swatch.fiestas{background:linear-gradient(135deg,#7d0610,#d61f2e,#ff6670)}

.lpw-theme-card .info b{
  display:block;
  font-size:14px;
  color:#0f172a;
}

.lpw-theme-card .info small{
  display:block;
  font-size:12px;
  color:#64748b;
  margin-top:4px;
}

.lpw-theme-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(240px,1fr));
  gap:14px;
  margin-top:14px;
  padding:20px 24px 8px;
}

.lpw-theme-grid .full{grid-column:1/-1}

.lpw-theme-grid label{
  display:block;
  font-size:12px;
  font-weight:700;
  margin-bottom:6px;
  color:#334155;
}

.lpw-theme-grid input,
.lpw-theme-grid select{
  width:100%;
  min-height:40px;
  border:1px solid #cbd5e1;
  border-radius:8px;
  padding:8px 10px;
}

.lpw-mp3-upload-row{
  display:flex;
  gap:10px;
  align-items:center;
}

.lpw-mp3-upload-row input[type="file"]{
  flex:1;
}

.lpw-mp3-current{
  display:block;
  margin-top:6px;
  font-size:11px;
  color:#64748b;
}

.lpw-theme-actions{
  display:flex;
  gap:9px;
  flex-wrap:wrap;
  padding:8px 24px 18px;
}

#profileDropdown [data-profile-action="theme-manager"] i{color:#b30f17}

@media(max-width:760px){
  .lpw-theme-choice-wrap{grid-template-columns:1fr}
  .lpw-theme-grid{grid-template-columns:1fr}
  .lpw-theme-grid .full{grid-column:auto}
  .lpw-fp-ribbon{display:none}
  #lpwMusicControl{left:14px;bottom:78px}
  .lpw-mp3-upload-row{flex-direction:column;align-items:stretch}
}


/* =========================
   Theme Halloween
   ========================= */
body.lpw-theme-halloween{
  background:
    radial-gradient(circle at top left,rgba(255,122,24,.14),transparent 26%),
    radial-gradient(circle at bottom right,rgba(109,40,217,.12),transparent 28%),
    linear-gradient(135deg,#120817 0%,#1b1022 50%,#0f0814 100%)!important;
  color:#f8fafc;
}

body.lpw-theme-halloween .sidebar{
  background:linear-gradient(180deg,#0b0610 0%,#24102f 42%,#f97316 100%)!important;
  color:#fff!important;
}

body.lpw-theme-halloween .sidebar::before{
  content:"🎃";
  position:absolute;
  right:-18px;
  bottom:26px;
  width:130px;
  height:130px;
  border-radius:50%;
  font-size:72px;
  line-height:130px;
  text-align:center;
  background:radial-gradient(circle,rgba(249,115,22,.22),rgba(124,58,237,.12),transparent 70%);
  pointer-events:none;
}

body.lpw-theme-halloween .sidebar,
body.lpw-theme-halloween .sidebar *{
  color:#fff!important;
}

body.lpw-theme-halloween .sidebar svg{
  fill:#fff!important;
  stroke:#fff!important;
}

body.lpw-theme-halloween .sidebar .nav-link.active,
body.lpw-theme-halloween .sidebar a.active{
  background:rgba(249,115,22,.25)!important;
  box-shadow:inset 3px 0 0 #fb923c!important;
}

body.lpw-theme-halloween .sidebar .nav-link:hover,
body.lpw-theme-halloween .sidebar a:hover{
  background:rgba(255,255,255,.12)!important;
}

body.lpw-theme-halloween .content .card,
body.lpw-theme-halloween .content .table-card,
body.lpw-theme-halloween .content .chart-card,
body.lpw-theme-halloween .content .kpi-card,
body.lpw-theme-halloween .content .widget,
body.lpw-theme-halloween .content .section-card,
body.lpw-theme-halloween .content .report-card,
body.lpw-theme-halloween .content .pbi281-kpi,
body.lpw-theme-halloween .content .exec-kpi-v274,
body.lpw-theme-halloween .content .rrhh-kpi,
body.lpw-theme-halloween .content .comm-kpi{
  background:linear-gradient(180deg,#ffffff 0%,#fff7ed 100%)!important;
  border:1px solid rgba(249,115,22,.25)!important;
  border-radius:18px!important;
  box-shadow:0 12px 28px rgba(15,6,20,.18)!important;
}

body.lpw-theme-halloween .content .kpi-card,
body.lpw-theme-halloween .content .pbi281-kpi,
body.lpw-theme-halloween .content .exec-kpi-v274,
body.lpw-theme-halloween .content .rrhh-kpi,
body.lpw-theme-halloween .content .comm-kpi{
  position:relative;
  overflow:hidden;
}

body.lpw-theme-halloween .content .kpi-card::before,
body.lpw-theme-halloween .content .pbi281-kpi::before,
body.lpw-theme-halloween .content .exec-kpi-v274::before,
body.lpw-theme-halloween .content .rrhh-kpi::before,
body.lpw-theme-halloween .content .comm-kpi::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:4px;
  background:linear-gradient(90deg,#111827,#f97316,#7c3aed);
}

body.lpw-theme-halloween h1,
body.lpw-theme-halloween h2,
body.lpw-theme-halloween h3,
body.lpw-theme-halloween .page-title{
  color:#ea580c!important;
}

body.lpw-theme-halloween .btn.primary,
body.lpw-theme-halloween .btn-primary,
body.lpw-theme-halloween button.primary{
  background:linear-gradient(135deg,#111827,#f97316)!important;
  border-color:#ea580c!important;
  color:#fff!important;
}

body.lpw-theme-halloween #lpwFiestasBanner{
  border:1px solid rgba(249,115,22,.28);
  background:
    radial-gradient(circle at 5% 50%,rgba(249,115,22,.28),transparent 18%),
    linear-gradient(110deg,#111827 0%,#24102f 50%,#f97316 100%);
  box-shadow:0 14px 30px rgba(15,6,20,.28);
}

body.lpw-theme-halloween .lpw-fp-title{
  color:#fff!important;
  text-shadow:0 2px 8px rgba(0,0,0,.34);
}

body.lpw-theme-halloween .lpw-fp-msg{
  color:#ffedd5!important;
}

body.lpw-theme-halloween .lpw-fp-ribbon{
  color:#fff;
  border:1px solid rgba(255,237,213,.32);
  background:rgba(0,0,0,.24);
}

.lpw-hw-pumpkin{
  width:62px;
  height:62px;
  border-radius:18px;
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:42px;
  background:radial-gradient(circle,rgba(249,115,22,.35),rgba(0,0,0,.18));
  box-shadow:0 0 0 4px rgba(249,115,22,.18),0 10px 22px rgba(0,0,0,.22);
}

body.lpw-theme-halloween #lpwMusicControl{
  background:linear-gradient(135deg,#111827,#f97316)!important;
}

body.lpw-theme-halloween .chat-fab{
  display:flex!important;
  visibility:visible!important;
  opacity:1!important;
  z-index:9998!important;
  right:22px!important;
  bottom:22px!important;
}

body.lpw-theme-halloween .chat-panel{
  z-index:9999!important;
}

.lpw-theme-card .swatch.halloween{
  background:linear-gradient(135deg,#111827,#f97316,#7c3aed);
}


/* =========================
   Halloween FX Overlay
   ========================= */
.lpw-hw-fx{
  position:fixed;
  inset:0;
  pointer-events:none;
  overflow:hidden;
  z-index:35;
  opacity:0;
  transition:opacity .35s ease;
}

.lpw-hw-fx.show{
  opacity:1;
}

.lpw-hw-fog{
  position:absolute;
  left:-10%;
  right:-10%;
  height:140px;
  filter:blur(10px);
  opacity:.20;
  background:radial-gradient(circle at 30% 50%,rgba(255,255,255,.65),transparent 34%),
             radial-gradient(circle at 60% 50%,rgba(124,58,237,.35),transparent 26%),
             radial-gradient(circle at 80% 50%,rgba(249,115,22,.45),transparent 30%);
  animation:lpwHwFogMove 26s linear infinite;
}

.lpw-hw-fog.fog-1{ bottom:6%; animation-duration:28s; }
.lpw-hw-fog.fog-2{ top:9%; opacity:.12; animation-duration:34s; animation-direction:reverse; }

.lpw-hw-bat,
.lpw-hw-witch,
.lpw-hw-lightning{
  position:absolute;
  user-select:none;
  will-change:transform, opacity;
}

.lpw-hw-bat{
  font-size:28px;
  opacity:.50;
  filter:drop-shadow(0 4px 8px rgba(0,0,0,.35));
  transform:scale(var(--scale,1));
  animation:lpwHwBatFly linear infinite, lpwHwWing ease-in-out infinite;
}

.lpw-hw-bat.bat-1{ animation-duration:18s, 1.1s; }
.lpw-hw-bat.bat-2{ animation-duration:22s, 1.3s; }
.lpw-hw-bat.bat-3{ animation-duration:20s, 1.15s; }
.lpw-hw-bat.bat-4{ animation-duration:24s, 1.45s; }
.lpw-hw-bat.bat-5{ animation-duration:26s, 1.2s; }

.lpw-hw-witch{
  font-size:44px;
  opacity:.76;
  filter:drop-shadow(0 8px 16px rgba(0,0,0,.38));
  animation:lpwHwWitchFly 32s linear infinite, lpwHwWitchFloat 4.4s ease-in-out infinite;
}

.lpw-hw-witch.witch-2{ font-size:54px; animation-duration:36s, 5.1s; }
.lpw-hw-witch.witch-3{ font-size:40px; animation-duration:29s, 4.2s; }

.lpw-hw-lightning{
  top:9%;
  font-size:52px;
  color:#fde047;
  opacity:0;
  text-shadow:0 0 10px rgba(253,224,71,.65), 0 0 26px rgba(255,255,255,.4);
  animation:lpwHwLightning 8s steps(1,end) infinite;
}

.lpw-hw-lightning.bolt-2{ top:14%; animation-duration:9.5s; }
.lpw-hw-lightning.bolt-3{ top:7%; animation-duration:7.4s; }
.lpw-hw-lightning.bolt-4{ top:18%; animation-duration:10.2s; }

body.lpw-theme-halloween::after{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:32;
  opacity:.16;
  background:
    radial-gradient(circle at 20% 14%, rgba(249,115,22,.10), transparent 12%),
    radial-gradient(circle at 82% 16%, rgba(124,58,237,.14), transparent 10%),
    linear-gradient(180deg, rgba(255,255,255,.04), transparent 30%);
  animation:lpwHwFlashBg 9s linear infinite;
}

@keyframes lpwHwBatFly{
  0%   { transform:translateX(-12vw) translateY(0) scale(var(--scale,1)); }
  25%  { transform:translateX(25vw) translateY(-18px) scale(calc(var(--scale,1) + .04)); }
  50%  { transform:translateX(55vw) translateY(12px) scale(var(--scale,1)); }
  75%  { transform:translateX(85vw) translateY(-10px) scale(calc(var(--scale,1) + .05)); }
  100% { transform:translateX(118vw) translateY(8px) scale(var(--scale,1)); }
}

@keyframes lpwHwWing{
  0%,100% { rotate:-7deg; }
  50%     { rotate:7deg; }
}

@keyframes lpwHwWitchFly{
  0%   { transform:translateX(112vw) translateY(0) rotate(-2deg); opacity:0; }
  6%   { opacity:.88; }
  40%  { transform:translateX(62vw) translateY(-10px) rotate(2deg); }
  70%  { transform:translateX(24vw) translateY(8px) rotate(-1deg); }
  100% { transform:translateX(-22vw) translateY(-6px) rotate(1deg); opacity:0; }
}

@keyframes lpwHwWitchFloat{
  0%,100% { margin-top:0; }
  50%     { margin-top:-12px; }
}

@keyframes lpwHwLightning{
  0%, 82%, 100% { opacity:0; transform:scale(.85); }
  83% { opacity:.94; transform:scale(1); }
  84% { opacity:.14; }
  85% { opacity:.98; transform:scale(1.06); }
  86% { opacity:0; transform:scale(.9); }
}

@keyframes lpwHwFogMove{
  0%   { transform:translateX(-6%) translateY(0); }
  50%  { transform:translateX(6%) translateY(8px); }
  100% { transform:translateX(-6%) translateY(0); }
}

@keyframes lpwHwFlashBg{
  0%, 84%, 100% { opacity:.16; }
  85%           { opacity:.26; }
  86%           { opacity:.12; }
  87%           { opacity:.24; }
}

@media(max-width: 900px){
  .lpw-hw-bat{ font-size:22px; opacity:.42; }
  .lpw-hw-witch{ font-size:32px; opacity:.66; }
  .lpw-hw-lightning{ font-size:40px; }
}
