:root {
    --sidebar-width: 250px;
    --brand: #2f6f4e;
    --brand-dark: #234f38;
}

body {
    background-color: #f4f6f5;
    font-family: 'Segoe UI', Tahoma, Verdana, sans-serif;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--brand-dark), var(--brand));
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1030;
    transition: transform .25s ease;
}

.sidebar .brand {
    padding: 1.25rem 1rem;
    font-weight: 700;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255,255,255,.15);
}

.sidebar .brand small {
    display: block;
    font-weight: 400;
    opacity: .75;
    font-size: .72rem;
}

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

.sidebar-nav .nav-link {
    color: rgba(255,255,255,.85);
    padding: .65rem 1.25rem;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .92rem;
}

.sidebar-nav .nav-link i {
    width: 18px;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,.15);
    border-left-color: #fff;
    color: #fff;
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.15);
    font-size: .85rem;
}

/* ---------- Main content ---------- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e3e6e5;
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.page-body {
    padding: 1.5rem;
    flex: 1;
}

.card-stat {
    border: none;
    border-radius: .75rem;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
}

.card-stat .stat-icon {
    font-size: 1.8rem;
    opacity: .85;
}

.sidebar-toggle-btn {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle-btn {
        display: inline-flex;
    }
}

table.table thead th {
    background-color: #eef3f0;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.badge-rank-1 { background-color: #d4af37 !important; }
