/* ============================================================
   Diário Oficial Eletrônico — Várzea Grande - MT
   Identidade visual replicando o site oficial da Prefeitura
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --verde: #006218;
    --verde-hover: #008c2a;
    --verde-escuro: #004d12;
    --amarelo-claro: #fffbe5;
    --amarelo: #e6e675;
    --verde-fundo: #e7f0eb;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f5f5;
    color: #212529;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.page-content {
    flex: 1;
}

/* === HEADER - estilo site oficial === */
.top-header {
    background: linear-gradient(90deg, #fffbe5 0%, #e6e675 100%);
    padding: 10px 0;
    border-bottom: 3px solid var(--verde);
}
.top-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.top-header .logo-area {
    display: flex;
    align-items: center;
    gap: 20px;
}
.top-header .logo-link { display: inline-flex; }
.top-header .logo-area img {
    max-width: 220px;
    height: auto;
}
.top-header .logo-area .logo-text {
    color: var(--verde);
    font-weight: 900;
    font-size: 18px;
    line-height: 1.3;
}
.top-header .logo-area .logo-text small {
    font-weight: normal;
    font-size: 13px;
    color: #333;
    display: block;
}

/* === MENU NAV === */
.nav-bar {
    background: var(--verde);
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.nav-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.nav-bar h1 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}
.nav-bar .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.nav-bar .nav-links a {
    color: #fff;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.2s;
}
.nav-bar .nav-links a:hover {
    background: rgba(255, 255, 255, 0.15);
}
.nav-bar .nav-links a.active {
    background: rgba(255, 255, 255, 0.22);
    font-weight: 700;
}

/* === STATS === */
.stats-bar {
    background: var(--verde-fundo);
    padding: 14px 24px;
    border-radius: 8px;
    margin: 24px 0 20px;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: center;
}
.stats-bar .stat {
    font-size: 14px;
    color: var(--verde);
    font-weight: 600;
}
.stats-bar .stat span { font-weight: normal; color: #333; }
.stats-bar .stat strong { color: var(--verde); }

/* === SEARCH === */
.search-box {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #d4d4d4;
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: Arial, Helvetica, sans-serif;
}
.search-box:focus {
    outline: none;
    border-color: var(--verde);
    box-shadow: 0 0 0 3px rgba(0, 98, 24, 0.15);
}
.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
    display: none;
}

/* === YEAR CARDS === */
.year-card {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}
.year-header {
    background: linear-gradient(135deg, var(--verde), var(--verde-hover));
    color: #fff;
    padding: 14px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    user-select: none;
}
.year-header:hover {
    background: linear-gradient(135deg, #007a1e, #00a332);
}
.year-header h2 { font-size: 20px; font-weight: 700; }
.year-header .arrow {
    font-size: 18px;
    transition: transform 0.3s;
    display: inline-block;
}
.year-header .arrow.open { transform: rotate(180deg); }
.year-body { padding: 16px 24px 24px; }

/* === MONTH GROUPS === */
.month-group { margin-bottom: 20px; }
.month-group:last-child { margin-bottom: 0; }
.month-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--verde);
    padding: 10px 14px;
    background: var(--verde-fundo);
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.month-title .count {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

/* === TABLES === */
.editions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.editions-table th {
    text-align: left;
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    color: #555;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}
.editions-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}
.editions-table tr:hover td { background: #f5faf6; }
.editions-table .numero { font-weight: 700; color: var(--verde); }
.editions-table a { color: var(--verde); font-weight: 600; text-decoration: none; }
.editions-table a:hover { color: var(--verde-hover); text-decoration: underline; }
.editions-table .acoes-col { white-space: nowrap; }

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}
.badge-dom { background: #d4edda; color: #155724; }
.badge-amm { background: #cce5ff; color: #004085; }
.badge-sup { background: #fff3cd; color: #856404; margin-left: 4px; }
.badge-extra { background: #f8d7da; color: #721c24; margin-left: 4px; }
.badge-tipo { background: #e2e3e5; color: #383d41; }

/* === PAGE HEADER (títulos internos) === */
.page-heading {
    margin: 24px 0 16px;
    color: var(--verde);
    font-size: 24px;
    font-weight: 800;
}
.page-subheading {
    color: #555;
    font-size: 14px;
    margin-bottom: 20px;
}

/* === BUTTONS === */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    font-family: Arial, Helvetica, sans-serif;
}
.btn-primary { background: var(--verde); color: #fff; }
.btn-primary:hover { background: var(--verde-hover); }
.btn-outline {
    background: #fff;
    color: var(--verde);
    border: 2px solid var(--verde);
}
.btn-outline:hover { background: var(--verde-fundo); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* === FORMS === */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #d4d4d4;
    border-radius: 6px;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
}
.form-control:focus {
    outline: none;
    border-color: var(--verde);
    box-shadow: 0 0 0 3px rgba(0, 98, 24, 0.15);
}
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.form-row .form-group { flex: 1; min-width: 160px; }
.form-row .form-group.search-term { flex: 2; }
select.form-control { cursor: pointer; }

/* === DETAIL (edição) === */
.edition-detail {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 16px;
}
.edition-detail .detail-header {
    background: linear-gradient(135deg, var(--verde), var(--verde-hover));
    color: #fff;
    padding: 22px 28px;
}
.edition-detail .detail-header h2 { font-size: 22px; }
.edition-detail .detail-header .meta { opacity: 0.9; font-size: 13px; margin-top: 6px; }
.edition-detail .detail-body { padding: 24px 28px; }
.edition-detail .detail-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.edition-detail .detail-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.edition-detail h3 {
    color: var(--verde);
    font-size: 16px;
    margin-bottom: 12px;
}
.hash-box {
    background: #f1f5f1;
    border: 1px dashed #b8d9c0;
    border-radius: 6px;
    padding: 12px 16px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    word-break: break-all;
    color: #333;
}
.hash-valid { color: var(--verde); font-weight: 700; }

.pdf-embed {
    width: 100%;
    height: 70vh;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
}

/* === MATÉRIAS === */
.matter-item {
    border: 1px solid #e6e6e6;
    border-left: 4px solid var(--verde);
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 12px;
    background: #fcfdfc;
}
.matter-item .matter-title { font-weight: 700; color: #212529; margin-bottom: 4px; }
.matter-item .matter-meta { font-size: 12px; color: #777; margin-bottom: 8px; }
.matter-item .matter-content {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    white-space: pre-line;
}
.matter-item .matter-number {
    font-weight: 700;
    color: var(--verde);
    font-size: 13px;
}

/* === VERIFY === */
.verify-result {
    border-radius: 8px;
    padding: 20px 24px;
    margin-top: 20px;
    font-size: 15px;
    line-height: 1.6;
}
.verify-result.ok {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}
.verify-result.fail {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}
.verify-result .hash-value {
    font-family: 'Courier New', monospace;
    word-break: break-all;
    background: rgba(0, 0, 0, 0.06);
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 13px;
}

/* === PAGINAÇÃO === */
.pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 20px 0;
    justify-content: center;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #ddd;
    color: var(--verde);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.pagination a:hover { background: var(--verde-fundo); }
.pagination .active span {
    background: var(--verde);
    color: #fff;
    border-color: var(--verde);
}
.pagination .disabled span { color: #aaa; cursor: not-allowed; }

/* === RESULT CARDS (busca / home) === */
.edition-row {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid var(--verde);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
}
.edition-row:hover { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08); }
.edition-row .er-left .er-num {
    font-weight: 800;
    color: var(--verde);
    font-size: 16px;
}
.edition-row .er-left .er-title {
    font-size: 14px;
    color: #333;
    margin-top: 2px;
}
.edition-row .er-left .er-meta {
    font-size: 12px;
    color: #777;
    margin-top: 4px;
}
.edition-row .er-right { display: flex; gap: 8px; }

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    background: #fff;
    border: 1px dashed #ccc;
    border-radius: 8px;
}
.empty-state .es-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h3 { color: #555; margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* === FOOTER INSTITUCIONAL === */
footer.site-footer {
    background: var(--verde);
    color: #ccc;
    padding: 32px 0 24px;
    margin-top: 40px;
    border-top: 4px solid var(--verde-escuro);
}
footer.site-footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}
footer.site-footer .footer-logo { margin-bottom: 16px; }
footer.site-footer .footer-logo img { max-width: 160px; opacity: 0.9; }
footer.site-footer .footer-info {
    font-size: 13px;
    line-height: 1.8;
    color: #b8d9c0;
}
footer.site-footer .footer-info strong { color: #fff; }
footer.site-footer .footer-info a { color: #8fc99c; text-decoration: none; }
footer.site-footer .footer-info a:hover { color: #fff; text-decoration: underline; }
footer.site-footer .footer-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin: 16px auto;
    max-width: 600px;
}
footer.site-footer .footer-copy { font-size: 12px; color: #8fc99c; }

/* === VLIBRAS === */
[vw] [vw-access-button] { display: none; }
[vw].enabled [vw-access-button] { display: flex; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .top-header .logo-area img { max-width: 150px; }
    .top-header .logo-area .logo-text { font-size: 14px; }
    .nav-bar h1 { font-size: 16px; }
    .year-body { padding: 12px; }
    .editions-table { font-size: 12px; }
    .editions-table th, .editions-table td { padding: 6px 8px; }
    .stats-bar { padding: 12px 16px; gap: 12px; }
    .edition-detail .detail-header { padding: 16px 18px; }
    .edition-detail .detail-body { padding: 16px 18px; }
}

/* =============================================================
   CONSELHOS — estilos específicos
   ============================================================= */

/* === FILTROS === */
.filter-bar {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.filter-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 10px;
    align-items: center;
}
.filter-row .search-box { margin-bottom: 0; }
.filter-row .form-control { padding: 10px 12px; }
.result-count {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

/* === GRID DE CONSELHOS (cards) === */
.conselho-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.conselho-card {
    display: block;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: 4px solid var(--verde);
    border-radius: 8px;
    padding: 18px 20px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s, transform 0.2s;
}
.conselho-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    text-decoration: none;
}
.conselho-card .cc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.conselho-card .cc-sigla {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--verde-fundo);
    color: var(--verde);
    font-weight: 800;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}
.conselho-card .cc-nome {
    font-size: 16px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 10px;
    line-height: 1.3;
}
.conselho-card .cc-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
}
.conselho-card .cc-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--verde);
}

/* === DETALHE DO CONSELHO === */
.conselho-detail {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 16px;
}
.conselho-detail .detail-header {
    background: linear-gradient(135deg, var(--verde), var(--verde-hover));
    color: #fff;
    padding: 22px 28px;
}
.conselho-detail .detail-header h2 { font-size: 22px; }
.conselho-detail .detail-header .meta { opacity: 0.95; font-size: 13px; margin-top: 6px; }
.conselho-detail .detail-body { padding: 24px 28px; }
.conselho-detail .detail-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.conselho-detail .detail-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.conselho-detail h3 {
    color: var(--verde);
    font-size: 16px;
    margin-bottom: 12px;
}
.conselho-detail .sub-title {
    color: var(--verde);
    font-size: 14px;
    margin: 16px 0 6px;
}
.sobre-text {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    background: #fcfdfc;
    border-left: 4px solid var(--verde);
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 10px;
}
.mandato-info {
    font-size: 13px;
    color: #555;
    background: var(--verde-fundo);
    padding: 8px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
}

/* === DATAGRID (contato) === */
.datagrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.dg-item {
    background: #f8faf8;
    border: 1px solid #e6ece6;
    border-radius: 6px;
    padding: 10px 14px;
}
.dg-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}
.dg-value { font-size: 15px; font-weight: 600; color: #212529; }
.dg-value a { color: var(--verde); }

/* === DIRETORIA / MEMBROS === */
.diretoria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.membro-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 16px;
    background: #fcfdfc;
}
.membro-destaque {
    border-top: 4px solid var(--verde);
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.mc-cargo {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--verde);
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}
.mc-nome { font-size: 15px; font-weight: 700; color: #212529; }
.mc-meta { font-size: 12px; color: #777; margin-top: 3px; }
.membros-lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}
.membro-item {
    border: 1px solid #eee;
    border-left: 3px solid var(--verde);
    border-radius: 6px;
    padding: 10px 14px;
    background: #fcfdfc;
}
.mi-nome { font-size: 14px; font-weight: 600; color: #212529; }
.mi-meta { font-size: 12px; color: #777; margin-top: 2px; }

/* === REUNIÕES === */
.reuniao-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 10px;
    background: #fcfdfc;
    flex-wrap: wrap;
}
.reuniao-item .ri-left { flex: 1; min-width: 200px; }
.reuniao-item .ri-data { font-weight: 700; color: var(--verde); font-size: 15px; }
.reuniao-item .ri-tipo { font-size: 12px; color: #777; margin-top: 3px; }
.reuniao-item .ri-pauta { font-size: 13px; color: #333; margin-top: 6px; }
.ata-texto { font-size: 12px; color: #888; font-style: italic; }

/* === DOCUMENTOS === */
.doc-item {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 10px;
    background: #fcfdfc;
    flex-wrap: wrap;
}
.doc-item:hover { background: #f5faf6; }
.doc-icon { font-size: 26px; }
.doc-info { flex: 1; min-width: 200px; }
.doc-name { font-weight: 700; color: #212529; }
.doc-meta { font-size: 12px; color: #777; margin-top: 2px; }
.doc-ext { color: #999; font-weight: 600; }

/* === RESPONSIVE (conselhos) === */
@media (max-width: 900px) {
    .filter-row { grid-template-columns: 1fr 1fr; }
    .filter-row .search-box { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
    .conselho-detail .detail-header { padding: 16px 18px; }
    .conselho-detail .detail-body { padding: 16px 18px; }
    .filter-row { grid-template-columns: 1fr; }
    .filter-row .search-box { grid-column: auto; }
    .datagrid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .datagrid { grid-template-columns: 1fr; }
}
