/* =================================================================== */
/* === ARQUIVO DE ESTILO PRINCIPAL - PORTAL DA TRANSPARÊNCIA === */
/* =================================================================== */


/* --- 1. ESTILOS GERAIS E COMPONENTES --- */

/* Botão de Download Personalizado */
.btn-baixar {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    color: #fff;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    background-color: #0d6efd;
    border: 1px solid #0d6efd;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.375rem;
    transition: background-color .15s ease-in-out;
}
.btn-baixar:hover {
    color: #fff;
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* --- 2. LAYOUT PRINCIPAL (CABEÇALHO E MENU) --- */

/* Cabeçalho Estilo Anexo 1 - Refinado */
.top-utility-bar-wrapper {
    background-color: #1a4d1a; /* Verde mais escuro conforme solicitado anteriormente */
    padding: 0.5rem 0; /* Um pouco mais alto para comportar os botões quadrados */
    font-family: 'Poppins', sans-serif;
}

.accessibility-label {
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    opacity: 0.95;
}

.acc-btn {
    background: transparent;
    border: 1.5px solid #fff;
    color: #fff;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 4px;
    border-radius: 4px; /* Leve arredondamento conforme imagem */
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.acc-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-1px);
}

.acc-btn i {
    font-size: 0.9rem;
}

.login-btn {
    border-color: rgba(255, 255, 255, 0.3); /* Menos destaque para o login */
    opacity: 0.8;
}

.login-btn:hover {
    border-color: #fff;
    opacity: 1;
}

.portal-main-banner {
    background-color: #2ca444; /* Verde principal */
    background-image: linear-gradient(180deg, #2ca444 0%, #248a39 100%);
    color: #fff;
    padding: 0.6rem 0; /* Reduzido de 2rem para compensar o aumento da logo */
    box-shadow: inset 0 -10px 15px rgba(0,0,0,0.05);
}

.portal-main-banner .prefeitura-logo-header {
    max-height: 154px; /* Aumentado em 40% de 110px */
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.portal-main-banner h1.portal-main-title {
    font-size: 3rem;
    font-weight: 800;
    color: #fff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.portal-main-banner .portal-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    font-weight: 400;
}


.banner-content .breadcrumb {
    background: rgba(0,0,0,0.1);
    display: inline-flex;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
}

.banner-content .breadcrumb-item, 
.banner-content .breadcrumb-item a {
    color: #fff !important;
    font-size: 0.85rem;
}

.banner-content .breadcrumb-item.active {
    font-weight: 700;
    opacity: 1;
}

/* Utilitários Pequenos */
.btn-xs {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* Menu Lateral (Sidebar) */
.sidebar {
    background-color: #f8f9fa; /* Fundo cinza claro */
    border-radius: 0;
    overflow-y: auto;           /* MODIFICADO: Permite a rolagem vertical quando necessário */
    margin-top: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    padding-top: 1.5rem;
}

/* Caixa de Busca no Menu */
.search-box {
    background-color: #3a7d0b; /* Fundo do pesquisar */
    padding: 1rem;
    color: white;
}
.search-box h5 {
    margin-bottom: 0.75rem;
}
.search-box .form-control {
    border-radius: 0.25rem 0 0 0.25rem;
    border: none;
}
.search-box .btn {
    border-radius: 0 0.25rem 0.25rem 0;
    background-color: #f8f9fa;
    color: #28a745;
    border: none;
}

/* Títulos e Links dentro do Menu */
.sidebar-heading {
    font-weight: bold;
    font-size: 1.1rem;
    color: #343a40;
    padding: 1rem 1rem 0.5rem 1rem;
}
.sidebar-menu {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}
.sidebar-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #495057;
    text-decoration: none;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease-in-out;
}
.sidebar-menu li:last-child a {
    border-bottom: none;
}
.sidebar-menu a:hover {
    background-color: #e9ecef;
}
.sidebar-menu a.active {
    background-color: #e9f5ea;
    color: #155724;
    font-weight: bold;
    position: relative;
}
.sidebar-menu a.active::after {
    content: '→';
    position: absolute;
    right: 1rem;
    font-weight: bold;
}

/* --- 3. CONTEÚDO PRINCIPAL --- */

/* Títulos na Área de Conteúdo */
main h1, main .h2, main .display-5 {
    color: #003366;
}

/* Lista de Cards Informativos */
.info-card-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.info-card {
    display: flex;
    align-items: center;
    position: relative; /* Essencial para o link estendido */
    padding: 1.5rem;
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}
.info-card .icon-container {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    margin-right: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dynamic-icon {
    width: 42px;
    height: 42px;
    background-color: var(--cor-principal, #2ca444); /* Fallback case precise */
    opacity: 0.15; /* Efeito de fundo translúcido como no print */
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    z-index: 1;
}

.dynamic-icon-text {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cor-principal, #2ca444);
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    position: relative;
    z-index: 2;
}

.info-card .text-container {
    flex-grow: 1;
}
.info-card .card-titulo {
    font-size: 1.25rem;
    font-weight: bold;
    color: #212529;
    margin-bottom: 0;
}
.info-card .card-subtitulo {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}
.info-card .favorite-icon {
    margin-left: 1.5rem;
    font-size: 1.0rem;
    color: #143064;
    position: relative;
    z-index: 2;
}
.info-card:hover .favorite-icon {
    color: #ffc107;
}


/* --- 4. ÁREA ADMINISTRATIVA E LAYOUT GERAL --- */

/* Barra de Navegação do Admin */
.navbar-admin {
    background-color: #003366;
}
.navbar-admin .navbar-brand,
.navbar-admin .nav-link {
    color: #ffffff;
}
.navbar-admin .nav-link:hover {
    color: #dddddd;
}

/* Espaçamento Lateral Personalizado */
.container-custom-padding {
    padding-left: 8rem;
    padding-right: 8rem;
}

/*
 * Portal público (padrão ESIC / sic.php):
 * container-fluid py-5
 * coluna menu: col-md-3 col-lg-2 d-none d-md-block px-0 ps-3 mb-4
 * conteúdo: col-md-9 ms-auto col-lg-10 px-md-5
 * Evite p-0 na coluna do menu — remove o gutter e cola o menu ao conteúdo.
 */

/* --- 5. ESTILOS DE TABELA PERSONALIZADA --- */

/* Estilo geral da tabela */
.table-custom {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.9rem;
}

/* Estilo para o cabeçalho da tabela com degradê e cantos arredondados */
.table-custom thead tr th {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 2px solid #dee2e6;
    font-weight: bold;
    font-size: 0.95rem;
    color: #343a40;
    background-color: #f8f9fa;
    background-image: linear-gradient(to bottom, #f8f9fa, #e9ecef);
    border: none;
}

/* Arredonda o canto superior esquerdo do PRIMEIRO item do cabeçalho */
.table-custom thead tr th:first-child {
    border-top-left-radius: 8px;
}

/* Arredonda o canto superior direito do ÚLTIMO item do cabeçalho */
.table-custom thead tr th:last-child {
    border-top-right-radius: 8px;
}

/* Estilo para as células do corpo da tabela */
.table-custom tbody tr td {
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef; /* Linha um pouco mais suave */
}

/* Remove a borda inferior da última linha da tabela */
.table-custom tbody tr:last-child td {
    border-bottom: none;
}

/* Cabeçalho de Tabela Antigo (mantido para compatibilidade) */
.thead-blue th {
    background-color: #f8f9fa;
    color: #212529;
    border-color: #dee2e6;
}


/* --- 8. Estilo do Rodapé --- */
footer {
    background-color: #2c5d0a; /* BARRA INFERIOR DO FOOTER */
    color: #F2F6FB;           /* Texto claro para contraste */
}

/* --- 9. Acessibilidade — Alto contraste (classe em html, ver js/acessibilidade.js) --- */

html.high-contrast,
html.high-contrast body {
    background-color: #000000 !important;
    color: #ffffff !important;
}

html.high-contrast .text-muted,
html.high-contrast small {
    color: #d0d0d0 !important;
}

html.high-contrast a {
    color: #ffff00 !important;
}

/* Cabeçalho público (barra utilitária + banner) */
html.high-contrast .top-utility-bar-wrapper,
html.high-contrast .portal-main-banner {
    background-color: #000000 !important;
    background-image: none !important;
    color: #ffffff !important;
}

html.high-contrast .portal-main-title,
html.high-contrast .portal-subtitle,
html.high-contrast .breadcrumb-utility,
html.high-contrast .breadcrumb-utility span,
html.high-contrast .breadcrumb-utility a {
    color: #ffffff !important;
}

html.high-contrast .accessibility-label {
    color: #ffffff !important;
}

/* Menu lateral (sidebar-v2 em menu.php) */
html.high-contrast .sidebar-v2,
html.high-contrast .sidebar {
    background-color: #0a0a0a !important;
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
    background-image: none !important;
}

html.high-contrast .sidebar-heading {
    color: #e0e0e0 !important;
}

html.high-contrast .menu-item {
    color: #ffffff !important;
}

html.high-contrast .menu-item:hover {
    background-color: #333333 !important;
    color: #ffff00 !important;
}

html.high-contrast .menu-item.active {
    background-color: #444444 !important;
    color: #ffff00 !important;
}

html.high-contrast .search-box {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
}

html.high-contrast .search-box h5 {
    color: #ffffff !important;
}

/* Cards e conteúdo */
html.high-contrast .card,
html.high-contrast .list-group-item,
html.high-contrast .table,
html.high-contrast .thead-blue th,
html.high-contrast .breadcrumb-item a,
html.high-contrast .page-header,
html.high-contrast footer,
html.high-contrast .table-dark th,
html.high-contrast .table-custom thead tr th {
    background-color: #111111 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
    background-image: none !important;
}

html.high-contrast .card-header,
html.high-contrast .card-body {
    background-color: #111111 !important;
    color: #ffffff !important;
}

html.high-contrast .btn-outline-secondary,
html.high-contrast .btn-outline-dark {
    color: #ffffff !important;
    border-color: #ffffff !important;
}

html.high-contrast .info-card {
    background-color: #222222 !important;
    border-color: #ffffff !important;
}

html.high-contrast .info-card:hover {
    background-color: #333333 !important;
}

html.high-contrast .form-control,
html.high-contrast .form-select {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

html.high-contrast .modal-content {
    background-color: #111111 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

/* --- ESTILO PARA A BARRA DE TÍTULO DA PREFEITURA --- */
.prefeitura-title-bar {
    background-color: #f8f9fa;
    padding: 0.5rem 1rem;
    text-align: center;
    font-weight: bold; /* ou 700 */
    color: #212529; /* CORRIGIDO: Cor escura para contrastar com o fundo claro */
    font-size: 0.9rem;
    border-bottom: 1px solid #dee2e6;
    font-family: 'Poppins', sans-serif; /* Adicionado para usar Poppins */
}