/* ==========================================================================
   Ticketa — sistema de diseño
   Fondo aireado con degradados suaves, tarjetas blancas flotantes,
   tipografía geométrica bold. Ver DESIGN.md.
   ========================================================================== */

:root {
    /* Lienzo y superficies */
    --canvas: #f2f3f7;
    --surface: #ffffff;
    --surface-soft: #f7f8fa;
    --surface-sunken: #f1f2f5;

    /* Estructura */
    --border: #ecedf1;
    --border-strong: #e2e3e9;

    /* Tinta */
    --ink: #0e0e12;
    --ink-soft: #2b2c33;
    --muted: #83868f;
    --muted-light: #a7aab3;

    /* Negro de UI y marca */
    --ui-black: #101014;
    --nav-track: #14141a;
    --brand: #e1332b;
    --brand-dark: #b3241e;

    /* Pasteles de estado */
    --green-bg: #e7f6ec;
    --green-ink: #1b7a3d;
    --blue-bg: #e8f0fe;
    --blue-ink: #1d4ed8;
    --yellow-bg: #fdf3d7;
    --yellow-ink: #8a6100;
    --red-bg: #fdecec;
    --red-ink: #b3241e;

    /* Tipografía */
    --font-sans: 'Outfit', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;

    /* Métricas */
    --radius-card: 20px;
    --radius-field: 12px;
    --radius-chip: 999px;
    --shadow-card: 0 1px 2px rgba(17, 17, 26, 0.04), 0 10px 28px rgba(17, 17, 26, 0.05);
    --shadow-lift: 0 2px 4px rgba(17, 17, 26, 0.04), 0 14px 34px rgba(17, 17, 26, 0.08);
    --shadow-nav: 0 2px 6px rgba(17, 17, 26, 0.06), 0 14px 30px rgba(17, 17, 26, 0.10);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    min-height: 100vh;
    background: var(--canvas);
    color: var(--ink-soft);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Lavados de color del lienzo. Capa fija, nunca intercepta el puntero. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(60vw 46vh at 12% 0%, rgba(197, 190, 232, 0.42), transparent 62%),
        radial-gradient(58vw 44vh at 92% 4%, rgba(180, 205, 234, 0.44), transparent 60%),
        radial-gradient(70vw 50vh at 70% 100%, rgba(233, 205, 218, 0.34), transparent 64%);
}

h1, h2, h3, h4 {
    margin: 0;
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.12;
}

p {
    margin: 0 0 1em;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--ink);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

svg.icon {
    display: block;
    flex: none;
}

::selection {
    background: rgba(225, 51, 43, 0.16);
}

/* --------------------------------------------------------------------------
   Navegación superior flotante
   -------------------------------------------------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    flex: none;
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    background: var(--ui-black);
    color: #fff;
    border-radius: 50%;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand__name {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 auto;
    padding: 5px;
    background: var(--nav-track);
    border-radius: var(--radius-chip);
    box-shadow: var(--shadow-nav);
}

.nav__item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-chip);
    color: #b9bbc2;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 200ms var(--ease), color 200ms var(--ease);
}

.nav__item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
}

.nav__item.is-active {
    background: #fff;
    color: var(--ink);
    font-weight: 600;
}

.nav__item.is-active:hover {
    background: #fff;
}

.nav__item--muted {
    color: #6b6d77;
    cursor: default;
}

.nav__item--muted:hover {
    background: transparent;
    color: #6b6d77;
}

.topbar__end {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.circle-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--ink-soft);
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.circle-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lift);
}

.avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    background: var(--ui-black);
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   Contenedor
   -------------------------------------------------------------------------- */

.main {
    padding: 12px 28px 96px;
}

.main__inner {
    max-width: 1160px;
    margin: 0 auto;
}

.main__inner--narrow {
    max-width: 720px;
}

/* --------------------------------------------------------------------------
   Encabezado de página
   -------------------------------------------------------------------------- */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin: 16px 0 28px;
}

.page-head__eyebrow {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}

.page-head__eyebrow a {
    color: var(--muted);
}

.page-head h1 {
    font-size: 38px;
}

.page-head__sub {
    margin-top: 10px;
    color: var(--muted);
    font-size: 15px;
    max-width: 62ch;
}

.page-head__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 19px;
    border: 1px solid transparent;
    border-radius: var(--radius-chip);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
    transition: background 180ms var(--ease), border-color 180ms var(--ease),
                color 180ms var(--ease), transform 140ms var(--ease), box-shadow 180ms var(--ease);
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn--primary {
    background: var(--ui-black);
    color: #fff;
}

.btn--primary:hover {
    background: #26262e;
}

.btn--secondary {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--ink);
}

.btn--secondary:hover {
    background: var(--surface-soft);
    border-color: #d5d6dd;
}

.btn--ghost {
    background: transparent;
    color: var(--muted);
}

.btn--ghost:hover {
    background: var(--surface-sunken);
    color: var(--ink);
}

.btn--danger {
    background: transparent;
    color: var(--brand);
}

.btn--danger:hover {
    background: var(--red-bg);
}

.btn--sm {
    padding: 7px 13px;
    font-size: 13px;
}

.btn--block {
    width: 100%;
}

.btn[disabled] {
    opacity: 0.45;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Tarjetas y métricas
   -------------------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 26px;
    border-bottom: 1px solid var(--border);
}

.card__title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--ink);
}

.card__body {
    padding: 26px;
}

.card__body--tight {
    padding: 18px 26px;
}

.bento {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat {
    position: relative;
    padding: 22px 24px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    transition: transform 220ms var(--ease), box-shadow 220ms var(--ease);
}

.stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
}

.stat__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}

.stat__chip {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    background: var(--ui-black);
    color: #fff;
    border-radius: 50%;
}

.stat__value {
    margin-top: 14px;
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.035em;
    color: var(--ink);
}

.stat__hint {
    margin-top: 9px;
    font-size: 13px;
    color: var(--muted-light);
}

/* --------------------------------------------------------------------------
   Tablas
   -------------------------------------------------------------------------- */

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    padding: 13px 26px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
    white-space: nowrap;
}

.table td {
    padding: 16px 26px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.table tbody tr {
    transition: background 150ms var(--ease);
}

.table tbody tr:hover {
    background: var(--surface-soft);
}

.table__title {
    display: block;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.table__meta {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--muted);
}

.table__actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.table td.is-right,
.table th.is-right {
    text-align: right;
}

.mono {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   Badges, medidor y segmentado
   -------------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-chip);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge--neutral { background: var(--surface-sunken); color: var(--muted); }
.badge--green   { background: var(--green-bg);  color: var(--green-ink); }
.badge--blue    { background: var(--blue-bg);   color: var(--blue-ink); }
.badge--yellow  { background: var(--yellow-bg); color: var(--yellow-ink); }
.badge--red     { background: var(--red-bg);    color: var(--red-ink); }

.meter {
    width: 128px;
    height: 5px;
    background: var(--surface-sunken);
    border-radius: var(--radius-chip);
    overflow: hidden;
}

.meter__fill {
    height: 100%;
    background: var(--ui-black);
    border-radius: var(--radius-chip);
    transition: width 500ms var(--ease);
}

.meter__fill--full {
    background: var(--brand);
}

.segmented {
    display: inline-flex;
    padding: 4px;
    background: var(--surface-sunken);
    border-radius: var(--radius-chip);
}

.segmented__option {
    position: relative;
    display: flex;
}

.segmented__option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented__option span {
    padding: 7px 16px;
    border-radius: var(--radius-chip);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: background 200ms var(--ease), color 200ms var(--ease);
    white-space: nowrap;
}

.segmented__option input:checked + span {
    background: var(--ui-black);
    color: #fff;
    font-weight: 600;
}

.segmented__option input:focus-visible + span {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Formularios
   -------------------------------------------------------------------------- */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.field--full {
    grid-column: 1 / -1;
}

.field__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.field__optional {
    margin-left: 5px;
    font-weight: 400;
    color: var(--muted-light);
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-field);
    color: var(--ink);
    font-family: inherit;
    font-size: 14.5px;
    line-height: 1.5;
    transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.textarea {
    min-height: 118px;
    resize: vertical;
}

.select {
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2383868f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 4px rgba(16, 16, 20, 0.07);
}

.input.has-error,
.select.has-error,
.textarea.has-error {
    border-color: var(--brand);
}

.input::placeholder,
.textarea::placeholder {
    color: var(--muted-light);
}

/* Campo principal sin caja, al estilo «Enter Ticket Name». */
.input--title {
    padding: 6px 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.input--title:focus {
    box-shadow: none;
    border-bottom-color: var(--ink);
}

.input--title::placeholder {
    color: #c9cbd2;
    font-weight: 500;
}

.field__help {
    font-size: 12.5px;
    color: var(--muted);
}

.field__error {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: var(--brand);
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .input {
    border-radius: var(--radius-field) 0 0 var(--radius-field);
}

.input-group .select {
    width: auto;
    border-left: 0;
    border-radius: 0 var(--radius-field) var(--radius-field) 0;
}

.input-group__prefix {
    display: grid;
    place-items: center;
    padding: 0 13px;
    background: var(--surface-soft);
    border: 1px solid var(--border-strong);
    border-right: 0;
    border-radius: var(--radius-field) 0 0 var(--radius-field);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.input-group__prefix + .input {
    border-radius: 0;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 26px;
    background: var(--surface-soft);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-card) var(--radius-card);
}

.form-section {
    padding: 26px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
    border-bottom: 0;
}

.form-section__title {
    margin-bottom: 4px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--ink);
}

.form-section__note {
    margin-bottom: 22px;
    font-size: 13.5px;
    color: var(--muted);
    max-width: 60ch;
}

/* --------------------------------------------------------------------------
   Filtros
   -------------------------------------------------------------------------- */

.filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.search {
    position: relative;
    flex: 1 1 260px;
    max-width: 340px;
}

.search .input {
    padding-left: 40px;
    border-radius: var(--radius-chip);
}

.search__icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--muted-light);
    pointer-events: none;
}

.filters .select {
    border-radius: var(--radius-chip);
}

/* --------------------------------------------------------------------------
   Vacío, avisos y paginación
   -------------------------------------------------------------------------- */

.empty {
    padding: 76px 32px;
    text-align: center;
}

.empty__mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 20px;
    background: var(--ui-black);
    color: #fff;
    border-radius: 16px;
}

.empty__title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--ink);
}

.empty__text {
    margin: 9px auto 24px;
    max-width: 46ch;
    color: var(--muted);
    font-size: 14.5px;
}

.notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 17px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
}

.notice--info    { background: var(--blue-bg);   color: var(--blue-ink); }
.notice--warning { background: var(--yellow-bg); color: var(--yellow-ink); }
.notice--danger  { background: var(--red-bg);    color: var(--red-ink); }

.notice--muted {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
}

.flash-stack {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(390px, calc(100vw - 40px));
}

.flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lift);
    font-size: 14px;
    animation: flash-in 420ms var(--ease) both;
}

.flash--success { border-left: 3px solid var(--green-ink); }
.flash--error   { border-left: 3px solid var(--brand); }

.flash__close {
    margin-left: auto;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: var(--muted-light);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

@keyframes flash-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    font-size: 13.5px;
    color: var(--muted);
}

.pager__links {
    display: flex;
    gap: 8px;
}

/* --------------------------------------------------------------------------
   Detalle de evento
   -------------------------------------------------------------------------- */

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}

.dl {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 13px 16px;
    font-size: 14px;
}

.dl dt {
    color: var(--muted);
}

.dl dd {
    margin: 0;
    color: var(--ink-soft);
    font-weight: 500;
}

.cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface-sunken);
}

.divider {
    height: 1px;
    margin: 22px 0;
    background: var(--border);
    border: 0;
}

/* --------------------------------------------------------------------------
   Pantallas centradas (login, instalación, error)
   -------------------------------------------------------------------------- */

.centered {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
}

.auth-card__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin-bottom: 26px;
}

.auth-card__panel {
    padding: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.auth-card__title {
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -0.03em;
    text-align: center;
}

.auth-card__text {
    margin: 9px 0 26px;
    text-align: center;
    font-size: 14.5px;
    color: var(--muted);
}

.auth-card__foot {
    margin-top: 22px;
    text-align: center;
    font-size: 12.5px;
    color: var(--muted-light);
}

.steps {
    display: flex;
    flex-direction: column;
}

.step {
    display: flex;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}

.step:last-child {
    border-bottom: 0;
}

.step__num {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: none;
    background: var(--surface-sunken);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.step.is-done .step__num {
    background: var(--green-bg);
    color: var(--green-ink);
}

.step__body {
    min-width: 0;
    flex: 1;
}

.step__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}

.step__text {
    margin-top: 3px;
    font-size: 13.5px;
    color: var(--muted);
}

.error-code {
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.05em;
    color: var(--ink);
    text-align: center;
}

/* --------------------------------------------------------------------------
   Ticket del cliente
   -------------------------------------------------------------------------- */

.ticket-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 32px 20px 56px;
}

.ticket-wrap {
    width: 100%;
    max-width: 420px;
}

.ticket-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.ticket-topbar__title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.ticket {
    filter: drop-shadow(0 18px 40px rgba(17, 17, 26, 0.14));
}

/* Portada negra con arco rojo detrás del contenido. */
.ticket__cover {
    position: relative;
    padding: 22px 22px 24px;
    background: var(--ui-black);
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    isolation: isolate;
}

.ticket__cover::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(72% 62% at 50% 26%, var(--brand), transparent 72%);
}

.ticket__cover-image {
    display: block;
    width: 100%;
    height: 188px;
    object-fit: cover;
    border-radius: 16px;
}

.ticket__cover-fallback {
    display: grid;
    place-items: center;
    height: 188px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.5);
}

.ticket__event {
    margin-top: 18px;
    color: #fff;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.ticket__event-meta {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 13.5px;
}

/*
   Troquel: la muesca es un recorte transparente formado por dos mitades.
   La mitad superior la aporta .ticket__body y la inferior .ticket__stub, así
   el degradado de la página se ve a través del hueco.
*/
.ticket__body {
    padding: 26px 24px 30px;
    background:
        radial-gradient(circle 15px at 0 100%, transparent 14.5px, var(--surface) 15.5px) 0 0 / 50.5% 100% no-repeat,
        radial-gradient(circle 15px at 100% 100%, transparent 14.5px, var(--surface) 15.5px) 100% 0 / 50.5% 100% no-repeat;
}

.ticket__stub {
    position: relative;
    padding: 26px 24px 28px;
    border-radius: 0 0 24px 24px;
    background:
        radial-gradient(circle 15px at 0 0, transparent 14.5px, var(--surface) 15.5px) 0 0 / 50.5% 100% no-repeat,
        radial-gradient(circle 15px at 100% 0, transparent 14.5px, var(--surface) 15.5px) 100% 0 / 50.5% 100% no-repeat;
    text-align: center;
}

.ticket__stub::before {
    content: '';
    position: absolute;
    top: 0;
    left: 26px;
    right: 26px;
    border-top: 1.5px dashed #dcdee4;
}

.ticket__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 18px;
}

.ticket__label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted-light);
}

.ticket__value {
    margin-top: 3px;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--ink);
    word-break: break-word;
}

.ticket__qr {
    display: inline-flex;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
}

.ticket__qr svg,
.ticket__qr img {
    display: block;
    width: 176px;
    height: 176px;
}

.ticket__code {
    margin-top: 14px;
    font-family: var(--font-mono);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.14em;
    color: var(--ink);
}

.ticket__hint {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--muted-light);
}

.ticket__actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.ticket-void {
    margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   Entrada por scroll
   -------------------------------------------------------------------------- */

.reveal {
    opacity: 0;
    transform: translateY(14px);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 600ms var(--ease), transform 600ms var(--ease);
    transition-delay: calc(var(--index, 0) * 60ms);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Utilidades
   -------------------------------------------------------------------------- */

.stack-16 > * + * { margin-top: 16px; }
.stack-24 > * + * { margin-top: 24px; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.inline-form { display: inline; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Pantallas chicas
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
    .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .topbar {
        flex-wrap: wrap;
        padding: 14px 18px;
    }

    .nav {
        order: 3;
        width: 100%;
        margin: 4px 0 0;
        overflow-x: auto;
        justify-content: flex-start;
    }

    .topbar__end { margin-left: auto; }

    .main { padding: 8px 18px 80px; }

    .page-head h1 { font-size: 30px; }

    .form-grid { grid-template-columns: minmax(0, 1fr); }

    .brand__name { display: none; }
}

@media (max-width: 560px) {
    .bento { grid-template-columns: minmax(0, 1fr); }
    .page-head { align-items: flex-start; }
    .auth-card__panel { padding: 26px 20px; }
    .ticket__grid { gap: 16px 14px; }
}
