/* your styles go here */

/* Destacar campos obrigatórios */
label span.text-danger {
    font-size: 1.2em;
    vertical-align: middle;
    margin-left: 3px;
}

/* Campos de formulário mais amigáveis */
.form-control-lg,
.form-select-lg {
    font-size: 1.1rem;
    padding: 0.7rem 1rem;
}

/* Texto de ajuda */
.form-text {
    color: #6c757d;
    font-style: italic;
    margin-top: 0.25rem;
}

@media (max-width: 767px) {
    .table-responsive .dropdown-menu {
        position: static !important;
    }
}

@media (min-width: 768px) {
    .table-responsive {
        overflow: visible;
    }
}

/* 1. Todo painel de aba deve sumir por padrão */
.tab-content>.tab-pane {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* 2. O painel ativo deve aparecer */
.tab-content>.active {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    overflow: visible !important;
}

/* 3. Correção para animação Fade (se estiver usando) */
.tab-content>.tab-pane.fade {
    opacity: 0;
    transition: opacity .15s linear;
}

.tab-content>.tab-pane.fade.show {
    opacity: 1;
}


.fade:not(.show) {
    opacity: 0;
    visibility: hidden;
    height: 0;
}

/* ============================================================
   PRINT STYLES — Relatórios (documento oficial)
   ============================================================ */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body {
        background: #fff !important;
        font-size: 10pt;
        margin: 10mm;
    }

    /* Esconder navegação, sidebar, botões e filtros */
    .navbar,
    .sidebar,
    footer,
    .btn,
    .btn-group,
    form,
    .pagination,
    .page-header,
    .alert,
    .d-flex .btn-danger,
    [class*="sidebar"],
    [class*="navbar"],
    [class*="menu"],
    [class*="nav"],
    .report-filter-card,
    .essential-filters,
    .common-filters,
    .filter-form {
        display: none !important;
    }

    /* Remover layout de sidebar para ocupar página inteira */
    .d-flex.align-items-stretch {
        display: block !important;
    }

    .page-holder {
        background: #fff !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .container-fluid {
        padding: 0 !important;
        max-width: 100% !important;
    }

    /* Cabeçalho oficial (logo + timbre) */
    .print-header {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 15px;
        text-align: center;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
        margin-bottom: 15px;
    }

    .print-header img {
        max-height: 60px;
    }

    .print-header-text {
        text-align: center;
    }

    .print-header-text h1 {
        font-size: 14pt;
        font-weight: bold;
        margin: 0;
        text-transform: uppercase;
    }

    .print-header-text h2 {
        font-size: 11pt;
        font-weight: bold;
        margin: 2px 0;
    }

    .print-header-text h3 {
        font-size: 10pt;
        margin: 2px 0;
        font-weight: normal;
    }

    /* Filtros aplicados */
    .print-filters {
        font-size: 8pt;
        margin-bottom: 10px;
        padding: 5px 8px;
        background-color: #f5f5f5 !important;
        border: 1px solid #ddd;
    }

    .print-filters p {
        margin: 2px 0;
    }

    /* Tabelas com estilo oficial */
    .table {
        width: 100%;
        border-collapse: collapse;
        font-size: 9pt;
    }

    .table th,
    .table td {
        border: 1px solid #333 !important;
        padding: 4px 6px;
        vertical-align: top;
    }

    .table thead th,
    .table thead tr {
        background-color: #e0e0e0 !important;
        font-weight: bold;
        text-transform: uppercase;
        font-size: 8pt;
    }

    .table tfoot td,
    .table .table-light td {
        background-color: #f0f0f0 !important;
        font-weight: bold;
    }

    .table-hover tbody tr:hover {
        background-color: transparent !important;
    }

    .table tbody tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Esconder coluna de ações na impressão */
    /*.table th:last-child,
    .table td:last-child {
        display: none !important;
    }*/

    /* Garantir que células com múltiplas linhas não quebrem */
    .table td small,
    .table td .small {
        display: block;
        font-size: 7pt;
        line-height: 1.2;
    }

    /* Cards de agrupamento (por fornecedor, secretaria, período) */
    .card {
        border: 1px solid #333 !important;
        margin-bottom: 10px;
        box-shadow: none !important;
    }

    .card-header {
        background-color: #e0e0e0 !important;
        border-bottom: 1px solid #333 !important;
        padding: 6px 10px;
    }

    .card-header h5 {
        font-size: 10pt;
        font-weight: bold;
    }

    .card-header .badge {
        background-color: #666 !important;
        color: #fff !important;
    }

    /* Total geral */
    .card.bg-primary {
        background-color: #333 !important;
        color: #fff !important;
        border-color: #000 !important;
    }

    .card.bg-primary .card-body {
        padding: 8px 12px;
    }

    /* Badges de status */
    .badge {
        border: 1px solid #333 !important;
        padding: 2px 6px;
    }

    .bg-success { background-color: #28a745 !important; color: #fff !important; }
    .bg-danger { background-color: #dc3545 !important; color: #fff !important; }
    .bg-warning { background-color: #ffc107 !important; color: #000 !important; }
    .bg-info { background-color: #17a2b8 !important; color: #fff !important; }
    .bg-secondary { background-color: #6c757d !important; color: #fff !important; }

    /* Rodapé de impressão */
    .print-footer {
        display: block !important;
        text-align: center;
        font-size: 8pt;
        border-top: 1px solid #999;
        padding-top: 5px;
        margin-top: 15px;
        color: #666;
    }

    /* Utilitários */
    .text-end { text-align: right !important; }
    .text-center { text-align: center !important; }
    .fw-bold, .fw-semibold { font-weight: bold !important; }
    .text-primary { color: #000 !important; }
    .text-dark { color: #000 !important; }
    .text-muted { color: #666 !important; }

    /* Remover sombras e bordas arredondadas */
    .shadow-sm,
    .shadow,
    .border-0,
    .rounded-pill {
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    /* Esconder links decorativos */
    a.text-decoration-none {
        text-decoration: none !important;
        color: #000 !important;
    }
}

/* Ocultar elementos de impressão na tela */
.print-header,
.print-filters,
.print-footer {
    display: none;
}
