:root {
    --gqr-blue: #155eef;
    --gqr-blue-dark: #0b3aa6;
    --gqr-ink: #12203b;
    --gqr-muted: #60708c;
    --gqr-bg: #f4f7fb;
    --gqr-border: #dfe7f2;
    --gqr-sidebar: #0b1f3a;
    --gqr-admin: #172554;
    --gqr-success: #087f5b;
    --gqr-danger: #c92a2a;
}

body {
    background: var(--gqr-bg);
    color: var(--gqr-ink);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--gqr-blue); }
.min-w-0 { min-width: 0; }
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: .55rem;
    background: #fff;
    color: var(--gqr-blue-dark);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: -.02em;
    vertical-align: middle;
}

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
    width: 262px;
    flex: 0 0 262px;
    background: var(--gqr-sidebar);
    color: #e5edf9;
    padding: 1rem .85rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-admin { background: var(--gqr-admin); }
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: .35rem .45rem 1rem;
}
.sidebar-context {
    border-top: 1px solid rgba(255,255,255,.1);
    border-bottom: 1px solid rgba(255,255,255,.1);
    padding: .8rem .45rem;
    margin-bottom: .8rem;
}
.sidebar-nav { display: flex; flex-direction: column; gap: .15rem; }
.sidebar-link {
    display: block;
    color: #c4d3e8;
    text-decoration: none;
    font-size: .91rem;
    font-weight: 500;
    padding: .58rem .7rem;
    border-radius: .5rem;
    transition: background .15s ease, color .15s ease;
}
.sidebar-link:hover, .sidebar-link:focus { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-link.active { color: #fff; background: var(--gqr-blue); }
.sidebar-section {
    color: #7f97b7;
    text-transform: uppercase;
    letter-spacing: .09em;
    font-size: .66rem;
    font-weight: 700;
    padding: 1rem .7rem .35rem;
}
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.1); padding: .8rem .5rem .2rem; color: #c4d3e8; }
.app-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--gqr-border);
    padding: .8rem 1.3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
}
.page-kicker { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gqr-muted); font-weight: 700; }
.content { padding: 1.4rem; flex: 1; }
.app-footer { color: var(--gqr-muted); font-size: .76rem; border-top: 1px solid var(--gqr-border); padding: .75rem 1.4rem; display: flex; justify-content: space-between; gap: 1rem; }
.card { border-color: var(--gqr-border); border-radius: .85rem; box-shadow: 0 4px 18px rgba(18,32,59,.04); }
.card-header { background: #fff; border-bottom-color: var(--gqr-border); font-weight: 650; }
.btn-primary { --bs-btn-bg: var(--gqr-blue); --bs-btn-border-color: var(--gqr-blue); --bs-btn-hover-bg: var(--gqr-blue-dark); --bs-btn-hover-border-color: var(--gqr-blue-dark); }
.form-control, .form-select { border-color: #cfd9e8; }
.form-control:focus, .form-select:focus { border-color: #8bb0ff; box-shadow: 0 0 0 .2rem rgba(21,94,239,.14); }
.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: .72rem .65rem; vertical-align: middle; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gqr-muted); font-weight: 700; background: #f8fafd; }
.stat-card { height: 100%; }
.stat-label { color: var(--gqr-muted); font-size: .76rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.6rem; font-weight: 750; letter-spacing: -.03em; }
.stat-hint { color: var(--gqr-muted); font-size: .78rem; }

.public-nav { background: linear-gradient(100deg, #0b1f3a, #0b3aa6); }
.public-nav .brand-mark { width: 1.9rem; height: 1.9rem; }
.public-main { min-height: calc(100vh - 132px); }
.public-footer { background: #0b1f3a; color: #c4d3e8; padding: 1rem 0; font-size: .8rem; }
.hero {
    background: radial-gradient(circle at 85% 20%, rgba(83,145,255,.35), transparent 36%), linear-gradient(110deg, #0b1f3a, #0b3aa6 65%, #155eef);
    color: #fff;
    border-radius: 1rem;
    padding: 2.2rem;
}
.hero h1 { letter-spacing: -.035em; }
.event-card { height: 100%; overflow: hidden; }
.event-cover { height: 160px; object-fit: cover; background: linear-gradient(135deg, #dce9ff, #eef5ff); width: 100%; }
.event-cover-placeholder { display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #6694e8; font-weight: 800; }
.ticket-card { max-width: 760px; margin: auto; background: #fff; border: 1px solid var(--gqr-border); border-radius: 1rem; overflow: hidden; }
.ticket-stub { border-left: 2px dashed #c7d4e8; }
.qr-box { background: #fff; padding: .65rem; border: 1px solid var(--gqr-border); border-radius: .6rem; display: inline-block; min-width: 172px; min-height: 172px; }
.qr-box img, .qr-box canvas { display: block; margin: auto; max-width: 100%; height: auto !important; }
.ticket-number { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .03em; }

.scanner-page { background: #071426; min-height: 100vh; color: #eef4ff; }
.scanner-header { background: #0b1f3a; border-bottom: 1px solid rgba(255,255,255,.12); }
.scanner-camera {
    background: #000;
    border-radius: .8rem;
    overflow: hidden;
    position: relative;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.scanner-camera video { width: 100%; max-height: 56vh; object-fit: cover; }
.scanner-result { border-radius: .9rem; padding: 1.4rem; min-height: 210px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.scanner-result.authorized { background: #067647; color: #fff; }
.scanner-result.denied { background: #b42318; color: #fff; }
.scanner-result.unavailable { background: #b54708; color: #fff; }
.scanner-result h2 { font-size: 2rem; font-weight: 850; letter-spacing: -.03em; }
.scanner-result .detail { font-size: 1rem; opacity: .92; }
.scanner-history { max-height: 340px; overflow-y: auto; }
.scanner-history .item { border-bottom: 1px solid rgba(255,255,255,.1); padding: .6rem 0; }
.scanner-page .form-control, .scanner-page .form-select { background: #12243e; color: #fff; border-color: #294160; }
.scanner-page .form-control::placeholder { color: #93a9c7; }
.scanner-page .form-select option { color: #111; }

@media (max-width: 991.98px) {
    .content { padding: 1rem; }
    .topbar { padding: .75rem 1rem; }
    .app-footer { flex-direction: column; }
    .hero { padding: 1.5rem; border-radius: .8rem; }
}

@media print {
    .sidebar, .topbar, .app-footer, .public-nav, .public-footer, .no-print, .alert { display: none !important; }
    body, .content, .app-main, .app-shell { background: #fff !important; margin: 0 !important; padding: 0 !important; display: block !important; }
    .ticket-card { border: 0; max-width: 100%; box-shadow: none !important; page-break-inside: avoid; }
    .card { box-shadow: none !important; }
    a { color: inherit !important; text-decoration: none !important; }
}
