:root {
  --navy: #10233f;
  --navy-soft: #1b3557;
  --green: #2f7d4a;
  --green-dark: #25633b;
  --green-soft: #eaf4ed;
  --gold: #b58a3a;
  --gold-soft: #f5eedf;
  --surface: #ffffff;
  --background: #f4f6f3;
  --text: #172033;
  --muted: #667085;
  --border: #dfe5dc;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --radius: 12px;
  --shadow: 0 18px 48px rgba(16, 35, 63, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--background);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea,
a.action {
  min-height: 44px;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

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

h1,
h2,
h3 {
  color: var(--navy);
  line-height: 1.2;
}

:focus-visible {
  outline: 3px solid #d4a84e;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--surface);
  background: var(--navy);
  border-radius: 8px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ui-icon {
  display: block;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  overflow: visible;
  color: #e8eef6;
  background: var(--navy);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.sidebar-top {
  flex: 0 0 auto;
  padding: 28px 20px 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  flex: 0 0 auto;
  object-fit: contain;
  background: var(--surface);
  border-radius: 14px;
}

.brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 1.24rem;
  letter-spacing: 0.01em;
}

.brand-copy small {
  margin-top: 5px;
  color: #aebdd0;
  font-size: 0.73rem;
  white-space: nowrap;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: 22px;
  padding: 0 12px;
  color: #c9d4e2;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  cursor: pointer;
}

.sidebar-toggle:hover {
  color: var(--surface);
  background: rgba(255, 255, 255, 0.1);
}

.toggle-mark {
  display: grid;
  flex: 0 0 28px;
  place-items: center;
  font-size: 1.45rem;
  transition: transform 180ms ease;
}

.sidebar-nav {
  display: grid;
  flex: 0 0 auto;
  gap: 6px;
  overflow: visible;
  padding: 8px 14px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 7px 12px;
  color: #ccd6e3;
  border: 1px solid transparent;
  border-radius: 10px;
  text-decoration: none;
}

a.nav-item:hover {
  color: var(--surface);
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.is-active {
  color: var(--surface);
  background: rgba(47, 125, 74, 0.32);
  border-color: rgba(119, 190, 144, 0.25);
}

.nav-item.is-disabled {
  color: #8fa0b5;
  cursor: default;
}

.nav-mark {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #dfe7f1;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.nav-label small {
  display: block;
  color: #8294aa;
  font-size: 0.67rem;
}

.sidebar-footer {
  display: grid;
  flex: 0 0 auto;
  gap: 14px;
  margin-top: 12px;
  padding: 18px 20px 22px;
  background: var(--navy);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.user-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--navy);
  background: var(--gold-soft);
  border: 2px solid rgba(181, 138, 58, 0.55);
  border-radius: 50%;
  font-weight: 800;
}

.user-copy {
  display: grid;
  min-width: 0;
}

.user-copy strong {
  overflow: hidden;
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy small {
  color: #9daec1;
  font-size: 0.7rem;
}

.logout-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0 12px;
  color: #d5deea;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  cursor: pointer;
}

.logout-button:hover {
  color: var(--surface);
  background: rgba(255, 255, 255, 0.07);
}

.app-shell.is-sidebar-collapsed {
  grid-template-columns: 88px minmax(0, 1fr);
}

.app-shell.is-sidebar-collapsed .sidebar-top,
.app-shell.is-sidebar-collapsed .sidebar-footer {
  padding-right: 14px;
  padding-left: 14px;
}

.app-shell.is-sidebar-collapsed .brand-sidebar {
  justify-content: center;
  width: 100%;
}

.app-shell.is-sidebar-collapsed .brand-copy,
.app-shell.is-sidebar-collapsed .nav-label,
.app-shell.is-sidebar-collapsed .reproduction-nav-links,
.app-shell.is-sidebar-collapsed .user-copy {
  display: none;
}

.app-shell.is-sidebar-collapsed .sidebar-toggle,
.app-shell.is-sidebar-collapsed .nav-item,
.app-shell.is-sidebar-collapsed .logout-button {
  justify-content: center;
  padding-right: 8px;
  padding-left: 8px;
}

.app-shell.is-sidebar-collapsed .toggle-mark {
  transform: rotate(180deg);
}

.workspace {
  min-width: 0;
}

.main-content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 46px clamp(24px, 4vw, 64px) 64px;
}

.mobile-header,
.mobile-nav,
.mobile-reproduction-nav {
  display: none;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 38px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--green);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.page-header h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.045em;
}

.page-intro {
  max-width: 690px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.environment-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  color: #74551e;
  background: var(--gold-soft);
  border: 1px solid #e7d6b2;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
}

.section-heading > p {
  max-width: 410px;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 18px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 210px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(16, 35, 63, 0.045);
}

.feature-card--wide {
  grid-column: 1 / -1;
  min-height: 0;
}

.feature-card::after {
  display: block;
  width: 42px;
  height: 3px;
  margin-top: 24px;
  content: "";
  background: linear-gradient(90deg, var(--green), var(--gold));
  border-radius: 999px;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 28px;
}

.card-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 10px;
}

.card-icon .ui-icon {
  width: 21px;
  height: 21px;
}

.status-badge {
  min-height: 26px;
  color: #48634f;
  background: var(--green-soft);
  border-color: #cfe3d5;
}

.feature-card h3 {
  margin-bottom: 8px;
  font-size: 1.12rem;
}

.metric-value {
  display: block;
  margin: 4px 0 10px;
  color: var(--navy);
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1;
}

.metric-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.metric-summary > div {
  min-width: 0;
  padding: 10px;
  background: #f8faf7;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.metric-summary dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 780;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric-summary dd {
  margin: 0;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  color: var(--navy);
  font-size: clamp(0.95rem, 1.8vw, 1.45rem);
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.feature-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.card-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
  color: var(--green-dark);
  font-size: 0.87rem;
  font-weight: 750;
  text-decoration: none;
}

.card-link:hover,
.card-link:focus-visible {
  text-decoration: underline;
}

.dashboard-shortcuts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 28px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.dashboard-shortcuts h2 {
  margin: 0;
  font-size: 1.12rem;
}

.dashboard-shortcuts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-shortcuts-list a {
  display: inline-flex;
  gap: 8px;
  padding: 10px 14px;
  color: var(--navy);
  background: #f8faf7;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.dashboard-shortcuts-list a:hover,
.dashboard-shortcuts-list a:focus-visible {
  border-color: var(--green);
  color: var(--green-dark);
}

.empty-state,
.foundation-note {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.empty-mark,
.foundation-mark {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--green-dark);
  background: var(--green-soft);
  border-radius: 12px;
  font-weight: 850;
}

.empty-state h3,
.foundation-note h2 {
  margin-bottom: 5px;
  font-size: 1rem;
}

.empty-state p,
.foundation-note p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.foundation-note {
  margin-top: 28px;
  background: transparent;
  border-style: dashed;
}

.guest-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
}

.guest-shell::before {
  position: fixed;
  top: -28vw;
  right: -18vw;
  z-index: -1;
  width: 58vw;
  height: 58vw;
  content: "";
  background: radial-gradient(circle, rgba(47, 125, 74, 0.13), transparent 68%);
  pointer-events: none;
}

.guest-brand {
  padding: 30px 0;
}

.guest-brand .brand-copy strong {
  color: var(--navy);
}

.guest-brand .brand-copy small {
  color: var(--muted);
}

.guest-content {
  display: grid;
  place-items: center;
  padding: 32px 0 64px;
}

.login-card,
.error-card {
  width: min(100%, 460px);
  padding: clamp(26px, 5vw, 42px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--green);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-heading {
  margin-bottom: 28px;
}

.login-heading h1,
.error-card h1 {
  margin-bottom: 10px;
  font-size: clamp(1.7rem, 5vw, 2.2rem);
  letter-spacing: -0.035em;
}

.login-heading > p:last-child,
.error-card > p {
  color: var(--muted);
}

.login-card form {
  display: grid;
  gap: 18px;
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-group label {
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 720;
}

.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--text);
  background: #fbfcfa;
  border: 1px solid #cbd5c8;
  border-radius: 9px;
}

.field-group input::placeholder,
.field-group textarea::placeholder {
  color: #98a29a;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  background: var(--surface);
  border-color: var(--green);
  outline: 3px solid rgba(47, 125, 74, 0.14);
}

.primary-button,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 9px;
  font-weight: 760;
  text-decoration: none;
}

.primary-button {
  color: var(--surface);
  background: var(--green);
  border: 1px solid var(--green);
  cursor: pointer;
}

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

.secondary-action {
  color: var(--navy);
  background: var(--surface);
  border: 1px solid #b9c5b7;
}

.secondary-action:hover {
  color: var(--green-dark);
  border-color: var(--green);
}

.alert {
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 0.88rem;
}

.alert-danger {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #fecdca;
}

.login-help {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.guest-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 22px 0 28px;
  color: var(--muted);
  font-size: 0.76rem;
}

.error-card {
  text-align: center;
}

.error-code {
  margin-bottom: 8px;
  color: var(--gold) !important;
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.18em;
}

.correlation-id {
  overflow-wrap: anywhere;
  font-size: 0.8rem;
}

.correlation-id code {
  display: block;
  margin-top: 7px;
  color: var(--navy);
}

.debug-details {
  margin-top: 22px;
  text-align: left;
}

.debug-details pre {
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  background: #eef1ed;
  border-radius: 8px;
  font-size: 0.75rem;
  white-space: pre-wrap;
}

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

.compact-page-header {
  align-items: center;
  margin-bottom: 28px;
}

.compact-page-header h1 {
  font-size: clamp(1.8rem, 3vw, 2.55rem);
}

.data-panel,
.form-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(16, 35, 63, 0.045);
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 20px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-panel .secondary-action {
  min-height: 48px;
  cursor: pointer;
}

.animal-filter-panel {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.animal-filter-panel .checkbox-field-group {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  align-self: end;
  gap: 10px;
  min-height: 48px;
}

.animal-filter-panel .checkbox-field-group input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  margin: 0;
}

.animal-filter-panel .checkbox-field-group label {
  cursor: pointer;
}

.animal-more-filters,
.animal-filter-actions {
  grid-column: 1 / -1;
}

.animal-more-filters {
  min-width: 0;
  background: #f8faf7;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.animal-more-filters > summary {
  min-height: 48px;
  padding: 14px 16px;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.animal-more-filters > summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.animal-more-filters[open] > summary {
  border-bottom: 1px solid var(--border);
}

.animal-more-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.animal-more-filters > .technical-filter-panel {
  margin: 0 16px 16px;
  background: var(--surface);
}

.technical-filter-panel {
  min-width: 0;
  background: #f8faf7;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.technical-filter-panel summary {
  min-height: 48px;
  padding: 14px 16px;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.technical-filter-panel[open] summary {
  border-bottom: 1px solid var(--border);
}

.technical-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.technical-trait-field {
  grid-column: span 2;
}

.animal-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.detail-nav a {
  padding: 8px 12px;
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 760;
  text-decoration: none;
}

.detail-nav a:hover {
  color: var(--green-dark);
  border-color: var(--green);
}

.detail-section {
  margin-top: 18px;
  scroll-margin-top: 18px;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.detail-list > div {
  padding: 14px;
  background: #f8faf7;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.detail-list dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--navy);
  font-weight: 720;
}

.detail-history {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.detail-history li {
  padding: 12px 14px;
  background: #f8faf7;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.station-history-list {
  display: grid;
  gap: 14px;
}

.station-history-card {
  min-width: 0;
  padding: 18px;
  background: #f8faf7;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.station-history-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.station-history-card h3,
.station-history-card h4 {
  margin-bottom: 0;
}

.station-history-fields {
  margin-top: 14px;
}

.station-source-group {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
}

.station-source-group summary {
  cursor: pointer;
  color: var(--navy);
  font-weight: 780;
}

.station-source-group summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.82rem;
}

.pagination > div {
  display: flex;
  gap: 8px;
}

.responsive-table {
  position: relative;
  overflow-x: auto;
}

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

.users-table th,
.users-table td {
  padding: 16px 18px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.users-table th {
  color: var(--muted);
  background: #f8faf7;
  font-size: 0.73rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

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

.users-table td > strong,
.users-table td > small {
  display: block;
}

.users-table td > small,
.muted,
.field-help {
  color: var(--muted);
}

.status-badge.is-inactive {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #fecdca;
}

.table-actions,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.table-actions form {
  margin: 0;
}

.table-actions .secondary-action,
.danger-button {
  min-height: 44px;
  padding: 7px 10px;
  font-size: 0.78rem;
}

.danger-button {
  color: var(--surface);
  background: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 9px;
  font-weight: 760;
  cursor: pointer;
}

.danger-button:hover {
  background: #912018;
  border-color: #912018;
}

.form-panel {
  padding: clamp(22px, 4vw, 36px);
}

.relationship-panel {
  margin-top: 20px;
}

.compact-section-heading {
  display: block;
  margin-bottom: 20px;
}

.compact-section-heading h2 {
  margin-bottom: 6px;
  font-size: 1.2rem;
}

.compact-section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: left;
}

.narrow-form-panel {
  width: min(100%, 680px);
}

.management-form {
  display: grid;
  gap: 20px;
}

.form-panel > .parent-search-form {
  margin-bottom: 28px;
}

.animal-identifier-fieldset {
  display: grid;
  gap: 16px;
  min-width: 0;
  margin: 0;
  padding: 18px;
  background: #fbfcfa;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.animal-identifier-fieldset legend {
  padding: 0 6px;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 720;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.field-group .checkbox-line input,
.checkbox-line input {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.form-panel > .alert,
.account-summary {
  margin-bottom: 20px;
}

.management-form .field-group input:not([type="checkbox"]) {
  width: 100%;
  padding: 11px 13px;
  background: #fbfcfa;
  border: 1px solid #cbd5c8;
  border-radius: 9px;
}

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

.field-error {
  color: var(--danger);
  font-size: 0.78rem;
}

.field-help {
  font-size: 0.76rem;
}

.account-summary {
  display: grid;
  padding: 16px;
  background: var(--green-soft);
  border: 1px solid #cfe3d5;
  border-radius: 10px;
}

.account-summary span {
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.profile-fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.profile-fieldset legend {
  padding: 0 6px;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 720;
}

.profile-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px;
  background: #fbfcfa;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
}

.profile-option input {
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
}

.profile-option span {
  display: grid;
  min-width: 0;
}

.profile-option small {
  color: var(--muted);
  font-size: 0.7rem;
}

.participation-source,
.form-help {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.participation-actions {
  min-width: 250px;
}

.compact-management-form {
  gap: 12px;
}

.compact-management-form .primary-button {
  width: 100%;
  justify-content: center;
}

.status-badge.status-pendente {
  color: #7a4f00;
  background: #fff3cd;
  border-color: #f2d98b;
}

.status-badge.status-confirmada {
  color: #245c35;
  background: var(--green-soft);
  border-color: #cfe3d5;
}

.status-badge.status-encerrada {
  color: #5c6670;
  background: #eef1f3;
  border-color: #d7dde1;
}

.alert-info {
  color: #214b70;
  background: #eff8ff;
  border: 1px solid #b2ddff;
}

.alert-success {
  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid #b7d9c1;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.summary-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.summary-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-card strong {
  color: var(--navy);
  font-size: 1.7rem;
}

.import-reading-summary {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
  padding: clamp(18px, 3vw, 26px);
}

.import-reading-summary header p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.import-reading-facts {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.import-reading-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.import-reading-groups article {
  min-width: 0;
  padding: 14px;
  background: #f8faf7;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.import-reading-groups h3 {
  margin: 0 0 9px;
  color: var(--navy);
  font-size: 0.86rem;
}

.import-reading-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.import-reading-list li {
  max-width: 100%;
  padding: 5px 9px;
  overflow-wrap: anywhere;
  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid #cfe3d5;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 720;
}

.import-upload-panel {
  width: min(100%, 720px);
}

.import-upload-panel form,
.import-lines,
.import-issues {
  display: grid;
  gap: 16px;
}

.import-line-card {
  padding: clamp(18px, 3vw, 28px);
}

.import-line-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.import-line-header h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.import-comparison {
  margin-bottom: 18px;
}

.import-issues {
  margin-top: 18px;
}

.import-issues h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.import-issue {
  padding: 16px;
  background: #fffbf2;
  border: 1px solid #ead6a8;
  border-radius: 10px;
}

.import-issue.is-blocking {
  background: var(--danger-soft);
  border-color: #fecdca;
}

.import-issue > div > small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.import-decision-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(16, 35, 63, 0.12);
}

.decision-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.import-raw-details {
  margin-top: 18px;
}

.import-raw-details summary {
  color: var(--navy);
  font-weight: 750;
  cursor: pointer;
}

.import-raw-details .responsive-table {
  margin-top: 12px;
}

.import-confirm-panel {
  margin-top: 24px;
}

.import-bulk-panel,
.import-bulk-groups,
.import-bulk-card,
.import-bulk-actions,
.import-bulk-card form {
  display: grid;
  gap: 1rem;
}

.import-bulk-panel {
  margin: 20px 0;
}

.import-bulk-card {
  padding: clamp(16px, 3vw, 24px);
}

.import-bulk-card header h3,
.import-bulk-card header p {
  margin-bottom: 0;
}

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

.import-bulk-card button {
  justify-self: start;
}

.import-bulk-card input:focus-visible,
.import-bulk-card select:focus-visible,
.import-bulk-card button:focus-visible {
  outline: 3px solid #d4a84e;
  outline-offset: 3px;
}

@media (max-width: 720px) {
  .import-bulk-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .import-bulk-card button {
    width: 100%;
    justify-content: center;
  }
}

.dep-rules-note {
  margin-bottom: 20px;
  padding: 14px 16px;
  color: var(--navy);
  background: var(--green-soft);
  border: 1px solid #cce7dc;
  border-radius: 12px;
  line-height: 1.55;
}

.dep-traits-grid {
  display: grid;
  gap: 20px;
}

.dep-trait-card {
  min-width: 0;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dep-trait-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dep-trait-header h2 {
  margin: 4px 0 0;
  font-size: 1.2rem;
}

.dep-trait-code {
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dep-color-list {
  display: grid;
  gap: 12px;
}

.dep-color-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(126px, 0.75fr) minmax(130px, 1fr) minmax(126px, 0.75fr) minmax(116px, 0.7fr);
  align-items: end;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 16px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.dep-color-row legend {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 850;
}

.dep-color-dot {
  width: 12px;
  height: 12px;
  background: var(--muted);
  border: 1px solid rgba(16, 35, 63, 0.18);
  border-radius: 50%;
}

.dep-color-verde .dep-color-dot {
  background: #198754;
}

.dep-color-amarelo .dep-color-dot {
  background: #e8b923;
}

.dep-color-laranja .dep-color-dot {
  background: #e97817;
}

.dep-color-vermelho .dep-color-dot {
  background: #c9333e;
}

.dep-boundary-field {
  min-width: 0;
}

.dep-boundary-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--navy);
  font-size: 0.76rem;
  font-weight: 750;
}

.dep-boundary-field input {
  width: 100%;
  min-width: 0;
}

.dep-check {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.dep-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--green-dark);
}

.dep-check .field-error {
  flex-basis: 100%;
}

.dep-active-check {
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.dep-rule-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.evaluation-section-heading,
.evaluation-version-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.evaluation-section-heading > div {
  min-width: 0;
}

.evaluation-history-list,
.evaluation-groups {
  display: grid;
  gap: 16px;
}

.evaluation-version-card {
  padding: clamp(18px, 3vw, 26px);
}

.evaluation-version-header {
  margin-bottom: 18px;
}

.evaluation-version-header h2 {
  margin: 4px 0 0;
  font-size: 1.25rem;
}

.evaluation-current-badge {
  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid #b7d9c1;
}

.evaluation-summary-list {
  margin-bottom: 18px;
}

.evaluation-trait-group {
  min-width: 0;
  background: #f8faf7;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.evaluation-trait-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 16px;
  color: var(--navy);
  font-weight: 800;
  cursor: pointer;
}

.evaluation-trait-group summary small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.evaluation-trait-group[open] summary {
  border-bottom: 1px solid var(--border);
}

.evaluation-traits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  padding: 14px;
}

.evaluation-trait-card {
  min-width: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.evaluation-trait-card > header {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.evaluation-trait-card > header strong {
  color: var(--green-dark);
  font-size: 0.82rem;
}

.evaluation-trait-card > header span {
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 700;
}

.evaluation-dep-value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.evaluation-dep-value > span,
.evaluation-trait-metrics dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.evaluation-dep-value strong {
  overflow-wrap: anywhere;
  color: var(--navy);
  font-size: 1rem;
}

.dep-signal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  margin-bottom: 12px;
  padding: 5px 9px;
  color: var(--navy);
  background: #f2f4f1;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 760;
}

.dep-signal-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  background: var(--muted);
  border: 1px solid rgba(16, 35, 63, 0.2);
  border-radius: 50%;
}

.dep-signal-verde .dep-signal-dot {
  background: #198754;
}

.dep-signal-amarelo .dep-signal-dot {
  background: #e8b923;
}

.dep-signal-laranja .dep-signal-dot {
  background: #e97817;
}

.dep-signal-vermelho .dep-signal-dot {
  background: #c9333e;
}

.evaluation-trait-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.evaluation-trait-metrics > div {
  min-width: 0;
}

.evaluation-trait-metrics dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 730;
}

.evaluation-empty-group {
  margin: 0;
  padding: 14px 16px;
}

.reproduction-nav-group {
  display: grid;
  gap: 4px;
}

.reproduction-nav-links {
  display: grid;
  gap: 2px;
  margin: 0 10px 4px 54px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.reproduction-nav-links a {
  min-height: 32px;
  padding: 6px 8px;
  overflow: hidden;
  color: #b8c5d5;
  border-radius: 7px;
  font-size: 0.72rem;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reproduction-nav-links a:hover,
.reproduction-nav-links a:focus-visible {
  color: var(--surface);
  background: rgba(255, 255, 255, 0.08);
}

.reproduction-page {
  display: grid;
  gap: 22px;
}

.reproduction-page .page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.reproduction-page .page-heading h1 {
  margin-bottom: 8px;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
}

.reproduction-toolbar,
.reproduction-page .filter-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(220px, 2fr) auto;
  align-items: end;
  gap: 10px 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.reproduction-page .filter-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reproduction-page .filter-form > .form-actions {
  grid-column: 1 / -1;
}

.reproduction-toolbar label,
.reproduction-page .filter-form > label,
.birth-form > label,
.reproduction-form > label,
.reproduction-cancel-form > label,
form[data-reproduction-draft] > label {
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 720;
}

.reproduction-toolbar input,
.reproduction-page .filter-form > input,
.reproduction-page .filter-form > select,
.birth-form > input,
.birth-form > select,
.birth-form > textarea,
.reproduction-form > input,
.reproduction-form > select,
.reproduction-form > textarea,
.reproduction-cancel-form > textarea,
form[data-reproduction-draft] > input,
form[data-reproduction-draft] > select,
form[data-reproduction-draft] > textarea,
.birth-calf-card input,
.birth-calf-card select,
.birth-calf-card textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--text);
  background: #fbfcfa;
  border: 1px solid #cbd5c8;
  border-radius: 9px;
}

.birth-form,
.reproduction-form,
.reproduction-cancel-form,
form[data-reproduction-draft] {
  display: grid;
  gap: 9px;
  padding: clamp(18px, 3vw, 30px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(16, 35, 63, 0.05);
}

.birth-form textarea,
.reproduction-form textarea,
.reproduction-cancel-form textarea,
form[data-reproduction-draft] textarea {
  min-height: 96px;
  resize: vertical;
}

.birth-form [aria-invalid="true"],
.reproduction-form [aria-invalid="true"],
.reproduction-cancel-form [aria-invalid="true"],
form[data-reproduction-draft] [aria-invalid="true"] {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.birth-form .field-error,
.reproduction-form .field-error,
.reproduction-cancel-form .field-error,
form[data-reproduction-draft] .field-error {
  margin: -4px 0 4px;
}

.birth-calf-list {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.birth-calf-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 18px;
  background: #f8faf7;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.birth-calf-card legend {
  padding: 0 6px;
  color: var(--navy);
  font-weight: 800;
}

.birth-status {
  color: var(--green-dark);
  font-weight: 760;
}

.reproduction-table-wrap {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}

.reproduction-table-wrap table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.reproduction-table-wrap th,
.reproduction-table-wrap td {
  padding: 13px 15px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.reproduction-table-wrap th {
  color: var(--muted);
  background: #f8faf7;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.reproduction-table-wrap tr:last-child td {
  border-bottom: 0;
}

.reproduction-page button[type="submit"],
.reproduction-page .button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  color: var(--surface);
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 9px;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.reproduction-page button[type="submit"]:hover,
.reproduction-page .button-primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.reproduction-page button.danger-button[type="submit"] {
  color: var(--surface);
  background: var(--danger);
  border-color: var(--danger);
}

.reproduction-page button.danger-button[type="submit"]:hover {
  background: #912018;
  border-color: #912018;
}

.reproduction-page .alert-error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #fecdca;
}

.mating-page-header,
.mating-batch-card,
.mating-filter-panel,
.mating-table-wrap,
.mating-identity-grid,
.mating-official-result,
.mating-trait-group,
.mating-origin,
.mating-matrix-summary,
.mating-matrix-result {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mating-batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}

.mating-batch-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.mating-batch-card h2,
.mating-batch-card p,
.mating-matrix-result h3,
.mating-matrix-result p {
  margin-bottom: 0;
}

.mating-card-action {
  justify-self: start;
}

.mating-empty-state {
  padding: 24px;
}

.mating-summary-list,
.mating-matrix-result dl,
.mating-identity-grid article dl,
.mating-trait-card dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  gap: 10px;
  margin: 0;
}

.mating-summary-list > div,
.mating-matrix-result dl > div,
.mating-identity-grid article dl > div,
.mating-trait-card dl > div {
  min-width: 0;
}

.mating-summary-list dt,
.mating-matrix-result dt,
.mating-identity-grid dt,
.mating-trait-card dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mating-summary-list dd,
.mating-matrix-result dd,
.mating-identity-grid dd,
.mating-trait-card dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: var(--navy);
  font-weight: 730;
}

.mating-filter-panel {
  margin-bottom: 20px;
  padding: 0;
}

.mating-filter-panel > summary,
.mating-trait-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 13px 16px;
  color: var(--navy);
  font-weight: 800;
  cursor: pointer;
}

.mating-filter-panel > summary:focus-visible,
.mating-trait-group > summary:focus-visible,
.mating-card-action:focus-visible,
.mating-results-table a:focus-visible,
.mating-matrix-links a:focus-visible {
  outline: 3px solid #d4a84e;
  outline-offset: 3px;
}

.mating-filter-panel[open] > summary,
.mating-trait-group[open] > summary {
  border-bottom: 1px solid var(--border);
}

.mating-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 14px;
  padding: 18px;
}

.mating-filter-actions {
  grid-column: 1 / -1;
  flex-wrap: wrap;
}

.mating-table-wrap {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.mating-results-table {
  width: 100%;
  border-collapse: collapse;
}

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

.mating-results-table td > strong,
.mating-results-table td > small {
  display: block;
}

.mating-results-table td > small {
  margin-top: 3px;
  color: var(--muted);
}

.mating-pagination {
  margin-top: 18px;
}

.mating-identity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
}

.mating-identity-grid article {
  min-width: 0;
  padding: 16px;
  background: #f8faf7;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.mating-identity-grid h2,
.mating-origin h2 {
  font-size: 1rem;
}

.mating-official-result,
.mating-origin {
  margin-bottom: 18px;
  padding: 20px;
}

.mating-trait-groups {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.mating-trait-group {
  padding: 0;
}

.mating-trait-group > summary small {
  color: var(--muted);
  font-size: 0.72rem;
}

.mating-trait-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 12px;
  padding: 14px;
}

.mating-trait-card {
  min-width: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.mating-trait-card > header {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.mating-trait-card > header strong {
  color: var(--green-dark);
}

.mating-dep-value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.mating-dep-signal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  margin-bottom: 12px;
  padding: 5px 9px;
  color: var(--navy);
  background: #f2f4f1;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 760;
}

.mating-dep-signal-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  background: var(--muted);
  border: 1px solid rgba(16, 35, 63, 0.2);
  border-radius: 50%;
}

.mating-dep-signal-verde .mating-dep-signal-dot {
  background: #198754;
}

.mating-dep-signal-amarelo .mating-dep-signal-dot {
  background: #e8b923;
}

.mating-dep-signal-laranja .mating-dep-signal-dot {
  background: #e97817;
}

.mating-dep-signal-vermelho .mating-dep-signal-dot {
  background: #c9333e;
}

.mating-matrix-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}

.mating-matrix-result {
  display: grid;
  gap: 12px;
  padding: 15px;
  background: #f8faf7;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.mating-matrix-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .compact-page-header > .form-actions {
    min-width: 0;
    flex-wrap: wrap;
  }

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

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

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

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

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

  .feature-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

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

  .dep-active-check {
    padding-left: 0;
    border-left: 0;
  }

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

  .reproduction-page .filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .mating-page-header .secondary-action,
  .mating-filter-actions,
  .mating-filter-actions > * {
    width: 100%;
  }

  .mating-table-wrap {
    overflow: visible;
    background: transparent;
    border: 0;
  }

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

  .mating-results-table thead {
    display: none;
  }

  .mating-results-table tr {
    margin-bottom: 14px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .mating-results-table td {
    display: grid;
    grid-template-columns: minmax(92px, 38%) minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    overflow-wrap: anywhere;
    border: 0;
  }

  .mating-results-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .mating-results-table .empty-state-row td {
    display: block;
  }

  .mating-results-table .empty-state-row td::before {
    display: none;
  }

  .mating-filter-grid,
  .mating-identity-grid,
  .mating-trait-grid,
  .mating-matrix-results {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 66px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
  }

  .mobile-reproduction-nav {
    position: sticky;
    top: 66px;
    z-index: 19;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--border);
    scrollbar-width: thin;
  }

  .mobile-reproduction-nav a {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 14px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 760;
    text-decoration: none;
  }

  .mobile-reproduction-nav a.is-active {
    color: var(--navy);
    background: var(--green-soft);
    border-color: var(--green);
  }

  .brand-mobile {
    color: var(--navy);
  }

  .brand-mobile img {
    border: 1px solid var(--border);
    border-radius: 10px;
  }

  .mobile-user {
    max-width: 28vw;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .mobile-logout-form {
    flex: 0 0 auto;
  }

  .mobile-logout-button {
    min-width: 44px;
    padding: 0 10px;
    color: var(--navy);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 0.72rem;
    font-weight: 760;
    cursor: pointer;
  }

  .mobile-logout-button:hover {
    color: var(--green-dark);
    border-color: var(--green);
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: flex;
    min-height: 70px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(16, 35, 63, 0.08);
    scrollbar-width: thin;
  }

  .mobile-nav-item {
    display: grid;
    place-content: center;
    flex: 0 0 84px;
    min-width: 0;
    min-height: 70px;
    padding: 6px 4px;
    color: var(--muted);
    font-size: 0.62rem;
    text-align: center;
    text-decoration: none;
  }

  .mobile-nav-item .nav-mark {
    justify-self: center;
    color: var(--green-dark);
    background: var(--green-soft);
  }

  .mobile-nav-item strong {
    overflow: hidden;
    font-size: 0.69rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav-item.is-active {
    color: var(--navy);
    background: var(--green-soft);
  }

  .mobile-nav-item.is-disabled {
    opacity: 0.62;
  }

  .workspace {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
  }

  .main-content {
    padding: 26px 16px 38px;
  }

  .page-header,
  .section-heading {
    display: block;
  }

  .page-header {
    margin-bottom: 30px;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .environment-badge {
    margin-top: 18px;
  }

  .section-heading > p {
    margin-top: 8px;
    text-align: left;
  }

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

  .feature-card,
  .feature-card:last-child:nth-child(odd) {
    grid-column: auto;
    min-height: 180px;
  }

  .feature-card--wide {
    grid-column: 1 / -1;
    min-height: 0;
  }

  .guest-shell {
    width: min(100% - 28px, 560px);
  }

  .guest-brand {
    padding: 20px 0;
  }

  .guest-content {
    align-items: start;
    padding: 18px 0 40px;
  }

  .brand-copy small {
    white-space: normal;
  }

  .login-card,
  .error-card {
    padding: 26px 22px;
  }

  .compact-page-header .action,
  .compact-page-header > .secondary-action {
    width: 100%;
    margin-top: 18px;
  }

  .data-panel {
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .technical-filter-grid {
    grid-template-columns: 1fr;
  }

  .technical-trait-field {
    grid-column: auto;
  }

  .animal-filter-actions,
  .animal-filter-actions .secondary-action {
    width: 100%;
  }

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

  .animal-detail-nav {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 2px 2px 8px;
    scrollbar-width: none;
  }

  .animal-detail-nav::-webkit-scrollbar {
    display: none;
  }

  .animal-detail-nav a {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 44px;
    white-space: nowrap;
  }

  .detail-section[id] {
    scroll-margin-top: 86px;
  }

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

  .responsive-table {
    overflow: visible;
  }

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

  .users-table thead {
    display: none;
  }

  .users-table tr {
    margin-bottom: 14px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .users-table td {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border: 0;
  }

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

  .users-table .table-actions {
    display: flex;
    grid-template-columns: none;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-top: 14px;
    border-top: 1px solid var(--border);
  }

  .users-table .table-actions::before {
    display: none;
  }

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

  .import-line-card {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(16, 35, 63, 0.045);
  }

  .import-line-header {
    display: block;
  }

  .import-line-header .status-badge {
    margin-top: 10px;
  }

  .form-columns,
  .profile-fieldset {
    grid-template-columns: 1fr;
  }

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

  .animal-detail-header > .form-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin-top: 18px;
  }

  .animal-detail-header > .form-actions > * {
    min-width: 0;
    min-height: 44px;
    padding: 9px;
    text-align: center;
  }

  .animal-detail-header > .form-actions > :last-child {
    grid-column: 1 / -1;
  }

  .reproduction-page .page-heading,
  .reproduction-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .reproduction-page .page-heading .button-primary,
  .reproduction-page .form-actions > *,
  .reproduction-toolbar button {
    width: 100%;
    min-height: 44px;
  }

  .reproduction-page .filter-form {
    grid-template-columns: 1fr;
  }

  .reproduction-table-wrap {
    overflow-x: auto;
    background: transparent;
    border: 0;
  }

  .reproduction-table-wrap table,
  .reproduction-table-wrap tbody,
  .reproduction-table-wrap tr,
  .reproduction-table-wrap td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .reproduction-table-wrap thead {
    display: none;
  }

  .reproduction-table-wrap tr {
    margin-bottom: 14px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .reproduction-table-wrap td {
    display: grid;
    grid-template-columns: minmax(92px, 38%) minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    overflow-wrap: anywhere;
    border: 0;
  }

  .reproduction-table-wrap td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .reproduction-table-wrap .empty-state-row td {
    display: block;
  }

  .reproduction-table-wrap .empty-state-row td::before {
    display: none;
  }

  .dep-trait-card {
    padding: 18px 14px;
  }

  .dep-rule-actions,
  .dep-rule-actions .primary-button {
    width: 100%;
  }

  .evaluation-section-heading,
  .evaluation-version-header {
    display: grid;
  }

  .evaluation-section-heading .secondary-action {
    width: 100%;
  }

  .evaluation-traits-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .animal-filter-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .animal-more-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .animal-filter-panel .checkbox-field-group label {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .compact-page-header > .primary-button {
    width: 100%;
    min-height: 44px;
    margin-top: 18px;
  }

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

  .animal-table td {
    display: grid;
    grid-template-columns: minmax(120px, 40%) minmax(0, 1fr);
    overflow-wrap: anywhere;
  }

  .animal-table td::before {
    content: attr(data-label);
  }

  .animal-table .table-actions {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }

  .animal-table .table-actions .secondary-action {
    flex: 1 1 132px;
    min-height: 44px;
  }

  .station-history-card > header {
    flex-wrap: wrap;
  }

}

@media (max-width: 380px) {
  .import-summary,
  .decision-fields-grid {
    grid-template-columns: 1fr;
  }

  .guest-brand .brand-copy small {
    display: none;
  }

  .mobile-user {
    display: none;
  }

  .status-badge {
    font-size: 0.66rem;
  }

  .dep-color-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.report-header {
  align-items: flex-start;
  justify-content: space-between;
}

.report-actions,
.report-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.report-print-meta {
  display: none;
}

.report-meta {
  color: var(--muted);
}

.report-meta span,
.report-print-meta span {
  display: inline-block;
  margin-right: 10px;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 12px;
  margin: 18px 0;
  padding: 0;
}

.report-summary > div {
  min-width: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.report-summary dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.report-summary dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  color: var(--navy);
  font-size: 1.28rem;
  font-weight: 820;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  align-items: end;
  gap: 14px;
  margin: 18px 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.report-filters > label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 740;
}

.report-filters input,
.report-filters select,
.report-filters textarea {
  width: 100%;
  min-width: 0;
}

.report-filters input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.report-checkbox-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
}

.report-checkbox-field label {
  font-weight: 740;
}

.report-filter-actions {
  align-items: center;
  align-self: end;
}

.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.report-tabs a {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.report-tabs a[aria-current="page"] {
  color: #fff;
  background: var(--navy);
}

.report-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

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

.report-table caption {
  padding: 0 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: left;
}

.report-table th,
.report-table td {
  padding: 10px;
  overflow-wrap: anywhere;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.report-table th {
  color: var(--navy);
  font-size: 0.76rem;
}

.report-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.report-pagination a,
.report-pagination [aria-current="page"] {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.report-pagination a[aria-current="page"],
.report-pagination span[aria-current="page"] {
  color: #fff;
  background: var(--navy);
}

@media (max-width: 640px) {
  .report-header {
    align-items: stretch;
  }

  .report-actions,
  .report-actions > *,
  .report-filter-actions,
  .report-filter-actions > * {
    width: 100%;
  }

  .report-filters {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  }

  .report-table-wrap {
    overflow: visible;
  }

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

  .report-table-wrap thead {
    display: none;
  }

  .report-table-wrap tr {
    margin-bottom: 12px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .report-table-wrap td {
    display: grid;
    grid-template-columns: minmax(92px, 38%) minmax(0, 1fr);
    gap: 8px;
    padding: 6px 0;
    border: 0;
  }

  .report-table-wrap td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 760;
  }

  .report-table-wrap .empty-state-row td {
    display: block;
  }

  .report-table-wrap .empty-state-row td::before {
    display: none;
  }

  .report-pagination {
    align-items: stretch;
    flex-direction: column;
  }
}

@media print {
  .sidebar,
  .mobile-header,
  .mobile-nav,
  .filter-panel,
  .report-actions,
  .report-tabs,
  .report-related-links,
  .pagination,
  .report-pagination {
    display: none !important;
  }

  .report-print-meta {
    display: block;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #777;
  }

  .report-screen-meta {
    display: none;
  }

  .app-shell,
  .workspace,
  .main-content {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .report-table-wrap {
    max-width: none;
    overflow: visible;
  }

  .report-table-wrap .report-table {
    display: table;
    width: 100%;
  }

  .report-table tbody {
    display: table-row-group;
  }

  .report-table thead {
    display: table-header-group;
  }

  .report-table tr {
    display: table-row;
    break-inside: avoid;
  }

  .report-table th,
  .report-table td {
    display: table-cell;
    padding: 5px;
    font-size: 9pt;
  }

  .report-table td::before {
    content: none;
  }
}

/* Source evidence stays secondary and readable on narrow screens. */
.station-archive-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1rem; align-items: end; }
.station-archive-filters label { display: grid; gap: .4rem; }
.station-archive-list { display: grid; gap: .8rem; }
.station-archive-row { font-size: 1rem; margin-top: 1.2rem; }
.station-archive-cell { min-width: 0; }
.station-archive-cell header { display: flex; gap: .5rem; justify-content: space-between; flex-wrap: wrap; }
.station-archive-cell h3 { font-size: 1rem; }
.station-archive-value, .station-archive-cell dd { overflow-wrap: anywhere; white-space: pre-wrap; }
