/*Write your custom css in this file.*/

/* Sidebar Modern Header and Footer */
.sidebar {
    display: flex !important;
    flex-direction: column !important;
    background-color: #F9F9F9 !important;
}

.sidebar-header {
    flex: 0 0 auto;
    height: 66px !important;
    min-height: 66px !important;
    padding: 0 15px !important;
    background-color: #ffffff;
    z-index: 10;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.sidebar-scroll {
    flex: 1 1 auto !important;
    overflow-x: hidden !important;
}

.sidebar-user-section {
    flex: 0 0 auto;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.sidebar-user-section .dropdown-toggle:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.sidebar-user-section .avatar {
    border: 2px solid #eee;
    border-radius: 50% !important;
    transition: all 0.3s ease;
    overflow: hidden !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.avatar img {
    border-radius: 50% !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.sidebar-user-section .dropdown-toggle:hover .avatar {
    border-color: #272727;
}

.sidebar-user-section .user-name {
    line-height: 1.2;
}

.sidebar-user-section .dropdown-menu {
    margin-top: 5px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08) !important;
}

.sidebar-user-notifications {
    gap: 5px;
}

.sidebar-user-notifications .nav-link {
    padding: 5px;
    color: #666 !important;
    transition: all 0.2s ease;
}

.sidebar-user-notifications .nav-link:hover {
    color: #272727 !important;
}

.sidebar-user-notifications .icon,
.sidebar-user-notifications svg {
    width: 16px !important;
    height: 16px !important;
}

.sidebar-user-notifications .notification-badge-container {
    top: -2px !important;
    right: -2px !important;
    font-size: 10px;
}

/* Sidebar toggled state */
.sidebar-toggled .sidebar-user-section .user-info-text,
.sidebar-toggled .sidebar-user-notifications,
.sidebar-toggled .sidebar-menu-search-container {
    display: none !important;
}

.sidebar-toggled .sidebar-menu {
    padding-top: 15px !important;
}

.sidebar-toggled .sidebar-user-section .dropdown-toggle {
    justify-content: center !important;
    padding: 15px 0 !important;
}

.sidebar-toggled .sidebar-user-section .avatar {
    margin-right: 0 !important;
}

.sidebar-logo-container {
    flex: 0 0 auto;
    max-width: 150px;
    overflow: hidden;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

.sidebar-brand {
    position: relative !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
}

/* Correção de visibilidade das logos */
.brand-logo-mini {
    display: none !important;
}

.sidebar-toggled .brand-logo {
    display: none !important;
}

.sidebar-toggled .brand-logo-mini {
    display: flex !important;
}

/* Em telas pequenas, garantir que a logo mini apareça e a normal suma (se não for via .sidebar-toggled) */
@media (max-width: 767px) {
    .brand-logo.hidden-xs {
        display: none !important;
    }

    .brand-logo-mini {
        display: flex !important;
    }
}

.sidebar-brand img {
    max-width: 100%;
    height: auto;
    max-height: 42px;
}

.sidebar-topbar-icons {
    flex: 0 0 auto;
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.sidebar-topbar-icons .nav-link {
    padding: 4px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #272727 !important;
}

/* Icons styling */
.sidebar-topbar-icons .icon, 
.sidebar-topbar-icons svg {
    width: 18px !important;
    height: 18px !important;
    color: #272727 !important;
    stroke: #272727 !important;
    display: block !important;
}

/* Sidebar toggled state (Minimized 70px) */
.sidebar-toggled .sidebar-header {
    flex-direction: column !important;
    padding: 10px 0 !important;
    height: auto !important;
    min-height: 85px !important;
    justify-content: center !important;
    align-items: center !important;
}

.sidebar-toggled .sidebar-logo-container {
    width: 70px !important;
    max-width: 70px !important;
    margin-bottom: 8px !important;
    justify-content: center !important;
    display: flex !important;
}

.sidebar-toggled .sidebar-brand {
    justify-content: center !important;
    width: 100% !important;
}

.sidebar-toggled .sidebar-topbar-icons {
    flex-direction: column !important;
    padding: 0 !important;
    gap: 8px !important;
    width: 70px !important;
    justify-content: center !important;
    align-items: center !important;
}

.sidebar-toggled .sidebar-topbar-icons .nav-link {
    padding: 2px 0 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
}

/* Remove Topbar Offset Global - DIMENSIONAMENTO */
.page-container {
    height: calc(100vh - 65px) !important;
    margin-top: 65px !important;
    overflow-y: auto !important;
    transition: all 0.3s ease;
}

body.topbar-hidden .page-container {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-left: 250px !important; /* Força o conteúdo para o lado do menu */
    width: calc(100% - 250px) !important;
    height: 100vh !important;
}

body.topbar-hidden.sidebar-toggled .page-container {
    margin-left: 70px !important;
    width: calc(100% - 70px) !important;
    height: 100vh !important;
}

.main-scrollable-page {
    padding-bottom: 80px !important; /* Respiro no final da página */
    min-height: 100% !important;
}

.topbar-hidden .main-scrollable-page {
    padding-top: 0 !important;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    body.topbar-hidden .page-container {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* Sidebar adjustments when topbar is gone */
.topbar-hidden .sidebar {
    top: 0 !important;
    height: 100vh !important;
}

.topbar-hidden .sidebar-brand {
    top: 0 !important;
    position: relative !important; /* Altera de fixed para relative se necessário para não sobrepor */
}

/* Sidebar toggle button adjustment if still used */
.sidebar-toggle-btn {
    color: #272727 !important;
}

/* Botão Flutuante WhatsApp */
.whatsapp-float {
    position: fixed;
    width: 38px;
    height: 38px;
    top: calc(50% + 5px);
    right: 20px;
    background-color: #272F3A;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 22px;
    box-shadow: 2px 2px 3px #999;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    background-color: #1e242c;
    transform: scale(1.1);
    box-shadow: 3px 3px 5px #666;
}

.whatsapp-float svg {
    width: 20px;
    height: 20px;
    fill: #FFF;
    display: block;
}

/* Tooltip */
.whatsapp-tooltip {
    position: absolute;
    right: 55px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(-5px);
}

.tooltip-content {
    background-color: #272F3A;
    color: #FFF;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    white-space: nowrap;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #272F3A;
}

.tooltip-text {
    display: inline-block;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(39, 47, 58, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(39, 47, 58, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(39, 47, 58, 0);
    }
}

/* Ajuste para mobile - evitar conflito com menu inferior */
@media (max-width: 576px) {
    .whatsapp-float {
        top: calc(50% + 5px);
        right: 15px;
        width: 32px;
        height: 32px;
    }

    .whatsapp-float svg {
        width: 16px;
        height: 16px;
    }

    .whatsapp-tooltip {
        right: 50px;
        top: 50%;
        transform: translateY(-50%);
    }

    .whatsapp-float:hover .whatsapp-tooltip {
        transform: translateY(-50%) translateX(-5px);
    }

    .tooltip-content {
        font-size: 12px;
        padding: 10px 12px;
        white-space: nowrap;
    }

    .tooltip-content::after {
        right: -6px;
        top: 50%;
        transform: translateY(-50%);
        border-top-width: 6px;
        border-bottom-width: 6px;
        border-left-width: 6px;
        border-right: none;
    }
}

/* Cor branca específica para visualização de leads e widgets do dashboard */
.leads-details-view .box,
.dashboard-widget-white.box,
.dashboard-widget-white .box,
.dashboard-widget-white .box-content {
    background-color: #ffffff !important;
}

/* Permitir fundo preto na tarja de resumo do cliente */
.client-overview-black-card,
.client-overview-black-card .box,
.client-overview-black-card .box-content {
    background-color: #000000 !important;
    border-color: #333 !important;
}

.client-overview-black-card .b-r {
    border-right: 1px solid #333 !important;
}

/* Exceção para boxes dentro de tabelas para garantir transparência */
td .box,
td .box-content {
    background-color: transparent !important;
}

/* Fix for profile image section background */
#profile-image-section,
#profile-image-section .box-content {
    background-color: transparent !important;
}

/* Fix for statistics widgets in cover area */
.cover-widget .box,
.cover-widget .box-content {
    background-color: transparent !important;
}

/* Fix para scroll no conteúdo principal das páginas do Financeiro */
.financeiro-page .page-container {
    height: calc(100vh - 65px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative;
    display: flex !important;
    /* Forçar flex para manter sidebar e container lado a lado */
}

/* Permitir que o conteúdo interno respire sem barras de scroll duplas */
.financeiro-page .scrollable-page,
.financeiro-page .page-wrapper {
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
    width: 100% !important;
    flex-grow: 1 !important;
}

/* Desativar PerfectScrollbar no conteúdo para usar o scroll nativo do .page-container acima */
.financeiro-page .page-container .ps-container,
.financeiro-page .page-container .ps {
    overflow: visible !important;
}

.financeiro-page .page-container .ps__rail-y,
.financeiro-page .page-container .ps__rail-x {
    display: none !important;
}

/* REFORÇO: Garantir que a sidebar e seu scrollbar sejam sempre visíveis */
.financeiro-page .sidebar {
    position: fixed !important;
    z-index: 1005 !important;
}

.financeiro-page .sidebar-scroll {
    display: block !important;
    visibility: visible !important;
    overflow-y: hidden !important;
    /* O PerfectScrollbar cuidará disso */
}

.financeiro-page .sidebar-scroll .ps__rail-y {
    display: block !important;
    opacity: 1 !important;
    z-index: 1010 !important;
}

.financeiro-page .sidebar-scroll .ps__thumb-y {
    background-color: rgba(0, 0, 0, 0.2) !important;
    width: 6px !important;
}


.financeiro-page .sidebar,
.financeiro-page .sidebar-scroll {
    visibility: visible;
}

/* Scrollable Tabs - Melhoria para evitar quebra de linha e permitir scroll horizontal suave */
.scrollable-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 5px;
    position: relative;
    padding-left: 0;
    padding-right: 0;
}

/* Aplicar padding apenas quando as abas estão dentro de um container com setas de scroll */
.scrollable-tabs-container .scrollable-tabs {
    padding-left: 45px !important;
    padding-right: 45px !important;
}

/* Container para as abas com setas */
.scrollable-tabs-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.tab-scroll-arrow {
    position: absolute;
    top: 0;
    height: 100%;
    width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    border: none;
}

.tab-scroll-arrow i {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.tab-scroll-arrow:hover i {
    background: #f8f9fa;
    color: #212529;
    transform: scale(1.1);
}

.tab-scroll-arrow.left {
    left: 0;
    background: linear-gradient(to right, #F8FAFC, rgba(248, 250, 252, 0));
}

.tab-scroll-arrow.right {
    right: 0;
    background: linear-gradient(to left, #F8FAFC, rgba(248, 250, 252, 0));
}

.tab-scroll-arrow.disabled {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.scrollable-tabs::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.scrollable-tabs li {
    flex: 0 0 auto;
}

/* Removido indicador antigo pois agora usamos setas fixas */

/* --- CUSTOMIZAÇÃO DE CORES DO MENU E ÍCONES (#272727) --- */

/* Fundo da Sidebar e Scroll */
.sidebar,
.sidebar-scroll {
    background-color: #F9F9F9 !important;
}

/* Container da Logo (Fundo Branco) */
.sidebar-brand {
    background-color: #ffffff !important;
}

/* Itens do Menu (Texto e Ícones) */
.sidebar-menu li a {
    color: #272727 !important;
}

/* Ícones Feather (SVG) */
.sidebar-menu li a svg,
.sidebar-menu li a i {
    color: #272727 !important;
    stroke: #272727 !important;
}

/* Estado Ativo e Hover */
.sidebar-menu li.active>a,
.sidebar-menu li a:hover,
.sidebar-menu li a:focus,
.sidebar-menu li.main.open>a {
    background-color: rgba(0, 0, 0, 0.05) !important;
    color: #272727 !important;
}

/* Ajuste para submenus */
.sidebar-menu li ul,
.sidebar-menu li ul li a {
    background-color: transparent !important;
    color: #272727 !important;
}

.sidebar-menu li ul li a:hover {
    background-color: rgba(0, 0, 0, 0.03) !important;
}

/* --- AJUSTE DE ESPAÇAMENTO --- */

/* Reduzir padding inferior da busca e espaçamento superior */
.sidebar-menu-search-container {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    margin-top: 0 !important;
}

.sidebar-user-section .dropdown-toggle {
    padding-bottom: 10px !important;
}

.sidebar-scroll {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Remover margem/padding superior da lista */
.sidebar-menu {
    padding-top: 0px !important;
    margin-top: 0px !important;
}

/* Ajuste da borda inferior do logo e botão de nav */
.sidebar-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.sidebar-logo-container img {
    object-fit: contain;
}
.sidebar-brand {
    border-bottom: none !important;
}

/* Ajuste do botão toggle no mobile */
@media (max-width: 500px) {
    .sidebar.sidebar-off {
        background-color: #F9F9F9 !important;
    }

    .sidebar .sidebar-toggle-btn {
        color: #272727 !important;
    }
}

/* Espaçamento das linhas no leads dashboard */
.dashboard-view .dashboards-row {
    margin-bottom: 0;
}

.dashboard-view .widget-container {
    padding-bottom: 0;
}


/* --- CUSTOMIZAÇÃO DO TOPBAR (BRANCO) --- */
.navbar-custom {
    background-color: #ffffff !important;
}

.navbar-custom .nav-link,
.navbar-custom .nav-link svg,
.navbar-custom .nav-link i,
.navbar-custom .user-name {
    color: #272727 !important;
    stroke: #272727 !important;
}

.navbar-custom .dropdown-toggle::after {
    color: #272727 !important;
}

.navbar-custom .sidebar-toggle-btn i {
    color: #272727 !important;
    stroke: #272727 !important;
}

/* Sticky Note FAB removed - Integrated into Quick Add */
/* Task Details View Style */
.task-top-button {
    transition: all 200ms ease;
    z-index: 1001;
}

.task-top-button.position-fixed-top {
    background-color: #fff;
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.08);
}

.task-details-view .details-view-wrapper {
    align-items: flex-start;
}

.task-title-section {
    margin-bottom: 10px;
}

.task-title-section h1 {
    font-size: 20px;
}

.task-status-section {
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f1f5;
    margin-bottom: 20px;
}

.task-details-view .task-info .icon-16 {
    margin-top: -3px;
}

/* Mobile adjustments for task view */
@media (max-width: 576px) {
    .task-details-view .details-view-wrapper {
        flex-direction: column;
    }
    
    .task-details-view .details-view-right-section {
        width: 100%;
        margin-left: 0;
        margin-top: 20px;
    }
}

/* Nested Submenus Styling */
#sidebar-menu li ul li ul {
    background: rgba(0, 0, 0, 0.05);
    padding-left: 10px;
    display: none;
}

#sidebar-menu li.has-child.open > ul {
    display: block !important;
}

#sidebar-menu li.has-child > a .menu-arrow {
    transition: transform 0.2s ease;
}

#sidebar-menu li.has-child.open > a .menu-arrow {
    transform: rotate(90deg);
}

#sidebar-menu li ul li a {
    padding-left: 25px !important;
}

#sidebar-menu li ul li ul li a {
    padding-left: 40px !important;
}

/* Floating Quick Add Button */
#floating-quick-add-global {
    position: fixed;
    top: calc(50% - 43px); /* Reducted stack - Quick Add and WhatsApp */
    right: 20px;
    z-index: 1050;
}

.quick-add-float {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #004797; /* Elegant blue requested by user */
    border: none;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 0;
}

.quick-add-float:hover {
    background-color: #000;
    transform: scale(1.1);
    box-shadow: 2px 5px 15px rgba(0, 0, 0, 0.3);
}

.quick-add-float svg {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2.5px !important;
}

@keyframes pulse-dark {
    0% {
        box-shadow: 0 0 0 0 rgba(39, 39, 39, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(39, 39, 39, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(39, 39, 39, 0);
    }
}

.quick-add-float::after {
    display: none; /* Remove default dropdown arrow */
}

#floating-quick-add-global .dropdown-menu {
    min-width: 200px;
    border: none;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15) !important;
}

#floating-quick-add-global .dropdown-item {
    border-radius: 8px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
}

#floating-quick-add-global .dropdown-item:hover {
    background-color: #f8f9fa;
}

#floating-quick-add-global.dropstart .dropdown-toggle::before {
    display: none !important;
}

@media (max-width: 576px) {
    #floating-quick-add-global {
        top: calc(50% - 37px);
        right: 15px;
    }
    .quick-add-float {
        width: 32px;
        height: 32px;
    }
    .quick-add-float svg {
        width: 16px !important;
        height: 16px !important;
    }
}

/* Sidebar Sticky User Section */
.sidebar {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
}

.sidebar-scroll {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.sidebar-user-section {
    flex-shrink: 0 !important;
}

/* Ensure background for visibility when sticky */
.sidebar-user-section.bg-white {
    background-color: #ffffff !important;
    position: relative;
    z-index: 10;
}

/* Smaller Avatar */
.avatar-xs {
    width: 30px !important;
    height: 30px !important;
}

.avatar-xs img {
    width: 30px !important;
    height: 30px !important;
}

/* --- MENU CUSTOMIZATION (LEFT MENUS) --- */
.menu-header-item {
    background-color: #f0f2f5 !important;
    border-left: 4px solid #667eea !important;
    font-weight: bold !important;
}

.menu-header-item span.float-start {
    text-transform: uppercase !important;
    color: #4a5568 !important;
    font-size: 11px !important;
    letter-spacing: 0.05em !important;
}

.menu-header-item .badge-header {
    background-color: #667eea;
    color: white;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
    text-transform: uppercase;
}

#menu-item-list-2 .menu-header-item .make-sub-menu,
#menu-item-list-2 .menu-header-item .make-root-menu {
    display: none !important;
}
