:root {
  --ink: #17362f;
  --green: #235347;
  --green-2: #347565;
  --cream: #f5f0e7;
  --paper: #fffdf8;
  --rust: #d8843f;
  --line: #d8d6ca;
  --muted: #66736f;
  --danger: #a33d35;
  --shadow: 0 24px 70px rgba(23, 54, 47, 0.12);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

/* F05 — pesagens de escritório e campo */
#weighings.workspace,
#field.workspace,
#sanitary.workspace {
  overflow-x: hidden;
}
.weighing-entry-grid {
  align-items: start;
}
.weighing-row .button-row {
  margin-top: 0.35rem;
}
.warning-text {
  color: #8a4300;
  font-weight: 700;
}
#weighing-selected {
  position: sticky;
  top: 1rem;
}
@media (max-width: 760px) {
  #weighings .filter-bar,
  #weighings .form-row,
  #field .form-row {
    grid-template-columns: minmax(0, 1fr);
  }
  #weighings input,
  #weighings select,
  #weighings textarea,
  #field input,
  #field select,
  #field textarea {
    min-width: 0;
    max-width: 100%;
  }
  #weighing-selected {
    position: static;
  }
}

/* F04 — a navegação interna mantém ações de campo legíveis e tocáveis. */
.animal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.animal-tabs .active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.animal-tabs button {
  min-height: 44px;
}
.animal-module-view {
  margin-bottom: 1rem;
}
.registry-form fieldset,
.compact-form,
details {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin: 0.8rem 0;
}
.registry-form legend {
  font-weight: 700;
  padding: 0 0.35rem;
}
.compact-form {
  display: grid;
  gap: 0.7rem;
}
.decision-item {
  display: grid;
  gap: 0.3rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}
.decision-item:last-child {
  border-bottom: 0;
}
.button-link {
  display: inline-flex;
  width: max-content;
  text-decoration: none;
  margin-top: 0.4rem;
}
textarea {
  width: 100%;
  max-width: 100%;
  resize: vertical;
}
#animal-area > .panel {
  margin-top: 1rem;
}
.history-columns {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.birth-fields > label,
.birth-fields > div {
  display: block;
  margin-bottom: 0.8rem;
}
.birth-fields > div[hidden] {
  display: none;
}
.birth-fields .field-help {
  display: block;
  margin-top: 0.4rem;
}
.registry-form input,
.registry-form select {
  min-width: 0;
  max-width: 100%;
}
@media (max-width: 680px) {
  .animal-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .animal-tabs button {
    width: 100%;
  }
  .filter-bar {
    grid-template-columns: 1fr;
  }
  .registry-form .form-row,
  #animal-area .form-row {
    grid-template-columns: 1fr;
  }
  .search-card #search-form {
    grid-template-columns: 1fr;
  }
  .search-card #search-form button {
    width: 100%;
  }
  #main {
    overflow-x: hidden;
  }
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
  .decision-item {
    overflow-wrap: anywhere;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  background: var(--cream);
}
button,
input,
select {
  font: inherit;
}
.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 20;
  background: #fff;
  padding: 0.7rem 1rem;
  color: var(--ink);
}
.skip-link:focus {
  top: 1rem;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--rust);
  margin: 0 0 0.7rem;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}
h1 {
  font-size: clamp(2.7rem, 5vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
}
h1 em {
  color: var(--rust);
  font-weight: 400;
}
h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  letter-spacing: -0.03em;
  margin-bottom: 0.3rem;
}
h3 {
  font-size: 1rem;
  letter-spacing: 0.02em;
}
.muted,
.microcopy {
  color: var(--muted);
}
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}
.login-story {
  padding: clamp(2rem, 6vw, 7rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(
      circle at 78% 20%,
      rgba(216, 132, 63, 0.2),
      transparent 30%
    ),
    linear-gradient(145deg, #173d34, #275e50);
  color: #fff;
}
.login-story .eyebrow {
  margin-top: 3rem;
}
.login-story h1 {
  max-width: 900px;
}
.lead {
  max-width: 590px;
  font-size: 1.15rem;
  line-height: 1.7;
  color: #dfe9e4;
}
.field-note {
  margin-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 1.3rem;
  color: #c9dbd3;
}
.field-note span {
  color: #e8a66d;
  margin-right: 0.5rem;
}
.brand-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 1.35rem;
}
.login-panel {
  display: grid;
  place-items: center;
  padding: 2rem;
  background: var(--paper);
}
.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 0.8rem;
}
.auth-card h2 {
  font-size: 2.8rem;
}
.auth-card .primary {
  margin-top: 0.5rem;
}
label {
  font-size: 0.8rem;
  font-weight: 750;
}
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.85rem 1rem;
  border-radius: 4px;
  color: var(--ink);
  outline: none;
}
input:focus,
select:focus,
button:focus-visible {
  box-shadow: 0 0 0 3px rgba(216, 132, 63, 0.3);
  border-color: var(--rust);
}
button {
  border: 0;
  cursor: pointer;
  font-weight: 800;
}
.primary {
  background: var(--green);
  color: #fff;
  border-radius: 4px;
  padding: 0.9rem 1.25rem;
  transition:
    0.15s transform,
    0.15s background;
}
.primary:hover {
  background: var(--green-2);
  transform: translateY(-1px);
}
.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.65rem 1rem;
  border-radius: 4px;
}
.text-button {
  background: transparent;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.form-error {
  min-height: 1.2em;
  color: var(--danger);
  font-size: 0.84rem;
  margin: 0;
}
.field-error {
  min-height: 1.2em;
  margin: 0.2rem 0 0;
  color: var(--danger);
  font-size: 0.84rem;
}
.role-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.role-options legend,
.list-tools label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}
.role-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.role-options input {
  width: auto;
}
.resolution-card {
  margin: 0.7rem 0 1rem;
  padding: 1rem;
  border: 1px solid var(--rust);
  border-radius: 12px;
  background: #fff8f0;
}
.resolution-card h3,
.resolution-card p {
  margin: 0 0 0.65rem;
}
.button-row,
.list-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.offline-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.offline-status > div:first-child {
  display: grid;
  gap: 0.35rem;
}
.field-lock {
  max-width: 680px;
  margin-inline: auto;
  display: grid;
  gap: 0.75rem;
}
.offline-help {
  margin-top: 1rem;
  line-height: 1.6;
}
.offline-help summary {
  cursor: pointer;
  font-weight: 800;
}
.weighing-detail {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.weighing-detail h3 {
  margin-top: 0;
}
.weighing-detail dl {
  display: grid;
  grid-template-columns: minmax(9rem, auto) 1fr;
  gap: 0.4rem 1rem;
  margin-bottom: 0;
}
.weighing-detail dt {
  font-weight: 800;
}
.weighing-detail dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.compact-button {
  width: max-content;
  margin-top: 0.4rem;
  padding: 0.45rem 0.7rem;
}
.breadcrumb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
}
.text-button {
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  border: 0;
  background: transparent;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 0.18rem;
}
.phase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.stacked-form {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}
.stacked-form > label:not(.check-line),
.inline-fields label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  font-weight: 700;
}
.stacked-form input,
.stacked-form select,
.stacked-form textarea {
  width: 100%;
  max-width: 100%;
}
.inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  min-width: 0;
}
.check-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
}
.check-line input {
  width: auto;
}
.decision-list,
.session-list,
.help-topic-list {
  display: grid;
  gap: 0.75rem;
}
.decision-card,
.session-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #fff;
  overflow-wrap: anywhere;
}
.decision-card > header,
.session-card,
.sessions-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.decision-card h3,
.decision-card p,
.session-card h3,
.session-card p,
.sessions-heading h2,
.sessions-heading p {
  margin-top: 0;
}
.decision-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.3rem 0.75rem;
  margin: 0.8rem 0;
}
.decision-facts dt {
  font-weight: 700;
}
.decision-facts dd {
  margin: 0;
}
.help-search {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.help-topic-body h3 {
  margin: 0.75rem 0 0.15rem;
  font-size: 0.95rem;
}
.glossary-list {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr);
  gap: 0.55rem 1rem;
}
.glossary-list dt {
  font-weight: 800;
}
.glossary-list dd {
  margin: 0;
}

@media (max-width: 800px) {
  .phase-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .breadcrumb-row,
  .decision-card > header,
  .session-card,
  .sessions-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .inline-fields,
  .glossary-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .decision-facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .decision-facts dd {
    margin-bottom: 0.35rem;
  }
  .decision-card .button-row,
  .session-card .button-row {
    display: grid;
  }
  .decision-card .button-row button,
  .session-card > button,
  .sessions-heading > button {
    width: 100%;
  }
  .offline-status {
    align-items: stretch;
    flex-direction: column;
  }
  .offline-status .button-row,
  .field-lock .button-row {
    display: grid;
  }
  .offline-status button,
  .field-lock button {
    width: 100%;
  }
  #field-search .button-row {
    display: grid;
  }
}

/* F03 — cadastros privados, detalhe progressivo e produtos canônicos */
.partner-role-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.partner-role-nav .nav-active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
.partner-basic-row,
.partner-location-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.3fr);
  gap: 0.75rem;
  grid-column: 1 / -1;
  min-width: 0;
}
.partner-location-row {
  grid-template-columns: minmax(220px, 1fr) minmax(80px, 120px);
}
.partner-detail {
  margin-top: 1.25rem;
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.partner-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.partner-detail-grid > section {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
  background: var(--surface-soft);
}
.stack-form {
  display: grid;
  gap: 0.65rem;
}
.stack-form input,
.stack-form select,
.stack-form textarea,
.stack-form button {
  width: 100%;
  min-width: 0;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.detail-item {
  padding: 0.7rem;
  border-radius: 8px;
  background: var(--surface-soft);
}
.detail-item strong,
.detail-item span {
  display: block;
}
@media (max-width: 960px) {
  .partner-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .section-heading.compact {
    align-items: stretch;
    flex-direction: column;
    gap: 0.75rem;
  }
  .section-heading.compact > button {
    width: 100%;
  }
  .partner-basic-row,
  .partner-location-row,
  .partner-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .partner-role-nav button {
    flex: 1 1 100%;
  }
  .partner-detail {
    padding: 0.8rem;
  }
}
.list-tools {
  justify-content: flex-end;
  margin: 0.5rem 0 0.8rem;
}
.list-tools select {
  width: auto;
  min-width: 12rem;
}
.record-card[data-highlight="true"] {
  box-shadow: 0 0 0 3px rgba(216, 132, 63, 0.35);
}
.model-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.25rem;
}
.model-viewer {
  width: min(1100px, calc(100vw - 2rem));
  height: min(900px, calc(100vh - 2rem));
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
}
.model-viewer::backdrop {
  background: rgba(12, 30, 26, 0.68);
}
.model-viewer-bar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}
.model-viewer-bar h2 {
  margin: 0;
}
.model-viewer iframe {
  display: block;
  width: 100%;
  height: calc(100% - 11rem);
  min-height: 320px;
  margin: 0.8rem 0;
  border: 1px solid var(--line);
  background: #fff;
}
.app-shell {
  min-height: 100vh;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns:
    auto minmax(170px, 0.55fr) minmax(360px, 1.25fr) minmax(190px, 280px)
    auto;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem clamp(0.8rem, 2vw, 1.5rem);
  background: rgba(255, 253, 248, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink);
  text-decoration: none;
  width: max-content;
}
.brand-mark.small {
  width: 42px;
  height: 42px;
  border-color: var(--green);
  color: var(--green);
  font-size: 1rem;
}
.brand strong,
.brand small {
  display: block;
}
.brand small {
  color: var(--muted);
  font-size: 0.7rem;
  margin-top: 0.12rem;
}
.work-context {
  min-width: 0;
  display: grid;
  grid-column: span 2;
  grid-template-columns: minmax(150px, 0.9fr) minmax(180px, 1.1fr);
  gap: 0.15rem 0.65rem;
}
.context-field {
  min-width: 0;
}
.work-context label,
.work-context small {
  display: block;
}
.work-context input {
  width: 100%;
  min-width: 0;
  padding: 0.55rem 0.7rem;
}
.work-context small {
  color: var(--muted);
  font-size: 0.67rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.context-change-dialog {
  width: min(480px, calc(100vw - 2rem));
  border: 0;
  border-radius: 16px;
  padding: 1.25rem;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.context-change-dialog::backdrop {
  background: rgba(20, 31, 25, 0.58);
}
.topbar > #logout {
  justify-self: end;
}
.menu-button {
  display: none;
  white-space: nowrap;
}
.app-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
}
.content-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.side-navigation {
  position: sticky;
  top: 68px;
  align-self: start;
  height: calc(100vh - 68px);
  overflow-y: auto;
  padding: 0.85rem;
  background: var(--paper);
  border-right: 1px solid var(--line);
}
.side-navigation-bar {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.35rem 0.65rem;
  border-bottom: 1px solid var(--line);
}
.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
}
.control-icon,
.navigation-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}
.control-icon svg,
.navigation-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  overflow: visible;
}
.mobile-only {
  display: none;
}
#navigation-items {
  display: grid;
  gap: 0.25rem;
  padding-top: 0.65rem;
}
.navigation-link {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  min-height: 42px;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
}
.navigation-link:hover {
  background: #f0ece3;
}
.navigation-link[aria-current="page"] {
  color: #fff;
  background: var(--green);
}
.navigation-icon {
  width: 1.7rem;
  height: 1.7rem;
}
.navigation-group {
  border-top: 1px solid var(--line);
  padding-top: 0.25rem;
}
.navigation-group summary {
  cursor: pointer;
  padding: 0.7rem 0.65rem;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.breadcrumb {
  min-height: 42px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.55rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 240, 231, 0.92);
  color: var(--muted);
  font-size: 0.78rem;
}
.breadcrumb a {
  color: var(--green);
  font-weight: 750;
}
.breadcrumb [aria-current="page"] {
  color: var(--ink);
}
.breadcrumb-separator {
  color: #a7aaa5;
}
.function-search {
  position: relative;
  min-width: 0;
}
.update-available {
  white-space: nowrap;
}
.function-search input {
  padding: 0.6rem 0.75rem;
}
.function-results {
  position: absolute;
  z-index: 25;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  max-height: min(420px, 65vh);
  overflow-y: auto;
  padding: 0.35rem;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.function-results a {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem;
  color: var(--ink);
  text-decoration: none;
}
.function-results a:hover,
.function-results a:focus {
  background: #f0ece3;
}
.function-results small {
  color: var(--muted);
}
.home-section {
  box-shadow: none;
}
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
}
.shortcut-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 0.35rem;
  min-height: 92px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
}
.shortcut-card .shortcut-icon {
  grid-row: 1 / span 2;
  color: var(--green);
}
.shortcut-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}
.shortcut-card:hover,
.shortcut-card:focus {
  border-color: var(--green);
}
.shortcut-card span {
  color: var(--muted);
  font-size: 0.78rem;
}
.help-content details {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.help-content summary {
  cursor: pointer;
  font-weight: 800;
}
.help-content details p {
  margin: 0.7rem 0 0;
  max-width: 780px;
  line-height: 1.6;
  color: var(--muted);
}
.navigation-collapsed .app-layout {
  grid-template-columns: 72px minmax(0, 1fr);
}
.navigation-collapsed .side-navigation {
  padding-inline: 0.45rem;
}
.navigation-collapsed .side-navigation-bar strong,
.navigation-collapsed .navigation-label,
.navigation-collapsed .navigation-group summary {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.navigation-collapsed .side-navigation-bar {
  justify-content: center;
}
.navigation-collapsed .navigation-link {
  grid-template-columns: 1fr;
  padding-inline: 0.4rem;
}
.navigation-collapsed .navigation-group {
  border: 0;
  padding: 0;
}
.navigation-collapsed .navigation-icon {
  margin: auto;
}
.workspace {
  width: min(1260px, calc(100% - 2rem));
  margin: auto;
  padding: clamp(2rem, 6vw, 5.5rem) 0;
}
.navigation-backdrop {
  display: none;
}
@media (max-width: 1100px) and (min-width: 801px) {
  .app-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .detail-grid > *,
  .weight-input,
  .weight-input input {
    min-width: 0;
  }
  .topbar {
    grid-template-columns:
      minmax(150px, 0.45fr) minmax(340px, 1fr) minmax(180px, 240px)
      auto;
  }
  .topbar .menu-button {
    display: none;
  }
  .work-context {
    grid-column: auto;
  }
}
@media (max-width: 800px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0.55rem 0.75rem;
  }
  .menu-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }
  .brand small,
  .brand-mark.small {
    display: none;
  }
  .work-context,
  .function-search {
    grid-column: 1 / -1;
  }
  .function-search {
    grid-row: 3;
  }
  .app-layout,
  .navigation-collapsed .app-layout {
    display: block;
  }
  .side-navigation {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    width: min(310px, calc(100vw - 3rem));
    height: 100vh;
    padding: 0.85rem;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }
  .navigation-open .side-navigation {
    transform: translateX(0);
  }
  .navigation-collapsed .side-navigation-bar strong,
  .navigation-collapsed .navigation-label,
  .navigation-collapsed .navigation-group summary {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }
  .navigation-collapsed .navigation-link,
  .navigation-link {
    grid-template-columns: 1.75rem minmax(0, 1fr);
  }
  #collapse-menu {
    display: none;
  }
  .mobile-only {
    display: grid;
  }
  .navigation-backdrop {
    position: fixed;
    z-index: 35;
    inset: 0;
    display: block;
    background: rgba(12, 30, 26, 0.58);
  }
  .breadcrumb {
    padding-inline: 1rem;
  }
}
.hero-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: end;
  margin-bottom: 3rem;
}
.hero-row h1 {
  font-size: clamp(3rem, 7vw, 6.6rem);
  margin: 0;
}
.hero-row > p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
  padding-bottom: 0.5rem;
}
.search-card,
.panel,
.timeline-section {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.search-card {
  padding: clamp(1.3rem, 4vw, 2.6rem);
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem 3rem;
}
.search-card > div:first-child,
.section-heading > div {
  display: flex;
  gap: 1rem;
}
.search-card h2 {
  font-size: 2rem;
}
.search-card p {
  color: var(--muted);
  margin-bottom: 0;
}
.step {
  font-family: Georgia, serif;
  color: var(--rust);
  border-top: 2px solid var(--rust);
  padding-top: 0.25rem;
  min-width: 2.2rem;
}
.search-card form {
  display: flex;
  gap: 0.6rem;
  align-self: center;
}
.search-card input {
  font-size: 1.1rem;
}
.inline-status,
.result-list {
  grid-column: 1/-1;
}
.inline-status {
  font-size: 0.86rem;
  color: var(--muted);
}
.result-list {
  display: grid;
  gap: 0.65rem;
}
.result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  padding: 1rem;
  color: var(--ink);
  border-radius: 4px;
}
.result:hover {
  border-color: var(--green);
}
.result strong,
.result small {
  display: block;
}
.result small {
  color: var(--muted);
  margin-top: 0.25rem;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4rem 0 1rem;
}
.section-heading h2 {
  margin: 0;
}
.detail-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1rem;
}
.panel {
  padding: 2rem;
}
.identity-panel dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.7rem 1rem;
  margin-top: 1.5rem;
}
.identity-panel dt {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.identity-panel dd {
  margin: 0;
  font-family: ui-monospace, monospace;
  overflow-wrap: anywhere;
}
.weight-panel {
  background: var(--green);
  color: #fff;
}
.weight-panel label,
.weight-panel .microcopy {
  color: #dfe9e4;
}
.weight-panel select,
.weight-panel input {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.weight-panel select option {
  color: var(--ink);
}
.weight-panel .primary {
  background: var(--rust);
  color: #271b10;
  width: 100%;
}
.weight-input {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.3rem 0 1rem;
}
.weight-input input {
  font-family: Georgia, serif;
  font-size: 2.5rem;
}
@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .weight-input input {
    min-width: 0;
    width: 100%;
    font-size: 2rem;
  }
  .weighing-detail dl {
    grid-template-columns: 1fr;
  }
  .weighing-detail dd {
    margin-bottom: 0.35rem;
  }
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.microcopy {
  font-size: 0.75rem;
  line-height: 1.5;
  margin: 0.8rem 0 0;
}
.timeline-section {
  padding: 2rem;
  margin-top: 1rem;
}
.section-heading.compact {
  margin: 0 0 1.5rem;
}
.history-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}
.timeline {
  display: grid;
  gap: 0.75rem;
}
.timeline-item {
  border-left: 3px solid var(--rust);
  padding: 0.4rem 0 0.4rem 1rem;
}
.timeline-item strong,
.timeline-item span {
  display: block;
}
.timeline-item span {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.25rem;
}
.empty {
  color: var(--muted);
  font-style: italic;
}
.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem clamp(1rem, 4vw, 4.5rem);
  background: var(--ink);
  color: #c9dbd3;
  font-size: 0.75rem;
}
.update-notice {
  position: fixed;
  z-index: 20;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 8px 30px #0003;
  border: 1px solid var(--line);
}
.update-notice[hidden] {
  display: none;
}
@media (max-width: 640px) {
  .update-notice {
    left: 1rem;
    flex-direction: column;
    align-items: stretch;
  }
}
.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  background: var(--ink);
  color: #fff;
  padding: 1rem 1.3rem;
  border-radius: 4px;
  box-shadow: var(--shadow);
  transform: translateY(150%);
  transition: 0.2s transform;
}
.toast.show {
  transform: translateY(0);
}
.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;
}
[hidden] {
  display: none !important;
}
@media (max-width: 800px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-story {
    min-height: 45vh;
    padding: 2rem;
  }
  .login-story .eyebrow {
    margin-top: 2rem;
  }
  .login-story h1 {
    font-size: 3rem;
  }
  .field-note {
    margin-top: 1rem;
  }
  .login-panel {
    padding: 3rem 1.2rem;
  }
  .topbar {
    grid-template-columns: 1fr auto;
  }
  .work-context {
    grid-column: 1/-1;
    grid-row: 2;
  }
  .hero-row,
  .detail-grid,
  .history-columns {
    grid-template-columns: 1fr;
  }
  .hero-row {
    gap: 1rem;
  }
  .search-card {
    grid-template-columns: 1fr;
  }
  .search-card form {
    flex-direction: column;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .app-footer {
    flex-direction: column;
  }
  .workspace {
    padding-top: 2.5rem;
  }
  .section-heading {
    margin-top: 2.5rem;
  }
}
@media (max-width: 560px) {
  .work-context {
    grid-template-columns: 1fr;
  }
  .work-context small {
    white-space: normal;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.module-nav,
.subnav {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.65rem clamp(1rem, 4vw, 4.5rem);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.module-nav button,
.subnav button {
  white-space: nowrap;
  background: transparent;
  color: var(--muted);
  padding: 0.65rem 0.85rem;
  border-bottom: 2px solid transparent;
}
.module-nav .nav-active,
.subnav .nav-active {
  color: var(--green);
  border-color: var(--rust);
}
.subnav {
  padding: 0 0 1rem;
  margin-bottom: 1rem;
  background: transparent;
}
.cad-panel {
  box-shadow: none;
}
.compact-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
  margin: 1.2rem 0;
  max-width: 100%;
}
.compact-form > label {
  display: grid;
  min-width: 0;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}
.compact-form > label input,
.compact-form > label select {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 400;
}
.compact-form .field-wide {
  grid-column: 1 / -1;
}
.form-field {
  display: grid;
  min-width: 0;
  gap: 0.4rem;
}
.form-field > span:first-child {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}
.partner-name-field,
.partner-name-field input {
  width: 100%;
  min-width: 0;
}
.partner-document-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(220px, 1fr) auto;
  align-items: start;
  gap: 0.65rem;
  min-width: 0;
}
.partner-submit {
  align-self: start;
  margin-top: 1.42rem;
  white-space: nowrap;
}
.card-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  gap: 0.65rem;
  margin-top: 1rem;
}
.listing-controls {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, auto) auto auto;
  align-items: end;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.listing-controls label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.listing-controls input,
.listing-controls select {
  min-width: 0;
  width: 100%;
}
.listing-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.listing-table th,
.listing-table td {
  padding: 0.75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.listing-table th {
  background: var(--paper);
  font-size: 0.82rem;
}
.sort-heading {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.listing-table .button-row {
  min-width: 155px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}
.pagination span {
  color: var(--muted);
}
.record-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.3rem 1rem;
  border: 1px solid var(--line);
  background: #fff;
  padding: 1rem;
}
.record-card strong {
  grid-column: 1;
}
.record-card span {
  grid-column: 1;
  font-size: 0.82rem;
}
.record-card button {
  grid-column: 2;
  grid-row: 1/3;
}
.notice {
  border-left: 4px solid var(--rust);
  background: #fff5e9;
  padding: 1rem;
  color: #6c4a2d;
  margin: 1rem 0;
}
.security-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 1.25rem;
}
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.profile-section {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
  box-shadow: none;
}
.profile-section header {
  margin-bottom: 0.35rem;
}
.profile-section header h2,
.profile-section header p {
  margin: 0;
}
.profile-section header p {
  margin-top: 0.45rem;
}
.profile-section input,
.profile-section select {
  min-height: 48px;
}
.profile-section .field-error:empty {
  min-height: 0;
}
.readonly-field {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.35rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7f4ed;
}
.readonly-field span,
.readonly-field small,
.profile-fixed-preferences dt {
  color: var(--muted);
}
.readonly-field span,
.profile-fixed-preferences dt {
  font-size: 0.8rem;
  font-weight: 800;
}
.profile-fixed-preferences {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.4rem 0;
}
.profile-fixed-preferences div {
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7f4ed;
}
.profile-fixed-preferences dd {
  margin: 0.25rem 0 0;
  overflow-wrap: anywhere;
}
.profile-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}
.profile-actions #profile-status {
  flex-basis: 100%;
  min-height: 1.2rem;
  margin: 0;
}
.users-panel {
  display: grid;
  gap: 1rem;
  min-width: 0;
  box-shadow: none;
}
.listing-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
.users-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}
.users-heading h2,
.users-heading p,
.invitation-card h1,
.invitation-card p {
  margin-top: 0;
}
.users-table td:last-child .button-row {
  flex-wrap: wrap;
}
.user-status {
  display: inline-flex;
  width: max-content;
  min-height: 1.75rem;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  background: #f1eee7;
  font-size: 0.78rem;
  font-weight: 800;
}
.user-status.active {
  color: #275c47;
  border-color: #9ab9a8;
  background: #e9f4ed;
}
.user-status.warning {
  color: #6c4a2d;
  border-color: #d7b681;
  background: #fff5e9;
}
.user-status.ended {
  color: #6d3d3d;
  border-color: #d4aaaa;
  background: #fff0ef;
}
.invitation-card {
  width: min(100%, 580px);
}
.invitation-details,
.invitation-details dl {
  display: grid;
  gap: 0.9rem;
}
.invitation-details dl {
  margin: 0;
}
.invitation-details dl div {
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.invitation-details dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}
.invitation-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.section-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}
.text-link {
  color: var(--green);
  font-weight: 800;
  text-underline-offset: 4px;
}
.security-section {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
  box-shadow: none;
}
.security-section-heading h2,
.security-section-heading p,
.security-state p,
.security-form h3,
.security-form p {
  margin: 0;
}
.security-section-heading h2 {
  font-size: clamp(1.65rem, 2.5vw, 2.35rem);
}
.security-section-heading p,
.security-form > p {
  margin-top: 0.45rem;
  color: var(--muted);
  line-height: 1.5;
}
.security-form,
.security-state {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
}
.security-form {
  width: min(100%, 520px);
}
.security-form .primary {
  margin-top: 0.35rem;
}
.security-actions {
  display: grid;
  gap: 0.65rem;
}
.status-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
}
.status-badge {
  width: max-content;
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}
.status-badge.success {
  color: #275c47;
  background: #e9f4ed;
  border-color: #9ab9a8;
}
.status-badge.neutral {
  color: var(--muted);
  background: #f1eee7;
}
#mfa-proof-code-row {
  display: grid;
  gap: 0.8rem;
}
#mfa-proof-code-row[hidden] {
  display: none;
}
.mfa-provision {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  grid-template-areas:
    "qr copy"
    "qr manual"
    "confirm confirm";
  align-items: start;
  gap: 1rem 1.5rem;
}
.mfa-provision-copy {
  grid-area: copy;
}
.mfa-provision-copy h3,
.mfa-provision-copy p,
.mfa-manual p {
  margin-top: 0;
}
.mfa-provision img {
  grid-area: qr;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #fff;
}
.mfa-manual {
  grid-area: manual;
}
.mfa-manual-details {
  margin-top: 0.75rem;
}
.mfa-provision code {
  display: block;
  padding: 0.65rem;
  border: 1px solid var(--line);
  background: #fff;
  overflow-wrap: anywhere;
}
.mfa-provision .security-form {
  grid-area: confirm;
}
.recovery-codes {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 1rem;
}
.recovery-codes ol {
  columns: 2;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.page-heading h1 {
  font-size: clamp(2.3rem, 4vw, 3.8rem);
  margin: 0;
}
.page-heading > p {
  max-width: 520px;
  color: var(--muted);
  margin: 0;
}
#main.workspace,
#cadastros.workspace,
#admin.workspace,
#properties.workspace,
#inventory.workspace {
  padding-top: 2.25rem;
}

/* F06 — compras, saldos derivados e movimentações operacionais */
.inventory-subnav {
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 0.35rem;
}
.inventory-subnav button {
  flex: 0 0 auto;
}
.inventory-panel {
  min-width: 0;
}
.inventory-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
  align-items: start;
}
.phase6-form {
  display: grid;
  gap: 0.75rem;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  background: var(--paper);
  min-width: 0;
}
.phase6-form h3 {
  margin: 0 0 0.15rem;
}
.phase6-form label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  font-weight: 700;
}
.phase6-form input,
.phase6-form select,
.phase6-form textarea {
  width: 100%;
  min-width: 0;
}
.phase6-form textarea {
  min-height: 5.5rem;
  resize: vertical;
}
.phase6-form .wide {
  grid-column: 1/-1;
}
.phase6-wide-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.phase6-wide-form h3,
.phase6-wide-form > p,
.phase6-wide-form > button {
  grid-column: 1/-1;
}
.inventory-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.inventory-columns > section {
  min-width: 0;
}
.phase6-list {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}
.phase6-record {
  display: grid;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--paper);
  min-width: 0;
  overflow-wrap: anywhere;
}
.phase6-record strong {
  color: var(--green);
}
.phase6-record .button-row {
  margin-top: 0.35rem;
}
.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.metric-row > article {
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.85rem;
  background: var(--paper);
}
.metric-row strong {
  display: block;
  font-size: 1.35rem;
}
@media (max-width: 1050px) {
  .inventory-form-grid,
  .inventory-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .phase6-wide-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .inventory-form-grid,
  .inventory-columns,
  .phase6-wide-form,
  .metric-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .phase6-form .wide {
    grid-column: auto;
  }
  #inventory.workspace {
    overflow-x: hidden;
  }
}

.property-subnav {
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 0.35rem;
}
.property-subnav button {
  flex: 0 0 auto;
}
.property-panel {
  min-width: 0;
}
.phase2-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.4rem;
  align-items: end;
}
.phase2-form label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  font-weight: 700;
}
.phase2-form .wide {
  grid-column: 1 / -1;
}
.phase2-form input,
.phase2-form select,
.phase2-form textarea {
  width: 100%;
  min-width: 0;
}
.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.split-grid > form {
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  align-content: start;
}
.phase2-list {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}
.phase2-list-tools {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto auto;
  gap: 0.75rem;
  align-items: end;
}
.phase2-list-tools label {
  display: grid;
  gap: 0.3rem;
  font-weight: 700;
}
.phase2-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.9rem 1rem;
  background: var(--paper);
}
.phase2-record > p {
  grid-column: 1 / -1;
  margin: 0;
}
.record-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.record-badge {
  border-radius: 999px;
  background: var(--cream);
  padding: 0.2rem 0.55rem;
  font-size: 0.82rem;
}
.operational-map {
  min-height: 10rem;
  border: 1px dashed var(--line);
  border-radius: 1rem;
  margin: 1rem 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--green) 5%, white),
    white
  );
}
.operational-map svg {
  width: 100%;
  min-height: 10rem;
}

@media (max-width: 900px) {
  .phase2-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .split-grid {
    grid-template-columns: 1fr;
  }
  .listing-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .listing-controls label:first-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 620px) {
  .phase2-form,
  .phase2-list-tools {
    grid-template-columns: minmax(0, 1fr);
  }
  .phase2-form .wide {
    grid-column: auto;
  }
  .phase2-record {
    grid-template-columns: minmax(0, 1fr);
  }
  .phase2-record > p {
    grid-column: auto;
  }
  .property-subnav {
    margin-inline: -0.25rem;
    padding-inline: 0.25rem;
  }
}
#main .search-card {
  box-shadow: none;
}
.action-dialog {
  width: min(760px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border: 0;
  border-radius: 16px;
  padding: 0;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.action-dialog::backdrop {
  background: rgba(20, 31, 25, 0.58);
}
.dialog-card {
  padding: clamp(1rem, 3vw, 1.75rem);
}
.access-wizard {
  display: grid;
  gap: 1rem;
  width: 100%;
  min-width: 0;
}
.access-wizard > h2,
.access-wizard > p {
  margin: 0;
}
.access-wizard fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  padding: 1rem;
}
.access-wizard legend {
  font-weight: 900;
  padding: 0 0.35rem;
}
.access-wizard input,
.access-wizard textarea {
  width: 100%;
  min-width: 0;
}
.wizard-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wizard-progress li {
  padding: 0.55rem;
  border-bottom: 3px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}
.wizard-progress li.current {
  color: var(--green);
  border-color: var(--green);
}
.choice-list,
.property-access-list {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}
.autocomplete-list {
  max-height: 14rem;
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--paper);
}
.autocomplete-list button {
  width: 100%;
  min-height: 44px;
  text-align: left;
  overflow-wrap: anywhere;
}
.permission-groups {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
  min-width: 0;
}
.permission-group {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--paper);
}
.permission-group > summary {
  cursor: pointer;
  padding: 0.8rem 1rem;
  font-weight: 900;
}
.permission-group > .choice-list {
  padding: 0 1rem 1rem;
}
.permission-group[hidden],
.access-choice[hidden] {
  display: none;
}
.access-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  padding: 0.75rem;
  border: 1px solid var(--line);
  background: #fff;
}
.access-choice input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
}
.access-choice span,
.access-choice small {
  display: block;
  min-width: 0;
}
.access-choice small {
  margin-top: 0.25rem;
  color: var(--muted);
  line-height: 1.35;
}
.access-choice:has(input:disabled) {
  opacity: 0.62;
  background: var(--paper);
}
.information-choice-list {
  display: grid;
  gap: 0.6rem;
}
.access-information {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, auto);
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line);
  background: #fff;
}
.access-information span,
.access-information small {
  display: block;
  min-width: 0;
}
.access-information small {
  margin-top: 0.25rem;
  color: var(--muted);
  line-height: 1.35;
}
.access-information select {
  width: 100%;
  min-width: 0;
}
.property-access-card h4 {
  margin: 1rem 0 0.55rem;
}
.access-page-summary {
  margin: 0.35rem 0 0;
}
.property-access-card {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 1rem;
  min-width: 0;
}
.property-access-card h3,
.property-access-card p {
  margin-top: 0;
}
.access-review {
  padding: 0.85rem;
  border-left: 4px solid var(--green);
  background: #eef5f1;
  overflow-wrap: anywhere;
}
.profile-card-list {
  display: grid;
  gap: 0.75rem;
}
.profile-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: #fff;
}
.profile-card h3,
.profile-card p {
  margin: 0;
}
.profile-card .eyebrow {
  margin-bottom: 0.3rem;
}
.profile-card-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  grid-column: 1;
}
.profile-card-meta span {
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
}
.profile-card > .button-row {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
}
@media (max-width: 800px) {
  .topbar,
  .app-layout,
  .content-column,
  .workspace,
  .users-panel {
    min-width: 0;
    max-width: 100%;
  }
  .security-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .profile-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .page-heading {
    display: block;
  }
  .page-heading > p {
    margin-top: 0.6rem;
  }
  .profile-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .profile-card > .button-row {
    grid-column: 1;
    grid-row: auto;
  }
}
@media (max-width: 640px) {
  .users-heading {
    display: grid;
  }
  .users-heading button {
    width: 100%;
  }
  .wizard-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .action-dialog {
    width: 100vw;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
  }
  .access-wizard .button-row {
    display: grid;
  }
  .access-wizard .button-row button {
    width: 100%;
  }
  .access-information {
    grid-template-columns: minmax(0, 1fr);
  }
  .profile-fixed-preferences {
    grid-template-columns: minmax(0, 1fr);
  }
  .profile-actions {
    display: grid;
  }
  .profile-actions button {
    width: 100%;
  }
  .mfa-provision {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "copy"
      "qr"
      "manual"
      "confirm";
  }
  .mfa-provision img {
    grid-row: auto;
    justify-self: center;
  }
  .recovery-codes ol {
    columns: 1;
  }
  .security-section .button-row,
  .security-actions {
    display: grid;
  }
  .security-section .button-row button,
  .security-actions button {
    width: 100%;
  }
  .listing-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .listing-controls label:first-child {
    grid-column: 1 / -1;
  }
  .listing-table,
  .listing-table tbody,
  .listing-table tr,
  .listing-table td {
    display: block;
    width: 100%;
  }
  .listing-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .listing-table tr {
    margin-bottom: 0.75rem;
    border: 1px solid var(--line);
    background: #fff;
  }
  .listing-table td {
    display: grid;
    grid-template-columns: minmax(90px, 34%) minmax(0, 1fr);
    gap: 0.5rem;
    border: 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
  }
  .listing-table td:last-child {
    border-bottom: 0;
  }
  .listing-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--ink);
  }
  .listing-table .button-row {
    min-width: 0;
  }
  .users-table .compact-button {
    width: 100%;
    white-space: normal;
  }
  .pagination {
    justify-content: space-between;
  }
  .pagination span {
    order: -1;
    width: 100%;
    text-align: center;
  }
  #model-list .record-card {
    grid-template-columns: minmax(0, 1fr);
  }
  #model-list .record-card strong,
  #model-list .record-card span,
  #model-list .model-actions {
    grid-column: 1;
  }
  #model-list .model-actions {
    width: 100%;
  }
  #model-list .model-actions button {
    grid-column: auto;
    grid-row: auto;
    flex: 1 1 100%;
    width: 100%;
  }
  .partner-document-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .partner-submit {
    width: 100%;
    margin-top: 0;
  }
  .role-options label {
    max-width: 100%;
  }
  .model-viewer {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }
  .model-viewer iframe {
    height: calc(100% - 13.5rem);
    min-height: 240px;
  }
}

/* UX-HEADER-001 — contexto identificável com uso compacto da área útil. */
.topbar {
  grid-template-columns:
    minmax(160px, 210px) minmax(230px, 360px)
    auto auto auto;
  min-height: 64px;
  gap: 0.5rem;
  padding: 0.4rem clamp(0.75rem, 2vw, 1.25rem);
}
.brand {
  gap: 0.55rem;
  min-width: 0;
}
.brand-mark.small {
  width: 34px;
  height: 34px;
  font-size: 0.82rem;
}
.brand strong {
  font-size: 0.92rem;
  white-space: nowrap;
}
.brand small {
  font-size: 0.64rem;
}
.context-switcher,
.function-search,
.account-switcher {
  position: relative;
  min-width: 0;
}
.context-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 48px;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.context-copy,
.context-copy strong,
.context-copy small {
  display: block;
  min-width: 0;
}
.context-copy strong,
.context-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.context-copy strong {
  font-size: 0.86rem;
}
.context-copy small {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.68rem;
}
.header-action,
.header-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  white-space: nowrap;
}
.header-action-label {
  font-size: 0.78rem;
  font-weight: 800;
}
.topbar > .menu-button {
  display: none;
}
.header-popover {
  position: absolute;
  z-index: 60;
  top: calc(100% + 0.45rem);
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.header-popover-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.header-popover-heading strong,
.header-popover-heading small {
  display: block;
}
.header-popover-heading small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
}
.context-panel {
  left: 0;
  width: min(430px, calc(100vw - 2rem));
}
.context-panel .work-context {
  display: grid;
  grid-column: auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
}
.context-panel .context-field {
  display: grid;
  gap: 0.25rem;
}
.context-panel .work-context small {
  display: block;
  overflow: visible;
  color: var(--muted);
  font-size: 0.7rem;
  text-overflow: clip;
  white-space: normal;
}
.context-panel input:disabled {
  cursor: default;
  opacity: 1;
  background: var(--cream);
}
.function-search-panel {
  right: 0;
  width: min(370px, calc(100vw - 2rem));
}
.function-search-panel > label {
  display: block;
  margin-bottom: 0.35rem;
}
.function-search-panel input {
  width: 100%;
}
.function-search-panel .function-results {
  position: static;
  width: 100%;
  max-height: min(420px, 55vh);
  margin-top: 0.35rem;
  box-shadow: none;
}
.account-menu {
  right: 0;
  width: 250px;
  padding: 0.45rem;
}
.account-menu-heading {
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--line);
}
.account-menu-heading small,
.account-menu-heading strong {
  display: block;
  overflow-wrap: anywhere;
}
.account-menu-heading small {
  color: var(--muted);
}
.account-menu a,
.account-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.7rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-weight: 750;
  text-align: left;
  text-decoration: none;
}
.account-menu a:hover,
.account-menu a:focus,
.account-menu button:hover,
.account-menu button:focus {
  background: #f0ece3;
}
.account-menu #logout {
  margin-top: 0.2rem;
  border-top: 1px solid var(--line);
  border-radius: 0;
  color: var(--danger);
}
.topbar > #show-update {
  min-height: 44px;
  padding: 0.45rem 0.65rem;
}
.app-layout {
  min-height: calc(100vh - 64px);
}
.side-navigation {
  top: 64px;
  height: calc(100vh - 64px);
}
.breadcrumb-row {
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 240, 231, 0.92);
}
.breadcrumb {
  flex: 1 1 auto;
  min-height: 40px;
  padding: 0.35rem clamp(0.75rem, 3vw, 2rem);
  border: 0;
  background: transparent;
}
.breadcrumb-desktop {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.breadcrumb-mobile {
  display: none;
}
.compact-help {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: clamp(0.45rem, 2vw, 1.25rem);
  min-height: 40px;
  padding: 0.35rem 0.5rem;
  font-size: 0.76rem;
  text-decoration: none;
}
.compact-help .control-icon svg {
  width: 18px;
  height: 18px;
}
.workspace {
  padding: clamp(1.25rem, 3vw, 2.5rem) 0;
}

@media (max-width: 1100px) and (min-width: 801px) {
  .topbar {
    grid-template-columns:
      minmax(145px, 180px) minmax(210px, 1fr)
      auto auto auto;
  }
  .brand-mark.small,
  .brand small,
  .header-action-label {
    display: none;
  }
}

@media (max-width: 800px) and (min-width: 621px) {
  .topbar {
    grid-template-columns:
      44px minmax(112px, 150px) minmax(230px, 1fr)
      44px 44px;
    grid-template-rows: 48px;
    min-height: 64px;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
  }
  .topbar > .menu-button {
    display: inline-grid;
    grid-column: 1;
    grid-row: 1;
    padding: 0;
  }
  .brand {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    justify-self: start;
  }
  .brand-mark.small,
  .brand small,
  .header-action-label {
    display: none;
  }
  .context-switcher {
    grid-column: 3;
    grid-row: 1;
  }
  .function-search {
    grid-column: 4;
    grid-row: 1;
  }
  .account-switcher {
    grid-column: 5;
    grid-row: 1;
  }
  .header-action {
    width: 44px;
    padding: 0;
  }
  .topbar > #show-update {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .app-layout {
    min-height: calc(100vh - 64px);
  }
  .side-navigation {
    top: 0;
    height: 100vh;
  }
  .workspace {
    width: min(1260px, calc(100% - 1.5rem));
    padding: 1rem 0 2rem;
  }
}

@media (max-width: 620px) {
  .topbar {
    grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
    grid-template-rows: 44px 48px;
    min-height: 104px;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
  }
  .topbar > .menu-button {
    display: inline-grid;
    grid-column: 1;
    grid-row: 1;
    padding: 0;
  }
  .brand {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    justify-self: start;
  }
  .brand-mark.small,
  .brand small,
  .header-action-label {
    display: none;
  }
  .brand strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .context-switcher {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .context-trigger {
    min-height: 48px;
    padding-inline: 0.55rem;
  }
  .function-search {
    grid-column: 3;
    grid-row: 1;
  }
  .account-switcher {
    grid-column: 4;
    grid-row: 1;
  }
  .header-action {
    width: 44px;
    padding: 0;
  }
  .topbar > #show-update {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
  }
  .header-popover {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    max-height: calc(100vh - 7.5rem);
    overflow-y: auto;
  }
  .context-panel {
    top: 6.85rem;
  }
  .function-search-panel,
  .account-menu {
    top: 3.55rem;
  }
  .app-layout {
    min-height: calc(100vh - 104px);
  }
  .side-navigation {
    top: 0;
    height: 100vh;
  }
  .breadcrumb-row {
    min-height: 42px;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
  }
  .breadcrumb {
    min-height: 40px;
    padding: 0.3rem 0.75rem;
  }
  .breadcrumb-desktop {
    display: none;
  }
  .breadcrumb-mobile {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    font-weight: 800;
    text-decoration: none;
  }
  .compact-help {
    min-height: 38px;
    margin-right: 0.35rem;
    padding-inline: 0.4rem;
  }
  .workspace {
    width: min(1260px, calc(100% - 1.5rem));
    padding: 1rem 0 2rem;
  }
}
.animal-lookup {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  width: 100%;
}

.animal-lookup .search-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.animal-lookup-results {
  display: grid;
  gap: 0.35rem;
  max-height: 18rem;
  overflow: auto;
  border: 1px solid var(--line, #d7ddd8);
  border-radius: 0.75rem;
  padding: 0.4rem;
  background: var(--surface, #fff);
  z-index: 3;
}

.animal-lookup-option {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.animal-lookup-option:hover,
.animal-lookup-option:focus-visible {
  background: color-mix(in srgb, var(--green) 10%, white);
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.animal-lookup-option span,
.animal-operational-summary span {
  display: block;
  color: var(--muted, #58635d);
  font-size: 0.9rem;
}

.animal-operational-summary {
  display: grid;
  gap: 0.3rem;
  padding: 0.75rem;
  border-left: 4px solid var(--green);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--green) 6%, white);
}

.animal-selected-list {
  display: grid;
  gap: 0.4rem;
}

.animal-selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line, #d7ddd8);
  border-radius: 0.5rem;
}

@media (max-width: 520px) {
  .animal-lookup .search-inline {
    grid-template-columns: 1fr;
  }

  .animal-lookup .search-inline button {
    width: 100%;
  }

  .animal-selected-item {
    align-items: stretch;
    flex-direction: column;
  }
}
