:root {
    --sb-primary: #4e73df;
    --sb-primary-dark: #224abe;
    --sb-sidebar: #2f2e41;
    --sb-sidebar-light: #3d3b57;
    --sb-bg: #f8f9fc;
    --sb-text: #1f2937;
}

body {
    font-family: 'Nunito', 'Work Sans', sans-serif;
    background: var(--sb-bg);
    color: var(--sb-text);
}

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

.sb-sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--sb-primary), var(--sb-primary-dark));
    color: #fff;
    display: flex;
    flex-direction: column;
}

.sb-sidebar-brand {
    padding: 1.5rem 1.25rem;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.sb-nav {
    list-style: none;
    margin: 0;
    padding: 1rem 0;
    flex: 1;
}

.sb-nav-item a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1.25rem;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-weight: 600;
}

.sb-nav-item.active a,
.sb-nav-item a:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.sb-sidebar-footer {
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    background: rgba(0,0,0,0.08);
}

.sb-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sb-topbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.sb-topbar-title {
    font-weight: 700;
    color: var(--sb-primary);
}

.sb-topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.sb-topbar-user img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    padding: 4px;
}

.sb-page {
    padding: 2rem 1.5rem 3rem;
}

.card-sb {
    border: none;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
}

.badge-soft {
    background: rgba(78, 115, 223, 0.1);
    color: var(--sb-primary);
}

.form-control,
.form-select {
    border-radius: 0.65rem;
}

.form-control
{
    background-color: #bfc5d6;
}

label.error {
    display: block;
    color: crimson;
    font-size: 1.15rem;
    margin-left: 15px;
}

.btn-sb {
    background: var(--sb-primary);
    color: #fff;
    border: none;
}

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

.table thead th {
    background: #f3f4f6;
    border-bottom: none;
}

.sidebar-collapsed .sb-sidebar {
    width: 80px;
}

.sidebar-collapsed .sb-sidebar-brand span,
.sidebar-collapsed .sb-nav-item a span,
.sidebar-collapsed .sb-sidebar-footer {
    display: none;
}

.sidebar-collapsed .sb-nav-item a {
    justify-content: center;
}

@media (max-width: 991px) {
    #wrapper {
        flex-direction: column;
    }
    .sb-nav {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        padding: 1rem;
    }
    .sb-nav-item a {
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
    }
    .sb-sidebar-footer {
        display: none;
    }
}


.sb-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1030;
}

@media (max-width: 991px) {
    .sb-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 1040;
        width: 260px;
    }

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

    .sidebar-open .sb-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}


@media (max-width: 991px) {
    .sb-sidebar {
        display: none;
    }
    .sidebar-open .sb-sidebar {
        display: flex;
    }
}
