:root {
      --primary: #06b6d4;
      --primary-soft: rgba(45, 212, 191, 0.35);
      --primary-dark: #0ea5e9;
      --accent: #facc15;
      --accent-soft: rgba(250, 204, 21, 0.16);
      --danger: #f97373;
      --bg: #020617;
      --bg-soft: #020617;
      --card-bg: rgba(15, 23, 42, 0.98);
      --border-soft: rgba(148, 163, 184, 0.3);
      --text-main: #e5e7eb;
      --text-muted: #9ca3af;
      --radius-lg: 20px;
      --radius-xl: 26px;
      --shadow-soft: 0 20px 40px rgba(15, 23, 42, 0.9);

      /* Colores navideños extra */
      --xmas-red: #ef4444;
      --xmas-green: #0cff00;
      --xmas-gold: #facc15;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
      background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.25), transparent 55%),
                  radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.2), transparent 55%),
                  #020617;
      color: var(--text-main);
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      overflow-x: hidden;
      overflow-y: auto;
      position: relative;
      margin-top: 2rem;
    }

    /* Fondo animado de líneas */
    body::before {
      content: "";
      position: fixed;
      inset: -40px;
      background:
        linear-gradient(115deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px),
        linear-gradient(205deg, rgba(30, 64, 175, 0.22) 1px, transparent 1px);
      background-size: 120px 120px;
      opacity: 0.2;
      mix-blend-mode: soft-light;
      animation: gridShift 30s linear infinite;
      pointer-events: none;
      z-index: -2;
    }

    @keyframes gridShift {
      0% { transform: translate3d(0,0,0); }
      100% { transform: translate3d(-120px,-120px,0); }
    }

    /* Canvas de nieve */
    #snowCanvas {
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 5;
    }

    .app-shell {
      width: 100%;
      max-width: 1200px;
      min-height: 620px;
      background: radial-gradient(circle at top, rgba(15,23,42,0.96), rgba(15,23,42,0.99));
      border-radius: 32px;
      box-shadow: var(--shadow-soft);
      overflow: hidden;
      display: grid;
      grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
      border: 1px solid rgba(148, 163, 184, 0.3);
      backdrop-filter: blur(20px);
      position: relative;
      margin: 16px 0;

    }

    /* Glow exterior */
    .app-shell::before {
      content: "";
      position: absolute;
      inset: -2px;
      border-radius: inherit;
      background: conic-gradient(
        from 180deg,
        rgba(56, 189, 248, 0.15),
        rgba(94, 234, 212, 0.3),
        rgba(250, 204, 21, 0.28),
        rgba(56, 189, 248, 0.15)
      );
      opacity: 0.6;
      filter: blur(18px);
      z-index: -1;
      animation: borderGlow 12s linear infinite;
    }

    @keyframes borderGlow {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

    /* Guirnalda de luces navideñas */
    .xmas-lights {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 46px;
      display: flex;
      justify-content: space-around;
      align-items: flex-end;
      padding: 0 40px;
      pointer-events: none;
      z-index: 4;
    }

    .xmas-lights::before {
      content: "";
      position: absolute;
      top: 16px;
      left: 20px;
      right: 20px;
      height: 2px;
      border-radius: 999px;
      background: radial-gradient(circle at center, rgba(148,163,184,0.9), transparent);
      opacity: 0.7;
    }

    .xmas-bulb {
      position: relative;
      width: 16px;
      height: 24px;
      border-radius: 50% 50% 60% 60%;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.9);
      animation: bulbSwing 1.6s ease-in-out infinite alternate;
      transform-origin: top center;
    }

    .xmas-bulb::before {
      content: "";
      position: absolute;
      top: -6px;
      left: 50%;
      transform: translateX(-50%);
      width: 10px;
      height: 6px;
      border-radius: 3px;
      background: #111827;
    }

    /* Colores alternados */
    .xmas-bulb:nth-child(3n+1) {
      background: var(--xmas-red);
      box-shadow: 0 0 14px rgba(239, 68, 68, 0.8);
      animation-delay: 0s;
    }

    .xmas-bulb:nth-child(3n+2) {
      background: var(--xmas-green);
      box-shadow: 0 0 14px rgba(34, 197, 94, 0.8);
      animation-delay: 0.2s;
    }

    .xmas-bulb:nth-child(3n+3) {
      background: var(--xmas-gold);
      box-shadow: 0 0 14px rgba(250, 204, 21, 0.85);
      animation-delay: 0.4s;
    }

    @keyframes bulbSwing {
      0% {
        transform: rotate(-8deg);
        opacity: 0.8;
      }
      100% {
        transform: rotate(8deg);
        opacity: 1;
      }
    }

    /* LEFT: LOGIN */
    .login-pane {
      padding: 48px 28px 28px; /* más espacio arriba para las luces */
      display: flex;
      flex-direction: column;
      gap: 26px;
      background:
        radial-gradient(circle at top, rgba(248,250,252,0.06), transparent 60%),
        radial-gradient(circle at bottom left, rgba(59,130,246,0.16), transparent 55%);
      border-right: 1px solid rgba(55, 65, 81, 0.85);
    }

    .brand {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
    }

    .brand-logo {
      width: 120px;
      height: 120px;
      border-radius: 999px;
      background: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 18px 40px rgba(15, 23, 42, 0.75);
      overflow: hidden;
      transform: translateY(0);
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      border: 3px solid rgba(248, 250, 252, 0.7);
    }

    .brand-logo img {
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
    }

    .brand-logo:hover {
      transform: translateY(-2px) scale(1.03);
      box-shadow: 0 22px 50px rgba(248, 250, 252, 0.9);
    }

    .brand-title {
      font-weight: 600;
      font-size: 18px;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: #e5e7eb;
    }

    .brand-subtitle {
      font-size: 13px;
      color: var(--text-muted);
      text-align: center;
      max-width: 260px;
    }

    .login-title {
      font-size: 19px;
      font-weight: 600;
      margin-bottom: 6px;
    }

    .login-subtitle {
      font-size: 13px;
      color: var(--text-muted);
    }

    .login-form {
      display: flex;
      flex-direction: column;
      gap: 14px;
      margin-top: 6px;
    }

    .form-group {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .form-label {
      font-size: 13px;
      font-weight: 500;
      color: #cbd5f5;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .form-label small {
      font-size: 11px;
      color: var(--text-muted);
    }

    .input-wrapper {
      position: relative;
    }

    .input-icon {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      font-size: 15px;
      color: var(--text-muted);
      pointer-events: none;
    }

    .input {
      width: 100%;
      padding: 10px 12px 10px 34px;
      border-radius: 999px;
      border: 1px solid rgba(148, 163, 184, 0.6);
      outline: none;
      background:
        radial-gradient(circle at top left, rgba(15,23,42,0.96), rgba(15,23,42,0.99));
      color: var(--text-main);
      font-size: 14px;
      transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease,
        transform 0.07s ease;
    }

    .input::placeholder {
      color: rgba(148, 163, 184, 0.7);
    }

    .input:hover {
      border-color: var(--primary-dark);
      box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
    }

    .input:focus {
      border-color: var(--primary-dark);
      box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.55), 0 12px 25px rgba(8, 47, 73, 0.8);
      background: rgba(15, 23, 42, 1);
      transform: translateY(-1px);
    }

    .input.error {
      border-color: var(--danger);
      box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.7);
    }

    .login-actions {
      margin-top: 10px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .btn-primary {
      width: 100%;
      border-radius: 999px;
      border: none;
      padding: 11px 14px;
      background:
        radial-gradient(circle at top left, var(--xmas-red), var(--primary-dark));
      color: #0b1120;
      font-weight: 600;
      font-size: 14px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      text-transform: uppercase;
      letter-spacing: 0.09em;
      box-shadow: 0 18px 36px rgba(8, 47, 73, 0.9);
      transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        filter 0.12s ease;
      position: relative;
      overflow: hidden;
    }

    .btn-primary::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(120deg, transparent 0%, rgba(248, 250, 252, 0.6) 50%, transparent 100%);
      transform: translateX(-120%);
      transition: transform 0.4s ease;
      mix-blend-mode: soft-light;
      pointer-events: none;
    }

    .btn-primary:hover::after {
      transform: translateX(120%);
    }

    .btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 22px 45px rgba(8, 47, 73, 0.96);
      filter: brightness(1.04);
    }

    .btn-primary:active {
      transform: translateY(1px) scale(0.98);
      box-shadow: 0 12px 26px rgba(8, 47, 73, 0.8);
    }

    .btn-primary .pulse-dot {
      width: 8px;
      height: 8px;
      border-radius: 999px;
      background: #0cff00;
      box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.3);
    }

    .login-meta {
      margin-top: 4px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 12px;
      color: var(--text-muted);
    }

    .login-meta a {
      color: var(--accent);
      text-decoration: none;
      font-weight: 500;
    }

    .login-meta a:hover {
      text-decoration: underline;
    }

    .login-footer {
      margin-top: auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 13px;
      color: var(--text-muted);
    }

    .login-footer-icons {
      display: flex;
      gap: 8px;
      font-size: 18px;
    }

    .login-footer-icons span {
      cursor: pointer;
      transition: transform 0.12s ease, text-shadow 0.12s ease;
    }

    .login-footer-icons span:hover {
      transform: translateY(-1px) scale(1.05);
      text-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
    }

    /* RIGHT: CONTENT */
    .content-pane {
      padding: 48px 26px 24px; /* espacio extra arriba por luces */
      display: flex;
      flex-direction: column;
      gap: 16px;
      background:
        radial-gradient(circle at top right, rgba(59,130,246,0.2), transparent 50%),
        radial-gradient(circle at bottom, rgba(15,23,42,0.96), rgba(15,23,42,1));
      position: relative;
    }

    .content-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
    }

    .content-title {
      font-size: 15px;
      font-weight: 500;
      color: #e5e7eb;
    }

    .content-title span {
      color: var(--accent);
      font-weight: 600;
    }

    .content-date {
      font-size: 12px;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .pill {
      padding: 4px 10px;
      border-radius: 999px;
      border: 1px solid rgba(148, 163, 184, 0.4);
      font-size: 11px;
      color: var(--text-muted);
      background: rgba(15, 23, 42, 0.96);
    }

    .pill.ai-pill {
      border-color: rgba(45, 212, 191, 0.7);
      color: #a5f3fc;
      background: radial-gradient(circle at top left, rgba(45, 212, 191, 0.16), rgba(15,23,42,1));
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .pill.ai-pill span {
      font-size: 13px;
    }

    .hero {
      flex: 1;
      display: grid;
      grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
      gap: 16px;
      align-items: stretch;
    }

    /* CARRUSEL FUTURISTA */
    .hero-carousel {
      position: relative;
      border-radius: var(--radius-xl);
      overflow: hidden;
      min-height: 260px;
      border: 1px solid rgba(148, 163, 184, 0.35);
      background: #020617;
      box-shadow: 0 22px 45px rgba(15, 23, 42, 0.9);
      isolation: isolate;
    }

    .hero-slide {
      position: absolute;
      inset: 0;
      background-size: cover;
      background-position: center;
      display: flex;
      align-items: flex-end;
      padding: 18px 20px;
      opacity: 0;
      transform: scale(1.03) translateX(8px);
      transition:
        opacity 0.7s ease,
        transform 0.7s ease;
    }

    .hero-slide::before {
      content: "";
      position: absolute;
      inset: 0;
      background:
        linear-gradient(to top, rgba(0,0,0,0.78), transparent 45%),
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.3), transparent 55%);
      mix-blend-mode: multiply;
      z-index: 0;
    }

    .hero-slide.active {
      opacity: 1;
      transform: scale(1) translateX(0);
      z-index: 1;
    }

    .hero-tag {
      position: absolute;
      top: 14px;
      left: 16px;
      padding: 4px 10px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 500;
      background: rgba(15, 23, 42, 0.88);
      border: 1px solid rgba(248, 250, 252, 0.12);
      display: inline-flex;
      align-items: center;
      gap: 6px;
      color: #e5e7eb;
      z-index: 2;
      backdrop-filter: blur(8px);
    }

    .hero-tag-icon {
      width: 20px;
      height: 20px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      background: radial-gradient(circle at 30% 0%, #bbf7d0, #0cff00);
      color: #052e16;
    }

    .hero-content {
      position: relative;
      z-index: 2;
      max-width: 90%;
    }

    .hero-title {
      font-size: 19px;
      font-weight: 700;
      margin-bottom: 6px;
      text-shadow: 0 14px 32px rgba(0, 0, 0, 1);
    }

    .hero-text {
      font-size: 13px;
      line-height: 1.4;
      color: #f9fafb;
      max-width: 380px;
    }

    .hero-highlight {
      color: var(--accent);
      font-weight: 700;
    }

    .hero-footer {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-top: 12px;
      font-size: 12px;
      color: var(--text-muted);
    }

    .hero-dot {
      width: 6px;
      height: 6px;
      border-radius: 999px;
      background: #0cff00;
      box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
    }

    .carousel-dots {
      position: absolute;
      bottom: 10px;
      right: 16px;
      display: flex;
      gap: 6px;
      z-index: 3;
    }

    .carousel-dot {
      width: 8px;
      height: 8px;
      border-radius: 999px;
      background: rgba(148, 163, 184, 0.7);
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .carousel-dot.active {
      width: 18px;
      background: #facc15;
      box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.3);
    }

    .carousel-ctrl {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      width: 30px;
      height: 30px;
      border-radius: 999px;
      border: 1px solid rgba(148,163,184,0.4);
      background: rgba(15,23,42,0.85);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      color: #e5e7eb;
      cursor: pointer;
      z-index: 3;
      backdrop-filter: blur(10px);
      transition: background 0.15s ease, transform 0.1s ease, opacity 0.2s ease;
      opacity: 0;
    }

    .carousel-ctrl:hover {
      background: rgba(15,23,42,0.98);
      transform: translateY(-50%) scale(1.05);
    }

    .hero-carousel:hover .carousel-ctrl {
      opacity: 1;
    }

    .carousel-ctrl.prev { left: 10px; }
    .carousel-ctrl.next { right: 10px; }

    /* Side cards */
    .hero-side {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .card {
      background: var(--card-bg);
      border-radius: var(--radius-lg);
      border: 1px solid var(--border-soft);
      padding: 14px 16px;
      box-shadow: 0 16px 34px rgba(15, 23, 42, 0.9);
      position: relative;
      overflow: hidden;
      transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
    }

    .card::before {
      content: "";
      position: absolute;
      inset: -40%;
      background: conic-gradient(
        from 220deg,
        rgba(56, 189, 248, 0.12),
        transparent,
        rgba(250, 204, 21, 0.12),
        transparent
      );
      opacity: 0;
      transition: opacity 0.25s ease;
      pointer-events: none;
    }

    .card:hover {
      transform: translateY(-2px);
      box-shadow: 0 20px 40px rgba(15, 23, 42, 1);
      border-color: rgba(56, 189, 248, 0.6);
    }

    .card:hover::before {
      opacity: 1;
    }

    .card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
      gap: 10px;
      position: relative;
      z-index: 1;
    }

    .card-title {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      font-weight: 600;
    }

    .card-badge {
      width: 24px;
      height: 24px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      background: radial-gradient(circle at 30% 0%, #bbf7d0, #0cff00);
      color: #052e16;
    }

    .card-badge.sunat {
      background: radial-gradient(circle at 30% 0%, #e0f2fe, #0ea5e9);
      color: #082f49;
    }

    .card-subtitle {
      font-size: 11px;
      color: var(--text-muted);
    }

    .card-refresh {
      border-radius: 999px;
      padding: 4px 8px;
      border: 1px solid rgba(148, 163, 184, 0.5);
      font-size: 11px;
      color: var(--text-muted);
      display: inline-flex;
      align-items: center;
      gap: 4px;
      cursor: pointer;
      background: rgba(15, 23, 42, 0.9);
      position: relative;
      z-index: 1;
    }

    .card-refresh:hover {
      background: rgba(15, 23, 42, 1);
      color: #e5e7eb;
    }

    .sunat-rates {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-top: 4px;
      position: relative;
      z-index: 1;
    }

    .rate-pill {
      border-radius: 999px;
      padding: 7px 10px;
      background: radial-gradient(circle at top left, rgba(15,23,42,0.96), rgba(15,23,42,1));
      border: 1px solid rgba(148, 163, 184, 0.55);
      font-size: 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .rate-label {
      font-size: 11px;
      color: var(--text-muted);
    }

    .rate-value {
      font-weight: 600;
    }

    .card-body {
      font-size: 12px;
      color: var(--text-muted);
      line-height: 1.4;
      position: relative;
      z-index: 1;
    }

    .bottom-strip {
      margin-top: 4px;
      display: flex;
      justify-content: flex-end;
      gap: 16px;
      font-size: 11px;
      color: var(--text-muted);
      flex-wrap: wrap;
    }

    .bottom-pill {
      padding: 4px 10px;
      border-radius: 999px;
      border: 1px dashed rgba(148, 163, 184, 0.6);
      background: rgba(15,23,42,0.9);
    }

    /* TOASTS / ALERTAS FLOTANTES */
    .toast-container {
      position: fixed;
      top: 16px;
      right: 18px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      z-index: 9999;
      pointer-events: none;
    }

    .toast {
      min-width: 260px;
      max-width: 320px;
      border-radius: 14px;
      padding: 10px 12px;
      display: flex;
      align-items: flex-start;
      gap: 8px;
      font-size: 13px;
      box-shadow: 0 16px 40px rgba(15, 23, 42, 0.9);
      border: 1px solid transparent;
      opacity: 0;
      transform: translateX(20px) translateY(-10px);
      animation: toastIn 0.25s ease forwards;
      pointer-events: auto;
      backdrop-filter: blur(8px);
    }

    .toast.success {
      background: radial-gradient(circle at top left, rgba(22,163,74,0.35), rgba(15,23,42,0.97));
      border-color: rgba(74, 222, 128, 0.8);
      color: #bbf7d0;
    }

    .toast.error {
      background: radial-gradient(circle at top left, rgba(248,113,113,0.35), rgba(15,23,42,0.97));
      border-color: rgba(248, 113, 113, 0.8);
      color: #fee2e2;
    }

    .toast .icon {
      font-size: 16px;
      margin-top: 2px;
    }

    .toast .content {
      flex: 1;
    }

    .toast .title {
      font-weight: 600;
      margin-bottom: 2px;
      font-size: 13px;
    }

    .toast .msg {
      font-size: 12px;
      opacity: 0.9;
    }

    .toast .close-btn {
      border: none;
      background: transparent;
      color: inherit;
      font-size: 14px;
      cursor: pointer;
      padding: 0 0 0 4px;
    }

    @keyframes toastIn {
      to {
        opacity: 1;
        transform: translateX(0) translateY(0);
      }
    }

    @keyframes toastOut {
      to {
        opacity: 0;
        transform: translateX(16px) translateY(-4px);
      }
    }

    /* Responsive */
    @media (max-width: 960px) {
      .app-shell {
        grid-template-columns: minmax(0, 1fr);
        max-width: 720px;
      }

      .login-pane {
        border-right: none;
        border-bottom: 1px solid rgba(55, 65, 81, 0.9);
      }

      .content-pane {
        padding-top: 28px;
      }

      .hero {
        grid-template-columns: minmax(0, 1fr);
      }

      .hero-carousel {
        min-height: 230px;
      }

      .xmas-lights {
        padding: 0 24px;
      }
    }

    /* ============================================
       TABLETS (iPad, Android Tablets)
       ============================================ */
    
    /* Tablets en general (768px - 1024px) */
    @media (min-width: 768px) and (max-width: 1024px) {
      body { 
        padding: 20px;
        margin-top: clamp(8rem, 12vh, 15rem);
      }

      .app-shell {
        max-width: 85%;
        margin: 0 auto;
      }

      .login-pane {
        padding-top: 2.5rem !important;
        padding-bottom: 2rem;
      }

      .brand {
        margin-top: 0.5rem;
        margin-bottom: 2rem;
      }

      .brand-logo {
        width: 140px;
        height: 140px;
        margin-top: 0.5rem;
      }

      .content-pane {
        padding-top: 2.5rem;
      }
    }

    /* Tablets iOS (iPad) específico */
    @media (min-width: 768px) and (max-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) {
      body { 
        margin-top: clamp(10rem, 15vh, 18rem);
      }

      .login-pane {
        padding-top: 3rem !important;
      }

      .brand-logo {
        width: 150px;
        height: 150px;
      }
    }

    /* Tablets en landscape */
    @media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
      body { 
        padding: 16px;
        margin-top: clamp(5rem, 8vh, 10rem);
      }

      .app-shell {
        max-width: 95%;
      }

      .login-pane {
        padding-top: 2rem !important;
      }

      .brand-logo {
        width: 130px;
        height: 130px;
      }
    }

    /* ============================================
       MÓVILES GRANDES (641px - 767px)
       ============================================ */
    
    @media (max-width: 767px) and (min-width: 641px) {
      body { 
        padding: 12px;
        margin-top: clamp(18rem, 28vh, 25rem);
      }

      .app-shell {
        border-radius: 24px;
        min-height: auto;
        margin-top: 0 !important;
        padding-top: 0;
      }

      .login-pane {
        padding-top: 3.5rem !important;
        padding-bottom: 1.5rem;
      }

      .brand {
        margin-top: 0.5rem;
        margin-bottom: 1.5rem;
      }

      .brand-logo {
        width: 130px;
        height: 130px;
        margin-top: 0.75rem;
      }
    }

    /* ============================================
       MÓVILES ESTÁNDAR (481px - 640px)
       ============================================ */
    
    @media (max-width: 640px) {
      body { 
        padding: 10px;
        margin-top: clamp(28rem, 38vh, 38rem);
      }

      .app-shell {
        border-radius: 24px;
        min-height: auto;
        margin-top: 0 !important;
        padding-top: 0;
      }

      .login-pane {
        padding-top: clamp(3.5rem, 8vh, 5rem) !important;
        padding-bottom: 1.5rem;
      }

      .brand {
        margin-top: 0.5rem;
        margin-bottom: 1.5rem;
      }

      .brand-logo {
        margin-top: clamp(0.75rem, 2vh, 1.5rem);
      }

      .login-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
      }

      .toast-container {
        left: 10px;
        right: 10px;
      }

      .toast {
        width: 100%;
        max-width: none;
      }
    }

    /* iOS específico - iPhone */
    @media (max-width: 640px) and (-webkit-min-device-pixel-ratio: 2) {
      body { 
        margin-top: clamp(30rem, 42vh, 40rem);
      }

      .login-pane {
        padding-top: clamp(4rem, 9vh, 5.5rem) !important;
      }

      /* Ajuste para notch de iPhone */
      @supports (padding: max(0px)) {
        .login-pane {
          padding-top: max(4rem, env(safe-area-inset-top)) !important;
        }
      }
    }

    /* Android específico */
    @media (max-width: 640px) and (-webkit-min-device-pixel-ratio: 1.5) {
      body { 
        margin-top: clamp(29rem, 40vh, 39rem);
      }

      .login-pane {
        padding-top: clamp(3.75rem, 8.5vh, 5.25rem) !important;
      }
    }

    /* ============================================
       MÓVILES PEQUEÑOS (361px - 480px)
       ============================================ */
    
    @media (max-width: 480px) {
      body { 
        margin-top: clamp(30rem, 43vh, 40rem);
      }

      .app-shell {
        border-radius: 20px;
      }

      .login-pane {
        padding-top: clamp(4rem, 10vh, 6rem) !important;
      }

      .brand-logo {
        width: clamp(100px, 25vw, 120px);
        height: clamp(100px, 25vw, 120px);
      }
    }

    /* iOS iPhone SE y similares */
    @media (max-width: 480px) and (-webkit-min-device-pixel-ratio: 2) {
      body { 
        margin-top: clamp(32rem, 45vh, 42rem);
      }

      .login-pane {
        padding-top: clamp(4.5rem, 11vh, 6.5rem) !important;
      }
    }

    /* ============================================
       MÓVILES MUY PEQUEÑOS (hasta 360px)
       ============================================ */
    
    @media (max-width: 360px) {
      body { 
        margin-top: clamp(32rem, 48vh, 42rem);
        padding: 8px;
      }

      .app-shell {
        border-radius: 18px;
      }

      .login-pane {
        padding-top: clamp(4.5rem, 12vh, 6.5rem) !important;
        padding-left: 20px;
        padding-right: 20px;
      }

      .brand-logo {
        width: clamp(90px, 22vw, 110px);
        height: clamp(90px, 22vw, 110px);
      }

      .login-title {
        font-size: 17px;
      }

      .login-subtitle {
        font-size: 12px;
      }
    }

    /* ============================================
       ORIENTACIÓN LANDSCAPE EN MÓVILES
       ============================================ */
    
    @media (max-width: 767px) and (orientation: landscape) {
      body { 
        margin-top: clamp(12rem, 20vh, 18rem);
        padding: 8px;
      }

      .app-shell {
        max-height: 95vh;
        overflow-y: auto;
      }

      .login-pane {
        padding-top: 2rem !important;
        padding-bottom: 1rem;
      }

      .brand {
        margin-bottom: 1rem;
      }

      .brand-logo {
        width: 100px;
        height: 100px;
        margin-top: 0.5rem;
      }

      .login-form {
        gap: 10px;
      }

      .form-group {
        gap: 5px;
      }
    }
    
    
/* Botón flotante de música navideña */
  .xmas-music-btn {
    position: fixed;
    bottom: 26px;
    left: 26px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle at top left, #facc15, #ef4444);
    color: #fff;
    font-size: 26px;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    animation: bellWiggle 1.4s infinite ease-in-out;
  }

  .xmas-music-btn:hover {
    transform: scale(1.12);
    filter: brightness(1.1);
  }

  /* Animación de campanita */
  @keyframes bellWiggle {
    0% { transform: rotate(0deg); }
    30% { transform: rotate(-18deg); }
    60% { transform: rotate(14deg); }
    100% { transform: rotate(0deg); }
  }

  /* Cuando está apagada */
  .xmas-music-btn.off {
    animation: none;
    opacity: 0.75;
    filter: grayscale(0.4);
  }
