:root {
    --bg: #0b1020;
    --bg-soft: #121a2f;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: #ffffff;
    --ink: #172033;
    --muted: #667085;
    --line: #dfe5f0;
    --primary: #6d5ef4;
    --primary-dark: #5646ef;
    --success: #157347;
    --danger: #b42318;
    --warning: #b54708;
    --shadow: 0 20px 60px rgba(10, 16, 36, 0.14);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(109, 94, 244, 0.26), transparent 24%),
        radial-gradient(circle at top right, rgba(7, 182, 212, 0.22), transparent 20%),
        linear-gradient(180deg, #f4f7fb 0%, #edf1f8 100%);
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

.public-shell {
    min-height: 100vh;
}

.hero-band {
    max-width: 1240px;
    margin: 0 auto;
    padding: 40px 24px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 28px;
    align-items: center;
}

.hero-copy h1,
.panel h2,
.panel h3,
.success-panel h2 {
    margin: 0;
    line-height: 1.05;
}

.hero-copy h1 {
    font-size: clamp(2.2rem, 4vw, 4rem);
    max-width: 12ch;
}

.hero-text {
    max-width: 58ch;
    color: rgba(23, 32, 51, 0.82);
    font-size: 1.06rem;
    line-height: 1.6;
    margin: 16px 0 0;
}

.hero-media {
    min-height: 360px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #0d1530;
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-section {
    max-width: 1240px;
    margin: 0 auto;
    padding: 12px 24px 40px;
}

.page-section.narrow {
    max-width: 860px;
}

.split-layout {
    display: grid;
    gap: 24px;
}

.registration-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel,
.admin-card,
.stat-card {
    background: var(--surface-strong);
    border: 1px solid rgba(208, 216, 229, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel {
    padding: 32px;
}

.event-search-panel {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
    gap: 24px;
    margin-bottom: 30px;
    padding: 34px;
    border-color: rgba(109, 94, 244, 0.18);
    background:
        linear-gradient(135deg, rgba(109, 94, 244, 0.06), rgba(14, 165, 233, 0.04)),
        #ffffff;
}

.search-panel-copy p:last-child {
    margin-bottom: 0;
}

.search-panel-copy h2 {
    font-size: clamp(1.85rem, 3vw, 2.8rem);
    line-height: 1.08;
}

.search-panel-copy p {
    color: rgba(23, 32, 51, 0.82);
    line-height: 1.72;
    font-size: 1rem;
}

.event-search-box {
    display: grid;
    gap: 16px;
}

.catalog-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.catalog-filters .field {
    gap: 6px;
}

.catalog-filters .field span {
    font-size: 0.88rem;
}

.filter-reset-button {
    width: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    align-self: end;
}

.search-field {
    gap: 8px;
}

.search-field span {
    font-size: 0.9rem;
}

.search-field input {
    min-height: 54px;
    font-size: 0.98rem;
    padding-left: 18px;
    padding-right: 18px;
    border-width: 2px;
    border-color: rgba(109, 94, 244, 0.18);
    box-shadow: 0 10px 30px rgba(109, 94, 244, 0.08);
}

.search-results {
    display: grid;
    gap: 14px;
    max-height: 320px;
    overflow: auto;
    padding-right: 2px;
}

.search-result-card {
    display: grid;
    gap: 10px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcff;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-result-card:hover {
    transform: translateY(-1px);
    border-color: rgba(109, 94, 244, 0.35);
    box-shadow: 0 18px 34px rgba(16, 24, 40, 0.08);
}

.search-result-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1.02rem;
}

.search-result-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.search-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 0.88rem;
}

.feature-list ul {
    margin: 18px 0 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.8;
}

.info-strip {
    margin-top: 22px;
    display: grid;
    gap: 10px;
    padding: 16px 18px;
    border-radius: var(--radius);
    background: rgba(109, 94, 244, 0.08);
    border: 1px solid rgba(109, 94, 244, 0.16);
}

.info-strip span {
    color: #3f3a86;
    font-weight: 600;
}

.code-callout {
    margin-top: 22px;
    padding: 16px 18px;
    border-radius: var(--radius);
    background: #0e162d;
    color: #ffffff;
}

.code-callout span {
    display: block;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.84rem;
    margin-bottom: 8px;
}

.code-callout code,
code {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.94rem;
}

.event-meta,
.action-row,
.inline-actions,
.filters-bar,
.section-heading {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.pill,
.status-badge,
.table-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.pill {
    background: #f2f5fb;
    color: var(--ink);
}

.pill.muted,
.table-badge.muted {
    background: #edf1f7;
    color: #556070;
}

.status-badge.open,
.table-badge.ok,
.table-badge.checked_in {
    background: rgba(21, 115, 71, 0.12);
    color: var(--success);
}

.status-badge.sold-out,
.table-badge.cancelled,
.table-link.danger {
    color: var(--danger);
}

.status-badge.sold-out,
.table-badge.cancelled {
    background: rgba(180, 35, 24, 0.12);
}

.table-badge.registered {
    background: rgba(109, 94, 244, 0.12);
    color: var(--primary-dark);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 26px;
}

.detail-grid dt,
.ticket-summary span,
.field span,
.eyebrow,
.table-subline {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.detail-grid dd {
    margin: 6px 0 0;
    font-weight: 600;
}

.event-lead {
    font-size: 1.03rem;
    color: rgba(23, 32, 51, 0.8);
}

.form-heading h3,
.section-heading h2,
.section-heading h3 {
    margin: 6px 0 0;
}

.form-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 16px;
    margin-bottom: 8px;
}

.form-heading > div {
    display: grid;
    gap: 4px;
}

.form-heading .status-badge {
    justify-self: end;
    align-self: start;
}

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

.field-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-span-2 {
    grid-column: 1 / -1;
}

.field {
    display: grid;
    gap: 11px;
}

.field.grow {
    flex: 1;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    min-height: 48px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    color: var(--ink);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

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

.field.field-textarea textarea {
    min-height: 96px;
}

.choice-group {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
}

.choice-option {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 0.96rem;
}

.choice-option input {
    width: 18px;
    min-height: 18px;
    margin: 0;
    padding: 0;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: rgba(109, 94, 244, 0.88);
    box-shadow: 0 0 0 4px rgba(109, 94, 244, 0.12);
}

.field small {
    color: var(--danger);
}

.field-hint {
    margin: -2px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.checkbox-field {
    align-content: end;
}

.checkbox-field input {
    width: 20px;
    min-height: 20px;
    padding: 0;
}

.custom-fields-block {
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.custom-fields-block h4 {
    margin: 0 0 14px;
}

.registration-form {
    display: grid;
    gap: 18px;
}

.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    white-space: nowrap;
}

.primary-button {
    background: var(--primary);
    color: #ffffff;
}

.primary-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.ghost-button {
    background: #ffffff;
    border-color: var(--line);
    color: var(--ink);
}

.ghost-button:hover {
    border-color: rgba(109, 94, 244, 0.44);
    transform: translateY(-1px);
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid;
}

.alert.success {
    color: var(--success);
    background: rgba(21, 115, 71, 0.08);
    border-color: rgba(21, 115, 71, 0.18);
}

.alert.warning {
    color: var(--warning);
    background: rgba(181, 71, 8, 0.08);
    border-color: rgba(181, 71, 8, 0.18);
}

.alert.danger {
    color: var(--danger);
    background: rgba(180, 35, 24, 0.08);
    border-color: rgba(180, 35, 24, 0.18);
}

.empty-state {
    padding: 20px;
    border-radius: var(--radius);
    background: #f6f8fc;
    border: 1px dashed var(--line);
    color: var(--muted);
}

.success-panel {
    text-align: center;
}

.ticket-summary {
    margin: 28px 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ticket-summary div {
    padding: 18px;
    border-radius: var(--radius);
    background: #f6f8fc;
    border: 1px solid var(--line);
}

.ticket-summary strong {
    display: block;
    margin-top: 6px;
    font-size: 1rem;
}

.booking-ticket-list {
    display: grid;
    gap: 14px;
    margin: 0 0 28px;
}

.booking-ticket-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #fbfcff;
}

.booking-ticket-card p {
    margin: 6px 0 0;
    color: var(--muted);
}

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

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

th,
td {
    padding: 16px 14px;
    text-align: left;
    border-bottom: 1px solid #e8edf6;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.table-link {
    font-weight: 600;
    color: var(--primary-dark);
}

.note-box {
    margin-top: 24px;
    padding: 18px;
    border-radius: var(--radius);
    background: #f7f8fc;
}

.catalog-section {
    display: grid;
    gap: 20px;
    margin-top: 26px;
}

.event-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.event-card {
    display: grid;
    grid-template-rows: 220px minmax(0, 1fr);
    border-radius: var(--radius);
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(208, 216, 229, 0.9);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 46px rgba(16, 24, 40, 0.12);
    border-color: rgba(109, 94, 244, 0.22);
}

.event-card-media {
    position: relative;
    height: 220px;
    background:
        linear-gradient(145deg, rgba(109, 94, 244, 0.24), rgba(9, 15, 28, 0.86));
    background-color: var(--accent);
}

.event-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-card-body {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 12px;
    padding: 22px;
}

.event-card .event-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.event-card .event-meta .pill.muted {
    justify-self: start;
}

.event-card .event-meta .availability-pill {
    justify-self: end;
}

.event-card-body h3 {
    margin: 0;
    font-size: 1.22rem;
    line-height: 1.18;
}

.event-card-body p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
    font-size: 0.97rem;
}

.catalog-results-section h2,
.catalog-section h2 {
    font-size: clamp(1.9rem, 3vw, 3rem);
    line-height: 1.04;
}

.section-heading {
    align-items: end;
}

.section-heading-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.availability-pill.available {
    background: rgba(21, 115, 71, 0.1);
    color: var(--success);
}

.availability-pill.sold-out {
    background: rgba(180, 35, 24, 0.1);
    color: var(--danger);
}

.section-description {
    margin: 10px 0 0;
    color: rgba(23, 32, 51, 0.72);
    line-height: 1.68;
    max-width: 64ch;
}

.is-hidden {
    display: none !important;
}

.ticket-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.icon-button {
    width: 46px;
    min-width: 46px;
    padding: 0;
}

.event-panel .event-meta {
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.event-panel h2 {
    margin-top: 2px;
}

.event-panel .event-lead {
    margin: 10px 0 0;
}

.form-panel .field-grid {
    margin-top: 6px;
    align-items: start;
}

.form-panel .custom-fields-block .field-grid {
    margin-top: 0;
}

.centered-actions {
    justify-content: center;
    margin-top: 22px;
}

@media (max-width: 980px) {
    .hero-band,
    .event-search-panel,
    .registration-layout,
    .ticket-summary,
    .detail-grid,
    .field-grid,
    .field-grid.compact,
    .event-card-grid {
        grid-template-columns: 1fr;
    }

    .catalog-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .booking-ticket-card {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-band {
        padding-top: 24px;
    }
}

@media (max-width: 640px) {
    .hero-band,
    .page-section {
        padding-left: 16px;
        padding-right: 16px;
    }

    .panel,
    .admin-card {
        padding: 20px;
    }

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

    .filter-reset-button {
        width: 100%;
    }
}
