*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    :root {
      --bg:          #050507;
      --surface:     #0d0d10;
      --surface2:    #13131a;
      --border:      rgba(255,255,255,0.07);
      --border2:     rgba(255,255,255,0.13);
      --violet:      #8B2BE2;
      --violet-dim:  rgba(139,43,226,0.18);
      --violet-glow: rgba(139,43,226,0.40);
      --cyan:        #00D4FF;
      --cyan-dim:    rgba(0,212,255,0.12);
      --text:        #f0f0f4;
      --text-muted:  rgba(255,255,255,0.45);
      --green:       #22c55e;
      --amber:       #f59e0b;
      --red:         #ef4444;
    }
    body { background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif; min-height: 100vh; }
    body::before {
      content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
      background: repeating-linear-gradient(-45deg, transparent, transparent 40px,
        rgba(139,43,226,0.018) 40px, rgba(139,43,226,0.018) 41px);
    }

    /* ─── AUTH ─────────────────────────────────────────────────────── */
    .auth-wrap {
      min-height: 100vh; display: flex; align-items: center; justify-content: center;
      padding: 20px; position: relative; z-index: 1;
    }
    .auth-card {
      background: var(--surface); border: 1px solid var(--border2);
      border-radius: 24px; padding: 40px; width: 100%; max-width: 420px;
    }
    .auth-logo { text-align: center; margin-bottom: 28px; }
    .auth-logo-inner { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
    .auth-logo svg { height: 28px; width: auto; }
    .auth-logo-text {
      font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800;
      background: linear-gradient(135deg, var(--violet), var(--cyan));
      -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    }
    .auth-title {
      font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800;
      margin-bottom: 6px; text-align: center;
    }
    .auth-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; text-align: center; line-height: 1.6; }
    .auth-back {
      display: inline-flex; align-items: center; gap: 6px; margin-bottom: 20px;
      font-size: 13px; color: var(--text-muted); cursor: pointer; background: none;
      border: none; font-family: 'Inter', sans-serif; padding: 0; transition: color .15s;
    }
    .auth-back:hover { color: var(--text); }

    .float-group { position: relative; margin-bottom: 16px; }
    .float-label {
      position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
      font-size: 13px; color: var(--text-muted); pointer-events: none;
      transition: all .18s; background: transparent;
    }
    .float-group input:focus ~ .float-label,
    .float-group input:not(:placeholder-shown) ~ .float-label {
      top: -9px; font-size: 11px; background: var(--surface);
      padding: 0 4px; color: var(--violet); transform: none;
    }
    .form-input {
      width: 100%; padding: 13px 14px;
      background: var(--surface2); border: 1px solid var(--border2);
      border-radius: 10px; color: var(--text);
      font-family: 'Inter', sans-serif; font-size: 14px; outline: none;
      transition: border-color .18s, box-shadow .18s;
    }
    .form-input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-dim); }
    .form-input::placeholder { color: transparent; }
    .form-input.show-placeholder::placeholder { color: var(--text-muted); }
    .form-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }

    .btn-primary {
      width: 100%; height: 52px; border-radius: 13px; border: none; cursor: pointer;
      background: linear-gradient(90deg, var(--violet), var(--cyan), var(--violet));
      background-size: 200% auto;
      color: #fff; font-family: 'Syne', sans-serif;
      font-size: 16px; font-weight: 800;
      box-shadow: 0 0 24px var(--violet-glow);
      animation: shimmer 3s linear infinite;
      transition: transform .2s, box-shadow .2s, opacity .2s;
      margin-top: 8px;
    }
    .btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 38px var(--violet-glow); }
    .btn-primary:disabled { opacity: .5; cursor: not-allowed; animation: none; transform: none; }
    @keyframes shimmer { 0%{background-position:0% center} 100%{background-position:200% center} }

    .auth-err {
      font-size: 13px; color: var(--red); margin-top: 12px;
      text-align: center; min-height: 18px; line-height: 1.5;
    }
    .resend-link {
      text-align: center; margin-top: 14px; font-size: 12px; color: var(--text-muted);
    }
    .resend-link button {
      background: none; border: none; color: var(--violet); cursor: pointer;
      font-family: 'Inter', sans-serif; font-size: 12px; text-decoration: underline;
      padding: 0;
    }
    .code-input {
      font-family: 'Space Mono', monospace; font-size: 22px; font-weight: 700;
      letter-spacing: .2em; text-align: center; text-transform: uppercase;
    }
    .sent-badge {
      display: flex; align-items: center; gap: 8px; padding: 10px 14px;
      background: var(--violet-dim); border: 1px solid rgba(139,43,226,0.3);
      border-radius: 10px; margin-bottom: 20px; font-size: 12px; color: #c084fc;
      line-height: 1.5;
    }

    /* ─── DASHBOARD NAV ─────────────────────────────────────────────── */
    .dash-nav {
      position: fixed; top: 0; left: 0; right: 0; z-index: 100;
      display: flex; align-items: center; justify-content: space-between;
      padding: 14px 28px;
      background: rgba(5,5,7,0.85); backdrop-filter: blur(16px);
      border-bottom: 1px solid var(--border2);
      gap: 12px;
    }
    .dash-nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
    .dash-nav-logo svg { height: 22px; width: auto; }
    .dash-nav-logo-text {
      font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 800;
      background: linear-gradient(135deg, var(--violet), var(--cyan));
      -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    }
    .dash-nav-event {
      font-size: 13px; color: var(--text-muted); overflow: hidden;
      text-overflow: ellipsis; white-space: nowrap; flex: 1;
      text-align: center; display: none;
    }
    .dash-nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
    .btn-icon {
      background: var(--surface); border: 1px solid var(--border2);
      color: var(--text-muted); border-radius: 8px; padding: 7px 12px;
      font-size: 12px; font-family: 'Inter', sans-serif; cursor: pointer;
      transition: all .15s; display: flex; align-items: center; gap: 6px;
    }
    .btn-icon:hover { border-color: var(--violet); color: var(--text); }

    /* ─── RECOMMENDATION BANNER ─────────────────────────────────────── */
    .rec-banner {
      background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3);
      border-radius: 12px; padding: 12px 16px; margin-bottom: 20px;
      display: flex; align-items: center; justify-content: space-between;
      gap: 12px; flex-wrap: wrap;
    }
    .rec-banner-text { font-size: 13px; color: var(--amber); line-height: 1.5; }
    .btn-rec {
      background: rgba(245,158,11,0.18); border: 1px solid rgba(245,158,11,0.4);
      color: var(--amber); border-radius: 8px; padding: 6px 14px;
      font-size: 12px; font-family: 'Inter', sans-serif; font-weight: 600;
      cursor: pointer; white-space: nowrap; transition: all .15s; flex-shrink: 0;
    }
    .btn-rec:hover { background: rgba(245,158,11,0.28); }

    /* ─── DASHBOARD MAIN ────────────────────────────────────────────── */
    .dash-main {
      max-width: 960px; margin: 0 auto; padding: 88px 20px 60px;
      position: relative; z-index: 1;
    }

    /* Estado badge grande */
    .estado-hero { text-align: center; margin-bottom: 36px; }
    .estado-badge {
      display: inline-flex; align-items: center; gap: 8px;
      padding: 8px 20px; border-radius: 30px;
      font-family: 'Space Mono', monospace; font-size: 12px; font-weight: 700;
      letter-spacing: .1em; text-transform: uppercase; margin-bottom: 16px;
    }
    .estado-badge.pronto  { background: var(--cyan-dim); border: 1px solid rgba(0,212,255,0.35); color: var(--cyan); }
    .estado-badge.abierto { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.35); color: var(--green); }
    .estado-badge.descarga{ background: var(--violet-dim); border: 1px solid rgba(139,43,226,0.35); color: #c084fc; }
    .estado-badge.expirado{ background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }
    .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
    .dot.pulse { animation: pulse 1.8s ease-in-out infinite; }
    @keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.7)} }

    .estado-nombre {
      font-family: 'Syne', sans-serif; font-size: clamp(22px, 4vw, 34px);
      font-weight: 800; margin-bottom: 6px;
    }
    .estado-msg { font-size: 14px; color: var(--text-muted); }

    /* Info cards */
    .info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
    .info-card {
      background: var(--surface); border: 1px solid var(--border2);
      border-radius: 16px; padding: 18px 20px;
    }
    .info-card-label {
      font-size: 10px; text-transform: uppercase; letter-spacing: .12em;
      color: var(--text-muted); margin-bottom: 6px;
    }
    .info-card-value { font-size: 15px; font-weight: 600; line-height: 1.4; }
    .info-card-value.mono { font-family: 'Space Mono', monospace; font-size: 14px; }

    /* Link invitados */
    .invitados-card {
      background: var(--surface); border: 1px solid var(--border2);
      border-radius: 16px; padding: 20px 22px; margin-bottom: 24px;
    }
    .invitados-card-title {
      font-size: 11px; text-transform: uppercase; letter-spacing: .12em;
      color: var(--text-muted); margin-bottom: 12px;
    }
    .accesos-section-label {
      font-size: 11px; text-transform: uppercase; letter-spacing: .10em;
      color: var(--text-muted); margin-bottom: 8px;
    }
    .accesos-tiempos-row {
      display: flex; gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
    }
    .accesos-tiempo-label {
      font-size: 11px; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px;
    }
    .accesos-tiempo-input-wrap {
      display: flex; align-items: center; gap: 5px;
    }
    .accesos-tiempo-input-wrap input {
      width: 60px; padding: 5px 8px; border-radius: 7px;
      border: 1px solid var(--border2); background: var(--surface2);
      color: var(--text); font-family: 'Space Mono', monospace; font-size: 13px;
      text-align: center;
    }
    .accesos-tiempo-input-wrap input:focus { outline: none; border-color: var(--cyan); }
    .accesos-tiempo-input-wrap span { font-size: 11px; color: var(--text-muted); }
    .accesos-btn-row {
      display: flex; gap: 8px; flex-wrap: wrap;
    }
    .btn-acceso {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 8px 14px; border-radius: 9px;
      font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
      cursor: pointer; transition: all .15s; white-space: nowrap;
      border: 1px solid rgba(139,43,226,0.5); background: var(--violet-dim); color: #c084fc;
    }
    .btn-acceso:hover { background: rgba(139,43,226,0.3); }
    .btn-acceso.btn-acceso-outline {
      background: transparent; border-color: var(--border2); color: var(--text-muted);
    }
    .btn-acceso.btn-acceso-outline:hover { border-color: var(--cyan); color: var(--cyan); }

    .btn-copy {
      padding: 7px 14px; border-radius: 8px; border: 1px solid rgba(139,43,226,0.4);
      background: var(--violet-dim); color: #c084fc;
      font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
      cursor: pointer; flex-shrink: 0; white-space: nowrap; transition: all .15s;
    }
    .btn-copy:hover { background: rgba(139,43,226,0.3); }
    .btn-qr {
      padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border2);
      background: transparent; color: var(--text-muted);
      font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
      cursor: pointer; flex-shrink: 0; white-space: nowrap; transition: all .15s;
      display: flex; align-items: center; gap: 6px;
    }
    .btn-qr:hover { border-color: var(--cyan); color: var(--cyan); }

    /* Galería */
    .galeria-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
    }
    .galeria-title {
      font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800;
    }
    .galeria-count { font-size: 12px; color: var(--text-muted); font-family: 'Space Mono', monospace; }

    .galeria-grid {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      gap: 12px;
    }
    .galeria-foto {
      aspect-ratio: 1; border-radius: 12px; overflow: hidden;
      border: 1px solid var(--border2); cursor: pointer; position: relative;
      background: var(--surface2);
    }
    .galeria-foto img {
      width: 100%; height: 100%; object-fit: cover; display: block;
      transition: transform .3s; will-change: transform;
    }
    .galeria-foto:hover img { transform: scale(1.05); }
    .galeria-foto-overlay {
      position: absolute; bottom: 0; left: 0; right: 0;
      background: linear-gradient(transparent, rgba(0,0,0,.7));
      padding: 28px 10px 8px; font-size: 11px; color: rgba(255,255,255,.7);
      opacity: 0; transition: opacity .2s;
    }
    .galeria-foto:hover .galeria-foto-overlay { opacity: 1; }
    .galeria-texto {
      border-radius: 12px; overflow: hidden;
      border: 1px solid var(--border2); padding: 16px;
      background: var(--surface); position: relative;
    }
    .galeria-texto-msg {
      font-size: 14px; line-height: 1.6; margin-bottom: 10px;
      color: var(--text); word-break: break-word;
    }
    .galeria-texto-autor {
      font-size: 11px; color: var(--text-muted);
      font-family: 'Space Mono', monospace;
    }
    .galeria-item-del {
      position: absolute; top: 8px; right: 8px;
      background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3);
      color: var(--red); border-radius: 6px; width: 26px; height: 26px;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; font-size: 13px; opacity: 0; transition: opacity .15s;
    }
    .galeria-foto:hover .galeria-item-del,
    .galeria-texto:hover .galeria-item-del { opacity: 1; }

    .galeria-empty {
      grid-column: 1/-1; text-align: center; padding: 60px 20px;
      color: var(--text-muted); font-size: 14px;
    }
    .galeria-empty-icon { font-size: 40px; margin-bottom: 12px; }

    /* Spinner */
    .spinner {
      display: inline-block; width: 28px; height: 28px;
      border: 2px solid rgba(139,43,226,0.2);
      border-top-color: var(--violet); border-right-color: var(--cyan);
      border-radius: 50%; animation: spin .7s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    .loading-wrap { text-align: center; padding: 80px 20px; }

    /* ─── MODAL ─────────────────────────────────────────────────────── */
    .modal-overlay {
      position: fixed; inset: 0; z-index: 500;
      background: rgba(0,0,0,.75); backdrop-filter: blur(6px);
      display: none; align-items: center; justify-content: center; padding: 20px;
    }
    .modal-overlay.open { display: flex; }
    .modal-box {
      background: var(--surface); border: 1px solid var(--border2);
      border-radius: 20px; padding: 32px; width: 100%; max-width: 400px;
      position: relative;
    }
    .modal-title {
      font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800;
      margin-bottom: 6px;
    }
    .modal-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 22px; line-height: 1.5; }
    .modal-close {
      position: absolute; top: 16px; right: 16px;
      background: none; border: none; color: var(--text-muted);
      font-size: 18px; cursor: pointer; line-height: 1; padding: 4px;
    }
    .modal-close:hover { color: var(--text); }
    .modal-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 6px; }
    .modal-footer { display: flex; gap: 10px; margin-top: 20px; }
    .btn-secondary {
      flex: 1; height: 46px; border-radius: 10px; border: 1px solid var(--border2);
      background: transparent; color: var(--text-muted);
      font-family: 'Inter', sans-serif; font-size: 14px; cursor: pointer; transition: all .15s;
    }
    .btn-secondary:hover { border-color: var(--violet); color: var(--text); }
    .btn-save {
      flex: 1; height: 46px; border-radius: 10px; border: none;
      background: linear-gradient(90deg, var(--violet), var(--cyan));
      color: #fff; font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 800;
      cursor: pointer; transition: opacity .15s;
    }
    .btn-save:hover:not(:disabled) { opacity: .88; }
    .btn-save:disabled { opacity: .45; cursor: not-allowed; }

    /* Lightbox */
    .lightbox {
      position: fixed; inset: 0; z-index: 600;
      background: rgba(0,0,0,.92); display: none;
      align-items: center; justify-content: center; padding: 20px;
    }
    .lightbox.open { display: flex; }
    .lightbox img { max-width: 100%; max-height: 90vh; border-radius: 10px; object-fit: contain; }
    .lightbox-close {
      position: fixed; top: 20px; right: 20px;
      background: rgba(255,255,255,.12); border: none; color: #fff;
      font-size: 24px; border-radius: 50%; width: 44px; height: 44px;
      cursor: pointer; display: flex; align-items: center; justify-content: center;
    }

    /* Toast */
    .toast {
      position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
      background: rgba(13,13,16,0.92); backdrop-filter: blur(16px);
      border: 1px solid var(--border); padding: 12px 26px; border-radius: 28px;
      font-size: 13px; font-family: 'Space Mono', monospace;
      box-shadow: 0 12px 40px rgba(0,0,0,.6); z-index: 9999;
      transition: opacity .3s; opacity: 0; pointer-events: none; white-space: nowrap;
    }
    .toast.show { opacity: 1; }
    .toast.success { border-color: rgba(34,197,94,.45); color: var(--green); }
    .toast.error   { border-color: rgba(239,68,68,.45);  color: var(--red); }

    @media (max-width: 640px) {
      .info-grid { grid-template-columns: 1fr 1fr; }
      .auth-card { padding: 28px 20px; }
      .dash-nav { padding: 12px 16px; }
      .galeria-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
      .dash-main { padding-top: 76px; }
    }
    @media (min-width: 640px) {
      .dash-nav-event { display: block; }
    }
