﻿/* ===============================================
   HTMX SPA PROGRESS BAR & OVERLAYS
   =============================================== */

/* Barra de Progresso */
.htmx-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.2);
    z-index: 10000;
    overflow: hidden;
}

.htmx-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
    animation: progress-shine 2s infinite;
}



@keyframes progress-shine {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Loading Overlay */
.htmx-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.htmx-loading-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 300px;
    width: 90%;
}

.htmx-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.htmx-loading-message {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

/* Error Overlay */
.htmx-error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.htmx-error-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
}

.htmx-error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.htmx-error-title {
    color: #dc3545;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 600;
}

.htmx-error-message {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.htmx-error-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.htmx-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.htmx-btn-primary {
    background-color: #007bff;
    color: white;
}

.htmx-btn-primary:hover {
    background-color: #0056b3;
}

.htmx-btn-secondary {
    background-color: #6c757d;
    color: white;
}

.htmx-btn-secondary:hover {
    background-color: #545b62;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===============================================
   LAYOUT PRINCIPAL
   =============================================== */

.nox-container {
    display: flex;
    height: 100%;
    width: 100%;
    flex-direction: row;
    overflow-x: hidden;
}

.nox-sidebar {
    background-color: #fff;
    color: #fff;
    width: 250px;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.3s ease, width 0.3s ease;
    overflow-x: hidden;
    overflow-y: hidden;
    border-right: 1px solid #e0e0e0;
}

    .nox-sidebar .dx-treeview-search {
        margin-left: 8px;
        margin-right: 8px;
    }

    .nox-sidebar .nox-sidebar-logo-product {
        display: flex;
        justify-content: center;
        align-items: stretch;
        background-position: center;
        background-repeat: no-repeat;
        background-size: contain;
        height: 10%;
    }

        .nox-sidebar .nox-sidebar-logo-product a {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .nox-sidebar .nox-sidebar-logo-product .img {
            height: 100%;
            min-width: 108px;
            min-height: 66px;
            background-repeat: no-repeat;
            background-size: contain;
            background-position: center;
        }

.nox-sidebar-content {
    flex-grow: 1;
    overflow-y: auto; /* Adiciona scroll apenas ao conteúdo do menu */
    padding-bottom: 80px; /* Espaço para o footer fixo */
}

/* Estilos para o container da ação no menu */
.nox-menu .nox-menu-action-container {
    display: flex;
    align-items: center;
    margin-left: auto; /* Empurra o botão para a direita dentro do flex container */
    padding-right: 8px; /* Pequeno espaçamento da borda direita do item do menu */
}

/* Estilo para o botão de adicionar (+) no menu */
.nox-menu .nox-menu-add-btn {
    background-color: transparent;
    border: none;
    color: #757575; /* Cor do ícone - um cinza médio, sutil */
    padding: 4px; /* Espaçamento interno para um botão compacto */
    border-radius: 4px; /* Bordas levemente arredondadas */
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: inline-flex; /* Para alinhar o ícone corretamente */
    align-items: center;
    justify-content: center;
    width: 26px; /* Largura ajustada para o ícone */
    height: 26px; /* Altura ajustada para o ícone */
    line-height: 1; /* Para melhor alinhamento vertical do ícone */
}

.nox-menu .nox-menu-add-btn:hover,
.nox-menu .nox-menu-add-btn:focus {
    background-color: #e0e0e0; /* Cor de fundo no hover/focus, um pouco mais escura que o hover do item */
    color: #333333; /* Cor do ícone mais escura no hover/focus */
}

.nox-menu .nox-menu-add-btn .fa-plus {
    font-size: 0.9em; /* Tamanho do ícone ligeiramente menor para melhor encaixe */
}

/* Estilos para estados visuais (loading, success, error) */
.nox-menu .nox-menu-add-btn.nox-btn-loading .fa-plus {
    animation: nox-menu-spin 1s linear infinite; /* Animação de carregamento */
}

@keyframes nox-menu-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nox-menu .nox-menu-add-btn.nox-btn-success .fa-plus::before {
    content: "\f00c"; /* Ícone de check (FontAwesome) */
    color: #4CAF50; /* Verde para sucesso */
    font-weight: bold;
}

.nox-menu .nox-menu-add-btn.nox-btn-error .fa-plus::before {
    content: "\f071"; /* Ícone de aviso/exclamação (FontAwesome) */
    color: #F44336; /* Vermelho para erro */
    font-weight: bold;
}

.nox-sidebar .nox-close-sidebar {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: transparent;
    border: none;
    color: #000;
    font-size: 20px;
    cursor: pointer;
}

.nox-main {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: 100%;
    width: 100%; /* Adicione width 100% para que o .nox-main ocupe todo o espa�o dispon�vel */
    transition: margin-left 0.3s ease;
    overflow-x: hidden; /* Evita overflow horizontal */
    overflow-y: auto; /* Adiciona rolagem vertical independente */
    padding-top: 56px; /* Altura da navbar para não sobrepor o conteúdo */
}

.nox-navbar {
    color: #fff;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .nox-navbar .dx-buttongroup-wrapper {
        display: flex;        
    }

.nox-breadcrumb {
    background-color: rgba(0,0,0,.04);
    height: 34px;
    display: flex;
    align-items: center;
    padding: 0 17px;
    position: relative;
    cursor: text;
    color: rgba(0,0,0,.6);
    font-size: 14px;
    line-height: normal;
}

    .nox-breadcrumb::before {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 1px;
        background-color: #8f8f8f;
    }

.nox-toggle-sidebar {
    background-color: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: block;
}

.nox-navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

    .nox-navbar-right a {
        color: #fff;
        text-decoration: none;
    }

        .nox-navbar-right a img {
            height: 20px;
            width: 20px;
        }

    .nox-navbar-right .dx-icon {
        color: #fff;
    }

.dx-list-items .dx-icon {
    color: rgba(0,0,0,.54);
}

    .nox-navbar-right .dx-button-content {
        padding-inline: 1px !important;
    }

    .nox-content-wrapper {
        padding: 0px 1px;
        background-color: #f2f0f0;
        overflow-x: auto; /* Permite scroll horizontal se necess�rio */
        width: 100%;
        height: 100%;
        box-sizing: border-box;
    }

.nox-content {
    padding: 0px 8px;
    height: 100%;
    width: 100%;
    max-width: 100%; /* Garante que a largura n�o ultrapasse 100% */
    box-sizing: border-box;
    background-color: #fff;
    overflow-x: auto; /* Adiciona scroll horizontal se necess�rio */
}

.nox-sidebar-collapsed {
    width: 0;
    transform: translateX(-250px); /* Move the sidebar out of view */
    overflow-x: hidden;
}

.nox-main-collapsed {
    margin-left: 0;
    overflow-x: hidden;
}

.nox-report-tabs {
    height: 100%;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .nox-container {
        flex-direction: column;
    }

    .nox-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        z-index: 1000;
        width: 100%;
    }

        .nox-sidebar.nox-open {
            transform: translateX(0);
            padding-top: 56px; /* Altura da navbar */
            height: calc(100% - 56px); /* Ajusta a altura para compensar o padding */
            box-sizing: border-box; /* Garante que padding não aumente a altura total */
        }

    .nox-toggle-sidebar {
        display: block;
    }

    .nox-sidebar .nox-close-sidebar {
        display: block;
    }

    .nox-main {
        margin-left: 0;
    }

    .nox-navbar {
        left: 0 !important; /* Força o posicionamento à esquerda no mobile */
    }

    .nox-menu .nox-btn-menu-container {
        font-size: 16px;
    }
}

.nox-menu .dx-treeview-item {
    padding: 0;
}

.nox-menu .nox-btn-menu-container {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.nox-menu .nox-menu-icon {
    width: 24px;
    text-align: center;
    display: inline-block;
}

.nox-menu .nox-btn-menu {
    flex-grow: 1;
    padding: 10px;
    text-decoration: none;
    color: inherit;
}

.nox-menu .nox-btn-menu-container:hover {
    background-color: #f0f0f0; /* Adiciona um efeito de hover ao cont�iner */
}

    .nox-menu .dx-treeview {
        padding: 0;
    }

        .nox-menu .dx-treeview li.dx-treeview-node .dx-item a {
            text-transform: uppercase;
            color: #505050;
        }

        .nox-menu .dx-treeview li.dx-treeview-node li.dx-treeview-node .dx-item a {
            text-transform: none;
        }

        .nox-menu .dx-treeview li.dx-treeview-node li.dx-treeview-node:not(.dx-state-selected) .dx-item a {
            color: #505050;
            font-weight: normal;
        }

        .nox-menu .dx-treeview li.dx-treeview-node.dx-state-selected:not(.dx-treeview-node-is-leaf) .dx-item {
            background-color: transparent;
        }

        .nox-menu .dx-treeview li.dx-treeview-node.dx-treeview-node-is-leaf.dx-state-selected .dx-item {
            background-color: #e9e9e9;
        }

            .nox-menu .dx-treeview li.dx-treeview-node.dx-treeview-node-is-leaf.dx-state-selected .dx-item a {
                font-weight: normal;                
            }


.nox-wrapper {
    margin-left: 260px;
    padding: 0 25px 30px 30px;
}

.nox-navbar-item-container {
    display: flex;
    align-items: center;
    padding: 10px;
    position: relative;
}

.nox-navbar-notification-content {
    overflow: hidden;
    flex: 1 0 auto;
}

.nox-navbar-notification-title {
    font-size: 16px;
    font-weight: bold;
    color: inherit;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nox-navbar-notification-body {
    width: 230px;
}

.nox-navbar-notification-body-content {
    color: inherit;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nox-navbar-notification-date {
    font-size: 12px;
    color: inherit;
}

.nox-navbar-notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: red;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    line-height: 1;
}

.nox-navbar .dx-list-static-delete-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.nox-navbar-item-container {
    display: flex;
    align-items: center;
    padding: 10px;
    position: relative;
    padding-right: 40px; /* Espa�o para o bot�o de exclus�o */
}

#viewAllNotifications:hover {
    background-color: #f5f5f5;
}

.nox-navbar-item-container.lida {
    background-color: #f0f0f0;
    color: #aaa;
}

.nox-gallery-container-search-father {
    display: flex;
    overflow: hidden;
    scroll-behavior: smooth;
    width: 100%;
    padding: 0;
    border: none;
    background-color: transparent;
    user-select: none;
}

.nox-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 10px;
    width: 104%;
    height: 105%;
    overflow: hidden;
    border-radius: 10px;
    border: 2px solid #ddd;
    background-color: #fff;
    transition: transform 0.3s ease;
}

    .nox-image-container:hover {
        cursor: pointer;
        transform: scale(1.05);
        border-color: #aaa;
    }

    .nox-image-container img {
        max-width: 100%;
        object-fit: contain;
        height: 120px;
    }

.nox-image-name {
    text-align: center;
    font-size: 13px;
}

/* === Navbar V2 Styles === */
.nox-navbar {
    background-color: var(--nox-primary-color);
    color: white;
    height: 56px; /* Altura do protótipo (h-14 -> 3.5rem -> 56px) */
    padding: 0 16px; /* px-4 -> 1rem -> 16px */
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 250px; /* Largura da sidebar */
    right: 0;
    z-index: 1001;
    transition: left 0.3s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.nox-main-collapsed .nox-navbar {
    left: 0;
}

.nox-navbar-left, .nox-navbar-right {
    display: flex;
    align-items: center;
    gap: 12px; /* space-x-3 -> 0.75rem -> 12px */
}

.nox-navbar-left {
    flex-grow: 1;
    min-width: 0; /* Prevents flex items from overflowing */
}

.nox-navbar-breadcrumb {
    margin-left: 5px;
    display: flex;
    align-items: center;
    flex-grow: 1;
    font-size: 1.4em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nox-navbar-breadcrumb > * {
    margin-right: 8px;
    text-decoration: none;
}

.nox-navbar-breadcrumb > *:last-child {
    margin-right: 0;
}

/* MobIA Button - Structure */
.nox-navbar-mobia-btn-native {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 0.375rem; /* rounded-md */
    padding: 6px 12px; /* px-3 py-1.5 */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px; /* space-x-1.5 */
    font-size: 0.75rem; /* text-xs */
    font-weight: 500; /* font-medium */
    transition: background-color 0.2s;
    height: 38px; /* Ajuste para alinhar com outros botões */
}

.nox-navbar-mobia-btn-native:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.nox-navbar-mobia-btn-native:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* Ajustes para botões DevExtreme na navbar */
.nox-navbar-right .dx-button {
    background-color: transparent;
    border: none;
    color: white;
    height: 38px; /* Altura consistente */
    width: 38px; /* Largura consistente */
    border-radius: 9999px; /* rounded-full */
    padding: 6px; /* p-1.5 */
}

.nox-navbar-right .dx-button:hover {
    background-color: rgba(0, 0, 0, 0.15); /* Equivalente a hover:bg-orange-700 */
}

.nox-navbar-right .dx-button .dx-button-content {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nox-navbar-right .dx-button .dx-icon {
    font-size: 20px; /* text-xl */
    color: white;
    margin: 0;
}

.nox-navbar-right .dx-button .dx-button-text {
    display: none; /* Esconde o texto por padrão, como no protótipo */
}

/* Estilo específico para o botão de empresa que tem texto */
#companyButton.dx-button {
    width: auto; /* Largura automática para acomodar o texto */
    padding: 6px 12px; /* Padding horizontal maior */
    border-radius: 0.375rem; /* rounded-md */
}

#companyButton.dx-button .dx-button-text {
    display: inline;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 8px; /* Espaço entre ícone e texto */
}

.nox-chat-logo {
    display: flex;
    align-items: center;
}

.nox-chat-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.nox-chat-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.nox-chat-beta {
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    background-color: #6c757d;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 8px;
}

.nox-chat-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #555;
}

.nox-chat-area {
    flex-grow: 1;
    overflow-y: auto;
}

.nox-chat-tagline {
    text-align: center;
    padding: 15px;
    font-size: 14px;
    color: #666;
    background-color: #f9f9f9;
}

/* User Initials Icon - Structure & FIX for clipping */
.nox-navbar-user-btn.dx-button {
    min-width: 36px;
    width: 36px; /* Fix width */
    height: 36px; /* Fix height */
    padding: 0 !important;
    border-radius: 50%; /* Make the button itself a circle */
    overflow: hidden; /* Hide anything outside the circle */
}

.nox-navbar-user-btn .dx-button-content {
    padding: 0 !important;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nox-navbar-user-initials {
    width: 27px; /* Fill the container */
    height: 27px; /* Fill the container */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    line-height: 1;
}

.nox-menu-small-devextreme-button .dx-button {
    width: 20px !important;
    height: 20px !important;
    min-width: auto !important;
    padding: 0 !important;
}

    .nox-menu-small-devextreme-button .dx-button .dx-button-content {
        padding-block: 0px !important;
        padding-inline-start: 0px !important;
        padding-inline-end: 0px !important;
    }

    .nox-menu-small-devextreme-button .dx-button .dx-icon {
        color: #2196F3 !important;
    }

/* ========================================================= */
/* RODAPÉ DA EMPRESA NO MENU LATERAL - ESTILOS ÚNICOS      */
/* ========================================================= */

.nox-sidebar-empresa-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 250px; /* Largura da sidebar */
    background-color: #ffffff;
    border-top: 1px solid #e5e5e5;
    z-index: 10;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease, width 0.3s ease;
}

/* Ajuste quando sidebar está collapsed */
.nox-sidebar-collapsed .nox-sidebar-empresa-footer {
    left: -250px;
}

.nox-empresa-details-panel {
    padding: 16px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e5e5e5;
    transition: all 0.3s ease;
    overflow-y: auto; /* Adiciona scroll interno quando necessário */
    max-height: 0;
}

.nox-empresa-details-panel.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.nox-empresa-details-panel.expanded {
    max-height: 60vh; /* Altura máxima de 60% da viewport */
    opacity: 1;
}

.nox-empresa-section-header {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.nox-empresa-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 4px 0;
}

.nox-empresa-label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    min-width: 70px;
}

.nox-empresa-value {
    font-size: 12px;
    color: #333;
    font-weight: 400;
}

.nox-empresa-value-copy {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nox-empresa-copy-icon {
    cursor: pointer;
    color: #007bff;
    font-size: 11px;
    padding: 2px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.nox-empresa-copy-icon:hover {
    background-color: #007bff;
    color: white;
}

.nox-empresa-actions-container {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #ddd;
}

.nox-empresa-compact-area {
    padding: 12px 16px;
    background-color: #ffffff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.nox-empresa-compact-area:hover {
    background-color: #f5f5f5;
}

.nox-empresa-compact-content {
    flex: 1;
}

.nox-empresa-compact-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    line-height: 1.2;
}

.nox-empresa-compact-cnpj {
    font-size: 11px;
    color: #666;
}

.nox-empresa-toggle-arrow {
    color: #666;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nox-empresa-lista-item {
    border-radius: 4px;
    margin: 4px 0;
}

.nox-empresa-lista-nome {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.nox-empresa-lista-cnpj {
    font-size: 11px;
    color: #666;
}

/* Responsividade para telas menores */
@media (max-width: 768px) {
    .nox-empresa-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .nox-empresa-compact-name {
        font-size: 12px;
    }
    
    .nox-empresa-compact-cnpj {
        font-size: 10px;
    }
    
    /* Ajustes do footer no mobile */
    .nox-sidebar-empresa-footer {
        width: 100%;
        left: 0;
    }
    
    .nox-sidebar.nox-open .nox-sidebar-empresa-footer {
        width: 100%;
        left: 0;
    }
    
    .nox-empresa-details-panel.expanded {
        max-height: 50vh; /* Menor altura no mobile */
    }
}