:root {
    --cor-sidebar: #041E3F;
}

/* Ajustes globais para layout fixo */
.layout-navbar-fixed .main-header {
    border-bottom: 1px solid #dee2e6 !important;
    background-color: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px);
}

.brand-link {
    height: calc(3.5rem + 1px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    background-color: var(--cor-sidebar) !important;
}

.brand-link .brand-text {
    font-size: 0.85rem !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600 !important;
    color: #fff !important;
}

/* PERSONALIZAÇÃO CORES */
.bg-sistema {
   background-color: #00A0D3;
   color: white;
}

.icon i:hover {
   background-color: #00A0D3;
 }

.text-sistema {
   color: #041E3F;
}

h5 {
   color: #041E3F !important;
   font-weight: bold !important;
}

.link-sistema{
   color: #00A0D3!important;
   text-decoration: none!important;
}

.link-sistema:hover{
   color: #037296!important;
   text-decoration: none!important;
}

.card-sistema.card-outline {
   border-top: 3px solid #00A0D3;
 }

.toTop {
   cursor: pointer;
   position: fixed;
   bottom: 20px;
   right: 20px;
   display:none;
   z-index: 10;
   opacity: 0.5;
}

.toTop:hover {
   opacity: 1;
}

/* --- SIDEBAR PREMIUM --- */
.sidebar {
    overflow-x: hidden; /* Evita o scroll horizontal indesejado */
    overflow-y: auto; /* Garante o scroll vertical se necessário */
}

/* --- SCROLLBAR PREMIUM SIDEBAR --- */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--cor-sidebar);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.main-sidebar {
    background-color: var(--cor-sidebar) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    border-right: none !important;
}

/* Estilo dos itens do menu */
.nav-sidebar .nav-item .nav-link {
    border-radius: 8px !important;
    margin: 4px 16px 4px 8px !important; /* Mais espaço à direita */
    width: calc(100% - 24px) !important; /* Compensa a margem (16px + 8px) para não colar na borda */
    padding: 8px 12px !important; /* Menus um pouco menores */
    transition: all 0.2s ease-in-out !important;
    border-left: 3px solid transparent !important;
    font-size: 0.85rem !important; /* Fonte reduzida para o menu principal */
    color: #ffffff !important; /* Cor branca para menus inativos sobre o fundo escuro */
}

/* Hover dos menus */
.nav-sidebar .nav-item .nav-link:hover {
    background-color: #1C345A !important; /* Cor da imagem */
    color: #ffffff !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Item ativo */
.nav-sidebar .nav-item.menu-open > .nav-link,
.nav-sidebar .nav-item .nav-link.active {
    background-color: #1C345A !important; /* Cor da imagem */
    color: #ffffff !important;
    font-weight: 600;
}

/* Ícones do menu */
.nav-sidebar .nav-item .nav-link i.nav-icon {
    margin-right: 10px;
    width: 25px;
    text-align: center;
    transition: transform 0.2s ease;
}

.nav-sidebar .nav-item .nav-link:hover i.nav-icon {
    transform: scale(1.1);
}

/* Alinhamento das setinhas (dropdown) */
.nav-sidebar .nav-item .nav-link p > i.right {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

/* Animação da setinha quando aberto */
.nav-sidebar .nav-item.menu-open > .nav-link p > i.right {
    transform: translateY(-50%) rotate(-90deg);
}

/* Submenus (Treeview) */
.nav-treeview {
    padding-left: 10px;
}

.nav-treeview .nav-link {
    margin: 2px 12px 2px 8px !important;
    padding: 6px 12px !important; /* Submenu com aspecto mais limpo e compacto */
    font-size: 0.8rem !important; /* Fonte reduzida para o submenu */
    color: rgba(255, 255, 255, 0.8) !important; /* Tom suave para submenus inativos */
}

/* Painel do Usuário na Sidebar */
.user-panel {
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    margin-bottom: 15px !important;
}

.user-panel .info span {
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.75rem;
    opacity: 1;
    color: #ffffff;
}

/* --- ESTILO CENTRAL DE RELATÓRIOS --- */
.category-header {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
 }
 
 .report-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
 }

 .report-card .flex-grow-1 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
 }
 
 .report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border-color: #cbd5e1;
 }
 
 .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-right: 1rem;
 }
 
 .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.1rem;
 }
 
 .card-desc {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
 }
 
 .chevron-icon {
    color: #cbd5e1;
    transition: color 0.2s;
 }
 
 .report-card:hover .chevron-icon {
    color: #64748b;
 }
 
 /* --- Temas de Cores --- */
 .theme-blue .category-header { color: #2563eb; }
 .theme-blue .icon-box { background-color: #eff6ff; color: #2563eb; }
 
 .theme-amber .category-header { color: #d97706; }
 .theme-amber .icon-box { background-color: #fffbeb; color: #d97706; }
 
 .theme-pink .category-header { color: #db2777; }
 .theme-pink .icon-box { background-color: #fdf2f8; color: #db2777; }
 
 .theme-emerald .category-header { color: #059669; }
 .theme-emerald .icon-box { background-color: #ecfdf5; color: #059669; }

 .modal-zoom .modal-content {
    transform: scale(0.9);
    transition: transform 0.2s ease-out;
}
.modal-zoom.show .modal-content {
    transform: scale(1);
}

/* --- PREMIUM UI COMPONENTS --- */
.premium-card {
    border-radius: 12px !important;
    overflow: hidden;
}

.overlay-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
}

/* --- BADGES SUTIS (ESTILO BOOTSTRAP 5) --- */
.bg-success-subtle { background-color: #d1e7dd !important; color: #0f5132 !important; }
.bg-danger-subtle { background-color: #f8d7da !important; color: #842029 !important; }
.bg-warning-subtle { background-color: #fff3cd !important; color: #664d03 !important; }
.bg-info-subtle { background-color: #cff4fc !important; color: #055160 !important; }
.bg-secondary-subtle { background-color: #e2e3e5 !important; color: #41464b !important; }

.x-small {
    font-size: 0.75rem;
}

.italic {
    font-style: italic;
}

/* --- TOM SELECT PREMIUM --- */
.ts-wrapper.form-control {
    padding: 0 !important;
    height: calc(2.25rem + 2px) !important; /* Altura padrão AdminLTE/Bootstrap 4 */
    border: 1px solid #ced4da !important;
    border-radius: 0.25rem !important;
    background: #fff !important;
}

.ts-control {
    border: none !important; /* Borda agora fica no wrapper para simular input */
    background: transparent !important;
    padding: 0.45rem 0.75rem !important;
    box-shadow: none !important;
    font-size: 1rem !important;
}

.ts-wrapper.form-control.focus {
    border-color: #80bdff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

.ts-dropdown {
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    margin-top: 5px !important;
    overflow: hidden !important;
    z-index: 2000 !important;
}

.ts-dropdown .option {
    padding: 10px 15px !important;
    font-size: 14px !important;
    transition: background 0.1s ease !important;
}

/* Item Ativo/Hover na lista - RESOLVE LEGIBILIDADE */
.ts-dropdown .active {
    background-color: #00A0D3 !important; /* Cor de identidade do sistema */
    color: #ffffff !important; /* Texto branco para contraste total */
}

.ts-dropdown .active .text-muted {
    color: rgba(255, 255, 255, 0.8) !important; /* Texto secundário legível sobre azul */
}

/* Estilo para múltiplos itens selecionados (se usado) */
.ts-control .item {
    background: #e7f1ff !important;
    color: #007bff !important;
    border: 1px solid #b6d4fe !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
}

.ts-wrapper.disabled .ts-control {
    background-color: #e9ecef !important;
    opacity: 1 !important;
}
