:root {
    --blue: #007bff;
    --red: #dc3545;
    --green: #28a745;
    --cyan: #17a2b8;
    --white: #fff;
    --gray-dark: #343a40;
    --primary: #2A6DCF;
    --secondary: #005E7A;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-sans-serif);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: var(--white);
    width: 100%;
    overflow-x: hidden;
}

.cabecalho-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-image: url("../img/bg_top_principal.png");
    background-position: 0px 0px;
    background-repeat: no-repeat;
    background-size: cover;
    padding: 10px 20px;
    color: var(--white);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    min-height: 93px;
}

.esquerda {
    flex: 0 0 30%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.logo-tre {
    display: flex;
    align-items: center;
}

.logo-tre img {
    max-width: 70px;
    margin-right: 15px;
}

.texto-tre {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.texto-tre span:first-child {
    font-size: 1.2rem;
    line-height: 1.3;
}

.texto-tre span:last-child {
    font-size: 1.125rem;
    font-weight: bold;
    line-height: 1.2;
}

.centro {
    flex: 0 0 40%;
    text-align: center;
}

.titulo-principal {
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.2;
}

.direita {
    flex: 0 0 30%;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

footer {
    margin-top: 15px;
    text-align: center;
    color: #666;
    padding: 10px;
    font-size: 0.9rem;
}

.titulo-direita {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.3125rem;
}

.subtitulo-direita {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    line-height: 1.3;
}

.subtitulo-direita a {
    color: var(--white);
    text-decoration: underline;
}

.subtitulo-direita a:hover {
    text-decoration: none;
}

@media (max-width: 768px) {
    .cabecalho-container {
        flex-wrap: wrap;
        padding: 15px;
    }

    .esquerda {
        flex: 0 0 100%;
        justify-content: center;
        margin-bottom: 10px;
        order: 1;
    }

    .centro {
        flex: 0 0 100%;
        order: 3;
        margin-top: 10px;
        text-align: center;
    }

    .direita {
        flex: 0 0 100%;
        align-items: center;
        text-align: center;
        order: 2;
        margin-bottom: 10px;
    }

    .logo-tre img {
        max-width: 60px;
    }

    .titulo-principal {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .titulo-principal {
        font-size: 1.125rem;
    }

    .texto-tre span:first-child {
        font-size: 0.875rem;
    }

    .texto-tre span:last-child {
        font-size: 1rem;
    }

    .titulo-direita {
        font-size: 1rem;
    }

    .subtitulo-direita {
        font-size: 0.75rem;
    }
}

.container-fluid {
    margin-top: 100px;
    padding: 20px;
    width: 100%;
    max-width: 100%;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 20px;
    width: 99%;
}

.col-md-4,
.col-sm-12,
.col,
.col-md-6 {
    padding: 0 5px;
    width: 100%;
}

@media (min-width: 768px) {
    .col-md-4 {
        width: 33.333%;
    }

    .col-md-6 {
        width: 50%;
    }
}

.card {
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.3s ease;
    height: 100%;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-body {
    padding: 0.5rem;
}

.card-title {
    text-align: center;
    font-size: 1rem;
    color: #343a40;
    font-weight: 500;
}

.card-subtitle {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.title {
    font-size: 1.1rem;
    color: #343a40;
    font-weight: 500;
}

.subtitle {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.summary-card {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
    text-align: center;
    margin-top: 0.5rem;
}

.datas-card .card-body {
    padding: 0.5rem;
}

.data-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.data-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.data-label {
    font-weight: 600;
    color: #343a40;
    display: block;
    margin-bottom: 0.25rem;
}

.data-value {
    color: var(--primary);
    font-size: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background-color: var(--white);
    table-layout: auto;
}

th,
td {
    padding: 0.4rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
    white-space: nowrap;
}

th:nth-child(1),
td:nth-child(1) {
    min-width: 200px;
    white-space: normal;
}

th:nth-child(2),
td:nth-child(2),
th:nth-child(3),
td:nth-child(3),
th:nth-child(4),
td:nth-child(4),
th:nth-child(5),
td:nth-child(5),
th:nth-child(6),
td:nth-child(6),
th:nth-child(7),
td:nth-child(7) {
    min-width: 100px;
    text-align: center;
}

th {
    background-color: var(--secondary); 
    color: var(--white);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin-bottom: 0.5rem;
}

.search-container input {
    padding: 0.5rem 0.5rem 0.5rem 2.2rem;
    width: 100%;
    border-radius: 0.25rem;
    border: 1px solid var(--secondary);
    font-size: 0.875rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.search-container input:focus {
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.search-icon {
    position: absolute;
    left: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.error {
    color: var(--danger);
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--danger);
    border-radius: 0.25rem;
    margin: 1.25rem 0;
    background-color: #f8d7da;
    width: 100%;
}


/* Manter a ordenação clicável */
#municipios-table th {
    cursor: pointer;
    user-select: none;
    position: relative;
}

/* Indicador visual para links */
#municipios-table tbody tr:hover {
    background-color: #f8f9fa;
}

#municipios-table tbody tr:hover .link-municipio {
    background-color: #dce5f5;
}

.municipio-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.municipio-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.municipio-header .codigo {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .municipio-header h1 {
        font-size: 20px;
    }
    
    .table-responsive {
        font-size: 14px;
    }
}


ul {
    margin: 0.625rem 0;
    padding-left: 1.25rem;
    list-style-type: none;
}

ul li {
    margin: 0.3125rem 0;
    position: relative;
    padding-left: 1.25rem;
}

ul li:before {
    content: "?";
    color: var(--primary);
    font-size: 1.2rem;
    position: absolute;
    left: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

a:hover {
    text-decoration: underline;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}

.pagination-info {
    margin: 0 1rem;
    color: #6c757d;
    font-size: 0.875rem;
}

.page-numbers {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.page-item {
    margin: 0 0.25rem;
}

.page-link {
    display: block;
    padding: 0.375rem 0.75rem;
    color: var(--secondary);
    background-color: var(--white);
    border: 1px solid #e0e0e0;
    border-radius: 0.25rem;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    min-width: 2.5rem;
    text-align: center;
}

.page-link:hover {
    color: #0056b3;
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.page-item.active .page-link {
    color: var(--white);
    background-color: var(--secondary);
    border-color: var(--primary);
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: var(--white);
    border-color: #e0e0e0;
}

.page-size-selector {
    display: flex;
    align-items: center;
    margin-left: 1rem;
    gap: 0.5rem;
}

.page-size-selector select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 0.25rem;
    background-color: var(--white);
}

@media (min-width: 1200px) {
    .container-fluid {
        padding: 0 40px;
    }

    th:nth-child(1),
    td:nth-child(1) {
        min-width: 250px;
    }
}

@media (min-width: 1400px) {
    .container-fluid {
        padding: 0 20px;
    }
}

@media (min-width: 1600px) {
    .container-fluid {
        padding: 0 40px;
    }
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

.p-3 {
    padding: 1rem;
}

.w-100 {
    width: 100%;
}