:root {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #182230;
    background: #f6f8fb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
}

button,
input,
select {
    font: inherit;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.header {
    padding: 36px 0 22px;
}

.header__eyebrow {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #667085;
}

.header h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
}

.header p {
    margin: 10px 0 0;
    color: #667085;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 8px 0 18px;
}

.stat {
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 18px rgba(16, 24, 40, .04);
}

.stat__label {
    color: #667085;
    font-size: 14px;
}

.stat__value {
    display: block;
    margin-top: 8px;
    font-size: 32px;
    font-weight: 800;
}

.panel {
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(16, 24, 40, .04);
}

.filters {
    display: grid;
    grid-template-columns: 1fr 180px 180px;
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid #eaecf0;
}

.field {
    width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    padding: 11px 12px;
    outline: none;
    background: #fff;
}

.field:focus {
    border-color: #98a2b3;
    box-shadow: 0 0 0 3px rgba(152, 162, 179, .15);
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid #eaecf0;
    white-space: nowrap;
}

th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #667085;
    background: #fcfcfd;
}

.person-name {
    font-weight: 700;
}

.person-dni {
    margin-top: 3px;
    font-size: 12px;
    color: #667085;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 700;
    background: #f2f4f7;
}

.badge--ok {
    background: #ecfdf3;
    color: #027a48;
}

.badge--pending {
    background: #fffaeb;
    color: #b54708;
}

.btn {
    border: 0;
    border-radius: 9px;
    padding: 9px 12px;
    cursor: pointer;
    font-weight: 700;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.btn--primary {
    background: #101828;
    color: #fff;
}

.btn--secondary {
    background: #f2f4f7;
    color: #344054;
}

.empty {
    text-align: center;
    color: #667085;
    padding: 32px;
}

.notice {
    position: fixed;
    right: 20px;
    bottom: 20px;
    max-width: 360px;
    background: #101828;
    color: #fff;
    border-radius: 12px;
    padding: 13px 16px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, .25);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: .2s ease;
}

.notice.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 760px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    th:nth-child(3),
    td:nth-child(3) {
        display: none;
    }
}


.header--with-action {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.header__action {
    text-decoration: none;
    white-space: nowrap;
}

.row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.row-actions a {
    text-decoration: none;
}

.qr-page {
    background: #f2f4f7;
}

.qr-shell {
    width: min(560px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.qr-topbar {
    margin-bottom: 14px;
}

.link-back {
    color: #344054;
    text-decoration: none;
    font-weight: 700;
}

.ticket {
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 24px;
    padding: 34px;
    text-align: center;
    box-shadow: 0 16px 42px rgba(16, 24, 40, .08);
}

.ticket__eyebrow {
    margin: 0 0 4px;
    color: #667085;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.ticket h1 {
    margin: 0;
    font-size: 25px;
}

.ticket__qr {
    display: grid;
    place-items: center;
    width: min(360px, 100%);
    aspect-ratio: 1;
    margin: 24px auto 18px;
    padding: 10px;
    border: 1px solid #eaecf0;
    border-radius: 18px;
    background: #fff;
}

.ticket__qr img {
    display: block;
    width: 100%;
    height: auto;
}

.ticket h2 {
    margin: 8px 0 10px;
    font-size: 25px;
}

.ticket__type {
    margin-bottom: 10px;
}

.ticket__help {
    max-width: 380px;
    margin: 16px auto 0;
    color: #667085;
    line-height: 1.5;
}

.ticket__status {
    margin-top: 22px;
    border-radius: 12px;
    padding: 12px 14px;
    background: #fffaeb;
    color: #b54708;
    font-weight: 800;
}

.ticket__status--ok {
    background: #ecfdf3;
    color: #027a48;
}

.ticket-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

.ticket-actions a {
    text-decoration: none;
}

.scanner-page {
    background: #f2f4f7;
}

.scanner-shell {
    width: min(1080px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 50px;
}

.scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 18px;
}

.scanner-header h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 44px);
}

.scanner-header p:not(.header__eyebrow) {
    margin: 8px 0 0;
    color: #667085;
}

.scanner-header a {
    text-decoration: none;
}

.scanner-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
    gap: 18px;
    align-items: start;
}

.scanner-card,
.scan-result,
.scanner-help {
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(16, 24, 40, .04);
}

.scanner-card {
    padding: 16px;
    overflow: hidden;
}

#reader {
    overflow: hidden;
    border: 0 !important;
    border-radius: 14px;
}

#reader video {
    border-radius: 12px;
}

#reader button {
    border: 0;
    border-radius: 9px;
    padding: 9px 12px;
    background: #101828;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

#reader select {
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    padding: 8px;
    font: inherit;
}

#reader a {
    color: #344054;
}

.scanner-note {
    margin: 12px 0 0;
    color: #667085;
    font-size: 13px;
    line-height: 1.45;
}

.scan-result {
    min-height: 350px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.scan-result__icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #f2f4f7;
    font-size: 23px;
    font-weight: 900;
}

.scan-result__eyebrow {
    margin: 18px 0 5px;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.scan-result h2 {
    margin: 0;
    font-size: 28px;
}

.scan-result > p:last-of-type {
    color: #667085;
    line-height: 1.5;
}

.scan-result--success {
    border-color: #abefc6;
    background: #f6fef9;
}

.scan-result--success .scan-result__icon {
    background: #dcfae6;
    color: #067647;
}

.scan-result--warning {
    border-color: #fedf89;
    background: #fffcf5;
}

.scan-result--warning .scan-result__icon {
    background: #fef0c7;
    color: #b54708;
}

.scan-result--error {
    border-color: #fecdca;
    background: #fffafa;
}

.scan-result--error .scan-result__icon {
    background: #fee4e2;
    color: #b42318;
}

.scan-person {
    display: grid;
    gap: 5px;
    margin-top: 18px;
    border-top: 1px solid rgba(16, 24, 40, .10);
    padding-top: 18px;
}

.scan-person strong {
    font-size: 21px;
}

.scan-person span {
    color: #475467;
}

.scanner-help {
    margin-top: 18px;
    padding: 15px 18px;
    color: #475467;
    line-height: 1.5;
}

@media (max-width: 860px) {
    .header--with-action,
    .scanner-header {
        align-items: stretch;
        flex-direction: column;
    }

    .header__action {
        align-self: flex-start;
    }

    .scanner-grid {
        grid-template-columns: 1fr;
    }

    .scan-result {
        min-height: 260px;
    }
}

@media (max-width: 620px) {
    .ticket {
        padding: 24px 18px;
    }

    .ticket-actions {
        flex-direction: column;
    }

    .ticket-actions .btn {
        width: 100%;
        text-align: center;
    }

    .row-actions {
        min-width: 260px;
    }
}

@media print {
    body {
        background: #fff;
    }

    .no-print {
        display: none !important;
    }

    .qr-shell {
        width: 100%;
        padding: 0;
    }

    .ticket {
        box-shadow: none;
        border: 0;
    }
}


.header-actions,
.scanner-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.header-actions form {
    margin: 0;
}

.user-chip {
    display: inline-flex;
    flex-direction: column;
    min-width: 120px;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    padding: 7px 10px;
    background: #fff;
}

.user-chip strong {
    font-size: 13px;
}

.user-chip span {
    margin-top: 2px;
    color: #667085;
    font-size: 11px;
}

.user-chip--compact {
    min-width: 0;
}

.audit-note,
.action-note {
    display: block;
    margin-top: 6px;
    color: #667085;
    font-size: 11px;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    background: #f2f4f7;
}

.login-shell {
    width: min(440px, calc(100% - 28px));
}

.login-card {
    border: 1px solid #e4e7ec;
    border-radius: 22px;
    padding: 32px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(16, 24, 40, .08);
}

.login-card h1 {
    margin: 0;
    font-size: 32px;
}

.login-card__intro {
    margin: 10px 0 24px;
    color: #667085;
    line-height: 1.5;
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-form label {
    display: grid;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
}

.login-submit {
    width: 100%;
    margin-top: 4px;
}

.form-alert {
    margin: 0 0 18px;
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 13px;
    line-height: 1.45;
}

.form-alert--error {
    background: #fef3f2;
    color: #b42318;
}

.form-alert--warning {
    background: #fffaeb;
    color: #b54708;
}

@media (max-width: 760px) {
    .header-actions,
    .scanner-header__actions {
        width: 100%;
    }

    .header-actions .btn,
    .scanner-header__actions .btn {
        text-align: center;
    }

    .user-chip {
        flex: 1;
    }
}


.text-active {
    color: #027a48;
    font-weight: 700;
}

.text-muted {
    color: #667085;
    font-weight: 700;
}

.event-selector-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 18px;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    padding: 14px 16px;
    background: #fff;
}

.event-selector-card > div {
    display: grid;
    gap: 3px;
}

.event-selector-card__label,
.event-selector > span {
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}

.event-selector {
    display: grid;
    min-width: 310px;
    gap: 5px;
}

.historical-notice {
    margin: 0 0 18px;
    border: 1px solid #fedf89;
    border-radius: 12px;
    padding: 12px 14px;
    background: #fffcf5;
    color: #b54708;
    line-height: 1.45;
}

.page-section {
    padding-top: 34px;
    padding-bottom: 50px;
}

.subpage-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.subpage-header h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 42px);
}

.subpage-header p:not(.header__eyebrow) {
    margin: 8px 0 0;
    color: #667085;
}

.subpage-header a {
    text-decoration: none;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(300px, .65fr) minmax(0, 1.35fr);
    gap: 18px;
    align-items: start;
}

.simple-panel {
    padding: 22px;
}

.simple-panel h2 {
    margin: 0 0 18px;
}

.stack-form {
    display: grid;
    gap: 16px;
}

.stack-form label {
    display: grid;
    gap: 6px;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 9px !important;
    font-weight: 500 !important;
}

.event-list {
    display: grid;
    gap: 12px;
}

.event-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid #eaecf0;
    border-radius: 12px;
    padding: 14px;
}

.event-list-item__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.event-list-item__meta {
    margin-top: 4px;
    color: #667085;
    font-size: 12px;
}

.event-list-item__actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.event-list-item__actions a {
    text-decoration: none;
}

.event-list-item__actions form {
    margin: 0;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.registration-panel {
    max-width: 760px;
}

.form-alert--success {
    background: #ecfdf3;
    color: #027a48;
}

.ticket__event-meta {
    margin: 7px 0 0;
    color: #667085;
    font-size: 13px;
}

@media (max-width: 850px) {
    .event-selector-card,
    .subpage-header,
    .event-list-item {
        align-items: stretch;
        flex-direction: column;
    }

    .event-selector {
        min-width: 0;
        width: 100%;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .event-list-item__actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 620px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}


.scanner-missing {
    margin-bottom: 18px;
}

.scanner-missing code {
    display: block;
    margin-top: 8px;
    border-radius: 8px;
    padding: 9px 10px;
    background: rgba(255, 255, 255, .7);
    color: inherit;
    overflow-wrap: anywhere;
}


.badge--error {
    background: #fef3f2;
    color: #b42318;
}

.import-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px 24px;
    align-items: start;
}

.import-intro h2,
.import-preview h2 {
    margin: 0;
}

.import-intro p,
.import-preview__header p {
    color: #667085;
    line-height: 1.5;
}

.import-intro code {
    border-radius: 5px;
    padding: 2px 5px;
    background: #f2f4f7;
    color: #344054;
}

.import-intro > a {
    text-decoration: none;
}

.import-upload-form {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.file-drop {
    display: grid;
    flex: 1;
    gap: 6px;
    border: 1px dashed #98a2b3;
    border-radius: 12px;
    padding: 14px;
    background: #fcfcfd;
}

.file-drop > span {
    font-size: 13px;
    font-weight: 800;
}

.file-drop small {
    color: #667085;
}

.file-drop input[type="file"] {
    width: 100%;
}

.import-preview {
    margin-top: 20px;
}

.import-preview__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.import-preview__header a {
    text-decoration: none;
}

.import-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.import-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 14px 0;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    color: #475467;
    font-size: 13px;
}

.import-confirm {
    display: flex;
    justify-content: flex-end;
    margin: 14px 0;
}

.import-table-panel {
    margin-top: 14px;
}

.import-errors {
    max-width: 260px;
    margin-top: 6px;
    color: #b42318;
    font-size: 11px;
    white-space: normal;
}

.import-success-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.import-success-actions a {
    text-decoration: none;
}

@media (max-width: 850px) {
    .import-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .import-intro {
        grid-template-columns: 1fr;
    }

    .import-upload-form {
        grid-column: 1;
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 620px) {
    .import-preview__header {
        align-items: stretch;
        flex-direction: column;
    }

    .import-stats {
        grid-template-columns: 1fr;
    }

    .import-confirm {
        justify-content: stretch;
    }

    .import-confirm .btn {
        width: 100%;
    }
}
