/* ============================================================
   Arcano — sistema de diseño "Noche de Gala"
   ============================================================ */
:root {
  --bg: #080a12;
  --bg-2: #0e1220;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .075);
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --text: #f6eedd;
  --muted: #a9afc6;
  --faint: #767c98;
  --gold: var(--brand, #ff8a3d);
  --gold-2: #ffc08a;
  --gold-3: #c2551a;
  --ruby: #c0334d;
  --ruby-2: #ee6a82;
  --emerald: #3da5ff;
  --emerald-2: #9fd0ff;
  --amber: #ffb15c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
  --font-display: "Fraunces", "Playfair Display", Georgia, serif;
  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--font-ui); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--gold-2); text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; letter-spacing: -.01em; margin: 0 0 .4em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
::selection { background: var(--gold); color: #1a1205; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .85rem; }
.gold { color: var(--gold-2); }
.grad-text { background: linear-gradient(120deg, var(--gold-2), var(--gold) 45%, #fff 70%, var(--gold)); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 7s linear infinite; }
@keyframes shine { to { background-position: -220% 0; } }
.i { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.2em; }
.i-lg { width: 1.6em; height: 1.6em; }

/* ---------- Fondo animado ---------- */
.bg-fx { position: fixed; inset: 0; z-index: -2; overflow: hidden; background:
  radial-gradient(1200px 700px at 12% -10%, rgba(40, 110, 255, .35), transparent 60%),
  radial-gradient(900px 600px at 105% 10%, rgba(255, 122, 46, .22), transparent 60%),
  radial-gradient(900px 700px at 50% 120%, rgba(255, 138, 61, .12), transparent 60%), var(--bg); }
.bg-fx .blob { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(90px); opacity: .22; animation: drift 28s ease-in-out infinite alternate; }
.bg-fx .b1 { background: #2a6bff; left: -12vmax; top: 10vh; }
.bg-fx .b2 { background: #ff7a2e; right: -14vmax; top: -8vh; animation-duration: 34s; animation-delay: -8s; }
.bg-fx .b3 { background: #3da5ff; left: 30vw; bottom: -26vmax; opacity: .12; animation-duration: 40s; animation-delay: -15s; }
@keyframes drift { to { transform: translate3d(8vw, -6vh, 0) scale(1.18) rotate(30deg); } }
.bg-fx::after { content: ""; position: absolute; inset: 0; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
#snow { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* ---------- Superficies ---------- */
.glass { position: relative; background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.025)); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); box-shadow: var(--shadow); }
.glass.pad { padding: 1.5rem; }
.glass.glow::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(140deg, rgba(255,138,61,.75), transparent 35%, transparent 65%, rgba(61,165,255,.6)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.tilt { transform-style: preserve-3d; transition: transform .35s var(--ease), box-shadow .35s; will-change: transform; }
.spot { position: relative; overflow: hidden; }
.spot::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 138, 61, .14), transparent 55%); }
.spot:hover::after { opacity: 1; }

/* ---------- Botones ---------- */
.btn { --h: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; height: var(--h); padding: 0 1.25rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 600 .92rem var(--font-ui); cursor: pointer; transition: transform .25s var(--ease), background .25s, border-color .25s, box-shadow .25s; position: relative; overflow: hidden; white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: rgba(255,255,255,.3); transform: translateY(-1px); color: #fff; }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { border: 0; color: #231704; background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, var(--gold-3)); box-shadow: 0 10px 30px -10px var(--gold), inset 0 1px 0 rgba(255,255,255,.55); }
.btn-primary:hover { color: #231704; background: linear-gradient(135deg, #fff2c9, var(--gold-2) 50%, var(--gold)); box-shadow: 0 16px 40px -10px var(--gold), inset 0 1px 0 rgba(255,255,255,.7); }
.btn-primary::after { content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-20deg); animation: sweep 4.5s ease-in-out infinite; }
@keyframes sweep { 0%, 55% { left: -80%; } 100% { left: 150%; } }
.btn-ruby { background: linear-gradient(135deg, #e0526b, var(--ruby)); border: 0; color: #fff; box-shadow: 0 10px 30px -12px var(--ruby); }
.btn-danger { color: var(--ruby-2); border-color: rgba(238,106,130,.35); background: rgba(192,51,77,.08); }
.btn-danger:hover { background: rgba(192,51,77,.22); color: #fff; }
.btn-sm { --h: 34px; padding: 0 .9rem; font-size: .82rem; }
.btn-icon { --h: 34px; width: 34px; padding: 0; }
.btn-lg { --h: 54px; padding: 0 2rem; font-size: 1.02rem; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn .spin { display: none; width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: rot .7s linear infinite; }
.btn.loading .spin { display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Formularios ---------- */
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }
.input { width: 100%; padding: .78rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: rgba(0, 0, 0, .28); color: var(--text); font: 500 .95rem var(--font-ui); transition: border-color .2s, box-shadow .2s, background .2s; }
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255, 138, 61, .15); background: rgba(0, 0, 0, .4); }
select.input { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a9afc6' stroke-width='2.4'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.4rem; }
select.input option { background: #10152a; color: var(--text); }
textarea.input { resize: vertical; min-height: 90px; }
input[type="color"].input { padding: .25rem; height: 46px; cursor: pointer; }
input[type="date"].input, input[type="time"].input { color-scheme: dark; }
.errorlist { list-style: none; margin: .35rem 0 0; padding: 0; color: var(--ruby-2); font-size: .82rem; }
.help { color: var(--faint); font-size: .8rem; margin-top: .3rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 1.2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1.2rem; }
.file-input { width: 100%; padding: .7rem; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: rgba(0,0,0,.2); color: var(--muted); font-size: .85rem; cursor: pointer; }
.file-input::file-selector-button { margin-right: .8rem; border: 0; padding: .45rem .9rem; border-radius: 999px; background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer; }
.switch { display: flex; align-items: center; gap: .8rem; cursor: pointer; padding: .55rem 0; text-transform: none !important; letter-spacing: 0 !important; font-size: .95rem !important; color: var(--text) !important; }
.switch-input { appearance: none; width: 44px; height: 26px; flex: none; border-radius: 99px; background: rgba(255,255,255,.12); position: relative; cursor: pointer; transition: background .25s; }
.switch-input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .3s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.switch-input:checked { background: linear-gradient(135deg, var(--gold-2), var(--gold)); }
.switch-input:checked::after { transform: translateX(18px); background: #2a1c05; }

/* ---------- Chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .22rem .7rem; border-radius: 99px; font-size: .76rem; font-weight: 700; letter-spacing: .02em; border: 1px solid var(--line-2); color: var(--muted); background: var(--surface); white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.noDot::before { display: none; }
.chip-new { color: var(--faint); }
.chip-invited { color: #7cc4ff; border-color: rgba(124,196,255,.32); background: rgba(61,165,255,.08); }
.chip-seen { color: var(--amber); border-color: rgba(240,180,91,.3); background: rgba(240,180,91,.08); }
.chip-confirmed, .chip-ok { color: var(--emerald-2); border-color: rgba(159,208,255,.3); background: rgba(61,165,255,.1); }
.chip-declined, .chip-bad { color: var(--ruby-2); border-color: rgba(238,106,130,.3); background: rgba(192,51,77,.1); }
.chip-gold { color: var(--gold-2); border-color: rgba(255,138,61,.35); background: rgba(255,138,61,.1); }

/* ---------- Layout de app (panel) ---------- */
.shell { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 1.4rem 1rem; display: flex; flex-direction: column; gap: .4rem; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.15)); backdrop-filter: blur(20px); }
.brand { display: flex; align-items: center; gap: .8rem; padding: .4rem .6rem 1.2rem; font-family: var(--font-display); font-size: 1.15rem; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #231704; background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 8px 22px -8px var(--gold); overflow: hidden; flex: none; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand small { display: block; font-family: var(--font-ui); font-size: .72rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border-radius: 12px; color: var(--muted); font-weight: 600; transition: all .25s var(--ease); position: relative; }
.nav a:hover { color: var(--text); background: var(--surface); transform: translateX(3px); }
.nav a.active { color: var(--gold-2); background: linear-gradient(90deg, rgba(255,138,61,.16), transparent); }
.nav a.active::before { content: ""; position: absolute; left: -1rem; top: 20%; bottom: 20%; width: 3px; border-radius: 3px; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.sidebar .spacer { flex: 1; }
.userbox { padding: .8rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; gap: .6rem; font-size: .85rem; }
.main { padding: 2.2rem clamp(1rem, 3vw, 3rem) 4rem; min-width: 0; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.page-head p { margin: 0; color: var(--muted); }
.crumb { color: var(--faint); font-size: .85rem; margin-bottom: .5rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.topbar-m { display: none; }
.imp-banner { position: sticky; top: 0; z-index: 50; background: linear-gradient(90deg, var(--ruby), #7c1c2e); text-align: center; padding: .45rem; font-size: .82rem; font-weight: 600; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .3rem; padding: .35rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(0,0,0,.25); width: fit-content; max-width: 100%; overflow-x: auto; margin-bottom: 1.6rem; scrollbar-width: none; }
.tabs a { padding: .55rem 1.1rem; border-radius: 99px; color: var(--muted); font-weight: 600; font-size: .9rem; display: inline-flex; gap: .5rem; align-items: center; white-space: nowrap; transition: all .25s; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: #231704; background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 6px 18px -8px var(--gold); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.stat { padding: 1.2rem 1.3rem; }
.stat .num { font-family: var(--font-display); font-size: 2.5rem; line-height: 1; margin: .35rem 0 .2rem; }
.stat .lbl { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: .5rem; }
.stat .sub { font-size: .82rem; color: var(--faint); }
.bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: .7rem; }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--gold-3), var(--gold), var(--gold-2)); box-shadow: 0 0 14px var(--gold); transition: width 1.4s var(--ease); }
.bar.green > i { background: linear-gradient(90deg, #2a7fc0, var(--emerald), var(--emerald-2)); box-shadow: 0 0 14px var(--emerald); }
.ring { --p: 0; --c: var(--gold); width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255,255,255,.08) 0); position: relative; transition: --p 1.4s; flex: none; }
.ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #0e1220; }
.ring b { position: relative; font-family: var(--font-display); font-size: 1.3rem; }

/* ---------- Tablas ---------- */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
.tbl th { text-align: left; padding: .9rem 1rem; font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: .85rem 1rem; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; }
.tbl tbody tr { transition: background .2s; }
.tbl tbody tr:hover { background: rgba(255,255,255,.035); }
.tbl tr:last-child td { border-bottom: 0; }
.person { display: flex; align-items: center; gap: .8rem; min-width: 190px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #1b1205; background: linear-gradient(135deg, var(--gold-2), var(--gold)); flex: none; }
.avatar.c1 { background: linear-gradient(135deg, #9be6c8, #3da5ff); }
.avatar.c2 { background: linear-gradient(135deg, #ffb2c0, #e0526b); }
.avatar.c3 { background: linear-gradient(135deg, #b9d0ff, #6f95e8); }
.avatar.c4 { background: linear-gradient(135deg, #ffd9a0, #f0a23b); }
.row-actions { display: flex; gap: .4rem; justify-content: flex-end; }

/* ---------- Cards de evento ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1.2rem; }
.ev-card { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; color: var(--text); }
.ev-card:hover { color: var(--text); }
.ev-card h3 { margin: 0; font-size: 1.35rem; }
.ev-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .84rem; color: var(--muted); }
.ev-meta span { display: inline-flex; gap: .4rem; align-items: center; }
.ev-prog { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ev-prog .lbl { font-size: .74rem; color: var(--muted); display: flex; justify-content: space-between; }
.empty { text-align: center; padding: 4rem 1.5rem; }
.empty .art { width: 120px; height: 120px; margin: 0 auto 1.4rem; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, rgba(255,138,61,.2), transparent 70%); font-size: 3.4rem; animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(4deg); } }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 1.25rem 2.4rem; color: var(--faint); font-weight: 600; }
.timeline li::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; background: var(--bg-2); }
.timeline li.done { color: var(--text); }
.timeline li.done .dot { background: linear-gradient(135deg, var(--emerald-2), var(--emerald)); border-color: transparent; color: #04202e; }
.timeline li.done::before { background: var(--emerald); }
.timeline li.now .dot { border-color: var(--gold); box-shadow: 0 0 0 5px rgba(255,138,61,.15); animation: pulse 2s infinite; }
.timeline li.now { color: var(--gold-2); }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(255,138,61,0); } }

/* ---------- Mensajes / toasts ---------- */
.toasts { position: fixed; top: 1.2rem; right: 1.2rem; z-index: 200; display: flex; flex-direction: column; gap: .7rem; width: min(400px, calc(100vw - 2rem)); }
.toast { display: flex; gap: .8rem; align-items: flex-start; padding: .95rem 1.1rem; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(12, 15, 28, .92); backdrop-filter: blur(16px); box-shadow: var(--shadow); animation: toastIn .55s var(--ease) both; position: relative; overflow: hidden; }
.toast.out { animation: toastOut .4s ease forwards; }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; background: currentColor; width: 100%; transform-origin: left; animation: ttl 6s linear forwards; opacity: .7; }
.toast.success { color: var(--emerald-2); } .toast.error { color: var(--ruby-2); } .toast.warning { color: var(--amber); } .toast.info { color: #7cc4ff; }
.toast .tx { color: var(--text); font-size: .9rem; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }
@keyframes ttl { to { transform: scaleX(0); } }

/* ---------- Modal ---------- */
dialog.modal { border: 1px solid var(--line-2); border-radius: 22px; padding: 0; background: rgba(12, 15, 28, .96); color: var(--text); width: min(560px, calc(100vw - 2rem)); box-shadow: 0 50px 120px -20px #000; backdrop-filter: blur(24px); }
dialog.modal::backdrop { background: rgba(3, 4, 12, .72); backdrop-filter: blur(6px); }
dialog.modal[open] { animation: modalIn .45s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.96); } }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 1.3rem 1.5rem 0; }
.modal-h h3 { margin: 0; }
.modal-b { padding: 1.2rem 1.5rem 1.5rem; }

/* ---------- Varios componentes ---------- */
.toolbar { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.2rem; }
.toolbar .grow { flex: 1; }
.search { position: relative; min-width: 240px; }
.search .i { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .input { padding-left: 2.6rem; border-radius: 99px; }
.pills { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill { padding: .4rem .9rem; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-size: .83rem; font-weight: 600; transition: all .2s; }
.pill:hover { border-color: var(--line-2); color: var(--text); }
.pill.active { background: rgba(255,138,61,.14); border-color: rgba(255,138,61,.45); color: var(--gold-2); }
.callout { display: flex; gap: 1rem; padding: 1rem 1.2rem; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); margin-bottom: 1rem; align-items: flex-start; }
.callout.ok { border-color: rgba(159,208,255,.35); background: rgba(61,165,255,.08); color: var(--emerald-2); }
.callout.warn { border-color: rgba(240,180,91,.35); background: rgba(240,180,91,.07); color: var(--amber); }
.callout.err { border-color: rgba(238,106,130,.4); background: rgba(192,51,77,.1); color: var(--ruby-2); }
.callout .tx { color: var(--text); }
.callout b { color: inherit; }
.divider { height: 1px; background: var(--line); margin: 1.4rem 0; border: 0; }
.row { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 1rem; }
.cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.2rem; align-items: start; }
.kbd { font: 600 .75rem ui-monospace, monospace; padding: .15rem .45rem; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); }
.token { font-family: ui-monospace, monospace; font-size: .8rem; color: var(--gold-2); }
.exc-pair { display: inline-flex; align-items: center; gap: .6rem; padding: .35rem .5rem .35rem .9rem; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); margin: 0 .5rem .5rem 0; font-size: .86rem; }
.exc-pair .ban { color: var(--ruby-2); }
.exc-pair form { display: inline; }
.exc-pair button { border: 0; background: none; color: var(--faint); cursor: pointer; padding: .2rem; border-radius: 50%; display: grid; }
.exc-pair button:hover { color: var(--ruby-2); background: rgba(192,51,77,.2); }
.multi { max-height: 220px; overflow: auto; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: rgba(0,0,0,.28); padding: .4rem; }
.multi label { display: flex; align-items: center; gap: .7rem; padding: .45rem .6rem; border-radius: 8px; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--text); font-weight: 500; margin: 0; }
.multi label:hover { background: var(--surface-2); }
.multi input { accent-color: var(--gold); width: 16px; height: 16px; }
.preview-count { display: flex; gap: .6rem; margin-top: .6rem; flex-wrap: wrap; }

/* ---------- Auth / landing ---------- */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: min(440px, 100%); padding: 2.4rem 2.2rem; }
.hero { text-align: center; max-width: 780px; padding: 2rem 1rem; }
.hero .eyebrow, .eyebrow { display: inline-flex; gap: .6rem; align-items: center; padding: .4rem 1rem; border-radius: 99px; border: 1px solid rgba(255,138,61,.35); background: rgba(255,138,61,.08); color: var(--gold-2); font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 1.4rem; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.02; margin-bottom: 1.2rem; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 560px; margin: 0 auto 2rem; }
.logo-big { width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 1.4rem; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; color: #231704; background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 20px 50px -14px var(--gold); overflow: hidden; animation: float 5s ease-in-out infinite; }
.logo-big img { width: 100%; height: 100%; object-fit: cover; }
.ornament { display: flex; align-items: center; gap: 1rem; color: var(--gold); margin: 1.6rem 0; }
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,138,61,.5)); }
.ornament::after { transform: scaleX(-1); }

/* ---------- Participante (público) ---------- */
.pub { max-width: 860px; margin: 0 auto; padding: 2.2rem 1.2rem 5rem; }
.pub-head { text-align: center; margin-bottom: 2rem; }
.stepper { display: flex; justify-content: center; gap: .6rem; margin: 1.4rem 0 2rem; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: .6rem; padding: .5rem 1rem .5rem .5rem; border: 1px solid var(--line); border-radius: 99px; color: var(--faint); font-size: .85rem; font-weight: 600; background: var(--surface); transition: all .4s var(--ease); }
.step b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); font-size: .8rem; }
.step.done { color: var(--emerald-2); border-color: rgba(159,208,255,.3); } .step.done b { background: var(--emerald); color: #04202e; }
.step.now { color: var(--gold-2); border-color: rgba(255,138,61,.5); background: rgba(255,138,61,.1); } .step.now b { background: var(--gold); color: #231704; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.info { padding: .9rem 1.1rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.info .k { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 700; }
.info .v { font-weight: 700; font-size: 1.05rem; margin-top: .15rem; }
.cta-pair { display: grid; grid-template-columns: 2fr 1fr; gap: .8rem; }
.wish-list { display: grid; gap: .8rem; margin: 1rem 0; }
.wish { display: flex; gap: 1rem; padding: .9rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); align-items: center; animation: rise .5s var(--ease) both; }
.wish .thumb { width: 64px; height: 64px; border-radius: 12px; background: rgba(0,0,0,.35); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--faint); cursor: zoom-in; }
.wish .thumb img { width: 100%; height: 100%; object-fit: cover; }
.wish .body { flex: 1; min-width: 0; }
.wish .t { font-weight: 700; }
.wish .n { color: var(--muted); font-size: .86rem; }
.wish a.lnk { font-size: .82rem; display: inline-flex; gap: .3rem; align-items: center; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.prio-1 { color: var(--ruby-2); } .prio-2 { color: var(--amber); } .prio-3 { color: var(--muted); }

/* ---------- Revelación ---------- */
.reveal-stage { min-height: 70vh; display: grid; place-items: center; text-align: center; perspective: 1200px; }
.gift3d { width: 190px; height: 190px; position: relative; margin: 0 auto 2rem; cursor: pointer; transform-style: preserve-3d; animation: giftBob 3s ease-in-out infinite; filter: drop-shadow(0 30px 40px rgba(0,0,0,.6)); }
@keyframes giftBob { 50% { transform: translateY(-14px) rotateY(8deg); } }
.gift3d .base { position: absolute; left: 10px; right: 10px; bottom: 0; height: 120px; border-radius: 10px; background: linear-gradient(135deg, #d63d58, #8d1a2f); box-shadow: inset 0 -20px 30px rgba(0,0,0,.35); }
.gift3d .base::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 34px; transform: translateX(-50%); background: linear-gradient(90deg, #c79b3d, var(--gold-2), #c79b3d); }
.gift3d .lid { position: absolute; left: 0; right: 0; bottom: 110px; height: 52px; border-radius: 10px; background: linear-gradient(135deg, #e8556f, #a92440); transform-origin: left bottom; transition: transform 1s var(--ease), opacity .8s; box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.gift3d .lid::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 34px; transform: translateX(-50%); background: linear-gradient(90deg, #c79b3d, var(--gold-2), #c79b3d); }
.gift3d .bow { position: absolute; left: 50%; bottom: 158px; width: 90px; height: 50px; transform: translateX(-50%); transition: transform 1s var(--ease), opacity .8s; }
.gift3d .bow::before, .gift3d .bow::after { content: ""; position: absolute; top: 0; width: 44px; height: 44px; border: 9px solid var(--gold-2); border-radius: 50% 50% 0 50%; }
.gift3d .bow::before { left: 0; transform: rotate(-8deg); } .gift3d .bow::after { right: 0; transform: scaleX(-1) rotate(-8deg); }
.gift3d.open { animation: none; }
.gift3d.open .lid { transform: translate(40px, -150px) rotate(38deg); opacity: 0; }
.gift3d.open .bow { transform: translate(-50%, -170px) rotate(-30deg); opacity: 0; }
.gift3d.open .base { animation: shake .5s; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.glow-burst { position: absolute; left: 50%; top: 40%; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 140px 100px rgba(246,223,164,.5); opacity: 0; pointer-events: none; }
.glow-burst.go { animation: burst 1.6s ease-out; }
@keyframes burst { 0% { opacity: 0; transform: scale(.2); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(5); } }
.giftee-card { opacity: 0; transform: translateY(40px) scale(.9); transition: all 1.1s var(--ease); max-width: 640px; margin: 0 auto; }
.giftee-card.show { opacity: 1; transform: none; }
.giftee-name { font-family: var(--font-display); font-size: clamp(2.6rem, 9vw, 5.4rem); line-height: 1; margin: .2rem 0 1rem; }
.giftee-name .ch { display: inline-block; opacity: 0; transform: translateY(40px) rotateX(-90deg); animation: chIn .8s var(--ease) forwards; }
@keyframes chIn { to { opacity: 1; transform: none; } }

/* ---------- Animación del sorteo (admin) ---------- */
.draw-overlay { position: fixed; inset: 0; z-index: 300; display: none; place-items: center; background: rgba(4, 6, 12, .92); backdrop-filter: blur(14px); text-align: center; }
.draw-overlay.on { display: grid; animation: fade .4s; }
@keyframes fade { from { opacity: 0; } }
.slot { font-family: var(--font-display); font-size: clamp(2rem, 6vw, 4rem); height: 1.3em; overflow: hidden; margin: 1rem 0; color: var(--gold-2); text-shadow: 0 0 30px rgba(255,138,61,.5); }
.slot span { display: block; animation: slotIn .12s linear; }
@keyframes slotIn { from { transform: translateY(-60%); opacity: .2; filter: blur(4px); } }
.orbit { width: 180px; height: 180px; margin: 0 auto; position: relative; }
.orbit i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--gold); animation: rot 1.2s linear infinite; }
.orbit i:nth-child(2) { inset: 18px; border-top-color: var(--ruby-2); animation-duration: 1.8s; animation-direction: reverse; }
.orbit i:nth-child(3) { inset: 36px; border-top-color: var(--emerald-2); animation-duration: 2.4s; }
.orbit em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 3rem; }
canvas#confetti { position: fixed; inset: 0; z-index: 400; pointer-events: none; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; height: 380px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; padding: .5rem .2rem; scroll-behavior: smooth; }
.bubble { max-width: 80%; padding: .6rem .9rem; border-radius: 16px; font-size: .92rem; animation: rise .35s var(--ease); word-wrap: break-word; }
.bubble.me { align-self: flex-end; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #231704; border-bottom-right-radius: 4px; }
.bubble.them { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble time { display: block; font-size: .68rem; opacity: .6; margin-top: .15rem; }
.chat-form { display: flex; gap: .6rem; padding-top: .8rem; }
.chat-empty { margin: auto; text-align: center; color: var(--faint); }

/* ---------- Entrada scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0ms); }
[data-reveal].in { opacity: 1; transform: none; }

.lightbox { position: fixed; inset: 0; z-index: 250; background: rgba(3,4,12,.9); display: none; place-items: center; cursor: zoom-out; }
.lightbox.on { display: grid; animation: fade .3s; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 14px; box-shadow: var(--shadow); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 120; left: 0; top: 0; width: 280px; transform: translateX(-102%); transition: transform .4s var(--ease); background: rgba(8, 10, 20, .97); }
  .sidebar.open { transform: none; }
  .topbar-m { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 90; background: rgba(8,10,18,.85); backdrop-filter: blur(14px); }
  .cols, .grid-2, .grid-3, .cta-pair { grid-template-columns: 1fr; }
  .main { padding-top: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
#drop-zone { display: grid; place-items: center; gap: .4rem; padding: 1.4rem; text-align: center; border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); cursor: pointer; color: var(--muted); transition: all .25s; position: relative; }
#drop-zone:hover, #drop-zone.over { border-color: var(--gold); background: rgba(255,138,61,.07); color: var(--gold-2); }
#drop-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.giftee-name .ch { color: var(--gold-2); text-shadow: 0 0 40px rgba(255,138,61,.55), 0 4px 0 rgba(0,0,0,.25); }

/* ============ RESPONSIVE ============ */
.main, .pub { padding-left: max(clamp(1rem, 3vw, 3rem), env(safe-area-inset-left)); padding-right: max(clamp(1rem, 3vw, 3rem), env(safe-area-inset-right)); }
img, canvas, video { max-width: 100%; }
.center-screen, .reveal-stage { min-height: 100dvh; }
.reveal-stage { min-height: 70dvh; }
@media (max-width: 1200px) { .cols { grid-template-columns: 1fr !important; } }
@media (max-width: 960px) {
  .cols, .grid-2, .grid-3, .cta-pair { grid-template-columns: 1fr !important; }
  .page-head { align-items: flex-start; }
  .search { min-width: 0; flex: 1 1 100%; }
  .toolbar > form:not(.search), .toolbar .grow { flex: none; }
  .toolbar .grow { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .main { padding-top: 1rem; padding-bottom: 3rem; }
  .page-head { margin-bottom: 1.2rem; }
  .page-head > .btn, .page-head .row > .btn { width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .stat { padding: 1rem; } .stat .num { font-size: 2rem; }
  .glass.pad, .ev-card { padding: 1.1rem; }
  .cards { grid-template-columns: 1fr; }
  .ev-prog { grid-template-columns: 1fr; }
  .btn-lg { --h: 50px; padding: 0 1.4rem; }
  .row > .btn-lg, .cta-pair .btn { width: 100%; }
  .toasts { top: .6rem; right: .6rem; left: .6rem; width: auto; }
  .auth-card { padding: 1.8rem 1.3rem; }
  .hero h1 { font-size: clamp(2.2rem, 11vw, 3rem); }
  .pub { padding-top: 1.2rem; }
  .stepper { gap: .4rem; } .step { font-size: .78rem; padding: .4rem .8rem .4rem .4rem; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .wish { flex-wrap: wrap; } .wish .thumb { width: 54px; height: 54px; }
  .gift3d { transform: scale(.88); }
  .chat { height: 340px; } .bubble { max-width: 90%; }
  .tabs { width: 100%; border-radius: 16px; }
  .tabs a { padding: .55rem .9rem; }
  dialog.modal { width: calc(100vw - 1.2rem); border-radius: 18px; }
  .modal-b, .modal-h { padding-left: 1.1rem; padding-right: 1.1rem; }
  .exc-pair { max-width: 100%; flex-wrap: wrap; }
  .row-actions { justify-content: flex-start; }
  /* Tablas -> tarjetas */
  .tbl-wrap { overflow: visible; }
  table.tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tbody tr { margin: 0 .7rem .7rem; width: auto; padding: .8rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.03); }
  .tbl td { padding: .35rem 0; border: 0; display: flex; justify-content: space-between; align-items: center; gap: .8rem; text-align: right; }
  .tbl td[data-label]::before { content: attr(data-label); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); text-align: left; }
  .tbl td:first-child { justify-content: flex-start; text-align: left; padding-bottom: .6rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
  .tbl td:last-child { padding-top: .6rem; }
  .person { min-width: 0; }
  .tbl td .row-actions { width: 100%; justify-content: flex-end; }
}
@media (max-width: 400px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .brand { font-size: 1rem; }
}
@media (hover: none) and (pointer: coarse) {
  .btn-icon, .btn-sm { --h: 42px; }
  .btn-icon { width: 42px; }
  .nav a { padding: .85rem .9rem; }
}
/* iOS: evita el zoom al enfocar inputs */
@media (max-width: 960px) { .input, select.input, textarea.input { font-size: 16px; } }

/* El atributo hidden debe ganarle a display de .btn y similares */
[hidden] { display: none !important; }

/* --- Actualización parcial, confirmaciones y validación con el estilo del sistema --- */
.region { display: contents; }
[data-region] { transition: opacity .15s; }
[data-region].is-loading:not(.region) { opacity: .45; pointer-events: none; }
dialog.confirm { width: min(440px, calc(100vw - 2rem)); }
.confirm-msg { margin: 0 0 1.4rem; color: var(--text); font-size: 1rem; line-height: 1.55; }
.confirm-actions { display: flex; justify-content: flex-end; gap: .7rem; flex-wrap: wrap; }
.input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--ruby-2) !important; box-shadow: 0 0 0 3px rgba(238, 106, 130, .22); }
.multi label.dim { opacity: .4; cursor: not-allowed; }
