@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary: #E63946;
    --primary-dark: #c1121f;
    --primary-light: #FFF1F2;
    --black: #111111;
    --dark-black: #000000;
    --light-gray: #F5F5F5;
    --border: #E5E5E5;
    --muted: #666666;
    --white: #FFFFFF;
    --sidebar-width: 240px;
    --header-height: 60px;
}

* { box-sizing: border-box; }

body {
    background-color: #F0F2F5;
    color: var(--black);
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 14px;
    margin: 0;
}

/* ── SIDEBAR ── */
#sidebar {
    background-color: #0D0D0D;
    color: var(--white);
    width: var(--sidebar-width);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#sidebar .brand {
    padding: 1.2rem 1.2rem 1rem;
    border-bottom: 1px solid #222;
}

#sidebar .brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

#sidebar .brand-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 900;
    color: white;
}

#sidebar .brand-name {
    font-weight: 800;
    font-size: 1rem;
    color: var(--white);
    letter-spacing: 0.5px;
}

#sidebar .brand-sub {
    font-size: 0.65rem;
    color: #888;
    letter-spacing: 1px;
    text-transform: uppercase;
}

#sidebar .nav-section {
    padding: 1rem 0 0.5rem;
}

#sidebar .nav-section-title {
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #555;
    padding: 0 1.2rem;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

#sidebar .nav-link {
    color: #aaa;
    padding: 0.6rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

#sidebar .nav-link i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

#sidebar .nav-link:hover {
    color: var(--white);
    background: rgba(255,255,255,0.05);
}

#sidebar .nav-link.active {
    color: var(--white);
    background: rgba(230,57,70,0.15);
    border-left-color: var(--primary);
}

#sidebar .nav-logout {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid #222;
}

#sidebar .nav-logout a {
    color: #888;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    padding: 0.5rem 0.2rem;
}

#sidebar .nav-logout a:hover { color: var(--primary); }

/* ── TOP BAR ── */
#topbar {
    position: fixed;
    top: 0; left: var(--sidebar-width); right: 0;
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 100;
}

#topbar .page-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--black);
}

#topbar .topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

#topbar .admin-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ── MAIN CONTENT ── */
#main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 1.5rem;
    min-height: calc(100vh - var(--header-height));
}

/* ── CARDS ── */
.card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.stat-card {
    border-radius: 10px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.7;
}

.stat-card .stat-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    opacity: 0.15;
}

/* ── TABLES ── */
.table { font-size: 0.875rem; }
.table thead th {
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--light-gray);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
}
.table td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #F5F5F5;
}
.table tbody tr:hover { background: #FAFAFA; }
.table tbody tr:last-child td { border-bottom: none; }

/* ── BUTTONS ── */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    letter-spacing: 0.2px;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}
.btn-dark { background-color: var(--black); border-color: var(--black); }
.btn-dark:hover { background-color: #333; }

/* ── BADGES ── */
.badge { font-weight: 600; letter-spacing: 0.3px; border-radius: 5px; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status-draft { background: #F5F5F5; color: #666; }
.status-open { background: #E3F2FD; color: #1565C0; }
.status-ready { background: #E8F5E9; color: #2E7D32; }
.status-started { background: #FFEBEE; color: #C62828; }
.status-completed { background: #F3E5F5; color: #6A1B9A; }
.status-cancelled { background: #ECEFF1; color: #546E7A; }

/* ── LIVE INDICATOR ── */
.live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

/* ── FORMS ── */
.form-label {
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}
.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: 0.9rem;
    padding: 0.55rem 0.85rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230,57,70,0.1);
}

/* ── SECTION HEADERS ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: var(--black);
}
.page-header .page-subtitle {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 2px;
}

/* ── TICKET STATES ── */
.ticket-box {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.ticket-available {
    background-color: var(--primary-light);
    border: 2px solid var(--primary);
    color: var(--black);
}
.ticket-available:hover { transform: scale(1.05); box-shadow: 0 2px 8px rgba(230,57,70,0.3); }
.ticket-booked {
    background-color: var(--black);
    color: var(--white);
    border: 2px solid var(--black);
    cursor: not-allowed;
    opacity: 0.7;
}
.ticket-selected {
    background-color: var(--primary) !important;
    color: var(--white) !important;
    border-color: var(--primary-dark) !important;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(230,57,70,0.4);
}

/* ── MOBILE ── */
.mobile-topbar {
    background: var(--black);
    color: var(--white);
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mobile-topbar .brand { font-weight: 800; color: var(--primary); font-size: 1rem; }

@media (max-width: 767.98px) {
    #sidebar { display: none !important; }
    #topbar { display: none !important; }
    #main-content { margin-left: 0; margin-top: 0; padding: 1rem; }
}
