:root {
  --bg: #f6f5fb;
  --surface: #ffffff;
  --line: #e6e3f2;
  --text: #1b1340;
  --muted: #6b6690;
  --primary: #5b3df5;
  --primary-soft: #efebff;
  --ok: #067647;
  --ok-soft: #e7f8ef;
  --warn: #b54708;
  --warn-soft: #fff4e5;
  --err: #b42318;
  --err-soft: #fee4e2;
  --radius: 14px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.topbar { background: var(--text); color: #fff; }
.topbar .inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { color: #fff; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand .dot { width: 26px; height: 26px; border-radius: 8px; background: var(--primary); display: grid; place-items: center; font-size: .8rem; }
.topbar nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.topbar nav a, .topbar nav button { color: #d9d4ff; background: none; border: 0; font: inherit; cursor: pointer; padding: 6px 10px; border-radius: 8px; }
.topbar nav a:hover, .topbar nav button:hover { background: #ffffff1a; text-decoration: none; }

.inner { max-width: 1100px; margin: 0 auto; padding: 14px 16px; }
main.inner { padding-top: 24px; padding-bottom: 48px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.card h2 { font-size: 1.1rem; }
.grid { display: grid; gap: 20px; }
@media (min-width: 860px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.side { grid-template-columns: 2fr 1fr; } }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 9px 14px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: #cfc8f5; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--err); }
.btn.wa { background: #25d366; border-color: #25d366; color: #fff; }
.btn.sm { padding: 5px 10px; font-size: .85rem; border-radius: 8px; }

form.stack { display: grid; gap: 14px; }
.row { display: grid; gap: 14px; }
@media (min-width: 600px) { .row.two { grid-template-columns: 1fr 1fr; } .row.three { grid-template-columns: 2fr 1fr 1fr; } }
label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
label .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input, select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .num { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .lbl { color: var(--muted); font-size: .85rem; }
.progress { height: 8px; border-radius: 99px; background: var(--primary-soft); overflow: hidden; margin-top: 8px; }
.progress > span { display: block; height: 100%; background: var(--primary); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
tr.highlight td { background: var(--primary-soft); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 700; }
.badge.valid, .badge.on { background: var(--primary-soft); color: var(--primary); }
.badge.used, .badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.cancelled, .badge.off { background: var(--err-soft); color: var(--err); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-weight: 500; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--err-soft); color: var(--err); }
.notice { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: 10px; font-size: .9rem; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.event-list { display: grid; gap: 12px; }
.event-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.event-row h3 { font-size: 1.05rem; margin: 0 0 2px; }

.ticket-list { display: grid; gap: 18px; }
@media (min-width: 700px) { .ticket-list { grid-template-columns: 1fr 1fr; } }
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.ticket-head { background: var(--text); color: #fff; padding: 16px 20px; }
.ticket-head .type { color: #c9c0ff; font-weight: 600; font-size: .9rem; }
.ticket-body { padding: 18px 20px; text-align: center; border-top: 2px dashed var(--line); }
.ticket-body img { width: 100%; max-width: 260px; image-rendering: pixelated; }
.ticket-body .code { font-family: ui-monospace, monospace; color: var(--muted); font-size: .8rem; }
.ticket.used .ticket-body img, .ticket.cancelled .ticket-body img { opacity: .25; }

.login-wrap { min-height: 80vh; display: grid; place-items: center; }
.login-wrap .card { width: 100%; max-width: 380px; }

/* ===================== Sitio público ===================== */
.public main.inner { padding-top: 8px; }
.hero {
  margin: 16px 0 32px; padding: 44px 28px; border-radius: 24px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #7b5cff 0%, #5b3df5 40%, #1b1340 100%);
}
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); letter-spacing: -.02em; margin-bottom: .6rem; }
.hero p { margin: 0; max-width: 560px; color: #e5e0ff; font-size: 1.05rem; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: 1.4rem; margin: 0; }

.event-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.event-card {
  display: flex; flex-direction: column; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.event-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 12px 30px rgba(27,19,64,.12); }
.cover-wrap { position: relative; }
.cover { aspect-ratio: 16 / 9; background-size: cover; background-position: center; background-color: var(--primary-soft); }
.cover.generated {
  display: grid; place-items: center;
  background: linear-gradient(135deg, hsl(var(--h) 75% 58%), hsl(calc(var(--h) + 50) 70% 38%));
}
.cover.generated span { font-size: 3.5rem; font-weight: 800; color: #ffffffcc; }
.cover.big { aspect-ratio: 21 / 8; border-radius: 22px; }
.cover.big.generated span { font-size: 5rem; }
.date-badge {
  position: absolute; top: 12px; left: 12px; background: #fff; border-radius: 12px;
  padding: 6px 10px; text-align: center; line-height: 1.05; box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.date-badge .d { display: block; font-size: 1.35rem; font-weight: 800; }
.date-badge .m { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--primary); }
.ribbon { position: absolute; top: 14px; right: 12px; background: var(--err); color: #fff; font-weight: 700; font-size: .78rem; padding: 4px 10px; border-radius: 99px; }
.event-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.event-card-body h3 { font-size: 1.15rem; margin: 0; }
.event-card .meta { display: grid; gap: 4px; color: var(--muted); font-size: .9rem; }
.event-card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.price { font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.price small { font-weight: 500; color: var(--muted); font-size: .78rem; }
.go { color: var(--primary); font-weight: 600; font-size: .9rem; }

.event-hero { margin: 12px 0 24px; }
.event-layout { display: grid; gap: 24px; }
@media (min-width: 860px) { .event-layout { grid-template-columns: 1fr 360px; align-items: start; } .buy-box { position: sticky; top: 20px; } }
.event-title { font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: -.02em; }
.facts { display: grid; gap: 14px; margin: 18px 0 24px; }
.fact { display: flex; gap: 12px; align-items: flex-start; }
.fact .ico { width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--primary-soft); display: grid; place-items: center; font-size: 1.2rem; }
.description { white-space: pre-line; font-size: 1.02rem; line-height: 1.65; }
.buy-box { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.buy-box h2 { font-size: 1.2rem; }
.ticket-types { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.ticket-types li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.ticket-types li.soldout { opacity: .55; }
.soldout-label { color: var(--err); font-weight: 600; }
.last { color: var(--warn); font-weight: 600; }
.btn.block { width: 100%; padding: 13px; }
.btn:disabled { opacity: .7; cursor: not-allowed; }

.site-footer { border-top: 1px solid var(--line); margin-top: 24px; }
.site-footer .inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .9rem; padding: 20px 16px 28px; }

/* Carga de imagen */
.image-field { display: grid; gap: 8px; }
.image-field .label { font-weight: 600; font-size: .9rem; display: grid; gap: 4px; }
.image-field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.dropzone {
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; max-height: 320px;
  border: 2px dashed #cfc8f5; border-radius: 14px; background: var(--primary-soft); cursor: pointer; overflow: hidden;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: #e4ddff; }
.dropzone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-empty { display: grid; gap: 4px; text-align: center; color: var(--primary); padding: 16px; }
.thumb { width: 72px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; }
.thumb.generated { display: grid; place-items: center; color: #fff; font-weight: 800;
  background: linear-gradient(135deg, hsl(var(--h) 75% 58%), hsl(calc(var(--h) + 50) 70% 38%)); }
.site-footer { color: var(--muted); }
.site-footer .credit strong { color: var(--text); }

/* ===================== Solicitudes (admin) ===================== */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.badge.pending { background: var(--warn-soft); color: var(--warn); }
.badge.approved { background: var(--ok-soft); color: var(--ok); }
.badge.rejected { background: var(--err-soft); color: var(--err); }
.req-table td { vertical-align: top; }
.req-table .msg { white-space: pre-line; font-size: .85rem; color: var(--muted); margin-top: 4px; }
.bulk-bar { display: grid; gap: 10px; margin-top: 14px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.tabs a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.tabs a:hover { text-decoration: none; }
.gallery-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.gallery-admin figure { margin: 0; position: relative; }
.gallery-admin img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.gallery-admin label { position: absolute; top: 6px; right: 6px; background: #fff; border-radius: 8px; padding: 2px 6px; font-size: .75rem; display: flex; gap: 4px; }
fieldset.group { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; margin: 0; display: grid; gap: 14px; }
fieldset.group legend { font-weight: 700; padding: 0 6px; }

/* ===================== Landing del evento ===================== */
.landing.theme-dark {
  --bg: #0f0b24; --surface: #1a1537; --line: #2e2856; --text: #f3f1ff; --muted: #a9a3cf;
  --primary: #8b70ff; --primary-soft: #2a2259;
  --ok: #4ade80; --ok-soft: #12351f; --warn: #fbbf24; --warn-soft: #3a2a0a; --err: #f87171; --err-soft: #3b1616;
  color-scheme: dark;
}
.landing.theme-dark input, .landing.theme-dark select, .landing.theme-dark textarea { background: #120e2a; }
.landing.theme-dark .btn:not(.primary):not(.wa) { background: var(--surface); color: var(--text); border-color: var(--line); }
.l-wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.preview-bar { background: var(--err); color: #fff; text-align: center; padding: 8px 16px; font-weight: 600; font-size: .9rem; }

.l-hero { position: relative; color: #fff; min-height: min(78vh, 640px); display: flex; align-items: flex-end; overflow: hidden; }
.l-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.l-hero-bg.generated { background: linear-gradient(135deg, hsl(var(--h) 75% 55%), hsl(calc(var(--h) + 60) 70% 25%)); }
.l-hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,6,30,.25) 0%, rgba(10,6,30,.55) 50%, rgba(10,6,30,.92) 100%); }
.l-hero-content { position: relative; width: 100%; padding-top: 72px; padding-bottom: 40px; }
.l-back { position: absolute; top: 18px; left: 16px; color: #fff; opacity: .85; font-size: .9rem; background: rgba(0,0,0,.25); padding: 6px 12px; border-radius: 99px; backdrop-filter: blur(6px); }
.l-back:hover { opacity: 1; text-decoration: none; }
.l-chip { display: inline-block; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); padding: 6px 12px; border-radius: 99px; font-weight: 600; font-size: .9rem; backdrop-filter: blur(6px); }
.l-hero h1 { font-size: clamp(2rem, 7vw, 3.6rem); letter-spacing: -.03em; margin: 14px 0 8px; line-height: 1.05; text-wrap: balance; overflow-wrap: anywhere; }
.l-venue { font-size: 1.05rem; opacity: .92; }
.l-countdown { display: flex; gap: 10px; margin-top: 20px; }
.l-countdown[hidden], .l-live[hidden] { display: none; }
.l-countdown div { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 12px; padding: 8px 10px; min-width: 62px; text-align: center; backdrop-filter: blur(6px); }
.l-countdown b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.l-countdown span { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; opacity: .8; }
.l-live { margin-top: 18px; font-weight: 700; color: #4ade80; }
.l-hero-cta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 24px; }
.l-cta { padding: 14px 26px; font-size: 1.05rem; border-radius: 14px; }
.l-from { font-weight: 600; opacity: .9; }
.l-badge { background: rgba(255,255,255,.18); padding: 10px 16px; border-radius: 12px; font-weight: 700; }

.l-main { padding-top: 12px; padding-bottom: 40px; }
.l-section { padding: 32px 0; border-bottom: 1px solid var(--line); }
.l-section:last-child { border-bottom: 0; }
.l-section h2 { font-size: 1.45rem; letter-spacing: -.01em; margin-bottom: 16px; }
.l-lineup { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.l-lineup li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-weight: 600; }
.l-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.l-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; display: block; }
.l-tickets { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 24px 20px; margin: 28px 0; scroll-margin-top: 16px; }
@media (min-width: 700px) { .l-tickets { padding: 30px 32px; } }
.l-form { margin-top: 8px; }
.l-done { text-align: center; padding: 8px 0; }
.l-done-ico { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; margin: 0 auto 10px; }
.l-pay { text-align: left; background: var(--primary-soft); border-radius: 14px; padding: 14px 16px; margin: 16px auto 8px; max-width: 520px; }
.l-pay-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); }
.l-pay-body { white-space: pre-line; margin-top: 6px; font-weight: 500; }
.l-map { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); margin: 6px 0 14px; aspect-ratio: 16 / 9; max-height: 360px; width: 100%; }
.l-map iframe { width: 100%; height: 100%; border: 0; display: block; }
.theme-dark .l-map iframe { filter: invert(.9) hue-rotate(180deg) saturate(.6); }
.l-faq { display: grid; gap: 8px; }
.l-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.l-faq summary { cursor: pointer; font-weight: 600; }
.l-faq details div { white-space: pre-line; color: var(--muted); margin-top: 8px; }
.l-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.l-footer .l-wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 28px; }
.l-footer .credit strong { color: var(--text); }

.l-sticky { display: none; }
@media (max-width: 859px) {
  .has-cta { padding-bottom: 76px; }
  .l-sticky {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; gap: 12px; align-items: center; justify-content: space-between;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(0,0,0,.12); transition: transform .2s ease;
  }
  .l-sticky.away { transform: translateY(110%); }
  .l-sticky div { display: grid; min-width: 0; }
  .l-sticky strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .l-sticky span { font-size: .82rem; color: var(--muted); }
  .l-sticky .btn { flex: none; }
}
