:root {
  --pj-blue: #005a92;
  --pj-blue-dark: #003d66;
  --pj-blue-soft: #eaf4fb;
  --pj-green: #2e9e63;
  --pj-green-soft: #eaf7f0;
  --pj-amber: #d78318;
  --pj-amber-soft: #fff5e5;
  --pj-violet: #54758f;
  --pj-violet-soft: #eef3f6;
  --pj-red: #d73a49;
  --pj-surface: #ffffff;
  --pj-background: #f4f6f8;
  --pj-foreground: #17324a;
  --pj-muted: #5c7183;
  --pj-border: #d7e0e7;
  --pj-ring: rgba(0, 90, 146, .18);
  --pj-radius: 10px;
  --pj-shadow: 0 1px 3px rgba(17, 46, 70, .08);
}

#painel {
  min-height: 70vh;
  padding: 0 0 72px;
  color: var(--pj-foreground);
  background: var(--pj-background);
  font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
}

#painel *, #painel *::before, #painel *::after { box-sizing: border-box; }
#painel button, #painel select, #painel input { font: inherit; }

.pj-tabbar {
  position: relative;
  z-index: 30;
  border-bottom: 1px solid transparent;
  background: var(--pj-background);
}

.pj-tabs {
  position: static;
  top: auto;
  z-index: auto;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 18px;
  overflow-x: auto;
  background: transparent;
  box-shadow: none;
  scrollbar-width: none;
}

.pj-tabs::-webkit-scrollbar { display: none; }

.pj-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 52px;
  padding: 2px 0 0;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: #50697d;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s, border-color .18s;
}

.pj-tab:hover { color: var(--pj-blue); background: transparent; }
.pj-tab:active { color: var(--pj-blue-dark); }
.pj-tab:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--pj-ring); }
.pj-tab.active {
  color: var(--pj-blue-dark);
  border-bottom-color: var(--pj-blue);
  background: transparent;
  box-shadow: none;
}
.pj-tab i { font-size: 15px; }
.pj-tab__short { display: none; }

.pj-clear {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--pj-red);
  background: #fff;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .18s, opacity .18s;
}
.pj-filter-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-width: 0; }
.pj-filter-actions .pj-clear { flex: none; margin-left: 0; }
.pj-clear--compact { margin-left: auto; padding: 6px 8px; font-size: 11px; }

.pj-clear:hover:not(:disabled) { background: #fff1f2; }
.pj-clear:active:not(:disabled) { transform: scale(.98); }
.pj-clear:disabled { color: #8ba0b3; opacity: .62; cursor: not-allowed; }
.pj-clear:disabled:hover { color: #8ba0b3; background: #fff; }

.pj-wrap { max-width: 1480px; margin: 0 auto; padding: 26px 18px; }
.pj-pane { display: none; position: relative; animation: pj-fade-in .28s ease both; }
.pj-pane.active { display: block; }

.pj-pane.is-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  z-index: 36;
  width: 34%;
  height: 3px;
  border-radius: 999px;
  background: var(--pj-blue);
  box-shadow: 0 0 10px rgba(0, 90, 146, .24);
  animation: pj-loading-bar 1.05s ease-in-out infinite;
  pointer-events: none;
}

.pj-pane.is-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  z-index: 35;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: #dce6ed;
  pointer-events: none;
}

.pj-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.pj-heading__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--pj-blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
}

.pj-heading h1, .pj-heading h2 {
  margin: 0 0 6px;
  color: var(--pj-foreground);
  font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
  font-size: clamp(23px, 2.1vw, 31px);
  font-weight: 700;
  line-height: 1.18;
}

.pj-heading p { max-width: 700px; margin: 0; color: var(--pj-muted); font-size: 14px; line-height: 1.55; }

.pj-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid #cce9d9;
  border-radius: 999px;
  color: #286846;
  background: var(--pj-green-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pj-live::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pj-green);
  box-shadow: 0 0 0 4px rgba(46, 158, 99, .12);
}

.pj-filter-card {
  position: relative;
  margin-bottom: 18px;
  padding: 16px 18px 18px;
  border: 1px solid var(--pj-border);
  border-radius: var(--pj-radius);
  background: var(--pj-surface);
  box-shadow: var(--pj-shadow);
}

.pj-filter-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 18px;
  width: 44px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--pj-blue);
}

.pj-filter-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; padding-bottom: 11px; border-bottom: 1px solid #e8edf1; }
.pj-filter-title { display: flex; align-items: center; gap: 9px; color: var(--pj-foreground); font-size: 14px; font-weight: 800; }
.pj-title-icon, .pj-card-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--pj-blue);
  background: var(--pj-blue-soft);
  font-size: 14px;
}
.pj-filter-title .pj-title-icon { width: 30px; height: 30px; }
.pj-filter-hint { color: var(--pj-muted); font-size: 12px; }

.pj-tip { position: relative; display: inline-flex; }
.pj-tip__btn {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--pj-blue);
  background: var(--pj-blue-soft);
  font-size: 11px;
  cursor: pointer;
}
.pj-tip__btn:hover { filter: brightness(.94); }
.pj-tip__bubble {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: none;
  width: max-content;
  max-width: 280px;
  padding: 9px 11px;
  border: 1px solid #e8edf1;
  border-radius: 8px;
  color: var(--pj-muted);
  background: #fff;
  box-shadow: 0 6px 18px rgba(16, 42, 67, .14);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}
.pj-tip__bubble strong { color: var(--pj-foreground); }
.pj-tip__btn[aria-expanded="true"] + .pj-tip__bubble { display: block; }
@media (max-width: 520px) {
  .pj-tip__bubble { left: auto; right: 0; max-width: 240px; }
}

.pj-filtros { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 0; }
.pj-field--wide { grid-column: span 2; }
#painel .pj-filtros .pj-field label {
  display: block;
  margin: 0 0 6px;
  color: #526d82;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.pj-select-wrap { position: relative; min-width: 0; }

.pj-filtros select {
  width: 100%;
  height: 43px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--pj-border);
  border-radius: 10px;
  appearance: none;
  color: var(--pj-foreground);
  background: #fff;
  box-shadow: none;
  font-size: 14px;
  transition: border-color .18s, box-shadow .18s, background-color .18s;
}

.pj-native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.pj-combobox { position: relative; min-width: 0; }
.pj-combobox__control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  min-width: 0;
  height: 44px;
  overflow: hidden;
  border: 1px solid #cbd7e0;
  border-radius: 8px;
  background: #fff;
  transition: border-color .16s, box-shadow .16s;
}
.pj-combobox__control:hover { border-color: #9fb3c2; }
.pj-combobox.is-open .pj-combobox__control,
.pj-combobox:focus-within .pj-combobox__control { border-color: var(--pj-blue); box-shadow: 0 0 0 3px var(--pj-ring); }
.pj-combobox__input {
  min-width: 0;
  width: 100%;
  height: 42px;
  padding: 0 4px 0 12px;
  overflow: hidden;
  border: 0;
  outline: 0;
  color: var(--pj-foreground);
  background: transparent;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pj-combobox__input::placeholder { color: #8395a5; }
.pj-combobox__toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  padding: 0;
  border: 0;
  border-left: 1px solid #edf1f4;
  color: #60788c;
  background: #f8fafb;
  cursor: pointer;
}
.pj-combobox__toggle i { transition: transform .16s; }
.pj-combobox.is-open .pj-combobox__toggle i { transform: rotate(180deg); }
.pj-combobox__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 80;
  display: none;
  width: 100%;
  min-width: 0;
  max-height: 292px;
  overflow: hidden;
  border: 1px solid #c7d4de;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(16, 42, 67, .16);
}
.pj-combobox.is-open .pj-combobox__menu { display: flex; flex-direction: column; animation: pj-combo-in .14s ease both; }
.pj-combobox__status { flex: none; padding: 9px 11px 7px; border-bottom: 1px solid #edf1f4; color: var(--pj-muted); background: #f8fafb; font-size: 11px; line-height: 1.35; }
.pj-combobox__status strong { color: var(--pj-blue-dark); }
.pj-combobox__options { margin: 0; padding: 5px; overflow-y: auto; list-style: none; }
.pj-combobox__option {
  display: block;
  width: 100%;
  padding: 9px 10px;
  overflow: hidden;
  border-radius: 5px;
  color: #29465d;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.pj-combobox__option:hover,
.pj-combobox__option.is-active { color: var(--pj-blue-dark); background: #eaf3f9; }
.pj-combobox__option[aria-selected='true'] { font-weight: 700; }
.pj-combobox__empty { padding: 15px 11px; color: var(--pj-muted); font-size: 12px; text-align: center; }

.pj-filtros select:hover { border-color: #b8c8d6; background: #fbfdff; }
.pj-filtros select:focus { outline: none; border-color: var(--pj-blue); box-shadow: 0 0 0 3px var(--pj-ring); }

.pj-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-height: 0; margin-top: 12px; }
.pj-active-filters:empty { display: none; }
.pj-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid #c7dbe9;
  border-radius: 999px;
  color: var(--pj-blue-dark);
  background: var(--pj-blue-soft);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.pj-filter-chip:hover { border-color: #9bc1da; background: #dceef9; }
.pj-filter-chip i { font-size: 10px; }

.pj-kpis { display: grid; gap: 14px; margin-bottom: 18px; }
.pj-kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pj-kpi {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 15px 17px;
  border: 1px solid var(--pj-border);
  border-radius: 8px;
  color: var(--pj-foreground);
  background: var(--pj-surface);
  box-shadow: var(--pj-shadow);
  text-align: left;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.pj-kpi:hover { transform: translateY(-1px); border-color: #9fb6c7; box-shadow: 0 4px 10px rgba(17, 46, 70, .08); }
.pj-kpi:focus-visible { outline: none; border-color: var(--pj-blue); box-shadow: 0 0 0 3px var(--pj-ring), var(--pj-shadow); }
.pj-kpi .ic {
  display: grid;
  place-items: center;
  flex: none;
  grid-column: 2;
  grid-row: 1;
  width: 34px;
  height: 34px;
  border: 1px solid #d5e2ea;
  border-radius: 50%;
  color: var(--pj-blue);
  background: #f7fafc;
  font-size: 14px;
}
.pj-kpi .tx { grid-column: 1; grid-row: 1; min-width: 0; }
.pj-kpi .tx small {
  display: block;
  margin-bottom: 2px;
  color: var(--pj-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .025em;
}
.pj-kpi .tx b {
  display: block;
  overflow: hidden;
  color: var(--pj-foreground);
  font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
  font-size: clamp(24px, 2vw, 29px);
  font-weight: 700;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pj-value-updated { animation: pj-value-pop .28s ease both; }
.pj-kpi .go { display: none; }
.pj-kpi.green .ic, .pj-kpi.amber .ic, .pj-kpi.violet .ic { color: var(--pj-blue); background: #f7fafc; }

.pj-grid { display: grid; gap: 14px; }
.pj-grid-main { grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr); align-items: stretch; }
.pj-grid-secondary { grid-template-columns: minmax(320px, .72fr) minmax(0, 1.28fr); margin-top: 14px; }
.pj-grid-contracts { grid-template-columns: minmax(340px, .8fr) minmax(0, 1.2fr); }
.pj-grid-contracts-secondary { grid-template-columns: minmax(280px, .75fr) minmax(360px, 1.2fr) minmax(300px, 1fr); margin-top: 14px; }
.pj-grid-ods { grid-template-columns: 310px minmax(0, 1fr); }
.pj-card {
  min-width: 0;
  padding: 17px;
  overflow: hidden;
  border: 1px solid var(--pj-border);
  border-radius: var(--pj-radius);
  background: var(--pj-surface);
  box-shadow: var(--pj-shadow);
}
.pj-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 0 0 12px; }
.pj-card-title { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.pj-card h3 { margin: 1px 0; color: var(--pj-foreground); font-family: 'Roboto', 'Segoe UI', Arial, sans-serif; font-size: 16px; font-weight: 700; line-height: 1.35; }
.pj-card-subtitle { display: block; color: var(--pj-muted); font-size: 11px; line-height: 1.35; }
.pj-card .tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--pj-border);
  border-radius: 999px;
  color: var(--pj-muted);
  background: #f8fafc;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.pj-mapcard { display: flex; flex-direction: column; }
#mapaInicio, #mapaOds { width: 100%; flex: 1 1 auto; min-height: 470px; border: 1px solid var(--pj-border); border-radius: 12px; overflow: hidden; z-index: 1; }
.pj-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; padding: 0 4px; color: var(--pj-muted); font-size: 12px; line-height: 1.5; }
.pj-note i { margin-top: 2px; color: var(--pj-blue); }
.pj-chart { min-height: 240px; }
.pj-chart-tall { min-height: 0; }

.pj-barlist { display: grid; gap: 2px; padding: 4px 48px 2px 0; }
.pj-barlist__head,
.pj-barlist__row {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(120px, 1fr) 82px;
  align-items: center;
  gap: 12px;
}
.pj-barlist__head { padding: 0 8px 7px; border-bottom: 1px solid #e5ebf0; color: #718596; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .045em; }
.pj-barlist__head span:last-child { text-align: right; }
.pj-barlist__row {
  width: 100%;
  min-height: 29px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  color: var(--pj-foreground);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.pj-barlist__row:hover { background: #f2f7fa; }
.pj-barlist__row:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--pj-ring); }
.pj-barlist__label { min-width: 0; overflow: hidden; color: #3d5870; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.pj-barlist__track { position: relative; height: 12px; overflow: hidden; border-radius: 3px; background: #edf1f4; }
.pj-barlist__fill { display: block; min-width: 2px; height: 100%; border-radius: inherit; background: var(--bar-color, var(--pj-blue)); }
.pj-barlist__value { color: #24465f; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pj-barlist__empty { padding: 36px 12px; color: var(--pj-muted); font-size: 13px; text-align: center; }

.pj-tablecard { margin-top: 16px; padding: 0; overflow: hidden; }
.pj-tablecard > .pj-card-head { margin: 0; padding: 17px 18px 13px; border-bottom: 1px solid var(--pj-border); }
.pj-table-wrap { padding: 14px 18px 18px; overflow-x: auto; }
#painel .dataTables_wrapper { color: var(--pj-foreground); font-size: 13px; }
#painel .dataTables_wrapper .dataTables_length, #painel .dataTables_wrapper .dataTables_filter { margin-bottom: 12px; color: var(--pj-muted); font-size: 12px; }
#painel .dataTables_wrapper .dataTables_length select, #painel .dataTables_wrapper .dataTables_filter input {
  height: 38px;
  border: 1px solid var(--pj-border);
  border-radius: 9px;
  color: var(--pj-foreground);
  background: #fff;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
#painel .dataTables_wrapper .dataTables_length select { margin: 0 5px; padding: 0 28px 0 10px; }
#painel .dataTables_wrapper .dataTables_filter input { min-width: 230px; margin-left: 8px; padding: 0 11px; }
#painel .dataTables_wrapper select:focus, #painel .dataTables_wrapper input:focus { border-color: var(--pj-blue); box-shadow: 0 0 0 3px var(--pj-ring); }
#painel table.dataTable {
  width: 100% !important;
  margin: 0 0 12px !important;
  overflow: hidden;
  border: 1px solid var(--pj-border);
  border-radius: 12px;
  border-spacing: 0;
  border-collapse: separate;
}
#painel table.dataTable.no-footer { border-bottom: 1px solid var(--pj-border); }
#painel table.dataTable thead th {
  padding: 12px 11px;
  border: none;
  border-bottom: 1px solid var(--pj-border);
  color: #3f5d73;
  background: #f0f5f9;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .055em;
  white-space: nowrap;
}
#painel table.dataTable tbody td {
  padding: 11px;
  border-top: none;
  border-bottom: 1px solid #edf1f5;
  color: #40566b;
  background: #fff;
  font-size: 12px;
  line-height: 1.4;
  vertical-align: middle;
}
#painel table.dataTable tbody tr:last-child td { border-bottom: none; }
#painel #tblInicio tbody td:nth-child(5),
#painel #tblOds tbody td:nth-child(4) { white-space: nowrap; }
#painel table.dataTable.stripe tbody tr.odd, #painel table.dataTable.display tbody tr.odd { background: #fff; }
#painel table.dataTable.display tbody tr:hover td { background: #f7fafc !important; }
#painel .dataTables_wrapper .dataTables_info { padding-top: 9px; color: var(--pj-muted); font-size: 12px; }
#painel .dataTables_wrapper .dataTables_paginate { padding-top: 4px; }
#painel .dataTables_wrapper .dataTables_paginate .paginate_button {
  min-width: 34px;
  margin-left: 3px;
  padding: 6px 9px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  color: #486581 !important;
  background: transparent !important;
}
#painel .dataTables_wrapper .dataTables_paginate .paginate_button:hover { border-color: var(--pj-border) !important; color: var(--pj-blue) !important; background: #f1f5f9 !important; }
#painel .dataTables_wrapper .dataTables_paginate .paginate_button.current { border-color: var(--pj-blue) !important; color: #fff !important; background: var(--pj-blue) !important; }

.pj-ficha {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid #cae0ee;
  border-radius: 8px;
  color: var(--pj-blue);
  background: var(--pj-blue-soft);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s;
}
.pj-ficha:hover { border-color: #9fc6dd; color: var(--pj-blue-dark); background: #dceef9; text-decoration: none; }
.pj-ficha:active { transform: scale(.98); }
.pj-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 7px; border: 1px solid currentColor; border-radius: 5px; background: #fff; font-size: 11px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.pj-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pj-badge.is-concluido { color: #075eb8; background: #eef6ff; }
.pj-badge.is-execucao { color: #147247; background: #edf8f2; }
.pj-badge.is-suspenso { color: #b52a38; background: #fff1f2; }
.pj-badge.is-neutro { color: #596b7b; background: #f4f6f8; }
.pj-project-name { display: block; min-width: 240px; color: var(--pj-foreground); font-weight: 700; line-height: 1.45; }
.pj-money { color: #264e6a; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.pj-metricbtns { display: inline-flex; gap: 3px; margin-left: auto; padding: 3px; border: 1px solid var(--pj-border); border-radius: 10px; background: #f4f7fa; }
.pj-metricbtns button { padding: 6px 10px; border: none; border-radius: 7px; color: var(--pj-muted); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; transition: background .15s, color .15s; }
.pj-metricbtns button.active { border-color: transparent; color: var(--pj-blue); background: #fff; box-shadow: 0 2px 8px -5px rgba(16, 42, 67, .5); }

.pj-ods-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.pj-ods { position: relative; aspect-ratio: 1 / 1; padding: 0; overflow: hidden; border: 3px solid transparent; border-radius: 10px; background: #eee; cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s; }
.pj-ods img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pj-ods:hover { transform: scale(1.04); }
.pj-ods:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--pj-ring); }
.pj-ods.sel { border-color: var(--pj-blue); box-shadow: 0 0 0 3px var(--pj-ring); }
.pj-ods.dim { opacity: .35; }
.pj-ods .cnt { position: absolute; top: 4px; right: 4px; padding: 2px 6px; border-radius: 10px; color: #fff; background: rgba(0, 0, 0, .65); font-size: 10px; font-weight: 700; }
.pj-ods-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pj-ods-head img { height: 54px; }
.pj-ods-head h2 { margin: 0; color: var(--pj-foreground); font-family: 'Poppins', sans-serif; font-size: 20px; font-weight: 700; line-height: 1.15; }

.pj-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--pj-border);
  border-radius: 18px;
  color: var(--pj-foreground);
  background: #fff;
  box-shadow: 0 30px 80px -30px rgba(5, 27, 46, .65);
}
.pj-dialog::backdrop { background: rgba(4, 21, 35, .56); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.pj-dialog[open] { animation: pj-dialog-in .2s ease both; }
.pj-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 18px; border-bottom: 1px solid var(--pj-border); }
.pj-dialog__title-wrap { display: flex; align-items: center; gap: 11px; min-width: 0; }
.pj-dialog__icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px; color: var(--pj-blue); background: var(--pj-blue-soft); }
.pj-dialog h2 { margin: 0; font-family: 'Roboto', 'Segoe UI', Arial, sans-serif; font-size: 17px; font-weight: 700; }
.pj-dialog__close { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--pj-border); border-radius: 9px; color: var(--pj-muted); background: #fff; cursor: pointer; }
.pj-dialog__body { max-height: calc(100vh - 164px); padding: 21px 18px; overflow-y: auto; }
.pj-dialog__value { margin-bottom: 8px; overflow-wrap: anywhere; color: var(--pj-blue-dark); font-family: 'Roboto', 'Segoe UI', Arial, sans-serif; font-size: 34px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.pj-dialog__body p { margin: 0; color: var(--pj-muted); font-size: 14px; line-height: 1.6; }
.pj-dialog__details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 19px; padding-top: 17px; border-top: 1px solid var(--pj-border); }
.pj-dialog__metric { min-width: 0; padding: 11px 12px; border: 1px solid #e0e7ec; border-radius: 7px; background: #f8fafb; }
.pj-dialog__metric small { display: block; margin-bottom: 4px; overflow: hidden; color: #6b7f90; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.pj-dialog__metric strong { display: block; overflow: hidden; color: #23445d; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.pj-dialog__context { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 10px 11px; border-radius: 7px; color: #536b7e; background: #eef4f7; font-size: 11px; line-height: 1.45; }
.pj-dialog__context i { margin-top: 2px; color: var(--pj-blue); }
.pj-dialog__foot { display: flex; justify-content: flex-end; padding: 13px 18px; border-top: 1px solid var(--pj-border); background: #f8fafc; }
.pj-dialog__button { padding: 8px 13px; border: 1px solid var(--pj-blue); border-radius: 9px; color: #fff; background: var(--pj-blue); font-size: 13px; font-weight: 800; cursor: pointer; }

.pj-toast {
  position: fixed;
  right: 88px;
  bottom: 22px;
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: min(390px, calc(100vw - 28px));
  padding: 12px 14px;
  border: 1px solid #c7dbe9;
  border-radius: 12px;
  color: var(--pj-foreground);
  background: #fff;
  box-shadow: 0 18px 45px -22px rgba(5, 27, 46, .65);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.pj-toast.show { opacity: 1; transform: translateY(0); }
.pj-toast.error { border-color: #f0bec4; }
.pj-toast i { margin-top: 2px; color: var(--pj-blue); }
.pj-toast.error i { color: var(--pj-red); }
.pj-toast span { font-size: 13px; font-weight: 600; line-height: 1.45; }

/* Detalhes do projeto abertos a partir dos mapas. */
.pj-modal[hidden] { display: none; }
.pj-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.pj-modal-backdrop { position: absolute; inset: 0; background: rgba(16, 42, 67, .58); backdrop-filter: blur(2px); }
.pj-modal-box { position: relative; width: min(900px, 100%); max-height: 90vh; overflow: auto; border-radius: 14px; background: #fff; box-shadow: 0 30px 80px -20px rgba(16, 42, 67, .62); }
.pj-modal-close { position: absolute; top: 12px; right: 12px; z-index: 3; width: 38px; height: 38px; border: 1px solid var(--pj-border); border-radius: 50%; color: var(--pj-blue-dark); background: rgba(255, 255, 255, .94); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(16, 42, 67, .16); }
.pj-modal-close:hover { background: #fff; }
.pj-modal-loading { padding: 60px 20px; color: var(--pj-muted); text-align: center; }
.pj-modal-h { padding: 20px 22px 6px; }
.pj-modal-h h2 { margin: 0; padding-right: 44px; color: var(--pj-foreground); font-size: 1.35rem; line-height: 1.25; }
.pj-modal-h .sub { margin-top: 5px; color: var(--pj-muted); font-size: .95rem; }
.pj-modal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 22px; padding: 14px 22px; }
.pj-fld { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.pj-fld .k { color: var(--pj-muted); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.pj-fld .v { overflow-wrap: anywhere; color: var(--pj-foreground); font-size: .95rem; }
.pj-modal-txt { padding: 6px 22px 14px; }
.pj-modal-txt h4 { margin: 14px 0 4px; color: var(--pj-blue); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.pj-modal-txt p, .pj-modal-txt .pj-clamp { margin: 0; color: #334e68; font-size: .95rem; line-height: 1.5; }
.pj-modal-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--pj-border); background: #fff; }
.pj-modal .pj-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border: 0; border-radius: 8px; color: #fff; background: var(--pj-blue); font-size: .92rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.pj-modal .pj-btn:hover { color: #fff; background: var(--pj-blue-dark); }
.pj-modal .pj-btn.ghost { color: var(--pj-blue-dark); background: #eef4f8; }
.pj-car { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 14px 14px 0 0; background: #102a43; }
.pj-car[hidden] { display: none; }
.pj-car-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pj-car-btn { position: absolute; top: 50%; z-index: 2; width: 42px; height: 42px; transform: translateY(-50%); border: 0; border-radius: 50%; color: var(--pj-blue-dark); background: rgba(255, 255, 255, .88); font-size: 24px; line-height: 1; cursor: pointer; }
.pj-car-btn:hover { background: #fff; }
.pj-car-prev { left: 12px; }
.pj-car-next { right: 12px; }
.pj-car-count { position: absolute; right: 14px; bottom: 12px; z-index: 2; padding: 3px 10px; border-radius: 20px; color: #fff; background: rgba(16, 42, 67, .78); font-size: .8rem; }
.pj-clamp { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; }
.pj-clamp.expanded { display: block; overflow: visible; -webkit-line-clamp: unset; }
.pj-more { margin-top: 2px; padding: 2px 0; border: 0; color: var(--pj-blue); background: none; font-size: .82rem; font-weight: 700; cursor: pointer; }
.pj-more:hover { text-decoration: underline; }
.pj-more[hidden] { display: none; }

/* Evita que os controles globais flutuantes cubram cards e ações do painel. */
[vw].enabled {
  top: auto !important;
  right: 14px !important;
  bottom: 96px !important;
  transform: none !important;
}
[vw-access-button] {
  position: static !important;
  inset: auto !important;
}

@keyframes pj-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pj-dialog-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes pj-combo-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes pj-loading-bar { from { transform: translateX(-120%); } to { transform: translateX(395%); } }
@keyframes pj-value-pop { from { opacity: .55; transform: translateY(3px); } to { opacity: 1; transform: none; } }

@media (max-width: 1199.98px) {
  .pj-filtros { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pj-field--wide { grid-column: span 2; }
  .pj-kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pj-grid-main, .pj-grid-contracts { grid-template-columns: 1fr 1fr; }
  .pj-grid-contracts-secondary { grid-template-columns: 1fr 1fr; }
  .pj-grid-contracts-secondary .pj-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 991.98px) {
  .pj-tabbar { top: 60px; }
  .pj-wrap { padding-top: 22px; }
  .pj-grid-main, .pj-grid-secondary, .pj-grid-contracts, .pj-grid-contracts-secondary, .pj-grid-ods { grid-template-columns: 1fr; }
  .pj-grid-contracts-secondary .pj-card:last-child { grid-column: auto; }
  #mapaInicio, #mapaOds { min-height: 390px; }
}

@media (max-width: 767.98px) {
  .pj-tabs { gap: 16px; padding: 0 12px; }
  .pj-tab { gap: 6px; min-height: 48px; padding: 2px 0 0; font-size: 12px; }
  .pj-tab__full { display: none; }
  .pj-tab__short { display: inline; }
  .pj-tab i { font-size: 16px; }
  .pj-clear { padding: 8px 10px; font-size: 12px; }
  .pj-wrap { padding: 18px 12px; }
  .pj-heading { gap: 14px; }
  .pj-live { display: none; }
  .pj-heading h1, .pj-heading h2 { font-size: 23px; }
  .pj-filter-card { padding: 14px; }
  .pj-filter-head { align-items: flex-start; }
  .pj-filter-actions { align-items: flex-end; flex-direction: column; gap: 7px; }
  .pj-filter-hint { display: none; }
  .pj-filtros { grid-template-columns: 1fr; }
  .pj-field--wide { grid-column: auto; }
  .pj-kpis.k4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pj-kpi { grid-template-columns: minmax(0, 1fr) 32px; gap: 10px; padding: 13px; }
  .pj-kpi .ic { grid-column: 2; width: 32px; height: 32px; border-radius: 50%; font-size: 13px; }
  .pj-kpi .tx { grid-column: 1; }
  .pj-kpi .tx b { font-size: 20px; }
  .pj-kpi .go { display: none; }
  .pj-card { padding: 14px; }
  .pj-card-head { gap: 8px; }
  .pj-tablecard { padding: 0; }
  .pj-tablecard > .pj-card-head { padding: 14px; }
  .pj-table-wrap { padding: 12px; overflow: visible; }
  .pj-toast { right: 14px; bottom: 82px; }
  .back-to-top { display: none !important; }
  [vw].enabled { right: 12px !important; bottom: 18px !important; }
  #mapaInicio, #mapaOds { min-height: 350px; }
  .pj-metricbtns { width: 100%; margin-top: 8px; }
  .pj-metricbtns button { flex: 1; padding-inline: 7px; }
  .pj-contract-year-head { flex-wrap: wrap; }
  .pj-contract-year-head .pj-card-title { width: 100%; }
  .pj-dialog__details { grid-template-columns: 1fr; }
  .pj-modal { align-items: flex-end; padding: 0; }
  .pj-modal-box { max-height: 94vh; border-radius: 14px 14px 0 0; }
  .pj-modal-grid { grid-template-columns: 1fr; }
  .pj-modal-foot { padding: 12px 14px; }

  .pj-barlist__head { display: none; }
  .pj-barlist__row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; padding: 7px 5px; }
  .pj-barlist__track { grid-column: 1 / -1; grid-row: 2; height: 10px; }
  .pj-barlist__value { grid-column: 2; grid-row: 1; }

  #painel .dataTables_wrapper .dataTables_length { display: none; }
  #painel .dataTables_wrapper .dataTables_filter { float: none; margin: 0 0 12px; text-align: left; }
  #painel .dataTables_wrapper .dataTables_filter label { display: block; font-size: 0; }
  #painel .dataTables_wrapper .dataTables_filter input { width: 100%; min-width: 0; height: 42px; margin: 0; font-size: 14px; }
  #painel table.dataTable { display: block; overflow: visible; border: 0; border-radius: 0; background: transparent; }
  #painel table.dataTable thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; border: 0; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  #painel table.dataTable tbody { display: grid; gap: 12px; width: 100%; }
  #painel table.dataTable tbody tr { display: grid; width: 100%; padding: 14px; border: 1px solid var(--pj-border); border-radius: 14px; background: #fff; box-shadow: 0 10px 28px -25px rgba(16, 42, 67, .6); }
  #painel table.dataTable tbody tr:hover td { background: transparent !important; }
  #painel table.dataTable tbody td { display: grid; grid-template-columns: minmax(92px, .42fr) minmax(0, 1fr); gap: 12px; align-items: start; width: 100%; padding: 8px 0; border: 0; border-bottom: 1px solid #edf1f5; background: transparent !important; text-align: left !important; }
  #painel table.dataTable tbody td::before { content: attr(data-label); color: #6b8295; font-size: 10px; font-weight: 800; line-height: 1.4; text-transform: uppercase; letter-spacing: .045em; }
  #painel table.dataTable tbody td.pj-row-title { order: -2; display: block; margin-bottom: 3px; padding: 0 0 11px; border-bottom: 1px solid var(--pj-border); }
  #painel table.dataTable tbody td.pj-row-title::before { display: block; margin-bottom: 5px; }
  #painel table.dataTable tbody td.pj-row-action { order: 10; display: block; padding: 12px 0 0; border-bottom: 0; }
  #painel table.dataTable tbody td.pj-row-action::before { display: none; }
  #painel table.dataTable tbody td.pj-row-action .pj-ficha { width: 100%; min-height: 40px; }
  #painel table.dataTable tbody td:last-child:not(.pj-row-action) { border-bottom: 0; }
  .pj-project-name { min-width: 0; font-size: 14px; }
  #painel .dataTables_wrapper .dataTables_info { float: none; padding: 7px 0; text-align: center; }
  #painel .dataTables_wrapper .dataTables_paginate { float: none; white-space: normal; text-align: center; }
  #painel .dataTables_wrapper .dataTables_paginate .paginate_button { margin-top: 4px; }
}

@media (max-width: 430px) {
  .pj-kpis.k4 { grid-template-columns: 1fr; }
  .pj-kpi { grid-template-columns: minmax(0, 1fr) 32px; }
}

@media (prefers-reduced-motion: reduce) {
  #painel *, #painel *::before, #painel *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
