:root {
    --app-sidebar: #111827;
    --app-sidebar-soft: rgba(255, 255, 255, 0.06);
    --app-sidebar-hover: rgba(255, 255, 255, 0.10);
    --app-sidebar-active: rgba(255, 255, 255, 0.16);
    --app-border: rgba(255, 255, 255, 0.08);
}

html, body {
    height: 100%;
}

body {
    font-size: 0.95rem;
    background: #f3f6fa;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 290px;
    flex: 0 0 290px;
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    box-shadow: 0 0 1.5rem rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.app-main {
    min-width: 0;
    flex: 1 1 auto;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sidebar-group {
    border-bottom: 1px solid var(--app-border);
    padding-bottom: 0.4rem;
}

.sidebar-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 0;
    background: transparent;
    color: #fff;
    padding: 0.75rem 0.25rem 0.65rem;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: left;
}

.sidebar-group-toggle:hover {
    color: #fff;
    opacity: 0.95;
}

.group-title {
    display: inline-flex;
    align-items: center;
}

.sidebar-caret {
    transition: transform 0.15s ease;
    opacity: 0.75;
    font-size: 0.85rem;
}

.sidebar-group-toggle.collapsed .sidebar-caret {
    transform: rotate(-90deg);
}

.submenu-list {
    gap: 0.15rem;
    padding: 0 0 0.4rem 0.2rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.88);
    border-radius: 0.75rem;
    padding: 0.6rem 0.8rem;
    transition: background-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.sidebar .nav-link:hover {
    background: var(--app-sidebar-hover);
    color: #fff;
    transform: translateX(2px);
}

.submenu-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-left: 0.1rem;
    padding-left: 0.9rem;
    font-size: 0.93rem;
}

.submenu-link::before {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.48);
    flex: 0 0 0.45rem;
}

.submenu-link.active {
    background: var(--app-sidebar-active);
    font-weight: 700;
    color: #fff;
}

.submenu-link.active::before {
    background: #fff;
}

.logout-link {
    border-top: 1px solid var(--app-border);
    border-radius: 0.75rem;
    padding-top: 0.9rem;
}

.user-card {
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--app-border);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.04);
}

.card {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 0.35rem 1rem rgba(15, 23, 42, 0.06);
}

.table td,
.table th {
    vertical-align: middle;
}

.table-sm td,
.table-sm th {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.sticky-top-card {
    position: sticky;
    top: 1rem;
}

.badge-soft {
    background: #eef2ff;
    color: #3730a3;
}

.form-text,
.text-muted.small {
    color: #64748b !important;
}

.btn {
    border-radius: 0.7rem;
}

@media (max-width: 991.98px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-basis: auto;
        position: relative;
        height: auto;
    }

    .sidebar-inner {
        height: auto;
    }
}
