/* ==============================
   SITE.CSS — Consolidado
   Fontes: site.css (base), site.v9.css (ajustes PDF DEBUG)
   Data: 2025-10-27
   Nota: v9 vem por último para prevalecer onde diferir.
   ============================== */

/* ===== Base (site.css) ===== */
html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

/* ===== util ===== */
.text-nowrap {
    white-space: nowrap !important;
}

.table th,
.table td {
    vertical-align: middle;
}

.table-sm th,
.table-sm td {
    padding-top: .35rem;
    padding-bottom: .35rem;
}

/* ===== cards ===== */
.card {
    border-radius: .75rem;
}

.card-header {
    border-top-left-radius: .75rem !important;
    border-top-right-radius: .75rem !important;
}

/* ===== toolbar ===== */
.toolbar {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: .75rem;
}

    .toolbar .btn svg {
        pointer-events: none;
    }

.badge-soft {
    background: rgba(0,0,0,.05);
    color: #333;
    border: 1px solid rgba(0,0,0,.08);
}

/* ===== filtros ===== */
.filtros-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: .75rem;
}

    .filtros-grid .col-span-2 {
        grid-column: span 2;
    }

    .filtros-grid .col-span-3 {
        grid-column: span 3;
    }

    .filtros-grid .col-span-4 {
        grid-column: span 4;
    }

    .filtros-grid .col-span-6 {
        grid-column: span 6;
    }

    .filtros-grid .col-span-12 {
        grid-column: span 12;
    }

@media (max-width: 991.98px) {
    .filtros-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 575.98px) {
    .filtros-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== tabelas ===== */
.table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f9fa;
}

.table .col-min {
    width: 1%;
    white-space: nowrap;
}

.table .col-120 {
    width: 120px;
}

.table .col-140 {
    width: 140px;
}

.table .col-160 {
    width: 160px;
}

.table .col-200 {
    width: 200px;
}

/* ===== ícones de ação ===== */
.action-icons {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

    .action-icons .btn {
        padding: .25rem .5rem;
        line-height: 1;
    }

/* ===== modal ===== */
.modal-lg {
    --bs-modal-width: 980px;
}

.modal-xl {
    --bs-modal-width: 1140px;
}

/* ===== área de impressão in-place ===== */
#__print_area__ {
    display: none;
}

    #__print_area__ .print-header,
    #__print_area__ .print-footer {
        display: none; /* escondidos no modo tela por padrão */
    }

    #__print_area__ .print-header {
        gap: 12px;
        align-items: center;
    }

        #__print_area__ .print-header img {
            height: 28mm;
            width: auto;
        }

        #__print_area__ .print-header .title {
            font-weight: 700;
            font-size: 18px;
            line-height: 1.15;
        }

    #__print_area__ .print-body {
        margin-top: 42mm; /* reserva do cabeçalho fixo */
        margin-bottom: 20mm; /* reserva do rodapé fixo   */
    }

    #__print_area__ .print-footer {
        font-size: 12px;
        color: #666;
    }

    /* ===== tabelas dentro da área de impressão ===== */
    #__print_area__ table {
        width: 100%;
    }

        #__print_area__ table th,
        #__print_area__ table td {
            border: 1px solid #dee2e6;
            padding: .5rem .6rem;
        }

/* ===== carimbo no rodapé (timestamp) ===== */
.print-footer .timestamp {
    opacity: .8;
}

/* ===== timer de sessão (exemplo de badge) ===== */
.session-timer-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .15rem .6rem;
    border-radius: 999px;
    font-weight: 600;
    line-height: 1;
    /* presumindo tarja preta: mantém contraste alto */
    background: rgba(255,255,255,0.12);
    color: #fff;
    user-select: none;
    white-space: nowrap;
    min-width: 84px; /* evita pular quando troca de 10:00 para 9:59 */
    justify-content: center;
}

    .session-timer-badge.session-timer-warning {
        background: rgba(255,193,7,0.25); /* amarelo suave */
    }

    .session-timer-badge.session-timer-danger {
        background: rgba(220,53,69,0.3); /* vermelho suave */
    }

    .session-timer-badge .bi {
        font-size: 1rem;
        margin-right: .35rem;
        line-height: 1;
        display: inline-block;
        transform: translateY(1px);
    }

/* ==== impressão seletiva in-place ==== */
#__print_area__ {
    display: none;
}

    /* === PDF capture (modo tela) === */
    #__print_area__.pdf-capture .print-header,
    #__print_area__.pdf-capture .print-footer {
        display: block !important;
    }

    #__print_area__.pdf-capture .print-header {
        display: flex !important;
    }

@media print {
    body > *:not(#__print_area__) {
        display: none !important;
    }

    #__print_area__ {
        display: block !important;
    }

        /* cabeçalho fixo no topo */
        #__print_area__ .print-header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            display: flex !important;
            align-items: center;
            gap: 12px;
            padding: 10mm 10mm 6mm 10mm;
            border-bottom: 1px solid #ddd;
            background: #fff !important;
            z-index: 1000;
        }

            #__print_area__ .print-header img {
                height: 24mm;
                width: auto;
            }

            #__print_area__ .print-header .title {
                font-weight: 700;
                font-size: 18px;
            }

        /* corpo com offset do cabeçalho e rodapé */
        #__print_area__ .print-body {
            margin-top: 42mm;
            margin-bottom: 20mm;
            padding: 0 10mm;
            background: #fff !important;
        }

        /* rodapé fixo no fim */
        #__print_area__ .print-footer {
            position: fixed;
            left: 0;
            right: 0;
            bottom: 0;
            padding: 4mm 10mm 6mm 10mm;
            border-top: 1px solid #ddd;
            background: #fff !important;
            font-size: 12px;
            color: #444;
            display: flex !important;
            align-items: center;
            justify-content: space-between;
            z-index: 1000;
        }

        /* zebra básica p/ tabelas */
        #__print_area__ table tbody tr:nth-child(odd) {
            background: #fafafa;
        }

        /* esconder última coluna (ações) somente na impressão/PDF */
        /* tela principal */
        #__print_area__ #tbl-ciot th:last-child,
        #__print_area__ #tbl-ciot td:last-child {
            display: none !important;
        }

        /* modal de lista por empresa */
        #__print_area__ #tbl-ciot-modal th:last-child,
        #__print_area__ #tbl-ciot-modal td:last-child {
            display: none !important;
        }
}

/* quando NÃO estiver imprimindo, mantenha o rodapé invisível */
#__print_area__ .print-footer {
    display: none;
}

/* redundância intencional para garantir estado inicial */
#__print_area__ {
    display: none;
}

    /* === Habilitar header/rodapé durante a CAPTURA DO PDF (modo tela) === */
    #__print_area__.pdf-capture .print-header,
    #__print_area__.pdf-capture .print-footer {
        display: block !important;
    }

    #__print_area__.pdf-capture .print-header {
        display: flex !important; /* preserva layout em flex */
    }

/* ===== Ajustes adicionais (site.v9.css) ===== */
/* ============================
   PDF DEBUG v9 - 2025-10-24
   Comentamos regras que poderiam ocultar conteúdo
   durante a captura do html2pdf. Revertível.
   ============================ */

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

/* ===== util ===== */
.text-nowrap {
    white-space: nowrap !important;
}

.table th,
.table td {
    vertical-align: middle;
}

.table-sm th,
.table-sm td {
    padding-top: .35rem;
    padding-bottom: .35rem;
}

/* ===== cards ===== */
.card {
    border-radius: .75rem;
}

.card-header {
    border-top-left-radius: .75rem !important;
    border-top-right-radius: .75rem !important;
}

/* ===== toolbar ===== */
.toolbar {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: .75rem;
}

    .toolbar .btn svg {
        pointer-events: none;
    }

.badge-soft {
    background: rgba(0,0,0,.05);
    color: #333;
    border: 1px solid rgba(0,0,0,.08);
}

/* ===== filtros ===== */
.filtros-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: .75rem;
}

    .filtros-grid .col-span-2 {
        grid-column: span 2;
    }

    .filtros-grid .col-span-3 {
        grid-column: span 3;
    }

    .filtros-grid .col-span-4 {
        grid-column: span 4;
    }

    .filtros-grid .col-span-6 {
        grid-column: span 6;
    }

    .filtros-grid .col-span-12 {
        grid-column: span 12;
    }

@media (max-width: 991.98px) {
    .filtros-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 575.98px) {
    .filtros-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== tabelas ===== */
.table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f9fa;
}

.table .col-min {
    width: 1%;
    white-space: nowrap;
}

.table .col-120 {
    width: 120px;
}

.table .col-140 {
    width: 140px;
}

.table .col-160 {
    width: 160px;
}

.table .col-200 {
    width: 200px;
}

/* ===== cones de ao ===== */
.action-icons {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

    .action-icons .btn {
        padding: .25rem .5rem;
        line-height: 1;
    }

/* ===== modal ===== */
.modal-lg {
    --bs-modal-width: 980px;
}

.modal-xl {
    --bs-modal-width: 1140px;
}

/* ===== rea de impresso in-place ===== */
/* [PDF DEBUG v9] COMENTADO: estado base oculto da área de impressão

#__print_area__ {
    display: none;
}

    
*/
#__print_area__ .print-header,
    #__print_area__ .print-footer {
        display: none; /* escondidos no modo tela por padro */
    }

    #__print_area__ .print-header {
        gap: 12px;
        align-items: center;
    }

        #__print_area__ .print-header img {
            height: 28mm;
            width: auto;
        }

        #__print_area__ .print-header .title {
            font-weight: 700;
            font-size: 18px;
            line-height: 1.15;
        }

    #__print_area__ .print-body {
        margin-top: 42mm; /* reserva do cabealho fixo */
        margin-bottom: 20mm; /* reserva do rodap fixo   */
    }

    #__print_area__ .print-footer {
        font-size: 12px;
        color: #666;
    }

    /* ===== tabelas dentro da rea de impresso ===== */
    #__print_area__ table {
        width: 100%;
    }

        #__print_area__ table th,
        #__print_area__ table td {
            border: 1px solid #dee2e6;
            padding: .5rem .6rem;
        }

/* ===== carimbo no rodap (timestamp) ===== */
.print-footer .timestamp {
    opacity: .8;
}

/* ===== timer de sesso (exemplo de badge) ===== */
.session-timer-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .15rem .6rem;
    border-radius: 999px;
    font-weight: 600;
    line-height: 1;
    /* presumindo tarja preta: mantm contraste alto */
    background: rgba(255,255,255,0.12);
    color: #fff;
    user-select: none;
    white-space: nowrap;
    min-width: 84px; /* evita pular quando troca de 10:00 para 9:59 */
    justify-content: center;
}

    .session-timer-badge.session-timer-warning {
        background: rgba(255,193,7,0.25); /* amarelo suave */
    }

    .session-timer-badge.session-timer-danger {
        background: rgba(220,53,69,0.3); /* vermelho suave */
    }

    .session-timer-badge .bi {
        font-size: 1rem;
        margin-right: .35rem;
        line-height: 1;
        display: inline-block;
        transform: translateY(1px);
    }

/* ==== impresso seletiva in-place ==== */
/* [PDF DEBUG v9] COMENTADO: estado base oculto da área de impressão

#__print_area__ {
    display: none;
}

    
*/
/* === PDF capture (modo tela) === */
    #__print_area__.pdf-capture .print-header,
/* [PDF DEBUG v9] COMENTADO: habilitação de header/rodapé na captura (temporário)

    #__print_area__.pdf-capture .print-footer {
        display: block !important;
    }
*/

/* [PDF DEBUG v9] COMENTADO: habilitação de header/rodapé na captura (temporário)


    #__print_area__.pdf-capture .print-header {
        display: flex !important;
    }
*/


/* [PDF DEBUG v9] COMENTADO INTEIRO: BLOCO @media print QUE ESCONDIA TUDO EXCETO #__print_area__
@media print {
    body > *:not(#__print_area__) {
        display: none !important;
    }

    #__print_area__ {
        display: block !important;
    }
*/

        /* cabealho fixo no topo */
        #__print_area__ .print-header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            display: flex !important;
            align-items: center;
            gap: 12px;
            padding: 10mm 10mm 6mm 10mm;
            border-bottom: 1px solid #ddd;
            background: #fff !important;
            z-index: 1000;
        }

            #__print_area__ .print-header img {
                height: 24mm;
                width: auto;
            }

            #__print_area__ .print-header .title {
                font-weight: 700;
                font-size: 18px;
            }

        /* corpo com offset do cabealho e rodap */
        #__print_area__ .print-body {
            margin-top: 42mm;
            margin-bottom: 20mm;
            padding: 0 10mm;
            background: #fff !important;
        }

        /* rodap fixo no fim */
        #__print_area__ .print-footer {
            position: fixed;
            left: 0;
            right: 0;
            bottom: 0;
            padding: 4mm 10mm 6mm 10mm;
            border-top: 1px solid #ddd;
            background: #fff !important;
            font-size: 12px;
            color: #444;
            display: flex !important;
            align-items: center;
            justify-content: space-between;
            z-index: 1000;
        }

        /* zebra bsica p/ tabelas */
        #__print_area__ table tbody tr:nth-child(odd) {
            background: #fafafa;
        }

        /* esconder ltima coluna (aes) somente na impresso/PDF */
        /* tela principal */
        #__print_area__ #tbl-ciot th:last-child,
        #__print_area__ #tbl-ciot td:last-child {
            display: none !important;
        }

        /* modal de lista por empresa */
        #__print_area__ #tbl-ciot-modal th:last-child,
        #__print_area__ #tbl-ciot-modal td:last-child {
            display: none !important;
        }
}

/* quando NO estiver imprimindo, mantenha o rodap invisvel */
#__print_area__ .print-footer {
    display: none;
}

/* redundncia intencional para garantir estado inicial */
/* [PDF DEBUG v9] COMENTADO: estado base oculto da área de impressão

#__print_area__ {
    display: none;
}

    
*/
/* === Habilitar header/rodap durante a CAPTURA DO PDF (modo tela) === */
    #__print_area__.pdf-capture .print-header,
/* [PDF DEBUG v9] COMENTADO: habilitação de header/rodapé na captura (temporário)

    #__print_area__.pdf-capture .print-footer {
        display: block !important;
    }
*/

/* [PDF DEBUG v9] COMENTADO: habilitação de header/rodapé na captura (temporário)


    #__print_area__.pdf-capture .print-header {
        display: flex !important; /* preserva layout em flex */
    }
*/
