/* ==================================================
   SIDEBAR GLOBAL (DUPRO)
   Estilo único do menu lateral fixo — carregado em
   TODAS as páginas via master.blade.php.
   Fonte única de verdade: não replicar em outros CSS.
================================================== */

/* --------------------------------------------------
   CONTAINER / MENU FIXO
-------------------------------------------------- */
.main-sidebar {
    background: #0f1e4d !important;
    border-right: none !important;
    width: 265px !important;
    opacity: 1 !important;
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh;
}

.main-sidebar .sidebar {
    background: #0f1e4d !important;
    border-top: 0 !important;
}

/* remove overlays internos do AdminLTE */
.main-sidebar::before,
.main-sidebar::after {
    display: none !important;
}

/* --------------------------------------------------
   SEM SCROLL NO MENU
   O menu é fixo e curto: escondemos qualquer barra de
   rolagem (nativa e do OverlayScrollbars do AdminLTE).
-------------------------------------------------- */
.main-sidebar,
.main-sidebar .sidebar,
.main-sidebar .os-host,
.main-sidebar .os-viewport {
    overflow: hidden !important;
    overflow-y: hidden !important;
}

.main-sidebar .os-scrollbar,
.main-sidebar .os-scrollbar-corner,
.main-sidebar .os-scrollbar-vertical {
    display: none !important;
}

/* --------------------------------------------------
   BRAND / LOGO — alinhado à ESQUERDA sobre os itens
   Recuo do logo = padding do .sidebar (8px)
                  + margin do .nav-link (10px)
                  + padding do .nav-link (14px) = 32px
   => a borda esquerda do logo cai na mesma coluna
      dos ícones do menu.
-------------------------------------------------- */
.brand-link {
    display: flex !important;
    align-items: center;
    justify-content: flex-start !important;
    height: 92px;
    padding: 14px 16px 14px 32px !important;
    background: transparent !important;
    border-bottom: 0 !important;
    margin-bottom: 0 !important;
    opacity: 1 !important;
}

.brand-link img {
    max-height: 44px !important;
    object-fit: contain;
    opacity: 1 !important;
    filter: none !important;
}

/* estado expandido (padrão) */
.brand-logo-full {
    display: block;
    margin: 0;              /* alinhado à esquerda; recuo vem do .brand-link */
    max-height: 44px;
}

.brand-logo-mini {
    display: none;
    max-height: 40px;
    margin: 0 auto;
}

/* --------------------------------------------------
   ESTADO COLAPSADO (menu mini) — logo mini centralizado
-------------------------------------------------- */
.sidebar-collapse .brand-logo-full,
.sidebar-mini.sidebar-collapse .brand-logo-full {
    display: none !important;
}

.sidebar-collapse .brand-logo-mini,
.sidebar-mini.sidebar-collapse .brand-logo-mini {
    display: block !important;
    margin: 0 auto;
}

.sidebar-mini.sidebar-collapse .brand-link {
    justify-content: center !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
}

/* --------------------------------------------------
   ITENS DO MENU
-------------------------------------------------- */
.nav-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255, 255, 255, 0.85) !important;
    padding: 14px 14px !important;
    margin: 6px 10px;
    border-radius: 12px;
    font-size: 15px !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-sidebar .nav-link .nav-icon {
    color: rgba(255, 255, 255, 0.75);
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-sidebar .nav-link p {
    margin: 0;
    line-height: 1.2;
}

/* hover */
.nav-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    transform: translateX(3px);
}

/* item ativo — gradiente azul (fade da esquerda) */
.nav-sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.45) 0%, rgba(59, 130, 246, 0.12) 55%, rgba(59, 130, 246, 0) 100%) !important;
    color: #fff !important;
    font-weight: 700;
}

.nav-sidebar .nav-link.active .nav-icon {
    color: #fff !important;
}

.nav-sidebar .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: #4f8cff;
    border-radius: 4px;
}

/* submenu */
.nav-treeview .nav-link {
    font-size: 12.5px;
    padding: 9px 12px !important;
    margin: 4px 10px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7) !important;
}

/* separador (header vazio) */
.sidebar .nav-header {
    margin: 15px 0;
    padding: 0;
    height: 1px;
    overflow: hidden;
    font-size: 0;
}

/* --------------------------------------------------
   CARTÃO DE USUÁRIO (rodapé da sidebar)
-------------------------------------------------- */
.sidebar-user-card {
    position: absolute;
    bottom: 16px;
    left: 12px;
    right: 12px;
    border-radius: 16px;
}

.sidebar-user-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    cursor: pointer;
    border-radius: 14px;
    transition: all 0.2s ease;
}

.sidebar-user-trigger:hover {
    background: rgba(255, 255, 255, 0.07);
}

.sidebar-user-avatar {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2F6BF6, #4F8CFF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.sidebar-user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    color: #8ea0c5;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.sidebar-user-arrow {
    margin-left: auto;
    color: #8ea0c5;
    font-size: 12px;
    transition: 0.3s;
}

.sidebar-user-card.open .sidebar-user-arrow {
    transform: rotate(180deg);
}

.sidebar-user-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: 0.3s ease;
}

.sidebar-user-card.open .sidebar-user-dropdown {
    max-height: 120px;
}

.sidebar-user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    color: #d6dcec !important;
    text-decoration: none;
    font-size: 13px;
}

.sidebar-user-dropdown a:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* usuário no modo colapsado */
.sidebar-collapse .sidebar-user-text,
.sidebar-collapse .sidebar-user-arrow {
    display: none !important;
}

.sidebar-collapse .sidebar-user-trigger {
    justify-content: center;
    padding: 12px;
}

.sidebar-collapse .sidebar-user-avatar {
    width: 44px;
    height: 44px;
    font-size: 16px;
}

/* ============================================================
   Padrão DuPro V2 — topo limpo
   O logout/perfil vivem no rodapé da sidebar (sidebar-user).
   A navbar superior do AdminLTE (que só trazia o "Sair") é
   ocultada no desktop; no mobile permanece para abrir a sidebar.
   ============================================================ */
.main-header.navbar {
    background: transparent;
    border: none;
    box-shadow: none;
}

@media (min-width: 992px) {
    .main-header.navbar {
        display: none;
    }
    .content-wrapper {
        padding-top: 8px;
    }
}
