:root {
    --bg: #111111;
    --surface: #1b1b1b;
    --surface-2: #232323;
    --muted: #b9b9b9;
    --text: #f4f4f4;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --primary: #6c0000;
    --primary-hover: #520000;
    --nav-bg: #1a1414;
    --nav-border: #3e2c2c;
}

html,
body {
    background: var(--bg);
    color: var(--text);
    min-height: 100%;
}

body.app-shell {
    margin: 0;
    padding-bottom: 84px;
    font-size: 1rem;
}

.app-container {
    max-width: 820px;
}

.top-header {
    position: sticky;
    top: 0;
    z-index: 25;
    border-bottom: 1px solid #2f2f2f;
    background: transparent;
}

.top-header-inner {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 12px 14px 6px 14px;
    margin: 0 auto;
}

.top-header-inner-scanner {
    padding-bottom: 2px;
}

.top-logo {
    width: 112px;
    height: 112px;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
    padding: 0;
}

.install-gate {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.88);
    display: grid;
    place-items: center;
    padding: 16px;
}

.install-gate-card {
    width: min(460px, 100%);
    background: #171717;
    border: 1px solid #3e2c2c;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.install-gate-logo {
    width: 110px;
    height: 110px;
    object-fit: contain;
    margin-bottom: 8px;
}

.install-gate-title {
    font-size: 1.35rem;
    margin-bottom: 8px;
}

.install-gate-text {
    color: #d7d7d7;
    margin-bottom: 14px;
}

.install-gate-help {
    color: #f2b4b4;
    font-size: 0.95rem;
}

.top-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
}

.screen-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
}

.screen-subtitle {
    color: var(--muted);
    text-align: center;
}

.card-soft {
    border: 1px solid #3d3d3d;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}

.form-control,
.form-control:focus {
    background: var(--surface-2);
    color: var(--text);
    border-color: #5b5b5b;
}

.form-label,
.form-check-label {
    color: var(--text);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.qr-reader {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    min-height: 320px;
    background: #101010;
}

.scanner-status {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

.scanner-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    margin-bottom: 8px;
}

.scan-result-card {
    min-height: 240px;
}

.scanner-retry {
    position: sticky;
    bottom: 90px;
    z-index: 15;
    font-size: 1.15rem;
    font-weight: 700;
    padding-top: 14px;
    padding-bottom: 14px;
}

.result-success {
    border-left: 8px solid var(--success);
    background: linear-gradient(180deg, #14532d 0%, #1b1b1b 100%);
}

.result-warning {
    border-left: 8px solid var(--warning);
    background: linear-gradient(180deg, #78350f 0%, #1b1b1b 100%);
}

.result-danger {
    border-left: 8px solid var(--danger);
    background: linear-gradient(180deg, #7f1d1d 0%, #1b1b1b 100%);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #211919 0%, var(--nav-bg) 100%);
    border-top: 1px solid var(--nav-border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    z-index: 20;
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.35);
}

.bottom-nav-link {
    text-align: center;
    color: #f1d7d7;
    text-decoration: none;
    padding: 13px 8px 14px 8px;
    font-weight: 600;
    border-top: 3px solid transparent;
    transition: all .15s ease;
}

.bottom-nav-link:hover,
.bottom-nav-link:focus {
    color: #ffffff;
    border-top-color: var(--primary);
    background: rgba(108, 0, 0, 0.18);
}

#selectedEventText {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffd4d4;
    background: rgba(108, 0, 0, 0.22);
    border: 1px solid rgba(108, 0, 0, 0.58);
    border-radius: 12px;
    padding: 8px 10px;
    margin-top: 8px;
    text-align: center;
}

.scanner-page {
    margin-top: 0;
}