/* =================================================================
   Sistema de Rifas — hoja de estilos
   Identidad: papel + tinta marina + esmeralda (confianza) + oro (premio).
   Tipografía: Space Grotesk para cifras/títulos, Inter para interfaz.
   ================================================================= */

:root {
  --paper:      #f7f7f4;
  --surface:    #ffffff;
  --surface-2:  #fbfbf9;
  --ink:        #14203a;
  --ink-soft:   #33415c;
  --muted:      #6b7280;
  --line:       #e3e6e2;
  --line-soft:  #eef0ec;

  --emerald:    #0f7a5f;
  --emerald-d:  #0b5f49;
  --emerald-t:  #e7f2ee;

  --gold:       #b8860b;
  --gold-2:     #d8a92a;
  --gold-soft:  #f4e6bd;

  --clay:       #b23b34;
  --clay-t:     #f7e9e8;

  --radius:     14px;
  --radius-sm:  9px;
  --shadow:     0 1px 2px rgba(20,32,58,.06), 0 8px 24px -12px rgba(20,32,58,.18);
  --shadow-lg:  0 24px 60px -24px rgba(20,32,58,.45);

  --font-num: "Space Grotesk", ui-monospace, "SF Mono", monospace;
  --font-ui:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--emerald-d); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }

.wrap { width: min(1120px, 92vw); margin-inline: auto; }
.stack > * + * { margin-top: 1rem; }

/* ---------- Encabezado ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(15,22,44,.92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #fff; border-bottom: 2px solid var(--gold);
}
.header-inner {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 1rem; padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; color:#fff; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: var(--ink); display: grid; place-items: center;
  font-family: var(--font-num); font-weight: 700; font-size: 19px; overflow:hidden; flex:0 0 auto;
}
.brand .mark.mark-img { width:54px; height:54px; background: transparent; border-radius:0; overflow:visible; }
.brand .mark.mark-img img { width:100%; height:100%; object-fit: contain; border-radius: 8px; display:block; }
.brand .name { font-size: 1.05rem; letter-spacing: -.01em; }
.brand .name small { display:block; font-size:.7rem; font-weight:400; color:#aeb9cc; letter-spacing:.02em; }

.header-nav { display:flex; gap: 26px; align-items:center; justify-self: center; }
.header-nav a { color:#dbe2ee; font-weight:600; font-size:.95rem; position:relative; padding:6px 0; }
.header-nav a:hover { color:#fff; text-decoration:none; }
.header-nav a::after { content:""; position:absolute; left:0; right:0; bottom:0; height:2px; background:var(--gold); transform:scaleX(0); transition:transform .15s ease; border-radius:2px; }
.header-nav a:hover::after { transform:scaleX(1); }

.header-actions { display:flex; align-items:center; gap:10px; justify-self: end; }
.nav-burger { display:none; width:42px; height:42px; border:1px solid rgba(255,255,255,.22); background:rgba(255,255,255,.06); border-radius:10px; cursor:pointer; padding:0; }
.nav-burger span { display:block; width:20px; height:2px; background:#fff; border-radius:2px; margin:4px auto; transition:transform .25s ease, opacity .2s ease; }
.nav-burger.is-open span:nth-child(1){ transform:translateY(6px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2){ opacity:0; }
.nav-burger.is-open span:nth-child(3){ transform:translateY(-6px) rotate(-45deg); }

html { scroll-behavior: smooth; }
#inicio, #numeros, #pagos, #contacto { scroll-margin-top: 84px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content:center; gap: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 11px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--emerald); color: #fff;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  text-decoration: none;
}
.btn:hover { background: var(--emerald-d); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 2px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.btn.ghost:hover { background: rgba(255,255,255,.1); }
.btn.outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.outline:hover { background: var(--surface-2); border-color: var(--muted); }
.btn.gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--ink); }
.btn.gold:hover { filter: brightness(1.03); }
.btn.danger { background: var(--clay); }
.btn.danger:hover { background: #922f29; }
.btn.sm { padding: 7px 12px; font-size: .85rem; }
.btn.block { width: 100%; }

/* ---------- Tarjetas / superficies ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
}
.card h2 { font-size: 1.15rem; }

/* ---------- Mensajes flash ---------- */
.flash { display:flex; gap:10px; align-items:flex-start; padding:12px 14px; border-radius: var(--radius-sm); margin-bottom:14px; border:1px solid; font-size:.95rem; }
.flash.ok    { background: var(--emerald-t); border-color: #bfe0d5; color: var(--emerald-d); }
.flash.error { background: var(--clay-t); border-color: #e9c4c1; color: #8f2c26; }
.flash.info  { background: #eef3fb; border-color: #cdddf3; color: #274b7a; }

/* =================================================================
   PORTADA PÚBLICA — Hero de boletería
   ================================================================= */
.hero {
  position: relative; overflow: hidden; color: #fff; padding: 56px 0 50px;
  background:
    radial-gradient(1100px 520px at 88% -12%, rgba(216,169,42,.20), transparent 60%),
    radial-gradient(820px 460px at -8% 118%, rgba(15,122,95,.18), transparent 55%),
    linear-gradient(155deg, #142138 0%, #0f1830 55%, #0b1122 100%);
}
.hero::before {
  content:""; position:absolute; inset:0; pointer-events:none; opacity:.05;
  background-image: repeating-linear-gradient(45deg, #fff 0 1px, transparent 1px 24px);
}
.hero .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; }
.eyebrow { color: var(--gold-2); font-family: var(--font-num); font-weight: 600; font-size: .92rem; letter-spacing:.04em; text-transform:uppercase; }
.hero h1 { font-family: var(--font-num); font-weight: 700; font-size: clamp(2.1rem, 5.2vw, 3.6rem); line-height:1.05; margin-top: 10px; }
.hero .lede { color: #d3dbe8; max-width: 52ch; font-size: 1.08rem; line-height:1.6; }
.hero .prize {
  margin-top: 22px; background: rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.14);
  border-radius: var(--radius); padding: 18px 20px;
}
.hero .prize .k { color: var(--gold-2); font-size:.78rem; font-weight:600; letter-spacing:.06em; text-transform:uppercase; }
.hero .prize .v { font-family: var(--font-num); font-size: 1.5rem; font-weight: 700; color:#fff; }

/* Columna derecha: imagen del producto + ficha */
.hero-media { display:flex; flex-direction:column; gap:18px; }
.hero-photo {
  margin:0; border-radius:18px; overflow:hidden;
  border:2px solid rgba(216,169,42,.55);
  box-shadow: 0 24px 60px -26px rgba(0,0,0,.6);
  background: rgba(255,255,255,.04);
}
.hero-photo img { display:block; width:100%; max-height:320px; object-fit:cover; }

/* Ficha "boleta" del hero (lado derecho) */
.stub {
  background: var(--surface); color: var(--ink); border-radius: 18px; padding: 24px;
  box-shadow: var(--shadow-lg); position: relative;
}
.stub.premium {
  border: 2px solid var(--gold);
  box-shadow: 0 24px 60px -24px rgba(0,0,0,.55), 0 0 0 5px rgba(216,169,42,.16);
}
.stub::before, .stub::after {
  content:""; position:absolute; width:26px; height:26px; border-radius:50%;
  background: var(--ink); top: 50%; transform: translateY(-50%);
}
.stub::before { left: -13px; }
.stub::after  { right: -13px; }
.stub .row { display:flex; justify-content:space-between; align-items:baseline; gap:14px; padding:11px 0; border-bottom:1px dashed var(--line); }
.stub .row:last-child { border-bottom:0; }
.stub .row .k { color: var(--muted); font-size:.85rem; }
.stub .row .v { font-weight:700; font-family: var(--font-num); text-align:right; }
.stub .cta { margin-top:14px; }

/* Barra de progreso de ventas */
.progress { margin-top:22px; }
.progress .bar { height: 12px; border-radius: 999px; background: rgba(255,255,255,.14); overflow:hidden; }
.progress .fill { height:100%; background: linear-gradient(90deg, var(--emerald), var(--gold-2)); width: var(--w, 0%); transition: width .6s ease; }
.progress .meta { display:flex; justify-content:space-between; margin-top:8px; color:#c3ccdb; font-size:.85rem; }

/* =================================================================
   TABLERO DE NÚMEROS
   ================================================================= */
.board-head { display:flex; flex-wrap:wrap; gap: 14px 20px; align-items:center; justify-content:space-between; margin: 30px 0 16px; }
.board-head h2 { font-size: 1.4rem; margin:0; }
.legend { display:flex; gap: 16px; flex-wrap:wrap; font-size:.85rem; color: var(--ink-soft); }
.legend .dot { display:inline-block; width:12px; height:12px; border-radius:4px; margin-right:6px; vertical-align:-1px; }
.dot.free { background: var(--emerald); }
.dot.taken { background: var(--clay); }
.dot.sel { background: var(--gold-2); }

.board-tools { display:flex; gap:10px; flex-wrap:wrap; margin-bottom: 16px; }
.board-tools input[type="search"] {
  flex: 1 1 220px; padding: 10px 12px; border:1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; background: var(--surface);
}
.board-tools input:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 1px; border-color: var(--emerald); }

.board {
  display: grid;
  grid-template-columns: repeat(var(--cols, 10), minmax(0, 1fr));
  gap: clamp(5px, 1.3vw, 10px);
  margin: 0 auto 40px;
  max-width: calc(var(--cols, 10) * 68px);
}
.num {
  font-family: var(--font-num); font-weight: 600;
  font-size: clamp(.72rem, 2.4vw, 1.05rem);
  aspect-ratio: 1 / 1; display:grid; place-items:center;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; position: relative;
  transition: transform .07s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.num:hover { border-color: var(--emerald); box-shadow: var(--shadow); }
.num:active { transform: translateY(1px); }
.num:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 2px; }
.num.free::after { content:""; position:absolute; bottom:8px; width:16px; height:3px; border-radius:2px; background: var(--emerald); opacity:.7; }

/* Ocupado: tocable, color claro y profesional (arcilla) */
.num.taken {
  cursor: pointer; color: #fff; border-color: transparent;
  background: linear-gradient(180deg, #c34a42, var(--clay));
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.10);
}
.num.taken:hover { filter: brightness(1.05); box-shadow: var(--shadow); }
.num .tag { position:absolute; top:6px; right:6px; width:7px; height:7px; border-radius:50%; background: rgba(255,255,255,.9); box-shadow:0 0 0 2px rgba(0,0,0,.06); }

/* Número ganador (cuando la rifa ya fue sorteada) */
.num.winner {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--ink); border-color: transparent;
  box-shadow: 0 0 0 3px rgba(216,169,42,.35), var(--shadow);
}
.num.winner .tag { background: var(--ink); box-shadow:none; }

.num.selected { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); box-shadow: 0 0 0 3px rgba(216,169,42,.25); }
.num.hidden { display:none; }
.board-hint { margin: -4px 0 18px; font-size: .9rem; }
.board-hint strong { color: var(--ink-soft); font-weight: 700; }

/* =================================================================
   MODAL DE COMPRA
   ================================================================= */
.modal-back {
  position: fixed; inset: 0; background: rgba(15,22,40,.55);
  display: none; place-items: center; padding: 20px; z-index: 50;
  backdrop-filter: blur(2px);
}
.modal-back.open { display: grid; }
.modal {
  background: var(--surface); border-radius: 18px; width: min(460px, 100%);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal header { background: var(--ink); color:#fff; padding: 18px 22px; display:flex; justify-content:space-between; align-items:center; }
.modal header .picked { font-family: var(--font-num); font-size: 1.6rem; font-weight: 700; color: var(--gold-2); }
.modal .body { padding: 22px; }
.modal .close { background:none; border:0; color:#c3ccdb; font-size:1.5rem; cursor:pointer; line-height:1; }
.modal .close:hover { color:#fff; }

.field { margin-bottom: 14px; }
.field label { display:block; font-size:.85rem; font-weight:600; margin-bottom:6px; color: var(--ink-soft); }
.field input[type=text], .field input[type=tel], .field input[type=email], .field input[type=url], .field input[type=password], .field input[type=number], .field input[type=date], .field input[type=search], .field input:not([type]), .field textarea, .field select {
  width:100%; padding:11px 12px; border:1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; background: var(--surface); color: var(--ink);
}
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible {
  outline: 3px solid var(--gold-soft); outline-offset:1px; border-color: var(--emerald);
}
.field .hint { font-size:.78rem; color: var(--muted); margin-top:4px; }
.check { display:flex; align-items:center; gap:10px; }
.check input { width:18px; height:18px; }
.err-msg { color:#8f2c26; font-size:.85rem; min-height: 1em; margin-top: 6px; }

/* Kicker del encabezado del modal */
.modal-kicker { font-size:.72rem; color:#c3ccdb; letter-spacing:.08em; text-transform:uppercase; font-weight:600; }

/* Popup de información (número ocupado / ventas cerradas) */
.info-list { display:flex; flex-direction:column; gap:10px; }
.info-row {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:12px 14px; border:1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.info-row .k { color: var(--muted); font-size:.85rem; }
.info-row .v { font-weight:700; text-align:right; word-break:break-word; }
.info-note {
  color: var(--ink-soft); font-size:.94rem; line-height:1.5;
  background: var(--surface-2); border:1px dashed var(--line);
  border-radius: var(--radius-sm); padding:16px;
}
.status-badge { display:inline-flex; align-items:center; gap:6px; padding:5px 12px; border-radius:999px; font-size:.82rem; font-weight:700; }
.status-badge::before { content:""; width:7px; height:7px; border-radius:50%; background: currentColor; }
.status-badge.paid { background: var(--emerald-t); color: var(--emerald-d); }
.status-badge.due  { background: var(--clay-t); color:#8f2c26; }

/* Reserva: nota y popup de comprobante */
.reserve-note { background: var(--gold-soft); border:1px solid #ecd9a5; color:#6b5200; border-radius: var(--radius-sm); padding:12px 14px; font-size:.9rem; line-height:1.5; margin-bottom:14px; }
.reserve-lead { margin:0 0 16px; color: var(--ink-soft); line-height:1.6; }
.reserve-lead strong { color: var(--ink); }
.wa-btn { gap:8px; }

/* =================================================================
   FOOTER
   ================================================================= */
.site-footer { border-top: 3px solid var(--gold); background: var(--ink); color:#c3ccdb; }
.footer-grid { display:grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 30px; padding: 40px 0 26px; }
.footer-brand .brand { color:#fff; }
.footer-brand .brand .name { font-size:1.1rem; }
.footer-desc { margin-top:14px; color:#aeb9cc; font-size:.92rem; line-height:1.6; max-width:44ch; }
.footer-col h4 { color:#fff; font-size:.95rem; margin:0 0 12px; letter-spacing:.02em; }
.footer-col ul { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:9px; }
.footer-col li { font-size:.92rem; }
.footer-col a { color:#c3ccdb; }
.footer-col a:hover { color:#fff; }
.footer-col li { display:flex; align-items:center; gap:9px; }
.footer-col .fi { display:inline-grid; place-items:center; width:26px; height:26px; border-radius:7px; background:rgba(255,255,255,.08); color:var(--gold-2); flex:0 0 auto; }
.footer-col .fi svg { width:15px; height:15px; }
.socials { display:flex; gap:10px; }
.social { width:42px; height:42px; border-radius:50%; display:grid; place-items:center; background:rgba(255,255,255,.09); color:#fff; transition: background .15s ease, color .15s ease, transform .15s ease; }
.social svg { width:20px; height:20px; }
.social:hover { background:var(--gold); color:var(--ink); text-decoration:none; transform: translateY(-2px); }
.footer-bottom { border-top:1px solid rgba(255,255,255,.12); }
.footer-bottom .wrap { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:16px 0; font-size:.82rem; color:#8ea0bd; }

/* Vista previa de imágenes en el panel */
.img-preview { border:1px solid var(--line); border-radius: var(--radius-sm); overflow:hidden; background: var(--surface-2); max-width:420px; }
.img-preview img { display:block; width:100%; height:auto; }
.img-preview.logo { max-width:160px; }
.img-empty { color:var(--muted); font-size:.9rem; background:var(--surface-2); border:1px dashed var(--line); border-radius:var(--radius-sm); padding:14px; }
input[type=file] { font: inherit; max-width:100%; }

/* =================================================================
   PANEL ADMIN
   ================================================================= */
.auth-page { min-height: 100vh; display:grid; place-items:center; padding: 24px;
  background: radial-gradient(900px 500px at 50% -10%, rgba(184,134,11,.16), transparent 60%), var(--ink); }
.auth-card { width: min(400px, 100%); background: var(--surface); border-radius:18px; box-shadow: var(--shadow-lg); padding: 30px; }
.auth-card .mark-lg { width:52px; height:52px; border-radius:12px; background:linear-gradient(135deg,var(--gold-2),var(--gold)); color:var(--ink); display:grid; place-items:center; font-family:var(--font-num); font-weight:700; font-size:26px; margin:0 auto 16px; }
.auth-card .mark-lg.mark-lg-img { width:64px; height:64px; background:transparent; overflow:hidden; }
.auth-card .mark-lg.mark-lg-img img { width:100%; height:100%; object-fit:contain; }
.auth-card h1 { font-size:1.4rem; text-align:center; }
.auth-card p.sub { color: var(--muted); margin-top:-4px; margin-bottom:18px; font-size:.92rem; text-align:center; }

/* Barra superior del panel */
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: #fff; border-bottom: 3px solid var(--gold);
  padding: 10px clamp(14px, 3vw, 22px);
}
.appbar .brand { color:#fff; }
.appbar .brand .name { font-size: 1rem; }
.appbar-title { margin-left: auto; color:#aeb9cc; font-weight:600; font-size:.9rem; letter-spacing:.02em; }

/* Botón hamburguesa */
.hamb { display:inline-grid; place-items:center; width:42px; height:42px; border:1px solid rgba(255,255,255,.2); background:rgba(255,255,255,.06); border-radius:10px; cursor:pointer; flex:0 0 auto; }
.hamb:hover { background:rgba(255,255,255,.12); }
.hamb:focus-visible { outline:3px solid var(--gold-soft); outline-offset:2px; }
.hamb-box { position:relative; width:20px; height:14px; }
.hamb-box span { position:absolute; left:0; width:100%; height:2px; border-radius:2px; background:#fff; transition:transform .25s ease, opacity .2s ease, top .25s ease; }
.hamb-box span:nth-child(1){ top:0; }
.hamb-box span:nth-child(2){ top:6px; }
.hamb-box span:nth-child(3){ top:12px; }
.hamb.is-open .hamb-box span:nth-child(1){ top:6px; transform:rotate(45deg); }
.hamb.is-open .hamb-box span:nth-child(2){ opacity:0; }
.hamb.is-open .hamb-box span:nth-child(3){ top:6px; transform:rotate(-45deg); }

/* Velo de fondo al abrir el menú */
.nav-scrim { position:fixed; inset:0; background:rgba(10,16,30,.5); z-index:55; backdrop-filter:blur(2px); }
body.nav-open { overflow:hidden; }

/* Menú lateral desplegable (drawer) */
.drawer {
  position: fixed; top:0; left:0; z-index:60; height:100%; width: min(300px, 84vw);
  background: var(--ink); color:#fff; display:flex; flex-direction:column;
  transform: translateX(-100%); transition: transform .28s ease;
  box-shadow: 0 0 60px rgba(0,0,0,.4);
}
.drawer.open { transform: translateX(0); }
.drawer-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:18px; border-bottom:1px solid rgba(255,255,255,.12); }
.drawer-close { background:none; border:0; color:#c3ccdb; font-size:1.8rem; line-height:1; cursor:pointer; padding:0 6px; }
.drawer-close:hover { color:#fff; }
.drawer-nav { flex:1; padding:14px; overflow-y:auto; display:flex; flex-direction:column; gap:4px; }
.drawer-nav a { display:flex; align-items:center; gap:12px; color:#c3ccdb; padding:12px 14px; border-radius:10px; font-weight:600; }
.drawer-nav a:hover { background:rgba(255,255,255,.08); color:#fff; text-decoration:none; }
.drawer-nav a.active { background:var(--emerald); color:#fff; }
.drawer-nav a .ic { display:inline-grid; place-items:center; width:22px; height:22px; flex:0 0 auto; }
.drawer-nav a .ic svg { width:20px; height:20px; }
.drawer-nav a .lbl { flex:1; }
.drawer-nav a .ext { color:#8ea0bd; font-size:.9rem; }
.drawer-foot { padding:16px; border-top:1px solid rgba(255,255,255,.12); }
.drawer-foot .btn svg { width:18px; height:18px; }

/* Contenido principal (centrado, sin barra lateral fija) */
.admin-main { padding: clamp(18px, 4vw, 36px); background: var(--paper); max-width: 1100px; margin-inline:auto; min-width:0; }
.admin-topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:22px; gap:12px; flex-wrap:wrap; }
.topbar-actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.topbar-actions .btn svg { flex:0 0 auto; }
.admin-topbar h1 { font-size:1.6rem; margin:0; }

.stats { display:grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap:14px; margin-bottom:24px; }
.stat { background: var(--surface); border:1px solid var(--line); border-radius: var(--radius); padding:16px 18px; box-shadow: var(--shadow); }
.stat .k { color: var(--muted); font-size:.8rem; }
.stat .v { font-family: var(--font-num); font-size:1.8rem; font-weight:700; margin-top:2px; }
.stat .v.gold { color: var(--gold); }
.stat .v.green { color: var(--emerald); }

.grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap:20px; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.pay-cfg { display:grid; grid-template-columns: 210px 1fr; gap:14px; align-items:start; }
@media (max-width:560px){ .pay-cfg { grid-template-columns: 1fr; gap:0; } }

/* Tabla */
.table-wrap { overflow-x:auto; border:1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { width:100%; border-collapse: collapse; font-size:.92rem; }
table.data th, table.data td { text-align:left; padding: 11px 14px; border-bottom:1px solid var(--line-soft); white-space:nowrap; }
table.data th { background: var(--surface-2); color: var(--ink-soft); font-weight:600; font-size:.8rem; letter-spacing:.02em; }
table.data td .n { font-family: var(--font-num); font-weight:700; }
table.data tr:hover td { background: var(--surface-2); }
.badge { display:inline-block; padding:3px 9px; border-radius:999px; font-size:.75rem; font-weight:600; }
.badge.paid { background: var(--emerald-t); color: var(--emerald-d); }
.badge.due  { background: var(--clay-t); color:#8f2c26; }

/* =================================================================
   SORTEO — escenario dramático
   ================================================================= */
.stage {
  min-height: 100vh; background:
    radial-gradient(1000px 600px at 50% 0%, rgba(184,134,11,.22), transparent 55%),
    var(--ink);
  color:#fff; display:flex; flex-direction:column;
}
.stage .stage-top { display:flex; justify-content:space-between; align-items:center; padding: 18px 0; }
.stage .wrap { width:min(900px,92vw); margin-inline:auto; width:min(900px,92vw); }
.stage-body { flex:1; display:grid; place-items:center; text-align:center; padding: 30px 0 60px; }
.reel-label { color: var(--gold-2); font-family: var(--font-num); letter-spacing:.15em; font-size:.9rem; }
.reel {
  font-family: var(--font-num); font-weight:700;
  font-size: clamp(4.5rem, 22vw, 12rem); line-height:1; color:#fff;
  letter-spacing: .02em; margin: 10px 0 6px; min-width: 3ch;
  text-shadow: 0 8px 40px rgba(216,169,42,.35);
}
.reel.spinning { color: #dfe6f0; }
.reel.winner { color: var(--gold-2); animation: pop .5s ease; }
@keyframes pop { 0%{transform:scale(.8);opacity:.4} 60%{transform:scale(1.12)} 100%{transform:scale(1)} }
.winner-card {
  margin-top: 22px; background: rgba(255,255,255,.06); border:1px solid rgba(216,169,42,.35);
  border-radius: 16px; padding: 20px 26px; display:inline-block; min-width: 260px;
}
.winner-card .who { font-size:1.5rem; font-weight:700; }
.winner-card .meta { color:#c3ccdb; margin-top:4px; }
.eligible-count { color:#aeb9cc; margin-top: 10px; }
.confetti { position:fixed; inset:0; pointer-events:none; z-index: 40; }

/* =================================================================
   PÁGINAS DE ERROR
   ================================================================= */
.error-page {
  min-height:100vh; display:grid; place-items:center; text-align:center; padding: 30px;
  background: radial-gradient(900px 500px at 50% -10%, rgba(184,134,11,.14), transparent 60%), var(--ink);
  color:#fff;
}
.error-page .code { font-family: var(--font-num); font-weight:700; font-size: clamp(5rem, 20vw, 10rem); line-height:1; color: var(--gold-2); }
.error-page h1 { font-size: 1.6rem; margin-top: 6px; }
.error-page p { color:#c3ccdb; max-width: 46ch; margin-inline:auto; }
.error-page .actions { margin-top: 22px; display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }

/* =================================================================
   UTILIDADES
   ================================================================= */
.muted { color: var(--muted); }
.center { text-align:center; }
.mt-0 { margin-top:0; } .mt-1 { margin-top:.6rem; } .mt-2 { margin-top:1.2rem; } .mt-3 { margin-top:2rem; }
.mb-2 { margin-bottom:1.2rem; }
.pill { display:inline-block; padding:4px 12px; border-radius:999px; font-size:.8rem; font-weight:600; }
.pill.open { background: var(--emerald-t); color: var(--emerald-d); }
.pill.closed { background:#eceef0; color: var(--ink-soft); }
.pill.done { background: var(--gold-soft); color:#7a5c05; }
.divider { height:1px; background: var(--line); margin: 20px 0; border:0; }
.empty { text-align:center; color: var(--muted); padding: 40px 20px; }

/* =================================================================
   BANNER DE MEDIOS DE PAGO (portada)
   ================================================================= */
.pay-banner {
  background:
    radial-gradient(900px 320px at 12% -30%, rgba(216,169,42,.22), transparent 60%),
    var(--ink);
  color:#fff; padding: 46px 0; border-top: 3px solid var(--gold);
  margin-top: 10px;
}
.pay-inner { display:flex; flex-direction:column; gap: 22px; }
.pay-eyebrow { color: var(--gold-2); font-family: var(--font-num); font-weight:600; letter-spacing:.14em; text-transform:uppercase; font-size:.78rem; }
.pay-title { font-family: var(--font-num); font-weight:700; font-size: clamp(1.6rem, 4.5vw, 2.5rem); margin: .18em 0 0; color:#fff; }
.pay-msg { color:#dbe2ee; font-size: 1.06rem; line-height:1.55; max-width: 62ch; margin: .45em 0 0; }
.pay-steps { list-style:none; display:grid; grid-template-columns: repeat(3, 1fr); gap:14px; margin:0; padding:0; }
.pay-steps li { display:flex; gap:12px; align-items:flex-start; background: rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.12); border-radius:14px; padding:14px 16px; }
.pay-steps .step-n { flex:0 0 auto; width:30px; height:30px; border-radius:50%; display:grid; place-items:center; font-family: var(--font-num); font-weight:700; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--ink); }
.pay-steps li div { display:flex; flex-direction:column; gap:2px; }
.pay-steps li strong { color:#fff; font-size:.98rem; }
.pay-steps li span { color:#c3ccdb; font-size:.85rem; }
.pay-methods { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.pay-method {
  position:relative; background: rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.14);
  border-radius: 14px; padding: 16px; display:flex; flex-direction:column; gap:5px;
  transition: border-color .15s ease, background .15s ease;
}
.pay-method:hover { border-color: rgba(216,169,42,.5); background: rgba(255,255,255,.09); }
.pay-method-name { color: var(--gold-2); font-size:.76rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase; }
.pay-method-val { font-family: var(--font-num); font-size: 1.16rem; font-weight:700; color:#fff; word-break: break-word; padding-right: 74px; }
.pay-copy {
  position:absolute; top:14px; right:14px; background: rgba(255,255,255,.1); color:#fff;
  border:1px solid rgba(255,255,255,.24); border-radius:999px; padding:5px 13px;
  font: inherit; font-size:.76rem; font-weight:600; cursor:pointer; transition: background .15s ease, border-color .15s ease;
}
.pay-copy:hover { background: rgba(255,255,255,.2); }
.pay-copy:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 2px; }
.pay-copy.ok { background: var(--emerald); border-color: transparent; }
.pay-foot {
  display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
  border-top:1px solid rgba(255,255,255,.12); padding-top: 20px;
}
.pay-titular { color:#c3ccdb; font-size:.98rem; }
.pay-titular strong { color:#fff; }
.pay-wa { box-shadow: 0 10px 30px -12px rgba(216,169,42,.6); animation: wa-pulse 2.4s ease-in-out infinite; }
.pay-wa svg { width:20px; height:20px; flex:0 0 auto; }
.pay-wa:hover { transform: translateY(-2px); }
@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 10px 30px -12px rgba(216,169,42,.55); }
  50% { box-shadow: 0 12px 36px -8px rgba(216,169,42,.95); }
}

/* =================================================================
   PANEL: pestañas, filtros, acciones de fila
   ================================================================= */
.tabbar { display:flex; flex-wrap:nowrap; gap:4px; border-bottom:1px solid var(--line); margin: 6px 0 18px; overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
.tabbar::-webkit-scrollbar { display:none; }
.tab-btn { appearance:none; background:transparent; border:0; border-bottom:2px solid transparent; padding:10px 14px; font:inherit; font-weight:600; color:var(--muted); cursor:pointer; border-radius:8px 8px 0 0; white-space:nowrap; flex:0 0 auto; }
.tab-btn:hover { color:var(--ink); background:var(--surface-2); }
.tab-btn.active { color:var(--emerald-d); border-bottom-color:var(--emerald); }
.tab-btn:focus-visible { outline:3px solid var(--gold-soft); outline-offset:2px; }
.tab-panel { animation: fade-up .18s ease; }
@keyframes fade-up { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

.quick-actions { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; }
.quick-actions-btns { display:flex; gap:10px; flex-wrap:wrap; }
.quick-actions-btns form { margin:0; }
.input-copy { width:100%; padding:11px 12px; border:1px solid var(--line); border-radius:var(--radius-sm); font:inherit; background:var(--surface-2); color:var(--ink); }
.input-copy:focus-visible { outline:3px solid var(--gold-soft); outline-offset:1px; border-color:var(--emerald); }

.filters { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.filter-search { flex:1 1 280px; }
.filter-search input, .filter-status select {
  padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius-sm);
  font:inherit; background:var(--surface); color:var(--ink);
}
.filter-search input { width:100%; }
.filter-status select { min-width:180px; }
.filter-search input:focus-visible, .filter-status select:focus-visible { outline:3px solid var(--gold-soft); outline-offset:1px; border-color:var(--emerald); }
.filter-count { color:var(--muted); font-size:.9rem; margin-left:auto; white-space:nowrap; }

/* Badge de estado con icono */
.badge { display:inline-flex; align-items:center; gap:5px; padding:4px 10px; border-radius:999px; font-size:.78rem; font-weight:700; line-height:1; }
.badge svg { flex:0 0 auto; }
.badge.paid { background: var(--emerald-t); color: var(--emerald-d); }
.badge.due  { background: var(--clay-t);  color: #8f2c26; }

/* Acciones de fila (iconos) */
.col-acc { width:1%; white-space:nowrap; }
.row-actions { display:flex; gap:6px; align-items:center; }
.row-actions form { margin:0; }
.icon-btn {
  display:inline-grid; place-items:center; width:34px; height:34px; border-radius:9px;
  border:1px solid var(--line); background:var(--surface); color:var(--ink-soft);
  cursor:pointer; transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--muted); }
.icon-btn:focus-visible { outline:3px solid var(--gold-soft); outline-offset:2px; }
.icon-btn.ok     { color: var(--emerald-d); border-color:#bfe0d5; background: var(--emerald-t); }
.icon-btn.ok:hover { background:#d9ede6; }
.icon-btn.warn   { color:#8a5b00; border-color:#ecd9a5; background: var(--gold-soft); }
.icon-btn.danger { color:#8f2c26; border-color:#e9c4c1; background: var(--clay-t); }
.icon-btn.danger:hover { background:#f3dcda; }

/* =================================================================
   MULTI-RIFA (listado admin y landing público)
   ================================================================= */
.create-rifa { display:flex; gap:10px; flex-wrap:wrap; }
.create-rifa input[type=text] { flex:1 1 260px; padding:11px 12px; border:1px solid var(--line); border-radius:var(--radius-sm); font:inherit; background:var(--surface); color:var(--ink); }
.create-rifa input[type=text]:focus-visible { outline:3px solid var(--gold-soft); outline-offset:1px; border-color:var(--emerald); }

.rifas-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap:18px; }
.rifa-card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); overflow:hidden; display:flex; flex-direction:column; }
.rifa-card.link { color:inherit; text-decoration:none; transition:transform .12s ease, box-shadow .12s ease; }
.rifa-card.link:hover { transform:translateY(-3px); box-shadow:var(--shadow-lg); text-decoration:none; }
.rifa-thumb { aspect-ratio:16/9; background:var(--surface-2); overflow:hidden; }
.rifa-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.rifa-thumb-empty { display:grid; place-items:center; font-size:2.2rem; color:var(--muted); }
.rifa-thumb-empty svg { width:44px; height:44px; }
.rifa-body { padding:16px; display:flex; flex-direction:column; gap:10px; }
.rifa-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.rifa-head h3 { font-size:1.05rem; margin:0; }
.rifa-actions { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.rifa-actions form { margin:0; }
.rifa-link { display:flex; align-items:center; gap:8px; }
.rifa-link .input-copy { flex:1; font-size:.8rem; padding:7px 9px; }

/* Barra de progreso en superficie clara (tarjetas) */
.progress.mini { margin-top:2px; }
.progress.mini .bar { height:8px; background: var(--line); }
.progress.mini .meta { color: var(--muted); font-size:.78rem; margin-top:6px; }

.recovery-codes { display:grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap:8px; }
.recovery-codes code { font-family:var(--font-num); background:var(--surface-2); border:1px solid var(--line); border-radius:8px; padding:8px 10px; text-align:center; font-size:1rem; letter-spacing:1px; }

/* Responsive */
@media (max-width: 860px) {
  .hero { padding: 34px 0 30px; }
  .hero-grid { grid-template-columns: 1fr; gap: 26px; }
  .grid-2, .form-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); }
  .admin-topbar h1 { font-size: 1.35rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  /* Encabezado público: menú hamburguesa */
  .header-inner { grid-template-columns: 1fr auto; padding: 10px 0; }
  .nav-burger { display:block; }
  .header-nav {
    display:none; position:absolute; left:0; right:0; top:100%;
    flex-direction:column; gap:0; background: var(--ink);
    border-bottom:2px solid var(--gold); padding:8px; box-shadow: var(--shadow-lg);
  }
  .header-nav.open { display:flex; }
  .header-nav a { padding:12px 14px; width:100%; border-radius:8px; }
  .header-nav a:hover { background: rgba(255,255,255,.08); }
  .header-nav a::after { display:none; }
}
@media (max-width: 560px) {
  .wrap { width: min(1120px, 94vw); }

  .board { gap: 7px; }
  .num { border-radius: 11px; }
  .board-head { margin: 24px 0 14px; }
  .board-head h2 { font-size: 1.25rem; }
  .hero { padding: 30px 0 28px; }
  .hero h1 { font-size: clamp(1.8rem, 8vw, 2.6rem); }
  .hero .lede { font-size: 1rem; }
  .stub::before, .stub::after { display:none; }
  .pay-banner { padding: 34px 0; }
  .pay-steps { grid-template-columns: 1fr; }
  .pay-foot { flex-direction: column; align-items: stretch; }
  .pay-wa { width: 100%; text-align:center; }

  /* Footer en una columna */
  .footer-grid { grid-template-columns: 1fr; gap: 24px; padding: 30px 0 20px; }
  .footer-bottom .wrap { justify-content:center; text-align:center; }

  /* Panel en móvil */
  .appbar-title { display: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat .v { font-size: 1.5rem; }
  .admin-topbar { margin-bottom: 16px; }
  .topbar-actions { width: 100%; }
  .topbar-actions .btn { flex: 1 1 auto; justify-content: center; }
  .admin-topbar h1 { font-size: 1.25rem; }
  .quick-actions-btns { width: 100%; }
  .quick-actions-btns .btn, .quick-actions-btns form { flex: 1 1 auto; }
  .quick-actions-btns .btn { width: 100%; }
  .filters { gap: 10px; }
  .filter-status, .filter-status select { width: 100%; }
  .filter-count { margin-left: 0; }

  /* Popups centrados también en móvil */
  .modal-back { align-items: center; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .modal { width: 100%; max-width: 440px; margin: auto; border-radius: 16px; max-height: 90vh; overflow-y: auto; animation: pop-in .2s ease; }
  .modal .body { padding: 18px; }
  .modal header { padding: 16px 18px; }
}
@keyframes pop-in { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (max-width: 400px) {
  .brand .name small { display:none; }
  .header-nav .btn { padding: 6px 10px; font-size: .8rem; }
  .board { gap: 6px; }
  .stats { grid-template-columns: 1fr 1fr; }
}

/* Respeta la preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
