/* ============================================
   CONSULTAR LICITAÇÃO - Estilo Refatorado
   ============================================ */

/* ============================================
   Page Container
   ============================================ */
.page-container {
    padding: 24px;
    max-width: 1800px;
    margin: 0 auto;
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 24px;
    color: white;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.page-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-header-icon {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: white;
}

.page-header-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.btn-novo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    color: #1e3a5f;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-novo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-novo ion-icon {
    font-size: 18px;
}

/* ============================================
   Filters Card
   ============================================ */
.filters-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.filters-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.filters-title ion-icon {
    font-size: 18px;
    color: #3b82f6;
}

.btn-clear-filters {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-filters:hover {
    background: #f1f5f9;
    color: #475569;
}

.filters-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 16px;
    align-items: end;
}

.filters-grid-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: end;
    margin-top: 16px;
    max-width: 500px;
}

/* ============================================
   Form Controls
   ============================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-label ion-icon {
    font-size: 14px;
    color: #94a3b8;
}

.form-control {
    width: 100%;
    height: 44px;
    padding: 10px 14px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    color: #334155;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    background-color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
    color: #94a3b8;
}

/* ============================================
   Select2 - CORREÇÃO COMPLETA
   ============================================ */
.form-group .select2-container {
    width: 100% !important;
}

.form-group .select2-container--default .select2-selection--single {
    height: 44px !important;
    padding: 6px 12px !important;
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
}

.form-group .select2-container--default.select2-container--focus .select2-selection--single,
.form-group .select2-container--default.select2-container--open .select2-selection--single {
    background-color: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    outline: none !important;
}

.form-group .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #334155 !important;
    font-size: 13px !important;
    line-height: 30px !important;
    padding-left: 0 !important;
    padding-right: 30px !important;
}

.form-group .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #94a3b8 !important;
}

.form-group .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px !important;
    right: 8px !important;
    top: 0 !important;
}

.form-group .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #64748b transparent transparent transparent !important;
    border-width: 5px 4px 0 4px !important;
}

/* Dropdown do Select2 */
.select2-dropdown {
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
    margin-top: 4px !important;
    overflow: hidden !important;
    z-index: 9999 !important;
}

.select2-container--default .select2-search--dropdown {
    padding: 8px !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    padding: 10px 14px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    outline: none !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #3b82f6 !important;
}

.select2-container--default .select2-results__option {
    padding: 10px 14px !important;
    font-size: 13px !important;
    color: #334155 !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #eff6ff !important;
    color: #3b82f6 !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #3b82f6 !important;
    color: white !important;
}

.select2-results__options {
    max-height: 250px !important;
}

/* ============================================
   Radio Group para Filtros de Status
   ============================================ */
.radio-group {
    display: inline-flex;
    gap: 2px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    align-items: center;
    flex-wrap: nowrap;
    /* Impede quebra de linha */
}

.radio-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    /* Impede encolhimento */
}

.radio-item input[type="radio"] {
    display: none;
}

.radio-item .radio-label {
    padding: 8px 10px;
    /* Padding menor para caber */
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.radio-item input[type="radio"]:checked+.radio-label {
    background: white;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.radio-item:hover .radio-label {
    color: #1e293b;
}

/* Responsive - Em telas menores, permite scroll horizontal */
@media (max-width: 768px) {
    .radio-group {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .radio-item .radio-label {
        padding: 6px 8px;
        font-size: 11px;
    }
}

/* ============================================
   View Toggle (versão geral - fallback)
   ============================================ */
.view-toggle {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
}

.view-toggle button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle button.active {
    background: white;
    color: #3b82f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.view-toggle button:hover:not(.active) {
    color: #1e293b;
}

.view-toggle button ion-icon {
    font-size: 18px;
}

/* ============================================
   Tabela de Dados
   ============================================ */
.table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.table-info {
    font-size: 13px;
    color: #64748b;
}

.table-info strong {
    color: #1e293b;
}

.table-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 14px 16px;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: #334155;
    vertical-align: middle;
}

.data-table td:first-child {
    font-size: 12px;
    white-space: nowrap;
    max-width: 120px;
}

.data-table tbody tr {
    transition: background 0.15s ease;
    cursor: pointer;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr.encerrado {
    background: #f1f5f9;
}

.data-table tbody tr.suspenso {
    background: #fef3c7;
}

/* ============================================
   Badges de Status
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Status badges */
.badge-andamento {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #86efac;
}

.badge-encerrado {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    border: 1px solid #cbd5e1;
}

.badge-suspenso {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.badge-rascunho {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #3730a3;
    border: 1px solid #a5b4fc;
}

/* ============================================
   Badges de Tipo - Cores por categoria
   ============================================ */
.badge-tipo {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cores específicas por tipo */
.badge-tipo.pregao {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.badge-tipo.licitacao {
    background: linear-gradient(135deg, #fae8ff 0%, #f5d0fe 100%);
    color: #86198f;
    border: 1px solid #e879f9;
}

.badge-tipo.dispensa {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    color: #c2410c;
    border: 1px solid #fdba74;
}

.badge-tipo.concorrencia {
    background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%);
    color: #0f766e;
    border: 1px solid #5eead4;
}

.badge-tipo.credenciamento {
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
    color: #a16207;
    border: 1px solid #fde047;
}

.badge-tipo.leilao {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.badge-tipo.default {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    border: 1px solid #cbd5e1;
}

/* ============================================
   Ações da Tabela
   ============================================ */
.acoes-cell {
    display: grid;
    grid-template-columns: repeat(3, 32px);
    gap: 6px;
    justify-content: start;
}

.btn-acao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-acao.visualizar {
    background: #eff6ff;
    color: #3b82f6;
}

.btn-acao.visualizar:hover {
    background: #dbeafe;
}

.btn-acao.editar {
    background: #fef3c7;
    color: #d97706;
}

.btn-acao.editar:hover {
    background: #fde68a;
}

.btn-acao.excluir {
    background: #fee2e2;
    color: #dc2626;
}

.btn-acao.excluir:hover {
    background: #fecaca;
}

.btn-acao.notificar {
    background: #f3e8ff;
    color: #7c3aed;
}

.btn-acao.notificar:hover {
    background: #e9d5ff;
}

.btn-acao.notificar.active {
    background: #7c3aed;
    color: white;
}

/* ============================================
   Cards View
   ============================================ */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
    padding: 24px;
}

.licitacao-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    cursor: pointer;
}

.licitacao-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.card-header-left {
    display: flex;
    gap: 12px;
}

.card-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.card-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.card-subtitle {
    font-size: 12px;
    color: #64748b;
}

.card-body {
    padding: 16px 20px;
    flex: 1;
}

.card-info-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}

.card-info-row:last-child {
    border-bottom: none;
}

.card-info-row ion-icon {
    color: #94a3b8;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.card-info-label {
    color: #64748b;
    font-weight: 500;
    flex-shrink: 0;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
    margin-top: auto;
}

.card-footer-actions {
    display: flex;
    gap: 8px;
}

/* ============================================
   Paginação
   ============================================ */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
}

.pagination-info {
    font-size: 13px;
    color: #64748b;
}

.pagination {
    display: flex;
    gap: 4px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
}

.pagination button.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Loading e Empty States
   ============================================ */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state ion-icon {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 16px;
    color: #475569;
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 13px;
    margin: 0;
}

/* ============================================
   Toast System
   ============================================ */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 400px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.toast.sucesso {
    border-left: 4px solid #10b981;
}

.toast.sucesso .toast-icon {
    color: #10b981;
}

.toast.erro {
    border-left: 4px solid #ef4444;
}

.toast.erro .toast-icon {
    color: #ef4444;
}

.toast.alerta {
    border-left: 4px solid #f59e0b;
}

.toast.alerta .toast-icon {
    color: #f59e0b;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

.toast.info .toast-icon {
    color: #3b82f6;
}

.toast-content {
    flex: 1;
}

.toast-message {
    margin: 0;
    font-size: 14px;
    color: #1e293b;
}

.toast-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 18px;
}

.toast-close:hover {
    color: #475569;
}

/* ============================================
   Ocultar visualizações
   ============================================ */
.view-cards,
.view-table {
    display: none;
}

.view-cards.active,
.view-table.active {
    display: block;
}

/* ============================================
   Responsivo
   ============================================ */
@media (max-width: 1200px) {
    .filters-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filters-grid-row2 {
        grid-template-columns: 1fr 1fr;
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    .filters-grid {
        grid-template-columns: 1fr;
    }

    .filters-grid-row2 {
        grid-template-columns: 1fr 1fr;
        max-width: 100%;
    }

    .radio-group {
        flex-wrap: wrap;
        height: auto;
        padding: 8px;
    }

    .cards-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-container {
        padding: 16px;
    }

    .page-header {
        padding: 20px;
    }

    .page-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .page-header-actions {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }

    /* Esconder toggle de visualização no mobile */
    .page-header .view-toggle {
        display: none !important;
    }

    .btn-novo {
        width: 100%;
        justify-content: center;
    }

    .filters-card {
        padding: 16px;
    }

    .filters-grid,
    .filters-grid-row2 {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .table-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .pagination-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }

    /* Forçar modo cards no mobile */
    .view-cards {
        display: block !important;
    }

    .view-table {
        display: none !important;
    }

    .cards-container {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Notification Indicator - Ícone de Notificação
   Adicionar no licitacao.css
   ============================================ */

/* Indicador de notificação */
.notification-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 14px;
    margin-left: 8px;
    cursor: help;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* Usuário inscrito - sino preenchido azul */
.notification-indicator.subscribed {
    background: #dbeafe;
    color: #2563eb;
}

.notification-indicator.subscribed:hover {
    background: #bfdbfe;
    transform: scale(1.1);
}

/* Disponível mas não inscrito - sino outline cinza */
.notification-indicator.available {
    background: #f1f5f9;
    color: #94a3b8;
}

.notification-indicator.available:hover {
    background: #e2e8f0;
    color: #64748b;
}

/* Para o card - título com ícone */
.card-title-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Para a tabela - código com ícone */
.codigo-cell {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Animação de sino para inscrito */
@keyframes bellRing {

    0%,
    100% {
        transform: rotate(0);
    }

    10%,
    30%,
    50% {
        transform: rotate(-10deg);
    }

    20%,
    40% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(0);
    }
}

.notification-indicator.subscribed:hover ion-icon {
    animation: bellRing 0.6s ease;
}

/* Tooltip customizado (opcional) */
.notification-indicator[title] {
    position: relative;
}

/* Responsivo */
@media (max-width: 768px) {
    .notification-indicator {
        width: 20px;
        height: 20px;
        font-size: 12px;
        margin-left: 6px;
    }
}

/* ============================================
   Notification Button - Botão de Notificação
   Adicionar no licitacao.css
   ============================================ */

/* Botão de notificação nas ações */
.btn-acao.notificacao {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

/* Usuário inscrito - sino preenchido azul */
.btn-acao.notificacao.subscribed {
    background: #dbeafe;
    color: #2563eb;
}

.btn-acao.notificacao.subscribed:hover {
    background: #bfdbfe;
    transform: scale(1.1);
}

/* Disponível mas não inscrito - sino outline cinza */
.btn-acao.notificacao.available {
    background: #f1f5f9;
    color: #94a3b8;
}

.btn-acao.notificacao.available:hover {
    background: #e2e8f0;
    color: #64748b;
}

/* Ícone dentro do botão */
.btn-acao.notificacao ion-icon {
    font-size: 18px;
}

/* Animação de sino para inscrito */
@keyframes bellRing {

    0%,
    100% {
        transform: rotate(0);
    }

    10%,
    30%,
    50% {
        transform: rotate(-10deg);
    }

    20%,
    40% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(0);
    }
}

.btn-acao.notificacao.subscribed:hover ion-icon {
    animation: bellRing 0.6s ease;
}

/* Estado disabled durante requisição */
.btn-acao.notificacao:disabled {
    cursor: wait;
}

/* Responsivo */
@media (max-width: 768px) {
    .btn-acao.notificacao {
        width: 28px;
        height: 28px;
    }

    .btn-acao.notificacao ion-icon {
        font-size: 16px;
    }
}

/* ============================================
   HEADER PROFISSIONAL - Consulta de Licitações
   ============================================
   Substituir/adicionar ao licitacao.css
   Mantém compatibilidade com o design system existente
   ============================================ */

/* ============================================
   Header Principal - Layout Profissional
   ============================================ */
.page-header-pro {
    background: linear-gradient(135deg, #0f2847 0%, #1e3a5f 35%, #2d5a87 70%, #1a4a72 100%);
    border-radius: 20px;
    padding: 0;
    margin-bottom: 24px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 4px 6px -1px rgba(15, 40, 71, 0.12),
        0 10px 20px -5px rgba(15, 40, 71, 0.08);
}

/* ============================================
   Elementos Decorativos
   ============================================ */
.header-decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
}

.decoration-circle-1 {
    width: 350px;
    height: 350px;
    top: -160px;
    right: -60px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
}

.decoration-circle-2 {
    width: 200px;
    height: 200px;
    bottom: -80px;
    left: 10%;
    background: radial-gradient(circle, rgba(147, 197, 253, 0.08) 0%, transparent 70%);
}

.decoration-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(96, 165, 250, 0.4) 20%,
            rgba(147, 197, 253, 0.6) 50%,
            rgba(96, 165, 250, 0.4) 80%,
            transparent 100%);
}

/* Padrão sutil de grid no fundo */
.page-header-pro::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
}

/* ============================================
   Linha Superior - Breadcrumb + Data
   ============================================ */
.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px 0 32px;
    position: relative;
    z-index: 1;
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.header-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.2s ease;
}

.header-breadcrumb a:hover {
    color: rgba(255, 255, 255, 0.85);
}

.header-breadcrumb a ion-icon {
    font-size: 14px;
}

.breadcrumb-sep {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
}

.header-breadcrumb span {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}

.header-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* ============================================
   Linha Principal - Ícone + Título + Ações
   ============================================ */
.header-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 32px 24px 32px;
    position: relative;
    z-index: 1;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Ícone com pulso animado */
.header-icon-box {
    position: relative;
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #93c5fd;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.icon-box-pulse {
    position: absolute;
    inset: -3px;
    border-radius: 16px;
    border: 2px solid rgba(147, 197, 253, 0.2);
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        opacity: 0;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Título */
.header-title-group h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: white;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.header-subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
    font-weight: 400;
}

.header-subtitle ion-icon {
    font-size: 14px;
    color: rgba(147, 197, 253, 0.6);
}

/* Ações à direita */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================
   FIX: Hover dos botões no header claro
   ============================================
   Adicionar ao licitacao.css (ou ao licitacao_header_light.css)
   
   O problema: os estilos antigos do .page-header (tema escuro)
   aplicam color: white no hover, que fica invisível no fundo branco.
   
   Este fix garante que .page-header-pro use cores escuras.
   ============================================ */

/* --- View Toggle --- */
.page-header-pro .view-toggle {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.page-header-pro .view-toggle button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.25s ease;
}

.page-header-pro .view-toggle button.active {
    background: #ffffff !important;
    color: #1e3a5f !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.page-header-pro .view-toggle button:hover:not(.active) {
    color: #334155 !important;
    background: #e2e8f0 !important;
}

.page-header-pro .view-toggle button ion-icon {
    font-size: 18px;
}

/* --- Botão Nova Licitação --- */
.page-header-pro .btn-novo-pro {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%) !important;
    color: #ffffff !important;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.2);
    letter-spacing: 0.01em;
}

.page-header-pro .btn-novo-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 58, 95, 0.3);
    background: linear-gradient(135deg, #162d4a 0%, #244a73 100%) !important;
    color: #ffffff !important;
}

.page-header-pro .btn-novo-pro ion-icon {
    font-size: 18px;
    color: #93c5fd;
}

/* --- Esconder toggle no mobile --- */
@media (max-width: 768px) {
    .page-header-pro .view-toggle {
        display: none !important;
    }
}

/* Botão Nova Licitação - Profissional */
.btn-novo-pro {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: white;
    color: #1e3a5f;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.01em;
}

.btn-novo-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    background: #f8fafc;
}

.btn-novo-pro:active {
    transform: translateY(0);
}

.btn-novo-pro ion-icon {
    font-size: 18px;
    color: #3b82f6;
}

/* ============================================
   Barra de Estatísticas
   ============================================ */
.header-stats-bar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 32px;
    margin: 0;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
}

.stat-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    transition: background 0.2s ease;
    cursor: default;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.stat-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-icon-total {
    background: rgba(147, 197, 253, 0.15);
    color: #93c5fd;
}

.stat-icon-andamento {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

.stat-icon-encerrado {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.stat-icon-suspenso {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.stat-number {
    font-size: 20px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Animação de contagem */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-number.loaded {
    animation: countUp 0.4s ease-out;
}

/* ============================================
   Responsivo
   ============================================ */
@media (max-width: 1024px) {
    .header-stats-bar {
        flex-wrap: wrap;
    }

    .stat-item {
        flex: 1 1 calc(50% - 1px);
        min-width: 0;
    }

    .stat-divider:nth-child(4) {
        display: none;
    }

    .stat-item:nth-child(5),
    .stat-item:nth-child(7) {
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }
}

@media (max-width: 768px) {
    .page-header-pro {
        border-radius: 14px;
    }

    .header-top-row {
        padding: 12px 20px 0 20px;
    }

    .header-date {
        display: none;
    }

    .header-main-row {
        padding: 16px 20px 20px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .header-icon-box {
        width: 48px;
        height: 48px;
        font-size: 22px;
        border-radius: 12px;
    }

    .header-title-group h1 {
        font-size: 20px;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    /* Esconder toggle no mobile */
    .page-header-pro .view-toggle {
        display: none;
    }

    .btn-novo-pro {
        width: 100%;
        justify-content: center;
    }

    .header-stats-bar {
        padding: 0 16px;
        flex-wrap: wrap;
    }

    .stat-item {
        flex: 1 1 calc(50% - 1px);
        padding: 12px 14px;
        gap: 10px;
    }

    .stat-divider {
        height: 28px;
    }

    /* Esconder divisores ímpares e adicionar borda no mobile */
    .stat-divider:nth-child(4) {
        display: none;
    }

    .stat-number {
        font-size: 18px;
    }

    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .header-top-row {
        padding: 10px 16px 0 16px;
    }

    .header-main-row {
        padding: 14px 16px 16px 16px;
    }

    .header-left {
        gap: 14px;
    }

    .header-title-group h1 {
        font-size: 18px;
    }

    .header-subtitle {
        font-size: 12px;
    }

    .stat-item {
        padding: 10px 12px;
    }

    .stat-number {
        font-size: 16px;
    }

    .stat-label {
        font-size: 10px;
    }
}

/* ============================================
   BLOCO UNIFICADO: Header + Stats + Filtros
   Substituir/adicionar ao licitacao.css
   ============================================ */

/* ============================================
   Container Unificado
   ============================================ */
.page-header-unified {
    background: #ffffff;
    border-radius: 20px;
    padding: 0;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 4px 12px rgba(0, 0, 0, 0.03);
}

/* Linha de acento superior */
.page-header-unified::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
            #1e3a5f 0%,
            #3b82f6 40%,
            #60a5fa 60%,
            #2d5a87 100%);
    z-index: 2;
}

/* Padrão sutil de grid no fundo */
.page-header-unified::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   Decorações
   ============================================ */
.page-header-unified .header-decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.page-header-unified .decoration-circle-1 {
    position: absolute;
    width: 300px;
    height: 300px;
    top: -140px;
    right: -40px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.04) 0%, transparent 70%);
    border-radius: 50%;
}

.page-header-unified .decoration-circle-2 {
    position: absolute;
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: 5%;
    background: radial-gradient(circle, rgba(30, 58, 95, 0.03) 0%, transparent 70%);
    border-radius: 50%;
}

.page-header-unified .decoration-line {
    display: none; /* Já temos o ::before do container */
}

/* ============================================
   Top Row - Breadcrumb + Data
   ============================================ */
.page-header-unified .header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px 0 32px;
    position: relative;
    z-index: 1;
}

.page-header-unified .header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #94a3b8;
}

.page-header-unified .header-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.page-header-unified .header-breadcrumb a:hover {
    color: #3b82f6;
}

.page-header-unified .header-breadcrumb a ion-icon {
    font-size: 14px;
}

.page-header-unified .breadcrumb-sep {
    font-size: 10px;
    color: #cbd5e1;
}

.page-header-unified .header-breadcrumb > span {
    color: #64748b;
    font-weight: 500;
}

.page-header-unified .header-date {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* ============================================
   Main Row - Ícone + Título + Ações
   ============================================ */
.page-header-unified .header-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 32px 24px 32px;
    position: relative;
    z-index: 1;
}

.page-header-unified .header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.page-header-unified .header-icon-box {
    position: relative;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #2563eb;
    flex-shrink: 0;
}

.page-header-unified .icon-box-pulse {
    position: absolute;
    inset: -3px;
    border-radius: 16px;
    border: 2px solid rgba(59, 130, 246, 0.15);
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.page-header-unified .header-title-group h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #1e293b;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.page-header-unified .header-subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
    font-weight: 400;
}

.page-header-unified .header-subtitle ion-icon {
    font-size: 14px;
    color: #60a5fa;
}

/* Ações à direita */
.page-header-unified .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* View Toggle */
.page-header-unified .view-toggle {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.page-header-unified .view-toggle button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.25s ease;
}

.page-header-unified .view-toggle button.active {
    background: #ffffff;
    color: #1e3a5f;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.page-header-unified .view-toggle button:hover:not(.active) {
    color: #334155;
    background: #e2e8f0;
}

.page-header-unified .view-toggle button ion-icon {
    font-size: 18px;
}

/* Botão Nova Licitação */
.page-header-unified .btn-novo-pro {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.2);
    letter-spacing: 0.01em;
}

.page-header-unified .btn-novo-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 58, 95, 0.3);
    background: linear-gradient(135deg, #162d4a 0%, #244a73 100%);
    color: #ffffff;
}

.page-header-unified .btn-novo-pro ion-icon {
    font-size: 18px;
    color: #93c5fd;
}

/* ============================================
   Barra de Estatísticas
   ============================================ */
.page-header-unified .header-stats-bar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 32px;
    margin: 0;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    position: relative;
    z-index: 1;
}

.page-header-unified .stat-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    transition: background 0.2s ease;
    cursor: default;
}

.page-header-unified .stat-item:hover {
    background: rgba(59, 130, 246, 0.03);
}

.page-header-unified .stat-divider {
    width: 1px;
    height: 32px;
    background: #e2e8f0;
    flex-shrink: 0;
}

.page-header-unified .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.page-header-unified .stat-icon-total {
    background: #eff6ff;
    color: #3b82f6;
    border: 1px solid #dbeafe;
}

.page-header-unified .stat-icon-andamento {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.page-header-unified .stat-icon-encerrado {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.page-header-unified .stat-icon-suspenso {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.page-header-unified .stat-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.page-header-unified .stat-number {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.page-header-unified .stat-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header-unified .stat-number.loaded {
    animation: countUp 0.4s ease-out;
}

/* ============================================
   FILTROS INTEGRADOS (Seção colapsável)
   ============================================ */
.filters-section {
    border-top: 1px solid #e2e8f0;
    position: relative;
    z-index: 1;
}

.filters-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    cursor: default;
}

.filters-section .filters-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.filters-section .filters-title ion-icon {
    font-size: 18px;
    color: #3b82f6;
}

.filters-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filters-section .btn-clear-filters {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filters-section .btn-clear-filters:hover {
    background: #f1f5f9;
    color: #475569;
}

/* Botão Toggle Filtros */
.btn-toggle-filters {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-toggle-filters:hover {
    background: #e2e8f0;
    color: #334155;
}

.btn-toggle-filters ion-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

/* ============================================
   Corpo dos Filtros (animação de colapso)
   ============================================ */
.filters-body {
    padding: 0 32px 24px 32px;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    opacity: 1;
}

/* Estado colapsado */
.filters-section.collapsed .filters-body {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.filters-section.collapsed .btn-clear-filters {
    opacity: 0.5;
    pointer-events: none;
}

/* ============================================
   Resumo dos Filtros (quando recolhido)
   ============================================ */
.filters-summary {
    display: none;
    padding: 0 32px 16px 32px;
}

.filters-section.collapsed .filters-summary {
    display: block;
    animation: fadeIn 0.3s ease 0.15s both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.filters-summary-text {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 16px;
    line-height: 1.6;
}

.filters-summary-text ion-icon {
    font-size: 14px;
    color: #3b82f6;
    flex-shrink: 0;
}

.summary-separator {
    color: #cbd5e1;
    margin: 0 2px;
}

/* ============================================
   Grids de Filtros (dentro do body)
   ============================================ */
.filters-section .filters-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 16px;
    align-items: end;
}

.filters-section .filters-grid-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: end;
    margin-top: 16px;
    max-width: 500px;
}

/* ============================================
   Responsivo - Bloco Unificado
   ============================================ */
@media (max-width: 1024px) {
    .page-header-unified .header-stats-bar {
        flex-wrap: wrap;
    }

    .page-header-unified .stat-item {
        flex: 1 1 calc(50% - 1px);
        min-width: 0;
    }

    .page-header-unified .stat-divider:nth-child(4) {
        display: none;
    }
}

@media (max-width: 768px) {
    .page-header-unified {
        border-radius: 14px;
    }

    .page-header-unified .header-top-row {
        padding: 12px 20px 0 20px;
    }

    .page-header-unified .header-date {
        display: none;
    }

    .page-header-unified .header-main-row {
        padding: 16px 20px 20px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .page-header-unified .header-icon-box {
        width: 48px;
        height: 48px;
        font-size: 22px;
        border-radius: 12px;
    }

    .page-header-unified .header-title-group h1 {
        font-size: 20px;
    }

    .page-header-unified .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .page-header-unified .view-toggle {
        display: none !important;
    }

    .page-header-unified .btn-novo-pro {
        width: 100%;
        justify-content: center;
    }

    .page-header-unified .header-stats-bar {
        padding: 0 16px;
        flex-wrap: wrap;
    }

    .page-header-unified .stat-item {
        flex: 1 1 calc(50% - 1px);
        padding: 12px 14px;
        gap: 10px;
    }

    .page-header-unified .stat-divider {
        height: 28px;
    }

    .page-header-unified .stat-number {
        font-size: 18px;
    }

    .page-header-unified .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
        border-radius: 8px;
    }

    .filters-section-header {
        padding: 14px 20px;
    }

    .filters-body {
        padding: 0 20px 20px 20px;
    }

    .filters-summary {
        padding: 0 20px 14px 20px;
    }

    .filters-section .filters-grid {
        grid-template-columns: 1fr;
    }

    .filters-section .filters-grid-row2 {
        grid-template-columns: 1fr 1fr;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .page-header-unified .header-top-row {
        padding: 10px 16px 0 16px;
    }

    .page-header-unified .header-main-row {
        padding: 14px 16px 16px 16px;
    }

    .page-header-unified .header-left {
        gap: 14px;
    }

    .page-header-unified .header-title-group h1 {
        font-size: 18px;
    }

    .page-header-unified .header-subtitle {
        font-size: 12px;
    }

    .page-header-unified .stat-item {
        padding: 10px 12px;
    }

    .page-header-unified .stat-number {
        font-size: 16px;
    }

    .page-header-unified .stat-label {
        font-size: 10px;
    }

    .filters-section-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .filters-body {
        padding: 0 16px 16px 16px;
    }

    .filters-summary {
        padding: 0 16px 12px 16px;
    }

    .filters-section .filters-grid-row2 {
        grid-template-columns: 1fr;
    }
}