.barra {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 5px 10px;
    width: 16%;
    display: flex;
    flex-direction: column;
    transition: all 0.5s ease;
    box-shadow: 4px 0 20px rgba(0, 94, 17, 0.15);
    z-index: 1000;
    animation: barraEntrada 0.8s ease-out;
}

.hamburguesa {
    position: absolute;
    width: 20px;
    height: 20px;
    top: 1%;
    left: 84%;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 8px;
    background-color: #f0f9f0;
    display: none;
}

.hamburguesa:hover {
    transform: scale(1.1) rotate(90deg);
    background-color: #deffe8;
    box-shadow: 0 2px 8px rgba(0, 94, 17, 0.2);
}

.logo {
    display: flex;
    text-align: center;
    width: 50px;
    height: 50px;
    margin: 10px auto 10px;
    transition: all 0.5s ease;
    border-radius: 12px;
    padding: 5px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 94, 17, 0.1);
}

.titulo {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #138035;
    margin: 10px 0 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e8f5e9;
    letter-spacing: 0.5px;
}

.texto {
    text-align: center;
    font-size: 10px;
    color: #666;
    margin: 0 0 5px;
    font-weight: 500;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
    margin-top: 20px;
}

.actual {
    text-align: left;
    padding: 15px 15px;
    background: linear-gradient(135deg, #138035 0%, #4CAF50 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    color: white;
    box-shadow: 0 4px 12px rgba(19, 128, 53, 0.3);
    display: flex;
    align-items: center;
    gap: 15px;
}

.botonBarra {
    text-align: left;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    gap: 15px;
}

.botonBarra:hover {
    background: linear-gradient(135deg, #e8f5e9 0%, #deffe8 100%);
    border-color: #138035;
    box-shadow: 0 4px 12px rgba(0, 94, 17, 0.15);
    color: #138035;
}

.imgBarra {
    width: 22px;
    height: 22px;
    filter: brightness(0.9);
    flex-shrink: 0;
}

.botonSalir {
    text-align: center;
    padding: 10px 15px;
    background: linear-gradient(135deg, #ff4444 0%, #ff6b6b 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
    margin-bottom: 15px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.2);
}

.botonSalir:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 68, 68, 0.3);
    background: linear-gradient(135deg, #ff3333 0%, #ff5555 100%);
}

.barra.contraer {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 25px 10px;
    width: 60px;
    box-shadow: 4px 0 20px rgba(0, 94, 17, 0.15);
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 3px solid #138035;
    align-items: center;
}

.logo.contraer {
    width: 50px;
    height: 50px;
    margin: 35px auto 30px;
    border-radius: 10px;
}

.hamburguesa.contraer {
    width: 20px;
    height: 20px;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px;
}

.texto.contraer {
    display: none;
}

nav.contraer {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
    margin-top: 50px;
    width: 100%;
    align-items: center;
}

.titulo.contraer {
    display: none;
}

.botonBarra.contraer {
    width: 50px;
    height: 50px;
    padding: 0;
    background: #f8f9fa;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    color: transparent;
}

.botonBarra.contraer:hover {
    background: linear-gradient(135deg, #e8f5e9 0%, #deffe8 100%);
    border-color: #138035;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 94, 17, 0.15);
}

.actual.contraer {
    width: 50px;
    height: 50px;
    padding: 0;
    background: linear-gradient(135deg, #138035 0%, #4CAF50 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    box-shadow: 0 4px 12px rgba(19, 128, 53, 0.3);
}

.imgBarra.contraer {
    height: 35px;
    width: 35px;
    display: block;
    margin: 0 auto;
    padding: 0;
    filter: brightness(1);
}

.botonSalir.contraer {
    width: 50px;
    height: 50px;
    padding: 0;
    background: linear-gradient(135deg, #ff4444 0%, #ff6b6b 100%);
    border-radius: 12px;
    font-size: 0;
    margin-top: auto;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.botonSalir.contraer:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 68, 68, 0.3);
}

@media (max-width: 768px) {
    .barra {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 64px;
        min-height: 64px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0 12px 0 16px;
        box-sizing: border-box;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        z-index: 9999;
        background: white;
        animation: none;
        overflow: visible;
    }

    .logo {
        width: 42px;
        height: 42px;
        margin: 0;
        order: 1;
    }

    .titulo {
        flex: 1;
        text-align: center;
        font-size: 18px;
        margin: 0;
        padding: 0;
        border-bottom: none;
        order: 2;
        color: #138035;
    }

    .hamburguesa {
        display: flex !important;
        position: static !important;
        left: unset !important;
        top: unset !important;
        right: unset !important;
        order: 3;
        width: 24px;
        height: 24px;
        flex-shrink: 0;
        padding: 8px;
        margin: 0;
        background-color: #f0f9f0;
        z-index: 10000;
        align-items: center;
        justify-content: center;
    }

    .texto {
        display: none;
    }

    .barra > .botonSalir {
        display: none;
    }

    .barra nav {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        gap: 0;
        padding: 0;
        margin: 0;
        z-index: 9998;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
        display: flex;
        pointer-events: none;
    }

    .barra nav.menu-abierto {
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        pointer-events: auto;
    }

    .barra nav a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px 20px;
        font-size: 16px;
        text-decoration: none;
        color: #333;
        border-bottom: 1px solid #f0f0f0;
        width: 100%;
        box-sizing: border-box;
        background: white;
        margin: 0;
        border-radius: 0;
        pointer-events: auto;
    }

    .barra nav .actual {
        background: #138035;
        color: white;
    }

    .barra nav .botonBarra {
        background: white;
        color: #333;
    }

    .barra nav .botonSalir {
        background: #ff4444;
        color: white;
        margin-top: 15px;
        margin-bottom: 20px;
        margin-left: 10px;
        margin-right: 10px;
        border-radius: 12px;
        justify-content: center;
        display: flex !important;
        width: calc(100% - 20px);
    }

    .barra nav .botonSalir:hover {
        background: #ff3333;
        transform: translateY(-2px);
    }

    .barra nav img {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 480px) {
    .barra {
        height: 58px;
    }

    .barra nav {
        top: 58px;
    }

    .barra nav.menu-abierto {
        max-height: calc(100vh - 58px);
    }

    .barra nav a {
        padding: 14px 16px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 64px !important;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 58px !important;
    }
}

@keyframes barraEntrada {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}