:root {
	--tp-sidebar-bg: #0b1057;
	--tp-sidebar-text: #e8e9f7;
	--tp-sidebar-active: #ffb703;
	--tp-card-primary: #0b1057;
	--tp-card-icon: #0b1057;
	--tp-card-hover: #141c8f;
	--tp-status-online: #16a34a;
	--tp-status-offline: #dc2626;
	--tp-status-warning: #f59e0b;
}

.tp-portal {
	display: flex;
	align-items: flex-start;
	gap: 28px;
	max-width: 1280px;
	margin: 0 auto;
	padding: 24px 16px 60px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1a1a2e;
	box-sizing: border-box;
}
.tp-portal *, .tp-portal *::before, .tp-portal *::after { box-sizing: border-box; }

/* Sidebar */
.tp-sidebar {
	flex: 0 0 260px;
	position: sticky;
	top: 20px;
	align-self: flex-start;
	background: var(--tp-sidebar-bg);
	border-radius: 12px;
	padding: 18px 0;
	box-shadow: 0 8px 24px rgba(11, 16, 87, 0.18);
}
.tp-sidebar-nav { display: flex; flex-direction: column; }
.tp-sidebar-link {
	display: block;
	padding: 12px 22px;
	color: var(--tp-sidebar-text);
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	border-left: 3px solid transparent;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.tp-sidebar-link:hover {
	background: rgba(255, 255, 255, 0.08);
}
.tp-sidebar-link.is-active {
	border-left-color: var(--tp-sidebar-active);
	color: var(--tp-sidebar-active);
	background: rgba(255, 255, 255, 0.06);
}

/* Main / Grid */
.tp-main { flex: 1 1 auto; min-width: 0; }
.tp-category-section { margin-bottom: 44px; scroll-margin-top: 24px; }
.tp-category-title {
	font-size: 22px;
	font-weight: 800;
	color: var(--tp-card-primary);
	border-bottom: 2px solid rgba(11, 16, 87, 0.12);
	padding-bottom: 10px;
	margin-bottom: 20px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.tp-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 18px;
}

.tp-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	text-align: center;
	background: #fff;
	border: 1px solid #e7e8f2;
	border-radius: 14px;
	padding: 28px 16px;
	text-decoration: none;
	color: #1a1a2e;
	box-shadow: 0 2px 6px rgba(11, 16, 87, 0.06);
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.tp-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 28px rgba(11, 16, 87, 0.16);
	border-color: var(--tp-card-hover);
}
.tp-card-icon {
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--tp-card-icon);
}
.tp-icon-svg { width: 100%; height: 100%; }
.tp-card-title { font-weight: 700; font-size: 15px; color: var(--tp-card-primary); }
.tp-card-empresa { font-size: 11px; color: #666; margin-top: -6px; }

.tp-card-offline { border-color: var(--tp-status-offline); }
.tp-card-lento { border-color: var(--tp-status-warning); }
.tp-card-badge {
	font-size: 11px;
	font-weight: 600;
	color: #fff;
	background: var(--tp-status-warning);
	padding: 4px 8px;
	border-radius: 999px;
}
.tp-card-badge-offline { background: var(--tp-status-offline); }
.tp-card-badge-lento { background: var(--tp-status-warning); }

/* Dados abertos (rodapé) */
.tp-open-data {
	margin-top: 40px;
	padding-top: 28px;
	border-top: 2px solid rgba(11, 16, 87, 0.12);
}
.tp-open-data h2 { color: var(--tp-card-primary); font-size: 20px; margin-bottom: 4px; }
.tp-open-data-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.tp-open-data-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #f2f3fb;
	border: 1px solid #dfe1f2;
	border-radius: 999px;
	padding: 8px 14px;
	font-size: 13px;
	color: var(--tp-card-primary);
	text-decoration: none;
	font-weight: 600;
}
.tp-open-data-chip:hover { background: #e4e6f9; }
.tp-open-data-ext {
	background: var(--tp-card-primary);
	color: #fff;
	font-size: 10px;
	font-weight: 800;
	padding: 2px 6px;
	border-radius: 4px;
}

/* Modal de aviso de terceiros */
.tp-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
}
.tp-modal.is-open { display: flex; }
.tp-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(11, 16, 87, 0.55);
	backdrop-filter: blur(2px);
}
.tp-modal-content {
	position: relative;
	background: #fff;
	border-radius: 16px;
	max-width: 460px;
	width: calc(100% - 32px);
	padding: 28px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
	animation: tp-modal-in 0.18s ease;
}
@keyframes tp-modal-in {
	from { opacity: 0; transform: translateY(10px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}
.tp-modal-content h3 { margin-top: 0; color: var(--tp-card-primary); }
.tp-modal-content p { color: #444; font-size: 14px; line-height: 1.5; }
.tp-modal-status-msg.is-offline { color: var(--tp-status-offline); font-weight: 600; }
.tp-modal-status-msg.is-lento { color: var(--tp-status-warning); font-weight: 600; }
.tp-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.tp-btn {
	border: none;
	border-radius: 8px;
	padding: 10px 18px;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
}
.tp-btn-primary { background: var(--tp-card-primary); color: #fff; }
.tp-btn-primary:hover { background: var(--tp-card-hover); }
.tp-btn-secondary { background: #eceef8; color: #333; }
.tp-btn-secondary:hover { background: #dfe1f2; }

/* Fiscalização e Auditoria (Atricon / Tribunal de Contas) */
.tp-institucional {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 2px solid rgba(11, 16, 87, 0.12);
}
.tp-institucional h2 { color: var(--tp-card-primary); font-size: 18px; margin-bottom: 4px; }
.tp-institucional-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.tp-institucional-link {
	display: inline-flex;
	align-items: center;
	background: var(--tp-card-primary);
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	font-size: 13px;
	padding: 10px 16px;
	border-radius: 8px;
}
.tp-institucional-link:hover { background: var(--tp-card-hover); }

@media (max-width: 782px) {
	.tp-portal { flex-direction: column; }
	.tp-sidebar { position: static; width: 100%; flex-basis: auto; }
	.tp-sidebar-nav { flex-direction: row; flex-wrap: wrap; }
	.tp-sidebar-link { flex: 1 1 auto; text-align: center; border-left: none; border-bottom: 3px solid transparent; }
	.tp-sidebar-link.is-active { border-left-color: transparent; border-bottom-color: var(--tp-sidebar-active); }
}
