/* SIAO V33 - ESTILO ROBUSTO E DEFINITIVO */
:root {
    --h-header: 45px;
    --h-row: 42px;
    --bg-header: #0f172a;
    --color-primary: #2563eb;
    --border-soft: #cbd5e1;
}

.crono-container {
    display: flex; flex-direction: column;
    background: #fff; border: 1px solid var(--border-soft); border-radius: 8px;
    font-family: 'Segoe UI', sans-serif; height: 750px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    overflow: visible; /* Importante para o tooltip */
}

.crono-toolbar {
    padding: 10px 15px; background: #fff; border-bottom: 1px solid #e2e8f0;
    display: flex; justify-content: space-between; align-items: center;
}

/* WORKSPACE E TABELA */
.crono-workspace { display: flex; flex: 1; overflow: visible; position: relative; background: #f1f5f9; }

.crono-table-panel {
    background: #fff; border-right: 2px solid var(--border-soft);
    display: flex; flex-direction: column; flex-shrink: 0;
    transition: width 0.3s ease; overflow: hidden; z-index: 20;
}

.table-header {
    height: var(--h-header); background: #f8fafc; border-bottom: 1px solid var(--border-soft);
    display: flex; align-items: center; font-weight: 800; font-size: 10px; color: #64748b;
}

.crono-row {
    height: var(--h-row); display: flex; align-items: center;
    border-bottom: 1px solid #f1f5f9; background: #fff;
}
.crono-row:nth-child(even) { background-color: #fcfcfc; }
.crono-row:hover { background-color: #f0f9ff; }

/* TRAVA DE LARGURA DAS COLUNAS (Atualizado V33.1) */
.col-atividade { flex: 1; padding-left: 10px; min-width: 200px; overflow: hidden; }
.col-dias { width: 75px !important; display: flex; justify-content: center; }
.col-tipo { width: 90px !important; display: flex; justify-content: center; }
.col-percent { width: 70px !important; display: flex; justify-content: center; }

/* ADICIONADO: Largura para a nova coluna de esforço vinda do SINAPI */
.col-qtd { width: 80px !important; display: flex; justify-content: center; align-items: center; } 

.col-pred { width: 70px !important; display: flex; justify-content: center; }
/* CAIXINHAS (INPUTS) ENCORPADAS */
.crono-input {
    border: 1.5px solid #cbd5e1; border-radius: 6px;
    height: 32px; width: 100%; max-width: 60px;
    text-align: center; font-size: 13px; font-weight: 700;
    background: #f8fafc; color: #334155; transition: 0.2s;
    padding: 0;
}
.crono-input:focus { border-color: var(--color-primary); background: #fff; outline: none; }

/* BADGE ID (PRETO E BRANCO) */
.item-numero {
    background: #0f172a; color: #fff;
    min-width: 26px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 5px; font-size: 11px; font-weight: 900;
    margin-right: 8px;
}

/* GANTT */
.crono-gantt-panel { flex: 1; overflow: auto; background: #fff; position: relative; }
.gantt-header { height: var(--h-header); background: #fff; position: sticky; top: 0; z-index: 10; display: flex; }
.gantt-body { position: relative; width: max-content; }

.month-block {
    height: 100%; display: flex; align-items: center; justify-content: center;
    background: var(--bg-header); color: white; font-weight: 700; font-size: 10px;
    border-right: 1px solid rgba(255,255,255,0.2); flex-shrink: 0;
}
.grid-container { position: absolute; top: 0; left: 0; height: 100%; width: 100%; display: flex; pointer-events: none; }
.grid-month-block { height: 100%; border-right: 1px solid #d1d5db; flex-shrink: 0; }

/* BARRAS E TOOLTIP FIXO */
.gantt-bar-wrapper {
    position: absolute; height: 26px; border-radius: 6px;
    font-size: 10px; font-weight: 700; display: flex; align-items: center;
    z-index: 5; box-shadow: 0 2px 5px rgba(0,0,0,0.15); cursor: pointer;
    overflow: visible; /* Permite o tooltip sair da barra */
}
.bar-progress { position: absolute; left: 0; top: 0; height: 100%;  background: #10b981; /* Verde técnico */; border-radius: 6px 0 0 6px; }
.resize-handle { position: absolute; right: 0; top: 0; width: 8px; cursor: col-resize; height: 100%; z-index: 10; }

/* O TOOLTIP AGORA É RELATIVO À BARRA */
.bar-tooltip {
    position: absolute;
    background: #0f172a; color: white;
    padding: 8px 12px; border-radius: 6px;
    font-size: 11px; white-space: nowrap;
    z-index: 9999; display: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    left: 50%; transform: translateX(-50%); /* Centraliza na barra */
    pointer-events: none;
    line-height: 1.4;
    border: 1px solid #334155;
}

/* Dashboard */
.dashboard-resumo { display: flex; gap: 20px; padding: 15px; background: #f8fafc; border-top: 2px solid #e2e8f0; }
.card-resumo { flex: 1; background: #fff; padding: 15px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.card-valor { font-size: 20px; font-weight: 800; color: #0f172a; }
.col-extra { display: none; }
.expanded .col-extra { display: flex; }

/* AJUSTE 1: Atividades mais limpas e compactas */
.atividade-nome {
    font-size: 11px !important; /* Menor e mais elegante */
    font-weight: 600 !important;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Três pontinhos se for muito grande */
    display: block;
    line-height: 1.2;
}

/* AJUSTE 2: Texto dentro da barra não colado */
.bar-text-inside {
    position: relative; 
    z-index: 2; 
    color: white; 
    width: 100%; 
    display: flex; 
    justify-content: space-between; 
    padding: 0 10px; /* Mais espaço nas laterais */
    font-size: 10px; 
    font-weight: 700; 
    align-items: center; 
    height: 100%;
}
/* CORREÇÃO DO BALÃO ESCONDIDO */

/* Quando o mouse passa na barra, ela ganha SUPER PODERES de Z-Index */
.gantt-bar-wrapper:hover {
    z-index: 9999 !important; /* Maior que o cabeçalho (z-index: 10) */
}

/* O Tooltip ganha ainda mais prioridade */
.bar-tooltip {
    z-index: 10000 !important;
}

/* Permitir que o Tooltip saia da área de corte do painel */
.crono-gantt-panel {
    overflow: visible !important; /* Deixa o balão vazar pra fora */
}

/* Mas para não perder a barra de rolagem, aplicamos overflow no BODY do Gantt */
.gantt-body {
    overflow-x: hidden; /* Evita rolagem lateral fantasma */
}