:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1a1d23;
    --sidebar-hover: #2a2d35;
    --sidebar-active: var(--main-color);
    --topbar-height: 56px;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #ced4da;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-brand:hover {
    color: #fff;
    text-decoration: none;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.sidebar-section-title {
    padding: 0.5rem 1.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c757d;
    font-weight: 600;
}

.sidebar .nav-item {
    margin: 0;
}

.sidebar .nav-link {
    padding: 0.6rem 1.25rem;
    color: #9ba1a9;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
    text-decoration: none;
}

.sidebar .nav-link.active {
    background: rgba(0,85,102,0.15);
    color: #fff;
    border-left-color: var(--main-color);
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* Scoped under .admin-wrapper to outrank app.min.css, which is loaded after this
   file and also styles .main-content / .page-content. Its `overflow: hidden` breaks
   the sticky topbar, and its 992px rule is !important, so this one has to be too. */
.admin-wrapper .main-content {
    margin-left: var(--sidebar-width) !important;
    overflow: visible;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-brand-mobile {
    display: none;
    font-weight: 700;
    color: var(--main-color);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #495057;
    cursor: pointer;
    padding: 0.25rem;
}

/* app.min.css sets calc(70px + 24px) of top padding here, meant for its own fixed
   navbar. Our topbar is sticky and already in flow, so that becomes dead space. */
.admin-wrapper .page-content {
    padding: 1.5rem;
    flex: 1;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h4 {
    margin: 0;
    font-weight: 600;
}

.page-header .text-muted {
    font-size: 0.875rem;
}

.kpi-card {
    border: none;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
}

.kpi-card .card-body {
    padding: 1.25rem;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.kpi-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.kpi-sub {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.quick-action-card {
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    color: #495057;
    text-decoration: none;
    display: block;
}

.quick-action-card:hover {
    background: var(--main-color);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.75rem rgba(0,85,102,0.2);
}

.quick-action-card i {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    display: block;
}

.quick-action-card span {
    font-size: 0.85rem;
    font-weight: 500;
}

.role-badge-superadmin {
    background: #dc3545;
    color: #fff;
}

.role-badge-admin {
    background: #0d6efd;
    color: #fff;
}

.role-badge-finance {
    background: #198754;
    color: #fff;
}

.role-badge-event_manager {
    background: #6f42c1;
    color: #fff;
}

.role-badge-staff {
    background: #6c757d;
    color: #fff;
}

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

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

    .admin-wrapper .main-content {
        margin-left: 0 !important;
    }

    .topbar-brand-mobile {
        display: block;
    }

    .sidebar-toggle {
        display: block;
    }

    .admin-wrapper .page-content {
        padding: 1rem;
    }

    .kpi-value {
        font-size: 1.35rem;
    }
}
