/* ===== SIDEBAR ===== */
.sidebar {
    width: 240px;
    height: 100vh;
    background: #1a3a2f;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 44px;
    height: 44px;
    /*background: #2d7a4e;*/
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .sidebar-logo-icon svg {
        width: 28px;
        height: 28px;
    }

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease, width 0.3s ease;
}

    .sidebar-logo-text .logo-firma {
        font-size: 16px;
        font-weight: 700;
        color: #ffffff;
        letter-spacing: 1px;
    }

    .sidebar-logo-text .logo-digital {
        font-size: 13px;
        font-weight: 600;
        color: #4ade80;
        letter-spacing: 0.5px;
    }

    .sidebar-logo-text small {
        display: none;
    }

.sidebar-menu-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px 0;
}

    /* Scrollbar personalizado */
    .sidebar-menu-wrapper::-webkit-scrollbar {
        width: 4px;
    }

    .sidebar-menu-wrapper::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar-menu-wrapper::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.2);
        border-radius: 4px;
    }

        .sidebar-menu-wrapper::-webkit-scrollbar-thumb:hover {
            background: rgba(255,255,255,0.3);
        }

/* Sidebar Navigation */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-item {
    margin: 2px 10px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
}

    .sidebar-nav-link:hover {
        background: rgba(255,255,255,0.08);
        color: #ffffff;
    }

.sidebar-nav-item.active .sidebar-nav-link {
    background: #2d7a4e;
    color: #ffffff;
    font-weight: 500;
}

.sidebar-nav-icon {
    width: 20px;
    min-width: 20px;
    text-align: center;
    font-size: 15px;
    opacity: 0.9;
}

.sidebar-nav-item.active .sidebar-nav-icon {
    opacity: 1;
}

.sidebar-nav-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s ease;
}

.sidebar-nav-arrow {
    font-size: 11px;
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.sidebar-nav-link.has-submenu:not(.collapsed) .sidebar-nav-arrow {
    transform: rotate(180deg);
}

/* Submenu */
.sidebar-subnav {
    list-style: none;
    padding: 4px 0 4px 44px;
    margin: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar-subnav-item {
    margin: 2px 0;
}

.sidebar-subnav-link {
    display: block;
    padding: 8px 12px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .sidebar-subnav-link:hover {
        color: #ffffff;
        background: rgba(255,255,255,0.05);
    }

/* Sidebar Footer */
.sidebar-footer {
    padding: 15px 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 auto;
    background: rgba(255,255,255,0.05);
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

    .sidebar-collapse-btn:hover {
        background: rgba(255,255,255,0.1);
        color: #ffffff;
    }

    .sidebar-collapse-btn i {
        transition: transform 0.3s ease;
    }

/* ===== COLLAPSED SIDEBAR ===== */
body.sidebar-collapsed .sidebar {
    width: 70px;
}

body.sidebar-collapsed .sidebar-logo-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

body.sidebar-collapsed .sidebar-nav-text,
body.sidebar-collapsed .sidebar-nav-arrow {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

body.sidebar-collapsed .sidebar-subnav {
    display: none;
}

body.sidebar-collapsed .sidebar-nav-link {
    justify-content: center;
    padding: 12px;
}

body.sidebar-collapsed .sidebar-nav-icon {
    margin: 0;
}

body.sidebar-collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

body.sidebar-collapsed .main-wrapper {
    margin-left: 70px;
}

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ===== RESPONSIVE SIDEBAR ===== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        height: 100vh;
    }

        .sidebar.show {
            transform: translateX(0);
            box-shadow: 4px 0 20px rgba(0,0,0,0.3);
        }

    .main-wrapper {
        margin-left: 0;
    }

    body.sidebar-collapsed .main-wrapper {
        margin-left: 0;
    }

    body.sidebar-collapsed .sidebar {
        width: 260px;
    }

    /* Overlay cuando el sidebar esta abierto en mobile */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

        .sidebar-overlay.show {
            display: block;
            opacity: 1;
        }
}

@media (max-width: 576px) {
    .sidebar {
        width: 100%;
    }

        .sidebar.show {
            width: 280px;
        }
}
/* ===== ORG SELECT CUSTOM ===== */
.org-select-custom {
    min-width: 200px;
}

    .org-select-custom .custom-select-trigger {
        background: #f9fafb;
        border-color: #e5e7eb;
    }

    .org-select-custom .custom-select-options {
        min-width: 220px;
        right: 0;
        left: auto;
    }

    .org-select-custom .custom-select-option {
        padding: 14px 16px;
    }

        .org-select-custom .custom-select-option i {
            color: #6b7280;
            width: 18px;
            text-align: center;
            font-size: 14px;
        }

        .org-select-custom .custom-select-option.selected i {
            color: #059669;
        }

        .org-select-custom .custom-select-option:hover i {
            color: #374151;
        }

        .org-select-custom .custom-select-option.selected:hover i {
            color: #059669;
        }