.sidebar-panel {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--erp-sidebar);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    color: #CBD5E1;
    background: var(--erp-sidebar-bg, #0A1B32);
    border-right: 1px solid rgba(148, 163, 184, 0.12);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.25);
    transition: transform var(--erp-transition), width var(--erp-transition), background-color 200ms ease;
}

.sidebar-header {
    min-height: var(--erp-topbar);
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: var(--erp-sidebar-bg, #0B1324);
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #18BFD8, #20D5B0);
    font-weight: 800;
    font-size: 1rem;
    color: #0B1324;
    box-shadow: 0 4px 12px rgba(24, 191, 216, 0.30);
    flex-shrink: 0;
}

.sidebar-header strong {
    display: block;
    color: #F8FAFC;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.sidebar-header small {
    color: #94A3B8;
    font-size: 0.76rem;
    font-weight: 500;
}

.sidebar-body {
    flex: 1;
    padding: 0.85rem 0.65rem;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom sidebar scrollbar */
.sidebar-body::-webkit-scrollbar {
    width: 5px;
}

.sidebar-body::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.18);
    border-radius: 4px;
}

.sidebar-body::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.35);
}

.sidebar-section-label {
    color: #64748B;
    font-size: 0.68rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.75rem 0.75rem 0.35rem;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.25rem;
}

.sidebar-link {
    width: 100%;
    border: 0;
    background: transparent;
    color: #94A3B8;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 550;
    text-align: left;
    position: relative;
    cursor: pointer;
    transition: all var(--erp-transition);
}

.sidebar-link i:first-child {
    width: 18px;
    font-size: 0.95rem;
    text-align: center;
    color: #64748B;
    flex-shrink: 0;
    transition: color var(--erp-transition);
}

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

.sidebar-link:hover i:first-child {
    color: #20C4E8;
}

.sidebar-link.active,
.has-submenu.open>.sidebar-link {
    color: #FFFFFF;
    background: rgba(32, 196, 232, 0.12);
    font-weight: 600;
}

.sidebar-link.active i:first-child,
.has-submenu.open>.sidebar-link i:first-child {
    color: #20C4E8;
}

.sidebar-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: #20C4E8;
    box-shadow: 0 0 8px rgba(32, 196, 232, 0.5);
}

/* Submenu */
.submenu {
    display: none;
    list-style: none;
    padding: 0.2rem 0 0.3rem 1.65rem;
    margin: 0.1rem 0 0.25rem 0.5rem;
    border-left: 1px solid rgba(148, 163, 184, 0.15);
}

.has-submenu.open .submenu {
    display: grid;
    gap: 0.15rem;
}

.submenu a {
    display: block;
    color: #94A3B8;
    padding: 0.42rem 0.75rem;
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 500;
    transition: all var(--erp-transition);
}

.submenu a:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.05);
    padding-left: 0.9rem;
}

.submenu a.active {
    color: #20C4E8;
    background: rgba(32, 196, 232, 0.12);
    font-weight: 600;
}

.submenu-angle {
    margin-left: auto;
    font-size: 0.75rem;
    color: #64748B;
    transition: transform var(--erp-transition);
}

.has-submenu.open .submenu-angle {
    transform: rotate(180deg);
    color: #CBD5E1;
}

.menu-pill {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.12rem 0.45rem;
    background: rgba(24, 191, 216, 0.15);
    color: #38DDF3;
}

.sidebar-footer {
    padding: 0.85rem 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    background: var(--erp-sidebar-bg, #0B1324);
}

.ops-card {
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 10px;
    background: rgba(22, 35, 56, 0.65);
}

.ops-card small {
    display: block;
    color: #94A3B8;
    font-size: 0.72rem;
}

.ops-card strong {
    color: #F8FAFC;
    font-size: 0.88rem;
}

.ops-card .progress {
    background-color: rgba(148, 163, 184, 0.15);
}

.ops-card .progress-bar {
    background: linear-gradient(135deg, #18BFD8, #20D5B0) !important;
}

.sidebar-collapse-mini {
    display: none;
}

/* Collapsed Sidebar */
body.sidebar-collapsed .sidebar-panel {
    width: 72px;
}

body.sidebar-collapsed .app-main {
    margin-left: 72px;
}

body.sidebar-collapsed .sidebar-header div:not(.sidebar-logo),
body.sidebar-collapsed .sidebar-link span,
body.sidebar-collapsed .submenu-angle,
body.sidebar-collapsed .sidebar-section-label,
body.sidebar-collapsed .sidebar-footer,
body.sidebar-collapsed .submenu {
    display: none !important;
}

body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 0.65rem 0;
}

body.sidebar-collapsed .sidebar-link i:first-child {
    width: auto;
    font-size: 1.1rem;
}

body.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0.85rem 0;
}