/*
 * Decoración navideña, tema «Equilibrio · Pine grove» (includes/navidad_widget.php
 * + assets/navidad_tema.js). Todo con prefijo xmas-. Nada recibe clics (pointer-events: none).
 * Incluye el gorro de Gerald (solo CSS) y el Papá Noel que cruza el dashboard una vez al día.
 */

/* ======================================================================
   Tema Equilibrio · Pine grove
   Rojo acebo #AD1010, dorado #D1A33C y verde pino #174D1A. Aquí van los adornos.
   Nada nuevo captura clics (todo pointer-events:none salvo enlaces).
   ====================================================================== */

/* ---------- Menú lateral: pino con guirnalda de luces ---------- */
#appSidebar {
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22112%22%20height%3D%2222%22%3E%3Cpath%20d%3D%22M0%204q14%2010%2028%200t28%200t28%200t28%200%22%20stroke%3D%22%238b97b3%22%20stroke-width%3D%221.3%22%20fill%3D%22none%22%2F%3E%3Cg%20fill%3D%22%238b97b3%22%3E%3Crect%20x%3D%2212.4%22%20y%3D%227.6%22%20width%3D%223.2%22%20height%3D%223%22%20rx%3D%22.8%22%2F%3E%3Crect%20x%3D%2240.4%22%20y%3D%227.6%22%20width%3D%223.2%22%20height%3D%223%22%20rx%3D%22.8%22%2F%3E%3Crect%20x%3D%2268.4%22%20y%3D%227.6%22%20width%3D%223.2%22%20height%3D%223%22%20rx%3D%22.8%22%2F%3E%3Crect%20x%3D%2296.4%22%20y%3D%227.6%22%20width%3D%223.2%22%20height%3D%223%22%20rx%3D%22.8%22%2F%3E%3C%2Fg%3E%3Cellipse%20cx%3D%2214%22%20cy%3D%2214%22%20rx%3D%223.6%22%20ry%3D%225%22%20fill%3D%22%23e2233f%22%2F%3E%3Cellipse%20cx%3D%2242%22%20cy%3D%2214%22%20rx%3D%223.6%22%20ry%3D%225%22%20fill%3D%22%23D1A33C%22%2F%3E%3Cellipse%20cx%3D%2270%22%20cy%3D%2214%22%20rx%3D%223.6%22%20ry%3D%225%22%20fill%3D%22%23e6efe5%22%2F%3E%3Cellipse%20cx%3D%2298%22%20cy%3D%2214%22%20rx%3D%223.6%22%20ry%3D%225%22%20fill%3D%22%237fc47f%22%2F%3E%3C%2Fsvg%3E") repeat-x 0 0 / 112px 22px, linear-gradient(180deg, #0e3311, #174D1A);
  border-right: 4px solid;
  border-image: linear-gradient(180deg, #fffdf6, #D1A33C) 1;
  padding-top: 26px;
}
#appSidebar h1 { color: #fff; }
#appSidebar h1 + p,
#appSidebar .flex-1 > p { color: #b6cdb3; }
#appSidebar .w-10.h-10.rounded-full.bg-primary {
  background: linear-gradient(135deg, #fffdf6 0%, #f3e2b0 35%, #D1A33C 100%);
}
#appSidebar .fs-nav-item { color: #dbe8d9; }
#appSidebar .fs-nav-item:not(.fs-eco-nuevo):hover { background: rgba(255, 255, 255, .08) !important; }
#appSidebar .fs-nav-item.bg-secondary-container,
#appSidebar .fs-nav-item.bg-secondary-container:hover {
  background: linear-gradient(135deg, #AD1010, #7e0b0b) !important;
  color: #fff !important;
  box-shadow: inset 4px 0 0 #D1A33C, 0 6px 14px rgba(173, 16, 16, .35);
}
#appSidebar .fs-nav-item.bg-secondary-container .material-symbols-outlined { color: #f6e3a8; }
#appSidebar .fs-nav-item span.bg-primary.rounded-full { background: #D1A33C; color: #0e3311; }
/* Pie del menú: Nueva Venta y Cerrar Sesión */
#appSidebar a.bg-primary {
  background: linear-gradient(135deg, #fffdf6 0%, #f3e2b0 35%, #D1A33C 100%);
  color: #0e3311;
}
#appSidebar .fs-nav-item.text-error { color: #ffb4ab; }
#appSidebar button[aria-label="Cerrar menú"] { color: #fff; }

/* ---------- Barra superior: franja tricolor abajo ---------- */
header.sticky.top-0 {
  background-image: linear-gradient(90deg, #AD1010 0 33.3%, #D1A33C 33.3% 66.6%, #174D1A 66.6%);
  background-size: 100% 4px;
  background-position: bottom;
  background-repeat: no-repeat;
}
header.sticky.top-0 div.bg-surface-container-high.rounded-full {
  background: linear-gradient(135deg, #fffdf6 0%, #f3e2b0 35%, #D1A33C 100%);
  color: #0e3311;
}

/* ---------- Tarjetas de indicadores: franja roja y dorada alternada ---------- */
.xmas-kpis > * { border-top: 4px solid #AD1010; }
.xmas-kpis > *:nth-child(even) { border-top-color: #D1A33C; }

/* ---------- Cintillo del dashboard ---------- */
.xmas-cintillo {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px;
  padding: 16px 24px; border-radius: 8px; color: #fff; border: 2px solid #D1A33C;
  background: linear-gradient(120deg, #7e0b0b, #AD1010 60%, #c42020);
}
.xmas-cintillo > * { position: relative; z-index: 2; }
.xmas-cintillo > .xmas-cinta, .xmas-cintillo > .xmas-mono { position: absolute; z-index: 1; }
.xmas-cinta {
  top: 0; bottom: 0; right: 240px; width: 20px;
  background: linear-gradient(90deg, #a9832b, #fff3cf 50%, #a9832b);
}
.xmas-mono {
  right: 217px; top: -5px; width: 66px; height: 44px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2060%2040%22%3E%3Cpath%20fill%3D%22%23D1A33C%22%20d%3D%22M27%2021l-8%2018%205-2%203%203%203-19zM33%2021l8%2018-5-2-3%203-3-19z%22%2F%3E%3Cpath%20fill%3D%22%23D1A33C%22%20d%3D%22M30%2019C22%204%205%201%204%2012s15%2013%2026%207zM30%2019C38%204%2055%201%2056%2012s-15%2013-26%207z%22%2F%3E%3Cpath%20d%3D%22M30%2019C24%209%2013%206%2010%2011M30%2019C36%209%2047%206%2050%2011%22%20stroke%3D%22%23000%22%20stroke-opacity%3D%22.18%22%20stroke-width%3D%221.5%22%20fill%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2230%22%20cy%3D%2219%22%20r%3D%225.5%22%20fill%3D%22%23a9832b%22%2F%3E%3C%2Fsvg%3E");
}
.xmas-arbolito { width: 44px; height: 44px; flex-shrink: 0; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23D1A33C%22%20d%3D%22M12%201.2l1.1%202.3%202.5.3-1.8%201.7.5%202.5L12%206.8%209.7%208l.5-2.5-1.8-1.7%202.5-.3z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M12%207.5l4.2%205h-2l3.3%204.3h-2.3L19%2021H5l3.8-4.2H6.5l3.3-4.3h-2z%22%2F%3E%3Ccircle%20cx%3D%2210.4%22%20cy%3D%2214.6%22%20r%3D%22.9%22%20fill%3D%22%23c8102e%22%2F%3E%3Ccircle%20cx%3D%2213.8%22%20cy%3D%2218.6%22%20r%3D%22.9%22%20fill%3D%22%23c8102e%22%2F%3E%3Ccircle%20cx%3D%2212.6%22%20cy%3D%2211.2%22%20r%3D%22.8%22%20fill%3D%22%23D1A33C%22%2F%3E%3C%2Fsvg%3E"); }
.xmas-cintillo-txt b { display: block; font-family: 'Hanken Grotesk', sans-serif; font-size: 20px; font-weight: 800; }
.xmas-cintillo-txt small { display: block; font-family: 'Hanken Grotesk', sans-serif; font-size: 15px; font-weight: 800; color: #f6e3a8; }
.xmas-cuenta { margin-left: auto; text-align: right; line-height: 1; }
.xmas-cuenta strong { font-family: 'Hanken Grotesk', sans-serif; font-size: 34px; font-weight: 900; color: #f6e3a8; }
.xmas-cuenta span { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .9; margin-top: 4px; }
@media (max-width: 640px) { .xmas-cinta, .xmas-mono { display: none; } }

/* ---------- Nieve sobre el contenido (la pone assets/navidad_tema.js) ---------- */
.xmas-conwrap { position: relative; }
/* Los .fixed (modales, avisos flotantes) quedan fuera: con position:relative se iban al fondo de la página. */
.xmas-conwrap > :not(.xmas-nieve):not(header):not(.sticky):not(.fixed) { position: relative; z-index: 1; }
.xmas-nieve { position: absolute; left: 0; right: 0; top: 0; height: 320px; overflow: hidden; pointer-events: none; z-index: 0; }
.xmas-nieve i {
  position: absolute; top: -10px; border-radius: 50%; background: #cfe6d6; opacity: .9;
  animation: xmas-copo linear infinite;
}
@keyframes xmas-copo { to { transform: translate(var(--x, 0), var(--h, 330px)); } }

/* ---------- Login: bosque de noche ---------- */
.xmas-login {
  background: radial-gradient(1100px 500px at 50% 115%, #2b6a2f 0%, transparent 60%), linear-gradient(180deg, #071c09, #0e3311 55%, #174D1A) !important;
}
.xmas-login [class*="blur-["] { display: none; }
.xmas-login div.max-w-md { border: 3px solid #D1A33C; border-top: 8px solid #AD1010; position: relative; }
.xmas-login > .xmas-nieve { height: 100%; --h: 100vh; }
.xmas-login > .xmas-nieve i { background: #fff; }
.xmas-lema {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 12px; padding: 7px 14px;
  font-family: 'Hanken Grotesk', sans-serif; font-size: 17px; font-weight: 800; line-height: 1.2;
  background: #AD1010; color: #f6e3a8; border: 1.5px solid #D1A33C; margin-bottom: 12px;
}
.xmas-colinas { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 170px; pointer-events: none; }
.xmas-arbol {
  position: absolute; bottom: 38px; left: calc(50% - 224px - 280px); width: 270px; height: 380px;
  pointer-events: none; filter: drop-shadow(0 18px 20px rgba(0, 0, 0, .25));
}
.xmas-arbol.der { left: auto; right: calc(50% - 224px - 230px); width: 180px; height: 255px; bottom: 52px; }
.xmas-regalos { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 120px; pointer-events: none; }
.xmas-arbol .glow { animation: xmas-titileo 1.6s ease-in-out infinite alternate; }
.xmas-arbol .glow:nth-of-type(3n) { animation-delay: .5s; }
@keyframes xmas-titileo { from { opacity: .35; } to { opacity: 1; } }
@media (max-width: 1100px) { .xmas-arbol { left: -70px; width: 210px; height: 300px; } .xmas-arbol.der { display: none; } }
@media (max-width: 1000px) { .xmas-arbol { display: none; } }

/* ---------- Movimiento reducido: copos quietos, sin titileo ---------- */
@media (prefers-reduced-motion: reduce) {
  .xmas-nieve i, .xmas-arbol .glow { animation: none !important; }
  .xmas-santa { display: none !important; }
}

/* ---------- Gerald con gorro de Papá Noel (solo CSS; el gorro se inclina a la derecha) ---------- */
#gerald-launcher, .gerald-head-avatar, .gerald-chat-avatar { position: relative; overflow: visible !important; }
#gerald-launcher img, .gerald-head-avatar img, .gerald-chat-avatar img { border-radius: 50%; }
.gerald-chat-avatar { background: transparent !important; }
#gerald-launcher::after, .gerald-head-avatar::after, .gerald-chat-avatar::after {
  content: ''; position: absolute; width: 96%; aspect-ratio: 100 / 78; left: 12%; top: -46%;
  transform: rotate(14deg); pointer-events: none;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%2078%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22r%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%221%22%20y2%3D%221%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%23e2233f%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%239b0b22%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cg%20transform%3D%22translate%28100%200%29%20scale%28-1%201%29%22%3E%3Cpath%20fill%3D%22url%28%23r%29%22%20d%3D%22M14%2060C18%2030%2040%206%2068%2010c16%202%2026%2014%2027%2030-6-8-14-11-21-9%205%209%209%2019%2012%2029z%22%2F%3E%3Crect%20x%3D%226%22%20y%3D%2252%22%20width%3D%2288%22%20height%3D%2220%22%20rx%3D%2210%22%20fill%3D%22%23fff%22%2F%3E%3Ccircle%20cx%3D%2293%22%20cy%3D%2242%22%20r%3D%2210%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .18));
}
#gerald-launcher::after { top: -50%; }
.gerald-head-avatar::after { width: 78%; left: 22%; top: -26%; }
/* Panel a pantalla completa en móvil: el gorro del encabezado se saldría, se oculta. */
@media (max-width: 767px) { .gerald-head-avatar::after { display: none; } }

/* ---------- Papá Noel cruzando el dashboard (lo crea assets/navidad_tema.js) ---------- */
.xmas-santa { position: fixed; z-index: 60; top: 90px; left: -660px; width: 640px; height: 140px; pointer-events: none; animation: xmas-santa-vuelo 7.5s cubic-bezier(.45, .05, .55, .95) .3s forwards; }
@keyframes xmas-santa-vuelo { 0% { left: -660px; top: 150px; } 45% { top: 70px; } 100% { left: calc(100vw + 40px); top: 110px; } }
.xmas-santa .bob { animation: xmas-santa-bob 1.1s ease-in-out infinite alternate; }
.xmas-santa .leg-a, .xmas-santa .leg-b { transform-box: fill-box; transform-origin: top center; animation: xmas-santa-galope .35s ease-in-out infinite alternate; }
.xmas-santa .leg-b { animation-direction: alternate-reverse; }
.xmas-santa .wave { transform-box: fill-box; transform-origin: 0% 100%; animation: xmas-santa-saludo .5s ease-in-out infinite alternate; }
.xmas-santa .spark { animation: xmas-santa-chispa 1s ease-in-out infinite alternate; }
@keyframes xmas-santa-bob { from { transform: translateY(-4px); } to { transform: translateY(4px); } }
@keyframes xmas-santa-galope { from { transform: rotate(-24deg); } to { transform: rotate(24deg); } }
@keyframes xmas-santa-saludo { from { transform: rotate(-12deg); } to { transform: rotate(22deg); } }
@keyframes xmas-santa-chispa { from { opacity: .15; } to { opacity: 1; } }
@media (max-width: 640px) { .xmas-santa { width: 380px; height: 83px; } }
