/* ==================== ESTILOS GERAIS ==================== */
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
}
/* ==================== LAYOUT PRINCIPAL ==================== */
#grid-container {
    min-height: 100vh;
    width: 99vw;
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
    gap: 12px;
    overflow: visible;           /* Permite crescer */
}
/* Área do Artifact (Workspace da IA) */
#ia-workspace {
    display: none;
    flex-shrink: 0;
    margin-bottom: 12px;
    border: 1px solid #007bff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: visible;
    background: #fff;
}
#ia-workspace.active {
    display: flex !important;
    flex-direction: column;
}
#ia-html {
    padding: 20px;
    background: #fff;
    min-height: 200px;
    overflow: visible;           /* Importante */
}
/* Cabeçalho do Workspace */
.ia-header {
    background: #007bff;
    color: #fff;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
#tabela-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    height: 100vh;
}
/* Título da Tabela */
.tabela-titulo {
    background: #ffffff;
    color: #333;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px 12px 0 0; /* Arredonda apenas o topo para "colar" na tabela */
    border-left: 5px solid #007bff; /* Detalhe azul na lateral esquerda */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: -5px; /* Truque para sobrepor levemente a tabela e parecer peça única */
    z-index: 10;
    position: relative;
}
/* ==================== TABELA TABULATOR ==================== */
#table-apontamentos {
    flex-grow: 1; /* Mais importante: ocupa o espaço restante */
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
}
.tabulator {
    height: 100% !important;
}
.tabulator-tableholder {
    overflow: auto !important;
    scrollbar-width: thin;
    scrollbar-color: #007bff #f0f0f0;
}
/* Scrollbar customizada (WebKit) */
.tabulator-tableholder::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.tabulator-tableholder::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 4px;
}
/* ==================== CABEÇALHO E ESTILO DA TABELA ==================== */
.tabulator-header {
    background-color: #007bff !important;
    color: #ffffff !important;
    border-bottom: none !important;
    font-weight: 600;
}
.tabulator-col {
    background-color: #007bff !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.tabulator-row {
    border-bottom: 1px solid #f0f2f5 !important;
    min-height: 45px !important;
}
.tabulator-row-odd { background-color: #ffffff; }
.tabulator-row-even { background-color: #f8f9fa; }
/* Filtros no cabeçalho */
.tabulator-header-filter input {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    outline: none !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease;
    font-size: 13px;
}
.tabulator-header-filter input:focus {
    background-color: rgba(255, 255, 255, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2) !important;
}
.tabulator-header-filter input::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}
/* Checkmark na lista de filtro */
.tabulator-edit-list-item {
    padding-left: 30px !important;
    position: relative;
    transition: background 0.2s;
}
.tabulator-edit-list-item.tabulator-edit-list-item-selected::before {
    content: "✓";
    position: absolute;
    left: 8px;
    color: #2ecc71;
    font-weight: bold;
    font-size: 14px;
}
.tabulator-edit-list-item:hover {
    background-color: #f0f0f0;
}
/* Rodapé */
.tabulator-footer {
    background-color: #ffffff !important;
    border-top: 2px solid #007bff !important;
    color: #333 !important;
    font-weight: bold;
}
/* ==================== IA - BOTÃO E CHAT ==================== */
/* Estilo base do botão */
.ai-button {
    position: fixed;
    bottom: 60px;
    right: 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-size: 24px;
    z-index: 1000;
    transition: transform 0.2s;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Classe de animação quando a IA está processando */
.ai-thinking {
    animation: pulse-thought 1.5s infinite ease-in-out;
    pointer-events: none; /* Evita cliques duplos enquanto processa */
}
@keyframes pulse-thought {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}
#ai-chat-box {
    position: fixed;
    bottom: 130px;
    right: 25px;
    width: 350px;
    height: 480px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
    border: 1px solid #ddd;
}
#chat-header {
    background: #007bff;
    color: white;
    padding: 15px;
    border-radius: 12px 12px 0 0;
    font-weight: bold;
}
#chat-content {
    flex-grow: 1;
    padding: 8px;
    overflow-y: auto;
    font-size: 14px;
    background: #f9f9f9;
}
#chat-input-area {
    padding: 8px;
    border-top: 1px solid #eee;
width: 100%;
}
.chat-input {
    flex-grow: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    outline: none;
   width: 100%;
}
/* ==================== MENU ==================== */
.dropdown-ia {
    position: relative;
    display: inline-block;
}
.menu-ia-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #fff;
    min-width: 280px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    z-index: 9999;
    border-radius: 4px;
}
.menu-ia-content a {
    color: #333;
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    border-bottom: 1px solid #eee;
}
.menu-ia-content a:hover {
    background-color: #f1f1f1;
}
.dropdown-ia:hover .menu-ia-content {
    display: block;
}
