.datas-historicas-page {
    margin-top: 24px;
    margin-bottom: 44px;
}

.historicas-filtros-card {
    border: 1px solid #dce3ee;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.historicas-filtros {
    display: grid;
    grid-template-columns: repeat(7, minmax(110px, 1fr));
    gap: 12px;
    align-items: end;
}

.historicas-filtros .campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.historicas-filtros .campo-busca {
    grid-column: span 2;
}

.historicas-filtros label {
    font-size: 0.82rem;
    color: #475569;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.historicas-filtros input[type="text"],
.historicas-filtros select {
    height: 40px;
    border: 1px solid #cdd8ea;
    border-radius: 10px;
    padding: 0 11px;
    font-size: 0.92rem;
    color: #0f172a;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.historicas-filtros input[type="text"]:focus,
.historicas-filtros select:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.16);
}

.historicas-filtros .acoes {
    display: inline-flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.btn-light {
    background: #edf3ff;
    color: #1e3a8a;
}

.historicas-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.historicas-meta p {
    margin: 0;
    font-size: 0.83rem;
    line-height: 1.2;
    color: #334155;
    background: #f7f9fd;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 6px 10px;
}

.historicas-tabela-wrap {
    overflow: auto;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.historicas-tabela {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

.historicas-tabela thead th {
    text-align: left;
    padding: 11px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.79rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #334155;
    background: #f8fbff;
    position: sticky;
    top: 0;
    z-index: 1;
}

.historicas-tabela tbody td {
    padding: 10px 11px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: top;
    font-size: 0.9rem;
    color: #0f172a;
}

.historicas-tabela tbody tr:nth-child(2n) td {
    background: #fcfdff;
}

.historicas-tabela tbody tr:last-child td {
    border-bottom: 0;
}

.tag {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1e3a8a;
    font-size: 0.76rem;
    border: 1px solid #dbe7ff;
    white-space: nowrap;
}

.historicas-paginacao {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

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

    .historicas-filtros .campo-busca {
        grid-column: span 2;
    }

    .historicas-filtros .acoes {
        grid-column: span 2;
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    .historicas-filtros {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .historicas-filtros .campo-busca,
    .historicas-filtros .acoes {
        grid-column: auto;
    }

    .historicas-filtros .acoes {
        justify-content: stretch;
    }

    .historicas-filtros .acoes .btn-action {
        width: 100%;
    }

    .historicas-meta {
        gap: 6px;
    }

    .historicas-meta p {
        border-radius: 10px;
        width: 100%;
    }
}

body.dark-mode .historicas-filtros-card {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    border-color: #334155;
}

body.dark-mode .historicas-filtros label,
body.dark-mode .historicas-meta p {
    color: #cbd5e1;
}

body.dark-mode .historicas-filtros input[type="text"],
body.dark-mode .historicas-filtros select {
    background: #0b1220;
    color: #e2e8f0;
    border-color: #334155;
}

body.dark-mode .btn-light {
    background: #1e293b;
    color: #bfdbfe;
}

body.dark-mode .historicas-meta p {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .historicas-tabela-wrap {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .historicas-tabela thead th {
    background: #111827;
    border-bottom-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .historicas-tabela tbody td {
    border-bottom-color: #1f2937;
    color: #e5e7eb;
}

body.dark-mode .historicas-tabela tbody tr:nth-child(2n) td {
    background: #0b1323;
}

body.dark-mode .tag {
    background: #1e293b;
    color: #dbeafe;
    border-color: #334155;
}
