/* ═══════════════════════════════════════════════
   BIOCOINS 2026 — Hoja de estilos principal
   Mobile-first · White bg · Lab/Gamer aesthetic
═══════════════════════════════════════════════ */

/* ── Variables base (sobreescritas por PHP desde DB) ── */
:root {
  --primary:     #10b981;
  --primary-lt:  #d1fae5;
  --xp:          #3b82f6;
  --xp-lt:       #dbeafe;
  --lvl:         #8b5cf6;
  --lvl-lt:      #ede9fe;
  --acc:         #f59e0b;
  --acc-lt:      #fef3c7;
  --danger:      #ef4444;
  --danger-lt:   #fee2e2;
  --success:     #22c55e;
  --bg:          #f8fafc;
  --bg-card:     #ffffff;
  --hdr:         #0f172a;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --border:      #e2e8f0;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,.12);
  --sidebar-w:   220px;
  --topbar-h:    56px;
  --bnav-h:      64px;
  --font:        'Space Grotesk', system-ui, sans-serif;
  --mono:        'JetBrains Mono', monospace;
}

/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
img { max-width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: 1rem; }

/* ── Topbar ───────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--hdr);
  height: var(--topbar-h);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; padding: 0 1rem;
}
.brand { display: flex; align-items: center; gap: .5rem; color: #fff; font-weight: 700; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand-icon { font-size: 1.4rem; }
.brand-name { letter-spacing: -.02em; }
.topbar-right { display: flex; align-items: center; gap: .5rem; }
.user-chip {
  display: flex; align-items: center; gap: .35rem;
  background: rgba(255,255,255,.1); color: #fff;
  padding: .25rem .65rem; border-radius: 999px; font-size: .82rem;
}
.btn-logout {
  color: rgba(255,255,255,.7); font-size: 1.1rem;
  background: transparent; border: none; cursor: pointer;
  padding: .3rem .5rem; border-radius: 6px; display: flex; align-items: center;
  transition: color .2s;
}
.btn-logout:hover { color: #fff; background: rgba(255,255,255,.1); text-decoration: none; }

/* ── Layout: sidebar + main ───────────────────────── */
.layout {
  display: flex;
  padding-top: var(--topbar-h);
  min-height: 100vh;
}
.sidebar {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--hdr);
  overflow-y: auto;
  z-index: 50;
  padding: .75rem 0;
  transform: translateX(0);
  transition: transform .25s;
}
.nav-list { display: flex; flex-direction: column; gap: 2px; padding: 0 .5rem; }
.nav-link {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .75rem; border-radius: 8px;
  color: rgba(255,255,255,.7); font-size: .88rem; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--primary); color: #fff; }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: calc(var(--topbar-h) + 1.25rem) 1.25rem 2rem;
  max-width: 1024px;
}
.main-alumno {
  margin-left: 0;
  padding-bottom: calc(var(--bnav-h) + 1rem);
  max-width: 600px; margin-inline: auto;
}

/* ── Bottom Navigation (alumno) ───────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bnav-h);
  background: var(--hdr);
  display: flex; align-items: stretch;
  box-shadow: 0 -2px 10px rgba(0,0,0,.2);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.bnav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: rgba(255,255,255,.55); font-size: .72rem; font-weight: 500;
  transition: color .15s; text-decoration: none;
}
.bnav-item:first-child { font-size: 1.3rem; }
.bnav-item > :first-child { font-size: 1.35rem; }
.bnav-item span { display: block; }
.bnav-item.active { color: var(--primary); }
.bnav-item:hover { color: #fff; text-decoration: none; }

/* ── Login ────────────────────────────────────────── */
.login-body { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.login-wrap { width: 100%; max-width: 400px; }
.login-card {
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 2rem;
}
.login-hero { text-align: center; margin-bottom: 1.5rem; }
.login-icon { font-size: 3rem; margin-bottom: .5rem; }
.login-hero h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; }
.login-hero p  { color: var(--text-muted); font-size: .9rem; margin-top: .2rem; }
.login-form .field { margin-bottom: 1rem; }
.login-footer { text-align: center; color: var(--text-muted); font-size: .8rem; margin-top: 1rem; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 2.5rem; }
.pw-toggle {
  position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1rem; line-height: 1;
}

/* ── Cards ────────────────────────────────────────── */
.card {
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem;
  margin-bottom: 1rem;
}
.card.border-warn { border-left: 4px solid var(--acc); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: .95rem; margin-bottom: .75rem;
  padding-bottom: .5rem; border-bottom: 1px solid var(--border);
}
.link-more { font-size: .82rem; color: var(--primary); font-weight: 500; }

/* ── Page Header ──────────────────────────────────── */
.page-header { margin-bottom: 1.25rem; }
.page-header h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -.03em; }
.page-header p { color: var(--text-muted); font-size: .88rem; }

/* ── Stats Grid ───────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(2,1fr); gap: .75rem;
  margin-bottom: 1rem;
}
.stats-grid.mini { grid-template-columns: repeat(3,1fr); }
.stat-card {
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .85rem;
  display: flex; align-items: center; gap: .75rem;
}
.stat-card.mini { padding: .6rem; }
.stat-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.stat-icon.bg-primary { background: var(--primary-lt); }
.stat-icon.bg-xp      { background: var(--xp-lt); }
.stat-icon.bg-lvl     { background: var(--lvl-lt); }
.stat-icon.bg-warn    { background: var(--acc-lt); }
.stat-icon.bg-dark    { background: var(--hdr); color: #fff; }
.stat-info { display: flex; flex-direction: column; }
.stat-num { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; line-height: 1.1; }
.stat-lbl { font-size: .78rem; color: var(--text-muted); }

/* ── Quick Buttons ────────────────────────────────── */
.quick-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: .6rem; margin-bottom: 1rem;
}
.quick-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .3rem; padding: .85rem .5rem; border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 600; text-decoration: none; color: #fff;
  transition: transform .15s, box-shadow .15s;
}
.quick-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.quick-btn > :first-child { font-size: 1.4rem; }
.q-primary { background: var(--primary); }
.q-xp      { background: var(--xp); }
.q-warn    { background: var(--acc); }
.q-lvl     { background: var(--lvl); }
.q-acc     { background: var(--acc); }
.q-dark    { background: #475569; }

/* ── Two column layout ────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── Forms ────────────────────────────────────────── */
.field { margin-bottom: .85rem; }
.field.field-full { grid-column: 1/-1; }
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .3rem; color: var(--text); }
.check-label { display: flex; align-items: center; gap: .4rem; font-weight: 500; cursor: pointer; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], select, textarea {
  width: 100%; padding: .6rem .8rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16,185,129,.12);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; }

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .9rem; cursor: pointer;
  border: none; transition: all .15s; text-decoration: none;
  background: var(--border); color: var(--text);
}
.btn:hover { filter: brightness(.93); text-decoration: none; }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-warning  { background: var(--acc); color: #fff; }
.btn-full     { width: 100%; }
.btn-xl       { padding: .85rem 1rem; font-size: 1rem; }
.btn-sm       { padding: .35rem .75rem; font-size: .82rem; }
.btn-xs       { padding: .2rem .5rem; font-size: .78rem; }

/* ── Filter bar ───────────────────────────────────── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  margin-bottom: 1rem;
}
.filter-bar input, .filter-bar select { width: auto; flex: 1; min-width: 140px; }

/* ── Tables ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th {
  background: var(--bg); text-align: left; font-weight: 600; font-size: .8rem;
  padding: .55rem .75rem; border-bottom: 2px solid var(--border); white-space: nowrap;
}
.data-table td { padding: .55rem .75rem; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }
.row-inactive { opacity: .55; }
.actions-cell { display: flex; gap: .3rem; flex-wrap: wrap; }
.num { font-family: var(--mono); text-align: right; }

/* ── Movimientos list ─────────────────────────────── */
.mov-list { display: flex; flex-direction: column; gap: .1rem; }
.mov-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 0; border-bottom: 1px solid var(--border);
}
.mov-item:last-child { border-bottom: none; }
.mov-icon { font-size: 1.3rem; width: 2rem; text-align: center; flex-shrink: 0; }
.mov-info { flex: 1; min-width: 0; }
.mov-info strong { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mov-info small { color: var(--text-muted); font-size: .78rem; display: block; }
.mov-val { font-family: var(--mono); font-weight: 700; font-size: .92rem; white-space: nowrap; text-align: right; }
.pos { color: var(--primary); }
.neg { color: var(--danger); }
.neu { color: var(--text-muted); }
.xp-tag { display: block; font-size: .74rem; color: var(--xp); }

/* ── Ranking ──────────────────────────────────────── */
.rank-list { display: flex; flex-direction: column; gap: .25rem; }
.rank-item { display: flex; align-items: center; gap: .65rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.rank-item:last-child { border-bottom: none; }
.rank-pos { font-family: var(--mono); font-weight: 700; font-size: 1rem; min-width: 28px; text-align: center; }
.rank-1 { color: var(--acc); font-size: 1.3rem; }
.rank-2 { color: var(--text-muted); font-size: 1.1rem; }
.rank-3 { color: #cd7f32; font-size: 1rem; }
.rank-info { flex: 1; }
.rank-info strong { display: block; font-size: .9rem; }
.rank-info small { color: var(--text-muted); font-size: .78rem; }
.rank-stats { text-align: right; }
.rank-medal { font-size: 1.2rem; min-width: 32px; display: inline-block; text-align: center; }
.ranking-table tr.top-1 td { background: rgba(245,158,11,.07); }
.ranking-table tr.top-2 td { background: rgba(148,163,184,.07); }
.ranking-table tr.top-3 td { background: rgba(205,127,50,.07); }

/* ── Badges ───────────────────────────────────────── */
.badge-bc {
  display: inline-flex; align-items: center; gap: .2rem;
  background: var(--primary-lt); color: var(--primary);
  border-radius: 999px; padding: .15rem .6rem;
  font-family: var(--mono); font-weight: 700; font-size: .82rem;
}
.badge-xp {
  background: var(--xp-lt); color: var(--xp);
  border-radius: 999px; padding: .15rem .6rem;
  font-family: var(--mono); font-weight: 700; font-size: .82rem;
  display: inline-block;
}
.badge-lvl {
  background: var(--lvl-lt); color: var(--lvl);
  border-radius: 999px; padding: .15rem .6rem;
  font-weight: 700; font-size: .8rem; display: inline-block;
}
.badge-ok  { background: var(--primary-lt); color: var(--primary); border-radius: 999px; padding: .1rem .55rem; font-size: .78rem; font-weight: 600; }
.badge-err { background: var(--danger-lt); color: var(--danger); border-radius: 999px; padding: .1rem .55rem; font-size: .78rem; font-weight: 600; }
.badge-tipo { border-radius: 999px; padding: .1rem .55rem; font-size: .78rem; font-weight: 600; }
.badge-tipo.pos { background: var(--primary-lt); color: var(--primary); }
.badge-tipo.neg { background: var(--danger-lt); color: var(--danger); }
.badge-tipo.neu { background: var(--border); color: var(--text-muted); }
.badge-premio { background: var(--acc-lt); color: var(--acc); border-radius: 999px; padding: .1rem .55rem; font-size: .78rem; font-weight: 600; }
.badge-pos  { background: var(--primary-lt); color: var(--primary); border-radius: 999px; padding: .15rem .65rem; font-size: .85rem; font-weight: 700; display: inline-block; }

/* ── XP Bar ───────────────────────────────────────── */
.xp-card { }
.xp-header { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: .75rem; }
.xp-bar-wrap { background: var(--border); border-radius: 999px; height: 14px; overflow: hidden; margin-bottom: .5rem; }
.xp-bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--xp), var(--primary));
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 6px; transition: width 1s cubic-bezier(.4,0,.2,1);
  min-width: 2rem;
}
.xp-bar-label { color: #fff; font-family: var(--mono); font-size: .65rem; font-weight: 700; }
.xp-next { font-size: .82rem; color: var(--text-muted); }

/* ── Alumno Hero ──────────────────────────────────── */
.alumno-hero {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem; background: var(--bg-card);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem;
}
.hero-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--xp));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.6rem; font-weight: 700; flex-shrink: 0;
}
.hero-info h2 { font-size: 1.2rem; font-weight: 700; }
.hero-info p  { font-size: .85rem; color: var(--text-muted); }

/* ── Insignias ────────────────────────────────────── */
.badges-row { display: flex; flex-wrap: wrap; gap: .6rem; padding: .25rem 0; }
.badge-ins {
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: .5rem .6rem; cursor: default; transition: transform .15s;
}
.badge-ins:hover { transform: scale(1.05); }
.badge-ins-icon { font-size: 1.6rem; }
.badge-ins-name { font-size: .7rem; font-weight: 600; color: var(--text-muted); text-align: center; max-width: 70px; }

/* ── Tabs ─────────────────────────────────────────── */
.tabs { display: flex; gap: .35rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab-btn {
  padding: .45rem .9rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--bg-card);
  font-weight: 600; font-size: .85rem; cursor: pointer;
  transition: all .15s; color: var(--text-muted);
}
.tab-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-row { display: flex; gap: .3rem; margin-bottom: 1rem; border-bottom: 2px solid var(--border); padding-bottom: .1rem; }
.tab-link { padding: .45rem .75rem; font-weight: 600; font-size: .85rem; color: var(--text-muted); border-radius: 6px 6px 0 0; }
.tab-link.active { color: var(--primary); border-bottom: 2px solid var(--primary); }
.tab-link:hover { color: var(--text); text-decoration: none; }

/* ── Acciones grid (asignar) ──────────────────────── */
.acciones-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .5rem; }
.accion-card { position: relative; }
.accion-card input[type=radio] { position: absolute; opacity: 0; width: 0; height: 0; }
.accion-inner {
  display: flex; flex-direction: column; gap: .15rem;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: .6rem .7rem; cursor: pointer; transition: all .15s;
  background: var(--bg);
}
.accion-card input:checked ~ .accion-inner {
  border-color: var(--primary); background: var(--primary-lt);
}
.accion-icon { font-size: 1.3rem; }
.accion-name { font-weight: 600; font-size: .85rem; line-height: 1.2; }
.accion-pts  { font-family: var(--mono); font-size: .78rem; color: var(--primary); font-weight: 600; }

/* ── Canje cards ──────────────────────────────────── */
.canje-list { display: flex; flex-direction: column; gap: .75rem; }
.canje-card { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .85rem; }
.canje-card.pendiente { border-color: var(--acc); }
.canje-card.aprobado  { border-color: var(--success); }
.canje-card.rechazado { border-color: var(--danger); opacity: .75; }
.canje-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.canje-icon { font-size: 1.6rem; }
.canje-main { flex: 1; }
.canje-main strong { display: block; font-weight: 700; }
.canje-main small { color: var(--text-muted); font-size: .8rem; }
.canje-cost { text-align: right; }
.canje-cost .badge-bc { display: block; }
.canje-cost small { display: block; color: var(--text-muted); font-size: .75rem; margin-top: .15rem; }
.canje-comment { font-size: .84rem; color: var(--text-muted); margin-bottom: .4rem; font-style: italic; }
.canje-comment.admin-note { color: var(--xp); }
.canje-meta { font-size: .78rem; color: var(--text-muted); margin-bottom: .5rem; }
.canje-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.canje-actions input { flex: 1; min-width: 120px; }
.estado-badge { display: inline-block; padding: .25rem .75rem; border-radius: 999px; font-size: .82rem; font-weight: 700; margin-top: .35rem; }
.estado-pendiente { background: var(--acc-lt); color: var(--acc); }
.estado-aprobado  { background: var(--primary-lt); color: var(--primary); }
.estado-rechazado { background: var(--danger-lt); color: var(--danger); }

/* ── Premios tienda ───────────────────────────────── */
.saldo-banner {
  display: flex; align-items: center; gap: .85rem;
  background: linear-gradient(135deg, var(--hdr), #1e293b);
  color: #fff; border-radius: var(--radius); padding: 1rem 1.25rem;
  font-size: 1.5rem; margin-bottom: 1rem;
}
.saldo-num { font-family: var(--mono); font-size: 2rem; font-weight: 700; line-height: 1; }
.saldo-lbl { font-size: .82rem; color: rgba(255,255,255,.6); }
.premios-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .75rem; margin-bottom: 1rem; }
.premio-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .5rem;
  transition: transform .15s, box-shadow .15s;
}
.premio-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.premio-card.no-funds { opacity: .65; }
.premio-card.pending  { border-color: var(--acc); }
.premio-icon { font-size: 2.5rem; text-align: center; }
.premio-nombre { font-weight: 700; font-size: .95rem; }
.premio-desc { font-size: .82rem; color: var(--text-muted); flex: 1; }
.premio-costo { margin-top: auto; }
.premio-estado { font-size: .82rem; font-weight: 600; padding: .35rem; border-radius: var(--radius-sm); text-align: center; }
.premio-estado.sin-fondos { background: var(--danger-lt); color: var(--danger); }
.premio-estado:not(.sin-fondos) { background: var(--acc-lt); color: var(--acc); }

/* ── Sorteo ───────────────────────────────────────── */
.sorteo-stage { min-height: 160px; display: flex; align-items: center; justify-content: center; margin: 1.5rem 0; }
.sorteo-drum {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  font-size: 2.5rem; background: var(--bg);
  border: 2px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 2rem; min-width: 280px; text-align: center;
}
.drum-name { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; color: var(--text); }
.drum-name.winner { color: var(--primary); }
.drum-spin { animation: spin .1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.sorteo-resultado { margin-top: 1rem; }
.winner-card {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  background: linear-gradient(135deg, var(--primary-lt), var(--xp-lt));
  border: 2px solid var(--primary); border-radius: var(--radius); padding: 1.5rem;
  text-align: center; animation: pop .4s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.winner-icon { font-size: 3rem; }
.winner-name { font-size: 1.4rem; font-weight: 700; }
.winner-sub  { color: var(--text-muted); font-size: .9rem; }
.confetti-piece {
  position: fixed; top: -10px; width: 10px; height: 10px;
  border-radius: 2px; pointer-events: none;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ── Pagination ───────────────────────────────────── */
.pagination { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: center; margin-top: 1rem; }
.page-btn { padding: .3rem .65rem; border-radius: 6px; background: var(--bg-card); border: 1px solid var(--border); font-size: .85rem; color: var(--text); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:hover { text-decoration: none; border-color: var(--primary); }

/* ── Misc helpers ─────────────────────────────────── */
.muted { color: var(--text-muted); }
.mt-1  { margin-top: .75rem; }
.mt-2  { margin-top: 1.25rem; }
.mb-2  { margin-bottom: 1.25rem; }
.empty-state { text-align: center; padding: 2rem; color: var(--text-muted); font-size: .9rem; }
.info-text { color: var(--text-muted); font-size: .88rem; margin-bottom: .85rem; line-height: 1.5; }
.two-col .card { margin-bottom: 0; }
.sellos-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.sello-chip { background: var(--acc-lt); color: var(--acc); border-radius: 999px; padding: .2rem .7rem; font-size: .82rem; font-weight: 600; }
.color-row { display: flex; gap: .5rem; align-items: center; }
.color-row input[type=color] { width: 40px; height: 36px; border-radius: 6px; border: 1px solid var(--border); padding: 2px; cursor: pointer; flex-shrink: 0; }
.color-text { flex: 1; font-family: var(--mono); font-size: .85rem; }
.qr-wrap { display: flex; justify-content: center; margin: 1rem 0; }
.qr-stats { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin: .75rem 0; }

/* ── Alerts ───────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 500; font-size: .9rem; }
.alert-success { background: var(--primary-lt); color: #065f46; border-left: 4px solid var(--primary); }
.alert-error   { background: var(--danger-lt);  color: #991b1b; border-left: 4px solid var(--danger); }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-220px); width: 220px; }
  .sidebar.open { transform: translateX(0); }
  .layout { display: block; }
  .main-content { margin-left: 0; padding: calc(var(--topbar-h) + 1rem) .85rem calc(var(--bnav-h) + 1rem); }
  .two-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); gap: .5rem; }
  .quick-grid { grid-template-columns: repeat(3,1fr); gap: .4rem; }
  .form-grid { grid-template-columns: 1fr; }
  .acciones-grid { grid-template-columns: 1fr; }
  .premios-grid { grid-template-columns: 1fr; }
  .brand-name { display: none; }
  .data-table { font-size: .8rem; }
  .data-table td, .data-table th { padding: .4rem .5rem; }
}

@media (max-width: 400px) {
  .quick-grid { grid-template-columns: repeat(2,1fr); }
  .stats-grid.mini { grid-template-columns: repeat(3,1fr); gap: .35rem; }
}
