/* Variables CSS */
:root {
    --primary-color: #101075;
    /*menu hecho click*/
    --secondary-color: #534bae;
    --accent-color: #0bd498;
    --dark-color: #090947;
    /*color de la barra de menus*/
    --light-color: #ecf0f1;
    --text-color: #a0e8fa;
    --sidebar-width: 200px;
    --sidebar-collapsed-width: 60px;
    --top-bar-height: 50px;
    --toolbar-height: 80px;
    --transition-speed: 0.3s;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Estilos Generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    overflow-x: hidden;
}

.submenu-text{
    text-decoration: none;
    color: var(--text-color);
}

/* Barra Superior (Mobile) */
.top-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--top-bar-height);
    background-color: var(--dark-color);
    color: var(--text-color);
    z-index: 100;
    box-shadow: var(--shadow);
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 15px;
}

.company-name-mobile {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
}

.top-bar-left,
.top-bar-right {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.menu-toggle,
.dots-menu,
.user-icon-mobile {
    font-size: 20px;
}

/* Barra Lateral Izquierda */
.sidebar-left {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-collapsed-width);
    background-color: var(--dark-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: width var(--transition-speed);
    z-index: 90;
}

.sidebar-left.expanded {
    width: var(--sidebar-width);
}

.sidebar-left.pinned {
    width: var(--sidebar-width);
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: var(--dark-color);
    height: 60px;
}

.logo {
    min-width: 30px;
    height: 30px;
    background-color: transparent;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 10px;
}

.company-name {
    font-size: 18px;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.sidebar-left.expanded .company-name,
.sidebar-left.pinned .company-name {
    opacity: 1;
}

.sidebar-menu {
    margin-top: 10px;
    overflow: hidden;
    max-height: calc(100vh - 120px);
}

.sidebar-menu::-webkit-scrollbar {
    width: 5px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color var(--transition-speed);
    position: relative;
}

.menu-item:hover {
    color: var(--dark-color);
    background-color: #A0BBFA;
    clip-path: polygon(0% 0%,
            calc(100% - 4px) 0%,
            calc(100% - 4px) 100%,
            0% 100%,
            0% calc(50% + 2px),
            calc(0% + 4px) calc(50% + 2px),
            calc(0% + 4px) calc(100% - 4px),
            calc(0% + 8px) calc(100% - 4px),
            calc(0% + 8px) calc(0% + 4px),
            calc(0% + 4px) calc(0% + 4px),
            calc(0% + 4px) calc(50% - 2px),
            0% calc(50% - 2px));
}

.menu-item.active {
    color: var(--primary-color);
    background-color: var(--text-color);
    clip-path: polygon(0% 0%,
            calc(100% - 0px) 0%,
            calc(100% - 0px) 100%,
            0% 100%,
            0% calc(50% + 2px),
            calc(0% + 4px) calc(50% + 2px),
            calc(0% + 4px) calc(100% - 4px),
            calc(0% + 8px) calc(100% - 4px),
            calc(0% + 8px) calc(0% + 4px),
            calc(0% + 4px) calc(0% + 4px),
            calc(0% + 4px) calc(50% - 2px),
            0% calc(50% - 2px));
}

.menu-icon {
    font-size: 18px;
    min-width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.menu-item:hover .menu-icon {
    color: var(--primary-color);
    transform: rotate(15deg);

}

.menu-text {
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.sidebar-left.expanded .menu-text,
.sidebar-left.pinned .menu-text {
    opacity: 1;
}

.menu-arrow {
    margin-left: auto;
    font-size: 12px;
    opacity: 0;
    transition: transform 0.2s, opacity var(--transition-speed);
}

.sidebar-left.expanded .menu-arrow,
.sidebar-left.pinned .menu-arrow {
    opacity: 1;
}

.menu-arrow.active {
    transform: rotate(90deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: rgba(192, 192, 192, 0.26);
    border-left: solid 4px var(--dark-color);
    border-right: solid 4px var(--dark-color);
    /*
            clip-path: polygon(0% 0%,
                    100% 0%,
                    100% 100%,
                    0% 100%,
                    0% calc(0% + 8px),
                    calc(0% + 4px) calc(0% + 8px),
                    calc(0% + 4px) calc(100% - 4px),
                    calc(0% + 8px) calc(100% - 4px),
                    calc(0% + 8px) calc(0% + 4px),
                    calc(0% + 4px) calc(0% + 4px),
                    calc(0% + 4px) calc(0% + 4px),
                    0% calc(0% + 4px));
                    */
}

.submenu.active {
    max-height: 1000px;
}

.submenu-item {
    display: flex;
    align-items: center;
    /*border-left: solid 6px var(--text-color);*/
    padding: 10px 15px 10px 15px;
    cursor: pointer;
    /*transition: background-color var(--transition-speed);*/





    /*
            clip-path: polygon(0% calc(50% - 2px),
                    calc(0% + 10px) 0%,
                    calc(100% - 0px) 0%,
                    calc(100% - 0px) 100%,
                    0% 100%,
                    0% calc(50% + 2px),
                    calc(0% + 10px) calc(50% + 2px),
                    calc(0% + 10px) calc(100% - 4px),
                    calc(0% + 14px) calc(100% - 4px),
                    calc(0% + 14px) calc(0% + 4px),
                    calc(0% + 10px) calc(0% + 4px),
                    calc(0% + 10px) calc(50% - 2px),
                    0% calc(50% - 2px));

                    */
}

.submenu-item:hover {
    background-color: var(--dark-color);
    color: var(--text-color);
    clip-path: polygon(0% calc(50% - 2px),
            calc(0% + 4px) calc(50% - 2px),
            calc(0% + 4px) calc(0% + 4px),
            calc(100% - 4px) calc(0% + 4px),
            calc(100% - 4px) calc(100% - 4px),
            calc(0% + 4px) calc(100% - 4px),
            calc(0% + 4px) calc(50% + 2px),
            0% calc(50% + 2px));

}

.submenu-item.active {

    background-color: var(--dark-color);
    clip-path: polygon(0% calc(50% - 2px),
            calc(0% + 4px) calc(50% - 2px),
            calc(0% + 4px) calc(0% + 4px),
            calc(100% - 4px) calc(0% + 4px),
            calc(100% - 4px) calc(100% - 4px),
            calc(0% + 4px) calc(100% - 4px),
            calc(0% + 4px) calc(50% + 2px),
            0% calc(50% + 2px));
}

.submenu-text {
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.sidebar-left.expanded .submenu-text,
.sidebar-left.pinned .submenu-text {
    opacity: 1;
}

.pin-container {
    position: absolute;
    bottom: 15px;
    width: 100%;
    text-align: center;
    padding: 10px;
}

.pin-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 auto;
    transition: transform 0.2s;
}

.pin-button:hover {
    transform: scale(1.1);
}

/* Toolbar (Cinta de opciones) */
.toolbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-collapsed-width);
    width: 100%;
    height: var(--toolbar-height);
    background-color: white;
    box-shadow: var(--shadow);
    display: none;
    align-items: center;
    padding: 0px 20px;
    z-index: 80;
}

.toolbar.active {
    display: flex;

}

.toolbar-with-pinned-sidebar {
    left: var(--sidebar-width);

}

.toolbar-title {
    font-size: 20px;
    font-weight: bold;
    margin-right: 20px;
    color: var(--dark-color);
}

.toolbar-actions {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    flex-grow: 1;
    padding-bottom: 5px;
}

.toolbar-actions::-webkit-scrollbar {
    height: 5px;
}

.toolbar-actions::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.toolbar-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    border-radius: 5px;
    background-color: var(--light-color);
    color: var(--dark-color);
    cursor: pointer;
    transition: background-color 0.2s;
    min-width: 70px;
}

.toolbar-button:hover {
    background-color: var(--primary-color);
    color: white;
}

.toolbar-icon {
    font-size: 18px;
    margin-bottom: 5px;
}

.toolbar-text {
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
}

/* Barra Lateral Derecha */
.sidebar-right {
    position: fixed;
    top: calc(2px + var(--top-bar-height));
    right: -300px;
    height: 100vh;
    width: var(--sidebar-width);
    background-color: var(--dark-color);
    color: var(--text-color);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right var(--transition-speed);
    z-index: 90;
    overflow-y: auto;
}

.sidebar-right.active {
    right: 0;
}

.right-sidebar-header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--light-color);
}

.user-profile {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 10px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: bold;
    color: var(--dark-color);
}

.user-role {
    font-size: 12px;
    color: #7f8c8d;
}

.right-sidebar-menu {
    padding: 20px;
}

.right-menu-section {
    margin-bottom: 20px;
}

.right-menu-title {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.right-menu-item {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.right-menu-item:hover {
    background-color: var(--secondary-color);
}

.right-menu-icon {
    font-size: 16px;
    width: 20px;
    margin-right: 10px;
    color: var(--text-color);
}

/* Contenido Principal */
.main {
    margin-left: var(--sidebar-collapsed-width);
    transition: margin-left var(--transition-speed);
    min-height: 100vh;
    background-color: #a0e8fa;
}

.main.with-pinned-sidebar {
    margin-left: var(--sidebar-width);
}

.main.with-toolbar {
    padding-top: calc(var(--toolbar-height) + 20px);

}

.main.with-topbar {
    padding-top: calc(var(--top-bar-height) + 20px);
}

.main.with-topbar.with-toolbar {
    padding-top: calc(var(--top-bar-height) + var(--toolbar-height) + 20px);

}

.content-section {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.content-section.hidden {
    display: none;
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.section-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 85;
    display: none;
}

.overlay.active {
    display: block;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .top-bar {
        display: block;
    }

    .sidebar-header {
        display: none;
    }

    .sidebar-left {
        top: calc(2px + var(--top-bar-height));
        height: calc(100vh - var(--top-bar-height));
        transform: translateX(-100%);
        transition: var(--transition-speed);
        width: var(--sidebar-width);
    }

    .sidebar-left.mobile-active {
        transform: translateX(0);
    }

    .sidebar-left .company-name,
    .sidebar-left .menu-text,
    .sidebar-left .menu-arrow,
    .sidebar-left .submenu-text {
        opacity: 1;
    }

    .main {
        margin-left: 0px;
        padding-top: calc(var(--top-bar-height) + 20px);
    }

    .main.with-pinned-sidebar {
        margin-left: 0;
    }

    .toolbar {
        top: var(--top-bar-height);
        left: 0px;
    }

    .toolbar-title {
        display: none;
    }

    .pin-container {
        display: none;
    }

    .submenu-item {
        padding-left: 45px;
    }
}