:root {
  color-scheme: light;
  --background: #f3f7f4;
  --surface: #ffffff;
  --surface-soft: #f8fbf9;
  --text: #17211b;
  --muted: #627067;
  --border: #dce6df;
  --primary: #15803d;
  --primary-dark: #166534;
  --primary-deep: #14532d;
  --primary-soft: #dcfce7;
  --sidebar: #10271a;
  --sidebar-deep: #0b1c12;
  --sidebar-muted: #afc3b5;
  --success: #15803d;
  --danger: #b42318;
  --shadow: 0 12px 32px rgb(16 39 26 / 7%);
  --shadow-small: 0 5px 16px rgb(16 39 26 / 6%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--primary);
}

button,
input,
select,
textarea {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 2px solid var(--primary);
}

.skip-link:focus {
  top: 1rem;
}

.app-shell {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  width: 17rem;
  padding: 1.4rem 1rem 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #ffffff;
  background:
    radial-gradient(circle at 10% 0%, rgb(34 197 94 / 18%), transparent 24rem),
    linear-gradient(175deg, var(--sidebar), var(--sidebar-deep));
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  color: #ffffff;
  text-decoration: none;
}

.sidebar-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sidebar-menu-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  color: #ffffff;
  background: rgb(255 255 255 / 8%);
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 0.6rem;
  cursor: pointer;
  font-weight: 750;
}

.sidebar-menu-toggle svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

.sidebar-brand > span:last-child {
  display: grid;
  min-width: 0;
}

.sidebar-brand strong {
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}

.sidebar-brand small {
  color: var(--sidebar-muted);
  font-size: 0.75rem;
}

.brand-mark {
  display: grid;
  flex: 0 0 2.75rem;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 0.85rem;
  box-shadow: 0 8px 20px rgb(0 0 0 / 16%);
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: -0.06em;
}

.sidebar-nav {
  display: grid;
  gap: 0.25rem;
  margin-top: 2rem;
}

.nav-label {
  margin: 0 0 0.4rem;
  padding: 0 0.75rem;
  color: #7f9c89;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-label-spaced {
  margin-top: 1.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  color: #d9e6dd;
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.nav-item svg,
.sidebar-logout svg {
  flex: 0 0 1.15rem;
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.nav-item:hover {
  color: #ffffff;
  background: rgb(255 255 255 / 7%);
}

.nav-item[aria-current="page"] {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 8px 18px rgb(4 120 54 / 24%);
}

.nav-item > small {
  margin-left: auto;
  color: #799283;
  font-size: 0.64rem;
}

.nav-item-disabled {
  opacity: 0.63;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgb(255 255 255 / 10%);
}

.user-summary {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  margin-bottom: 0.75rem;
}

.user-summary > span:last-child {
  display: grid;
  min-width: 0;
}

.user-summary strong,
.user-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-summary strong {
  font-size: 0.82rem;
}

.user-summary small {
  color: var(--sidebar-muted);
  font-size: 0.7rem;
}

.user-avatar {
  display: grid;
  flex: 0 0 2.25rem;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  color: var(--primary-deep);
  background: #dcfce7;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 850;
}

.sidebar-footer form {
  margin: 0;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.55rem 0.7rem;
  color: var(--sidebar-muted);
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 650;
  text-align: left;
}

.sidebar-logout:hover {
  color: #ffffff;
  background: rgb(255 255 255 / 7%);
}

.workspace {
  grid-column: 2;
  min-width: 0;
}

.workspace-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.8rem;
  padding: 0.9rem clamp(1.25rem, 3vw, 2.5rem);
  background: rgb(255 255 255 / 92%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.workspace-header > div {
  display: grid;
}

.workspace-header strong {
  font-size: 1rem;
}

.workspace-global-search {
  display: flex;
  flex: 1 1 24rem;
  max-width: 34rem;
  min-width: 14rem;
}

.workspace-global-search input {
  min-width: 0;
  width: 100%;
  min-height: 2.7rem;
  padding: 0.55rem 0.8rem;
  background: var(--surface-soft);
  border: 1px solid #b9c9be;
  border-right: 0;
  border-radius: 0.6rem 0 0 0.6rem;
}

.workspace-global-search button {
  min-height: 2.7rem;
  padding: 0.55rem 0.85rem;
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 0 0.6rem 0.6rem 0;
  cursor: pointer;
  font-weight: 750;
}

.workspace-global-search input:focus,
.workspace-global-search button:focus {
  position: relative;
  outline: 3px solid #4ade80;
  outline-offset: 2px;
}

.workspace-kicker {
  color: var(--muted);
  font-size: 0.72rem;
}

.role-chip {
  padding: 0.35rem 0.7rem;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 750;
}

.workspace-content {
  width: min(90rem, 100%);
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.guest-body {
  background:
    radial-gradient(circle at 15% 10%, rgb(34 197 94 / 14%), transparent 30rem),
    var(--background);
}

.guest-shell {
  min-height: 100vh;
}

.guest-header {
  padding: 1.25rem clamp(1rem, 5vw, 3rem);
  background: var(--sidebar);
}

.guest-brand {
  width: fit-content;
}

.guest-content {
  width: min(72rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 0;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-heading {
  max-width: 48rem;
  margin-bottom: 1.5rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.12;
}

h2 {
  margin-bottom: 0.5rem;
}

.page-heading > p:last-child,
.status-card p,
.auth-card p {
  color: var(--muted);
}

.status-card,
.auth-card,
.panel,
.table-panel {
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  box-shadow: var(--shadow);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}

.summary-card {
  display: grid;
  gap: 0.35rem;
  min-height: 7rem;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 0.85rem;
  box-shadow: var(--shadow-small);
}

.summary-card span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.summary-card strong {
  margin-top: auto;
  font-size: 2.15rem;
  line-height: 1;
}

.summary-card small {
  color: var(--muted);
  font-size: 0.78rem;
}

.summary-card[href] {
  color: var(--text);
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.summary-card[href]:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgb(22 59 41 / 10%);
}

.import-template-card {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.import-template-card strong {
  margin-top: 0;
  font-size: 1.25rem;
  line-height: 1.3;
}

.import-model-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.import-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.import-template-card .button {
  margin-top: auto;
}

.import-confirm-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.compact-list {
  margin: 0;
  padding-left: 1.1rem;
}

.compact-list li + li {
  margin-top: 0.3rem;
}

.summary-card-positive {
  border-top-color: #16a66a;
}

.summary-card-warning {
  border-top-color: #e7a928;
}

.dashboard-heading,
.mini-heading,
.status-pill,
.sector-list a,
.status-distribution a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.status-pill {
  justify-content: flex-start;
  width: fit-content;
  padding: 0.5rem 0.75rem;
  color: var(--primary-deep);
  background: var(--primary-soft);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 750;
  white-space: nowrap;
}

.status-pill span {
  width: 0.55rem;
  height: 0.55rem;
  background: #16a66a;
  border-radius: 50%;
}

.filter-panel.dashboard-filters {
  grid-template-columns: minmax(14rem, 2fr) repeat(2, minmax(10rem, 1fr)) auto auto;
}

.dashboard-summary {
  margin-top: 1.5rem;
}

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(18rem, 0.8fr);
  gap: 1.5rem;
  align-items: start;
}

.dashboard-alert-groups,
.dashboard-side-stack,
.sector-list,
.status-distribution {
  display: grid;
  gap: 1rem;
}

.dashboard-alert-groups > article + article {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.mini-heading h2,
.mini-heading h3 {
  margin: 0;
}

.mini-heading a {
  color: var(--primary-deep);
  font-size: 0.83rem;
  font-weight: 750;
  text-decoration: none;
}

.empty-note {
  margin: 0.75rem 0 0;
  padding: 0.85rem;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 0.65rem;
}

.large-total {
  color: var(--primary-deep);
  font-size: 2rem;
}

.sector-list,
.status-distribution {
  margin-top: 1rem;
  gap: 0.5rem;
}

.sector-list a,
.status-distribution a {
  padding: 0.65rem 0.75rem;
  color: var(--text);
  background: var(--surface-soft);
  border-radius: 0.55rem;
  text-decoration: none;
}

.sector-list a:hover,
.status-distribution a:hover {
  background: var(--primary-soft);
}

.financial-summary {
  color: #eefbf4;
  background: linear-gradient(145deg, var(--primary-dark), #0d6944);
  border-color: transparent;
}

.financial-summary .eyebrow,
.financial-summary small {
  color: #bdebd2;
}

.financial-summary > strong {
  display: block;
  margin: 1rem 0 0.35rem;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

.map-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.map-summary span {
  padding: 0.55rem 0.8rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-small);
}

.map-summary strong {
  color: var(--text);
}

.map-data-warning {
  margin-top: 1rem;
}

.operational-map-layout {
  display: grid;
  grid-template-columns: minmax(28rem, 1.8fr) minmax(18rem, 0.9fr);
  gap: 1.5rem;
  align-items: start;
}

.map-panel {
  padding-bottom: 1rem;
}

.map-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
}

.legend-state {
  width: 0.8rem;
  height: 0.65rem;
  background: #c6ead3;
  border: 1px solid #55a877;
  border-radius: 0.16rem;
}

.legend-success,
.map-marker-success {
  fill: #188d58;
  background: #188d58;
}

.legend-warning,
.map-marker-warning {
  fill: #d99516;
  background: #d99516;
}

.legend-progress,
.map-marker-progress {
  fill: #2f7f9f;
  background: #2f7f9f;
}

.legend-neutral,
.map-marker-neutral {
  fill: #77847c;
  background: #77847c;
}

.map-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.35rem;
}

.map-control {
  min-width: 2.5rem;
  min-height: 2.4rem;
  padding: 0.35rem 0.65rem;
  font-size: 1.15rem;
  line-height: 1;
}

.map-reset {
  min-height: 2.4rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
}

.map-zoom-value {
  min-width: 3.1rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.map-density-note {
  margin: 0.7rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.brazil-map-wrap {
  position: relative;
  max-width: 43rem;
  margin: 0 auto;
  overflow: hidden;
  background: radial-gradient(circle at 56% 45%, #fbfefd, #edf7f2);
  border: 1px solid #d6e7dd;
  border-radius: 0.85rem;
}

.brazil-map {
  display: block;
  width: 100%;
  height: auto;
  touch-action: manipulation;
  user-select: none;
}

.map-state {
  fill: #edf4ef;
  stroke: #93ad9c;
  stroke-linejoin: round;
  stroke-width: 0.9;
  cursor: zoom-in;
  transition: fill 120ms ease;
  vector-effect: non-scaling-stroke;
}

.is-detail-view .brazil-map,
.is-detail-view .map-state {
  cursor: grab;
}

.is-dragging .brazil-map,
.is-dragging .map-state {
  cursor: grabbing;
}

.map-state:hover {
  fill: #dcebe1;
}

.map-state-operational {
  fill: #c6ead3;
  stroke: #4b9b6b;
}

.map-state-operational:hover {
  fill: #afe0c1;
}

.map-state-label-line {
  stroke: #627067;
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}

.map-state-label,
.map-capital-label,
.map-location-label {
  paint-order: stroke;
  stroke: var(--surface);
  stroke-linejoin: round;
}

.map-state-label {
  fill: #4b5e52;
  font-size: 9px;
  font-weight: 800;
  pointer-events: none;
  stroke-width: 2.5px;
  text-anchor: middle;
  dominant-baseline: central;
}

.map-capital-dot {
  fill: #385648;
  pointer-events: none;
}

.map-capital-label {
  fill: #52645a;
  font-size: 8.5px;
  font-weight: 650;
  pointer-events: none;
  stroke-width: 2.3px;
}

.map-capital-label-secondary {
  display: none;
}

.is-detail-view .map-capital-label-secondary {
  display: inline;
}

.map-label-collided {
  opacity: 0;
}

.map-marker {
  stroke: var(--surface);
  stroke-width: 4;
  transition: filter 140ms ease, stroke-width 140ms ease;
  vector-effect: non-scaling-stroke;
}

.brazil-map a:hover .map-marker,
.brazil-map a:focus .map-marker {
  filter: brightness(0.88);
  stroke-width: 7;
}

.brazil-map a:focus {
  outline: none;
}

.map-marker-value {
  fill: #fff;
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: central;
}

.map-location-label {
  fill: #294236;
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
  stroke-width: 3.5px;
}

.map-point:hover .map-location-label,
.map-point:focus .map-location-label {
  opacity: 1;
}

.map-point-clustered {
  display: none;
}

.is-detail-view .map-point-clustered {
  display: inline;
}

.is-detail-view .map-cluster {
  display: none;
}

.map-cluster-marker {
  fill: #0f623b;
  stroke: #fff;
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

.map-cluster-value,
.map-cluster-caption {
  fill: #fff;
  font-weight: 800;
  pointer-events: none;
  text-anchor: middle;
}

.map-cluster-value {
  font-size: 13px;
}

.map-cluster-caption {
  font-size: 7px;
}

.map-cluster:hover .map-cluster-marker,
.map-cluster:focus .map-cluster-marker {
  fill: #084c2c;
  stroke-width: 7;
}

.map-point-tooltip {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 120ms ease;
}

.map-point:hover .map-point-tooltip,
.map-point:focus .map-point-tooltip,
.map-cluster:hover .map-point-tooltip,
.map-cluster:focus .map-point-tooltip {
  opacity: 1;
  visibility: visible;
}

.map-point-tooltip rect {
  fill: #073d29;
  filter: drop-shadow(0 5px 9px rgb(7 61 41 / 24%));
  stroke: #bce6cd;
  stroke-width: 1.5;
}

.map-tooltip-title,
.map-tooltip-label,
.map-tooltip-row,
.map-tooltip-more {
  fill: #fff;
  font-family: inherit;
}

.map-tooltip-title {
  font-size: 16px;
  font-weight: 800;
}

.map-tooltip-label,
.map-tooltip-more {
  fill: #bdebd2;
  font-size: 11px;
  font-weight: 700;
}

.map-tooltip-row {
  font-size: 12px;
  font-weight: 650;
}

.map-empty-state {
  position: absolute;
  top: 45%;
  left: 50%;
  display: grid;
  gap: 0.35rem;
  width: min(22rem, 80%);
  padding: 1rem;
  color: var(--muted);
  background: rgb(255 255 255 / 92%);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  text-align: center;
  transform: translate(-50%, -50%);
}

.map-empty-state strong {
  color: var(--text);
}

.map-source {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.map-location-list {
  display: grid;
  gap: 1rem;
}

.map-location-card {
  padding: 1.1rem;
}

.map-location-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.9rem 0;
}

.map-location-counts span {
  display: grid;
  padding: 0.55rem;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 0.5rem;
  font-size: 0.75rem;
}

.map-location-counts strong {
  color: var(--text);
  font-size: 1.15rem;
}

.map-coordinate-note {
  margin: 0.75rem 0 0;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 700;
}

.global-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  padding: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  box-shadow: var(--shadow-small);
}

.global-search-form .field {
  margin: 0;
}

.search-result-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.search-result-heading h2 {
  margin: 0;
  font-size: 1.2rem;
}

.search-type-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.search-type-summary span {
  padding: 0.3rem 0.6rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.76rem;
}

.search-type-summary strong {
  color: var(--text);
}

.global-search-results {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.global-search-result {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.15rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.global-search-result:hover {
  border-color: #8bc8a2;
  box-shadow: 0 8px 22px rgb(16 39 26 / 10%);
}

.search-result-kind {
  justify-self: start;
  padding: 0.28rem 0.58rem;
  color: var(--primary-deep);
  background: var(--primary-soft);
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 800;
}

.search-kind-person,
.search-kind-position {
  color: #075985;
  background: #e0f2fe;
}

.search-kind-md_item {
  color: #854d0e;
  background: #fef3c7;
}

.search-result-copy {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}

.search-result-copy > strong {
  font-size: 1rem;
}

.search-result-copy > span:not(.search-result-meta) {
  color: var(--muted);
}

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.search-result-meta small {
  padding: 0.18rem 0.4rem;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 0.3rem;
}

.search-result-open {
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.search-start-state {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 50rem;
}

.search-start-state h2,
.search-start-state p {
  margin: 0;
}

.search-start-state p {
  margin-top: 0.25rem;
  color: var(--muted);
}

.search-start-icon {
  display: grid;
  flex: 0 0 3.25rem;
  width: 3.25rem;
  height: 3.25rem;
  place-items: center;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 0.85rem;
  font-size: 1.7rem;
}

.compact-list {
  display: grid;
}

.compact-list > a,
.compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.compact-list > a > span:first-child,
.compact-row > span:first-child {
  display: grid;
}

.compact-list small {
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  color: var(--primary-deep);
  background: var(--primary-soft);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.tag-muted {
  color: var(--muted);
  background: #edf1ee;
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.location-card {
  padding: 1rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 0.8rem;
}

.location-card h3 {
  margin: 0 0 0.75rem;
}

.text-button {
  padding: 0.25rem;
  color: var(--primary);
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.text-button-danger {
  color: var(--danger);
}

.status-dot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.status-dot span {
  width: 0.75rem;
  height: 0.75rem;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 0.3rem rgb(15 118 110 / 14%);
}

.auth-card {
  width: min(30rem, 100%);
  margin: 2rem auto;
}

.auth-card-wide {
  width: min(48rem, 100%);
}

.login-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.login-choice p,
.login-password-heading p {
  margin: 0.25rem 0 0;
}

.login-divider {
  position: relative;
  margin: 1.25rem 0;
  color: var(--muted);
  text-align: center;
}

.login-divider::before {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  border-top: 1px solid var(--border);
  content: "";
}

.login-divider span {
  position: relative;
  padding: 0 0.75rem;
  background: var(--surface);
}

.login-password-heading {
  margin-bottom: 1.25rem;
}

.login-choice .button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #a8b8ad;
  border-radius: 0.5rem;
  background: var(--surface);
}

.field input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin-right: 0.5rem;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.button:focus,
a:focus,
.sidebar-logout:focus {
  outline: 3px solid #4ade80;
  outline-offset: 2px;
}

.sidebar-menu-toggle:focus-visible,
.collapsible-toggle:focus-visible {
  outline: 3px solid #4ade80;
  outline-offset: 2px;
}

.help-text,
.form-note {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.help-text ul {
  padding-left: 1.25rem;
}

.errorlist {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: var(--danger);
}

.form-error-summary {
  margin-bottom: 1.25rem;
  padding: 1rem;
  color: var(--danger);
  background: #fef3f2;
  border: 2px solid #f04438;
  border-radius: 0.6rem;
}

.form-error-summary strong {
  display: block;
  margin-bottom: 0.35rem;
}

.form-error-summary ul {
  margin: 0;
  padding-left: 1.25rem;
}

.form-error-summary a {
  color: inherit;
  font-weight: 700;
}

.field-invalid input,
.field-invalid select,
.field-invalid textarea {
  border-color: #d92d20;
  border-width: 2px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.6rem;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
}

.button-primary {
  color: #ffffff;
  background: var(--primary);
}

.button-primary:hover {
  background: var(--primary-dark);
}

.button-secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.button-danger {
  color: #ffffff;
  background: var(--danger);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.account-security-actions {
  align-items: stretch;
  gap: 0.85rem;
}

.account-security-actions form {
  margin: 0;
}

.account-security-actions .button {
  height: 100%;
}

.message {
  padding: 0.85rem 1rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 0.5rem;
}

.message-error {
  color: var(--danger);
  background: #fef3f2;
  border-color: #fecdca;
}

.message-success {
  color: #065f46;
  background: #ecfdf3;
  border-color: #a6f4c5;
}

.heading-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.heading-actions-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.heading-actions-group form {
  margin: 0;
}

.export-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.export-summary-card {
  display: flex;
  flex-direction: column;
  min-height: 15rem;
}

.export-summary-card strong {
  font-size: 1.45rem;
  line-height: 1.15;
}

.export-summary-card p {
  color: var(--muted);
  margin: 0.8rem 0 1.2rem;
}

.export-summary-card form {
  margin-top: auto;
}

.section-heading-padded {
  padding: 1.4rem 1.5rem 0.6rem;
}

.collapsible-ready {
  position: relative;
}

.collapsible-ready > h2 {
  padding-right: 8.5rem;
}

.collapsible-toggle {
  position: absolute;
  top: 1.15rem;
  right: 1.25rem;
  min-height: 2.35rem;
  padding: 0.4rem 0.65rem;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid #bbf7d0;
  border-radius: 0.5rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 750;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.panel {
  padding: 1.5rem;
}

.table-panel {
  padding: 0;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.nowrap {
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.badge-success {
  color: #065f46;
  background: #d1fae5;
}

.badge-muted {
  color: var(--muted);
  background: #e8eef2;
}

.badge-status {
  color: var(--primary-deep);
  background: var(--primary-soft);
}

.badge-risk-1 {
  color: #065f46;
  background: #d1fae5;
}

.badge-risk-2 {
  color: #0369a1;
  background: #e0f2fe;
}

.badge-risk-3 {
  color: #854d0e;
  background: #fef9c3;
}

.badge-risk-4 {
  color: #991b1b;
  background: #fee2e2;
}

.checkbox-group-box {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-item label {
  margin-bottom: 0;
  cursor: pointer;
  font-weight: 500;
}

.subnav,
.contract-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.subnav a,
.contract-tabs a,
.contract-tabs span {
  padding: 0.6rem 0.8rem;
  border-radius: 0.45rem;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.subnav a[aria-current="page"],
.contract-tabs a[aria-current="page"] {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.contract-tabs span {
  opacity: 0.55;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(16rem, 2fr) minmax(10rem, 1fr) auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  box-shadow: var(--shadow-small);
}

.filter-panel-wide {
  grid-template-columns: minmax(13rem, 2fr) repeat(3, minmax(9rem, 1fr)) auto;
}

.filter-panel .field {
  margin: 0;
}

.form-panel {
  max-width: 62rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1.25rem;
}

.form-grid .field:last-of-type,
.form-grid .field:nth-last-of-type(2) {
  grid-column: 1 / -1;
}

.detail-list-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-gap {
  margin-top: 1.5rem;
}

.change-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.change-grid article {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.change-grid span,
.change-grid small {
  color: var(--muted);
}

.action-panel {
  border-color: #86efac;
}

.alert-label {
  display: inline-block;
  color: #854d0e;
  font-size: 0.85rem;
  font-weight: 750;
}

.alert-expired,
.alert-30 {
  color: var(--danger);
}

.message-warning {
  color: #854d0e;
  background: #fffbeb;
  border-color: #fde68a;
}

.personnel-update-toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  width: min(25rem, calc(100vw - 3rem));
  padding: 1.1rem;
  border: 1px solid #e2b84b;
  border-radius: 0.9rem;
  background: #fffaf0;
  box-shadow: 0 1rem 2.5rem rgb(16 39 26 / 18%);
  color: #422f08;
}

.personnel-update-toast-icon {
  display: grid;
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: #e2b84b;
  color: #2b2108;
  font-weight: 800;
}

.personnel-update-toast strong {
  display: block;
}

.personnel-update-toast p {
  margin: 0.35rem 0 0.85rem;
}

.personnel-update-toast .button {
  width: 100%;
}

.detail-list {
  display: grid;
  gap: 0.75rem;
}

.detail-list div {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.detail-list dd {
  margin: 0;
  font-weight: 650;
}

.danger-zone,
.history-panel {
  margin-top: 1.5rem;
}

.timeline {
  display: grid;
  gap: 1rem;
  padding-left: 1.25rem;
}

.timeline li span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.request-feedback {
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid #c69214;
  border-radius: 8px;
  background: #fff9e8;
  color: #35290b;
}

.request-feedback p,
.request-message p {
  margin: 8px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.request-feedback small,
.request-message small {
  color: var(--muted);
}

.request-message {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.request-message:last-child {
  border-bottom: 0;
}

.request-message-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.request-message-outbound {
  padding-left: 14px;
  border-left: 3px solid var(--primary);
}

.request-message-delivery {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.request-message-delivery form {
  margin: 0;
}

.button-compact {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.request-message-form {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.request-message-form textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
}

.request-message-form .button {
  justify-self: start;
}

.qr-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  margin: 1.5rem 0;
}

.qr-panel img {
  max-width: 100%;
  height: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.manual-key {
  display: block;
  padding: 0.75rem;
  overflow-wrap: anywhere;
  background: #f0fdf4;
  border-radius: 0.5rem;
  font-size: 1rem;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.catalog-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: none;
}

.catalog-toolbar {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.catalog-search-field {
  max-width: 32rem;
}

.catalog-sector-filter {
  display: flex;
  gap: 0.4rem;
  padding-bottom: 0.2rem;
  overflow-x: auto;
}

.catalog-sector-button {
  flex: 0 0 auto;
  min-height: 2.4rem;
  padding: 0.45rem 0.8rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  cursor: pointer;
  font-weight: 700;
}

.catalog-sector-button:hover,
.catalog-sector-button[aria-pressed="true"] {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

.catalog-sector-button:focus-visible,
.frequent-access:focus-visible,
.catalog-item a:focus-visible,
.service-action:focus-visible {
  outline: 3px solid #4ade80;
  outline-offset: 2px;
}

.catalog-section + .catalog-section {
  margin-top: 2.5rem;
}

.frequent-access-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.frequent-access {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0 0.75rem;
  align-items: center;
  min-height: 4.5rem;
  padding: 0.75rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-small);
  text-decoration: none;
}

.frequent-access:hover {
  border-color: #9fb3a5;
}

.frequent-access img,
.frequent-access > span {
  grid-row: 1 / 3;
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
}

.frequent-access > span {
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border-radius: 0.4rem;
  font-weight: 850;
}

.frequent-access strong,
.frequent-access small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frequent-access small {
  color: var(--muted);
}

.catalog-results-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.catalog-results-heading h2 {
  margin: 0;
}

#catalog-result-count {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.catalog-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 12rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-small);
}

.catalog-item[hidden] {
  display: none;
}

.catalog-item-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.catalog-logo {
  display: grid;
  width: 3rem;
  height: 3rem;
  padding: 0.35rem;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border-radius: 0.4rem;
  font-weight: 850;
}

.catalog-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.catalog-logo-image {
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.catalog-item h3 {
  margin: 1rem 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
  letter-spacing: 0;
}

.catalog-item .button,
.catalog-unavailable {
  width: 100%;
  margin-top: auto;
  text-align: center;
}

.catalog-unavailable {
  color: var(--muted);
  font-size: 0.8rem;
}

.catalog-filter-empty {
  margin-top: 1rem;
  padding: 1.5rem;
  border: 1px dashed var(--border);
  text-align: center;
}

.external-shell {
  min-height: 100vh;
  background: var(--background);
}

.external-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5rem;
  padding: 0.75rem clamp(1rem, 5vw, 4rem);
  background: var(--sidebar);
  border-bottom: 3px solid var(--primary);
}

.external-header form {
  margin: 0;
}

.external-header .button-secondary {
  color: #ffffff;
  background: transparent;
  border-color: #6f8776;
}

.external-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.external-brand-copy {
  display: grid;
}

.external-brand-copy small {
  color: rgb(255 255 255 / 72%);
  font-size: 0.75rem;
  font-weight: 600;
}

.external-brand img {
  width: 4.5rem;
  height: 2.5rem;
  object-fit: contain;
}

.external-home-intro > .brand-mark {
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

.external-content {
  width: min(72rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 0;
}

.external-home {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(18rem, 0.6fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.external-home-intro > img {
  width: 8rem;
  height: 4.5rem;
  margin-bottom: 1.5rem;
  object-fit: contain;
  object-position: left center;
}

.external-home-intro p:last-child {
  max-width: 40rem;
  color: var(--muted);
}

.external-service-actions {
  display: grid;
  gap: 0.75rem;
}

.service-action {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  min-height: 4.5rem;
  padding: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-small);
  text-decoration: none;
}

.service-action > span {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border-radius: 0.4rem;
  font-size: 1.25rem;
  font-weight: 800;
}

.service-action-primary {
  border-color: #86b998;
}

.service-action-disabled {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.6;
}

@media (max-width: 64rem) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 1rem;
    overflow-y: visible;
    overscroll-behavior: auto;
  }

  .workspace {
    grid-column: auto;
  }

  .sidebar-menu-toggle {
    display: inline-flex;
  }

  .sidebar[data-menu-ready="true"][data-menu-open="false"] .sidebar-nav {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    gap: 0.35rem;
    margin-top: 1rem;
    padding-bottom: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-label,
  .sidebar-footer {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .workspace-header {
    position: static;
  }

  .workspace-global-search {
    max-width: none;
  }

  .dashboard-columns {
    grid-template-columns: 1fr;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .operational-map-layout {
    grid-template-columns: 1fr;
  }

  .map-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .map-controls {
    justify-content: flex-end;
  }

  .filter-panel.dashboard-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .frequent-access-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 42rem) {
  .workspace-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .workspace-global-search {
    flex-basis: 100%;
    order: 3;
    width: 100%;
  }

  .workspace-kicker,
  .role-chip,
  .nav-item > small {
    display: none;
  }

  .heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-heading,
  .catalog-results-heading,
  .external-home {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .catalog-heading,
  .catalog-results-heading {
    flex-direction: column;
  }

  .login-choice {
    align-items: stretch;
    flex-direction: column;
  }

  .import-confirm-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .content-grid,
  .qr-panel,
  .filter-panel,
  .filter-panel-wide,
  .form-grid,
  .detail-list-columns,
  .global-search-form {
    grid-template-columns: 1fr;
  }

  .search-result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-type-summary {
    justify-content: flex-start;
  }

  .global-search-result {
    grid-template-columns: 1fr auto;
  }

  .search-result-kind {
    grid-column: 1 / -1;
  }

  .change-grid {
    grid-template-columns: 1fr;
  }

  .location-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-topline {
    align-items: flex-start;
  }

  .sidebar-menu-toggle span {
    display: none;
  }

  .heading-actions-group,
  .heading-actions-group .button,
  .heading-actions-group form {
    width: 100%;
  }

  .account-security-actions,
  .account-security-actions > *,
  .account-security-actions .button {
    width: 100%;
  }

  .summary-card {
    min-height: 6.25rem;
  }

  .map-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 30rem) {
  .personnel-update-toast {
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    width: auto;
  }

  .summary-grid,
  .export-summary-grid {
    grid-template-columns: 1fr;
  }

  .workspace-content {
    padding: 1rem;
  }

  .frequent-access-list,
  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .external-header {
    align-items: flex-start;
  }

  .external-brand > span:not(.brand-mark) {
    display: none;
  }

  .collapsible-ready > h2 {
    padding-right: 0;
  }

  .collapsible-toggle {
    position: static;
    width: 100%;
    margin-bottom: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
/* Reimbursements */
.request-type-section,
.guidance-document,
.reimbursement-form-panel,
.confirmation-view {
  max-width: 1120px;
}

.request-contract-list {
  display: grid;
  gap: 10px;
}

.request-contract-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.request-contract-item div {
  display: grid;
  gap: 3px;
}

.request-contract-item span {
  color: var(--muted);
}

.guidance-document {
  color: var(--text);
  line-height: 1.65;
}

.guidance-section {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.guidance-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.guidance-section h2,
.guidance-qa h3 {
  margin-top: 0;
}

.guidance-list {
  display: grid;
  gap: 10px;
  padding-left: 24px;
}

.guidance-qa {
  padding: 16px 0;
}

.acknowledgement-panel {
  max-width: 1120px;
  margin-top: 10px;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.reimbursement-sheet {
  overflow: hidden;
  border: 1px solid #b9c8bf;
  border-radius: 6px;
  background: var(--surface);
}

.sheet-header {
  display: grid;
  grid-template-columns: 180px 1fr 230px;
  min-height: 96px;
  border-bottom: 1px solid #b9c8bf;
}

.sheet-logo,
.sheet-title,
.sheet-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.sheet-logo {
  color: var(--primary-deep);
  font-size: 1.15rem;
  font-weight: 800;
}

.sheet-title {
  border-inline: 1px solid #b9c8bf;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
}

.sheet-meta {
  align-items: flex-start;
  flex-direction: column;
  font-size: 0.78rem;
}

.sheet-row {
  display: grid;
  grid-template-columns: 110px 1.2fr 1fr 1.5fr;
  border-bottom: 1px solid #b9c8bf;
}

.sheet-cell,
.sheet-field {
  min-width: 0;
  padding: 14px;
}

.sheet-cell + .sheet-cell {
  border-left: 1px solid #b9c8bf;
}

.sheet-label,
.sheet-section-title {
  font-weight: 800;
}

.sheet-options ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sheet-options label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.sheet-options input[type="radio"] {
  width: auto;
}

.sheet-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sheet-dates > span {
  grid-column: 1 / -1;
  font-weight: 700;
}

.sheet-section-title {
  padding: 10px 14px;
  border-bottom: 1px solid #b9c8bf;
  background: #e8f3ec;
  text-align: center;
}

.sheet-grid {
  display: grid;
  border-bottom: 1px solid #b9c8bf;
}

.sheet-grid-two {
  grid-template-columns: 1fr 1fr;
}

.sheet-field {
  border-right: 1px solid #b9c8bf;
  border-bottom: 1px solid #b9c8bf;
}

.sheet-field:nth-child(2n) {
  border-right: 0;
}

.sheet-field label,
.sheet-cell label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 700;
}

.sheet-field input,
.sheet-field select,
.sheet-field textarea,
.sheet-cell input,
.sheet-cell select {
  width: 100%;
}

.sheet-field-city {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px;
}

.expense-table {
  display: grid;
  grid-template-columns: 140px minmax(150px, 1.3fr) 80px minmax(160px, 1fr) 140px 190px;
  overflow-x: auto;
  border-bottom: 1px solid #b9c8bf;
}

.expense-head,
.expense-cell {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid #b9c8bf;
  border-bottom: 1px solid #b9c8bf;
}

.expense-head {
  background: var(--surface-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.expense-row {
  display: contents;
}

.expense-row-removed {
  display: none;
}

.expense-cell input,
.expense-cell select {
  width: 100%;
}

.expense-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.expense-action input[type="checkbox"] {
  display: none;
}

.expense-action .button {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 0.76rem;
}

.expense-total-label,
.expense-total-value {
  grid-column: span 3;
  padding: 12px;
  font-weight: 800;
}

.expense-total-label {
  text-align: right;
}

.expense-total-value {
  color: var(--primary-deep);
  font-size: 1.05rem;
}

.sheet-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 42px 24px 18px;
}

.sheet-signatures span {
  border-top: 1px solid var(--text);
  padding-top: 6px;
  text-align: center;
}

/* Personnel registration */
.personnel-form-panel {
  max-width: 1120px;
}

.personnel-sheet-header {
  grid-template-columns: 190px 1fr 250px;
}

.personnel-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.personnel-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.personnel-grid .sheet-field {
  border-right: 1px solid #b9c8bf;
}

.personnel-grid .sheet-field:nth-child(2n) {
  border-right: 1px solid #b9c8bf;
}

.personnel-span-2 {
  grid-column: span 2;
}

.personnel-span-3 {
  grid-column: span 3;
}

.personnel-span-4 {
  grid-column: 1 / -1;
}

.personnel-sheet input:not([type="checkbox"]),
.personnel-sheet select,
.personnel-sheet textarea {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #a8b8ad;
  border-radius: 5px;
  background: var(--surface);
}

.personnel-sheet input:disabled {
  color: var(--muted);
  background: var(--surface-soft);
}

.personnel-form-readonly input:disabled,
.personnel-form-readonly select:disabled,
.personnel-form-readonly textarea:disabled {
  color: var(--text);
  background: var(--surface-soft);
  cursor: default;
  opacity: 1;
}

.personnel-access-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-soft);
}

.personnel-access-toggle input {
  width: 18px;
  height: 18px;
}

.personnel-access-toggle label {
  margin: 0;
}

.personnel-responsibility {
  padding: 14px;
  color: var(--primary-deep);
  background: #f0f8f3;
  font-size: 0.9rem;
  font-weight: 700;
}

.personnel-sheet [hidden] {
  display: none;
}

.selected-attachments {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.selected-attachment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.request-filter-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr auto;
  align-items: end;
  gap: 12px;
}

.request-filter-actions {
  margin: 0;
}

.detail-list-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-total {
  color: var(--primary-deep);
  font-size: 1.35rem;
}

.reimbursement-text-block {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.reimbursement-text-block h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.expense-detail-list {
  display: grid;
}

.expense-detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.confirmation-view {
  padding: 48px 0;
}

.confirmation-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-size: 1.5rem;
  font-weight: 800;
}

@media (max-width: 860px) {
  .sheet-header,
  .sheet-row,
  .sheet-grid-two,
  .request-filter-grid {
    grid-template-columns: 1fr;
  }

  .personnel-grid-3,
  .personnel-grid-4 {
    grid-template-columns: 1fr;
  }

  .personnel-span-2,
  .personnel-span-3,
  .personnel-span-4 {
    grid-column: auto;
  }

  .sheet-title,
  .sheet-cell + .sheet-cell,
  .sheet-field {
    border-right: 0;
    border-left: 0;
  }

  .sheet-title {
    border-block: 1px solid #b9c8bf;
  }

  .expense-table {
    display: block;
    overflow: visible;
  }

  .expense-head {
    display: none;
  }

  .expense-row {
    display: grid;
    grid-template-columns: 1fr;
    padding: 12px;
    border-bottom: 1px solid #b9c8bf;
  }

  .expense-cell {
    border: 0;
  }

  .expense-cell::before {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
  }

  .expense-date::before { content: "Data do gasto"; }
  .expense-city::before { content: "Cidade"; }
  .expense-uf::before { content: "UF"; }
  .expense-type::before { content: "Tipo de despesa"; }
  .expense-amount::before { content: "Valor"; }

  .expense-total-label,
  .expense-total-value {
    display: block;
    padding: 10px 14px;
    text-align: left;
  }

  .request-contract-item,
  .expense-detail-list div {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-list-wide {
    grid-template-columns: 1fr;
  }

  .request-table-panel {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .request-table,
  .request-table tbody,
  .request-table tr,
  .request-table td {
    display: block;
    width: 100%;
  }

  .request-table thead {
    display: none;
  }

  .request-table tbody {
    display: grid;
    gap: 12px;
  }

  .request-table tr {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
  }

  .request-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .request-table td:last-child {
    border-bottom: 0;
  }

  .request-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
  }
}
