*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #ce492a;
    --primary-light: #e05a38;
    --bg: #f7f5f3;
    --sidebar-bg: #1a1a1a;
    --sidebar-width: 260px;
    --text: #1a1a1a;
    --text-muted: #888;
    --border: #e8e4e0;
    --shadow: 0 2px 12px rgba(0, 0, 0, .07);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, .1);
    --radius: 14px;
    --radius-sm: 8px;
}

html,
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform .3s ease;
}

.sidebar-logo {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.logo-text {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 3px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, .55);
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, .07);
    color: rgba(255, 255, 255, .9);
}

.nav-item.active {
    background: var(--primary);
    color: #fff;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-mini {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info span {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    display: block;
}

.user-info small {
    font-size: 11px;
    color: rgba(255, 255, 255, .4);
}

.logout-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .4);
    transition: all .2s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 32px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    padding: 4px;
}

.page-body {
    padding: 32px;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-size: 22px;
    font-weight: 800;
}

.page-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 2px;
    margin-bottom: 24px;
}

.tab-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.tab {
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--border);
    background: #fff;
    color: var(--text-muted);
    transition: all .2s;
    font-family: 'Inter', sans-serif;
}

.tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.ticket-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: fadeUp .4s ease both;
    border: 1px solid var(--border);
    transition: transform .2s, box-shadow .2s;
}

.ticket-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.ticket-header {
    padding: 18px 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.ticket-event-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.ticket-event-info {
    flex: 1;
}

.ticket-event-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.ticket-event-loc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
}

.badge--confirmed {
    background: rgba(39, 174, 96, .12);
    color: #1a7a3f;
}

.badge--used {
    background: rgba(150, 150, 150, .12);
    color: #666;
}

.ticket-divider {
    display: flex;
    align-items: center;
    padding: 0 14px;
    position: relative;
    margin: 0 6px;
}

.ticket-divider::before {
    content: '';
    flex: 1;
    height: 1px;
    background: repeating-linear-gradient(90deg, var(--border) 0, var(--border) 5px, transparent 5px, transparent 10px);
}

.ticket-hole {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    flex-shrink: 0;
    margin: 0 -7px;
}

.ticket-body {
    padding: 14px 20px;
    display: flex;
    gap: 14px;
    align-items: center;
}

.ticket-detail {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ticket-field label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
}

.ticket-field span {
    font-size: 13px;
    font-weight: 600;
}

.ticket-qr-box {
    width: 72px;
    height: 72px;
    border: 2px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    gap: 3px;
    transition: border-color .2s;
    flex-shrink: 0;
}

.ticket-qr-box:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.ticket-footer {
    padding: 12px 20px;
    background: var(--bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-price-display {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
}

.ticket-code {
    font-size: 10px;
    color: var(--text-muted);
    font-family: monospace;
    margin-top: 1px;
}

.btn-dl {
    background: none;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-dl:hover {
    background: var(--primary);
    color: #fff;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    grid-column: 1/-1;
}

.empty-state .emoji {
    font-size: 56px;
    display: block;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.btn-primary-action {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.btn-primary-action:hover {
    background: var(--primary-light);
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    animation: fadeUp .3s ease;
}

.modal-box h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.modal-box p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.modal-qr-area {
    width: 180px;
    height: 180px;
    margin: 0 auto 16px;
    background: repeating-linear-gradient(45deg, #f0f0f0 0px, #f0f0f0 2px, #fff 2px, #fff 8px);
    border: 3px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-muted);
}

.modal-code {
    font-family: monospace;
    font-size: 13px;
    background: var(--bg);
    padding: 8px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
}

.btn-close-modal {
    background: var(--text);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 90;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .topbar,
    .page-body {
        padding-left: 20px;
        padding-right: 20px;
    }

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