/* ===== Layout público global ===== */
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:Arial,Helvetica,sans-serif;background:#f5f7f8;color:#173524;line-height:1.55}
img{max-width:100%;height:auto}
a{color:inherit}
.container{width:min(1200px,calc(100% - 32px));margin:0 auto}

/* Header */
.topbar{background:#fff;border-bottom:1px solid #dfe7ec}
.topbar-inner{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:18px 0}
.brand{display:flex;align-items:center;text-decoration:none}
.brand img{width:280px;max-width:100%;height:auto;display:block}
.top-actions{display:flex;flex-direction:column;align-items:flex-end;gap:12px;flex:1}
.accessibility{display:flex;align-items:center;gap:8px;color:#063f1d;font-size:.9rem}
.accessibility button{border:1px solid #dfe7ec;background:#fff;border-radius:8px;padding:6px 8px;cursor:pointer;color:#063f1d;font-weight:700}
.search{display:flex;width:min(420px,100%);height:46px;border:1px solid #dfe7ec;border-radius:12px;overflow:hidden;background:#fff}
.search input{flex:1;border:none;padding:0 16px;font-size:.95rem;outline:none}
.search button{width:54px;border:none;background:#0b5a2a;color:#fff;font-size:1.1rem;cursor:pointer}

/* Hero / home */
.hero{margin-top:24px;border-radius:16px;min-height:360px;overflow:hidden;position:relative;background:linear-gradient(90deg,rgba(4,65,29,.95),rgba(4,65,29,.70),rgba(4,65,29,.15)),url('../images/cidade-juara.jpg') center/cover no-repeat;box-shadow:0 12px 34px rgba(15,23,42,.08)}
.hero-content{min-height:360px;display:grid;grid-template-columns:1fr 300px;align-items:center;gap:24px;padding:48px 64px;color:#fff}
.hero h1{font-size:clamp(2.6rem,6vw,4.2rem);line-height:1.05;margin:0 0 16px}
.hero p{font-size:1.25rem;margin:0 0 24px;color:rgba(255,255,255,.94)}
.hero-btn{display:inline-flex;text-decoration:none;color:#fff;border:1px solid #fff;border-radius:12px;padding:12px 22px;font-weight:700}
.hero-btn:hover{background:#fff;color:#0b5a2a}
.hero-crest img{width:min(285px,100%);filter:drop-shadow(0 16px 28px rgba(0,0,0,.28))}
.notice{margin:24px 0;background:#edf7ef;border:1px solid #d7eadc;border-radius:14px;display:flex;justify-content:space-between;align-items:center;gap:18px;padding:14px 22px;color:#063f1d}
.notice a{background:#0b5a2a;color:#fff;text-decoration:none;border-radius:10px;padding:10px 18px;font-weight:700;white-space:nowrap}
.section-title{margin:30px 0 16px}
.section-title h2{color:#063f1d;margin:0 0 4px;font-size:1.65rem}
.section-title p{color:#52606d;margin:0}
.quick-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:34px}
.quick-card{background:#fff;border:1px solid #dfe7ec;border-radius:14px;padding:24px 16px;min-height:176px;text-decoration:none;text-align:center;box-shadow:0 6px 18px rgba(15,23,42,.04);transition:.2s;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px}
.quick-card:hover{transform:translateY(-4px);box-shadow:0 16px 30px rgba(15,23,42,.10);border-color:#b7dec5;background:#fbfffc}
.quick-icon{width:62px;height:62px;border-radius:20px;background:#f5faf7;border:1px solid #d9eadf;display:flex;align-items:center;justify-content:center;font-size:2rem}
.quick-card h3{font-size:1rem;color:#063f1d;margin:0}
.quick-card p{font-size:.84rem;color:#52606d;margin:0}

/* Page header / cards */
.page-header{margin:24px auto;background:linear-gradient(135deg,#0b5a2a,#063f1d);color:#fff;border-radius:16px;padding:34px;box-shadow:0 12px 34px rgba(15,23,42,.08)}
.page-header a{color:#fff;text-decoration:none;opacity:.95}
.page-header h1{font-size:clamp(1.8rem,4vw,2.6rem);margin:8px 0}
.page-header p{max-width:900px;color:rgba(255,255,255,.92);margin:0}
.panel,.public-card{background:#fff;border:1px solid #dfe7ec;border-radius:18px;padding:22px;margin-bottom:20px;box-shadow:0 8px 22px rgba(15,23,42,.05)}
.panel h2,.panel h3,.public-card h2,.public-card h3{margin-top:0;color:#063f1d}

/* Section buttons */
.button-list{margin:24px 0 36px;display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.button-card{background:#fff;border:1px solid #dfe7ec;border-radius:16px;padding:20px;text-decoration:none;display:flex;align-items:center;gap:16px;box-shadow:0 6px 18px rgba(15,23,42,.04);transition:.2s}
.button-card:hover{transform:translateY(-3px);box-shadow:0 14px 28px rgba(15,23,42,.09);background:#fbfffc}
.button-icon{width:58px;height:58px;border-radius:16px;background:#f5faf7;border:1px solid #d9eadf;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:8px;font-size:1.7rem;flex:0 0 auto}
.button-icon img{width:100%;height:100%;object-fit:contain}
.button-card strong{display:block;color:#063f1d;font-size:1rem}
.button-card small{color:#52606d}
.empty-box{background:#fff;border:1px dashed #dfe7ec;border-radius:16px;padding:28px;text-align:center;color:#52606d;margin:24px 0}

/* Selo reutilizavel de "ultima atualizacao" - usado nos modulos que atendem a exigencia
   de atualidade da cartilha PNTP (emendas, atos normativos, contratos, obras, etc.) */
.last-update-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:24px 0 4px;
  padding:9px 20px;
  background:#077834;
  border-radius:999px;
  font-size:.9rem;
  font-weight:bold;
  color:#fff;
  box-shadow:0 2px 6px rgba(7,120,52,.25);
}
.last-update-badge.is-stale{
  background:#b3541e;
  box-shadow:0 2px 6px rgba(179,84,30,.25);
}
.last-update-badge strong{
  color:#fff;
}
.last-update-badge .last-update-icon{
  font-size:1rem;
  line-height:1;
}
@media(max-width:640px){
  .last-update-badge{
    display:flex;
    text-align:center;
    justify-content:center;
    flex-wrap:wrap;
  }
}

/* Alerta de descumprimento de prazo de atualidade (cartilha PNTP) */
.stale-alert{
  margin:24px 0;
  background:#fff4e8;
  border:1px solid #f3cfa0;
  border-left:5px solid #b3541e;
  border-radius:12px;
  padding:16px 20px;
  color:#7a3c0f;
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.stale-alert .stale-alert-icon{
  font-size:1.2rem;
  line-height:1;
  flex-shrink:0;
}
.stale-alert strong{
  color:#5c2e0b;
}

/* Emendas */
.tabs{display:flex;gap:10px;flex-wrap:wrap}
.tab{padding:10px 14px;cursor:pointer;background:#eee;border-radius:8px;text-decoration:none;color:#24323f;font-weight:bold}
.tab.active{background:#077834;color:#fff}
.meta-grid,.summary-grid,.filters-grid{display:grid;gap:14px}
.meta-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.summary-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.filters-grid{grid-template-columns:repeat(4,minmax(0,1fr));align-items:end}
.box{background:#f8fbf6;border:1px solid #dfe7ec;border-radius:8px;padding:12px}
.box strong{display:block;margin-bottom:6px;color:#063f1d;font-size:.95rem}
.value{font-size:1.45rem;font-weight:bold}
.field label{display:block;margin-bottom:6px;font-weight:bold;font-size:.94rem}
.field input,.field select{width:100%;min-height:42px;padding:10px 12px;border:1px solid #c5ced8;border-radius:8px;background:#fff;font-size:.95rem}
.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}
.btn{border:none;border-radius:8px;padding:10px 16px;font-weight:bold;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;font-size:.92rem}
.btn-primary{background:#077834;color:#fff}
.btn-light,.btn-gray{background:#d5d9de;color:#222}
.btn-success{background:#2e8b57;color:#fff}
.table-wrap{width:100%;max-width:100%;overflow-x:auto;border:1px solid #dfe7ec;border-radius:10px;margin-top:14px;background:#fff}
.table{width:100%;min-width:1300px;border-collapse:collapse}
.table th,.table td{padding:12px;border-bottom:1px solid #e7edf3;text-align:left;vertical-align:top;font-size:.94rem}
.table th{background:#eef5ea;color:#063f1d;white-space:nowrap}
.table tr:hover td{background:#fcfdfb}
.money{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.tag{display:inline-block;padding:4px 8px;border-radius:999px;background:#e8f1df;color:#063f1d;font-weight:bold;font-size:.82rem;white-space:nowrap}
.link-doc,.doc-link{display:inline-block;margin-top:6px;margin-right:6px;padding:6px 10px;border:1px solid #077834;border-radius:6px;text-decoration:none;color:#077834;font-size:.84rem;font-weight:bold;background:#f8fbf6}
.link-doc:hover,.doc-link:hover{background:#077834;color:#fff}
.small{color:#5b6975;font-size:.9rem}
.footer-note{margin-top:12px;font-size:.92rem;color:#5b6975}

/* Footer */
.site-footer{margin-top:40px;background:#063f1d;color:#fff;padding:30px 0 0}
.footer-grid{display:grid;grid-template-columns:1.1fr .9fr .9fr;gap:30px;padding-bottom:26px}
.footer-brand{display:flex;align-items:center;gap:14px}
.footer-brand img{width:220px;max-width:100%;height:auto;display:block}
.footer-box h3{font-size:1rem;margin:0 0 10px;color:#fff}
.footer-box p,.footer-box a{font-size:.9rem;color:rgba(255,255,255,.88);text-decoration:none;display:block;margin:0 0 6px}
.footer-box a:hover{text-decoration:underline}
.copyright{border-top:1px solid rgba(255,255,255,.15);padding:14px 0;font-size:.86rem;color:rgba(255,255,255,.75)}

/* Responsive */
@media(max-width:1050px){
  .quick-grid{grid-template-columns:repeat(3,1fr)}
  .button-list{grid-template-columns:repeat(2,1fr)}
  .hero-content{grid-template-columns:1fr 240px;padding:42px}
}
@media(max-width:900px){
  .topbar-inner,.top-actions{align-items:center;text-align:center;flex-direction:column}
  .hero-content{grid-template-columns:1fr;text-align:center}
  .hero p{margin-left:auto;margin-right:auto}
  .hero-crest img{width:220px}
  .notice{flex-direction:column;text-align:center}
  .footer-grid{grid-template-columns:1fr}
  .quick-grid{grid-template-columns:repeat(2,1fr)}
  .button-list{grid-template-columns:1fr}
  .meta-grid,.summary-grid,.filters-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:640px){
  .container{width:min(100% - 24px,1200px)}
  .brand img{width:220px}
  .quick-grid,.meta-grid,.summary-grid,.filters-grid{grid-template-columns:1fr}
  .hero-content{padding:30px 20px}
  .hero h1{font-size:2.45rem}
  .actions{flex-direction:column}
  .btn{width:100%}
}
/* ===== Patch para cores dinâmicas ===== */
/* Cole no final de css/public.css se não substituir o arquivo inteiro */

.hero {
  background:
    linear-gradient(90deg, rgba(4,65,29,.95), rgba(4,65,29,.70), rgba(4,65,29,.15)),
    var(--hero-image) center/cover no-repeat !important;
}

.search button,
.notice a,
.btn-primary,
.btn-success,
.tab.active {
  background: var(--primary) !important;
  color: #fff !important;
}

.hero-btn:hover {
  color: var(--primary) !important;
}

.page-header,
.site-footer {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
}
.page-header h1 {
  color: #ffffff !important;
}

.section-title h2,
.panel h2,
.panel h3,
.public-card h2,
.public-card h3,
.quick-card h3,
.button-card strong {
  color: var(--primary-dark) !important;
}

.table th,
.tag {
  background: #edf7ef !important;
  color: var(--primary-dark) !important;
}

.link-doc,
.doc-link {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.link-doc:hover,
.doc-link:hover {
  background: var(--primary) !important;
  color: #fff !important;
}

.brand img {
  width: 280px;
  max-width: 100%;
  height: auto;
  display: block;
}

.footer-brand img {
  width: 220px;
  max-width: 100%;
  height: auto;
  display: block;
}
/* ===== Breadcrumb automático ===== */

.breadcrumb {
  width: min(1200px, calc(100% - 32px));
  margin: 18px auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: .92rem;
  color: #64748b;
}

.breadcrumb-prefix {
  font-weight: 800;
  color: var(--primary-dark, #063f1d);
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  color: #94a3b8;
  font-weight: 700;
}

.breadcrumb a {
  color: var(--primary, #077834);
  text-decoration: none;
  font-weight: 700;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb strong {
  color: var(--primary-dark, #063f1d);
  font-weight: 800;
}

@media(max-width: 640px) {
  .breadcrumb {
    width: min(100% - 24px, 1200px);
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}
/* ===== Acessibilidade pública ===== */

body {
  font-size: calc(16px * var(--font-scale, 1));
}

.accessibility-btn {
  transition: .18s ease;
}

.accessibility-btn:hover {
  transform: translateY(-1px);
  background: var(--primary, #077834) !important;
  color: #fff !important;
}

body.high-contrast {
  background: #000 !important;
  color: #fff !important;
}

body.high-contrast .topbar,
body.high-contrast .panel,
body.high-contrast .public-card,
body.high-contrast .quick-card,
body.high-contrast .button-card,
body.high-contrast .box,
body.high-contrast .table-wrap,
body.high-contrast .site-footer {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

body.high-contrast a,
body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast strong,
body.high-contrast .breadcrumb strong,
body.high-contrast .breadcrumb-prefix {
  color: #ffff00 !important;
}

body.high-contrast .search input,
body.high-contrast input,
body.high-contrast select,
body.high-contrast textarea {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

body.high-contrast .btn,
body.high-contrast button,
body.high-contrast .tab.active {
  background: #ffff00 !important;
  color: #000 !important;
  border-color: #ffff00 !important;
}

body.high-contrast .table th,
body.high-contrast .table td {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}
/* ===== Busca pública ===== */

.search-results {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.search-result-card {
  display: block;
  background: #fff;
  border: 1px solid #dfe7ec;
  border-radius: 14px;
  padding: 16px;
  text-decoration: none;
  transition: .18s ease;
}

.search-result-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary, #077834);
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
}

.search-result-card span {
  display: inline-block;
  background: #edf7ef;
  color: var(--primary-dark, #063f1d);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: .78rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.search-result-card strong {
  display: block;
  color: var(--primary-dark, #063f1d);
  font-size: 1.05rem;
}

.search-result-card p {
  color: #52606d;
  margin: 6px 0 0;
}
/* ===== Rodapé público dinâmico ===== */

.footer-dynamic-grid {
  grid-template-columns: 1.2fr repeat(3, minmax(180px, 1fr));
}

.footer-main-info {
  flex-direction: column;
  align-items: flex-start;
}

.footer-contact {
  margin-top: 14px;
}

.footer-contact p {
  margin: 0 0 6px;
  color: rgba(255,255,255,.88);
  font-size: .9rem;
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.footer-socials a {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.20);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 900;
}

.footer-socials a:hover {
  background: #fff;
  color: var(--primary-dark, #063f1d);
}

.footer-muted {
  color: rgba(255,255,255,.65) !important;
  font-style: italic;
}

.footer-context {
  background: rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.12);
  padding: 18px 0;
}

.footer-context-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.footer-context strong {
  display: block;
  color: #fff;
  font-size: 1.05rem;
}

.footer-context p {
  margin: 4px 0 0;
  color: rgba(255,255,255,.82);
}

.footer-context a {
  background: #fff;
  color: var(--primary-dark, #063f1d);
  border-radius: 10px;
  padding: 10px 16px;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

@media(max-width: 1050px) {
  .footer-dynamic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-context-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media(max-width: 700px) {
  .footer-dynamic-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Atos Normativos Próprios ===== */
.normative-tabs{display:flex;gap:10px;flex-wrap:wrap;margin:22px 0}
.normative-tab{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:10px 16px;border-radius:999px;border:1px solid #dfe7ec;background:#fff;color:var(--primary-dark,#063f1d);text-decoration:none;font-weight:800;box-shadow:0 6px 18px rgba(15,23,42,.04)}
.normative-tab:hover{background:#fbfffc;border-color:#b7dec5}
.normative-tab.active{background:var(--primary,#077834);color:#fff;border-color:var(--primary,#077834)}
.normative-filter-actions{margin-top:0;align-self:end}
.normative-table{width:100%;min-width:0;table-layout:fixed}
.normative-table th,.normative-table td{white-space:normal;overflow-wrap:anywhere;word-break:break-word;vertical-align:top}
.normative-table td strong{color:var(--primary-dark,#063f1d)}
.normative-table .doc-link{overflow-wrap:anywhere;word-break:break-word}
@media(max-width:760px){
  .normative-tabs{display:grid;grid-template-columns:1fr 1fr}
  .normative-tab{width:100%}
  .normative-filter-actions{align-self:stretch}
  .table-wrap{overflow-x:visible}
  .normative-table,.normative-table thead,.normative-table tbody,.normative-table tr,.normative-table th,.normative-table td{display:block;width:100%}
  .normative-table thead{display:none}
  .normative-table tr{border:1px solid #dfe7ec;border-radius:14px;padding:12px;margin:0 0 12px;background:#fff}
  .normative-table td{border:0!important;padding:7px 0}
  .normative-table td::before{content:attr(data-label);display:block;font-size:.78rem;font-weight:800;color:#52616b;text-transform:uppercase;letter-spacing:.03em;margin-bottom:2px}
}
@media(max-width:420px){.normative-tabs{grid-template-columns:1fr}}


/* ===== Correção definitiva: arquivos dos atos normativos sem estouro horizontal ===== */
.normative-files-list{
  width:100%;
  max-width:100%;
  display:flex;
  flex-direction:column;
  gap:12px;
  overflow:hidden;
}

.normative-file-card{
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
  padding:14px 12px;
  border:1px solid #dfe7ec;
  border-radius:12px;
  background:#fff;
}

.normative-file-info{
  min-width:0;
  max-width:100%;
}

.normative-file-info strong{
  display:block;
  max-width:100%;
  color:var(--primary-dark,#063f1d);
  overflow-wrap:anywhere;
  word-break:break-word;
  line-height:1.35;
}

.normative-file-info small,
.normative-file-label{
  display:block;
  color:#52616b;
  font-size:.84rem;
  margin-top:4px;
}

.normative-file-label{
  margin-top:0;
  margin-bottom:3px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.03em;
}

.normative-file-button{
  box-sizing:border-box;
  margin:0!important;
  white-space:normal!important;
  text-align:center;
}

@media(max-width:700px){
  .normative-file-card{
    grid-template-columns:1fr;
    align-items:stretch;
  }
  .normative-file-button{
    width:100%;
  }
}


/* ===== Correção definitiva: resultado dos atos normativos sem tabela/rolagem ===== */
.normative-results-list{
  width:100%;
  max-width:100%;
  display:flex;
  flex-direction:column;
  gap:12px;
  overflow:hidden;
}

.normative-result-card{
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:16px;
  align-items:center;
  padding:14px 12px;
  border:1px solid #dfe7ec;
  border-radius:14px;
  background:#fff;
}

.normative-result-main{
  min-width:0;
  max-width:100%;
}

.normative-result-title{
  display:block;
  max-width:100%;
  margin-top:8px;
  color:var(--primary-dark,#063f1d);
  font-weight:800;
  text-decoration:none;
  overflow-wrap:anywhere;
  word-break:break-word;
  line-height:1.35;
}

.normative-result-title:hover{
  text-decoration:underline;
}

.normative-result-description{
  margin-top:4px;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.normative-result-meta{
  min-width:210px;
  display:flex;
  flex-direction:column;
  gap:5px;
  color:#52616b;
  font-size:.9rem;
}

.normative-result-meta span{
  white-space:normal;
}

@media(max-width:760px){
  .normative-result-card{
    grid-template-columns:1fr;
    align-items:stretch;
  }
  .normative-result-meta{
    min-width:0;
    border-top:1px solid #eef2f5;
    padding-top:10px;
  }
}


/* =========================================================
   CORREÇÃO DEFINITIVA - TÍTULOS DO CABEÇALHO VERDE
   Mantém os títulos principais em branco dentro da caixa verde
   em todas as páginas públicas e seções.
   ========================================================= */
body .page-header h1,
body main .page-header h1,
body .container .page-header h1,
body section.page-header h1 {
  color: #ffffff !important;
}
body .page-header h1 a,
body .page-header h1 span,
body .page-header h1 strong {
  color: #ffffff !important;
}
