/* ===========================================================
   Interface do hub: cabeçalho, busca, breadcrumb, mapa do site
   =========================================================== */

:root {
	--tm-verde: #0b3d2e;
	--tm-verde-claro: #14694f;
	--tm-azul: #0077be;
	/* Recuo lateral que espelha o do conteúdo (#main > .inner: 6em, max-width 110em centralizado).
	   Alinha a barra superior, o cabeçalho e a barra de ações com o corpo da página. */
	--tm-gutter: 6em;
	--tm-pad-x: max(var(--tm-gutter), calc((100% - 110em) / 2 + var(--tm-gutter)));
}
@media screen and (max-width: 1680px) { :root { --tm-gutter: 5em; } }
@media screen and (max-width: 1280px) { :root { --tm-gutter: 4em; } }
@media screen and (max-width: 736px)  { :root { --tm-gutter: 2em; } }

/* ----- Cabeçalho full-width (estilo modelo) ----- */
body.is-preload { margin: 0; }
#header.tm-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 28px;
	padding: 18px var(--tm-pad-x);
	background: linear-gradient(135deg, var(--tm-verde) 0%, var(--tm-verde-claro) 100%);
	color: #fff;
	left: 0 !important;
}
.tm-brand,
.tm-brand:hover,
.tm-brand:focus { display: flex; align-items: center; gap: 14px; text-decoration: none !important; color: #fff !important; }
.tm-brand-logo { width: 58px; height: auto; }
/* Mantém o nome sempre branco (vence o a:hover do template) */
.tm-brand .tm-brand-text strong,
.tm-brand:hover .tm-brand-text strong,
.tm-brand:focus .tm-brand-text strong { display: block; font-size: 1.15rem; line-height: 1.15; color: #fff !important; }
.tm-brand .tm-brand-text span,
.tm-brand:hover .tm-brand-text span,
.tm-brand:focus .tm-brand-text span { font-size: .85rem; color: #d7e8e0 !important; }
.tm-brand-right { text-align: right; line-height: 1.25; }
.tm-brand-right strong { display: block; font-size: 1.05rem; color: #fff; }
.tm-brand-right span { font-size: .8rem; color: #cfe3d9; }

/* ----- Barra de ações (branca, abaixo do header) ----- */
.tm-barra-acoes {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	padding: 10px var(--tm-pad-x);
	background: #fff;
	border-bottom: 1px solid #e3e9e6;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.busca-wrap { position: relative; margin-left: auto; }
.busca-form {
	display: flex;
	align-items: stretch;
	height: 40px;
	box-sizing: border-box;
	border: 1px solid #cdd6d1;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

/* Dropdown da busca instantânea */
.busca-resultados {
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	left: 0;
	min-width: 280px;
	max-height: 380px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #d7e0db;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
	z-index: 9998;
	padding: 6px;
}
.busca-resultados a {
	display: block;
	padding: 8px 10px;
	border-radius: 6px;
	text-decoration: none;
	color: #233a31;
	line-height: 1.25;
}
.busca-resultados a:hover, .busca-resultados a:focus { background: #eef4f1; }
.busca-resultados a strong { display: block; font-size: .9rem; font-weight: 600; color: var(--tm-verde); }
.busca-resultados a small { font-size: .74rem; color: #6c757d; }
.busca-resultados .bz-vazio { padding: 10px; font-size: .85rem; color: #6c757d; }

body.tema-escuro .busca-resultados { background: #16221d; border-color: #2e463d; }
body.tema-escuro .busca-resultados a { color: #d6e6df; }
body.tema-escuro .busca-resultados a:hover { background: #1b2c25; }
body.tema-escuro .busca-resultados a strong { color: #bfe6d5; }
.busca-form input[type="search"] {
	border: 0;
	padding: 0 14px;
	min-width: 200px;
	font-size: .9rem;
	outline: none;
	background: transparent;
}
/* !important para vencer o estilo de button do template (main.css) */
.tm-barra-acoes .busca-form button {
	border: 0;
	background: var(--tm-verde) !important;
	color: #fff !important;
	padding: 0 16px;
	cursor: pointer;
	box-shadow: none;
}
.tm-barra-acoes .busca-form button:hover { background: var(--tm-verde-claro) !important; }
.tm-barra-acoes .busca-form button:focus-visible { outline: 3px solid var(--tm-azul); outline-offset: 2px; }

.btn-inicio, .btn-radar {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	text-decoration: none;
	font-size: .88rem;
	height: 40px;
	box-sizing: border-box;
	padding: 0 16px;
	border-radius: 8px;
	white-space: nowrap;
}
.btn-inicio { color: var(--tm-verde); border: 1px solid #cdd6d1; background: #fff; }
.btn-inicio:hover { background: #eef4f1; }
.btn-radar { color: #5a3d00; background: #ffd200; font-weight: 600; }
.btn-radar:hover { background: #ffdd33; }
.btn-inicio:focus-visible, .btn-radar:focus-visible { outline: 3px solid var(--tm-azul); outline-offset: 2px; }

/* Sidebar removida: oculta qualquer toggle/hambúrguer remanescente do template */
a.toggle[href="#sidebar"], #titleBar { display: none !important; }

/* ----- Breadcrumb (Atricon 13.2) ----- */
.breadcrumb {
	font-size: .85rem;
	color: #5b6b63;
	margin: 14px 0 4px;
	padding: 8px 12px;
	background: #f3f6f4;
	border-radius: 6px;
}
.breadcrumb a { color: var(--tm-azul); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: #2a3b34; font-weight: 600; }

/* ----- Mapa do site / Busca (listas) ----- */
.tm-mapa h2, .tm-busca h2 { color: var(--tm-verde); }
.tm-mapa .grupo { margin-bottom: 22px; }
.tm-mapa .grupo h3 {
	color: var(--tm-verde-claro);
	border-left: 4px solid var(--tm-verde);
	padding-left: 10px;
	margin-bottom: 8px;
}
.tm-mapa ul, .tm-busca ul { columns: 2; list-style: square; padding-left: 22px; }
.tm-mapa ul li, .tm-busca ul li { margin: 4px 0; break-inside: avoid; }
.tm-mapa a, .tm-busca a { color: var(--tm-azul); text-decoration: none; }
.tm-mapa a:hover, .tm-busca a:hover { text-decoration: underline; }

/* ----- Faixa de boas-vindas (identidade visual) ----- */
.tm-hero {
	background: linear-gradient(135deg, var(--tm-verde) 0%, var(--tm-verde-claro) 100%);
	color: #fff;
	border-radius: 14px;
	padding: 30px 28px;
	margin: 18px 0 8px;
}
.tm-hero h1 {
	margin: 0 0 8px;
	font-size: 1.7rem;
	color: #fff;
	line-height: 1.15;
}
.tm-hero p {
	margin: 0;
	max-width: 760px;
	font-size: .98rem;
	line-height: 1.6;
	color: #e7f1ec;
}
.tm-hero-atalhos {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
}
.tm-hero-atalhos a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	text-decoration: none;
	padding: 8px 14px;
	border-radius: 22px;
	font-size: .9rem;
	border: 1px solid rgba(255, 255, 255, 0.25);
	transition: background .15s ease;
}
.tm-hero-atalhos a:hover { background: rgba(255, 255, 255, 0.28); }
.tm-hero-atalhos a:focus-visible { outline: 3px solid #ffd200; outline-offset: 2px; }

/* ----- Página Institucional ----- */
.tm-institucional h2 { color: var(--tm-verde); }
.inst-bloco {
	background: #f7faf8;
	border: 1px solid #e1eae5;
	border-left: 5px solid var(--tm-verde);
	border-radius: 8px;
	padding: 16px 20px;
	margin: 16px 0;
}
.inst-bloco h3 {
	margin: 0 0 8px;
	color: var(--tm-verde-claro);
	font-size: 1.1rem;
}
.inst-bloco h3 i { margin-right: 8px; color: var(--tm-verde); }
.inst-lista { margin: 8px 0; padding-left: 4px; list-style: none; }
.inst-lista li { margin: 5px 0; }
.inst-links-inline { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.inst-links-inline li { margin: 0; }
.inst-link {
	display: inline-block;
	background: var(--tm-verde);
	color: #fff !important;
	text-decoration: none;
	padding: 7px 16px;
	border-radius: 20px;
	font-size: .9rem;
}
.inst-link:hover { background: var(--tm-verde-claro); }

/* ----- Responsividade ----- */
@media (max-width: 760px) {
	#header.tm-header { justify-content: center; text-align: center; }
	.tm-header .logo { justify-content: center; flex-basis: 100%; }
	.header-acoes { justify-content: center; width: 100%; }
	.busca-form { flex: 1 1 100%; }
	.busca-form input[type="search"] { min-width: 0; width: 100%; }
	.tm-hero { padding: 24px 18px; }
	.tm-hero h1 { font-size: 1.4rem; }
}

@media (max-width: 640px) {
	.tm-mapa ul, .tm-busca ul { columns: 1; }
}

/* ===== Obras (painel GeoPB) ===== */
/* Neutraliza o estilo de button/input/select do template (altura fixa, maiúsculas, cor) dentro do painel */
.tm-obras button, .tm-obras select, .tm-obras input {
	height: auto !important;
	line-height: 1.4 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	box-shadow: none !important;
	font-weight: 400;
}
.tm-obras h2 { color: var(--tm-verde); }
.obras-titulo { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.obras-titulo h2 { margin: 0 0 2px; font-size: 1.4rem; }
.obras-titulo h2 i { color: var(--tm-verde); }
.obras-titulo p { margin: 0; color: #5b6b63; font-size: .9rem; }
.obras-badge { background: #eaf2fb; color: #0a5a90; border: 1px solid #cfe0f3; border-radius: 16px; padding: 5px 12px; font-size: .78rem; font-weight: 600; white-space: nowrap; }

/* Filtros */
.obras-filtros { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; background: #f7faf8; border: 1px solid #e1eae5; border-radius: 10px; padding: 14px 16px; margin: 14px 0; }
.obras-filtros > div { display: flex; flex-direction: column; gap: 4px; }
.obras-filtros .obras-busca-wrap { flex: 1 1 240px; }
.obras-filtros label { font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: #5b6b63; font-weight: 600; }
.obras-filtros select, .obras-filtros input { padding: 8px 10px; border: 1px solid #cdd6d1; border-radius: 7px; font-size: .9rem; background: #fff; }
.obras-filtros input { width: 100%; box-sizing: border-box; }
.obras-limpar { align-self: flex-end; background: #eef2f0; border: 1px solid #cdd6d1; border-radius: 7px; padding: 9px 16px; cursor: pointer; font-size: .88rem; }
.obras-limpar:hover { background: #e2e8e5; }

/* Cartões de resumo */
.obras-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 16px 0; }
.obras-stat { border-left: 5px solid; border-radius: 10px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.06); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.obras-stat span { font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: #6c757d; }
.obras-stat strong { font-size: 1.8rem; color: #233a31; line-height: 1; }

.obras-sub { color: var(--tm-verde); margin: 20px 0 8px; font-size: .82rem; text-transform: uppercase; letter-spacing: .5px; }
.obras-sub small { text-transform: none; color: #888; font-weight: 400; }

/* Tipos (clicáveis) */
.obras-tipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.obras-tipo-card { display: block !important; text-align: left !important; white-space: normal !important; background: #fff; border: 1px solid #e1eae5; border-radius: 10px; padding: 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.obras-tipo-card .ot-nome { text-transform: none; }
.obras-tipo-card:hover { border-color: var(--tm-verde-claro); box-shadow: 0 4px 12px rgba(11,61,46,.12); }
.obras-tipo-card .ot-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.obras-tipo-card .ot-nome { font-weight: 700; color: var(--tm-verde); font-size: .9rem; }
.obras-tipo-card .ot-n { font-size: .72rem; color: #6c757d; background: #f0f4f2; border-radius: 10px; padding: 2px 8px; white-space: nowrap; }
.obras-tipo-card .ot-valor { font-size: 1.15rem; font-weight: 700; color: #233a31; margin: 8px 0 6px; }
.obras-tipo-card .ot-bar { height: 6px; background: #e9eef0; border-radius: 4px; overflow: hidden; }
.obras-tipo-card .ot-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--tm-verde), var(--tm-verde-claro)); }

/* Distribuição por situação */
.obras-dist { background: #fff; border: 1px solid #e1eae5; border-radius: 10px; padding: 16px; }
.od-item { margin-bottom: 12px; }
.od-item:last-child { margin-bottom: 0; }
.od-label { font-size: .85rem; color: #4a5b53; margin-bottom: 4px; }
.od-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.od-bar { height: 8px; background: #eef1f0; border-radius: 5px; overflow: hidden; }
.od-bar span { display: block; height: 100%; }

/* Exportar */
.obras-export { display: flex; gap: 8px; align-items: center; margin: 18px 0 8px; flex-wrap: wrap; }
.obras-export button { background: #fff !important; color: #233a31 !important; border: 1px solid #cdd6d1 !important; border-radius: 7px; padding: 7px 14px; cursor: pointer; font-size: .85rem; display: inline-flex !important; align-items: center; gap: 6px; }
.obras-export button:hover { background: #eef4f1 !important; }
.obras-export button i { color: var(--tm-verde); }
.obras-limpar { background: #eef2f0 !important; color: #233a31 !important; border: 1px solid #cdd6d1 !important; }
.obras-limpar:hover { background: #e2e8e5 !important; }

/* Tabela */
.obras-tabela { width: 100%; border-collapse: collapse; font-size: .86rem; background: #fff; }
.obras-tabela thead th { background: var(--tm-verde); color: #fff; text-align: left; padding: 10px 12px; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .3px; }
.obras-tabela tbody td { padding: 10px 12px; border-bottom: 1px solid #eef1f0; vertical-align: top; }
.obras-tabela .obra-objeto { max-width: 420px; }
.obras-tabela a { color: var(--tm-azul); text-decoration: none; font-weight: 600; }
.obra-toggle { cursor: pointer; color: var(--tm-verde); width: 22px; text-align: center; }
.obra-toggle i { transition: transform .15s; }
.obra-badge-sit { padding: 3px 9px; border-radius: 12px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.obra-detalhe td { background: #f7faf8; }
.od-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 18px; padding: 6px 4px; }
.od-grid > div { font-size: .85rem; color: #2a3b34; }
.od-grid > div span { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .4px; color: #6c757d; margin-bottom: 2px; }
.od-grid .od-full { grid-column: 1 / -1; }
.obra-link { display: inline-flex; align-items: center; gap: 7px; background: var(--tm-azul); color: #fff !important; text-decoration: none; padding: 7px 14px; border-radius: 6px; font-size: .85rem; }
.obra-link:hover { background: #0a5a90; }

/* Tema escuro */
body.tema-escuro .obras-filtros, body.tema-escuro .obras-stat, body.tema-escuro .obras-tipo-card,
body.tema-escuro .obras-dist, body.tema-escuro .obras-tabela { background: #16221d; border-color: #26352f; }
body.tema-escuro .obras-stat strong, body.tema-escuro .od-grid > div { color: #d6e6df; }
body.tema-escuro .obras-tabela tbody td { border-color: #26352f; }
body.tema-escuro .obra-detalhe td { background: #131d19; }
body.tema-escuro .obras-filtros select, body.tema-escuro .obras-filtros input { background: #0f1714; color: #e6efe9; border-color: #2e463d; }

@media print {
	.tm-header, .tm-barra-acoes, #barra-acessibilidade, .breadcrumb, .obras-filtros, .obras-export,
	.tm-footer, .tm-topo, [vw] { display: none !important; }
	.obra-detalhe { display: table-row !important; }
}

/* ===========================================================
   TEMA ESCURO (toggle na barra de acessibilidade)
   =========================================================== */
body.tema-escuro { background: #0f1714; color: #dfe8e3; }
body.tema-escuro #wrapper,
body.tema-escuro #main,
body.tema-escuro #main > .inner { background: transparent; }

body.tema-escuro .tm-barra-acoes { background: #13201b; border-bottom-color: #26352f; }
body.tema-escuro .btn-inicio { background: #13201b; color: #d6e6df; border-color: #2e463d; }
body.tema-escuro .btn-inicio:hover { background: #1b2c25; }
body.tema-escuro .busca-form { background: #0f1714; border-color: #2e463d; }
body.tema-escuro .busca-form input[type="search"] { color: #e6efe9; }

body.tema-escuro .breadcrumb { background: #13201b; color: #9fb3aa; }
body.tema-escuro .breadcrumb [aria-current="page"] { color: #e6efe9; }

body.tema-escuro .secao h2 { color: #9fd8c2; }
body.tema-escuro .secao p { color: #9fb3aa; }

body.tema-escuro .card { background: #16221d; border-color: #26352f; box-shadow: none; }
body.tema-escuro .card-info h3 { color: #bfe6d5; }
body.tema-escuro .card-info p { color: #9fb3aa; }

body.tema-escuro .inst-bloco { background: #16221d; border-color: #26352f; border-left-color: var(--tm-verde-claro); }
body.tema-escuro .inst-bloco h3 { color: #bfe6d5; }

body.tema-escuro .tm-mapa .grupo h3 { color: #bfe6d5; }
body.tema-escuro a { color: #7fd1b3; }
body.tema-escuro .tm-hero { box-shadow: none; }

/* Em tema escuro, o filtro de alto contraste é redundante; mantém só um ativo */
body.tema-escuro.alto-contraste { filter: none; }
