/* Estilo básico */
body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding: 0;
}

/* Botão Global de Ajuste de Tabelas */
#btnFitTableGlobal {
    transition: all 0.3s ease;
    font-size: 0.85rem;
    border-width: 1px;
}

#btnFitTableGlobal:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#btnFitTableGlobal.btn-outline-warning {
    border-color: #ffc107;
    color: #ffc107;
}

#btnFitTableGlobal.btn-outline-warning:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

/* Responsive para o botão */
@media (max-width: 768px) {
    #btnFitTableGlobal {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Barra superior fina */
.navbar {
    height: 40px;
    position: fixed;
    width: 100%;
    z-index: 1001;
}

/* Layout */
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#sidebar {
    min-width: 250px;
    max-width: 250px;
    background: #333;
    color: #fff;
    transition: all 0.3s ease;
    height: calc(100vh - 40px);
    position: fixed;
    top: 40px;
    z-index: 1000;
    overflow-y: auto;
}

#sidebar.active {
    min-width: 80px;
    max-width: 80px;
}

/* Ajuste para o menu lateral */
#sidebar ul.components a {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#sidebar ul li {
    padding: 8px;
    font-size: 14px;
}

#sidebar ul li a {
    color: white;
    padding: 8px;
    display: block;
    text-decoration: none;
}

#sidebar ul li a i {
    font-size: 18px;
    margin-right: 10px;
}

#sidebar.active ul li a span {
    display: none;
}

/* Estilo do conteúdo principal */
#content {
    margin-left: 250px;
    padding: 20px;
    transition: all 0.3s ease;
    padding-top: 60px;
}

#content.expanded {
    margin-left: 80px;
}

/* Estilo para títulos das telas */
h1, h2, h3 {
    font-size: 1.6rem;
    font-weight: bold;
    margin-bottom: 20px;
}

/* Estilo para botões */
button.btn, a.btn {
    font-size: 0.9rem;
    padding: 6px 12px;
}

/* Botões de ação específicos */
button.btn-warning, button.btn-danger, a.btn-primary {
    font-size: 0.9rem;
    padding: 6px 12px;
}

/* Estilo para a tabela de tarefas pendentes */
.task-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.task-table th,
.task-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.task-table th {
    background-color: #4b4b4b;
    color: white;
}

.task-table tr:hover {
    background-color: #f1f1f1;
}

.task-table .task-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 10px;
}

.task-table .task-pending {
    color: #d9534f;
}

.task-table .task-complete {
    color: #5cb85c;
}

.task-table a {
    color: #0056b3;
    text-decoration: none;
    font-weight: bold;
}

.task-table a:hover {
    color: #004080;
}

/* Define largura fixa para todas as colunas de todas as tabelas */
table th, table td {
    width: 200px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Rodapé fixo ao final da página */
.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 10px;
    position: relative;
    bottom: 0;
    width: 100%;
    height: 60px;
    flex-shrink: 0;
    margin-top: auto;
}

/* Botão de três linhas */
#sidebarCollapse {
    background: #333;
    border: none;
    color: white;
    padding: 5px 10px;
    cursor: pointer;
    margin-left: 20px;
}

#sidebarCollapse svg {
    fill: white;
}

/* Estilos para edição in-line */

/* Estilos básicos da tabela */
.table-container {
    width: fit-content;
    min-width: min-content;
    overflow-x: auto;
    max-height: 500px;
}

/* Estilos para células editáveis */
.editable-cell {
    position: relative;
    cursor: pointer;
    transition: width 0.3s ease;
}

.editable-cell:hover::after {
    content: '✎';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: #007bff;
    font-size: 12px;
    opacity: 0.7;
}

/* Estilos para o modo de edição */
.editing {
    background-color: #fff !important;
    padding: 0 !important;
    min-width: 150px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 100;
}

.editable-cell .edit-form {
    display: flex;
    gap: 8px;
    padding: 4px;
    width: 100%;
    align-items: center;
}

.editable-cell input {
    width: 100% !important;
    min-width: 100px;
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    height: 30px;
}

/* Novos estilos para células de input em novas linhas */
.new-row td {
    padding: 4px !important;
    position: relative;
}

/* Estilo base para inputs em nova linha */
.new-row input,
.new-row select {
    width: 125px;
    padding: 4px 8px;
    font-size: 0.875rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* Estilo básico para foco */
.new-row input:focus, 
.new-row select:focus {
    outline: none;
    border-color: #80bdff;
}

/* Melhorias visuais para inputs e botões */
.edit-form input:focus,
.new-row input:focus,
.new-row select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 0 0 0.2rem rgba(0,123,255,.25);
}

.edit-form .buttons-container {
    display: flex;
    gap: 4px;
    white-space: nowrap;
}

.edit-form .buttons-container button {
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.edit-form .buttons-container button:hover {
    transform: scale(1.05);
}

/* Estilos para alertas flutuantes e separador entre tabelas */
.alert-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    min-width: 250px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table-separator {
    margin: 2rem 0;
    border-top: 2px solid #dee2e6;
}

/* Estilos para outros selects também, para manter consistência */
.edit-select {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}

 /* Filtro para objetos select */
 .autocomplete-container {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    display: none; /* Escondido inicialmente */
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #ccc;
    background-color: #fff;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dropdown-menu.show {
    display: block; /* Exibido quando a lista está ativa */
}

.dropdown-menu li {
    padding: 8px 12px;
    cursor: pointer;
}

.dropdown-menu li:hover {
    background-color: #f1f1f1;
}

/* Tornar o ícone invisível por padrão */
.copy-icon {
    visibility: hidden;
}

/* Tornar o ícone visível quando o mouse passar sobre o <td> */
.col-hover:hover .copy-icon {
    visibility: visible;
}

/* Estilo de hover para linhas da tabela */
.table tbody tr {
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

.table tbody tr:hover {
    background-color: #e3f2fd !important; /* Azul claro */
    color: #212529 !important; /* Texto escuro para contraste */
    /*font-weight: bold !important;*/ /* Texto em negrito apenas no hover */
    cursor: pointer;
}

/* Efeito mais suave para todas as células da linha */
.table tbody tr:hover td {
    background-color: #e3f2fd !important; /* Azul claro harmonioso */
    color: #212529 !important; /* Garante texto escuro em todas as células */
    /*font-weight: bold !important;*/ /* Texto em negrito apenas no hover */
    border-color: #bbdefb !important; /* Borda azul mais escura */
}

/* Para tabelas com classes específicas do Bootstrap */
.table-striped tbody tr:hover {
    background-color: #e3f2fd !important; /* Azul claro harmonioso */
    color: #212529 !important; /* Texto escuro */
    /*font-weight: bold !important;*/ /* Texto em negrito apenas no hover */
}

.table-hover tbody tr:hover {
    background-color: #e3f2fd !important; /* Mantém consistência */
    color: #212529 !important; /* Texto escuro */
    /*font-weight: bold !important;*/ /* Texto em negrito apenas no hover */
}

/* Efeito especial para linhas ímpares em tabelas striped */
.table-striped tbody tr:nth-of-type(odd):hover {
    background-color: #e1f5fe !important; /* Azul ciano claro */
    color: #212529 !important; /* Texto escuro */
    /*font-weight: bold !important;*/ /* Texto em negrito apenas no hover */
}

/* Efeito especial para linhas pares em tabelas striped */
.table-striped tbody tr:nth-of-type(even):hover {
    background-color: #e3f2fd !important; /* Azul claro */
    color: #212529 !important; /* Texto escuro */
    /*font-weight: bold !important;*/ /* Texto em negrito apenas no hover */
}

/* Garantir que links e outros elementos também tenham cor escura e negrito apenas no hover */
.table tbody tr:hover a,
.table tbody tr:hover span,
.table tbody tr:hover div,
.table tbody tr:hover .td-acoes {
    color: #212529 !important; /* Texto escuro para todos os elementos filhos */
    /*font-weight: bold !important;*/ /* Texto em negrito apenas no hover */
}

/* Estilos para linhas selecionadas */
.table tbody tr.row-selected {
    background-color: #bbdefb !important; /* Azul mais escuro para seleção */
    color: #212529 !important; /* Texto escuro */
}

.table tbody tr.row-selected td {
    background-color: #bbdefb !important; /* Azul mais escuro para seleção */
    color: #212529 !important; /* Texto escuro */
    border-color: #90caf9 !important; /* Borda azul ainda mais escura */
}

/* Hover em linhas já selecionadas - cor ligeiramente diferente */
.table tbody tr.row-selected:hover {
    background-color: #90caf9 !important; /* Azul ainda mais escuro no hover */
}

.table tbody tr.row-selected:hover td {
    background-color: #90caf9 !important; /* Azul ainda mais escuro no hover */
}

/* Estilos para elementos de edição inline - prioridade sobre hover */
.editable-cell .edit-form,
.editable-cell .edit-form *,
.edit-form,
.edit-form * {
    z-index: 1000 !important;
    position: relative !important;
    background-color: white !important;
    color: #212529 !important;
    font-weight: normal !important;
}

/* Garantir que selects dentro de formulários de edição tenham prioridade */
.edit-form select,
.edit-form input,
.editable-cell .edit-form select,
.editable-cell .edit-form input {
    background-color: white !important;
    color: #212529 !important;
    font-weight: normal !important;
    border: 1px solid #ced4da !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Garantir que dropdowns de selects sejam visíveis */
.edit-form select:focus,
.editable-cell .edit-form select:focus {
    border-color: #80bdff !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25) !important;
}

/* Remover outline/contorno azul padrão do navegador */
.table tbody tr,
.table tbody tr td,
.table tbody tr:focus,
.table tbody tr td:focus,
.table tbody tr:active,
.table tbody tr td:active {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Remover outline em elementos focáveis dentro da tabela */
.table tbody tr *:focus,
.table tbody tr *:active {
    outline: none !important;
    box-shadow: none !important;
}

/* Garantir que não apareça outline em links e botões dentro da tabela */
.table tbody tr a:focus,
.table tbody tr button:focus,
.table tbody tr input:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remover qualquer tipo de seleção visual indesejada */
.table tbody tr,
.table tbody tr td {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Permitir seleção de texto apenas quando necessário (não nas células clicáveis) */
.table tbody tr td.text-selectable {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Remover bordas de foco do Bootstrap */
.table tbody tr:focus-within,
.table tbody tr td:focus-within {
    box-shadow: none !important;
    border-color: inherit !important;
}

/* Classe para fundos específicos */
.bg-danger-soft {
    background-color: rgba(220, 53, 69, 0.12); /* vermelho Bootstrap suave */
}