/* Estilos de Impressão Globais */
@media print {
    /* Ocultar TODOS os elementos por padrão */
    * {
        visibility: hidden !important;
    }
    
    /* Mostrar apenas o conteúdo da tabela e título */
    .table,
    .table *,
    .table th,
    .table td,
    .table thead,
    .table tbody,
    .table tr,
    .d-print-block,
    .d-print-block * {
        visibility: visible !important;
    }
    
    /* Ocultar TODOS os elementos de interface */
    .sidebar,
    .navbar,
    .mobile-header,
    .btn,
    .card-header,
    .card-footer,
    .filtros-ativos,
    .stats-cards,
    .alert,
    .toast-container,
    .loading-overlay,
    .dropdown,
    .nav,
    .breadcrumb,
    .d-flex.justify-content-between,
    .d-flex.gap-2,
    .d-flex.justify-content-center,
    .d-flex.align-items-center,
    .btn-primary,
    .btn-outline-secondary,
    .btn-secondary,
    .btn-success,
    .btn-danger,
    .btn-warning,
    .btn-info,
    .btn-light,
    .btn-dark,
    .btn-link,
    .form-control,
    .form-select,
    .form-label,
    .form-check,
    .form-check-input,
    .form-check-label,
    .input-group,
    .input-group-text,
    .modal,
    .modal-backdrop,
    .tooltip,
    .popover,
    .carousel,
    .accordion,
    .collapse,
    .tab-content,
    .nav-tabs,
    .nav-pills,
    .pagination,
    .page-link,
    .page-item,
    .list-group,
    .list-group-item,
    .card-group,
    .card-deck,
    .jumbotron,
    .progress,
    .progress-bar,
    .spinner-border,
    .spinner-grow,
    .badge-pill,
    .close,
    .sr-only,
    .visually-hidden,
    .no-print {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Configurações da página */
    @page {
        size: A4;
        margin: 2mm;
    }
    
    /* HTML e Body */
    html {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Container principal */
    body {
        font-size: 9px !important;
        line-height: 1.1 !important;
        color: #000 !important;
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
    }
    
    /* Container */
    .container-fluid {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .row {
        margin: 0 !important;
        width: 100% !important;
    }
    
    .col-12 {
        padding: 0 !important;
        width: 100% !important;
    }
    
    /* Card */
    .card {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        width: 100% !important;
    }
    
    .card-body {
        padding: 0 !important;
        width: 100% !important;
    }
    
    /* Título para impressão */
    .d-print-block {
        display: block !important;
    }
    
    .d-print-block h2 {
        font-size: 16px !important;
        font-weight: bold !important;
        margin-bottom: 8px !important;
        text-align: center !important;
        border-bottom: 1px solid #000 !important;
        padding-bottom: 5px !important;
    }
    
    .d-print-block p {
        text-align: center !important;
        margin-bottom: 10px !important;
        font-size: 10px !important;
    }
    
    /* Tabela */
    .table {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        border-collapse: collapse !important;
        font-size: 8px !important;
        margin-bottom: 0 !important;
        table-layout: fixed !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .table th,
    .table td {
        border: 1px solid #000 !important;
        padding: 1px 3px !important;
        text-align: left !important;
        vertical-align: top !important;
        word-wrap: break-word !important;
        line-height: 1.0 !important;
    }
    
    .table th {
        background-color: #f0f0f0 !important;
        font-weight: bold !important;
        font-size: 7px !important;
        padding: 2px 3px !important;
    }
    
    /* Table responsive */
    .table-responsive {
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }
    
    /* Forçar largura total da tabela */
    * {
        box-sizing: border-box !important;
        max-width: none !important;
    }
    
    /* Resetar todas as larguras */
    .container, .container-fluid, .row, .col, .col-12 {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
    }
    
    /* Forçar largura específica das colunas otimizada para máxima largura */
    .table th:nth-child(1), .table td:nth-child(1) { width: 6% !important; min-width: 6% !important; }  /* Foto */
    .table th:nth-child(2), .table td:nth-child(2) { width: 8% !important; min-width: 8% !important; } /* CIM */
    .table th:nth-child(3), .table td:nth-child(3) { width: 25% !important; min-width: 25% !important; } /* Nome */
    .table th:nth-child(4), .table td:nth-child(4) { width: 12% !important; min-width: 12% !important; } /* Grau */
    .table th:nth-child(5), .table td:nth-child(5) { width: 10% !important; min-width: 10% !important; } /* Situação */
    .table th:nth-child(6), .table td:nth-child(6) { width: 8% !important; min-width: 8% !important; }  /* Status */
    .table th:nth-child(7), .table td:nth-child(7) { width: 11% !important; min-width: 11% !important; } /* Data Nascimento */
    .table th:nth-child(8), .table td:nth-child(8) { width: 10% !important; min-width: 10% !important; } /* Data Iniciação */
    .table th:nth-child(9), .table td:nth-child(9) { width: 10% !important; min-width: 10% !important; } /* Data Óbito */
    
    /* Forçar largura total com transform */
    .table-responsive {
        transform: scaleX(1) !important;
        transform-origin: left top !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Override de qualquer largura máxima */
    .table, .table-responsive, .container-fluid, .row, .col-12 {
        max-width: none !important;
        width: 100% !important;
    }
    
    /* Garantir que a tabela ocupe toda a largura da página */
    .table {
        table-layout: fixed !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
    }
    
    /* Forçar que todas as colunas somem 100% */
    .table th, .table td {
        box-sizing: border-box !important;
    }
    
    /* Fotos dos obreiros */
    .obreiro-foto {
        width: 18px !important;
        height: 18px !important;
        border: 1px solid #000 !important;
    }
    
    /* Badges */
    .badge {
        font-size: 6px !important;
        padding: 1px 2px !important;
        border: 1px solid #000 !important;
        background-color: #f0f0f0 !important;
        color: #000 !important;
    }
    
    /* Nomes e apelidos */
    .obreiro-nome {
        font-weight: bold !important;
        font-size: 8px !important;
    }
    
    .obreiro-apelido {
        font-size: 7px !important;
        color: #666 !important;
    }
    
    /* Quebras de página */
    .table-responsive {
        page-break-inside: avoid !important;
    }
    
    /* Evitar quebras dentro das linhas da tabela */
    tr {
        page-break-inside: avoid !important;
    }
}
