.sidebar {
    width: 260px; /* Reduzido de 280px para 260px */
    min-width: 260px;
    max-width: 260px;
    min-height: 100vh;
    height: 100vh;
    background-color: #1e3a5f;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden; /* Evitar scrollbar horizontal */
    box-sizing: border-box; /* Garantir que padding não afete a largura */
    flex-shrink: 0; /* Impedir que o sidebar encolha */
}

.sidebar-header {
    padding: 20px 16px; /* Padding reduzido */
    text-align: center;
}

.sidebar-title {
    font-size: 18px; /* Padronizado */
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    box-sizing: border-box;
}

.sidebar-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    box-sizing: border-box;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 16px 20px;
}

.sidebar-user {
    padding: 16px 16px; /* Padding reduzido */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px; /* Reduzido para padronizar */
    text-align: center;
}

.user-icon {
    width: 80px; /* Reduzido para menu mais estreito */
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 4px;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.user-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.user-name {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
    max-width: 100%;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Máximo de 3 linhas */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.sidebar-setor {
    padding: 8px 16px; /* Padding reduzido */
    font-size: 12px; /* Reduzido para padronizar */
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.user-cpf {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    box-sizing: border-box;
}

.setor-label {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    box-sizing: border-box;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
}

.menu-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.menu-section-header {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px; /* Reduzido de 12px para padronizar */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 20px 8px 20px;
    margin-top: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    box-sizing: border-box;
    line-height: 1.4; /* Altura de linha fixa */
}

.sidebar-menu-item {
    background: none;
    border: none;
    color: white;
    text-align: left;
    padding: 10px 16px; /* Padding reduzido para menu mais estreito */
    font-size: 14px; /* Padronizado */
    font-weight: 500; /* Peso fixo para evitar mudança de tamanho */
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: inherit;
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    box-sizing: border-box;
    overflow: hidden;
    line-height: 1.5; /* Altura de linha fixa */
}

.sidebar-menu-item span {
    flex: 1;
    min-width: 0; /* Permite que o texto seja truncado */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-menu-item svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
}

.sidebar-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-menu-item.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 500; /* Manter o mesmo peso para evitar mudança de tamanho */
    border-left: 3px solid rgba(255, 255, 255, 0.8); /* Adicionar borda lateral para destacar */
    padding-left: 13px; /* Ajustar padding para compensar a borda (16px - 3px) */
}

.menu-arrow {
    display: none; /* Ocultar setas já que não são mais necessárias */
}

.submenu {
    display: flex; /* Sempre visível */
    flex-direction: column;
}

.submenu-item {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    text-align: left;
    padding: 8px 16px 8px 32px; /* Padding reduzido para menu mais estreito */
    font-size: 13px; /* Reduzido de 14px para padronizar */
    font-weight: 400; /* Peso fixo para evitar mudança de tamanho */
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: inherit;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: block; /* Garantir que seja um bloco para o ellipsis funcionar */
    line-height: 1.5; /* Altura de linha fixa */
}

.submenu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.submenu-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    font-weight: 400; /* Manter o mesmo peso para evitar mudança de tamanho */
    border-left: 3px solid rgba(255, 255, 255, 0.8); /* Adicionar borda lateral para destacar */
    padding-left: 29px; /* Ajustar padding para compensar a borda (32px - 3px) */
}

.sidebar-footer {
    padding: 20px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.logout-button {
    width: 100%;
    max-width: 200px;
    padding: 12px 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: inherit;
    text-align: center;
}

.logout-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
