:root {
    --bg: #000;
    --surface: #1c1c1c;
    --surface-2: #242424;
    --bg-elevated: var(--surface);
    --bg-soft: var(--surface-2);
    --text: #fff;
    --text-muted: rgba(255, 255, 255, 0.5);
    --accent: #C6A75E;
    --accent-hover: #d4ba7a;
    --accent-soft: rgba(198, 167, 94, 0.14);
    --hairline: rgba(255, 255, 255, 0.10);
    --border: rgba(198, 167, 94, 0.35);
    --success: #6B8F71;
    --danger: #B85C5C;
    --paper-cream: #f3efe4;
    --paper-cream-deep: #e8e0d0;
    --paper-ink: #14120e;
    --paper-ink-soft: #1c1914;
    --paper-fiber: rgba(60, 48, 30, 0.18);
    --paper-shadow: rgba(20, 14, 8, 0.42);

    --r-sm: 4px;
    --r-16: 16px;
    --r-card: 16px;
    --r-lg: 24px;
    --r-80: 80px;
    --r-pill: 80px;
    --radius: var(--r-sm);

    --ease: cubic-bezier(0.44, 0, 0.56, 1);
    --t: 0.3s var(--ease);

    --font-display: "Manrope", "Manrope Placeholder", sans-serif;
    --font-body: "Manrope", "Manrope Placeholder", sans-serif;

    --gutter: 40px;
    --wrap: 1600px;
    --block: 1120px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-color: rgba(198, 167, 94, 0.62) transparent;
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(198, 167, 94, 0.42);
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 186, 122, 0.72);
    border-width: 2px;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.02em;
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s var(--ease);
}

a:hover {
    color: var(--accent);
}

@media (max-width: 809px) {
    :root {
        --gutter: 16px;
    }
}

img {
    max-width: 100%;
    display: block;
}

h1, h2, h3, p, ul, ol {
    margin: 0;
}

h1, h2, h3,
.display,
.display-md,
.display-sm,
.kn-title,
.kn-display,
.kn-h3,
.num {
    font-family: var(--font-display);
    font-weight: 500;
}

.kn-title {
    font-weight: 800;
}

.num {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

.nav {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem var(--gutter);
    background: rgba(11, 11, 11, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--hairline);
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.nav-brand:hover {
    color: inherit;
    opacity: 0.82;
}

.brand-logo {
    display: block;
    height: 26px;
    width: auto;
    max-width: 168px;
}

.brand-logo-auth {
    height: 28px;
    max-width: 180px;
    margin-bottom: 1.1rem;
}

.brand-logo-footer {
    height: 28px;
    max-width: 180px;
}

.brand-logo-ticket {
    height: 22px;
    max-width: 140px;
    margin-bottom: 1.25rem;
}

.btn-tickets {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    height: 56px;
    padding: 2px 32px 2px 70px;
    border-radius: var(--r-80);
    background: #fff;
    color: #000;
    line-height: 1;
    overflow: hidden;
    text-decoration: none;
    will-change: transform;
}

.btn-tickets:hover {
    color: #000;
}

.btn-tickets-ico {
    position: absolute;
    z-index: 1;
    top: 2px;
    bottom: 2px;
    left: 2px;
    display: grid;
    place-items: center;
    width: 52px;
    padding: 14px;
    border-radius: var(--r-80);
    background: #000;
    color: #fff;
    transition: width 0.45s var(--ease), right 0.45s var(--ease);
}

.btn-tickets:hover .btn-tickets-ico {
    width: unset;
    right: 2px;
}

.btn-tickets-ico svg {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
}

.btn-tickets-label {
    position: relative;
    z-index: 5;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1;
    color: #000;
    transition: color 0.35s var(--ease);
}

.btn-tickets:hover .btn-tickets-label {
    color: #fff;
}

.btn-tickets.is-sm {
    height: 48px;
    padding: 2px 24px 2px 62px;
}

.btn-tickets.is-sm .btn-tickets-ico {
    width: 44px;
    padding: 12px;
}

.btn-tickets.is-sm .btn-tickets-ico svg {
    width: 20px;
    height: 20px;
}

.btn-tickets.is-sm .btn-tickets-label {
    font-size: 14px;
}

.nav-end {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.nav-user {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.admin-tabs {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    padding: 0.25rem;
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.04);
}

.admin-tabs a {
    border-radius: var(--r-pill);
    padding: 0.45rem 0.95rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    transition: background var(--t), color var(--t);
}

.admin-tabs a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.admin-tabs a.is-on {
    background: var(--accent);
    color: #000;
}

.admin-menu-logout {
    display: none;
}

.admin-menu-toggle {
    display: none;
    width: 2.7rem;
    height: 2.7rem;
    padding: 0.65rem;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.admin-menu-toggle span {
    display: block;
    width: 100%;
    height: 1px;
    margin: 0.24rem 0;
    background: var(--accent);
    transition: transform var(--t), opacity var(--t);
}

.admin-menu-toggle.is-open span:nth-child(1) {
    transform: translateY(0.49rem) rotate(45deg);
}

.admin-menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.admin-menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-0.49rem) rotate(-45deg);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    padding: 0.85rem 1.6rem;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1;
    cursor: pointer;
    background: transparent;
    color: var(--text);
    transition: background var(--t), color var(--t), border-color var(--t), transform var(--t);
}

.btn:active {
    transform: scale(0.97);
}

.btn-gold {
    background: var(--accent);
    color: #000;
}

.btn-gold:hover {
    background: var(--accent-hover);
    color: #000;
}

.btn-ghost {
    border-color: var(--hairline);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--border);
    background: var(--accent-soft);
    color: var(--accent);
}

.btn-sm {
    padding: 0.55rem 1.1rem;
    font-size: 0.76rem;
}

.btn-block {
    width: 100%;
}

/* —— Card base —— */
.card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    padding: 1.5rem;
    transition: transform var(--t), border-color var(--t), background var(--t);
}

.card-lg {
    border-radius: var(--r-lg);
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.card-hover:hover {
    transform: translateY(-2px);
    border-color: var(--border);
    background: var(--surface-2);
}

.card-flat {
    background: rgba(255, 255, 255, 0.03);
}

.kicker {
    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.display {
    font-size: clamp(4.4rem, 16vw, 11.5rem);
    line-height: 0.82;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.display-md {
    font-size: clamp(2.4rem, 7vw, 5.2rem);
    line-height: 0.95;
    font-weight: 600;
    letter-spacing: -0.04em;
}

.display-sm {
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -0.035em;
    margin-bottom: 1.25rem;
}

.lede {
    max-width: 38rem;
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-top: 1.2rem;
}

.lede-soft {
    margin-top: 0.8rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-link {
    color: var(--accent);
    border-bottom: 1px solid transparent;
}

.text-link:hover {
    border-bottom-color: var(--accent);
}

.marquee {
    overflow: hidden;
    border-bottom: 1px solid var(--hairline);
    padding: 0.75rem 0;
}

.marquee-track {
    display: flex;
    gap: 1.2rem;
    width: max-content;
    animation: marquee 32s linear infinite;
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    will-change: transform;
}

.marquee-group {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex: 0 0 auto;
    padding-right: 1.2rem;
}

.marquee-dot {
    color: var(--accent);
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.hero {
    padding: clamp(3rem, 8vw, 7rem) var(--gutter) 4rem;
    border-bottom: 1px solid var(--hairline);
}

.page-narrow,
.event-list,
.ticket-page,
.admin-wrap {
    padding: clamp(3rem, 7vw, 6rem) var(--gutter);
}

.page-narrow {
    max-width: 52rem;
}

.faq {
    display: grid;
    gap: 0.7rem;
    margin-top: 2.5rem;
    max-width: 56rem;
}

.faq-item {
    padding: 0;
    overflow: hidden;
}

.faq-item.is-open {
    border-color: var(--border);
}

.faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
    padding: 1.25rem 1.4rem;
    background: none;
    border: 0;
    color: inherit;
    font-family: var(--font-display);
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    text-align: left;
    cursor: pointer;
    transition: color var(--t);
}

.faq-q:hover {
    color: var(--accent);
}

.faq-icon {
    display: block;
    position: relative;
    flex: 0 0 auto;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    border: 1px solid var(--hairline);
    transition: border-color var(--t), transform var(--t);
}

.faq-icon::before,
.faq-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.7rem;
    height: 1px;
    background: currentColor;
    transform: translate(-50%, -50%);
    transition: opacity var(--t), transform var(--t);
}

.faq-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.faq-item.is-open .faq-icon {
    border-color: var(--border);
}

.faq-item.is-open .faq-icon::after {
    opacity: 0;
}

.faq-a {
    height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
}

.faq-item.is-open .faq-a {
    height: auto;
    opacity: 1;
    visibility: visible;
}

.faq-a p {
    color: var(--text-muted);
    padding: 0 1.4rem 1.4rem;
    max-width: 44rem;
}

.form-card h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.035em;
}

.form-lead,
.form-note {
    color: var(--text-muted);
    margin: 0.8rem 0 1.2rem;
    font-size: 0.95rem;
}

.form-note {
    font-size: 0.8rem;
}

.reg-form,
.auth-card form,
.admin-form,
.manual-code {
    display: grid;
    gap: 1rem;
}

label span,
.admin-form label span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: -0.01em;
    margin-bottom: 0.4rem;
}

input,
textarea,
select {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--hairline);
    border-radius: var(--r-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 0.7rem 0.85rem;
    outline: none;
    transition: border-color var(--t), background var(--t), box-shadow var(--t);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    padding: 0;
    accent-color: var(--accent);
}

input:hover,
textarea:hover,
select:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                      linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% + 1px), calc(100% - 13px) calc(50% + 1px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 2.2rem;
}

/* —— Chips pill —— */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: var(--r-pill);
    border: 1px solid var(--hairline);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 0.28rem 0.7rem;
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
}

.chip-gold {
    border-color: var(--border);
    background: var(--accent-soft);
    color: var(--accent);
}

.chip-ok {
    border-color: rgba(107, 143, 113, 0.35);
    background: rgba(107, 143, 113, 0.14);
    color: #8FB395;
}

.chip-bad {
    border-color: rgba(184, 92, 92, 0.35);
    background: rgba(184, 92, 92, 0.14);
    color: #D08A8A;
}

/* —— Panel: card que envuelve tablas y formularios —— */
.panel {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--hairline);
}

.panel-head h2,
.panel-head h1 {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.panel-body {
    padding: 1.4rem;
}

.panel-empty {
    padding: 2.5rem 1.4rem;
    color: var(--text-muted);
    text-align: center;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s var(--ease), visibility 0.22s var(--ease);
}

.modal.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-dialog {
    position: relative;
    width: min(100%, 54rem);
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    transform: translateY(10px) scale(0.98);
    transition: transform 0.28s var(--ease);
}

.modal.is-open .modal-dialog {
    transform: translateY(0) scale(1);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--hairline);
}

.modal-head h2 {
    font-size: 1.05rem;
    font-weight: 600;
}

.modal-close {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--hairline);
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    border-color: var(--border);
    color: var(--accent);
}

.modal-body {
    padding: 1.4rem;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 2rem var(--gutter) 3rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--hairline);
}

.flash {
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    background: var(--surface);
    font-size: 0.92rem;
}

.flash-ok {
    color: #8FB395;
    border-color: rgba(107, 143, 113, 0.35);
    background: rgba(107, 143, 113, 0.12);
}

.flash-err {
    color: #D08A8A;
    border-color: rgba(184, 92, 92, 0.35);
    background: rgba(184, 92, 92, 0.12);
}

.flash-warn {
    color: var(--accent);
    border-color: var(--border);
    background: var(--accent-soft);
}

/* —— Ticket —— */
.ticket-page {
    max-width: 34rem;
    margin: 0 auto;
}

.pass-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.pass-head .kicker {
    margin-bottom: 0;
}

.pass-name {
    font-size: clamp(1.9rem, 6vw, 2.8rem);
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -0.04em;
}

.pass-sub {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.ticket-cities {
    margin: 0.35rem 0 1.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ticket-qr-wrap {
    margin: 1.75rem 0;
    padding: 1.1rem;
    background: #fff;
    border-radius: var(--r-card);
    display: grid;
    place-items: center;
}

.ticket-qr {
    width: min(100%, 260px);
    height: auto;
    border-radius: 4px;
}

.ticket-back {
    margin-top: 1.5rem;
    text-align: center;
}

.ticket-footer {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    justify-content: center;
    padding-top: 1rem;
}

.developed-by {
    color: var(--text-muted);
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    opacity: 0.52;
    text-transform: uppercase;
}

.techne-logo {
    width: min(100%, 4.5rem);
    max-height: 1.25rem;
    height: auto;
    object-fit: contain;
}

/* Ticket a pantalla completa: sin nav, card centrada, sin scroll en viewports típicos */
body.is-ticket {
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.is-ticket .ticket-page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    max-width: 26rem;
    margin: 0 auto;
    padding: clamp(0.5rem, 1.5dvh, 0.85rem) var(--gutter);
}

body.is-ticket .ticket-page .pass {
    padding: clamp(0.85rem, 2dvh, 1.25rem);
}

body.is-ticket .brand-logo-ticket {
    height: 18px;
    max-width: 120px;
    margin-bottom: 0.5rem;
}

body.is-ticket .ticket-cities {
    margin: 0 0 0.5rem;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
}

body.is-ticket .pass-head {
    margin-bottom: 0.35rem;
}

body.is-ticket .pass-name {
    font-size: clamp(1.25rem, 4.5dvh, 1.65rem);
}

body.is-ticket .pass-sub {
    margin-top: 0.25rem;
    font-size: 0.85rem;
}

body.is-ticket .ticket-qr-wrap {
    margin: clamp(0.35rem, 1.2dvh, 0.65rem) 0;
    padding: clamp(0.45rem, 1dvh, 0.65rem);
}

body.is-ticket .ticket-qr {
    width: min(100%, min(42dvh, 11.5rem));
    max-height: min(42dvh, 11.5rem);
    height: auto;
    aspect-ratio: 1;
}

body.is-ticket .ticket-meta {
    margin: clamp(0.35rem, 1dvh, 0.65rem) 0 0;
}

body.is-ticket .ticket-meta li {
    padding: 0.35rem 0;
}

body.is-ticket .ticket-meta span {
    font-size: 0.78rem;
}

body.is-ticket .ticket-meta strong {
    font-size: 0.82rem;
}

body.is-ticket .ticket-page .form-note {
    margin-top: 0.5rem;
    font-size: 0.72rem;
    line-height: 1.35;
}

body.is-ticket .ticket-back {
    display: none;
}

body.is-ticket .site-footer.ticket-footer {
    flex-shrink: 0;
    padding: 0.35rem var(--gutter) max(0.5rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--hairline);
    gap: 0.15rem;
}

body.is-ticket .flash {
    margin-bottom: 0.5rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
}

@media (max-height: 640px) {
    body.is-ticket .ticket-meta li:nth-child(4),
    body.is-ticket .ticket-meta li:nth-child(5) {
        display: none;
    }

    body.is-ticket .ticket-page .form-note {
        display: none;
    }
}

@media (max-width: 809px) {
    body.is-ticket .ticket-page {
        max-width: none;
        width: 100%;
        padding-left: max(10px, env(safe-area-inset-left));
        padding-right: max(10px, env(safe-area-inset-right));
    }

    body.is-ticket .ticket-page .pass {
        width: 100%;
    }
}

.error-page {
    max-width: 40rem;
    margin: 0 auto;
}

.error-actions {
    margin-top: 1.75rem;
}

.manual-card {
    padding: 1.25rem;
}

.checkin-manual {
    margin-top: 0.25rem;
}

.checkin-manual.is-manual-open #manual-toggle,
#manual-toggle[hidden] {
    display: none !important;
}

.manual-panel {
    margin-top: 0;
    will-change: height, opacity, transform;
}

.manual-panel[hidden] {
    display: none;
}

.manual-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.manual-panel-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.manual-close-link {
    margin-top: 0.15rem;
}

.ticket-meta {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.ticket-meta li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--hairline);
}

.ticket-meta li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.ticket-meta span {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.ticket-meta strong {
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

.event-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    max-width: 76rem;
}

.event-row {
    display: grid;
    gap: 0.5rem;
    padding: 1.6rem;
}

.event-row-date {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.event-row-title {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.event-row-go {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 0.6rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 2.5rem;
}

.stat-grid article {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    padding: 1.1rem 1.2rem 1.2rem;
    transition: transform var(--t), border-color var(--t), background var(--t);
}

.stat-grid article:hover {
    transform: translateY(-2px);
    border-color: var(--border);
    background: var(--surface-2);
}

.stat-grid span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.stat-grid strong {
    display: block;
    font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
    font-size: 2.3rem;
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.04em;
    margin-top: 0.5rem;
}

.admin-wrap {
    max-width: 90rem;
    margin: 0 auto;
    padding-top: clamp(2rem, 4vw, 3.5rem);
}

.admin-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.admin-head .display-sm {
    margin-bottom: 0;
}

.admin-wrap .panel + .panel,
.admin-form .panel + .panel {
    margin-top: 1rem;
}

.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.export-form {
    display: flex;
    align-items: flex-end;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.export-form label {
    flex: 1 1 240px;
}

.table-wrap {
    overflow: auto;
    max-height: 70vh;
}

.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.data th {
    position: sticky;
    top: 0;
    z-index: 2;
    text-align: left;
    background: var(--surface-2);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.76rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--hairline);
    white-space: nowrap;
}

.data td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--hairline);
    vertical-align: middle;
}

.data tbody tr {
    transition: background var(--t);
}

.data tbody tr:hover {
    background: rgba(255, 255, 255, 0.035);
}

.data tbody tr:last-child td {
    border-bottom: 0;
}

.data a:hover {
    color: var(--accent);
}

.cell-strong {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.cell-muted {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
    letter-spacing: -0.02em;
}

.td-actions {
    width: 1%;
    white-space: nowrap;
}

.td-actions > * + * {
    margin-left: 0.8rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin: 1.2rem 0 1.5rem;
    padding: 0.9rem 1rem;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
}

.filters input,
.filters select {
    min-width: 160px;
    width: auto;
    flex: 1 1 160px;
    border-radius: var(--r-pill);
    padding: 0.55rem 0.95rem;
    font-size: 0.88rem;
}

.filters select {
    padding-right: 2.2rem;
}

@media (max-width: 720px) {
    .filters {
        border-radius: var(--r-lg);
    }
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    z-index: 2;
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    place-items: center;
    transform: translateY(-50%);
    color: var(--accent);
    background: transparent;
    border: 0;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: color var(--t), background var(--t);
}

.password-toggle .action-icon {
    width: 1.2rem;
    height: 1.2rem;
    stroke-width: 2;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.password-toggle[aria-pressed="true"] {
    color: var(--text);
}

@media (min-width: 800px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
    .form-grid .wide {
        grid-column: 1 / -1;
    }
}

.repeat {
    display: grid;
    gap: 0.6rem;
    margin: 0.6rem 0 0.8rem;
}

.repeat-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

@media (min-width: 800px) {
    .repeat-row {
        grid-template-columns: repeat(3, 1fr);
    }
    .repeat-row.repeat-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.form-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 2rem;
}

.check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.check input {
    width: auto;
}

.inline-form {
    display: inline;
}

.linkish {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: 0;
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
    padding: 0;
}

.linkish:hover {
    color: var(--accent);
}

.link-danger:hover {
    color: var(--danger);
}

.action-icon {
    width: 0.95rem;
    height: 0.95rem;
    flex: 0 0 auto;
}

.is-auth,
.is-checkin {
    min-height: 100vh;
    align-content: start;
}

.is-auth,
.is-checkin {
    display: grid;
    place-items: center;
}

.auth-shell {
    width: 100%;
    display: grid;
    place-items: center;
    padding: clamp(2rem, 8vh, 5rem) 1.25rem;
}

.auth-card {
    width: min(100%, 26rem);
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: clamp(1.75rem, 5vw, 2.5rem);
}

.auth-card h1 {
    font-size: clamp(1.7rem, 4vw, 2.2rem);
    letter-spacing: -0.035em;
}

.auth-brand {
    margin-bottom: 1.1rem;
}

.checkin-app {
    width: 100%;
    max-width: 480px;
    padding: 1.25rem 1.25rem 4rem;
}

.checkin-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.checkin-head .display-sm {
    font-size: clamp(1.25rem, 4.2vw, 1.65rem);
    line-height: 1.15;
    margin-bottom: 0;
}

.checkin-recent {
    margin: 1.25rem 0 0;
    padding: 1rem 1rem 0.35rem;
}

.checkin-recent-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.checkin-recent-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.checkin-recent-all {
    font-size: 0.82rem;
    white-space: nowrap;
}

.checkin-history-empty {
    margin: 0;
    padding: 0.5rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    text-align: center;
}

.checkin-history-wrap {
    max-height: min(70vh, 32rem);
}

.checkin-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.85rem 0 0.65rem;
}

.checkin-pager-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.checkin-recent-wrap {
    max-height: none;
    margin: 0 -0.35rem;
}

.checkin-recent-table {
    font-size: 0.82rem;
}

.checkin-recent-table th {
    font-size: 0.7rem;
    padding: 0.55rem 0.65rem;
}

.checkin-recent-table td {
    padding: 0.65rem 0.65rem;
}

.checkin-recent-empty td {
    color: var(--text-muted);
    text-align: center;
    font-size: 0.85rem;
    padding: 1rem 0.65rem 1.1rem;
}

.qr-reader-shell {
    position: relative;
    width: 100%;
    margin: 0 0 1.25rem;
    transform-origin: center center;
}

.qr-scan-flash {
    position: absolute;
    inset: 0;
    z-index: 4;
    border-radius: var(--r-lg);
    pointer-events: none;
    opacity: 0;
}

.qr-reader-shell.is-scan-ok .qr-scan-flash {
    background: rgba(143, 179, 149, 0.35);
    animation: qr-scan-pulse 0.55s ease-out;
}

.qr-reader-shell.is-scan-warn .qr-scan-flash {
    background: rgba(198, 167, 94, 0.32);
    animation: qr-scan-pulse 0.55s ease-out;
}

.qr-reader-shell.is-scan-bad .qr-scan-flash {
    background: rgba(208, 138, 138, 0.32);
    animation: qr-scan-pulse 0.55s ease-out;
}

@keyframes qr-scan-pulse {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }
    35% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .qr-scan-flash {
        display: none;
    }
}

.qr-reader {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.qr-reader > div {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
}

.qr-reader #reader__scan_region {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.qr-reader #reader__scan_region video,
.qr-reader video,
.qr-reader img,
.qr-reader canvas {
    width: 100% !important;
    height: 100% !important;
    margin: 0 auto !important;
    object-fit: cover;
    object-position: center;
    border-radius: calc(var(--r-lg) - 1px);
}

.qr-reader #qr-shaded-region {
    border-color: rgba(255, 255, 255, 0.55) !important;
}

.scan-name-toast {
    margin: -0.35rem 0 1rem;
    padding: 0.85rem 1rem 0.95rem;
    text-align: center;
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: var(--surface);
}

.scan-name-toast-kicker {
    margin: 0 0 0.25rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.scan-name-toast-name {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 5vw, 1.75rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.scan-name-toast.is-ok {
    border-color: rgba(107, 143, 113, 0.45);
    background: rgba(107, 143, 113, 0.1);
}

.scan-name-toast.is-ok .scan-name-toast-name {
    color: #9fb9a3;
}

.scan-name-toast.is-warn {
    border-color: rgba(198, 167, 94, 0.45);
    background: rgba(198, 167, 94, 0.1);
}

.scan-name-toast.is-warn .scan-name-toast-name {
    color: var(--accent);
}

.scan-name-toast.is-bad {
    border-color: rgba(184, 92, 92, 0.4);
    background: rgba(184, 92, 92, 0.1);
}

.scan-name-toast.is-bad .scan-name-toast-name {
    color: #d08a8a;
}

.checkin-flash {
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    background: var(--surface);
    margin-bottom: 1rem;
}

.checkin-flash strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.checkin-flash span {
    display: block;
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 0.2rem;
}

.checkin-flash.is-ok {
    border-color: rgba(107, 143, 113, 0.4);
    background: rgba(107, 143, 113, 0.14);
    color: #8FB395;
}

.checkin-flash.is-used {
    border-color: var(--border);
    background: var(--accent-soft);
    color: var(--accent);
}

.checkin-flash.is-bad {
    border-color: rgba(184, 92, 92, 0.4);
    background: rgba(184, 92, 92, 0.14);
    color: #D08A8A;
}

.nav-admin {
    flex-wrap: wrap;
}

.nav-checkin {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    width: 100%;
    gap: 0.5rem;
}

.nav-checkin-start {
    justify-self: start;
    min-width: 0;
}

.nav-checkin .nav-brand {
    justify-self: center;
    grid-column: 2;
    grid-row: 1;
}

.nav-checkin .nav-end {
    position: static;
    justify-self: end;
    grid-column: 3;
    grid-row: 1;
}

.nav-checkin .nav-back {
    padding-inline: 0.85rem;
}

@media (max-width: 720px) {
    .nav-admin {
        position: relative;
        flex-wrap: nowrap;
    }

    .nav-admin .nav-brand {
        min-width: 0;
        order: 1;
    }

    .nav-admin .brand-logo {
        max-width: 132px;
        height: 22px;
    }

    .nav-admin .nav-user {
        display: none;
    }

    .nav-admin .nav-end {
        display: none;
        order: 3;
    }

    .nav-admin .nav-end .btn-ghost {
        display: none;
    }

    .nav-admin .btn-ghost {
        padding: 0.55rem 0.85rem;
    }

    .admin-menu-toggle {
        display: block;
        order: 2;
        margin-left: auto;
        flex: 0 0 auto;
    }

    .nav-admin .admin-tabs {
        position: absolute;
        top: calc(100% + 0.5rem);
        left: var(--gutter);
        right: var(--gutter);
        z-index: 70;
        display: grid;
        gap: 0.2rem;
        padding: 0.45rem;
        border-radius: var(--r-card);
        background: var(--surface);
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-0.5rem) scale(0.98);
        transform-origin: top center;
        pointer-events: none;
        transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s var(--ease);
    }

    .nav-admin .admin-tabs.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    .nav-admin .admin-tabs a {
        padding: 0.75rem 0.9rem;
        border-radius: var(--r-sm);
    }

    .nav-admin .admin-tabs .admin-menu-logout {
        display: block;
        margin-top: 0.25rem;
        border-top: 1px solid var(--hairline);
        color: var(--text-muted);
    }
}

/* —— Base de movimiento ——
   Los elementos con [data-reveal] arrancan visibles. Solo motion.js, y solo si
   GSAP cargó, agrega .has-motion y toma el control de la entrada. */
.has-motion [data-reveal] {
    opacity: 0;
    visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .has-motion [data-reveal] {
        opacity: 1;
        visibility: visible;
    }
    .marquee-track,
    .photo-rail-track {
        animation: none;
    }
}

@media print {
    .nav, .site-footer, .hero-cta, .form-note a { display: none; }
    body { background: #fff; color: #111; }
    .has-motion [data-reveal] { opacity: 1; visibility: visible; }
}
