:root {
    color-scheme: dark;
    --surface-0: #0d0911;
    --surface-1: #17111d;
    --surface-2: #24182a;
    --surface-3: #302038;
    --text-strong: #f7f2ea;
    --text: #e5dde4;
    --text-muted: #b9afb9;
    --ember: #f0642f;
    --ember-strong: #ff7540;
    --glow-red: #c93f34;
    --gold: #d7a83e;
    --success: #3ac17f;
    --warning: #efb23a;
    --danger: #ef625b;
    --info: #7f9cf5;
    --border: rgba(247, 242, 234, 0.11);
    --border-strong: rgba(247, 242, 234, 0.2);
    --shadow: 0 22px 60px rgba(3, 1, 5, 0.28);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --sidebar-width: 268px;
    --mobile-nav-height: 74px;
    --focus: #ffb36a;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--surface-0);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--surface-0);
    -webkit-font-smoothing: antialiased;
}

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

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3,
strong {
    color: var(--text-strong);
}

h1 {
    margin-bottom: 0.55rem;
    font-size: clamp(1.9rem, 6vw, 3.45rem);
    line-height: 1.06;
    letter-spacing: -0.045em;
}

h2 {
    margin-bottom: 0.35rem;
    font-size: clamp(1.1rem, 3vw, 1.45rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h3 {
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

p {
    color: var(--text-muted);
}

code {
    padding: 0.18rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text-strong);
}

.icon {
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.75rem 1rem;
    transform: translateY(-150%);
    border-radius: var(--radius-sm);
    background: var(--text-strong);
    color: var(--surface-0);
    font-weight: 700;
}

.skip-link:focus {
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.eyebrow {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1.3;
    text-transform: uppercase;
}

.brand__mark {
    display: grid;
    width: 2.65rem;
    height: 2.65rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(240, 100, 47, 0.5);
    border-radius: 12px;
    background:
        radial-gradient(circle at 65% 25%, rgba(255, 179, 106, 0.85), transparent 18%),
        linear-gradient(145deg, var(--ember), #8e201e 70%);
    box-shadow: 0 0 28px rgba(240, 90, 40, 0.22);
    color: #fff8ef;
    font-family: Georgia, serif;
    font-size: 1.35rem;
    font-weight: 900;
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.72rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button:not(:disabled):active {
    transform: translateY(1px);
}

.button--primary {
    background: var(--ember);
    color: #160b08;
}

.button--primary:not(:disabled):hover {
    background: var(--ember-strong);
}

.button--secondary {
    border-color: var(--border-strong);
    background: var(--surface-2);
    color: var(--text-strong);
}

.button--secondary:not(:disabled):hover,
.button--ghost:not(:disabled):hover {
    border-color: rgba(240, 100, 47, 0.6);
    background: rgba(240, 100, 47, 0.08);
}

.button--ghost {
    border-color: var(--border);
    background: transparent;
    color: var(--text);
}

.button--danger {
    border-color: rgba(239, 98, 91, 0.35);
    background: rgba(239, 98, 91, 0.12);
    color: #ffaaa5;
}

.button--wide {
    width: 100%;
}

.button:disabled {
    border-color: var(--border);
    background: rgba(247, 242, 234, 0.05);
    color: #8f858f;
    cursor: not-allowed;
}

.icon-button {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-1);
    color: var(--text-strong);
}

.icon-button:hover {
    border-color: rgba(240, 100, 47, 0.55);
}

.status {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    gap: 0.45rem;
    padding: 0.28rem 0.62rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.status__dot {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: #918892;
}

.status--success { color: #8ce4b7; border-color: rgba(58, 193, 127, 0.3); }
.status--success .status__dot { background: var(--success); }
.status--warning { color: #f8d58a; border-color: rgba(239, 178, 58, 0.3); }
.status--warning .status__dot { background: var(--warning); }
.status--danger { color: #ffaaa5; border-color: rgba(239, 98, 91, 0.3); }
.status--danger .status__dot { background: var(--danger); }
.status--info { color: #bdcaff; border-color: rgba(127, 156, 245, 0.3); }
.status--info .status__dot { background: var(--info); }

.field {
    display: grid;
    gap: 0.42rem;
}

.field label,
.field__label-row {
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 700;
}

.field__label-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.field__label-row span {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 0.72rem 0.82rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: rgba(9, 6, 12, 0.65);
    color: var(--text-strong);
}

textarea {
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #8f858f;
}

input:disabled,
select:disabled,
textarea:disabled {
    color: #8f858f;
    cursor: not-allowed;
    opacity: 0.74;
}

.form-hint {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.form-stack {
    display: grid;
    gap: 1rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

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

.notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(127, 156, 245, 0.24);
    border-radius: var(--radius-md);
    background: rgba(127, 156, 245, 0.08);
}

.notice > .icon {
    margin-top: 0.1rem;
    color: #aebfff;
}

.notice strong,
.notice p {
    display: block;
    margin: 0;
}

.notice p {
    margin-top: 0.2rem;
    font-size: 0.84rem;
}

.notice--warning {
    border-color: rgba(239, 178, 58, 0.28);
    background: rgba(239, 178, 58, 0.08);
}

.notice--danger {
    border-color: rgba(239, 98, 91, 0.3);
    background: rgba(239, 98, 91, 0.08);
}

.empty-state {
    display: grid;
    min-height: 150px;
    place-items: center;
    align-content: center;
    padding: 1.5rem;
    text-align: center;
}

.empty-state__icon {
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.65rem;
    color: var(--gold);
}

.empty-state h3,
.empty-state p {
    margin-bottom: 0.3rem;
}

.empty-state p {
    max-width: 42ch;
    font-size: 0.86rem;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: linear-gradient(150deg, rgba(36, 24, 42, 0.92), rgba(23, 17, 29, 0.96));
    box-shadow: var(--shadow);
}

.card__header,
.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.card__header {
    padding: 1.15rem 1.15rem 0;
}

.card__header h2,
.section-heading h2 {
    margin-bottom: 0;
}

/* Authentication */
.auth-body {
    overflow-x: hidden;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
}

.auth-visual {
    position: relative;
    display: flex;
    min-height: 42vh;
    align-items: flex-end;
    overflow: hidden;
    padding: clamp(1.4rem, 5vw, 4rem);
    background:
        radial-gradient(circle at 18% 84%, rgba(255, 102, 33, 0.62), transparent 17%),
        radial-gradient(circle at 30% 68%, rgba(177, 35, 25, 0.34), transparent 32%),
        radial-gradient(circle at 72% 20%, rgba(88, 34, 92, 0.27), transparent 38%),
        linear-gradient(145deg, #1b0c18, #0b0710 60%, #130a16);
}

.auth-visual::before,
.auth-visual::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.auth-visual::before {
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255, 173, 80, 0.75) 0 1px, transparent 1.5px),
        radial-gradient(circle, rgba(230, 66, 32, 0.6) 0 1px, transparent 1.5px);
    background-position: 20% 30%, 70% 64%;
    background-size: 89px 83px, 121px 107px;
    opacity: 0.22;
    mask-image: linear-gradient(to top, #000, transparent 85%);
}

.auth-visual::after {
    right: -8%;
    bottom: -12%;
    width: 65%;
    height: 60%;
    border-radius: 50%;
    background: rgba(240, 90, 40, 0.13);
    filter: blur(55px);
}

.auth-visual__content {
    position: relative;
    z-index: 1;
    max-width: 690px;
}

.text-logo {
    display: inline-flex;
    align-items: flex-end;
    gap: 0.65rem;
    margin-bottom: 2.2rem;
}

.text-logo span {
    color: var(--text-strong);
    font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
    font-size: clamp(2.2rem, 8vw, 4.6rem);
    letter-spacing: 0.05em;
    line-height: 0.8;
}

.text-logo small {
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-visual__kicker {
    margin-bottom: 0.65rem;
    color: var(--gold);
    font-family: Georgia, serif;
    font-weight: 700;
}

.auth-visual h1 {
    max-width: 13ch;
}

.auth-visual > p,
.auth-visual__content > p {
    max-width: 54ch;
}

.auth-visual__event {
    display: grid;
    width: fit-content;
    margin-top: 1.4rem;
    padding-left: 1rem;
    border-left: 2px solid var(--ember);
}

.auth-visual__event .eyebrow {
    margin: 0 0 0.15rem;
}

.auth-visual__event span:last-child {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-panel {
    display: grid;
    place-items: center;
    padding: 1.35rem;
    background: var(--surface-0);
}

.auth-panel__inner {
    display: grid;
    width: min(100%, 430px);
    gap: 1.25rem;
}

.auth-panel__heading {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.auth-panel__heading .eyebrow,
.auth-panel__heading h2 {
    margin: 0;
}

.preview-link {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: var(--gold);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.preview-link .icon {
    width: 1rem;
}

.error-page {
    display: grid;
    width: min(100% - 2rem, 620px);
    min-height: 100vh;
    margin: auto;
    place-items: center;
    align-content: center;
    padding: 2rem;
    text-align: center;
}

.error-page .brand__mark {
    margin-bottom: 1.5rem;
}

.error-page p {
    max-width: 52ch;
}

/* App shell */
.app-shell {
    min-height: 100vh;
    padding-bottom: var(--mobile-nav-height);
}

.sidebar {
    display: none;
}

.app-main {
    min-width: 0;
}

.topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(13, 9, 17, 0.92);
    backdrop-filter: blur(16px);
}

.topbar .eyebrow {
    margin: 0;
    font-size: 0.62rem;
}

.topbar > div > strong {
    font-size: 0.98rem;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.topbar__actions .status {
    display: none;
}

.page-content {
    display: grid;
    gap: 1.25rem;
    width: min(100%, 1480px);
    margin: 0 auto;
    padding: 1rem;
}

.preview-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(239, 178, 58, 0.26);
    border-radius: var(--radius-md);
    background: rgba(239, 178, 58, 0.075);
}

.preview-banner > .icon {
    margin-top: 0.12rem;
    color: var(--gold);
}

.preview-banner strong,
.preview-banner span {
    display: block;
}

.preview-banner span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.page-heading {
    display: grid;
    gap: 1rem;
    padding-top: 0.5rem;
}

.page-heading p {
    max-width: 62ch;
    margin-bottom: 0;
}

.page-heading .button {
    width: 100%;
}

.event-hero {
    position: relative;
    display: grid;
    gap: 1.2rem;
    overflow: hidden;
    padding: 1.4rem;
    background:
        radial-gradient(circle at 75% 40%, rgba(240, 100, 47, 0.22), transparent 28%),
        linear-gradient(120deg, #2b1724, #17111d 70%);
}

.event-hero::after {
    content: "";
    position: absolute;
    inset: auto -8% -55% 35%;
    height: 100%;
    border-radius: 50%;
    background: rgba(192, 45, 36, 0.14);
    filter: blur(32px);
}

.event-hero h2 {
    margin-bottom: 0.35rem;
    font-family: Georgia, serif;
    font-size: clamp(1.55rem, 5vw, 2.4rem);
}

.event-hero p {
    margin: 0;
}

.event-hero__date {
    position: relative;
    z-index: 1;
    display: grid;
    width: fit-content;
    grid-template-columns: auto auto;
    align-items: end;
    column-gap: 0.5rem;
}

.event-hero__date strong {
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 2.8rem;
    line-height: 0.9;
}

.event-hero__date span {
    color: var(--text-strong);
    font-weight: 800;
}

.event-hero__date small {
    grid-column: 1 / -1;
    margin-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.68rem;
}

.metric-grid,
.content-grid,
.report-grid,
.settings-list,
.helper-grid,
.feedback-grid {
    display: grid;
    gap: 0.85rem;
}

.section-heading {
    margin-bottom: 0.75rem;
}

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

.metric-card {
    display: grid;
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-1);
}

.metric-card__icon {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    margin-bottom: 1rem;
    place-items: center;
    border-radius: 10px;
    background: rgba(240, 100, 47, 0.1);
    color: var(--ember-strong);
}

.metric-card strong {
    font-size: 1.9rem;
    line-height: 1;
}

.metric-card > span:not(.metric-card__icon) {
    overflow: hidden;
    margin-top: 0.4rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-overflow: ellipsis;
}

.metric-card small {
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.69rem;
}

.content-grid > .card {
    min-width: 0;
}

.schedule-focus {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
}

.schedule-focus > span {
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 1.7rem;
}

.schedule-focus p {
    margin: 0.25rem 0 0;
    font-size: 0.84rem;
}

.toolbar {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
}

.table-card {
    min-width: 0;
    overflow: hidden;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

th,
td {
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

th {
    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

td[colspan] {
    padding: 0;
    border: 0;
}

.timeline-card {
    padding: 1rem;
}

.timeline {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.timeline li {
    display: grid;
    grid-template-columns: 3.4rem 1rem minmax(0, 1fr);
    gap: 0.65rem;
    min-height: 94px;
}

.timeline time {
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 1.05rem;
    font-weight: 700;
}

.timeline__dot {
    position: relative;
    width: 0.68rem;
    height: 0.68rem;
    margin-top: 0.35rem;
    border: 2px solid var(--ember);
    border-radius: 50%;
    background: var(--surface-1);
}

.timeline__dot::after {
    content: "";
    position: absolute;
    top: 0.65rem;
    left: 50%;
    width: 1px;
    height: 76px;
    background: var(--border-strong);
}

.timeline li:last-child .timeline__dot::after {
    display: none;
}

.timeline li > div {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: center;
    gap: 0.3rem 0.6rem;
}

.timeline li strong,
.timeline li > div > span:not(.status) {
    display: block;
    width: 100%;
}

.timeline li > div > span:not(.status) {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.report-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.9rem;
    padding: 1rem;
}

.report-card__icon,
.settings-row > span:first-child {
    display: grid;
    width: 2.65rem;
    height: 2.65rem;
    place-items: center;
    border-radius: 12px;
    background: rgba(215, 168, 62, 0.1);
    color: var(--gold);
}

.report-card h2,
.report-card p,
.settings-row h2,
.settings-row p {
    margin-bottom: 0.3rem;
}

.report-card p,
.settings-row p {
    font-size: 0.82rem;
}

.report-card .button {
    grid-column: 1 / -1;
}

.settings-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.9rem;
    padding: 1rem;
}

.settings-row .status {
    grid-column: 1 / -1;
    width: fit-content;
}

.helper-grid .helper-primary {
    padding: 1.1rem;
}

.action-card {
    display: flex;
    min-height: 76px;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-1);
    text-decoration: none;
}

.action-card > .icon {
    width: 1.7rem;
    height: 1.7rem;
    color: var(--ember-strong);
}

.action-card strong,
.action-card small {
    display: block;
}

.action-card small {
    color: var(--text-muted);
}

.action-card.is-disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.scanner-layout {
    display: grid;
    gap: 1rem;
}

.scanner-stage {
    display: grid;
    place-items: center;
    padding: 1rem;
    text-align: center;
}

.scanner-stage p {
    max-width: 46ch;
}

.scanner-frame {
    position: relative;
    display: grid;
    width: min(100%, 340px);
    aspect-ratio: 1;
    margin-bottom: 1.25rem;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 22px;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        #0a070d;
    background-size: 24px 24px;
}

.scanner-frame::before,
.scanner-frame::after,
.scanner-frame span::before,
.scanner-frame span::after {
    content: "";
    position: absolute;
    width: 3.5rem;
    height: 3.5rem;
    border-color: var(--ember);
}

.scanner-frame::before { top: 1rem; left: 1rem; border-top: 3px solid; border-left: 3px solid; border-radius: 10px 0 0; }
.scanner-frame::after { top: 1rem; right: 1rem; border-top: 3px solid; border-right: 3px solid; border-radius: 0 10px 0 0; }
.scanner-frame span::before { bottom: 1rem; left: 1rem; border-bottom: 3px solid; border-left: 3px solid; border-radius: 0 0 0 10px; }
.scanner-frame span::after { right: 1rem; bottom: 1rem; border-right: 3px solid; border-bottom: 3px solid; border-radius: 0 0 10px; }
.scanner-frame > .icon { width: 3.5rem; height: 3.5rem; color: #665d68; }

.status-samples {
    display: grid;
    align-content: start;
    gap: 0.75rem;
    padding: 1rem;
}

.scan-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.scan-result strong,
.scan-result small {
    display: block;
}

.scan-result small {
    color: var(--text-muted);
}

.scan-result--success { border-color: rgba(58, 193, 127, 0.34); background: rgba(58, 193, 127, 0.08); }
.scan-result--success > .icon { color: var(--success); }
.scan-result--warning { border-color: rgba(239, 178, 58, 0.34); background: rgba(239, 178, 58, 0.08); }
.scan-result--warning > .icon { color: var(--warning); }
.scan-result--danger { border-color: rgba(239, 98, 91, 0.34); background: rgba(239, 98, 91, 0.08); }
.scan-result--danger > .icon { color: var(--danger); }

.component-section {
    padding: 1rem;
}

.component-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.feedback-grid {
    margin-top: 1rem;
}

.loading-state {
    display: flex;
    min-height: 92px;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.loading-state strong,
.loading-state small {
    display: block;
}

.loading-state small {
    color: var(--text-muted);
}

.spinner {
    width: 1.6rem;
    height: 1.6rem;
    border: 2px solid var(--border-strong);
    border-top-color: var(--ember);
    border-radius: 50%;
    animation: spin 900ms linear infinite;
}

.dialog {
    width: min(calc(100% - 2rem), 520px);
    padding: 1.25rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-1);
    box-shadow: var(--shadow);
    color: var(--text);
}

.dialog::backdrop {
    background: rgba(5, 3, 7, 0.76);
    backdrop-filter: blur(4px);
}

.dialog__icon {
    display: grid;
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    place-items: center;
    border-radius: 14px;
    background: rgba(240, 100, 47, 0.12);
    color: var(--ember-strong);
}

.dialog__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

.mobile-nav {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    min-height: var(--mobile-nav-height);
    grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
    border-top: 1px solid var(--border);
    background: rgba(18, 12, 22, 0.96);
    backdrop-filter: blur(18px);
}

.mobile-nav__item {
    display: grid;
    min-width: 0;
    place-items: center;
    align-content: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 700;
    text-decoration: none;
}

.mobile-nav__item .icon {
    width: 1.28rem;
}

.mobile-nav__item.is-active {
    color: var(--ember-strong);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (min-width: 620px) {
    .page-content { padding: 1.5rem; gap: 1.5rem; }
    .topbar { padding-inline: 1.5rem; }
    .topbar__actions .status { display: inline-flex; }
    .page-heading { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
    .page-heading .button { width: auto; }
    .event-hero { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 1.8rem; }
    .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .metric-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .toolbar { grid-template-columns: minmax(220px, 2fr) 1fr 1fr auto; align-items: end; }
    .timeline-card { padding: 1.5rem; }
    .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .settings-row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .settings-row .status { grid-column: auto; }
    .helper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .helper-primary { grid-row: span 2; }
    .scanner-layout { grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feedback-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
    .app-shell {
        display: grid;
        min-height: 100vh;
        grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
        padding-bottom: 0;
    }

    .sidebar {
        position: sticky;
        top: 0;
        display: flex;
        height: 100vh;
        flex-direction: column;
        padding: 1.2rem 1rem;
        border-right: 1px solid var(--border);
        background: #110c16;
    }

    .brand {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.25rem 0.35rem 1.2rem;
        text-decoration: none;
    }

    .brand strong,
    .brand small {
        display: block;
    }

    .brand strong {
        font-size: 1.15rem;
        letter-spacing: 0.08em;
    }

    .brand small {
        color: var(--text-muted);
        font-size: 0.68rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .event-context {
        display: grid;
        margin-bottom: 1rem;
        padding: 0.9rem;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: linear-gradient(145deg, rgba(240, 100, 47, 0.08), rgba(36, 24, 42, 0.7));
    }

    .event-context .eyebrow {
        margin-bottom: 0.35rem;
        font-size: 0.58rem;
    }

    .event-context strong {
        font-size: 0.86rem;
    }

    .event-context > span:not(.eyebrow),
    .event-context small {
        color: var(--text-muted);
        font-size: 0.72rem;
    }

    .event-context small {
        margin-top: 0.55rem;
        color: var(--gold);
    }

    .sidebar__nav {
        display: grid;
        gap: 0.25rem;
    }

    .nav-item {
        display: flex;
        min-height: 46px;
        align-items: center;
        gap: 0.75rem;
        padding: 0.7rem 0.8rem;
        border: 1px solid transparent;
        border-radius: var(--radius-sm);
        color: var(--text-muted);
        font-size: 0.88rem;
        font-weight: 650;
        text-decoration: none;
    }

    .nav-item:hover {
        background: rgba(255, 255, 255, 0.035);
        color: var(--text-strong);
    }

    .nav-item.is-active {
        border-color: rgba(240, 100, 47, 0.2);
        background: rgba(240, 100, 47, 0.1);
        color: #ffb38d;
    }

    .sidebar__footer {
        display: grid;
        gap: 0.8rem;
        margin-top: auto;
    }

    .preview-identity {
        display: flex;
        align-items: center;
        gap: 0.7rem;
        padding: 0.75rem;
        border-top: 1px solid var(--border);
    }

    .preview-identity > .icon {
        color: var(--gold);
    }

    .preview-identity strong,
    .preview-identity small {
        display: block;
        font-size: 0.76rem;
    }

    .preview-identity small {
        color: var(--text-muted);
        font-size: 0.66rem;
    }

    .topbar {
        min-height: 76px;
        padding-inline: 2rem;
    }

    .page-content {
        gap: 1.75rem;
        padding: 2rem;
    }

    .mobile-nav {
        display: none;
    }

    .content-grid--wide {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
    }

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

@media (min-width: 880px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1.22fr) minmax(380px, 0.78fr);
    }

    .auth-visual {
        min-height: 100vh;
        align-items: center;
    }

    .auth-panel {
        padding: clamp(2rem, 5vw, 5rem);
    }
}

.auth-panel--standalone { grid-column: 1 / -1; min-height: 100vh; margin: auto; }
.auth-panel__inner--wide { width: min(720px, 100%); }
.security-setup { display: grid; gap: 1rem; align-items: center; margin: 1rem 0; }
.qr-box { width: min(240px, 100%); padding: .7rem; border-radius: var(--radius-md); background: #fff; }
.qr-box svg { display: block; width: 100%; height: auto; }
.secret-value, .token-card code { display: block; max-width: 100%; padding: .75rem; overflow-wrap: anywhere; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(0,0,0,.3); color: var(--gold); }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: 1rem 0; }
.recovery-grid code { padding: .55rem; text-align: center; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.check-row { display: flex; gap: .65rem; align-items: flex-start; }
.check-row input { width: auto; margin-top: .2rem; }
.compact-form { max-width: 620px; }
.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th, .table-wrap td { padding: .75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table-wrap td small { display: block; color: var(--text-muted); }
.assignment-grid { display: grid; gap: .5rem; }
.assignment-row { display: flex; gap: 1rem; justify-content: space-between; align-items: center; padding: .65rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
select { width: 100%; min-height: 46px; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface, #17111c); color: var(--text-strong); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.page-actions, .quick-actions, .row-actions, .inline-form { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.form-span { grid-column: 1 / -1; }
.stack-list { display: grid; gap: .65rem; }
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem 1rem; align-items: center; padding: .85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255,255,255,.018); }
.list-row > div:first-child { display: grid; gap: .2rem; }
.list-row small { color: var(--text-muted); }
.list-row .row-actions { grid-column: 1 / -1; }
.button--small { min-height: 36px; padding: .45rem .7rem; font-size: .85rem; }
.button--danger { border-color: color-mix(in srgb, var(--danger) 55%, transparent); background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--text-strong); }
.event-context form, .event-context select { width: 100%; }
.event-context select { min-height: 38px; padding: .35rem .45rem; font-size: .8rem; }
.guest-layout { display: grid; gap: 1rem; }
.guest-cards { display: grid; gap: .65rem; }
.guest-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .65rem; align-items: center; padding: .85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.guest-card > div { display: grid; gap: .2rem; }
.guest-card small { color: var(--text-muted); }
.guest-card .button { grid-column: 1 / -1; }
.guest-table { display: none; }
.future-filter { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0 0; padding: .75rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); opacity: .7; }
.future-filter label { flex: 1 1 180px; }
.bulk-bar { display: grid; gap: .65rem; margin-top: 1rem; padding: .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.bulk-bar legend { padding-inline: .35rem; color: var(--gold); font-weight: 700; }
.category-row { display: grid; gap: .6rem; padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.conflict-panel { border-color: var(--warning); }
.stepper { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .4rem; padding: 0; list-style: none; counter-reset: steps; }
.stepper li { padding: .6rem .35rem; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); text-align: center; font-size: .76rem; }
.stepper li.is-active { border-color: var(--ember); color: var(--text-strong); background: rgba(240,90,40,.1); }
.print-sheet { max-width: 1000px; padding: 2rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-1); }
.print-sheet table { width: 100%; border-collapse: collapse; margin-block: 1.5rem; }
.print-sheet th, .print-sheet td { padding: .7rem; border-bottom: 1px solid var(--border); text-align: left; }
.print-sheet footer { color: var(--text-muted); font-size: .8rem; }
.print-toolbar { display: flex; gap: .7rem; justify-content: flex-end; }
.ticket-guidance { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.status-legend, .ticket-card__actions, .table-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.table-actions form { margin: 0; }
.ticket-table { display: none; }
.ticket-cards { display: grid; gap: .75rem; }
.ticket-card { display: grid; gap: .75rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: rgba(255,255,255,.018); }
.ticket-card > div:first-child { display: grid; gap: .25rem; }
.ticket-card small { color: var(--text-muted); }
.ticket-detail-grid { display: grid; gap: 1rem; align-items: start; }
.ticket-preview { position: relative; overflow: hidden; min-height: 620px; padding: 2rem; background: radial-gradient(circle at 78% 20%,rgba(240,90,40,.18),transparent 34%),linear-gradient(150deg,#16091d,#0b0710 70%); }
.ticket-preview::before { content: ''; position: absolute; inset: 0 auto auto 0; width: 100%; height: 5px; background: linear-gradient(90deg,var(--danger),var(--ember),var(--gold)); }
.ticket-preview__brand { margin-bottom: 2.5rem; color: #fff; font-size: 2rem; font-weight: 900; letter-spacing: .08em; }
.ticket-preview h2 { max-width: 560px; margin-bottom: 2rem; font-size: clamp(1.5rem,5vw,2.4rem); }
.ticket-preview dl, .detail-list { display: grid; gap: 1rem; }
.ticket-preview dl div, .detail-list div { display: grid; gap: .25rem; }
.ticket-preview dt, .detail-list dt { color: var(--gold); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.ticket-preview dd, .detail-list dd { margin: 0; color: var(--text-strong); font-weight: 700; }
.ticket-qr { width: min(280px,100%); margin: 2rem auto 0; padding: 1rem; border: 12px solid #fff; background: #fff; border-radius: var(--radius-sm); }
.ticket-qr svg { display: block; width: 100%; height: auto; }

@media (min-width: 760px) {
    .guest-layout { grid-template-columns: minmax(0, 1.55fr) minmax(280px, .7fr); align-items: start; }
    .guest-editor { position: sticky; top: 96px; }
    .guest-table { display: block; }
    .guest-cards { display: none; }
    .list-row { grid-template-columns: minmax(0,1fr) auto auto; }
    .list-row .row-actions { grid-column: auto; }
    .bulk-bar { grid-template-columns: repeat(3,minmax(0,1fr)) auto; align-items: end; }
    .category-row { grid-template-columns: minmax(150px,1.4fr) minmax(110px,.7fr) minmax(110px,.7fr) minmax(100px,.6fr) auto; align-items: end; }
    .ticket-table { display: block; }
    .ticket-cards { display: none; }
    .ticket-detail-grid { grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr); }
}

@media (min-width: 620px) { .security-setup { grid-template-columns: 240px minmax(0, 1fr); } }

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

@media print {
    :root { color-scheme: light; }
    body { background: #fff; color: #111; }
    .sidebar, .topbar, .mobile-nav, .preview-banner, .button, .print-toolbar { display: none !important; }
    .app-shell { display: block; padding: 0; }
    .page-content { width: 100%; padding: 0; }
    .card, .metric-card { border-color: #ccc; background: #fff; box-shadow: none; }
    h1, h2, h3, strong, p, .eyebrow { color: #111; }
    .print-sheet { max-width: none; padding: 0; border: 0; background: #fff; }
    .print-sheet table { color: #111; }
    .print-sheet th, .print-sheet td { border-color: #bbb; }
}
