@font-face {
  font-family: Nexa;
  src: url('/assets/nexa-regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Nexa;
  src: url('/assets/nexa-bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
:root {
  --blue: #00388b;
  --red: #fc0019;
  /* Cores de fonte por função, compartilhadas por todas as páginas e tamanhos. */
  --text-brand: var(--blue);
  --text-body: #172d4a;
  --text-secondary: #52657c;
  --text-inverse: #fff;
  --text-disabled: #8996a8;
  --text-negative: #bf1327;
  --text-positive: #13724b;
  --heading-text: var(--text-brand);
  --metric-text: var(--text-brand);
  --surface-red-readable: #e00016;
  --ink: var(--text-body);
  --muted: var(--text-secondary);
  --line: #dde5ef;
  --canvas: #f5f7fb;
  --green: var(--text-positive);
  --danger: var(--text-negative);
  --radius: 18px;
  font-family: Nexa, Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
}
a {
  color: inherit;
  text-decoration: none;
}
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}
svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
button svg {
  pointer-events: none;
}
button {
  border: 0;
}
.skip {
  position: fixed;
  top: -90px;
  left: 10px;
  background: #fff;
  padding: 15px;
  z-index: 100;
}
.skip:focus {
  top: 10px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  padding: 36px 22px 22px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.wordmark {
  display: block;
  color: var(--blue);
  padding: 0 16px;
}
.wordmark > span {
  font-size: 15px;
  letter-spacing: 2px;
  font-weight: 700;
}
.wordmark strong {
  display: block;
  letter-spacing: -2px;
  font-size: 46px;
  line-height: 1.05;
}
.dot {
  color: var(--red);
}
.slogan {
  padding: 0 16px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  margin: 15px 0 34px;
}
.nav-section {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: var(--muted);
  font-weight: 700;
  padding: 0 16px;
  margin-bottom: 12px;
}
.second {
  margin-top: 30px;
}
nav {
  display: grid;
  gap: 7px;
}
nav a {
  display: flex;
  gap: 13px;
  align-items: center;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 13px;
  border-radius: 11px;
  color: var(--muted);
  font-weight: 700;
  position: relative;
}
nav a:hover {
  background: #f3f6fc;
  color: var(--blue);
}
nav a.active {
  color: var(--blue);
  background: #edf3fd;
}
nav a.active:before {
  content: '';
  width: 3px;
  height: 20px;
  position: absolute;
  left: 0;
  background: var(--red);
  border-radius: 3px;
}
.icon {
  display: flex;
}
.side-bottom {
  margin-top: auto;
  padding: 25px 10px 0;
}
.small-pill {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--blue);
  background: #edf3fd;
  padding: 6px 9px;
  border-radius: 5px;
  font-weight: 700;
}
.side-bottom > p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.identity {
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 20px;
}
.identity strong {
  font-size: 10px;
  display: block;
}
.identity small {
  font-size: 9px;
  color: var(--muted);
  display: block;
  margin-top: 5px;
}
.avatar {
  border: 1px solid var(--line);
  padding: 9px;
  border-radius: 50%;
  color: var(--blue);
}
.avatar svg {
  width: 16px;
  height: 16px;
}
.workspace {
  margin-left: 250px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 92px;
  border-top: 4px solid var(--red);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.logo {
  width: 300px;
  height: auto;
  max-height: 83px;
  object-fit: contain;
}
.top-actions {
  display: flex;
  gap: 22px;
  align-items: center;
}
.environment {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.environment i {
  width: 7px;
  height: 7px;
  background: var(--blue);
  border-radius: 50%;
}
.icon-button {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--blue);
  font-size: 24px;
}
.mobile-menu {
  display: none;
}
main {
  padding: 30px 38px 20px;
  flex: 1;
  min-width: 0;
}
.filter-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.filter-fields {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.field {
  display: grid;
  gap: 7px;
}
.field span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--muted);
}
select,
input {
  height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 0 12px;
  color: var(--ink);
  min-width: 185px;
  font-size: 12px;
}
select {
  padding-right: 28px;
}
input[type='search'] {
  min-width: 250px;
}
.secondary,
.primary {
  min-height: 42px;
  padding: 11px 16px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.secondary {
  color: var(--blue);
  background: #fff;
  border: 1px solid var(--line);
}
.primary {
  background: var(--blue);
  color: var(--text-inverse);
}
.secondary:hover {
  background: #edf3fd;
}
.primary:hover {
  background: #002767;
}
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 15px;
  font-size: 12px;
  font-weight: 700;
}
.section-label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 22px;
}
.summary-card {
  background: #fff;
  padding: 20px 20px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.summary-card.primary-card {
  background: var(--blue);
  color: var(--text-inverse);
  border-color: var(--blue);
}
.summary-card.primary-card:before {
  content: '';
  position: absolute;
  width: 65px;
  height: 5px;
  background: var(--red);
  top: 0;
  left: 20px;
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 24px;
}
.card-top svg {
  width: 19px;
  opacity: 0.8;
}
.value-pair {
  display: flex;
  gap: 24px;
  align-items: flex-end;
}
.value-pair > div {
  flex: 1;
}
.value-pair strong {
  font-size: 32px;
  line-height: 1;
  display: block;
  font-weight: 700;
}
.value-pair small {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-top: 7px;
}
.primary-card .value-pair small {
  color: var(--text-inverse);
}
.card-bottom {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 20px;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
}
.primary-card .card-bottom {
  border-color: #ffffff40;
  color: var(--text-inverse);
}
.card-bottom strong {
  color: var(--ink);
}
.primary-card .card-bottom strong {
  color: var(--text-inverse);
}
.source-notice {
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid #d5e2f8;
  background: #ecf2fc;
  border-radius: 12px;
  padding: 14px 17px;
  margin-bottom: 24px;
  color: var(--blue);
}
.source-notice p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}
.source-notice strong {
  font-weight: 700;
}
.source-notice .icon {
  flex-shrink: 0;
}
.source-notice a {
  font-size: 11px;
  font-weight: 700;
  margin-left: auto;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.panel {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 22px 20px;
  gap: 15px;
}
.panel-head h2 {
  font-size: 16px;
  margin: 0 0 6px;
  font-weight: 700;
}
.panel-head p {
  color: var(--muted);
  font-size: 11px;
  margin: 0;
  line-height: 1.6;
}
.panel-actions {
  display: flex;
  gap: 8px;
}
.panel-actions button {
  font-size: 11px;
}
.matrix-wrap {
  overflow-x: auto;
  width: 100%;
}
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
thead th {
  font-weight: 700;
  color: var(--blue);
  font-size: 10px;
  background: #f7f9fc;
  padding: 11px 14px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
thead tr:first-child th {
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.4px;
}
thead th:first-child {
  text-align: left;
}
th.sticky,
td.sticky {
  position: sticky;
  left: 0;
  z-index: 2;
  background: inherit;
  border-right: 1px solid var(--line);
  min-width: 235px;
}
thead th.sticky {
  background: #f7f9fc;
  z-index: 3;
}
tbody tr {
  background: #fff;
}
tbody tr:hover {
  background: #f8faff;
}
td {
  padding: 14px;
  text-align: right;
  border-bottom: 1px solid #edf1f6;
  white-space: nowrap;
}
td:first-child {
  text-align: left;
  font-weight: 700;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.row-label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.row-dot {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: #9cb1d1;
}
.neutral {
  color: var(--blue);
}
.negative,
.reconcile {
  color: var(--danger);
}
.positive {
  color: var(--green);
}
.placeholder {
  color: var(--muted);
}
.row-toggle {
  background: transparent;
  padding: 0;
  color: var(--blue);
  font-size: 17px;
  width: 20px;
  height: 20px;
  line-height: 1;
}
.row-toggle:disabled {
  color: var(--text-disabled);
}
.group-row td {
  background: #f6f8fc;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding-top: 9px;
  padding-bottom: 9px;
}
.group-row td.sticky {
  background: #f6f8fc;
}
.reconcile-row {
  background: #fff7f8;
}
.reconcile-row td:first-child {
  color: var(--danger);
}
.reconcile-row .row-dot {
  background: var(--red);
}
.matrix-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 15px 22px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.7;
}
.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.legend i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.support-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  margin-top: 20px;
}
.support-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 20px 22px;
}
.support-card h3 {
  font-size: 13px;
  margin: 0 0 10px;
}
.support-card p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  margin: 0;
}
.support-card.accent {
  border-left: 4px solid var(--red);
}
.meta-line {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.meta-line:last-child {
  border-bottom: 0;
}
.meta-line strong {
  color: var(--blue);
  margin-left: auto;
}
.app-footer {
  padding: 24px 38px;
  color: var(--muted);
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--blue);
}
.page-intro {
  padding: 8px 0 26px;
  max-width: 700px;
}
.page-intro h1 {
  font-size: 30px;
  margin: 10px 0;
  letter-spacing: -0.8px;
}
.page-intro p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}
.empty-state {
  padding: 75px 24px;
  text-align: center;
}
.empty-state .empty-icon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  background: #edf3fd;
  color: var(--blue);
  border-radius: 22px;
  margin: 0 auto 20px;
}
.empty-state svg {
  width: 30px;
  height: 30px;
}
.empty-state h2 {
  font-size: 20px;
}
.empty-state p {
  max-width: 500px;
  margin: 12px auto 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}
.people-blank {
  min-height: 65vh;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.journey-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.journey-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.journey-icon {
  width: 45px;
  height: 45px;
  background: #edf3fd;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--blue);
}
.journey-card h2 {
  font-size: 18px;
  line-height: 1.4;
  margin: 0;
}
.journey-card p {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0;
}
.journey-card ul {
  font-size: 12px;
  line-height: 2;
  padding-left: 18px;
  color: var(--muted);
  margin: 0;
}
.journey-card .secondary {
  margin-top: auto;
}
.status-tag {
  font-size: 9px;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: #f3f6fa;
  padding: 5px 8px;
  border-radius: 5px;
  align-self: flex-start;
}
.data-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.flow-card {
  padding: 24px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}
.flow-card h2 {
  font-size: 17px;
  margin: 15px 0 10px;
}
.flow-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
.flow-card .number {
  font-size: 12px;
  color: var(--red);
  font-weight: 700;
}
.flow-card .meta-line {
  font-size: 10px;
}
.details {
  border-top: 1px solid var(--line);
  padding-top: 13px;
}
.details summary {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
}
.details p {
  margin-top: 12px;
}
.status-badge {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 6px;
  background: #eef3fa;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
}
.status-badge.warn {
  background: #fff0f2;
  color: var(--danger);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 35px;
  max-width: 600px;
  width: calc(100% - 32px);
  color: var(--ink);
  box-shadow: 0 30px 90px #152f5540;
}
dialog::backdrop {
  background: #10294c70;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-size: 30px;
  color: var(--blue);
  line-height: 1.2;
}
dialog p,
dialog dd {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}
dialog dt {
  font-size: 13px;
  font-weight: 700;
  margin: 18px 0 4px;
}
dialog dd {
  margin-left: 0;
}
dialog .close {
  position: absolute;
  right: 18px;
  top: 18px;
}
dialog .primary {
  margin-top: 15px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  background: var(--blue);
  color: var(--text-inverse);
  border-radius: 12px;
  font-size: 12px;
  z-index: 100;
  display: none;
  max-width: 90vw;
}
#toast.show {
  display: block;
}
.mobile-shade {
  display: none;
}
@media (min-width: 1600px) {
  main {
    padding: 35px 48px;
  }
  .topbar {
    padding: 0 48px;
  }
  .summary-card {
    padding: 25px;
  }
  .value-pair strong {
    font-size: 40px;
  }
  td {
    padding: 16px;
  }
  .matrix-wrap {
    min-height: 530px;
  }
}
@media (max-width: 1180px) {
  .sidebar {
    width: 222px;
    padding-left: 13px;
    padding-right: 13px;
  }
  .workspace {
    margin-left: 222px;
  }
  main {
    padding: 25px;
  }
  .topbar {
    padding: 0 25px;
  }
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .journey-grid {
    grid-template-columns: 1fr;
  }
  .data-flow {
    grid-template-columns: 1fr;
  }
  .value-pair strong {
    font-size: 34px;
  }
  .card-top {
    margin-bottom: 16px;
  }
  .card-bottom {
    margin-top: 14px;
  }
  .panel-head {
    flex-wrap: wrap;
  }
  .support-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
    width: 270px;
    box-shadow: 10px 0 50px #152f5525;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .workspace {
    margin-left: 0;
  }
  .mobile-menu {
    display: flex;
    flex-shrink: 0;
  }
  .topbar {
    height: 88px;
    padding: 0 14px;
    gap: 8px;
  }
  .logo {
    width: min(300px, calc(100vw - 125px));
    max-height: 78px;
  }
  .top-actions {
    gap: 5px;
  }
  .environment {
    display: none;
  }
  main {
    padding: 22px 16px;
  }
  .filter-fields {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .field input,
  .field select {
    width: 100%;
    min-width: 0;
  }
  .field.search-field {
    grid-column: 1/-1;
  }
  .filter-bar > .secondary {
    margin-left: auto;
  }
  .summary-grid {
    gap: 10px;
  }
  .summary-card {
    padding: 17px 14px;
    border-radius: 13px;
  }
  .card-top {
    font-size: 11px;
    min-height: 28px;
    margin-bottom: 17px;
    align-items: flex-start;
  }
  .card-top svg {
    width: 17px;
  }
  .value-pair {
    gap: 12px;
  }
  .value-pair strong {
    font-size: 27px;
  }
  .value-pair small {
    font-size: 9px;
  }
  .card-bottom {
    font-size: 9px;
    gap: 3px;
  }
  .source-notice {
    padding: 13px;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 9px;
  }
  .source-notice p {
    font-size: 11px;
    flex: 1;
  }
  .source-notice a {
    margin-left: 30px;
  }
  .source-notice svg {
    width: 20px;
  }
  .panel-head {
    padding: 20px 16px;
  }
  .panel-head h2 {
    font-size: 15px;
  }
  .panel-head p {
    max-width: 230px;
  }
  .panel-actions {
    width: 100%;
    justify-content: space-between;
  }
  .panel-actions .secondary {
    font-size: 10px;
    min-height: 38px;
    padding: 8px 10px;
  }
  .panel {
    border-radius: 14px;
  }
  .matrix-wrap {
    max-height: none;
  }
  th.sticky,
  td.sticky {
    min-width: 190px;
    max-width: 210px;
  }
  table {
    min-width: 850px;
    font-size: 11px;
  }
  td {
    padding: 13px 11px;
  }
  thead th {
    padding: 10px;
    font-size: 9px;
  }
  .matrix-footer {
    padding: 14px 16px;
    font-size: 9px;
  }
  .app-footer {
    padding: 18px 16px;
    font-size: 9px;
    flex-direction: column;
    gap: 7px;
  }
  .support-card {
    padding: 18px;
  }
  .page-intro h1 {
    font-size: 25px;
  }
  .empty-state {
    padding: 50px 20px;
  }
  .empty-state h2 {
    font-size: 18px;
  }
  .journey-card {
    padding: 20px;
  }
  .section-label {
    font-size: 11px;
  }
  .section-label span {
    font-size: 9px;
  }
  .mobile-shade.show {
    display: block;
    position: fixed;
    inset: 0;
    background: #0d2e5670;
    z-index: 15;
  }
  .identity strong {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
@media print {
  .sidebar,
  .topbar,
  .app-footer,
  .filter-bar,
  .panel-actions,
  .source-notice,
  .support-grid {
    display: none;
  }
  .workspace {
    margin: 0;
  }
  main {
    padding: 0;
  }
  .matrix-wrap {
    overflow: visible;
  }
  .panel {
    border: 0;
  }
  .summary-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  @page {
    size: A4 landscape;
    margin: 10mm;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.support-card.accent-gap {
  margin-top: 20px;
}
.meta-line strong {
  overflow-wrap: anywhere;
  min-width: 0;
  text-align: right;
}

.flag-filter {
  position: relative;
  min-width: 215px;
  flex: 1;
}
.flag-filter summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  gap: 7px;
}
.flag-filter summary::-webkit-details-marker {
  display: none;
}
.flag-filter summary > span {
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 700;
}
.flag-filter summary > strong {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
}
.flag-filter summary > strong:after {
  content: '⌄';
  color: var(--blue);
  margin-left: 15px;
}
.flag-filter[open] summary > strong {
  border-color: var(--blue);
}
.flag-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 310px;
  max-width: calc(100vw - 32px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 15px 40px #172d4a20;
  z-index: 12;
}
.flag-actions {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  gap: 12px;
}
.flag-actions button {
  background: #edf3fd;
  border-radius: 6px;
  color: var(--blue);
  font-size: 11px;
  padding: 9px;
}
.flag-popover fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  max-height: 320px;
  overflow: auto;
}
.flag-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 39px;
  font-size: 12px;
  padding: 5px;
  border-radius: 6px;
  cursor: pointer;
}
.flag-option:hover {
  background: #f3f6fc;
}
.flag-option input[type='checkbox'] {
  appearance: auto;
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  margin: 0;
  accent-color: var(--blue);
}
.flag-popover input[type='search'] {
  min-width: 0;
  width: 100%;
  margin-bottom: 10px;
}
.flag-group {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  margin: 13px 0 5px;
}
.filter-fields {
  flex: 1;
}
.summary-grid:empty {
  display: none;
}
@media (max-width: 760px) {
  .flag-filter {
    min-width: 0;
  }
  .flag-filter summary > span {
    font-size: 9px;
  }
  .flag-filter summary > strong {
    font-size: 11px;
  }
  .flag-filter .flag-popover {
    position: static;
    width: 100%;
    max-width: none;
    box-shadow: none;
    margin-top: 8px;
  }
  .flag-filter {
    grid-column: 1/-1;
  }
  .flag-option {
    min-height: 43px;
  }
  .flag-popover fieldset {
    max-height: 280px;
  }
}

.login-button {
  width: 100%;
  margin-top: 14px;
  font-size: 11px;
}
#auth-message {
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.identity strong {
  overflow-wrap: anywhere;
}

@media (min-width: 1181px) {
  .summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  }
}
.reconcile-card {
  border-top: 3px solid var(--red);
}
.reconcile-card .card-top {
  color: var(--danger);
}
@media (max-width: 760px) {
  .filter-bar {
    display: block;
  }
  .filter-fields {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
    flex: none;
  }
  .filter-bar > .secondary {
    display: flex;
    margin: 12px 0 0 auto;
  }
  .field {
    min-width: 0;
  }
  .field select {
    width: 100%;
  }
}

/* 0.2.1: ações explícitas, contexto e navegação por teclado */
button.summary-card {
  text-align: left;
  font: inherit;
  color: var(--ink);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
button.primary-card {
  color: var(--text-inverse);
}
button.summary-card:hover {
  box-shadow: 0 4px 15px #00388b16;
  border-color: var(--blue);
}
button.reconcile-card:hover {
  border-color: var(--red);
}
.card-action {
  font-size: 10px;
  font-weight: 700;
  color: var(--blue);
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 14px;
}
.primary-card .card-action {
  color: var(--text-inverse);
}
.card-action svg {
  width: 15px;
  height: 15px;
}
.selection-context {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 0 0 18px;
  font-size: 12px;
  color: var(--muted);
}
.text-link {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
}
.unit-link {
  background: none;
  padding: 5px 0;
  color: var(--blue);
  text-align: left;
  font: inherit;
  font-weight: 700;
  min-height: 32px;
}
.unit-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.reconcile-row .unit-link {
  color: var(--danger);
}
.sidebar {
  overflow-y: auto;
}
.side-bottom {
  flex-shrink: 0;
}
.flag-actions button,
.icon-button {
  min-height: 44px;
}
.flag-option {
  min-height: 44px;
}
main:focus:not(:focus-visible) {
  outline: none;
}
.primary:focus-visible,
.primary-card:focus-visible {
  outline-color: var(--red);
}
@media (max-width: 760px) {
  .selection-context {
    font-size: 11px;
  }
  .unit-link {
    min-height: 40px;
  }
  .sidebar {
    padding-top: 22px;
  }
  .slogan {
    margin-bottom: 20px;
  }
  .second {
    margin-top: 18px;
  }
  .side-bottom {
    padding-top: 15px;
  }
  .selection-context .text-link {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
  }
}

/* 0.3.0: dados reais locais, mesma estrutura em desktop e mobile. */
.tree-toggle {
  font: inherit;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  padding: 8px 0;
  cursor: pointer;
  white-space: normal;
  max-width: 100%;
}
.tree-toggle:focus-visible {
  outline: 2px solid var(--red, #fc0019);
  outline-offset: 2px;
}
.live-matrix {
  max-height: none !important;
}
.live-matrix:has([data-level='1']) {
  max-height: 78vh !important;
}
.live-matrix td:not(:first-child) {
  font-variant-numeric: tabular-nums;
}
.live-matrix [data-level='1'] {
  background: #f1f5fc;
}
.live-matrix [data-level='2'] {
  background: #f8faff;
}
.live-matrix [data-level='3'] {
  font-size: 13px;
}
.quality-list {
  padding: 22px;
}
.issue-group {
  border-bottom: 1px solid #dce3ee;
  margin-bottom: 14px;
}
.issue-group > summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: bold;
  padding: 14px 0;
}
.issue-item {
  padding: 14px 0;
  border-top: 1px solid #edf0f5;
}
.issue-item h3 {
  font-size: 15px;
  margin: 0 0 8px;
}
.issue-item p {
  margin: 0 0 8px;
  font-size: 14px;
}
.issue-item small {
  color: var(--muted);
}
.primary-card .negative,
.primary-card .positive,
.primary-card .neutral {
  color: var(--text-inverse);
}
.live-matrix .sticky {
  min-width: 260px;
}
.source-notice a {
  flex-shrink: 0;
}
@media (max-width: 760px) {
  .live-matrix .sticky {
    min-width: 185px;
    max-width: 220px;
  }
  .quality-list {
    padding: 14px;
  }
  .source-notice {
    align-items: flex-start;
  }
  .source-notice a {
    flex-shrink: 1;
  }
}

[hidden] {
  display: none !important;
}
.negative {
  color: var(--danger);
}
.positive {
  color: var(--green);
}
.neutral {
  color: var(--blue);
}
.reconcile-row td {
  color: var(--danger);
}

.summary-card {
  padding: 20px 16px 16px;
}
.value-pair {
  gap: 10px;
}
.value-pair strong {
  font-size: clamp(22px, 2vw, 30px);
}
.card-bottom strong.negative {
  color: var(--danger);
}
.card-bottom strong.positive {
  color: var(--green);
}
.card-bottom strong.neutral {
  color: var(--blue);
}
.priority-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.priority-card {
  border-radius: 20px;
  padding: 24px 28px;
  color: var(--text-inverse);
  text-align: left;
  font: inherit;
  min-width: 0;
}
.group-highlight {
  background: #00388b;
  border-top: 5px solid #00388b;
}
.stores-highlight {
  background: var(--surface-red-readable);
  border-top: 5px solid #fc0019;
}
.stores-highlight:hover {
  background: var(--danger);
}
.priority-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.8px;
  margin-bottom: 20px;
}
.priority-values {
  display: flex;
  gap: 32px;
  justify-content: space-between;
}
.priority-values > div {
  flex: 1;
  min-width: 0;
}
.priority-values strong {
  font-size: 42px;
  display: block;
  line-height: 1.2;
}
.priority-values span {
  font-size: 10px;
  display: block;
  letter-spacing: 0.5px;
  margin-top: 7px;
}
.priority-bottom {
  border-top: 1px solid #ffffff55;
  margin-top: 20px;
  padding-top: 14px;
  display: flex;
  gap: 15px;
  justify-content: space-between;
  font-size: 12px;
}
.priority-card > small {
  display: block;
  font-size: 10px;
  line-height: 1.5;
  margin-top: 16px;
  color: var(--text-inverse);
}
.store-count {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 16px;
}
.store-count span {
  font-size: 12px;
  font-weight: 400;
}
.stores-highlight .priority-top {
  margin-bottom: 12px;
}
.stores-highlight .priority-values strong {
  font-size: 28px;
}
.group-highlight .priority-values {
  margin-top: 36px;
}
.priority-card:focus-visible {
  outline: 3px solid #172d4a;
  outline-offset: 4px;
}
@media (max-width: 760px) {
  .priority-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .priority-card {
    padding: 20px;
    border-radius: 16px;
  }
  .priority-values strong {
    font-size: 38px;
  }
  .priority-bottom {
    font-size: 11px;
  }
  .group-highlight .priority-values {
    margin-top: 20px;
  }
  .stores-highlight .priority-values strong {
    font-size: 30px;
  }
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .summary-card {
    padding: 15px 12px;
  }
  .value-pair strong {
    font-size: 24px;
  }
  .card-bottom {
    flex-direction: column;
    gap: 5px;
  }
  .priority-card > small {
    font-size: 10px;
  }
}

.reconcile-card .card-bottom strong {
  color: var(--danger);
}
@media (max-width: 760px) {
  .source-notice p {
    flex: 1 1 calc(100% - 40px);
  }
  .source-notice a {
    flex: 1 1 100%;
    margin-left: 30px;
  }
}

.connect-page {
  max-width: 620px;
  margin: 40px auto;
  padding: 24px;
}
.connect-page p {
  margin: 20px 0;
  line-height: 1.6;
}
.connect-page input {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 12px 0;
}
.bridge-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.bridge-actions button {
  font-size: 12px;
}

/* Departamentos: mesma estrutura responsiva, dados somente pela API protegida. */
.dept-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.dept-card {
  padding: 22px;
  border: 1px solid #dce4ef;
  border-radius: 18px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dept-card span {
  font-size: 11px;
  letter-spacing: 0.08em;
}
.dept-card strong {
  font-size: 36px;
}
.dept-card.blue {
  background: #00388b;
  color: var(--text-inverse);
}
.dept-card.red {
  background: var(--surface-red-readable);
  color: var(--text-inverse);
}
.dept-content {
  padding: 0 24px 24px;
}
.dept-intro {
  line-height: 1.7;
}
.dept-controls {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}
.dept-controls label {
  display: flex;
  gap: 9px;
  align-items: center;
}
.dept-controls input[type='search'] {
  padding: 12px;
  border: 1px solid #ccd7e6;
  border-radius: 10px;
  width: 340px;
  max-width: 100%;
  font: inherit;
}
.dept-result {
  font-size: 13px;
  color: var(--muted);
}
.dept-row {
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  margin: 12px 0;
  overflow: hidden;
}
.dept-row > summary {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.25fr) 150px;
  gap: 20px;
  padding: 18px;
  cursor: pointer;
  background: #f8faff;
  list-style: none;
}
.dept-row > summary:before {
  content: none;
}
.dept-row summary strong {
  display: block;
  font-size: 15px;
}
.dept-row summary small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin: 5px 0;
}
.dept-row summary span {
  font-size: 14px;
  line-height: 1.5;
}
.dept-row > summary > div:first-child strong:before {
  content: '▸ ';
  color: var(--blue);
}
.dept-row[open] > summary > div:first-child strong:before {
  content: '▾ ';
}
.dept-count {
  text-align: right;
}
.dept-count strong {
  font-size: 24px !important;
  color: var(--blue);
}
.dept-detail {
  padding: 20px;
  line-height: 1.6;
}
.dept-source {
  font-size: 12px;
  color: var(--muted);
}
.dept-warning {
  padding: 12px;
  border-left: 3px solid #fc0019;
  background: #fff6f7;
}
.dept-table-wrap {
  overflow: auto;
  max-height: 440px;
  margin-top: 18px;
}
.dept-table-wrap table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}
.dept-table-wrap th,
.dept-table-wrap td {
  text-align: left !important;
  white-space: normal;
  padding: 12px;
  font-size: 12px;
  border-bottom: 1px solid #e3e9f1;
  max-width: 260px;
}
.dept-table-wrap th {
  position: sticky;
  top: 0;
  background: #eaf0f9;
  color: var(--blue);
  z-index: 1;
}
.dept-notes {
  margin-top: 18px;
  background: #f3f6fb;
  border-radius: 12px;
  padding: 18px;
  line-height: 1.7;
}
.dept-notes summary {
  cursor: pointer;
  font-weight: bold;
}
.department-review {
  margin-bottom: 24px;
}
@media (max-width: 1000px) {
  .dept-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dept-row > summary {
    grid-template-columns: 1fr 1fr;
  }
  .dept-count {
    grid-column: 1/-1;
    text-align: left;
    display: flex;
    gap: 12px;
    align-items: center;
  }
}
@media (max-width: 760px) {
  .dept-content {
    padding: 0 14px 18px;
  }
  .dept-card {
    padding: 16px;
  }
  .dept-card strong {
    font-size: 28px;
  }
  .dept-controls {
    align-items: stretch;
    flex-direction: column;
  }
  .dept-controls input[type='search'] {
    width: 100%;
  }
  .dept-row > summary {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 15px;
  }
  .dept-count {
    flex-wrap: wrap;
  }
  .dept-detail {
    padding: 14px;
  }
  .dept-table-wrap {
    max-height: 440px;
  }
}
.dept-date {
  display: block;
  margin-bottom: 18px;
}
.dept-controls input[type='checkbox'] {
  width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  flex: 0 0 18px;
  padding: 0 !important;
  margin: 0 !important;
  accent-color: #00388b;
}
.dept-controls label {
  font-size: 14px;
}

/* Acesso visível e identidade única em qualquer tamanho de tela. */
.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.product-name {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--blue);
}
.brand-lockup .logo {
  max-height: 58px;
}
.connection-panel {
  margin: 24px 32px 0;
  padding: 24px;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 1px solid #cad8eb;
  border-top: 4px solid var(--blue);
  border-radius: 16px;
}
.connection-panel[hidden] {
  display: none;
}
.connection-panel h2 {
  font-size: 22px;
  margin: 8px 0;
  color: var(--blue);
}
.connection-panel p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  overflow-wrap: anywhere;
}
.connection-panel .primary {
  flex-shrink: 0;
  min-height: 48px;
}
.connection-panel[data-phase='error'] {
  border-top-color: var(--red);
}
.connection-panel button:disabled {
  opacity: 0.65;
  cursor: wait;
}
@media (max-width: 760px) {
  .brand-lockup {
    flex: 1;
    min-width: 0;
  }
  .brand-lockup .logo {
    max-width: 190px;
    width: 100%;
    max-height: 50px;
  }
  .product-name {
    font-size: 10px;
    letter-spacing: 0.8px;
  }
  .connection-panel {
    margin: 16px 16px 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }
  .connection-panel h2 {
    font-size: 20px;
  }
  .connection-panel .primary {
    width: 100%;
  }
  .connection-panel p {
    font-size: 13px;
  }
}

/* Fotografia: calendário comum às visões desktop e mobile, apenas datas existentes. */
/* Calendar uses the input as its anchor; opening it never moves the filters. */
.snapshot-picker {
  position: relative;
  min-width: 235px;
  max-width: 100%;
  align-self: start;
}
.snapshot-picker.dept-date {
  display: grid;
  width: 320px;
  max-width: 100%;
}
.snapshot-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--muted);
  margin-bottom: 6px;
  min-height: 16px;
}
.snapshot-mode {
  font-size: 10px;
  letter-spacing: 0;
  color: var(--blue);
  white-space: nowrap;
}
.snapshot-field {
  position: relative;
  min-width: 0;
}
.snapshot-controls {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: white;
}
.snapshot-controls:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.snapshot-controls input {
  border: 0;
  border-radius: 0;
  min-width: 0;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  background: white;
}
.snapshot-controls input:focus {
  outline: none;
}
.snapshot-controls .snapshot-toggle {
  flex: 0 0 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  border-left: 1px solid var(--line);
  color: var(--blue);
  background: white;
}
.snapshot-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
.snapshot-message {
  display: block;
  max-width: 320px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  margin-top: 7px;
}
.snapshot-message.error {
  color: #c5001a;
}
.snapshot-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 336px;
  max-width: calc(100vw - 32px);
  padding: 14px;
  box-sizing: border-box;
  background: white;
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  border-radius: 14px;
  box-shadow: 0 14px 36px #00245126;
  z-index: 30;
}
.snapshot-panel[hidden] {
  display: none;
}
.snapshot-month-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.snapshot-month-nav select {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 8px;
  font: inherit;
  font-size: 14px;
  border-radius: 8px;
}
.snapshot-month-nav button {
  flex: 0 0 36px;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding: 0;
  background: #eef3fa;
  color: var(--blue);
  border: 0;
  border-radius: 8px;
  font-size: 24px;
}
.snapshot-month-nav button:disabled {
  opacity: 0.4;
}
.snapshot-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.snapshot-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0;
}
.snapshot-days button {
  width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #c4d6ed;
  border-radius: 8px;
  background: #e9f1fc;
  color: var(--blue);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.snapshot-days button:hover:not(:disabled) {
  background: #d8e8ff;
}
.snapshot-days button:disabled {
  background: #f7f8fa;
  color: #8b93a2;
  border-color: transparent;
  font-weight: 400;
  opacity: 1;
  cursor: default;
}
.snapshot-days button[aria-pressed='true'] {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  box-shadow: inset 0 -3px 0 var(--red);
}
.snapshot-days button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.snapshot-legend {
  font-size: 10px;
  line-height: 1.4;
  color: var(--muted);
  margin: 12px 0 5px;
}
.snapshot-close {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  background: transparent;
  color: var(--blue);
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
}
.snapshot-close:hover {
  background: #eef3fa;
}
@media (max-width: 760px) {
  .snapshot-picker,
  .snapshot-picker.dept-date {
    width: 100%;
    min-width: 0;
  }
  .snapshot-panel {
    width: 100%;
    max-width: 100%;
    padding: 12px;
  }
  .snapshot-days button {
    height: 40px;
    min-height: 40px;
  }
  .snapshot-message {
    max-width: none;
  }
  .snapshot-label {
    flex-wrap: wrap;
  }
}

/* Cards estáveis em cada recorte: sem centralização implícita de button nem saltos de grade. */
.priority-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: stretch;
}
.priority-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  appearance: none;
  line-height: 1.45;
}
.priority-top {
  gap: 12px;
  min-width: 0;
}
.priority-top svg {
  flex: none;
}
.priority-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.priority-values strong,
.store-count {
  font-variant-numeric: tabular-nums;
}
.priority-values span {
  line-height: 1.5;
  overflow-wrap: break-word;
}
.priority-bottom {
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 12px;
}
.priority-bottom strong {
  white-space: normal;
  font-variant-numeric: tabular-nums;
}
.priority-card > small {
  margin-top: auto;
  padding-top: 16px;
  min-height: 46px;
}
.store-count {
  flex-wrap: wrap;
  gap: 4px 10px;
  line-height: 1.2;
}
.store-count span {
  line-height: 1.5;
}
.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}
button.summary-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-width: 0;
  line-height: 1.45;
}
.summary-card .value-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.summary-card .card-top {
  align-items: flex-start;
  min-height: 36px;
  line-height: 1.5;
}
.summary-card .card-top svg {
  flex: none;
}
.summary-card .card-bottom {
  flex-wrap: wrap;
  gap: 4px 8px;
}
.summary-card .card-action {
  margin-top: auto;
  padding-top: 14px;
}
.summary-card[data-in-scope='false'] .card-top,
.summary-card[data-in-scope='false'] .value-pair {
  color: var(--muted);
}
.summary-card[aria-pressed='true'] {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}
.stores-highlight[aria-pressed='true'] {
  box-shadow: inset 0 0 0 2px #ffffffb0;
}
.section-label {
  gap: 10px 20px;
  flex-wrap: wrap;
}
.section-label span {
  line-height: 1.5;
}
@media (max-width: 1200px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1000px) and (min-width: 761px) {
  .priority-grid {
    grid-template-columns: 1fr;
  }
  .priority-card {
    padding: 22px;
  }
  .group-highlight .priority-values {
    margin-top: 16px;
  }
}
@media (max-width: 760px) {
  .priority-grid {
    grid-template-columns: 1fr;
  }
  .priority-card {
    padding: 20px;
  }
  .priority-values {
    gap: 14px;
  }
  .priority-bottom {
    align-items: flex-start;
  }
  .summary-card .card-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .summary-card .card-top {
    min-height: 36px;
  }
  .summary-card .value-pair strong {
    font-size: 26px;
  }
}
@media (max-width: 380px) {
  .priority-card {
    padding: 18px;
  }
  .priority-values strong {
    font-size: 32px;
  }
  .stores-highlight .priority-values strong {
    font-size: 28px;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .summary-card .card-top {
    min-height: 0;
  }
  .summary-card .card-bottom {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* Headcount: rótulos e controles na mesma altura, sem alinhar o botão à ajuda da data. */
.headcount-filters .filter-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) auto;
  align-items: start;
  gap: 12px;
  width: 100%;
}
.headcount-filters .field,
.headcount-filters .flag-filter {
  min-width: 0;
  width: 100%;
  margin: 0;
}
.headcount-filters .snapshot-label,
.headcount-filters .flag-filter summary > span {
  line-height: 14px;
  min-height: 14px;
}
.headcount-filters .snapshot-controls,
.headcount-filters .flag-filter summary > strong,
.headcount-filters #reset {
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
}
.headcount-filters .filter-action {
  display: grid;
  grid-template-rows: 14px 44px;
  gap: 7px;
  align-self: start;
}
.headcount-filters #reset {
  margin: 0;
  white-space: nowrap;
  justify-content: center;
}
@media (max-width: 1180px) {
  .headcount-filters .filter-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .headcount-filters .filter-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .headcount-filters .filter-action {
    grid-template-rows: 44px;
    gap: 0;
  }
  .headcount-filters .filter-action > span {
    display: none;
  }
  .headcount-filters #reset {
    width: 100%;
  }
}

/* Visões complementares reutilizam a matriz e mantêm a primeira coluna fixa. */
.grouped-headcount {
  margin-top: 24px;
}
.grouped-headcount .group-row td {
  font-weight: 700;
}
.grouped-headcount .group-row.reconcile-row td {
  color: var(--danger);
  background: #fff7f8;
}
.grouped-headcount .live-matrix .sticky {
  width: 32%;
  max-width: 420px;
}
@media (max-width: 760px) {
  .grouped-headcount {
    margin-top: 18px;
  }
  .grouped-headcount .live-matrix .sticky {
    width: auto;
    min-width: 190px;
    max-width: 210px;
  }
  .grouped-headcount .panel-actions {
    width: auto;
  }
  .grouped-headcount .panel-head {
    flex-wrap: wrap;
  }
}
.grouped-headcount .group-row td.negative {
  color: var(--danger);
}
.grouped-headcount .group-row td.positive {
  color: var(--green);
}
.grouped-headcount .group-row td.neutral {
  color: var(--blue);
}

/* Destaques iguais nos cards de todos os grupos e na visão mobile. */
.card-highlights {
  display: grid;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  margin-top: 14px;
  min-width: 0;
}
.highlight-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  font-size: 11px;
  line-height: 1.4;
}
.highlight-item span {
  color: var(--muted);
  min-width: 0;
  overflow-wrap: break-word;
}
.highlight-item strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  color: var(--blue);
}
.priority-card .card-highlights {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  border-color: #ffffff55;
  margin-top: 14px;
  padding-top: 14px;
}
.priority-card .highlight-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.priority-card .highlight-item span {
  color: var(--text-inverse);
  font-size: 11px;
}
.priority-card .highlight-item strong {
  color: var(--text-inverse);
  font-size: 23px;
  line-height: 1.1;
}
.reconcile-card .highlight-item strong {
  color: var(--danger);
}
.summary-card[data-in-scope='false'] .highlight-item strong {
  color: var(--muted);
}
@media (max-width: 760px) {
  .priority-card .card-highlights {
    gap: 10px;
  }
  .priority-card .highlight-item span {
    font-size: 10px;
  }
  .priority-card .highlight-item strong {
    font-size: 21px;
  }
  .summary-card .highlight-item {
    font-size: 10px;
  }
  .summary-card .highlight-item strong {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
/* Orçamento: mesma identidade e dados no desktop e no celular. */
.budget-page {
  display: grid;
  gap: 22px;
  min-width: 0;
}
.budget-banner {
  background: var(--blue, #00388b);
  color: var(--text-inverse);
  border-radius: 22px;
  padding: 28px;
  display: flex;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
}
.budget-banner h1 {
  font-size: 30px;
  margin: 10px 0;
}
.budget-banner p {
  max-width: 600px;
  line-height: 1.6;
  margin: 0;
}
.budget-banner .eyebrow {
  color: var(--text-inverse);
  opacity: 0.8;
}
.budget-owner {
  border-left: 3px solid #fc0019;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}
.budget-owner span,
.budget-stats article > span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.budget-owner strong {
  font-size: 21px;
}
.budget-owner small {
  overflow-wrap: anywhere;
}
.budget-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.budget-stats article {
  background: white;
  border: 1px solid #dbe2ec;
  border-radius: 18px;
  padding: 22px;
  display: grid;
  gap: 10px;
}
.budget-stats article > strong {
  font-size: 36px;
  color: var(--blue);
}
.budget-stats small {
  color: var(--muted);
}
.budget-activation {
  padding: 18px 22px;
  background: #fff8f0;
  border: 1px solid #e8d2b7;
  border-radius: 16px;
  line-height: 1.5;
}
.budget-activation p {
  margin: 7px 0 0;
}
.budget-filters {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 14px;
}
.budget-page label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
}
.budget-page input,
.budget-page select,
.budget-page textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #ccd6e4;
  border-radius: 10px;
  padding: 12px;
  font: inherit;
  background: white;
  color: var(--ink);
}
.budget-page input:focus,
.budget-page select:focus,
.budget-page textarea:focus {
  outline: 2px solid #00388b;
  outline-offset: 2px;
}
.budget-page .secondary {
  white-space: normal;
  text-align: center;
}
.budget-note {
  padding: 0 22px;
  line-height: 1.6;
  color: var(--muted);
  font-size: 13px;
}
.budget-unit {
  border-top: 1px solid #e1e7ef;
}
.budget-unit > summary {
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  font-weight: 700;
}
.budget-unit > summary:before {
  content: '▸';
  color: var(--blue);
}
.budget-unit[open] > summary:before {
  content: '▾';
}
.budget-unit > summary > span {
  flex: 1;
}
.budget-unit table {
  width: 100%;
  min-width: 760px;
}
.budget-unit td {
  white-space: normal;
  max-width: 350px;
}
.budget-unit th:first-child {
  min-width: 170px;
}
.budget-unit th:nth-child(2) {
  min-width: 230px;
}
.budget-draft,
.budget-history {
  padding: 0 22px 22px;
  line-height: 1.5;
}
.budget-line,
.budget-version {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #e1e7ef;
}
.budget-line p,
.budget-version p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.budget-request-fields {
  padding: 0 22px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
}
.budget-actions {
  padding: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.budget-page button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.budget-feedback {
  padding: 0 22px;
  color: var(--blue);
  line-height: 1.5;
}
.budget-review {
  margin: 0 22px 22px;
  padding: 20px;
  border-left: 4px solid #fc0019;
  background: #f5f8fc;
  border-radius: 10px;
  line-height: 1.6;
}
.budget-review h3 {
  margin: 0;
}
.budget-history details {
  padding: 14px 0;
  border-bottom: 1px solid #dbe2ec;
}
.budget-history summary {
  font-weight: 700;
  cursor: pointer;
}
.budget-history p {
  overflow-wrap: anywhere;
}
.budget-page .panel {
  min-width: 0;
  overflow: hidden;
}
.budget-page a.secondary {
  text-decoration: none;
}
.budget-unit summary:focus-visible {
  outline: 2px solid #00388b;
  outline-offset: -3px;
}
@media (max-width: 1100px) {
  .budget-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .budget-filters > button {
    grid-column: 2;
  }
  .budget-banner {
    align-items: flex-start;
  }
  .budget-owner {
    max-width: 260px;
  }
}
@media (max-width: 760px) {
  .budget-banner {
    padding: 22px;
    display: grid;
    gap: 20px;
  }
  .budget-banner h1 {
    font-size: 26px;
  }
  .budget-owner {
    max-width: none;
  }
  .budget-stats {
    grid-template-columns: 1fr;
  }
  .budget-stats article {
    padding: 18px;
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .budget-stats article > strong {
    grid-column: 2;
    grid-row: 1/3;
  }
  .budget-stats small {
    grid-column: 1;
  }
  .budget-stats article > strong {
    font-size: 30px;
  }
  .budget-filters {
    padding: 16px;
    grid-template-columns: 1fr;
  }
  .budget-filters > button {
    grid-column: 1;
  }
  .budget-request-fields {
    padding: 0 16px;
    grid-template-columns: 1fr;
  }
  .budget-line,
  .budget-version {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .budget-page .panel-head {
    align-items: stretch;
    flex-direction: column;
  }
  .budget-unit > summary {
    padding: 16px;
    gap: 10px;
    font-size: 14px;
  }
  .budget-note {
    padding: 0 16px;
  }
  .budget-actions {
    padding: 16px;
  }
  .budget-actions > button {
    width: 100%;
  }
}
.budget-page .flag-option {
  display: flex;
  align-items: center;
  gap: 10px;
}
.budget-page .flag-option input {
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  padding: 0;
}
.budget-page .flag-filter {
  min-width: 0;
}
.budget-page .flag-popover {
  max-height: 350px;
  overflow: auto;
}
.budget-page .budget-filters .flag-filter summary {
  min-height: 46px;
}

.budget-filters .snapshot-picker {
  min-width: 0;
}

/* Padrão global: a função do texto define a cor, nunca a página ou o breakpoint. */
:where(h1, h2, h3, h4, h5, h6) {
  color: var(--heading-text);
}
:where(button, input, select, textarea) {
  color: var(--ink);
}
:where(input, textarea)::placeholder {
  color: var(--muted);
  opacity: 1;
}
:where(label),
.section-label,
.card-top {
  color: var(--blue);
}
.budget-page label {
  color: var(--muted);
}
.value-pair strong,
.dept-card > strong {
  color: var(--metric-text);
}
/* Inversão contextual: títulos, valores e textos em azul/vermelho sempre brancos. */
.priority-card,
.primary-card,
.dept-card.blue,
.dept-card.red,
.budget-banner {
  --heading-text: var(--text-inverse);
  --metric-text: var(--text-inverse);
  color: var(--text-inverse);
}
.primary-card .card-top,
.priority-card .card-top {
  color: var(--text-inverse);
}
/* Semântica preservada em números: não depender apenas da cor para informar o estado. */
.primary-card .card-bottom strong {
  color: var(--text-inverse);
}
.summary-card[data-in-scope='false'] .value-pair strong {
  color: var(--muted);
}
.budget-banner .eyebrow,
.priority-card > small {
  opacity: 1;
}

/* Vigência sempre em evidência, independente da consulta histórica e dos filtros. */
.budget-current {
  display: block;
  border-top: 5px solid var(--red);
}
.budget-current-heading h1 {
  margin: 8px 0 10px;
  font-size: 30px;
}
.budget-current-heading p {
  font-size: 13px;
  max-width: none;
}
.budget-current-grid {
  display: grid;
  grid-template-columns: 0.9fr 1fr 1.2fr;
  gap: 28px;
  margin-top: 26px;
}
.budget-current-total {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.budget-current-total > strong {
  font-size: 54px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.budget-current-total > span {
  font-size: 14px;
}
.budget-current-fact {
  border-left: 1px solid #ffffff55;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.budget-current-fact > span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.budget-current-fact > strong {
  font-size: 23px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.budget-current-fact > small {
  font-size: 12px;
  line-height: 1.65;
}
.budget-current-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #ffffff55;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
  line-height: 1.6;
}
.budget-current-footer > a {
  color: var(--text-inverse);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
  flex-shrink: 0;
}
.budget-current .budget-scheduled {
  margin-top: 16px;
  font-size: 13px;
}
#budget-history {
  scroll-margin-top: 24px;
}
@media (max-width: 1100px) {
  .budget-current-grid {
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }
  .budget-current-total {
    grid-column: 1/-1;
  }
  .budget-current-fact {
    padding-left: 16px;
  }
  .budget-current-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 760px) {
  .budget-current-heading h1 {
    font-size: 23px;
  }
  .budget-current-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .budget-current-total > strong {
    font-size: 46px;
  }
  .budget-current-fact {
    border-left: 0;
    border-top: 1px solid #ffffff55;
    padding: 18px 0 0;
  }
  .budget-current-fact > strong {
    font-size: 22px;
  }
}

/* Propostas: aumentos e reduções explícitos, sem atribuir juízo pela cor. */
.budget-line .budget-movement {
  color: var(--blue);
  font-weight: 700;
}
.budget-impact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.budget-impact > div {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
}
.budget-impact span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}
.budget-impact strong {
  font-size: 30px;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}
.budget-impact small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.budget-review h4 {
  margin: 24px 0 12px;
}
.budget-review td:nth-child(2),
.budget-review th:nth-child(2) {
  text-align: left;
  white-space: normal;
  min-width: 160px;
}
@media (max-width: 760px) {
  .budget-impact {
    grid-template-columns: 1fr;
  }
  .budget-impact > div {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .budget-impact strong {
    grid-column: 2;
    grid-row: 1/3;
  }
  .budget-impact small {
    grid-column: 1;
  }
  .budget-review {
    margin: 0 16px 18px;
    padding: 16px;
  }
  .budget-review .matrix-wrap {
    max-width: 100%;
  }
}

/* 0.8.5 — Consulta hierárquica do quadro orçado. */
.budget-page .panel.budget-consultation {
  overflow: visible;
}
.budget-filter-total,
:is(.budget-department, .budget-area) > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 22px;
}
.budget-filter-total {
  background: #edf3fc;
  border-top: 3px solid var(--blue);
  color: var(--heading-text);
}
.budget-unit > summary {
  align-items: center;
  list-style: none;
}
.budget-node-label {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}
.budget-unit > summary > .budget-node-totals,
.budget-node-totals {
  flex: 0 0 auto;
  display: flex;
  gap: 24px;
  min-width: 150px;
  justify-content: flex-end;
  text-align: right;
}
.budget-node-totals > span {
  display: grid;
  gap: 5px;
  min-width: 58px;
}
.budget-node-totals small {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}
.budget-node-totals strong {
  font-size: 18px;
  color: var(--heading-text);
  font-variant-numeric: tabular-nums;
}
.budget-departments {
  margin: 0 22px 18px 42px;
  border-left: 3px solid #d8e5f7;
}
.budget-department {
  border-top: 1px solid var(--line);
}
:is(.budget-department, .budget-area) > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  list-style: none;
  background: #f6f8fc;
}
:is(.budget-department, .budget-area) > summary > span:first-child {
  flex: 1;
  overflow-wrap: anywhere;
}
:is(.budget-department, .budget-area) > summary:before {
  content: '▸';
  color: var(--blue);
}
:is(.budget-department, .budget-area)[open] > summary:before {
  content: '▾';
}
.budget-unit summary::-webkit-details-marker {
  display: none;
}
.budget-unit .budget-role-table {
  min-width: 460px;
  table-layout: auto;
}
.budget-unit .budget-role-table th:first-child {
  min-width: 160px;
  width: 52%;
  text-align: left;
}
.budget-unit .budget-role-table th:nth-child(2) {
  min-width: 60px;
}
.budget-role-table th[scope='row'] {
  font-size: 12px;
  font-weight: 500;
  white-space: normal;
}
.budget-role-table tfoot th,
.budget-role-table tfoot td {
  font-weight: 700;
  background: #edf3fc;
  color: var(--heading-text);
  border-top: 2px solid var(--line);
}
.budget-page .flag-option[hidden] {
  display: none;
}
.budget-page #budget-role-filter .flag-popover {
  max-height: none;
  overflow: visible;
}
.budget-filter-empty {
  font-size: 12px;
  color: var(--text-secondary);
}
:is(.budget-department, .budget-area) > summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -3px;
}
@media (max-width: 760px) {
  .budget-node-totals {
    min-width: 130px;
    gap: 14px;
  }
  .budget-node-totals strong {
    font-size: 17px;
  }
  .budget-node-totals small {
    font-size: 10px;
  }
  .budget-node-label {
    font-size: 10px;
  }
  .budget-departments {
    margin: 0 8px 12px 12px;
  }
  :is(.budget-department, .budget-area) > summary {
    padding: 14px 10px;
    gap: 8px;
    font-size: 12px;
    flex-wrap: wrap;
  }
  :is(.budget-department, .budget-area) > summary > span:first-child {
    min-width: 100px;
  }
  .budget-filter-total {
    padding: 16px;
    font-size: 13px;
  }
  .budget-unit > summary {
    flex-wrap: wrap;
  }
  .budget-unit > summary > span:first-child {
    min-width: 100px;
  }
}

.budget-consultation #budget-role-filter .flag-popover {
  left: auto;
  right: 0;
}
.budget-department .matrix-wrap {
  min-height: 0;
}
.budget-role-table th[scope='row'] {
  padding: 14px 16px;
  line-height: 1.5;
}

/* 0.8.6 — Ruptura departamental na fotografia, com o padrão de cores do site. */

/* 0.8.7 — Componente compartilhado de seleção múltipla. */
.multi-select-host {
  min-width: 0;
  width: 100%;
}
.multi-select-host .flag-filter {
  min-width: 0;
  width: 100%;
}
.multi-select-host .flag-popover {
  max-height: none;
  overflow: visible;
}
.multi-select-host .flag-option {
  display: flex;
  align-items: center;
  gap: 10px;
}
.multi-select-host .flag-option input[type='checkbox'] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  margin: 0;
}
.multi-select-host .filter-empty {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 8px 0;
}
.multi-select-host .filter-empty[hidden] {
  display: none;
}
.budget-page .multi-select-host .flag-filter summary {
  min-height: 46px;
}
.headcount-filters .multi-select-host {
  margin: 0;
}
@media (max-width: 760px) {
  .headcount-filters .multi-select-host {
    grid-column: 1/-1;
  }
  .multi-select-host .flag-popover {
    width: 100%;
    max-width: none;
  }
}
.budget-consultation > .budget-filters {
  align-items: start;
}
.budget-consultation > .budget-filters .snapshot-label,
.budget-consultation > .budget-filters .flag-filter summary > span {
  min-height: 28px;
  line-height: 14px;
}
.budget-consultation > .budget-filters #budget-reset {
  margin-top: 35px;
}
@media (max-width: 760px) {
  .budget-consultation > .budget-filters #budget-reset {
    margin-top: 0;
  }
}

/* Situações são informação complementar, sem acréscimo ao efetivo. */
.highlights-label {
  grid-column: 1/-1;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--muted);
}
.priority-card .highlights-label {
  color: var(--text-inverse);
}

/* Configurações: consulta de usuários e permissões Microsoft. */
.settings-page h1 {
  font-size: 23px;
  color: var(--blue);
  margin: 0 0 8px;
}
.settings-content {
  padding: 0 24px 24px;
}
.settings-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 22px;
}
.settings-summary article {
  padding: 20px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 0;
}
.settings-summary article > span {
  font-size: 10px;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--muted);
}
.settings-summary strong {
  display: block;
  font-size: 17px;
  color: var(--blue);
  margin: 12px 0;
}
.settings-summary p,
.settings-note,
.settings-status {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.settings-notice {
  padding: 18px 20px;
  border-left: 4px solid var(--red);
  background: var(--canvas);
  border-radius: 0 12px 12px 0;
  margin: 18px 0 24px;
}
.settings-notice strong {
  color: var(--blue);
  font-size: 14px;
}
.settings-notice p {
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 0;
}
.settings-section-head,
.settings-result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 22px 0 14px;
}
.settings-section-head h2 {
  color: var(--blue);
  font-size: 19px;
  margin: 0 0 6px;
}
.settings-section-head p,
.settings-result-head p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}
.settings-section-head button,
.settings-result-head a {
  flex-shrink: 0;
}
.settings-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.settings-filters label {
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.settings-filters select,
.settings-filters input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  color: var(--ink);
  width: 100%;
  min-width: 0;
  min-height: 44px;
}
.settings-user-table,
.settings-capabilities {
  width: 100%;
  font-size: 13px;
}
.settings-user-table td,
.settings-capabilities td,
.settings-capabilities th {
  white-space: normal;
  vertical-align: top;
  text-align: left;
  line-height: 1.6;
}
.settings-user-table td:first-child {
  min-width: 210px;
}
.settings-user-table small {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.settings-permission {
  display: inline-block;
  background: #edf3fd;
  color: var(--blue);
  border-radius: 6px;
  padding: 3px 9px;
  white-space: nowrap;
}
.settings-links {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 22px 0;
}
.settings-links a {
  flex-shrink: 0;
}
.settings-links p,
.settings-help {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}
.settings-help {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.settings-help summary {
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  min-height: 44px;
}
.settings-help li {
  margin-bottom: 9px;
}
.settings-user-table th,
.settings-capabilities th {
  color: var(--blue);
}
@media (max-width: 760px) {
  .settings-content {
    padding: 0 16px 18px;
  }
  .settings-page h1 {
    font-size: 21px;
  }
  .settings-summary,
  .settings-filters {
    grid-template-columns: 1fr;
  }
  .settings-summary {
    gap: 10px;
  }
  .settings-summary article {
    padding: 16px;
  }
  .settings-section-head,
  .settings-result-head,
  .settings-links {
    align-items: stretch;
    flex-direction: column;
  }
  .settings-section-head button,
  .settings-result-head a,
  .settings-links a {
    text-align: center;
    justify-content: center;
  }
  .settings-user-table,
  .settings-capabilities {
    min-width: 580px;
  }
  .settings-help ol {
    padding-left: 20px;
  }
}

/* Configurações: nenhuma exposição inicial ou no menu para outras contas. */
.sidebar nav a[data-route='settings'][hidden] {
  display: none;
}

/* Afastamentos longos: vermelho legível nos informativos sobre fundos claros. */
.summary-card:not(.primary-card) .highlight-item[data-highlight='leaveOver30'] span,
.summary-card:not(.primary-card) .highlight-item[data-highlight='leaveOver30'] strong,
.matrix-wrap th.long-leave-info,
.matrix-wrap td.long-leave-info {
  color: var(--danger);
}

.export-toolbar {
  margin: 0 22px 16px;
  padding: 16px 18px;
  background: #f1f5fa;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.export-toolbar strong {
  font-size: 14px;
  color: var(--blue);
}
.export-toolbar p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 5px 0 0;
  max-width: 600px;
}
.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.export-actions button {
  min-height: 44px;
}
.export-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.export-feedback {
  margin: 0 22px 16px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink);
}
.export-feedback:empty {
  display: none;
}
@media (max-width: 1000px) {
  .export-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 760px) {
  .export-toolbar {
    margin: 0 16px 14px;
    padding: 14px;
  }
  .export-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .export-actions button {
    font-size: 11px;
    padding: 10px;
  }
  .export-feedback {
    margin: 0 16px 14px;
  }
}

/* Movimentações nominais: mesma experiência desktop e mobile. */
tr[data-level='3'] .tree-toggle {
  display: block;
  padding: 0;
}
.allocation-edit {
  display: block;
  width: max-content;
  margin: 6px 0 0;
  padding: 7px 12px;
  border: 1px solid #b9c8dc;
  border-radius: 9px;
  background: #fff;
  color: var(--blue, #00388b);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
}
.allocation-edit:hover,
.allocation-edit:focus-visible {
  background: #eaf1fc;
  outline: 2px solid #00388b;
  outline-offset: 2px;
}
.allocation-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: 90dvh;
  padding: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  color: #183353;
  background: #fff;
  box-shadow: 0 20px 80px #001b4555;
  overflow: auto;
}
.allocation-dialog::backdrop {
  background: #001b4580;
}
.allocation-dialog h2 {
  margin: 0 0 8px;
  font-size: 24px;
  color: #00388b;
}
.allocation-person {
  font-weight: 700;
  font-size: 18px;
}
.allocation-help {
  font-size: 13px;
  line-height: 1.6;
  color: #53657d;
}
.allocation-current {
  padding: 12px;
  background: #f2f6fc;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.allocation-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
.allocation-fields .field {
  min-width: 0;
}
.allocation-fields select {
  width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}
.allocation-reason textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  resize: vertical;
}
.allocation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}
.allocation-actions [hidden] {
  display: none;
}
.allocation-status {
  font-size: 14px;
  line-height: 1.5;
  min-height: 1.5em;
}
.allocation-warning {
  color: #b51629;
  background: #fff1f3;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
}
.allocation-pending {
  padding: 18px 0;
  border-bottom: 1px solid #dbe2ed;
}
.allocation-pending h3 {
  margin: 0 0 10px;
  color: #00388b;
}
.allocation-pending p,
.allocation-pending small {
  line-height: 1.6;
}
.allocation-comparison {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  font-size: 14px;
}
.allocation-comparison dt {
  font-weight: 700;
}
.allocation-comparison dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.allocation-history {
  margin-top: 18px;
}
.allocation-review {
  margin-bottom: 22px;
}
@media (max-width: 600px) {
  .allocation-dialog {
    padding: 20px 16px;
  }
  .allocation-fields {
    grid-template-columns: 1fr;
  }
  .allocation-actions button {
    flex: 1;
    min-height: 44px;
  }
  .allocation-edit {
    min-height: 44px;
  }
  .allocation-comparison {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .allocation-comparison dd {
    margin-bottom: 12px;
  }
}

/* Consulta do cadastro padrão: isolada dos cálculos e das edições de pessoas. */
.settings-sections {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.settings-sections button[aria-pressed='true'] {
  background: #00388b;
  color: #fff;
  border-color: #00388b;
}
.settings-page[hidden],
.reference-catalog[hidden] {
  display: none;
}
.catalog-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0;
}
.catalog-filters > * {
  min-width: 0;
}
.catalog-filters input[type='search'] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 13px;
  border: 1px solid #d4dce8;
  border-radius: 12px;
  font: inherit;
  min-height: 48px;
}
.catalog-status {
  color: #53657d;
  font-size: 14px;
  line-height: 1.5;
}
.catalog-department {
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  margin: 12px 0;
  overflow: hidden;
}
.catalog-department > summary,
.catalog-sector > summary {
  cursor: pointer;
  padding: 18px;
  line-height: 1.5;
  color: #00388b;
}
.catalog-department > summary strong,
.catalog-sector > summary strong {
  margin-right: 12px;
}
.catalog-department > summary span,
.catalog-sector > summary span {
  font-size: 12px;
  color: #53657d;
}
.catalog-department[open] > summary {
  background: #f1f5fc;
  border-bottom: 1px solid #dbe3ef;
}
.catalog-sector {
  margin: 12px 18px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
}
.catalog-node-body {
  padding: 10px 20px 20px;
  line-height: 1.6;
}
.catalog-node-body h4 {
  margin: 16px 0 8px;
  font-size: 14px;
  color: #00388b;
}
.catalog-node-body small {
  font-size: 12px;
  color: #53657d;
}
.catalog-scope {
  color: #53657d;
  font-size: 14px;
  line-height: 1.6;
}
.catalog-roles {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.catalog-roles li {
  padding: 7px 11px;
  background: #edf3fc;
  color: #00388b;
  border-radius: 8px;
  font-size: 13px;
}
.catalog-observed ul {
  padding: 0;
  list-style: none;
  margin: 0;
}
.catalog-observed li {
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
}
.catalog-observed strong,
.catalog-observed span {
  display: block;
  overflow-wrap: anywhere;
}
.catalog-observed span {
  font-size: 12px;
  color: #53657d;
}
.catalog-unresolved > summary {
  color: #b51629;
}
.catalog-unresolved > .catalog-scope {
  padding: 0 20px;
}
@media (max-width: 760px) {
  .catalog-filters {
    grid-template-columns: 1fr;
  }
  .catalog-department > summary span,
  .catalog-sector > summary span {
    display: block;
    margin: 6px 0 0 18px;
  }
  .catalog-sector {
    margin: 10px;
  }
  .catalog-node-body {
    padding: 10px 14px 18px;
  }
  .settings-sections button {
    flex: 1;
    min-height: 48px;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .catalog-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Navegação persistente em todas as páginas. */
:root {
  --app-header-height: 92px;
}
html {
  scroll-padding-top: calc(var(--app-header-height) + env(safe-area-inset-top, 0px) + 12px);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  flex-shrink: 0;
  height: calc(var(--app-header-height) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: 0 3px 12px #00388b0a;
}
.mobile-shade.show {
  z-index: 16;
}
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 14;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 88px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #ffffff80;
  border-radius: 24px;
  background: var(--blue);
  color: var(--text-inverse);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 18px #00388b30;
}
.back-to-top[hidden] {
  display: none;
}
.back-to-top:hover {
  background: #002767;
}
.back-to-top:focus-visible {
  outline-offset: 3px;
  outline-color: var(--red);
}
.back-to-top svg {
  width: 20px;
  height: 20px;
}
.app-footer {
  padding-bottom: 88px;
}
@media (max-width: 760px) {
  :root {
    --app-header-height: 88px;
  }
  .back-to-top {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}
@media print {
  .topbar,
  .back-to-top {
    display: none !important;
  }
  .app-footer {
    padding-bottom: 0;
  }
}

/* Marcas clicáveis: mesma identidade, ação de atualização nativa. */
button.wordmark {
  background: transparent;
  text-align: left;
  width: 100%;
}
button.brand-lockup {
  background: transparent;
  padding: 0;
  min-height: 44px;
  border-radius: 8px;
}

/* Histórico de movimentações: rastreabilidade sem alterar o quadro. */
.allocation-log-content {
  padding: 0 22px 22px;
}
.allocation-log-filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  margin: 8px 0 18px;
}
.allocation-log-filters input,
.allocation-log-filters select {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  min-height: 46px;
}
.allocation-log-count {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.allocation-log-entry {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}
.allocation-log-entry > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  cursor: pointer;
  background: #f2f6fc;
  list-style: none;
}
.allocation-log-entry > summary::before {
  content: '▸';
  color: var(--blue);
}
.allocation-log-entry[open] > summary::before {
  content: '▾';
}
.allocation-log-entry > summary > div {
  flex: 1;
  min-width: 0;
}
.allocation-log-entry > summary strong,
.allocation-log-entry > summary div span {
  display: block;
  overflow-wrap: anywhere;
}
.allocation-log-entry > summary strong {
  color: var(--blue);
}
.allocation-log-entry > summary div span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 5px;
}
.allocation-log-body {
  padding: 8px 18px 18px;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.allocation-log-body small {
  color: var(--muted);
}
.allocation-log [hidden] {
  display: none;
}
.allocation-history-dialog {
  width: min(900px, calc(100vw - 32px));
}
.allocation-history-dialog > .secondary {
  display: block;
  margin-left: auto;
}
.allocation-history-dialog .panel-head {
  padding: 18px 0;
}
.allocation-history-dialog .allocation-log-content {
  padding: 0;
}
.allocation-log .allocation-comparison {
  grid-template-columns: 160px 1fr;
}
.allocation-log-filters .field {
  min-width: 0;
}
@media (max-width: 760px) {
  .allocation-log-content {
    padding: 0 16px 18px;
  }
  .allocation-log-filters {
    grid-template-columns: 1fr;
  }
  .allocation-log-entry > summary {
    flex-wrap: wrap;
    gap: 10px;
  }
  .allocation-log-entry > summary > div {
    flex-basis: 80%;
  }
  .allocation-log-entry .status-badge {
    white-space: normal;
  }
  .allocation-log .allocation-comparison {
    grid-template-columns: 1fr;
  }
  .allocation-log-entry > summary strong {
    font-size: 15px;
  }
}

/* Hierarquia consultiva: departamento > núcleo/setor > funções. */
.catalog-department-note {
  margin: 16px 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.catalog-role-levels {
  list-style: none;
  margin: 14px 0 22px;
  padding: 0 0 0 18px;
  border-left: 2px solid #dbe3ef;
}
.catalog-role-level {
  position: relative;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.catalog-role-level:before {
  content: '';
  position: absolute;
  left: -20px;
  top: 26px;
  width: 18px;
  border-top: 2px solid #dbe3ef;
}
.catalog-role-level h5 {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 13px;
}
.catalog-role-level:first-child {
  border-left: 3px solid var(--blue);
}
.catalog-role-level .catalog-roles {
  margin: 0;
}
.catalog-role-level .catalog-roles li {
  background: #fff;
}
.catalog-wdp-review {
  margin: 18px 0;
  padding: 12px;
  border: 1px dashed #ccd6e5;
  border-radius: 10px;
}
.catalog-wdp-review > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.catalog-department-review {
  margin: 16px 18px;
}
.catalog-role-levels + .settings-note {
  margin-top: 12px;
}
@media (max-width: 760px) {
  .catalog-role-levels {
    padding-left: 12px;
  }
  .catalog-role-level {
    padding: 12px;
  }
  .catalog-role-level:before {
    left: -14px;
    width: 12px;
  }
  .catalog-roles li {
    overflow-wrap: anywhere;
    max-width: 100%;
  }
}
/* Consulta dinâmica: níveis de expansão e informações sob demanda. */
.catalog-intro {
  margin: 8px 0 20px;
}
.catalog-intro strong {
  color: var(--blue);
  font-size: 15px;
}
.catalog-intro p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.catalog-help,
.catalog-extra {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.catalog-help {
  margin: 12px 0 20px;
}
.catalog-help > summary,
.catalog-extra > summary {
  cursor: pointer;
  min-height: 44px;
  align-content: center;
  color: var(--blue);
  font-weight: 700;
}
.catalog-help p {
  margin: 8px 0;
}
.catalog-extra {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 4px;
}
.catalog-department-scope {
  margin: 8px 18px 0;
  padding: 0 12px;
}
.catalog-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 12px 0;
}
.catalog-depth {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.catalog-toolbar button {
  min-height: 44px;
}
.catalog-depth button[aria-pressed='true'] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.catalog-role-levels {
  margin-top: 8px;
}
.catalog-role-level {
  padding: 10px 14px;
  margin-bottom: 10px;
}
.catalog-role-level h5 {
  margin-bottom: 6px;
}
@media (max-width: 760px) {
  .catalog-depth {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .catalog-toolbar > .secondary {
    width: 100%;
  }
  .catalog-depth button {
    text-align: center;
    justify-content: center;
  }
  .catalog-help > summary {
    line-height: 1.5;
  }
  .catalog-department-scope {
    margin: 6px 10px 0;
  }
  .catalog-intro strong {
    font-size: 14px;
  }
}

/* Privacidade: mesma identidade e fluxo no desktop e no celular. */
.privacy-dialog {
  width: min(850px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-top: 5px solid #fc0019;
  border-radius: 20px;
  color: var(--ink, #24364b);
  box-sizing: border-box;
  overflow: auto;
}
.privacy-dialog[open] {
  display: flex;
  flex-direction: column;
}
.privacy-dialog::backdrop {
  background: rgba(12, 30, 62, 0.7);
}
.privacy-heading {
  padding: 22px 28px 12px;
  flex: none;
  background: #fff;
}
.privacy-heading h2 {
  color: #00388b;
  font-size: 25px;
  margin: 8px 0;
}
.privacy-heading p {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.5;
}
.privacy-identity {
  overflow-wrap: anywhere;
  color: #00388b;
  font-weight: bold;
}
.privacy-terms {
  padding: 8px 28px 20px;
  overflow-y: auto;
  min-height: 80px;
  overscroll-behavior: contain;
}
.privacy-terms h2 {
  font-size: 19px;
  color: #00388b;
}
.privacy-terms h3,
.privacy-page-body h3 {
  font-size: 17px;
  color: #00388b;
  margin: 20px 0 8px;
}
.privacy-terms p,
.privacy-page-body p {
  line-height: 1.65;
  font-size: 15px;
}
.privacy-controls {
  flex: none;
  padding: 16px 28px 22px;
  border-top: 1px solid #dce3ee;
  background: #f6f8fc;
}
.privacy-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}
.privacy-check input {
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  flex: none;
  margin: 2px 0;
  accent-color: #00388b;
}
.privacy-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.privacy-buttons button {
  white-space: normal;
  min-height: 44px;
}
.privacy-feedback {
  font-size: 13px;
  line-height: 1.4;
  min-height: 18px;
  margin: 10px 0;
  color: #00388b;
}
.privacy-page-body {
  padding: 24px;
  max-width: 1000px;
}
.privacy-page h1 {
  color: #00388b;
  font-size: 26px;
}
.privacy-page-body h2 {
  color: #00388b;
  font-size: 22px;
}
.privacy-status {
  padding: 18px;
  border-radius: 12px;
  background: #edf3fc;
  color: #00388b;
}
.privacy-status p {
  overflow-wrap: anywhere;
}
.privacy-notice {
  padding: 16px;
  border-left: 4px solid #fc0019;
  background: #fff4f5;
  line-height: 1.6;
  font-size: 14px;
  border-radius: 8px;
}
.privacy-note {
  color: #59697f;
}
.privacy-export-check {
  margin: 10px 0;
  padding: 12px 16px;
  background: #f1f5fa;
  border-radius: 10px;
}
.privacy-export-check a {
  color: #00388b;
}
@media (max-width: 600px) {
  .privacy-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }
  .privacy-heading {
    padding: 16px 18px 8px;
  }
  .privacy-heading h2 {
    font-size: 21px;
  }
  .privacy-heading .eyebrow {
    font-size: 10px;
  }
  .privacy-terms {
    padding: 8px 18px 16px;
  }
  .privacy-controls {
    padding: 12px 18px 16px;
  }
  .privacy-buttons {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .privacy-check {
    font-size: 13px;
  }
  .privacy-page-body {
    padding: 18px;
  }
  .privacy-page .panel-head {
    flex-wrap: wrap;
  }
  .privacy-page h1 {
    font-size: 22px;
  }
}
.privacy-buttons button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.budget-page [hidden] {
  display: none !important;
}
.budget-activation button {
  margin: 4px 10px 4px 0;
}
.budget-activation p[role='status'] {
  min-height: 1.4em;
  overflow-wrap: anywhere;
}
.budget-feedback:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Mensagens de ação e campos obrigatórios: mesmo padrão em desktop e celular. */
.field-validation-error {
  display: block;
  color: var(--text-negative, #bf1327);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 6px;
  overflow-wrap: anywhere;
  white-space: normal;
}
.action-feedback-error {
  color: var(--text-negative, #bf1327) !important;
  font-weight: 600;
  border-left: 3px solid currentColor;
  padding: 8px 12px;
  overflow-wrap: anywhere;
}
input[aria-invalid='true'],
select[aria-invalid='true'],
textarea[aria-invalid='true'] {
  border: 2px solid var(--text-negative, #bf1327) !important;
  outline-color: var(--text-negative, #bf1327);
  box-shadow: 0 0 0 1px var(--text-negative, #bf1327);
}
input[type='checkbox'][aria-invalid='true'] {
  outline: 2px solid var(--text-negative, #bf1327);
  outline-offset: 3px;
}
.privacy-check:has([aria-invalid='true']) {
  flex-wrap: wrap;
}
.privacy-check > .field-validation-error {
  flex-basis: 100%;
  order: 2;
}
.budget-draft.field-invalid {
  border: 2px solid var(--text-negative, #bf1327);
  border-radius: 10px;
  padding: 12px;
}

.budget-request-fields {
  align-items: start;
  grid-template-columns: minmax(160px, 0.7fr) minmax(0, 1.5fr) minmax(0, 1.2fr);
}
.budget-request-fields label {
  min-width: 0;
}
.budget-request-fields select {
  width: 100%;
  min-width: 0;
}
@media (max-width: 760px) {
  .budget-request-fields {
    grid-template-columns: 1fr;
  }
}

.privacy-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line, #dce3ec);
}
.privacy-tools [hidden] {
  display: none !important;
}
@media (max-width: 600px) {
  .privacy-tools {
    align-items: stretch;
    flex-direction: column;
  }
  .privacy-tools button {
    width: 100%;
  }
}
/* Fechamento de jornada: mesmo padrão visual e filtros nos dois tamanhos. */
.sync-progress {
  border-left: 3px solid #00388b;
  padding: 10px 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Ajuste contextual compartilha o fluxo e o histórico do Orçamento. */
.headcount-budget-dialog {
  box-sizing: border-box;
  max-width: 1120px;
  width: min(1120px, calc(100vw - 32px));
  max-height: 92dvh;
  margin: auto;
  padding: 0 22px 22px;
  border: 1px solid #cbd5e1;
  border-top: 5px solid var(--red, #fc0019);
  border-radius: 20px;
  background: #f5f7fb;
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 20px 80px #001b4555;
}
.headcount-budget-dialog::backdrop {
  background: #001b4580;
}
.headcount-budget-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: #f5f7fb;
  padding: 20px 0 16px;
  border-bottom: 1px solid #dbe2ec;
}
.headcount-budget-header h2 {
  margin: 0;
  color: var(--blue);
  font-size: 25px;
}
.headcount-budget-header p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.headcount-budget-header button {
  flex-shrink: 0;
  min-height: 44px;
}
.headcount-budget-context {
  color: var(--blue);
  font-weight: 700;
  overflow-wrap: anywhere;
  line-height: 1.6;
  margin: 18px 0 6px;
}
.headcount-budget-help {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 18px;
}
.budget-compact {
  gap: 16px;
}
.budget-compact .budget-activation {
  font-size: 13px;
}
.budget-compact .budget-activation button {
  font-size: 12px;
  padding: 8px 12px;
}
.budget-compact .budget-filters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.budget-compact .budget-filters > button {
  grid-column: 2;
}
.headcount-budget-shortcut {
  white-space: normal;
  max-width: 100%;
}
.panel-actions .headcount-budget-shortcut {
  font-size: 12px;
  min-height: 40px;
}
@media (max-width: 760px) {
  .headcount-budget-dialog {
    width: calc(100vw - 16px);
    max-height: 96dvh;
    padding: 0 12px 16px;
    border-radius: 16px;
  }
  .headcount-budget-header {
    align-items: flex-start;
    padding: 14px 0;
    gap: 10px;
  }
  .headcount-budget-header h2 {
    font-size: 20px;
  }
  .headcount-budget-header button {
    max-width: 130px;
    font-size: 12px;
    padding: 10px;
  }
  .budget-compact .budget-filters {
    grid-template-columns: 1fr;
  }
  .budget-compact .budget-filters > button {
    grid-column: 1;
  }
  .headcount-budget-shortcut {
    min-height: 44px;
  }
}

/* Exact values remain readable when budget revisions are small at group scale. */

.data-refresh-status {
  margin: 16px 24px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  line-height: 1.6;
  color: var(--blue);
}
.data-refresh-status.negative {
  color: #b80016;
  border-color: #edc0c8;
}

/* Gestão da estrutura: o mesmo fluxo no desktop e no celular. */
.structure-management {
  margin-bottom: 20px;
}
.structure-revision {
  font-weight: 700;
  color: var(--blue, #00388b);
  overflow-wrap: anywhere;
}
.structure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.structure-feedback {
  min-height: 1.5em;
  overflow-wrap: anywhere;
}
.structure-error {
  color: #c80020;
  font-weight: 600;
}
.structure-import,
.structure-history {
  border: 1px solid #dce3ee;
  border-radius: 12px;
  margin-top: 14px;
  padding: 16px;
}
.structure-import > summary,
.structure-history > summary {
  cursor: pointer;
  font-weight: 700;
  color: #00388b;
}
.structure-import form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}
.structure-import input[type='file'] {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
.structure-import textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #bbc7d8;
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}
.structure-import [aria-invalid='true'] {
  outline: 2px solid #c80020;
  outline-offset: 2px;
}
.structure-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.structure-confirm input {
  flex: 0 0 20px;
  margin: 4px 0 0;
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  accent-color: #00388b;
}
.structure-confirm span {
  min-width: 0;
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
}
.structure-changes li {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-bottom: 12px;
}
.structure-changes details {
  margin: 12px 0;
}
.structure-history article {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid #dce3ee;
}
.structure-history article p {
  margin: 0;
}
.structure-history button {
  justify-self: start;
}
.structure-import button {
  justify-self: start;
}
@media (max-width: 600px) {
  .structure-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .structure-actions button {
    width: 100%;
  }
  .structure-import,
  .structure-history {
    padding: 12px;
  }
  .structure-changes ul {
    padding-left: 20px;
  }
}

.settings-integrations h3 {
  color: var(--blue);
  font-size: 17px;
  margin: 10px 0;
}
.settings-integrations p {
  font-size: 14px;
  line-height: 1.65;
}
.settings-source-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 13px;
}
.settings-source-table td,
.settings-source-table th {
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.settings-source-table td:first-child,
.settings-source-table th:first-child {
  width: 45%;
  min-width: 0;
}
.settings-source-table td,
.settings-source-table th {
  padding: 12px 8px;
}
.settings-source-table td:last-child,
.settings-source-table th:last-child {
  width: 30%;
  white-space: nowrap;
}
.settings-integrations .settings-source-table thead tr:first-child th {
  text-align: left;
}
.settings-source-table th {
  color: var(--blue);
}
.settings-data > summary {
  font-size: 19px;
}
.settings-data .settings-notice {
  margin-bottom: 0;
}

/* Duas referências organizacionais; sem rolagem horizontal no mobile. */
.structure-actions {
  flex-wrap: wrap;
}
.structure-actions [aria-pressed='true'] {
  background: var(--blue, #00388b);
  color: white;
  border-color: #00388b;
}
.structure-history {
  overflow-wrap: anywhere;
}
.structure-history li {
  margin: 0.65rem 0;
}
.reference-catalog > .structure-history {
  margin: 1rem 1.5rem;
  padding: 1rem;
}
.catalog-roles {
  flex-wrap: wrap;
}

.budget-area {
  border-top: 1px solid var(--line);
  margin-left: 12px;
}
.budget-area > summary {
  background: #fff;
}
.budget-area .matrix-wrap {
  min-height: 0;
}
.scope-detail {
  font-size: 14px;
  color: var(--ink, #20344f);
  min-width: 0;
  overflow-wrap: anywhere;
}
.scope-detail > summary {
  min-height: 44px;
  align-content: center;
  cursor: pointer;
  font-weight: 700;
  color: var(--blue, #00388b);
}
.scope-body {
  padding: 4px 12px 14px;
  line-height: 1.65;
}
.scope-body p {
  margin: 8px 0;
}
.scope-body ul {
  padding-left: 20px;
  list-style: disc;
  display: block;
}
.scope-body li {
  display: list-item;
  background: transparent !important;
  color: var(--ink, #20344f) !important;
  padding: 3px 0 !important;
}
.scope-current-note {
  border-left: 3px solid var(--red, #fc0019);
  padding-left: 12px;
}
.catalog-roles:has(.scope-detail) {
  display: block;
  width: 100%;
}
.catalog-roles > li:has(.scope-detail) {
  margin: 6px 0;
  background: white;
  max-width: 100%;
}
.project-purpose {
  font-size: 18px;
  line-height: 1.7;
  max-width: 950px;
}
.project-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 12px;
}
.project-kpis article {
  border: 1px solid var(--line, #dbe3ef);
  padding: 20px;
  border-radius: 16px;
  background: var(--canvas, #f5f7fb);
  min-width: 0;
}
.project-kpis article:first-child {
  background: var(--blue, #00388b);
  color: white;
}
.project-kpis span {
  font-size: 12px;
  font-weight: 700;
}
.project-kpis strong {
  font-size: 36px;
  display: block;
  margin: 12px 0;
}
.project-kpis p {
  font-size: 13px;
  line-height: 1.5;
}
.project-jumps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0;
}
.project-section {
  margin: 32px 0;
  scroll-margin-top: 120px;
  line-height: 1.7;
  min-width: 0;
}
.project-section h2 {
  color: var(--blue, #00388b);
  font-size: 22px;
}
.project-section h3 {
  color: var(--blue, #00388b);
}
.project-section > details,
.project-nucleus {
  border: 1px solid var(--line, #dbe3ef);
  border-radius: 12px;
  margin: 12px 0;
  padding: 14px;
}
.project-section summary {
  min-height: 44px;
  align-content: center;
  cursor: pointer;
  color: var(--blue, #00388b);
  font-weight: 700;
}
.project-table-wrap {
  overflow-x: auto;
  margin: 12px 0;
}
.project-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 570px;
}
.project-table-wrap th,
.project-table-wrap td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line, #dbe3ef);
  white-space: normal;
}
.project-table-wrap th {
  background: #edf3fc;
  color: #00388b;
}
.project-table-wrap td:nth-child(2) {
  text-align: center;
}
.project-phases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
  counter-reset: phase;
}
.project-phases li {
  border-left: 4px solid #fc0019;
  padding: 18px;
  background: var(--canvas, #f5f7fb);
  border-radius: 0 12px 12px 0;
}
.project-phases strong {
  color: #00388b;
}
.project-highlight {
  background: #00388b;
  color: white;
  padding: 16px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
}
.rh-project .reference-catalog {
  box-shadow: none;
}
.rh-project .settings-content {
  min-width: 0;
}
.rh-project .project-section > .structure-error {
  color: #b51629;
}
@media (max-width: 1000px) {
  .project-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .project-kpis,
  .project-phases {
    grid-template-columns: 1fr;
  }
  .project-kpis article {
    padding: 16px;
  }
  .project-jumps button {
    width: 100%;
  }
  .project-section {
    scroll-margin-top: 95px;
  }
  .rh-project .reference-catalog > .settings-content {
    padding: 12px;
  }
  .scope-body {
    padding-left: 4px;
    padding-right: 4px;
  }
  .project-purpose {
    font-size: 16px;
  }
}

/* Stable drill-down: the selected line is the scroll anchor, never a later sibling. */
html:has(.hierarchy-navigation) {
  overflow-anchor: none;
}
.hierarchy-navigation {
  overflow-anchor: none;
  scroll-behavior: auto;
}
.hierarchy-context {
  padding: 11px 20px;
  min-height: 43px;
  border-block: 1px solid var(--line);
  background: #f5f8fd;
  color: var(--blue);
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
  overflow: auto;
  scrollbar-width: thin;
}
.live-matrix thead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f7f9fc;
}
.live-matrix tr.hierarchy-open > .sticky .tree-toggle {
  font-weight: 700;
}
.live-matrix tr.hierarchy-parent > td {
  background: #f2f6fd;
}
.live-matrix tr.hierarchy-current > td {
  background: #e7effc;
}
.live-matrix tr.hierarchy-current > td:first-child {
  box-shadow: inset 4px 0 var(--red);
}
.live-matrix tr.hierarchy-parent > td:first-child {
  box-shadow: inset 3px 0 #8caede;
}
:is(.budget-unit, .budget-department, .budget-area)[open] > summary {
  background: #f2f6fd;
}
:is(.budget-unit, .budget-department, .budget-area).hierarchy-parent > summary {
  box-shadow: inset 3px 0 #8caede;
}
:is(.budget-unit, .budget-department, .budget-area).hierarchy-current > summary {
  background: #e7effc;
  box-shadow: inset 4px 0 var(--red);
}
.hierarchy-navigation .tree-toggle:focus-visible,
.hierarchy-navigation summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
@media (max-width: 760px) {
  .hierarchy-context {
    padding-inline: 14px;
    font-size: 11px;
  }
  .live-matrix:has([data-level='1']) {
    max-height: calc(100dvh - var(--app-header-height, 88px) - 70px) !important;
  }
}
@media print {
  .hierarchy-context {
    display: none;
  }
  .live-matrix thead {
    position: static;
  }
}

/* Native structure editing: one focused form, preserved consultation hierarchy. */
.structure-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.structure-native-editor,
.structure-review {
  margin: 20px 0;
  padding: 22px;
  border: 1px solid #ced9e9;
  border-radius: 16px;
  background: #f7f9fc;
  scroll-margin-top: 110px;
}
.structure-native-editor[hidden],
.structure-review[hidden] {
  display: none;
}
.structure-native-form input,
.structure-native-form select,
.structure-native-form textarea {
  width: 100%;
  min-width: 0;
}
.structure-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.structure-inline-actions button {
  font-size: 13px;
  padding: 7px 12px;
}
.structure-inline-actions button:last-child {
  color: #b70019;
}
.structure-native-form [aria-invalid='true'],
.structure-review [aria-invalid='true'] {
  border: 2px solid #c40019;
}
.structure-changes li {
  overflow-wrap: anywhere;
}
.structure-changes li p {
  margin: 5px 0;
}
.structure-review > button {
  margin: 8px 8px 0 0;
}
.structure-native-form .structure-actions {
  margin-top: 12px;
}
@media (max-width: 650px) {
  .structure-edit-grid {
    grid-template-columns: 1fr;
  }
  .structure-native-editor,
  .structure-review {
    padding: 14px;
  }
  .structure-actions > button {
    max-width: 100%;
    white-space: normal;
  }
  .structure-inline-actions {
    gap: 6px;
  }
}

.structure-native-form textarea,
.structure-review textarea {
  font: inherit;
  color: inherit;
  line-height: 1.5;
  padding: 12px;
  border: 1px solid #ced9e9;
  border-radius: 12px;
  background: white;
  resize: vertical;
  min-height: 96px;
  width: 100%;
}
.structure-native-form select:focus,
.structure-native-form input:focus,
.structure-native-form textarea:focus {
  outline: 2px solid #00388b;
  outline-offset: 2px;
}

/* Conciliação direta: mesma regra para todas as unidades, sem sair das pendências. */
.correlation-dialog {
  width: min(900px, 94vw);
  max-height: 90dvh;
  overflow: auto;
  border: 0;
  border-radius: 22px;
  padding: 26px;
  color: var(--navy, #00388b);
  box-shadow: 0 20px 80px #001a4860;
}
.correlation-dialog::backdrop {
  background: #001a4870;
}
.correlation-dialog h2 {
  margin-top: 0;
}
.correlation-origin {
  font-weight: bold;
  overflow-wrap: anywhere;
}
.correlation-dialog form {
  margin: 20px 0;
}
.correlation-dialog textarea {
  width: 100%;
  box-sizing: border-box;
}
.correlation-dialog select {
  max-width: 100%;
  width: 100%;
}
.correlation-dialog .structure-confirm {
  display: flex;
  gap: 10px;
  margin: 18px 0;
}
.correlation-dialog .structure-confirm input {
  flex: 0 0 auto;
}
.correlation-impact {
  padding: 16px;
  background: #eef4fc;
  border-left: 4px solid #00388b;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.correlation-cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
  margin-top: 20px;
}
.correlation-case {
  border: 1px solid #dce3ed;
  border-radius: 14px;
  padding: 18px;
  overflow-wrap: anywhere;
}
.correlation-case h3 {
  font-size: 16px;
  margin-top: 0;
}
.correlation-case button {
  margin-top: 12px;
}
.reconciliation-panel input[type='search'] {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccd5e2;
  border-radius: 10px;
  box-sizing: border-box;
}
.correlation-dialog [aria-invalid='true'] {
  border: 2px solid #fc0019;
}
.correlation-dialog .structure-feedback.structure-error {
  color: #bd0014;
}
.correlation-dialog button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
@media (max-width: 600px) {
  .correlation-dialog {
    padding: 18px;
    width: calc(100vw - 24px);
    box-sizing: border-box;
  }
  .correlation-dialog .structure-edit-grid {
    grid-template-columns: 1fr;
  }
  .correlation-dialog .structure-actions {
    display: flex;
    flex-wrap: wrap;
  }
  .correlation-dialog .structure-actions button {
    flex: 1 1 100%;
  }
}

.correlation-dialog {
  max-width: 900px;
  color: var(--ink);
  border-top: 5px solid var(--red);
  overscroll-behavior: contain;
}
.correlation-dialog h2 {
  color: var(--blue);
}
.correlation-dialog .field {
  min-width: 0;
}
.correlation-dialog select {
  min-width: 0;
  text-overflow: ellipsis;
}
.correlation-dialog textarea {
  font: inherit;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  resize: vertical;
  min-height: 80px;
  font-size: 14px;
}
.correlation-dialog .structure-actions {
  margin: 16px 0;
}
.correlation-dialog .structure-confirm {
  font-size: 14px;
  line-height: 1.55;
}
.correlation-dialog .structure-confirm input {
  height: 20px;
  min-width: 20px;
  width: 20px;
}
.correlation-dialog .structure-edit-grid {
  margin-top: 20px;
}
.correlation-dialog .structure-feedback {
  font-size: 14px;
  line-height: 1.5;
}
.correlation-dialog .structure-native-editor {
  margin-bottom: 20px;
}

.reconciliation-panel .structure-confirm {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  margin-top: 16px;
}
.reconciliation-panel .structure-confirm input {
  min-width: 20px;
  width: 20px;
  height: 20px;
}
/* Conferência de correlações e referência remuneratória — Adonai */
.correlation-review {
  margin-bottom: 24px;
}
.correlation-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.correlation-stat {
  border: 1px solid #d9e2ee;
  background: #f6f8fc;
  border-radius: 16px;
  padding: 18px;
  text-align: left;
  color: var(--blue, #00388b);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.correlation-stat span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.correlation-stat strong {
  font-size: 30px;
}
.correlation-stat small {
  font-size: 12px;
}
.correlation-stat.pending {
  border-color: #edb5bf;
  background: #fff4f5;
  color: #bd001b;
}
.correlation-stat.automatic {
  background: #edf3ff;
}
.correlation-stat:focus-visible {
  outline: 3px solid #00388b;
  outline-offset: 3px;
}
.correlation-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(260px, 2fr);
  gap: 16px;
  margin: 20px 0;
  align-items: end;
}
.correlation-table {
  min-width: 1050px;
  width: 100%;
  table-layout: fixed;
}
.correlation-table th,
.correlation-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  padding: 14px;
}
.correlation-table th:nth-child(1) {
  width: 21%;
}
.correlation-table th:nth-child(2) {
  width: 24%;
}
.correlation-table th:nth-child(3) {
  width: 17%;
}
.correlation-table th:nth-child(4),
.correlation-table th:nth-child(5) {
  width: 14%;
}
.correlation-table th:nth-child(6) {
  width: 10%;
}
.correlation-table td > strong,
.correlation-table td > span,
.correlation-table td > small {
  display: block;
  margin-bottom: 6px;
}
.correlation-row.pending {
  background: #fff7f8;
}
.correlation-row.pending td:first-child {
  border-left: 4px solid #fc0019;
}
.correlation-row.pending td:nth-child(2) > strong {
  color: #bd001b;
}
.correlation-badge {
  border-radius: 8px;
  background: #edf3ff;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 700;
  color: #00388b;
}
.correlation-badge.pending {
  color: #bd001b;
  background: #ffe6eb;
}
.correlation-badge.automatic {
  background: #e7efff;
}
.salary-observation {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}
.salary-observation strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.salary-observation small {
  font-size: 12px;
}
.function-salary {
  padding: 10px 0;
  color: #35516e;
  font-size: 13px;
}
.function-salary p {
  margin: 5px 0;
}
.pj-reference {
  width: 100%;
  max-width: 620px;
  margin: 15px 0;
}
.pj-reference th,
.pj-reference td {
  text-align: left;
  padding: 10px;
}
@media (max-width: 900px) {
  .correlation-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .correlation-filters {
    grid-template-columns: 1fr;
  }
  .correlation-stat {
    padding: 14px;
  }
  .correlation-table {
    font-size: 13px;
  }
}

/* Regional salary ranges share the existing structure filters and source date. */
.structure-region-control {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #d9e3ef;
}
.structure-region-control > .multi-select-host {
  max-width: 540px;
}
.regional-salary-item {
  padding: 10px 0;
  border-bottom: 1px solid #d9e3ef;
}
.regional-salary-item:last-child {
  border-bottom: 0;
}
.regional-salary-item > strong,
.regional-salary-item > small {
  display: block;
}
.regional-salary-item > .salary-region-name {
  color: #00388b;
  margin-bottom: 4px;
  font-size: 13px;
}
.regional-salary-item > small {
  font-size: 12px;
  line-height: 1.4;
}
.regional-salary-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0;
}
.regional-salary-values dt {
  font-size: 11px;
  color: #52657b;
}
.regional-salary-values dd {
  margin: 3px 0;
  font-family: Nexa, Arial, sans-serif;
  font-weight: 700;
  color: #00388b;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.correlation-table th:nth-child(1) {
  width: 20%;
}
.correlation-table th:nth-child(2) {
  width: 23%;
}
.correlation-table th:nth-child(3) {
  width: 16%;
}
.correlation-table th:nth-child(4) {
  width: 31%;
}
.correlation-table th:nth-child(5) {
  width: 10%;
}
@media (max-width: 600px) {
  .function-salary .regional-salary-values {
    gap: 6px;
  }
  .function-salary .regional-salary-values dd {
    font-size: 13px;
  }
}
/* 0.46 — comparison stays horizontal in every function, including equal/missing bases. */
.salary-comparison-grid {
  display: grid;
  grid-template-columns: repeat(var(--salary-columns, 3), minmax(175px, 1fr));
  gap: 8px;
  min-width: calc(var(--salary-columns, 3) * 183px - 8px);
}
.salary-comparison-grid > .regional-salary-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-width: 0;
}
.salary-comparison-grid > .regional-salary-item:last-child {
  border-bottom: 1px solid var(--line);
}
.salary-comparison-grid .salary-region-name {
  font-size: 13px;
  min-height: 18px;
}
.salary-comparison-grid .regional-salary-values {
  gap: 6px;
}
.salary-comparison-grid .regional-salary-values dd {
  font-size: 13px;
}
.salary-no-evidence {
  background: var(--canvas) !important;
}
.salary-no-evidence dd {
  color: var(--muted);
}
.salary-pj,
.salary-unknown {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  max-width: 410px;
  background: white;
}
.salary-unknown > .salary-region-name {
  color: var(--danger);
}
.correlation-table {
  min-width: 1350px;
}
.correlation-table th:nth-child(1) {
  width: 16%;
}
.correlation-table th:nth-child(2) {
  width: 18%;
}
.correlation-table th:nth-child(3) {
  width: 13%;
}
.correlation-table th:nth-child(4) {
  width: 45%;
}
.correlation-table th:nth-child(5) {
  width: 8%;
}
.correlation-table .regional-salary-values dd {
  white-space: nowrap;
}
.function-salary {
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 8px 0 12px;
  max-width: 100%;
}
.function-salary > small {
  display: block;
  margin-bottom: 7px;
}
.catalog-roles > li:has(> .function-salary) {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 3fr);
  gap: 8px 18px;
  align-items: start;
  padding: 14px;
  min-width: 0;
}
.catalog-roles > li:has(> .function-salary) > .structure-actions {
  grid-column: 1/-1;
}
@media (max-width: 1000px) {
  .catalog-roles > li:has(> .function-salary) {
    display: block;
  }
  .function-salary .salary-comparison-grid {
    min-width: 570px;
  }
  .function-salary .salary-comparison-grid[style*='--salary-columns: 1'] {
    min-width: 180px;
  }
  .function-salary .salary-comparison-grid[style*='--salary-columns: 2'] {
    min-width: 380px;
  }
}
.catalog-roles > li:has(> .function-salary) > .structure-inline-actions {
  grid-column: 1/-1;
}
@media (max-width: 760px) {
  .correlation-table {
    display: block;
    min-width: 0;
    table-layout: auto;
  }
  .correlation-table thead {
    display: none;
  }
  .correlation-table tbody {
    display: block;
  }
  .correlation-table .correlation-row {
    display: block;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin: 12px 0;
    padding: 12px;
    overflow: hidden;
    background: white;
  }
  .correlation-table .correlation-row.pending {
    border-left: 4px solid var(--red);
    background: #fff7f8;
  }
  .correlation-table .correlation-row td {
    display: block;
    width: 100%;
    padding: 6px 0;
    border: 0;
    text-align: left;
    min-width: 0;
  }
  .correlation-table .correlation-row td:first-child {
    border-left: 0;
  }
  .correlation-table .correlation-row td:first-child:before {
    content: 'ORIGEM WDP';
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    display: block;
    margin-bottom: 5px;
  }
  .correlation-table .correlation-row td:nth-child(2):before {
    content: 'DESTINO MUITO MAIS GESTÃO';
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    display: block;
    margin-bottom: 5px;
  }
  .correlation-table .correlation-row td.regional-salary {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 10px;
  }
  .correlation-table .correlation-row td:last-child button {
    min-height: 40px;
  }
}
.salary-comparison-grid .regional-salary-values {
  display: block;
  margin: 8px 0;
}
.salary-comparison-grid .regional-salary-values > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 5px 0;
}
.salary-comparison-grid .regional-salary-values dd {
  margin: 0;
}

/* Formação tem apenas duas unidades; não reservar altura vazia. */
#formation-panel .matrix-wrap {
  min-height: 0;
}
#formation-panel[hidden] {
  display: none;
}

body.portal-locked > :not(.portal-access) {
  display: none !important;
}
.portal-access {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  text-align: center;
  background: #f5f7fc;
  border-top: 5px solid #fc0019;
  color: #00388b;
}
.portal-access img {
  width: 220px;
  max-width: 75%;
  height: auto;
}
.portal-access h1 {
  font-size: 26px;
  margin: 18px 0 0;
}
.portal-access p {
  max-width: 520px;
  margin: 0;
}
.portal-access [role='status'] {
  min-height: 48px;
  margin-top: 24px;
}
.portal-access [hidden] {
  display: none !important;
}

/* Feedback de navegação e controles de toque, sem alterar a identidade. */
.data-refresh-status:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--red);
  box-shadow: 0 4px 16px #00388b08;
}
.data-refresh-status:not(.negative):not([hidden])::before {
  content: '';
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: mmg-busy 0.8s linear infinite;
}
@keyframes mmg-busy {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .data-refresh-status::before {
    animation: none !important;
  }
}
@media (max-width: 640px) {
  .data-refresh-status {
    margin: 12px 16px 0;
    font-size: 13px;
  }
  .tree-toggle,
  .allocation-edit {
    min-height: 44px;
  }
  .flag-filter > summary {
    min-height: 44px;
  }
}
/* Configurações: subpáginas e formulários de acesso, desktop e celular. */
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line, #dbe2ec);
}
.settings-tabs [aria-current='page'] {
  background: #00388b;
  color: #fff;
  border-color: #00388b;
}
.access-form {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid #00388b;
  border-radius: 16px;
  background: #f6f8fc;
}
.access-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.access-fields label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #173657;
  min-width: 0;
}
.access-fields input,
.access-fields select,
.access-fields textarea {
  max-width: 100%;
  width: 100%;
  min-height: 44px;
  border: 1px solid #bdcadd;
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  background: #fff;
  color: #173657;
  box-sizing: border-box;
}
.access-fields textarea {
  min-height: 88px;
  resize: vertical;
}
.access-fields .access-check {
  flex-direction: row;
  align-items: center;
}
.access-fields input[type='checkbox'] {
  width: 20px;
  min-height: 20px;
  flex-shrink: 0;
}
.access-fields [aria-invalid='true'] {
  border: 2px solid #cf0019;
  background: #fff5f5;
}
.access-fields small {
  font-size: 0.82rem;
  color: #526174;
}
.settings-page table small {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.settings-page pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.8rem;
}
.settings-page .settings-summary strong {
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  .access-fields {
    grid-template-columns: 1fr;
  }
  .access-form {
    padding: 16px;
  }
  .settings-tabs {
    padding: 12px;
  }
  .settings-tabs button {
    flex: 1 1 45%;
    min-height: 44px;
  }
  .settings-page .settings-section-head {
    flex-wrap: wrap;
    gap: 12px;
  }
}
.access-fields label.access-check {
  justify-content: flex-start;
  text-align: left;
  line-height: 1.4;
}
.access-fields input[type='checkbox'] {
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  margin: 0;
  flex: 0 0 20px;
  accent-color: #00388b;
}
.access-form {
  scroll-margin-top: 110px;
}

/* Access conflicts stay beside the draft, with the same mobile layout. */
.access-rules {
  grid-column: 1/-1;
  display: grid;
  gap: 12px;
  min-width: 0;
}
.access-rules p {
  margin: 0;
}
.access-conflicts {
  border: 2px solid #fc0019;
  border-radius: 16px;
  padding: 20px;
  margin: 16px 0;
  background: #fff;
  color: #173556;
  display: grid;
  gap: 12px;
}
.access-conflicts h3 {
  color: #c60019;
  margin: 0;
}
.access-conflicts label {
  display: grid;
  gap: 8px;
}
.access-conflicts select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.access-conflicts [aria-invalid='true'] {
  border-color: #fc0019;
}
.access-comparison pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.access-rules .flag-popover {
  position: static;
  max-width: 100%;
  box-sizing: border-box;
}
.access-form .access-fields > * {
  min-width: 0;
}

/* Active filter cards keep brand colors and expose the reversible action. */
.correlation-stat[aria-pressed='true'] {
  box-shadow: inset 0 0 0 2px currentColor;
}
.correlation-stat button {
  font: inherit;
}
.summary-card .card-action,
.correlation-stat small {
  line-height: 1.45;
}
.stores-highlight[aria-pressed='true']:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

/* Cadastros Gerais: same canonical data, readable on desktop and mobile. */
.registry-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.registry-tabs button {
  white-space: normal;
  text-align: left;
  min-height: 44px;
}
.registry-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.registry-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.registry-record {
  border: 1px solid var(--line, #d5dce7);
  border-left: 3px solid #00388b;
  border-radius: 12px;
  padding: 18px;
  background: #fff;
  min-width: 0;
  overflow-wrap: anywhere;
}
.registry-record h3 {
  margin-top: 0;
  color: #00388b;
}
.registry-record button {
  margin: 8px 8px 0 0;
}
.registry-record small {
  display: block;
}
.registry-record details > div {
  border-top: 1px solid #d5dce7;
  padding: 8px 0;
}
.registry-filters [aria-invalid='true'],
[aria-invalid='true'].multi-select-host {
  outline: 2px solid #fc0019;
  border-radius: 8px;
}
@media (max-width: 760px) {
  .registry-list,
  .registry-filters {
    grid-template-columns: 1fr;
  }
  .registry-record {
    padding: 14px;
  }
  .registry-tabs button {
    flex: 1 1 140px;
  }
}

/* Permission editor: flags remain readable on mobile, no horizontal matrix dependency. */
.access-permissions {
  grid-column: 1/-1;
  min-width: 0;
}
.permission-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.permission-resource {
  border: 1px solid #d8dfeb;
  border-radius: 14px;
  padding: 16px;
  min-width: 0;
  margin: 0;
}
.permission-resource legend {
  font-weight: 700;
  color: var(--blue, #00388b);
  padding: 0 6px;
}
.permission-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.permission-flags label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-direction: row;
  cursor: pointer;
  font-size: 14px;
}
.permission-flags input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: #00388b;
}
.permission-resource small {
  display: block;
  margin-top: 12px;
  line-height: 1.5;
}
.permission-resource .structure-actions {
  margin-top: 12px;
}
.permission-summary {
  font-weight: 700;
}
.permission-resource input:disabled + span {
  color: #626b7a;
}
.permission-resource:focus-within {
  outline: 2px solid #00388b;
  outline-offset: 2px;
}
@media (max-width: 760px) {
  .permission-matrix {
    grid-template-columns: 1fr;
  }
  .permission-resource {
    padding: 12px;
  }
  .access-permissions .structure-actions {
    flex-wrap: wrap;
  }
  .permission-flags {
    gap: 14px;
  }
  .permission-flags label {
    min-height: 32px;
  }
}

/* Privacidade: ênfase na fonte, preservando os fundos de navegação. */
.sidebar nav a[data-route='privacy'],
.sidebar nav a[data-route='privacy']:hover,
.sidebar nav a[data-route='privacy'].active {
  color: var(--text-negative);
}
.rh-project .journey-card {
  min-width: 0;
}
.rh-project .journey-card h3 {
  font-size: 20px;
  margin: 0 0 12px;
}
.rh-project .journey-card .status-tag {
  display: inline-block;
  margin-top: 16px;
}

/* Atalhos de página: uma única barra, sempre visível no cabeçalho. */
.page-navigation {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.page-navigation button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-brand);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.page-navigation button:hover:not(:disabled) {
  background: #edf3fd;
  border-color: #b9cdec;
}
.page-navigation button:disabled {
  color: var(--text-disabled);
  background: #f8fafc;
  cursor: not-allowed;
}
.page-navigation svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}
@media (min-width: 761px) and (max-width: 1180px) {
  .page-navigation button {
    padding: 10px;
    width: 44px;
  }
  .page-navigation button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .top-actions .environment {
    display: none;
  }
}

/* Data scope: same responsive permission form on desktop and mobile. */
.data-scope-editor {
  grid-column: 1/-1;
  min-width: 0;
  border-top: 3px solid #00388b;
  padding-top: 16px;
}
.data-scope-editor fieldset {
  min-width: 0;
  margin: 12px 0;
  padding: 16px;
  border: 1px solid #c9d3e2;
  border-radius: 12px;
}
.data-scope-editor select {
  width: 100%;
  margin-bottom: 12px;
}
.data-scope-editor [aria-invalid='true'] {
  border-color: #fc0019;
}
.data-scope-editor .negative:empty {
  display: none;
}
#scope-access-notice {
  margin: 12px 24px;
  border-left: 4px solid #00388b;
  padding: 12px;
  overflow-wrap: anywhere;
}
.data-scope-editor [hidden] {
  display: none !important;
}

/* Mobile page shortcuts: icons only, with accessible names and 44px touch targets. */
@media (max-width: 760px) {
  .page-navigation {
    gap: 12px;
  }
  .page-navigation button,
  .page-navigation button:first-child {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 10px;
  }
  .page-navigation button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* WDP emphasis changes the text only; existing panel backgrounds are retained. */
.quality-link,
.quality-link:hover,
.quality-link:visited {
  color: var(--text-negative);
  font-weight: 700;
}
.administration-hub .quality-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.department-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin: 0 0 18px;
  line-height: 1.5;
}
.department-context a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-brand);
  text-decoration: underline;
}

/* Navegação mobile compacta: menu e Início acima; Voltar e Avançar abaixo. */
.header-navigation {
  display: contents;
}
.topbar > .brand-lockup {
  order: 0;
}
.topbar .page-navigation {
  order: 1;
}
.topbar > .top-actions {
  order: 2;
}
@media (max-width: 760px) {
  :root {
    --app-header-height: 110px;
  }
  .topbar {
    flex-wrap: nowrap;
    gap: 8px;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 14px 6px;
  }
  .header-navigation {
    order: 0;
    display: grid;
    grid-template-columns: repeat(2, 44px);
    grid-template-rows: repeat(2, 44px);
    gap: 4px;
    flex: 0 0 92px;
    width: 92px;
    height: 92px;
  }
  .topbar .page-navigation {
    display: contents;
  }
  .header-navigation #menu {
    grid-column: 1;
    grid-row: 1;
    width: 44px;
    height: 44px;
  }
  .header-navigation [data-page-nav='home'] {
    grid-column: 2;
    grid-row: 1;
  }
  .header-navigation [data-page-nav='back'] {
    grid-column: 1;
    grid-row: 2;
  }
  .header-navigation [data-page-nav='forward'] {
    grid-column: 2;
    grid-row: 2;
  }
  .header-navigation button {
    margin: 0;
  }
  .topbar > .brand-lockup {
    order: 1;
    min-height: 50px;
  }
  .topbar > .top-actions {
    order: 2;
    flex: 0 0 40px;
  }
}
@media (max-width: 379px) {
  .topbar {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    grid-template-rows: 50px 40px;
    gap: 2px 8px;
    justify-content: normal;
    align-content: center;
  }
  .header-navigation {
    grid-column: 1;
    grid-row: 1/3;
  }
  .topbar > .brand-lockup {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
  }
  .topbar > .top-actions {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }
}

.access-employee-picker {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #f7f9fc;
}
.access-employee-picker label:has([name='employeeId']),
.access-employee-picker p {
  grid-column: 1/-1;
}
.access-employee-picker p {
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .access-employee-picker {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .access-employee-picker select {
    max-width: 100%;
    min-width: 0;
  }
}

/* Corporate reading pages reuse the Adonai palette and remain native text. */
.structure-subpages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.structure-subpages button {
  text-align: left;
  white-space: normal;
  min-height: 48px;
}
.structure-subpages [aria-current='page'] {
  background: #00388b;
  color: #fff;
  border-color: #00388b;
  border-bottom: 4px solid #fc0019;
}
.knowledge-reader {
  padding: 20px 0;
  min-width: 0;
}
.knowledge-edition {
  color: #00388b;
  font-weight: bold;
}
.knowledge-reader label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 640px;
}
.knowledge-reader input {
  width: 100%;
  box-sizing: border-box;
}
.knowledge-sections {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.knowledge-section {
  border: 1px solid #d8e1ee;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}
.knowledge-section summary {
  padding: 18px;
  color: #00388b;
  font-weight: bold;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.knowledge-section[open] {
  border-left: 4px solid #fc0019;
}
.knowledge-blocks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
}
.knowledge-block {
  margin: 0;
  padding: 14px;
  background: #f1f5fa;
  border-radius: 12px;
  white-space: pre-line;
  line-height: 1.65;
  overflow-wrap: anywhere;
  font-size: 1rem;
}
.knowledge-blocks h3 {
  color: #00388b;
  font-size: 1.08rem;
}
.knowledge-wide {
  grid-column: 1/-1;
}
.knowledge-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 0 18px 18px;
}
.knowledge-figures figure {
  margin: 0;
  max-width: 100%;
}
.knowledge-figures img {
  max-width: 100%;
  width: auto;
  height: 130px;
  object-fit: contain;
}
.knowledge-figures figcaption {
  font-size: 0.9rem;
  color: #00388b;
}
.knowledge-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}
.knowledge-card {
  border: 1px solid #d8e1ee;
  border-top: 4px solid #fc0019;
  padding: 20px;
  border-radius: 16px;
  background: #fff;
}
.knowledge-pending {
  margin-top: 24px;
}
.knowledge-pending summary {
  color: #a71927;
  cursor: pointer;
}
.knowledge-pending article {
  padding: 8px 16px;
}
.knowledge-pending p {
  font-size: 0.95rem;
}
@media (max-width: 640px) {
  .structure-subpages {
    grid-template-columns: 1fr;
  }
  .knowledge-blocks {
    grid-template-columns: 1fr;
    padding: 0 12px 12px;
  }
  .knowledge-section summary {
    padding: 14px;
  }
  .knowledge-block {
    padding: 12px;
  }
  .knowledge-reader {
    padding-top: 16px;
  }
}

/* Gestão PJ: same Adonai palette, compact forms and responsive reading. */
.pj-page {
  display: grid;
  gap: 18px;
}
.pj-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.pj-stat {
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #d6e0ef;
  display: grid;
  gap: 8px;
}
.pj-stat strong {
  font-size: 28px;
  color: #00388b;
}
.pj-stat span {
  font-size: 13px;
}
.pj-gate {
  grid-column: 1/-1;
  padding: 16px;
  background: #f1f5fa;
  border-radius: 12px;
}
.pj-gate summary {
  cursor: pointer;
  font-weight: 700;
}
.pj-records {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.pj-records .registry-record {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  overflow-wrap: anywhere;
}
.pj-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.pj-form .field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pj-form input:not(:where([type='checkbox'], [type='radio'])),
.pj-form select,
.pj-form textarea {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.pj-form .negative,
.pj-form .structure-actions,
.pj-form > p {
  grid-column: 1/-1;
}
.pj-form [aria-invalid='true'] {
  border: 2px solid #d00019;
  background: #fff5f6;
}
.pj-form input[readonly] {
  background: #eef2f7;
}
.pj-detail {
  scroll-margin-top: 125px;
}
.pj-detail p {
  overflow-wrap: anywhere;
}
.pj-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 18px 0;
}
.pj-steps button {
  display: grid;
  gap: 6px;
  min-height: 56px;
  min-width: 0;
  text-align: left;
  white-space: normal;
}
.pj-steps button[aria-current='step'] {
  border-color: #00388b;
  background: #eef4ff;
  color: #00388b;
}
.pj-steps button:focus-visible {
  outline: 3px solid #00388b;
  outline-offset: 2px;
}
.pj-steps small {
  font-size: 12px;
}
.pj-step-panel {
  border-top: 1px solid #d6e0ef;
  padding-top: 16px;
}
.pj-help {
  grid-column: 1 / -1;
}
.pj-contract,
.pj-finance {
  border-top: 1px solid #d6e0ef;
  padding-top: 18px;
  margin-top: 18px;
}
.pj-finance > strong {
  display: block;
  margin: 14px 0;
}
.pj-link {
  display: inline-block;
  font-size: 20px;
  font-weight: 700;
  color: #00388b;
  margin-top: 16px;
}
.pj-form-panel {
  scroll-margin-top: 125px;
}
.pj-page .structure-actions {
  flex-wrap: wrap;
}
.pj-page .negative {
  color: #d00019;
}
@media (max-width: 800px) {
  .pj-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pj-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pj-summary .pj-stat:first-child {
    grid-column: 1/-1;
  }
  .pj-records,
  .pj-form {
    grid-template-columns: 1fr;
  }
  .pj-form .structure-actions button {
    flex: 1;
    min-width: 0;
  }
  .pj-page .settings-content {
    padding: 16px;
  }
  .pj-page .pj-stat {
    padding: 14px;
  }
  .pj-page .structure-actions button {
    white-space: normal;
  }
  .pj-page h1 {
    font-size: 26px;
  }
}

.recruitment-page {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.recruitment-page .settings-content {
  padding: 20px;
}
.recruitment-pending > summary {
  color: var(--red, #fc0019);
  font-weight: bold;
}
.recruitment-timeline {
  border-left: 3px solid #00388b;
  margin: 18px 0;
  padding-left: 24px;
  list-style: none;
}
.recruitment-timeline li {
  padding: 10px 0;
  border-bottom: 1px solid #dbe2ec;
}
.recruitment-page .registry-record {
  overflow-wrap: anywhere;
}
.recruitment-page .pj-form [aria-invalid='true'] {
  border: 2px solid #fc0019;
  background: #fff5f5;
}
.recruitment-page .pj-form {
  margin-top: 18px;
}
@media (max-width: 600px) {
  .recruitment-page .settings-content {
    padding: 14px;
  }
  .recruitment-page .structure-actions {
    flex-wrap: wrap;
  }
  .recruitment-page .structure-actions button {
    flex: 1 1 130px;
  }
  .recruitment-page .pj-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.recruitment-page .field:has(input[type='checkbox']) {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: flex-start;
  grid-column: 1/-1;
}
.recruitment-page .field input[type='checkbox'] {
  width: 22px;
  min-width: 22px;
  max-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  flex: 0 0 22px;
}
.recruitment-page .field:has(input[type='checkbox']) span {
  font-size: 14px;
  line-height: 1.45;
}
.recruitment-page textarea {
  font: inherit;
}

.ri-page {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.ri-page .panel {
  min-width: 0;
}
.ri-page .pj-summary {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
}
.ri-page .registry-record {
  overflow-wrap: anywhere;
}
.ri-page progress {
  width: 100%;
  height: 10px;
  accent-color: #00388b;
}
.ri-page small {
  display: block;
}
.ri-form [aria-invalid='true'] {
  border: 2px solid #fc0019;
}
.ri-page .structure-actions {
  flex-wrap: wrap;
}
.ri-page select {
  max-width: 100%;
  text-overflow: ellipsis;
}
.ri-page .department-context {
  flex-wrap: wrap;
}
.ri-form textarea {
  font: inherit;
  line-height: 1.45;
  padding: 12px;
  border: 1px solid #d7e1f0;
  border-radius: 12px;
  width: 100%;
  min-height: 100px;
  resize: vertical;
  background: #fff;
  color: inherit;
}
.ri-form textarea[aria-invalid='true'] {
  border: 2px solid #fc0019;
  background: #fff6f7;
}

/* 0.89: mobile uses the MMG wordmark in the same-height header. */
.sidebar-adonai,
.mobile-mmg {
  display: none;
}
.sidebar-mmg > span {
  font-size: 15px;
  letter-spacing: 2px;
  font-weight: 700;
}
.staffing-module {
  margin-bottom: 16px;
}
.staffing-module > a {
  font-weight: 700;
  color: var(--blue);
  font-size: 20px;
}
.transfer-page {
  display: grid;
  gap: 18px;
}
.transfer-page .department-context {
  margin: 0;
}
.transfer-form {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
  margin-top: 20px;
}
.transfer-form label {
  display: grid;
  gap: 7px;
  font-size: 13px;
}
.transfer-form input,
.transfer-form select,
.transfer-form textarea {
  min-width: 0;
  width: 100%;
  font: inherit;
  box-sizing: border-box;
}
.transfer-form textarea {
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
}
.transfer-form p,
.transfer-form .transfer-confirm {
  grid-column: 1/-1;
  overflow-wrap: anywhere;
}
.transfer-form .transfer-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.transfer-confirm input {
  width: 20px;
  min-width: 20px;
  height: 20px;
  flex: 0 0 20px;
}
.transfer-form [aria-invalid='true'] {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.transfer-source {
  border-left: 4px solid var(--blue);
  padding: 12px;
  background: var(--canvas);
}
@media (max-width: 760px) {
  .sidebar .sidebar-mmg,
  .topbar .desktop-brand {
    display: none;
  }
  .sidebar-adonai {
    display: block;
    width: 190px;
    height: auto;
    max-width: 100%;
    object-fit: contain;
  }
  .sidebar .wordmark {
    padding: 10px 8px;
  }
  .topbar > .brand-lockup {
    flex: 1;
    min-width: 0;
    max-width: none;
    display: flex;
    justify-content: center;
    padding: 0;
  }
  .mobile-mmg {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: var(--blue);
    text-align: left;
    line-height: 1;
    white-space: nowrap;
  }
  .mobile-mmg > span {
    font-size: clamp(11px, 3vw, 15px);
    letter-spacing: 0.12em;
    font-weight: 700;
  }
  .mobile-mmg > strong {
    display: block;
    font-size: clamp(28px, 7.8vw, 40px);
    line-height: 1.05;
    letter-spacing: -1.3px;
    margin-top: 3px;
  }
  .mobile-mmg .dot {
    color: var(--red);
  }
  .transfer-form {
    grid-template-columns: 1fr;
  }
  .transfer-page .settings-content {
    padding: 18px;
  }
}

/* Shared policy/handbook lifecycle and readable audit trail. */
.knowledge-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.knowledge-status-tabs button {
  min-height: 44px;
  white-space: normal;
}
.knowledge-status-tabs [aria-pressed='true'] {
  background: #00388b;
  color: #fff;
  border-color: #00388b;
}
.knowledge-status-revoked:not(button) {
  color: #b00020;
}
.knowledge-warning {
  border-left: 4px solid #fc0019;
  color: #a71927;
}
.knowledge-audit,
.knowledge-management {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #d8e1ee;
  border-radius: 14px;
  background: #fff;
  min-width: 0;
}
.knowledge-audit > summary,
.knowledge-management > summary {
  cursor: pointer;
  color: #00388b;
  font-weight: bold;
  min-height: 32px;
}
.knowledge-audit-list {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}
.knowledge-history-entry {
  padding: 14px;
  background: #f1f5fa;
  border-radius: 12px;
  overflow-wrap: anywhere;
}
.knowledge-history-entry p {
  white-space: pre-line;
  margin: 8px 0;
}
.knowledge-management form {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.knowledge-management select,
.knowledge-management textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.knowledge-management [aria-invalid='true'] {
  border: 2px solid #fc0019;
}
.knowledge-reader .knowledge-confirm {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
}
.knowledge-confirm input {
  width: 20px;
  flex: 0 0 20px;
}
.knowledge-library > .settings-content > label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.knowledge-library input {
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 640px) {
  .knowledge-status-tabs button {
    flex: 1 1 130px;
  }
  .knowledge-audit,
  .knowledge-management {
    padding: 12px;
  }
  .knowledge-history-entry {
    padding: 12px;
  }
}

/* Shared registry workspace above the current module; origin keeps its own DOM. */
.registry-context-dialog {
  box-sizing: border-box;
  width: min(1160px, calc(100vw - 32px));
  max-width: none;
  height: min(90dvh, 1000px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid #d6deeb;
  border-top: 5px solid #fc0019;
  border-radius: 18px;
  background: #f5f7fc;
  color: #17345a;
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 24px 80px #00245455;
}
.registry-context-dialog::backdrop {
  background: #0c2346a6;
}
.registry-context-head {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  background: #fff;
  border-bottom: 1px solid #d6deeb;
}
.registry-context-head h2 {
  margin: 0;
  color: #00388b;
  font-size: 1.2rem;
}
.registry-context-head p {
  margin: 6px 0 0;
  font-size: 0.85rem;
}
.registry-context-head button {
  flex-shrink: 0;
  min-height: 44px;
}
.registry-context-body {
  padding: 16px;
  min-width: 0;
}
.registry-context-dialog > .settings-note,
.registry-context-dialog > .negative {
  margin: 12px 24px;
}
.registry-context-dialog > .settings-note:empty {
  display: none;
}
.registry-context-body .settings-content {
  min-width: 0;
}
.registry-context-body .registry-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  white-space: normal;
}
.registry-context-body .registry-tabs button {
  white-space: normal;
  min-height: 44px;
}
.registry-context-body .panel-head:empty {
  display: none;
}
.registry-context-body .structure-actions {
  flex-wrap: wrap;
}
.registry-context-body input,
.registry-context-body select,
.registry-context-body textarea {
  max-width: 100%;
  box-sizing: border-box;
}
.registry-discard {
  position: sticky;
  top: 0;
  z-index: 7;
  padding: 16px;
  background: #fff4f5;
  border: 2px solid #c00018;
  color: #17345a;
}
.registry-discard[hidden] {
  display: none;
}
.registry-discard button {
  margin: 4px;
  min-height: 44px;
}
.context-registry-bar {
  margin-bottom: 16px;
}
.registry-shortcuts {
  margin: 8px 0;
  min-width: 0;
}
.registry-shortcuts summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #00388b;
  font-weight: 700;
}
.registry-shortcuts summary::before {
  content: '+';
  font-size: 1.2rem;
}
.registry-shortcuts details[open] > summary::before {
  content: '−';
}
.registry-shortcuts-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}
.registry-shortcuts-menu button {
  min-height: 44px;
}
.registry-origin-update {
  margin: 10px 0;
}
@media (max-width: 600px) {
  .registry-context-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .registry-context-head {
    padding: 12px;
    gap: 10px;
    align-items: flex-start;
  }
  .registry-context-head h2 {
    font-size: 1.05rem;
  }
  .registry-context-head p {
    font-size: 0.8rem;
  }
  .registry-context-head button {
    max-width: 112px;
    font-size: 0.85rem;
    white-space: normal;
  }
  .registry-context-body {
    padding: 8px;
  }
  .registry-context-body .settings-content {
    padding: 12px;
  }
  .registry-context-body .registry-tabs button {
    flex: 1 1 42%;
    padding: 8px;
    font-size: 0.82rem;
  }
  .registry-context-body .registry-record {
    overflow-wrap: anywhere;
  }
  .registry-shortcuts-menu button {
    flex: 1 1 42%;
    white-space: normal;
  }
}

/* Registry organization: shared references and nucleus-owned registries. */
.registry-categories,
.registry-nuclei {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
}
.registry-categories {
  border-bottom: 1px solid #d6deeb;
}
.registry-categories button,
.registry-nuclei button {
  min-height: 44px;
  white-space: normal;
}
.registry-categories [aria-pressed='true'],
.registry-nuclei [aria-pressed='true'] {
  color: white;
  background: #00388b;
  border-color: #00388b;
}
.registry-section-note {
  padding: 4px 20px 12px;
}
.registry-section-note h2 {
  margin: 8px 0;
  font-size: 1.15rem;
  color: #00388b;
}
.registry-section-note p {
  margin: 8px 0;
}
.registry-planning {
  border-left: 3px solid #fc0019;
  padding: 8px 12px;
  background: #f5f7fc;
  border-radius: 6px;
}
.registry-planning summary {
  cursor: pointer;
  min-height: 32px;
  font-weight: 700;
  color: #00388b;
}
.registry-nuclei[hidden],
.registry-tabs [data-registry][hidden] {
  display: none !important;
}
@media (max-width: 600px) {
  .registry-categories,
  .registry-nuclei {
    padding: 10px 12px;
  }
  .registry-categories button {
    flex: 1;
  }
  .registry-nuclei button {
    flex: 1 1 100%;
  }
  .registry-section-note {
    padding: 4px 12px 12px;
  }
}

/* Financial approval uses the same panels and touch targets as the other RH modules. */
.finance-page {
  display: grid;
  gap: 18px;
}
.finance-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.finance-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.finance-form input,
.finance-form select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid var(--line, #d5deea);
  border-radius: 10px;
  background: white;
  color: var(--ink, #102d55);
  font: inherit;
}
.finance-page .registry-record {
  overflow-wrap: anywhere;
}
.finance-page .pj-stat {
  min-width: 0;
}
.finance-page .pj-stat h2 {
  font-size: 18px;
}
.finance-page .pj-stat small {
  line-height: 1.5;
}
@media (max-width: 650px) {
  .finance-form {
    grid-template-columns: 1fr;
  }
}

.finance-form [aria-invalid='true'] {
  border-color: #c40024;
  outline-color: #c40024;
}

.budget-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}
.budget-section-tabs button {
  min-height: 44px;
  padding: 12px 18px;
  border: 1px solid #cbd9eb;
  border-radius: 12px;
  background: #fff;
  color: #00388b;
  font: inherit;
  cursor: pointer;
}
.budget-section-tabs button[aria-selected='true'] {
  background: #00388b;
  color: #fff;
  border-color: #00388b;
}
.budget-section-tabs button:focus-visible {
  outline: 3px solid #fc0019;
  outline-offset: 3px;
}
.finance-page .pj-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.finance-page .panel {
  scroll-margin-top: 130px;
}
@media (max-width: 650px) {
  .budget-section-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }
  .finance-page .pj-summary {
    grid-template-columns: 1fr;
  }
}

/* Custos: separate currencies, readable ledger and horizontal scrolling only inside tables. */
.app-costs {
  min-width: 0;
}
.app-costs > section,
.app-costs > div {
  min-width: 0;
}
.app-costs h3 {
  margin-top: 1.4rem;
}
.app-costs .pj-stat {
  overflow-wrap: anywhere;
}
.cost-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  margin: 16px 0;
}
.cost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.cost-table th {
  color: var(--blue, #00388b);
  background: #eef3fa;
  text-align: left;
}
.cost-table th,
.cost-table td {
  padding: 12px;
  vertical-align: top;
  border-bottom: 1px solid #d8dfeb;
  min-width: 110px;
}
.app-costs .registry-record {
  overflow-wrap: anywhere;
}
.app-costs .settings-note {
  font-size: 14px;
}
.app-costs .finance-form {
  margin: 16px 0;
}
.app-costs .finance-form label {
  min-width: 0;
}
.app-costs .finance-form input,
.app-costs .finance-form select {
  box-sizing: border-box;
  max-width: 100%;
}

.app-costs.finance-page {
  gap: 12px;
}
.app-costs .pj-summary {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.app-costs > div > p {
  margin: 10px 0;
}
.app-costs .settings-notice {
  scroll-margin-top: 130px;
}

.five-level-catalog .settings-summary {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}
.five-level-catalog details {
  margin: 10px 0;
  padding-left: 12px;
}
.five-level-catalog summary {
  overflow-wrap: anywhere;
}
.five-level-catalog .registry-record {
  margin: 10px 0;
  overflow-wrap: anywhere;
}
.five-level-catalog .structure-error {
  color: #c40020;
}
@media (max-width: 600px) {
  .five-level-catalog details {
    padding-left: 8px;
  }
  .five-level-catalog .catalog-filters {
    grid-template-columns: 1fr;
  }
}
.five-level-catalog .structure-actions > label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #c60018;
  font-weight: 600;
  cursor: pointer;
}
.five-level-catalog .structure-actions > label input[type='checkbox'] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  accent-color: #00388b;
}

.approvals-page {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.approvals-page > section {
  min-width: 0;
}

.module-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  margin-top: 24px;
}
.module-navigation a:focus-visible {
  outline: 3px solid #fc0019;
  outline-offset: 3px;
}
.module-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.module-navigation a {
  padding: 12px 16px;
  border: 1px solid #cbd7ea;
  border-radius: 12px;
  background: #fff;
  color: #00388b;
  text-decoration: none;
  font-size: 14px;
}
.module-navigation a[aria-current='page'] {
  background: #00388b;
  color: #fff;
}
@media (max-width: 600px) {
  .module-navigation {
    display: grid;
    grid-template-columns: 1fr;
  }
  .module-navigation a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Shared module entrances and subpage selection — Adonai. */
.module-hub {
  border-top: 4px solid var(--red, #fc0019);
}
.module-hub > h1 {
  margin-bottom: 8px;
}
.module-hub > p {
  color: #435b7d;
}
.module-options {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  align-items: stretch;
}
.module-option {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 20px;
  min-height: 190px;
  border-radius: 16px;
  box-shadow: 0 2px 6px #00388b08;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
.module-option:hover {
  border-color: #00388b;
  box-shadow: 0 5px 16px #00388b12;
}
.module-option:active {
  background: #e1ebfa;
}
.module-option .module-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #edf3fc;
  color: #00388b;
}
.module-symbol svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.module-option .module-option-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.module-option strong {
  font-size: 18px;
  line-height: 1.35;
  color: #00388b;
}
.module-option .module-option-description {
  font-size: 14px;
  color: #435b7d;
  line-height: 1.55;
}
.module-option .module-open {
  font-size: 14px;
  font-weight: 700;
  color: #00388b;
}
.module-option.quality-link strong,
.module-option.quality-link .module-symbol,
.module-option.quality-link .module-open {
  color: #c00018;
}
.module-empty {
  padding: 18px;
  border: 1px dashed #cbd7ea;
  border-radius: 12px;
}
.module-navigation .module-back {
  font-weight: 700;
}
.module-navigation .quality-link:not([aria-current='page']) {
  color: #c00018;
}
.module-navigation a {
  min-height: 44px;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
}
.module-navigation a:hover {
  border-color: #00388b;
  background: #edf3fc;
}
.module-navigation a[aria-current='page'] {
  border-bottom: 3px solid #fc0019;
}
.module-navigation a[aria-current='page']:hover {
  background: #00388b;
  color: white;
}
:is(.settings-tabs, .structure-subpages, .budget-section-tabs) button {
  min-height: 48px;
  border: 1px solid #cbd7ea;
  border-radius: 12px;
  padding: 12px 16px;
  background: #fff;
  color: #00388b;
  font: inherit;
  line-height: 1.4;
  white-space: normal;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}
:is(.settings-tabs, .structure-subpages, .budget-section-tabs) button:hover:not(:disabled) {
  background: #edf3fc;
  border-color: #00388b;
}
:is(.settings-tabs, .structure-subpages, .budget-section-tabs)
  button:is([aria-current='page'], [aria-selected='true']) {
  background: #00388b;
  color: #fff;
  border-color: #00388b;
  box-shadow: inset 0 -3px #fc0019;
}
:is(.settings-tabs, .structure-subpages, .budget-section-tabs)
  button:is([aria-current='page'], [aria-selected='true']):hover {
  background: #00388b;
  color: #fff;
}
:is(.settings-tabs, .structure-subpages, .budget-section-tabs) button:focus-visible {
  outline: 3px solid #fc0019;
  outline-offset: 3px;
}
:is(.settings-tabs, .structure-subpages, .budget-section-tabs) button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.department-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  line-height: 1.5;
  margin-bottom: 18px;
}
.department-context a {
  padding: 10px 14px;
  border: 1px solid #cbd7ea;
  border-radius: 10px;
  background: white;
  color: #00388b;
  text-decoration: none;
}
.department-context a:focus-visible {
  outline: 3px solid #fc0019;
  outline-offset: 3px;
}
@media (max-width: 650px) {
  .module-option {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 14px;
    align-items: start;
    min-height: 0;
    padding: 16px;
    gap: 12px;
  }
  .module-option .module-symbol {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .module-option .module-option-body {
    min-width: 0;
    gap: 6px;
  }
  .module-option .module-open {
    font-size: 0;
    align-self: center;
  }
  .module-option .module-open:after {
    content: '›';
    font-size: 24px;
    line-height: 1;
  }
  .module-option strong {
    font-size: 17px;
  }
  .module-navigation {
    gap: 8px;
  }
  .module-navigation a {
    padding: 10px 14px;
  }
  :is(.settings-tabs, .structure-subpages, .budget-section-tabs) {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  :is(.settings-tabs, .structure-subpages, .budget-section-tabs) button {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .module-option,
  :is(.settings-tabs, .structure-subpages, .budget-section-tabs) button {
    transition: none;
  }
}

.module-option .module-option-description {
  font-weight: 400;
}

/* Connected work records share existing Adonai controls and touch targets. */
.work-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.work-context-actions {
  padding: 12px 0;
  flex-wrap: wrap;
}
.work-dialog {
  width: min(1000px, 94vw);
  max-height: 90dvh;
  overflow: auto;
  border: 1px solid var(--line, #d8e0eb);
  border-radius: 20px;
  padding: 20px;
  color: var(--ink, #152b49);
  background: #f5f7fb;
}
.work-dialog::backdrop {
  background: #10264299;
}
.work-page .structure-actions {
  flex-wrap: wrap;
}
.work-page .registry-record h2 {
  font-size: 1.2rem;
}
.work-page section > button {
  margin: 6px;
}
.work-page [aria-invalid='true'] {
  border-color: #c90020;
  outline: 1px solid #c90020;
}
@media (max-width: 600px) {
  .work-dialog {
    padding: 10px;
  }
  .work-context-actions button {
    width: 100%;
  }
  .work-page .structure-actions > * {
    max-width: 100%;
  }
  .work-page .registry-filters {
    grid-template-columns: 1fr;
  }
}

.work-page > section {
  scroll-margin-top: 140px;
}
.work-page > section:focus {
  outline: none;
}
.work-page .registry-record {
  gap: 12px;
}
.work-page .registry-record p {
  margin: 4px 0;
}
.work-page textarea {
  font: inherit;
  line-height: 1.5;
  padding: 12px;
  border: 1px solid #d7e1f0;
  border-radius: 12px;
  width: 100%;
  min-height: 110px;
  resize: vertical;
  background: #fff;
  color: inherit;
  box-sizing: border-box;
}
.work-page button,
.work-dialog > button {
  min-height: 44px;
}
.work-page input:focus-visible,
.work-page select:focus-visible,
.work-page textarea:focus-visible {
  outline: 2px solid #00388b;
  outline-offset: 2px;
}
@media (max-width: 600px) {
  .work-page input,
  .work-page select,
  .work-page textarea {
    font-size: 16px;
  }
}
.settings-notice .generation-warning,
.settings-notice .generation-warning strong {
  color: var(--text-negative);
}
.generation-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.generation-slots span {
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #dbe2ed;
  border-radius: 10px;
}
.generation-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.generation-sources article {
  background: #fff;
  border: 1px solid #dbe2ed;
  border-radius: 12px;
  padding: 12px;
}
.generation-sources p {
  margin: 8px 0;
}
.generation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.generation-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.generation-sources ~ ul {
  font-size: 14px;
  line-height: 1.6;
  padding-left: 20px;
}
.generation-sources ~ ul li {
  margin: 8px 0;
}
@media (max-width: 600px) {
  .generation-sources {
    grid-template-columns: 1fr;
  }
  .generation-actions button {
    width: 100%;
  }
}

/* Shared text fields keep the same typography and touch behavior across modules. */
textarea {
  font: inherit;
  line-height: 1.5;
  padding: 12px;
  border: 1px solid var(--line, #d8e0eb);
  border-radius: 12px;
  max-width: 100%;
  min-width: 0;
  min-height: 108px;
  resize: vertical;
  background: #fff;
  color: var(--ink, #152b49);
  box-sizing: border-box;
}
textarea:focus-visible {
  outline: 2px solid var(--blue, #00388b);
  outline-offset: 2px;
}
@media (max-width: 760px) {
  input:not([type='checkbox']):not([type='radio']):not([type='hidden']),
  select,
  textarea {
    font-size: 16px;
    min-height: 44px;
    max-width: 100%;
    min-width: 0;
  }
  .primary,
  .secondary {
    min-height: 44px;
  }
}
.allocation-batch-preview {
  max-height: 45vh;
  overflow: auto;
  margin: 16px 0;
}
.allocation-batch-preview table {
  min-width: 650px;
}
.allocation-batch-preview td,
.allocation-batch-preview th {
  text-align: left;
  white-space: normal;
  padding: 10px;
  font-size: 13px;
}
.allocation-batch-preview th {
  position: sticky;
  top: 0;
  background: #f3f6fa;
}
.allocation-dialog .field textarea {
  width: 100%;
  box-sizing: border-box;
}

.allocation-batch-dialog {
  width: min(1000px, 94vw);
}
.allocation-batch-departments {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  margin: 12px 0;
}
.allocation-batch-dialog .allocation-batch-departments input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  margin: 2px 0;
  accent-color: #00388b;
}
.allocation-batch-dialog textarea {
  font-size: 13px;
  white-space: pre;
  overflow: auto;
}

.allocation-batch-dialog .allocation-batch-departments {
  display: flex;
  text-align: left;
  justify-content: flex-start;
}
.allocation-batch-dialog .allocation-batch-departments input {
  min-width: 18px;
  max-width: 18px;
  padding: 0;
  box-sizing: border-box;
}
.allocation-batch-departments span {
  flex: 1;
  min-width: 0;
}

/* Cadastros: one navigable hierarchy, context-preserving editor. */
.structure-explorer {
  padding: 22px;
  margin-top: 18px;
}
.explorer-intro h2 {
  margin: 0 0 8px;
}
.explorer-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.explorer-metrics > .explorer-metric {
  padding: 14px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #f5f8fd;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.explorer-metrics strong {
  color: #00388b;
  font-size: 26px;
}
.explorer-metrics span {
  font-size: 13px;
}
.explorer-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.explorer-controls > input {
  flex: 1;
  min-width: 180px;
}
.explorer-pending {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c40018;
}
.explorer-pending input {
  width: 18px;
  height: 18px;
}
.explorer-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}
.explorer-tree {
  max-height: 65vh;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  padding: 8px;
}
.explorer-line {
  display: flex;
  align-items: center;
  border-radius: 10px;
  border-left: 3px solid transparent;
  margin: 3px 0;
  min-width: 0;
}
.explorer-line.is-selected {
  border-left-color: #fc0019;
  background: #eaf1fc;
}
.explorer-children {
  margin-left: 12px;
  border-left: 1px solid #dbe3ef;
  padding-left: 5px;
}
.explorer-select {
  border: 0;
  background: transparent;
  color: #173a68;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  flex: 1;
  padding: 10px;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  gap: 3px;
}
.explorer-select small {
  font-size: 11px;
  font-weight: 400;
  color: #58677b;
}
.explorer-select span {
  font-weight: 700;
}
.explorer-toggle {
  border: 0;
  background: transparent;
  min-width: 32px;
  min-height: 44px;
  font-size: 22px;
  color: #00388b;
}
.explorer-toggle-space {
  min-width: 32px;
}
.explorer-line.is-pending .explorer-select {
  color: #c40018;
}
.explorer-detail {
  position: sticky;
  top: 110px;
  min-width: 0;
  border: 1px solid #dbe3ef;
  border-top: 4px solid #00388b;
  border-radius: 14px;
  padding: 18px;
  overflow-wrap: anywhere;
}
.explorer-detail h3 {
  margin: 8px 0 18px;
  font-size: 22px;
}
.explorer-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 20px;
}
.explorer-crumb {
  border: 0;
  background: #f0f4fa;
  border-radius: 6px;
  color: #00388b;
  padding: 6px;
  font-size: 12px;
  white-space: normal;
  text-align: left;
}
.explorer-context {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
}
.explorer-context dt {
  color: #5d6b80;
  font-size: 12px;
}
.explorer-context dd {
  margin: 0;
  font-weight: 600;
  font-size: 13px;
}
.explorer-selected-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.explorer-child-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.explorer-child-list button {
  white-space: normal;
  text-align: left;
}
.structure-editor-dialog {
  width: min(850px, calc(100vw - 24px));
  max-height: 88vh;
  overflow: auto;
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  padding: 24px;
  color: #19375b;
  background: white;
  box-sizing: border-box;
}
.structure-editor-dialog::backdrop {
  background: #10233d80;
}
.structure-editor-dialog .structure-edit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.editor-context-path {
  color: #00388b;
  font-weight: 600;
  background: #eef4fc;
  padding: 12px;
  border-radius: 10px;
  overflow-wrap: anywhere;
}
.structure-explorer-management .structure-review:not([hidden]) {
  border-left: 4px solid #fc0019;
  padding: 18px;
  background: #fff8f9;
}
.structure-editor-dialog :is(input, select, textarea) {
  max-width: 100%;
  min-width: 0;
}
.explorer-select:focus-visible,
.explorer-toggle:focus-visible {
  outline: 2px solid #00388b;
  outline-offset: -2px;
}
@media (max-width: 760px) {
  .structure-explorer {
    padding: 14px;
  }
  .explorer-layout {
    grid-template-columns: 1fr;
  }
  .explorer-tree {
    max-height: 42vh;
  }
  .explorer-detail {
    position: static;
  }
  .explorer-metrics {
    gap: 6px;
  }
  .explorer-metrics > .explorer-metric {
    padding: 10px 6px;
  }
  .explorer-metrics strong {
    font-size: 22px;
  }
  .explorer-metrics span {
    font-size: 11px;
  }
  .explorer-controls > input {
    width: 100%;
    flex-basis: 100%;
  }
  .structure-editor-dialog {
    padding: 16px;
  }
  .structure-editor-dialog .structure-edit-grid {
    grid-template-columns: 1fr;
  }
  .explorer-context {
    grid-template-columns: 1fr;
  }
  .explorer-context dd {
    margin-bottom: 8px;
  }
}

.explorer-review-bar {
  position: sticky;
  bottom: 12px;
  background: #fff4f5;
  border: 1px solid #edb9c0;
  border-left: 4px solid #fc0019;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
  margin-top: 16px;
  box-shadow: 0 4px 18px #173a6817;
  z-index: 2;
}

.explorer-controls .explorer-pending {
  width: auto;
  flex: 0 1 auto;
  justify-content: flex-start;
}
.explorer-controls .explorer-pending input {
  flex: 0 0 18px;
  margin: 0;
}
.explorer-metrics span {
  overflow-wrap: anywhere;
}
.editor-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 3;
  background: white;
}
.structure-editor-dialog h2 {
  font-size: 24px;
  clear: both;
  padding-top: 12px;
}
.structure-editor-dialog .structure-actions {
  position: sticky;
  bottom: -16px;
  background: white;
  border-top: 1px solid #dbe3ef;
  padding: 12px 0;
  margin-bottom: 0;
}
@media (max-width: 760px) {
  .explorer-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .explorer-metrics span {
    font-size: 12px;
  }
  .explorer-metrics > .explorer-metric {
    padding: 12px;
  }
  .structure-editor-dialog h2 {
    font-size: 22px;
  }
}
.explorer-controls .explorer-pending {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.explorer-controls .explorer-pending input[type='checkbox'] {
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 0;
  flex: 0 0 18px;
}
.explorer-pending span {
  min-width: 0;
  white-space: normal;
  font-size: 13px;
}
.explorer-metrics span {
  hyphens: none;
  word-break: normal;
}
@media (max-width: 360px) {
  .explorer-metrics span {
    font-size: 10px;
  }
}

/* Shared organizational levels: one catalog, several explicit bindings. */
.shared-levels {
  padding: 22px;
  margin: 18px 0;
}
.shared-levels > .structure-actions input {
  flex: 1;
  min-width: 150px;
}
.shared-level-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.shared-level-row {
  padding: 16px;
  border: 1px solid #dbe3ef;
  border-left: 4px solid #00388b;
  border-radius: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.shared-level-row h3 {
  margin: 0;
  color: #00388b;
}
.shared-level-row details p {
  font-size: 13px;
}
.shared-level-row .structure-inline-actions button:last-child {
  color: #00388b;
}
.level-batch-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.level-batch-filters .multi-select-host {
  min-width: 0;
}
.level-batch-form input[type='checkbox'] {
  width: 20px;
  min-width: 20px;
  height: 20px;
}
.level-binding-list {
  max-height: 40vh;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  padding: 6px;
}
.level-binding-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  margin: 0;
  border-bottom: 1px solid #e6edf6;
  cursor: pointer;
}
.level-binding-option > span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.level-binding-option small {
  font-size: 12px;
  color: #58677b;
}
.level-binding-option input {
  flex: 0 0 20px;
  margin: 0;
}
.level-binding-option:has(input:checked) {
  background: #edf4ff;
  border-left: 3px solid #00388b;
}
.level-batch-count {
  font-weight: 600;
  color: #00388b;
}
.level-batch-preview {
  border-left: 4px solid #fc0019;
  border-radius: 10px;
  background: #fff7f8;
  padding: 16px;
  margin-top: 18px;
  overflow-wrap: anywhere;
}
.level-batch-preview[hidden] {
  display: none;
}
.level-batch-preview ul {
  max-height: 35vh;
  overflow: auto;
  padding-left: 20px;
}
.level-batch-preview li {
  margin: 8px 0;
}
.level-batch-preview .structure-confirm {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0;
}
.level-batch-preview [aria-invalid='true'] {
  outline: 2px solid #c40019;
}
.level-binding-list[aria-invalid='true'] {
  border: 2px solid #c40019;
}
@media (max-width: 760px) {
  .shared-levels {
    padding: 14px;
  }
  .shared-level-list,
  .level-batch-filters {
    grid-template-columns: 1fr;
  }
  .shared-level-row {
    padding: 12px;
  }
  .level-batch-form .flag-popover {
    width: 100%;
    max-width: 100%;
  }
  .level-batch-preview {
    padding: 12px;
  }
  .level-batch-form button {
    white-space: normal;
    max-width: 100%;
  }
}
.structure-editor-dialog {
  margin: auto;
  max-width: calc(100vw - 24px);
}
.level-batch-header {
  position: sticky;
  top: -24px;
  background: white;
  display: flex;
  justify-content: flex-end;
  z-index: 4;
  padding: 8px 0;
  border-bottom: 1px solid #e6edf6;
}
.level-batch-header .editor-close {
  position: static;
  float: none;
}
.level-batch-form > .structure-actions:last-child button:disabled {
  opacity: 0.6;
}
@media (max-width: 760px) {
  .level-batch-header {
    top: -16px;
  }
  .level-batch-form input,
  .level-batch-form select {
    font-size: 16px;
  }
}

/* A origem WDP tem nomenclatura própria; demais rótulos seguem ui-text.js. */
.wdp-source-value {
  text-transform: uppercase;
}

/* Clear distinction between registry, source mapping and operational allocation. */
.structure-diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.structure-diagnostic-card {
  min-width: 0;
  border: 1px solid #dce3ee;
  border-top: 3px solid #00388b;
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
}
.structure-diagnostic-card h3,
.structure-diagnostic-card p {
  margin: 0;
}
.structure-diagnostic-card > strong {
  font-size: 28px;
}
.structure-diagnostic-card > p {
  line-height: 1.55;
}
.structure-diagnostic-card .secondary {
  max-width: 100%;
  white-space: normal;
  text-align: left;
  min-height: 44px;
}
.structure-diagnostic-card > a {
  margin-top: auto;
}
.correlation-diagnosis {
  min-width: 270px;
  max-width: 350px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.correlation-diagnosis p {
  margin: 8px 0;
  line-height: 1.5;
}
.correlation-diagnosis .secondary {
  margin-top: 12px;
  white-space: normal;
  min-height: 44px;
}
.structure-consistency,
.correlation-review {
  scroll-margin-top: 145px;
}
@media (max-width: 1000px) {
  .structure-diagnostic-grid {
    grid-template-columns: 1fr;
  }
  .structure-diagnostic-card {
    padding: 16px;
  }
  .correlation-diagnosis {
    min-width: 245px;
  }
}

.correlation-table th:nth-child(3) {
  width: 10%;
}
.correlation-table th:nth-child(4) {
  width: 20%;
}
.correlation-table th:nth-child(5) {
  width: 36%;
}
@media (max-width: 760px) {
  .correlation-table .correlation-row {
    display: flex;
    flex-direction: column;
  }
  .correlation-table .correlation-row td.correlation-diagnosis {
    order: 3;
    max-width: 100%;
  }
  .correlation-table .correlation-row td.regional-salary {
    order: 4;
  }
  .correlation-diagnosis button {
    width: 100%;
  }
}

/* Atalhos de profundidade do mapa; consulta apenas, sem efeitos nos cadastros. */
.explorer-metric {
  font: inherit;
  color: #173a68;
  text-align: left;
  cursor: pointer;
  min-height: 76px;
  min-width: 0;
  white-space: normal;
}
.explorer-metric:hover:not(:disabled) {
  background: #eaf1fc;
  border-color: #00388b;
}
.explorer-metric:focus-visible {
  outline: 3px solid #00388b;
  outline-offset: 3px;
}
.explorer-metric[aria-pressed='true'] {
  background: #00388b;
  border-color: #00388b;
  box-shadow: inset 0 -4px 0 #fc0019;
  color: #fff;
}
.explorer-metric[aria-pressed='true'] strong,
.explorer-metric[aria-pressed='true'] span {
  color: #fff;
}
.explorer-metric[aria-pressed='true']:hover {
  background: #002d70;
}
.explorer-metric:disabled {
  cursor: default;
  opacity: 0.6;
}
@media (prefers-reduced-motion: reduce) {
  .explorer-metric {
    transition: none;
  }
}
@media (max-width: 480px) {
  .explorer-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .explorer-metrics span {
    font-size: 12px;
  }
}

/* Shared function references in Cadastros and Cargos e salários. */
.function-reference {
  min-width: 0;
  margin-top: 1rem;
  border-top: 1px solid var(--line, #d9e1ee);
  padding-top: 0.75rem;
}
.function-reference h4 {
  margin: 0.8rem 0 0.4rem;
  color: var(--blue, #00388b);
}
.function-step-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.7rem 0;
}
.function-step-links button,
.function-step-label {
  white-space: normal;
  overflow-wrap: anywhere;
}
.function-step-links button[aria-pressed='true'] {
  background: #00388b;
  color: #fff;
}
.step-preview {
  max-height: 45vh;
  overflow: auto;
  overscroll-behavior: contain;
}
.step-preview p,
.function-reference p {
  overflow-wrap: anywhere;
}

.headcount-reconciliation-dialog {
  width: min(1100px, 94vw);
  max-width: 94vw;
  max-height: 90dvh;
  overflow: auto;
  overscroll-behavior: contain;
}
.headcount-reconciliation-dialog .correlation-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 0.65rem;
}
.headcount-reconciliation-dialog .correlation-stat {
  white-space: normal;
  overflow-wrap: anywhere;
  min-height: 60px;
}
.headcount-reconciliation-dialog .correlation-stat[aria-pressed='true'] {
  background: #00388b;
  color: white;
}
.headcount-reconciliation-dialog input[type='search'] {
  width: 100%;
  margin: 1rem 0;
}
.reconciliation-people {
  display: grid;
  gap: 1rem;
}
.reconciliation-people p {
  overflow-wrap: anywhere;
}
.reconciliation-people .structure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.reconciliation-people button {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Reconciliation: direct function lookup, shared hierarchy and one save. */
.correlation-targets {
  display: grid;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}
.correlation-target {
  width: 100%;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  min-height: 44px;
}
.correlation-impact {
  overflow-wrap: anywhere;
}

/* Headcount: consulta nominal e conciliação no mesmo contexto. */
.headcount-unresolved-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--red, #b51d36);
  font-weight: 700;
  min-height: 44px;
  cursor: pointer;
  align-self: end;
}
.headcount-unresolved-filter input {
  width: 20px;
  height: 20px;
  accent-color: #b51d36;
  flex: none;
}
.headcount-people {
  scroll-margin-top: 150px;
}
.headcount-person-list {
  display: grid;
  gap: 12px;
}
.headcount-person-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  border: 1px solid var(--line, #dbe3ef);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}
.headcount-person-row h3 {
  font-size: 16px;
  margin: 0 0 7px;
}
.headcount-person-row p {
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  margin: 6px 0;
}
.headcount-person-row small {
  color: #536681;
}
.headcount-person-row details {
  margin-top: 12px;
  font-size: 13px;
}
.headcount-person-row summary {
  cursor: pointer;
  color: #173b78;
}
.headcount-person-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  min-width: 145px;
}
.headcount-person-actions button {
  white-space: normal;
}
.allocation-quick {
  margin: 16px 0;
}
.allocation-quick select {
  max-width: 100%;
  min-width: 0;
}
.allocation-quick small {
  font-size: 12px;
}
.data-refresh-status button {
  margin: 8px 12px;
}
@media (max-width: 760px) {
  .headcount-person-row {
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .headcount-person-actions {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: 0;
  }
  .headcount-person-actions button {
    flex: 1;
    min-height: 44px;
  }
  .headcount-unresolved-filter {
    width: 100%;
  }
  .headcount-people {
    scroll-margin-top: 130px;
  }
}

.allocation-editor-header {
  position: sticky;
  top: -28px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.allocation-editor-header h2 {
  margin: 0;
}
.allocation-editor-header button {
  flex: none;
}
.allocation-dialog select,
.allocation-dialog textarea {
  scroll-margin-top: 90px;
}
@media (max-width: 600px) {
  .allocation-editor-header {
    top: -20px;
  }
  .allocation-editor-header h2 {
    font-size: 20px;
  }
}

.headcount-people {
  margin-bottom: 22px;
}
.headcount-people > .field {
  margin: 0 22px 12px;
}
.headcount-people > .settings-note,
.headcount-people > .headcount-person-list {
  margin: 0 22px 18px;
}
.headcount-people > button {
  margin: 0 22px 22px;
}

.headcount-people > .negative {
  margin: 0 22px 18px;
}
.headcount-person-row small,
.headcount-person-row strong {
  display: block;
  margin-top: 6px;
}
.headcount-unresolved-filter {
  width: fit-content;
  max-width: 100%;
  grid-column: 1/-1;
  justify-content: flex-start;
  white-space: nowrap;
}
.headcount-unresolved-filter input {
  flex: 0 0 20px;
  min-width: 20px;
  max-width: 20px;
  padding: 0;
  margin: 0;
}
.headcount-unresolved-filter span {
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

/* Shared presentation order. Controls stay compact and keyboard/touch accessible. */
button.column-order {
  display: inline-flex;
  align-items: center;
  justify-content: inherit;
  gap: 0.35rem;
  min-height: 40px;
  padding: 5px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: inherit;
  white-space: normal;
  vertical-align: middle;
}
button.column-order:hover {
  background: rgba(0, 56, 139, 0.08);
}
button.column-order:focus-visible {
  outline: 2px solid #00388b;
  outline-offset: 2px;
}
.order-arrow {
  flex: none;
  font-size: 0.85em;
  min-width: 0.8em;
  opacity: 0.65;
}
[aria-sort='ascending'] .order-arrow,
[aria-sort='descending'] .order-arrow,
[aria-pressed='true'] > .order-arrow {
  opacity: 1;
  color: inherit;
}
.view-order-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  margin: 8px 0;
  border: 1px solid var(--line, #dbe2ee);
  border-radius: 10px;
  background: #f1f5fb;
  color: #00388b;
}
.view-order-header > button:first-child {
  margin-right: auto;
}
@media (max-width: 640px) {
  button.column-order {
    min-height: 44px;
    padding: 5px;
  }
  .view-order-header {
    gap: 4px;
    padding: 6px 8px;
  }
}

/* Estado da decisão: texto explícito e cores com contraste em fundo claro. */
.budget-decision-status {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px 9px;
  line-height: 1.4;
  font-weight: 800;
  white-space: normal;
}
.budget-decision-status[data-status='rejected'] {
  color: #b42338;
  background: #fff0f2;
  border-color: #f0bac3;
}
.budget-decision-status[data-status='approved'] {
  color: #166534;
  background: #eefbf2;
  border-color: #b7dec4;
}
.budget-decision-status[data-status='pending'] {
  color: #725100;
  background: #fff4b8;
  border-color: #e6c75c;
}
.budget-decision-feedback {
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.budget-decision-feedback:empty {
  display: none;
}
.budget-decision-feedback.error {
  color: #b42338;
}
.budget-decision-feedback button {
  display: block;
  margin-top: 12px;
}
.budget-decision-feedback:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
[data-budget-request] > summary {
  line-height: 2.1;
}

/* 0.130: shared action dimensions; cards and navigation keep their own semantics. */
:root {
  --action-height: 44px;
  --action-radius: 10px;
  --action-font: 13px;
  --action-space: 10px 14px;
  --card-space: 20px;
  --card-gap: 16px;
}
:root body :is(main, dialog, .sidebar) :is(button, a, summary):is(.primary, .secondary) {
  min-height: var(--action-height);
  padding: var(--action-space);
  border-radius: var(--action-radius);
  font-size: var(--action-font);
  font-weight: 700;
  line-height: 20px;
  gap: 8px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  box-sizing: border-box;
}
:root body :is(main, dialog, .sidebar) :is(button, a).primary {
  border: 1px solid transparent;
}
:root body :is(main, dialog, .sidebar) :is(button, a):is(.primary, .secondary) > svg {
  width: 20px;
  height: 20px;
  flex: none;
}
:root body :is(main, dialog, .sidebar) :is(button, a, summary):is(.primary, .secondary)[hidden] {
  display: none;
}
:is(.panel-actions, .structure-actions, .budget-actions, .allocation-actions, .generation-actions) {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.panel-head {
  align-items: center;
}
.panel-head > div:first-child {
  min-width: 0;
}
.panel-actions {
  min-width: 0;
  max-width: 100%;
}
:is(.journey-grid, .data-flow, .budget-stats, .pj-summary, .module-options) {
  align-items: stretch;
  gap: var(--card-gap);
}
:is(.journey-card, .flow-card, .budget-stats > article, .pj-summary > article) {
  padding: var(--card-space);
  border-radius: var(--radius);
  min-width: 0;
  overflow-wrap: anywhere;
}
/* Compact contextual actions, still accessible by keyboard and only to permitted users. */
.work-context-actions {
  padding: 0;
  margin: 0 0 14px;
  position: relative;
}
.work-context-actions > summary {
  width: fit-content;
  list-style: none;
  cursor: pointer;
}
.work-context-actions > summary::-webkit-details-marker {
  display: none;
}
.work-context-actions > summary:after {
  content: '⌄';
  margin-left: 8px;
}
.work-context-actions[open] > summary:after {
  content: '⌃';
}
.work-context-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0 0;
}
.work-context-options > button {
  width: auto;
}
/* Headcount toolbar: only the export entry point and occasional actions are visible. */
#headcount-export {
  display: contents;
}
.headcount-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: #f7f9fc;
}
.headcount-tools[hidden] {
  display: none;
}
.headcount-reading {
  margin: 20px 0 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.headcount-reading summary {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  min-height: 28px;
}
.headcount-reading p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}
.headcount-source {
  padding: 12px 16px;
  margin-bottom: 18px;
}
.headcount-export-dialog {
  width: min(580px, calc(100% - 24px));
  max-height: 90dvh;
  padding: 24px;
  overflow: auto;
}
.export-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.export-dialog-head h2 {
  font-size: 22px;
  line-height: 1.3;
  margin: 0;
}
.export-dialog-head > button {
  flex: none;
}
.headcount-export-dialog .export-feedback {
  margin: 16px 0 0;
  overflow-wrap: anywhere;
}
.headcount-export-dialog .export-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  margin-top: 18px;
}
.headcount-export-dialog .privacy-export-check {
  align-items: flex-start;
  line-height: 1.6;
}
.headcount-export-dialog .privacy-export-check input {
  flex: none;
  margin-top: 3px;
}
/* Equivalent cards use identical numeric scale, aligned rows and spacing. */
#priority-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--card-gap);
}
#priority-summary .priority-card {
  padding: 22px;
  gap: 0;
  border-radius: var(--radius);
}
#priority-summary .priority-top {
  margin-bottom: 20px;
  min-height: 28px;
  letter-spacing: 0;
}
#priority-summary .priority-context {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
#priority-summary .store-count {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
  border: 1px solid #ffffff70;
  border-radius: 8px;
  padding: 3px 8px;
}
#priority-summary .priority-values {
  margin-top: 0;
  gap: 16px;
}
#priority-summary .priority-values strong {
  font-size: 34px;
}
#priority-summary .priority-bottom {
  margin-top: 18px;
  padding-top: 12px;
  min-height: 36px;
}
#priority-summary .highlight-item {
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
#priority-summary .highlight-item strong {
  font-size: 20px;
}
#priority-summary .highlight-item span {
  font-size: 11px;
}
#priority-summary .card-highlights {
  gap: 10px 18px;
}
#priority-summary > article > small,
#priority-summary > button > small {
  font-size: 11px;
  min-height: 44px;
  padding-top: 14px;
}
main > .summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--card-gap);
}
main > .summary-grid .summary-card {
  padding: 18px;
  border-radius: var(--radius);
}
main > .summary-grid .card-top {
  min-height: 36px;
  margin-bottom: 14px;
}
main > .summary-grid .value-pair strong {
  font-size: 28px;
}
main > .summary-grid .card-bottom {
  margin-top: 14px;
  min-height: 48px;
  align-items: flex-start;
}
main > .summary-grid .highlight-item {
  min-height: 26px;
}
@media (max-width: 760px) {
  :root {
    --card-space: 16px;
    --card-gap: 12px;
  }
  .panel-actions {
    justify-content: flex-start;
    width: 100%;
  }
  #priority-summary {
    grid-template-columns: 1fr;
  }
  #priority-summary .priority-card {
    padding: 18px;
  }
  #priority-summary .priority-values strong {
    font-size: 32px;
  }
  main > .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  main > .summary-grid .summary-card {
    padding: 14px;
  }
  main > .summary-grid .value-pair strong {
    font-size: 26px;
  }
  main > .summary-grid .card-top {
    font-size: 12px;
  }
  .headcount-tools {
    padding: 12px 16px;
  }
  .headcount-export-dialog {
    padding: 18px;
  }
  .export-dialog-head {
    align-items: flex-start;
    gap: 12px;
  }
  .export-dialog-head h2 {
    font-size: 20px;
  }
  .work-context-options {
    display: grid;
    grid-template-columns: 1fr;
  }
  .work-context-options > button {
    width: 100%;
  }
}
@media (max-width: 380px) {
  main > .summary-grid {
    grid-template-columns: 1fr;
  }
  #priority-summary .highlight-item span {
    font-size: 10px;
  }
  #priority-summary .highlight-item strong {
    font-size: 18px;
  }
}
.headcount-people .panel-head {
  padding-bottom: 12px;
}
.headcount-people > .field {
  margin-bottom: 18px;
}
.headcount-people > .settings-note[hidden] {
  display: none;
}

/* 0.131: one navigation surface; the page uses the space previously occupied by the header. */
:root {
  --app-header-height: 0px;
}
.sidebar {
  padding-top: 18px;
  border-top: 4px solid var(--red);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.sidebar .wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0 6px;
  margin: 0 0 18px;
  background: transparent;
  flex: none;
}
.sidebar .sidebar-adonai {
  display: block;
  width: 100%;
  max-width: 218px;
  height: auto;
  object-fit: contain;
}
.sidebar .sidebar-mmg {
  display: block;
  text-align: left;
  padding: 0 10px;
}
.sidebar .sidebar-mmg > span {
  font-size: 13px;
  letter-spacing: 2px;
}
.sidebar .sidebar-mmg strong {
  font-size: 42px;
  line-height: 1.1;
}
.sidebar .page-navigation {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 0 24px;
  flex: none;
}
.sidebar .page-navigation button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  padding: 10px;
}
.sidebar .page-navigation button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.sidebar .side-bottom {
  padding: 12px 4px 0;
  margin-top: 22px;
  flex: none;
}
.sidebar .identity {
  padding-top: 16px;
  margin-top: 0;
}
.sidebar-help {
  border-top: 1px solid var(--line);
  padding: 18px 4px 4px;
  margin-top: 12px;
  flex: none;
}
.sidebar-help h2 {
  font-size: 13px;
  margin: 0 0 10px;
  color: var(--text-brand);
}
.sidebar-help #help {
  width: 100%;
  font-size: 12px;
}
.sidebar-help .app-build-status {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 16px 0 0;
  text-align: center;
}
.menu-close {
  display: none;
}
.workspace > .mobile-menu {
  display: none;
}
@media (max-width: 760px) {
  .workspace {
    padding-top: calc(56px + env(safe-area-inset-top, 0px));
  }
  .workspace > main {
    padding-top: 12px;
  }
  .workspace > .mobile-menu {
    display: inline-flex;
    position: fixed;
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: 16px;
    z-index: 15;
    width: 44px;
    height: 44px;
    border-color: #b9cdec;
    box-shadow: 0 3px 12px #00388b14;
  }
  .sidebar {
    width: min(300px, calc(100vw - 32px));
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  }
  .sidebar .wordmark {
    margin-bottom: 18px;
  }
  .sidebar .sidebar-adonai {
    max-width: 218px;
  }
  .sidebar .sidebar-mmg {
    display: block;
  }
  .menu-close {
    display: inline-flex;
    position: sticky;
    top: calc(8px + env(safe-area-inset-top, 0px));
    align-self: flex-end;
    z-index: 2;
    flex: none;
    margin: 0 0 8px auto;
    width: 44px;
    height: 44px;
  }
  body.navigation-open {
    overflow: hidden;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar {
    transition: none;
  }
}
@media print {
  .workspace > .mobile-menu,
  .menu-close {
    display: none !important;
  }
  .workspace {
    padding-top: 0;
  }
}

/* 0.132: distinguish planned positions from people, without another permanent dashboard. */
.headcount-pending {
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: 12px;
  background: #fff;
  min-width: 0;
}
.headcount-pending[hidden] {
  display: none;
}
.headcount-pending > details > summary {
  display: flex;
  align-items: center;
  gap: 10px 20px;
  flex-wrap: wrap;
  cursor: pointer;
  padding: 16px;
  min-height: 44px;
  list-style: none;
  font-size: 13px;
}
.headcount-pending > details > summary::-webkit-details-marker {
  display: none;
}
.headcount-pending summary > strong {
  color: var(--blue);
}
.pending-budget-count,
.pending-people-count {
  font-weight: 700;
  color: var(--danger);
}
.pending-expand {
  margin-left: auto;
  color: var(--blue);
  font-weight: 700;
}
.pending-expand:after {
  content: ' ▾';
}
.headcount-pending details[open] .pending-expand:after {
  content: ' ▴';
}
.pending-explanation {
  border-top: 1px solid var(--line);
  padding: 4px 18px 18px;
  font-size: 13px;
  line-height: 1.65;
}
.pending-explanation h3 {
  font-size: 16px;
  color: var(--blue);
  margin: 22px 0 8px;
}
.pending-explanation .matrix-wrap {
  max-height: 420px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.pending-explanation table {
  min-width: 850px;
}
.pending-explanation td {
  white-space: normal;
  max-width: 300px;
  text-align: left;
}
.pending-explanation th {
  text-align: left;
}
@media (max-width: 760px) {
  .headcount-pending > details > summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px;
  }
  .pending-expand {
    margin-left: 0;
  }
  .pending-explanation {
    padding: 2px 14px 14px;
  }
  .pending-explanation .structure-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Shared date entry: Brazilian typing + native calendar, ISO payload unchanged. */
.date-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 6px;
  align-items: center;
  width: 100%;
  min-width: 0;
  position: relative;
}
.date-entry input {
  width: 100%;
  min-width: 0;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.date-entry-calendar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 9px;
  border: 1px solid var(--line, #d5ddeb);
  border-radius: 10px;
  background: white;
  color: var(--blue, #00388b);
}
.date-entry-calendar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
input.date-entry-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  clip-path: inset(50%);
  overflow: hidden;
  opacity: 0;
}
.date-entry input[aria-invalid='true'] {
  border-color: #c8102e;
  box-shadow: 0 0 0 1px #c8102e;
}
.date-entry-calendar:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.date-entry:has(input:disabled) {
  opacity: 0.7;
}
.snapshot-picker[aria-busy='true'] .snapshot-message {
  color: #00388b;
  font-weight: 600;
}

.snapshot-latest {
  border: 0;
  background: transparent;
  color: var(--blue, #00388b);
  text-align: left;
  padding: 5px 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.snapshot-latest:disabled {
  opacity: 1;
  cursor: default;
  color: #4b607a;
}
.snapshot-picker > .allocation-edit {
  margin-top: 6px;
}
.snapshot-message {
  min-height: 2.5em;
}

/* Calendar controls respond to a single touch; vertical page scrolling stays native. */
.snapshot-toggle,
.snapshot-days button,
.snapshot-month-nav button,
.snapshot-close,
.snapshot-latest {
  touch-action: manipulation;
}

/* Pending budget origins: compact cards remain usable without a wide table. */
.budget-pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #dce3ee;
  padding: 16px 0;
}
.budget-pending-item > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.budget-pending-item p {
  margin: 6px 0;
}
.budget-pending-item button {
  flex-shrink: 0;
}
.budget-reconciliation h2 {
  color: #b41531;
}
.budget-reconciliation input {
  width: 100%;
  max-width: 600px;
}
@media (max-width: 600px) {
  .budget-pending-item {
    align-items: stretch;
    flex-direction: column;
  }
  .budget-pending-item button {
    align-self: flex-start;
    white-space: normal;
  }
}
.budget-reconciliation {
  padding: 20px;
}
.budget-reconciliation > .panel-head {
  padding: 0;
  margin-bottom: 16px;
}
.budget-reconciliation > p,
.budget-pending-item p {
  font-size: 0.9rem;
  line-height: 1.5;
}
.budget-reconciliation > label {
  display: block;
}
.budget-reconciliation #budget-pending-scope {
  color: #526780;
  font-size: 0.8rem;
}

/* Same hierarchy vocabulary as Budget; repeated names retain their explicit level. */
.headcount-level-label {
  white-space: normal;
  overflow-wrap: anywhere;
  display: block;
  margin: 3px 0 0 22px;
  color: #526780;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
}
.hierarchy-navigation tr[data-kind='department'] > .sticky {
  border-left: 3px solid #00388b;
}
.hierarchy-navigation tr[data-kind='nucleus'] > .sticky,
.hierarchy-navigation tr[data-kind='sector'] > .sticky {
  border-left: 3px solid #d6e1f2;
}
.hierarchy-navigation tr[data-kind] > .sticky {
  vertical-align: middle;
}
.hierarchy-navigation tr[data-kind] .tree-toggle {
  white-space: normal;
  text-align: left;
  line-height: 1.4;
}
.hierarchy-navigation tr[data-kind] .allocation-edit {
  margin-top: 5px;
}
/* Central registry navigation: keep full words and compact, tappable groups on phones. */
@media (max-width: 650px) {
  .registry-categories button[data-registry-category='organization'] {
    flex: 1 1 100%;
    overflow-wrap: normal;
    word-break: normal;
  }
  .registry-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .registry-tabs button {
    min-width: 0;
    min-height: 48px;
    padding: 10px;
    font-size: 0.88rem;
    overflow-wrap: normal;
    word-break: normal;
  }
}
/* Single salary references stay visible together without widening mobile pages. */
.function-reference .regional-salary {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.salary-single-value {
  margin: 0.45rem 0;
  font-variant-numeric: tabular-nums;
  color: var(--blue, #00388b);
}
.function-profile {
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line, #d9e1ee);
  border-radius: 10px;
}
.function-profile summary {
  font-weight: 700;
  color: var(--blue, #00388b);
  cursor: pointer;
}
.function-profile li {
  margin: 0.35rem 0;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .function-reference .salary-comparison-grid {
    min-width: 0;
    grid-template-columns: repeat(var(--salary-columns, 3), minmax(0, 1fr));
    gap: 6px;
  }
  .function-reference .regional-salary-item {
    padding: 8px;
  }
  .function-reference .salary-region-name {
    font-size: 11px;
    overflow-wrap: anywhere;
  }
  .function-reference .salary-single-value {
    font-size: 13px;
  }
  .function-reference .regional-salary-item > small {
    font-size: 10px;
    overflow-wrap: anywhere;
  }
}

/* Compact rows retain comfortable tap targets; quantities and rates remain distinct. */
.headcount-gap strong,
.headcount-gap small {
  display: block;
  line-height: 1.35;
}
.headcount-gap small {
  font-size: 11px;
  color: #53647c;
}
.headcount-gap {
  min-width: 78px;
}
#unit-panel .live-matrix td {
  padding-top: 7px;
  padding-bottom: 7px;
}
#unit-panel .tree-toggle {
  min-height: 36px;
}
#unit-panel .headcount-level-label {
  margin-top: 0;
  font-size: 10px;
}

.card-bottom:has(> span > strong),
.priority-bottom:has(> span > strong) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.card-bottom > span > strong,
.priority-bottom > span > strong {
  display: block;
}

/* Commercial indicators remain readable in the existing horizontally scrollable matrix. */
.commercial-percapita {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 104px;
}
.commercial-context {
  font-size: 0.82rem;
  color: var(--muted, #526582);
  line-height: 1.5;
  margin: 12px 0;
}
.commercial-context button {
  margin-left: 12px;
}
.headcount-filters .field select {
  max-width: 100%;
}

#unit-panel tr[data-kind='unit'] > .sticky {
  min-width: 300px;
}
#unit-panel tr[data-kind='unit'] > .sticky > .headcount-level-label {
  display: none;
}
#unit-panel tr[data-kind='unit'] > .sticky > .tree-toggle {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  min-height: 44px;
  max-width: calc(100% - 135px);
}
#unit-panel tr[data-kind='unit'] > .sticky > .headcount-budget-shortcut {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin: 0 0 0 8px;
  padding: 6px 8px;
  min-height: 44px;
  font-size: 11px;
  max-width: 125px;
}
@media (max-width: 760px) {
  #unit-panel .sticky,
  #department-panel .sticky {
    min-width: 180px;
    max-width: 180px;
    width: 180px;
  }
  #unit-panel tr[data-kind='unit'] > .sticky {
    min-width: 180px;
  }
  #unit-panel tr[data-kind='unit'] > .sticky > .tree-toggle {
    max-width: calc(100% - 54px);
  }
  #unit-panel tr[data-kind='unit'] > .sticky > .headcount-budget-shortcut {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    justify-content: center;
    font-size: 0;
    padding: 6px;
    margin-left: 6px;
  }
  #unit-panel tr[data-kind='unit'] > .sticky > .headcount-budget-shortcut::before {
    content: '\270E';
    font-size: 20px;
    line-height: 1;
  }
}

.settings-help > summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Shared hierarchy language: Headcount, Budget and organizational catalogues. */
:is(.catalog-department, .catalog-sector, .budget-unit, .budget-department, .budget-area)
  > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  box-sizing: border-box;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #f5f8fd;
  color: var(--blue);
  list-style: none;
  cursor: pointer;
}
:is(.catalog-department, .catalog-sector, .budget-unit, .budget-department, .budget-area)
  > summary::-webkit-details-marker {
  display: none;
}
:is(.catalog-department, .catalog-sector, .budget-unit, .budget-department, .budget-area)
  > summary::before {
  content: '+';
  flex: 0 0 22px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
}
:is(.catalog-department, .catalog-sector, .budget-unit, .budget-department, .budget-area)[open]
  > summary::before {
  content: '−';
}
:is(.catalog-department, .catalog-sector, .budget-unit, .budget-department, .budget-area)[open]
  > summary {
  background: #e7effc;
  box-shadow: inset 3px 0 var(--blue);
}
:is(.catalog-department, .catalog-sector, .budget-unit, .budget-department, .budget-area)
  > summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
:is(.catalog-department, .catalog-sector, .budget-unit, .budget-department, .budget-area)
  > summary:hover {
  background: #eaf1fc;
}
.hierarchy-disclosure {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 10px 0;
}
.hierarchy-disclosure > .hierarchy-disclosure,
.hierarchy-disclosure > .registry-record {
  margin: 10px 14px;
}
.hierarchy-title {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.hierarchy-title small {
  font-size: 11px;
  font-weight: 400;
  color: #526780;
}
.hierarchy-count {
  font-size: 12px;
  white-space: nowrap;
  color: #526780;
}
.five-level-catalog .settings-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.five-level-catalog .settings-summary > article {
  min-width: 0;
  margin: 0;
  padding: 14px;
  background: #f5f8fd;
  border: 1px solid var(--line);
  border-radius: 10px;
}
:is(.structure-inline-actions, .structure-actions, .budget-actions, .panel-actions) {
  align-items: center;
  gap: 10px;
}
:is(.structure-inline-actions, .structure-actions, .budget-actions, .panel-actions) > button {
  min-height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.35;
  white-space: normal;
}
.structure-inline-actions {
  padding: 10px 14px;
  margin: 0;
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  :is(.catalog-department, .catalog-sector, .budget-unit, .budget-department, .budget-area)
    > summary {
    padding: 10px;
    gap: 6px;
  }
  .hierarchy-disclosure > .hierarchy-disclosure,
  .hierarchy-disclosure > .registry-record {
    margin: 8px;
  }
  .hierarchy-count {
    font-size: 11px;
  }
  .five-level-catalog .settings-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .structure-inline-actions > button {
    flex: 1 1 120px;
  }
}

.five-level-catalog .settings-summary > article {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  min-height: 56px;
}
.five-level-catalog .settings-summary > article > strong {
  font-size: 22px;
  margin: 0;
}
.five-level-catalog .settings-summary > article > span {
  font-size: 12px;
  line-height: 1.35;
}
.catalog-filter-box {
  border-block: 1px solid var(--line);
  margin: 14px 0;
  padding: 10px 0;
}
.catalog-filter-box > summary {
  cursor: pointer;
  color: var(--blue);
  min-height: 44px;
  align-content: center;
}
.catalog-filter-box .catalog-filters {
  margin-top: 14px;
}
.five-level-catalog .structure-actions > label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 44px;
}
.five-level-catalog .structure-actions > label input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.structure-diagnostic-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.structure-diagnostic-card > p {
  flex: 1;
  margin-block: 4px 12px;
}
.structure-diagnostic-card > :is(button, a.secondary) {
  min-height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  line-height: 1.35;
  white-space: normal;
}
.structure-region-control > summary {
  cursor: pointer;
  min-height: 44px;
  align-content: center;
  font-weight: 600;
  color: var(--blue);
}

/* Shared RI reference details stay collapsed until requested. */
.ri-template-preview {
  grid-column: 1/-1;
  min-width: 0;
}
.ri-template {
  overflow-wrap: anywhere;
}
.ri-template .registry-record {
  margin: 10px 0;
}
.ri-form textarea[name='objective'],
.ri-form textarea[name='objectives'] {
  min-height: 160px;
}
.ri-template-preview > button {
  margin-top: 10px;
}

.ri-formation-card {
  cursor: pointer;
}
.ri-formation-card .settings-note {
  margin: 8px 0;
  line-height: 1.5;
}
.ri-formation-card .secondary {
  margin-top: 8px;
}

.headcount-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.headcount-heading h1,
.headcount-heading .data-freshness-badge,
.headcount-heading .context-help {
  margin: 0;
}
.headcount-heading h1 {
  order: 0;
}
.headcount-heading .data-freshness-badge {
  order: 1;
}
.headcount-heading .context-help {
  order: 2;
}
.ri-formation-card .settings-note {
  display: block;
  font-size: 12px;
}
.data-freshness-badge {
  display: table;
  max-width: 100%;
  margin: 8px 0 12px;
  padding: 6px 10px;
  border: 1px solid #efb5bc;
  border-radius: 6px;
  background: #fff1f3;
  color: #a41427;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}
.integration-page > section {
  margin-bottom: 20px;
}
.integration-page .settings-notice,
.integration-sources article {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 20px;
}
.integration-sources {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.integration-sources h3,
.integration-sources h4 {
  margin: 0 0 8px;
}
.integration-sources h4 {
  margin-top: 16px;
}
.integration-sources ul {
  padding-left: 20px;
}
.integration-sources li,
.settings-source-table td {
  overflow-wrap: anywhere;
}

/* Budget batch editor: bounded page size and stable touch targets. */
.budget-level-editor {
  min-width: 0;
}
.budget-level-editor table {
  width: 100%;
  min-width: 560px;
}
.budget-level-editor th[scope='row'] {
  white-space: normal;
  font-weight: 500;
  max-width: 600px;
}
.budget-level-editor td:first-child {
  width: 48px;
}
.budget-level-editor input[type='checkbox'] {
  width: 20px;
  height: 20px;
}
.budget-level-editor td input[type='number'] {
  width: 100px;
  min-height: 44px;
}
.budget-level-editor .budget-actions {
  align-items: center;
  flex-wrap: wrap;
}
.budget-level-editor [data-impact] {
  font-weight: 600;
  padding: 12px;
  background: #eef3fc;
  border-radius: 10px;
}
.budget-level-editor .matrix-wrap {
  max-height: 520px;
  overflow: auto;
}
.budget-level-editor thead {
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}
.budget-area > button.secondary {
  margin: 8px 16px;
}
.budget-unit > button.secondary,
.budget-department > button.secondary {
  margin: 8px 16px;
}

.budget-batch-filters,
.budget-batch-tools {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.budget-batch-filters > summary,
.budget-batch-tools > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--blue);
}
.budget-level-editor th[scope='row'] strong,
.budget-level-editor th[scope='row'] small {
  display: block;
  text-align: left;
}
.budget-level-editor th[scope='row'] small {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}
.budget-level-editor [data-impact]:empty {
  display: none;
}
@media (max-width: 600px) {
  .budget-level-editor table {
    min-width: 0;
  }
  .budget-level-editor thead {
    display: none;
  }
  .budget-level-editor tbody {
    display: block;
  }
  .budget-level-editor tr {
    display: grid;
    grid-template-columns: 40px 1fr 1fr;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
  }
  .budget-level-editor tr > th {
    grid-column: 2/4;
    padding: 4px !important;
  }
  .budget-level-editor tr > td {
    width: auto !important;
    padding: 4px !important;
    border: 0 !important;
    white-space: normal;
  }
  .budget-level-editor tr > td:first-child {
    grid-row: 1/3;
  }
  .budget-level-editor td[data-label]:before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 6px;
  }
  .budget-level-editor td input[type='number'] {
    width: 100%;
  }
  .budget-level-editor .budget-filters {
    padding: 12px 0;
  }
  .budget-level-editor .budget-actions {
    padding: 10px 0;
  }
  .budget-level-editor h3 {
    font-size: 18px;
  }
}

/* Owner audit: compact disclosure rows, consistent desktop and touch targets. */
.activity-page {
  min-width: 0;
}
.activity-page .access-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.activity-page .access-fields label {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.activity-page input,
.activity-page select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid var(--line, #d8e0eb);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink, #152b49);
}
.activity-list {
  display: grid;
  gap: 8px;
}
.activity-list details {
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line, #d8e0eb);
  border-radius: 12px;
  background: #fff;
}
.activity-list summary {
  padding: 14px;
  cursor: pointer;
  background: #eef3fb;
  overflow-wrap: anywhere;
}
.activity-list summary small {
  display: block;
  margin-top: 5px;
}
.activity-list dl {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 2fr;
  gap: 8px 16px;
  padding: 14px;
  margin: 0;
  overflow-wrap: anywhere;
}
.activity-list dt {
  font-weight: 600;
}
.activity-list dd {
  margin: 0;
}
.activity-page .structure-actions {
  grid-column: 1/-1;
  align-self: end;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.activity-page > button {
  margin-top: 12px;
}
@media (max-width: 600px) {
  .activity-page .access-fields {
    grid-template-columns: 1fr;
  }
  .activity-list dl {
    grid-template-columns: 1fr;
  }
  .activity-list dd {
    margin-bottom: 10px;
  }
  .activity-list summary {
    padding: 12px;
  }
}

/* Keep user editing within reach while the access matrix scrolls horizontally. */
#user-list .user-access-primary {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface, #fff);
  min-width: 100px;
  width: 100px;
  box-shadow: 1px 0 0 var(--line);
  text-align: center;
}
#user-list th.user-access-primary {
  z-index: 3;
}
#user-list .user-access-primary button {
  display: block;
  min-height: 44px;
  width: 100%;
  margin: 0 0 6px;
}
#user-list .user-access-primary input {
  display: block;
  margin: 6px auto;
  min-width: 24px;
  min-height: 24px;
}
#user-list {
  min-height: 0;
}
#user-list table {
  table-layout: fixed;
  min-width: 980px;
}
#user-list th,
#user-list td {
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}
#user-list :is(th, td):nth-child(2) {
  width: 230px;
}
#user-list :is(th, td):nth-child(3) {
  width: 240px;
}
#user-list :is(th, td):nth-child(4) {
  width: 230px;
}
#user-list :is(th, td):nth-child(5) {
  width: 180px;
}
#user-list td:last-child button {
  display: block;
  min-height: 44px;
  width: 100%;
  margin: 0 0 8px;
}

/* Administrative development log: shared controls, compact expandable rows. */
.development-heading,
.development-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.development-heading h2 {
  margin: 0;
}
.development-heading p,
.development-updated {
  color: #526581;
}
.development-heading p {
  margin: 6px 0;
}
.development-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0;
}
.development-summary article {
  min-width: 0;
}
.development-summary strong {
  font-size: 1.6rem;
}
.development-filters {
  display: grid;
  grid-template-columns: 2fr repeat(3, minmax(120px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin: 20px 0;
}
.development-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.development-filters input,
.development-filters select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.development-item {
  border: 1px solid #d9e2ef;
  border-radius: 12px;
  margin: 10px 0;
  background: #fff;
  overflow: hidden;
}
.development-item summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  cursor: pointer;
  background: #f3f6fc;
  list-style: none;
}
.development-item summary:before {
  content: '›';
  color: #00388b;
  font-size: 24px;
  flex: none;
}
.development-item[open] summary:before {
  transform: rotate(90deg);
}
.development-item summary:focus-visible,
.development-scope summary:focus-visible {
  outline: 3px solid #00388b;
  outline-offset: -3px;
}
.development-item-title {
  display: grid;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.development-item-title small {
  color: #526581;
}
.development-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: #526581;
  max-width: 45%;
}
.development-badge {
  border: 1px solid #cbd8ed;
  border-radius: 16px;
  padding: 5px 9px;
  background: #edf3ff;
  color: #00388b;
}
.development-published {
  background: #e6f4ec;
  color: #17613a;
  border-color: #b5ddc5;
}
.development-blocked {
  background: #fff0f1;
  color: #a31a2c;
  border-color: #e9bdc3;
}
.development-detail {
  padding: 4px 20px 18px;
}
.development-detail h3 {
  font-size: 1rem;
  margin: 18px 0 8px;
}
.development-detail li {
  margin: 8px 0;
  line-height: 1.5;
}
.development-evidence {
  border-left: 3px solid #00388b;
  background: #f3f6fc;
  padding: 12px;
  margin-top: 16px;
}
.development-evidence p {
  margin-bottom: 0;
}
.development-scope {
  margin-top: 24px;
  color: #526581;
}
.development-scope summary {
  cursor: pointer;
  padding: 12px 0;
}
@media (max-width: 1000px) {
  .development-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .development-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .development-filters {
    grid-template-columns: 1fr;
  }
  .development-item summary {
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px;
  }
  .development-item-title {
    flex-basis: 80%;
  }
  .development-meta {
    max-width: 100%;
    justify-content: flex-start;
    padding-left: 20px;
  }
  .development-detail {
    padding: 2px 12px 14px;
  }
  .development-summary {
    gap: 8px;
  }
  .development-summary article {
    padding: 12px;
  }
}

/* Headcount: one bounded scroll region, frozen labels and both header rows. */
:is(#unit-panel, #department-panel, #level-panel) .matrix-wrap.live-matrix {
  max-height: 70vh !important;
  max-height: 70dvh !important;
  min-height: 0;
  overflow: auto;
  isolation: isolate;
  scroll-padding-top: 100px;
  overscroll-behavior: contain;
}
:is(#unit-panel, #department-panel, #level-panel) table {
  min-width: 900px;
}
:is(#unit-panel, #department-panel, #level-panel) thead {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #f7f9fc;
}
:is(#unit-panel, #department-panel, #level-panel) .sticky {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
}
:is(#unit-panel, #department-panel, #level-panel) thead .sticky {
  z-index: 7;
  background: #f7f9fc;
  white-space: normal;
  overflow-wrap: anywhere;
}
:is(#unit-panel, #department-panel, #level-panel) .group-row > .sticky {
  background: #edf2fa;
}
:is(#unit-panel, #department-panel, #level-panel) .reconcile-row > .sticky {
  background: #fff7e8;
}
:is(#unit-panel, #department-panel, #level-panel) .hierarchy-parent > .sticky {
  background: #f2f6fd;
}
:is(#unit-panel, #department-panel, #level-panel) .hierarchy-current > .sticky {
  background: #e7effc;
}
@media (max-width: 760px) {
  :is(#unit-panel, #department-panel, #level-panel) .sticky {
    min-width: 180px;
    max-width: 180px;
    width: 180px;
  }
}
@media print {
  :is(#unit-panel, #department-panel, #level-panel) .matrix-wrap.live-matrix {
    max-height: none !important;
    overflow: visible;
  }
  :is(#unit-panel, #department-panel, #level-panel) thead,
  :is(#unit-panel, #department-panel, #level-panel) .sticky {
    position: static;
    box-shadow: none;
  }
}

/* Reversible summary filters share focus and selected feedback. */
button.pj-stat {
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--border, #dbe3f2);
}
button.pj-stat[aria-pressed='true'] {
  border-color: #00388b;
  box-shadow: inset 0 0 0 2px #00388b;
  background: #eef4ff;
}
button.pj-stat:focus-visible {
  outline: 3px solid #00388b;
  outline-offset: 3px;
}

/* Preserve readable access actions inside horizontally scrollable tables. */
.settings-page [data-profile] {
  min-width: 112px;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
.settings-page .access-profile-action {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 140px;
  background: var(--surface, #fff);
  text-align: left;
}
.settings-page th.access-profile-action {
  z-index: 3;
  background: #f5f7fb;
}

/* Authenticated knowledge center and contextual help. */
.sidebar-help a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem;
  border-radius: 10px;
  color: var(--blue, #00388b);
  text-decoration: none;
}
.sidebar-help a.active {
  background: #edf3ff;
}
.context-help {
  margin: 0 0 1rem;
  min-height: 42px;
}
.help-center {
  max-width: 1100px;
  margin-inline: auto;
}
.help-heading h1,
.help-heading h2 {
  margin-bottom: 0.5rem;
}
.help-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
  margin: 1.2rem 0;
}
.help-toolbar label {
  flex: 1 1 260px;
  display: grid;
  gap: 0.4rem;
}
.help-toolbar input {
  width: 100%;
  min-height: 44px;
}
.help-toolbar button,
.help-related button,
.help-topic {
  min-height: 44px;
}
.help-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.help-topic {
  background: #fff;
  border: 1px solid #ccd8eb;
  color: #143e76;
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  text-align: left;
}
.help-topic[aria-pressed='true'] {
  background: #eaf1ff;
  border-color: #00388b;
  box-shadow: inset 0 0 0 1px #00388b;
}
.help-articles {
  display: grid;
  gap: 0.75rem;
}
.help-article {
  border: 1px solid #d5dfed;
  border-radius: 12px;
  overflow: hidden;
}
.help-article summary {
  padding: 1rem;
  cursor: pointer;
  background: #f5f8fd;
  min-height: 64px;
}
.help-article summary span {
  display: inline-flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: calc(100% - 1.5rem);
  vertical-align: middle;
}
.help-article small {
  color: #536985;
  font-size: 0.8rem;
}
.help-article-body {
  padding: 1rem 1.25rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.help-article-body h3 {
  font-size: 1rem;
  margin: 1.2rem 0 0.3rem;
}
.help-article-body ol {
  padding-left: 1.4rem;
}
.help-article-body li + li {
  margin-top: 0.65rem;
}
.help-related {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.help-related h3 {
  flex-basis: 100%;
}
.help-status {
  font-size: 0.9rem;
  color: #536985;
}
.help-dialog {
  width: min(980px, 94vw);
  max-height: 90dvh;
  padding: 1rem;
  overflow: auto;
}
.help-dialog > .secondary {
  display: block;
  margin-left: auto;
  margin-bottom: 0.75rem;
}
.help-dialog .help-center {
  border: 0;
  box-shadow: none;
  padding: 0.5rem;
}
.help-center button:focus-visible,
.help-center summary:focus-visible {
  outline: 3px solid #00388b;
  outline-offset: 3px;
}
@media (max-width: 600px) {
  .help-toolbar {
    align-items: stretch;
  }
  .help-toolbar label {
    flex-basis: 100%;
  }
  .help-toolbar button {
    flex: 1;
  }
  .help-article-body {
    padding: 1rem;
  }
  .help-topic {
    flex: 1 1 130px;
  }
  .help-dialog {
    padding: 0.7rem;
  }
  .help-related button {
    width: 100%;
    text-align: left;
  }
}

.help-center {
  padding: 24px;
  min-width: 0;
}
.help-topic-picker {
  margin: 0 0 1rem;
}
.help-topic-picker > summary {
  cursor: pointer;
  padding: 0.8rem;
  border: 1px solid #d5dfed;
  border-radius: 10px;
  background: #f5f8fd;
  min-height: 44px;
}
.help-topic-picker[open] > .help-topics {
  margin-top: 0.75rem;
}
.help-heading h1 {
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .help-center {
    padding: 16px;
  }
  .help-heading h1 {
    font-size: 1.65rem;
  }
  .help-heading p {
    font-size: 0.95rem;
  }
}

.budget-page .budget-effective-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}
.budget-page .budget-effective-toggle input {
  width: auto;
  min-width: 18px;
  height: 18px;
}
.budget-filters {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.budget-metric {
  display: grid;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: 12px;
  padding: 8px;
}
.budget-metric > strong {
  font-size: 32px;
  color: var(--blue);
}
.budget-metric[aria-pressed='true'] {
  outline: 2px solid var(--blue);
  background: #eef3ff;
}
.budget-metric:focus-visible {
  outline: 3px solid var(--blue);
}

/* Both axes belong to one bounded scroller, including desktop. */
.settings-page .access-matrix {
  max-height: 65vh;
  max-height: 65dvh;
  overflow: auto;
  position: relative;
  isolation: isolate;
}
.settings-page .access-matrix table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
}
.settings-page .access-matrix thead {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f5f7fb;
}
.settings-page .access-matrix thead th {
  background: #f5f7fb;
}
.settings-page .access-matrix :is(.user-access-primary, .access-profile-action) {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
}
.settings-page .access-matrix thead :is(.user-access-primary, .access-profile-action) {
  z-index: 5;
  background: #f5f7fb;
}
.settings-page .access-matrix:focus-visible {
  outline: 3px solid #00388b;
  outline-offset: 2px;
}

/* Serviços: separar campos/foco e preservar o alvo nativo do estado ativo. */
.service-registry-form {
  display: grid;
  gap: 18px;
  margin: 0 0 18px;
  min-width: 0;
}
.service-registry-form > .field {
  min-width: 0;
  gap: 10px;
}
.service-registry-form > .field > input,
.service-registry-form > .field > select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.service-registry-form > .service-registry-active {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  width: fit-content;
  max-width: 100%;
  cursor: pointer;
}
.service-registry-form > .service-registry-active > input[type='checkbox'] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  flex: 0 0 20px;
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
}
.service-registry-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.service-registry-actions > button {
  min-height: 44px;
  max-width: 100%;
  white-space: normal;
}

@media (max-width: 360px) {
  .ri-page .pj-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Headcount page scroll: an inert visual mirror below the app bar. */
.headcount-page-header {
  position: fixed;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
  background: #f7f9fc;
  box-shadow: 0 2px 3px #17365a18;
}
.headcount-page-header table {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  min-width: 0;
  margin: 0;
}
.headcount-page-header :is(thead, tr) { display: contents; position: static; }
.headcount-page-header th {
  display: block;
  position: absolute;
  min-width: 0;
  max-width: none;
  box-sizing: border-box;
}
@media print { .headcount-page-header { display: none; } }
