/* FP Tabelas Técnicas — navegação em tabelas longas */

/* Cabeçalho fixo (clone) */
.fpt-sh { position: fixed; z-index: 990; top: 0; left: 0; overflow: hidden; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s ease; box-shadow: 0 6px 12px -8px rgba(15, 30, 60, .45); }
.fpt-sh.is-on { opacity: 1; visibility: visible; pointer-events: auto; }
.fpt-sh table.fpt-sh__t { margin: 0 !important; max-width: none !important; min-width: 0 !important; will-change: transform; }
.fpt-sh table.fpt-sh__t thead th, .fpt-sh table.fpt-sh__t thead td { cursor: default; }
.fpt-sh table.fpt-sh__t thead .dt-orderable-asc, .fpt-sh table.fpt-sh__t thead .dt-orderable-desc, .fpt-sh table.fpt-sh__t thead .sorting { cursor: pointer; }
.fpt-sh .fpt-sh__frozen { box-shadow: 1px 0 0 rgba(0, 0, 0, .15), 4px 0 6px -4px rgba(0, 0, 0, .3); }

/* Caixa de rolagem lateral criada para tabelas largas */
.fpt-hx { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.fpt-hx > table { margin-bottom: 0; }

/* 1ª coluna congelada */
table.fpt-freeze > thead > tr > :first-child,
table.fpt-freeze > tbody > tr > :first-child,
table.fpt-freeze > tfoot > tr > :first-child { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 rgba(0, 0, 0, .12), 4px 0 6px -4px rgba(0, 0, 0, .25); }
table.fpt-freeze > thead > tr > :first-child { z-index: 2; }

/* Barra de rolagem lateral flutuante */
.fpt-hbar { position: fixed; bottom: 0; left: 0; height: 16px; overflow-x: auto; overflow-y: hidden; z-index: 991; background: rgba(240, 244, 250, .92); border-top: 1px solid rgba(15, 30, 60, .15); display: none; scrollbar-width: auto; }
.fpt-hbar.is-on { display: block; }
.fpt-hbar__in { height: 1px; }

/* Miniatura flutuante */
.fpt-thumb { --fpt-thumb-w: 240px; position: fixed; bottom: calc(16px + var(--fpt-hbar-h, 0px)); right: 16px; z-index: 995; width: var(--fpt-thumb-w); max-width: calc(100vw - 32px); background: var(--fpt-thumb-bg, #6ea4dc); border-radius: 12px; box-shadow: 0 12px 32px -8px rgba(10, 25, 50, .5), 0 0 0 1px rgba(255, 255, 255, .35) inset; overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(12px) scale(.97); transform-origin: bottom right; transition: opacity .18s ease, transform .18s ease, visibility .18s, width .2s ease; font: 13px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.fpt-thumb--left { right: auto; left: 16px; transform-origin: bottom left; }
.fpt-thumb.is-on { opacity: 1; visibility: visible; transform: none; }
.fpt-thumb.is-big { width: min(calc(var(--fpt-thumb-w) * 2), 48vw, 620px); }
.fpt-thumb__bar { display: flex; align-items: center; gap: 2px; padding: 4px 4px 0 10px; color: #fff; }
.fpt-thumb__t { flex: 1; font-weight: 600; font-size: 12px; letter-spacing: .02em; text-transform: uppercase; opacity: .92; }
.fpt-thumb button:not(#fpt-x):not(#fpt-y), .fpt-thumb-pill:not(#fpt-x):not(#fpt-y), .fpt-lb > button:not(#fpt-x):not(#fpt-y) { all: unset; box-sizing: border-box; cursor: pointer; background: transparent; border: 0; box-shadow: none; text-shadow: none; }
.fpt-thumb__bar button:not(#fpt-x):not(#fpt-y) { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; color: #fff; }
.fpt-thumb__bar button:not(#fpt-x):not(#fpt-y):hover, .fpt-thumb__bar button:not(#fpt-x):not(#fpt-y):focus-visible { background: rgba(255, 255, 255, .22); }
.fpt-thumb__img:not(#fpt-x):not(#fpt-y) { display: block; width: 100%; padding: 4px 8px 8px; cursor: zoom-in; }
.fpt-thumb__img img { display: block; width: 100%; height: auto; max-height: 52vh; object-fit: contain; }
.fpt-thumb button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

.fpt-thumb-pill:not(#fpt-x):not(#fpt-y) { position: fixed; bottom: calc(16px + var(--fpt-hbar-h, 0px)); right: 16px; z-index: 995; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: #0f2747; color: #fff; font: 600 13px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; cursor: pointer; box-shadow: 0 8px 20px -6px rgba(10, 25, 50, .55); opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility .18s; }
.fpt-thumb-pill--left:not(#fpt-x):not(#fpt-y) { right: auto; left: 16px; }
.fpt-thumb-pill.is-on:not(#fpt-x):not(#fpt-y) { opacity: 1; visibility: visible; }
.fpt-thumb-pill:not(#fpt-x):not(#fpt-y):focus-visible { outline: 2px solid #6ea4dc; outline-offset: 2px; }

/* Checkbox do visitante */
.fpt-thumb-toggle { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; line-height: 1.3; color: inherit; cursor: pointer; user-select: none; }
.fpt-thumb-toggle input { margin: 0; width: 16px; height: 16px; accent-color: #0b5cad; }

/* Ampliação */
.fpt-lb { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(8, 18, 36, .82); cursor: zoom-out; animation: fpt-lb-in .15s ease; }
.fpt-lb figure { margin: 0; max-width: min(1100px, 100%); max-height: 100%; background: var(--fpt-thumb-bg, #6ea4dc); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.fpt-lb img { display: block; max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; margin: auto; }
.fpt-lb figcaption { color: #fff; font: 600 14px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; text-align: center; }
.fpt-lb > button:not(#fpt-x):not(#fpt-y) { position: absolute; top: 12px; right: 16px; width: 40px; height: 40px; text-align: center; font: 32px/40px system-ui, sans-serif; color: #fff; cursor: pointer; border-radius: 50%; }
.fpt-lb > button:focus-visible { outline: 2px solid #fff; }
@keyframes fpt-lb-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 700px) {
	.fpt-thumb { --fpt-thumb-w: 150px !important; right: 10px; bottom: calc(10px + var(--fpt-hbar-h, 0px)); border-radius: 10px; }
	.fpt-thumb--left { left: 10px; }
	.fpt-thumb.is-big { width: calc(100vw - 20px); }
	.fpt-thumb__bar { padding-left: 8px; }
	.fpt-thumb__bar button:not(#fpt-x):not(#fpt-y) { width: 30px; height: 30px; }
	.fpt-thumb__t { display: none; }
	.fpt-thumb__img:not(#fpt-x):not(#fpt-y) { padding: 2px 6px 6px; }
	.fpt-thumb-pill:not(#fpt-x):not(#fpt-y) { right: 10px; bottom: calc(10px + var(--fpt-hbar-h, 0px)); }
	.fpt-thumb--nomobile { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
	.fpt-thumb, .fpt-thumb-pill, .fpt-sh { transition: none; }
	.fpt-lb { animation: none; }
}
@media print {
	.fpt-sh, .fpt-hbar, .fpt-thumb, .fpt-thumb-pill, .fpt-thumb-toggle, .fpt-lb { display: none !important; }
}

/* Barra acima da tabela: escolher colunas + desenho flutuante */
.fpt-tbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 8px; font-size: 13px; line-height: 1.3; position: relative; z-index: 5; }
.fpt-tbar .fpt-thumb-toggle { margin: 0; }
.fpt-tbar__cols { position: relative; }
.fpt-tbar__btn:not(#fpt-x):not(#fpt-y) { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid rgba(15, 39, 71, .25); border-radius: 8px; background: #fff; color: #0f2747; font: 600 13px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; cursor: pointer; }
.fpt-tbar__btn:not(#fpt-x):not(#fpt-y):hover { border-color: #0b5cad; color: #0b5cad; }
.fpt-tbar__btn:not(#fpt-x):not(#fpt-y):focus-visible { outline: 2px solid #0b5cad; outline-offset: 2px; }
.fpt-tbar__btn.is-active:not(#fpt-x):not(#fpt-y) { background: #e8f1fb; border-color: #0b5cad; color: #0b5cad; }
.fpt-tbar__n { font-weight: 500; }
.fpt-cols { position: absolute; top: calc(100% + 6px); left: 0; z-index: 1000; width: min(340px, calc(100vw - 32px)); max-height: min(60vh, 460px); display: flex; flex-direction: column; background: #fff; color: #1f2937; border: 1px solid rgba(15, 39, 71, .18); border-radius: 10px; box-shadow: 0 14px 34px -10px rgba(10, 25, 50, .4); font: 13px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.fpt-cols[hidden] { display: none; }
.fpt-cols__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #e5e7eb; }
.fpt-cols__head button:not(#fpt-x):not(#fpt-y) { all: unset; cursor: pointer; color: #0b5cad; font-weight: 600; font-size: 12px; }
.fpt-cols__head button:not(#fpt-x):not(#fpt-y):focus-visible { outline: 2px solid #0b5cad; }
.fpt-cols__list { overflow: auto; padding: 6px 4px; }
.fpt-cols__list label { display: flex !important; align-items: flex-start; gap: 8px; padding: 6px 8px; margin: 0; border-radius: 6px; cursor: pointer; font-weight: 400; }
.fpt-cols__list label:hover { background: #f1f5f9; }
.fpt-cols__list input { margin: 2px 0 0; width: 16px; height: 16px; flex: none; accent-color: #0b5cad; }
@media print { .fpt-tbar { display: none !important; } }
.fpt-cols__list input[type="checkbox"]:not(#fpt-x):not(#fpt-y), .fpt-thumb-toggle input[type="checkbox"]:not(#fpt-x):not(#fpt-y) { -webkit-appearance: checkbox !important; appearance: auto !important; width: 16px !important; height: 16px !important; min-width: 0; margin: 2px 0 0; padding: 0; border: 0; background: none; box-shadow: none; position: static; opacity: 1; accent-color: #0b5cad; flex: none; }
.fpt-cols__list input[type="checkbox"]:not(#fpt-x):not(#fpt-y)::before, .fpt-cols__list input[type="checkbox"]:not(#fpt-x):not(#fpt-y)::after, .fpt-thumb-toggle input[type="checkbox"]:not(#fpt-x):not(#fpt-y)::before, .fpt-thumb-toggle input[type="checkbox"]:not(#fpt-x):not(#fpt-y)::after { content: none !important; display: none !important; }
