/* Animales and Hembras share lot identity colors and row presentation in BASIC and PRO. */
/* Animales — composición aprobada en docs/visual-system.md.
   Las tarjetas conservan las filas originales, sus seis celdas y eventos. */
/* Una paleta compartida para identificar el mismo lote en ambas vistas. */
:root {
  --lot-accent-green: var(--green2);
  --lot-accent-gold: #d7a642;
  --lot-accent-blue: #6094a0;
  --lot-accent-rust: #b96642;
}
.lot-color.green { background: var(--lot-accent-green); }
.lot-color.gold { background: var(--lot-accent-gold); }
.lot-color.blue { background: var(--lot-accent-blue); }
.lot-color.rust { background: var(--lot-accent-rust); }
:is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr[data-lot-color="green"] { --animal-lot-accent: var(--lot-accent-green); }
:is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr[data-lot-color="gold"] { --animal-lot-accent: var(--lot-accent-gold); }
:is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr[data-lot-color="blue"] { --animal-lot-accent: var(--lot-accent-blue); }
:is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr[data-lot-color="rust"] { --animal-lot-accent: var(--lot-accent-rust); }
:is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr[data-lot-color]::after {
  content: ''; position: absolute; inset: 1px auto 1px 1px; width: 5px;
  background: var(--animal-lot-accent); border-radius: 10px 0 0 10px; pointer-events: none;
}
#animals { padding: 24px 30px 40px; }
#animals .section-head { gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
#animals .section-head > div:first-child { flex: 1 1 260px; min-width: 0; }
#animals .section-head p { margin: 0; font-size: .94rem; line-height: 1.5; }
#animals .section-head > button { min-height: 44px; padding: 11px 16px; border-radius: 10px; font-size: .875rem; line-height: 1.4; white-space: nowrap; }
#animals .section-head > .primary { background: var(--green); color: #fff; border: 1px solid var(--green); }
#animals .section-head > .section-import-btn { margin-left: 0 !important; background: #fff !important; border: 1px solid var(--line) !important; color: var(--green) !important; font-weight: 700 !important; }
/* Importar animales — SVG A aprobado; conservar el botón y su evento. */
#animals .section-head > .section-import-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding-inline: 12px; }
#animals .section-head > .section-import-btn > svg { display: block; width: 16px; height: 16px; flex: 0 0 16px; pointer-events: none; }
#animals .toolbar { gap: 12px; margin-bottom: 18px; }
#animals .toolbar input { min-width: 0; min-height: 44px; font-size: .875rem; }
#animals .toolbar > button { min-height: 44px; border: 1px solid var(--line); background: #fff; color: var(--green); font-size: .875rem; }
#animals .section-head > button:focus-visible,
#animals .toolbar input:focus-visible,
#animals .toolbar button:focus-visible { outline: 2px solid var(--green2); outline-offset: 3px; }
#animals .table-wrap { border-radius: 14px; }
#animals table { min-width: 760px; }
#animals th { padding: 12px 18px; text-transform: none; letter-spacing: 0; font-size: .8125rem; font-weight: 650; line-height: 1.3; }
#animals td { padding: 10px 18px; font-size: .875rem; vertical-align: middle; }
/* Misma familia de la app; más cuerpo en los datos, sin agrandar la identidad. */
#animals td:nth-child(n+2):nth-child(-n+5):not([colspan]) { font-weight: 600; line-height: 1.3; }
#animals tbody tr:last-child td { border-bottom: 0; }
:is(#animals, #reproduction :is([data-reproduction-panel="females"], [data-reproduction-panel="bulls"])) .animal-list-identity { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
:is(#animals, #reproduction :is([data-reproduction-panel="females"], [data-reproduction-panel="bulls"])) .animal-list-code b { font-weight: inherit; }
:is(#animals, #reproduction :is([data-reproduction-panel="females"], [data-reproduction-panel="bulls"])) .animal-list-ear-label { margin: 0; font-size: .75rem; font-weight: 400; color: var(--muted); }
:is(#animals, #reproduction :is([data-reproduction-panel="females"], [data-reproduction-panel="bulls"])) .animal-list-ear-tag { display: block; font-size: .94rem; font-weight: 700; overflow-wrap: anywhere; }
:is(#animals, #reproduction :is([data-reproduction-panel="females"], [data-reproduction-panel="bulls"])) .animal-list-code { margin: 0; font-size: .75rem; font-weight: 400; overflow-wrap: anywhere; }
:is(#animals, #reproduction :is([data-reproduction-panel="females"], [data-reproduction-panel="bulls"])) .animal-list-name { margin: 0; font-size: .8125rem; font-weight: 700; color: var(--muted); overflow-wrap: anywhere; }
#animals .pill { padding: 4px 12px; font-size: .75rem; }
#animals .active-pill { background: #e6f3eb; color: #245c49; }
/* No anular el atributo hidden que utilizan los filtros existentes. */
#animals #animals-body tr[hidden] { display: none !important; }
/* Elevación de Lotes y sombra más contenida para las filas anchas de Animales. */
:is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr {
  position: relative; transition: background .15s, transform .15s, box-shadow .15s;
}
:is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr:not(:has(td[colspan])):hover,
:is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr:not(:has(td[colspan])):focus-visible {
  z-index: 1; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(23,63,50,.055);
}
@media (prefers-reduced-motion: reduce) {
  :is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr { transition: none; }
  :is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr:not(:has(td[colspan])):hover,
  :is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr:not(:has(td[colspan])):focus-visible { transform: none; }
}
/* PC: mismo encabezado descriptivo que Lotes (lot-summary.js)
   y Actividades (activity-calendar-polish.js); sin cambios en tablet/celular. */
@media (min-width: 1181px) {
  #animals .section-head p { font-size: 1.45rem; line-height: 1.2; font-weight: 750; letter-spacing: -.01em; color: #24312c; }
}
@media (min-width: 721px) and (max-width: 1180px) {
  #animals { padding: 24px 20px 40px; }
  #animals .section-head > div:first-child { flex-basis: 100%; }
  #animals .section-head > .section-import-btn { margin-left: auto !important; }
}
@media (max-width: 900px) {
  #animals .table-wrap { overflow: visible; border: 0; border-radius: 0; background: transparent; }
  #animals table { display: block; min-width: 0; }
  #animals thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #animals tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  #animals tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; min-width: 0; align-content: start; }
  #animals td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; font-size: .875rem; }
  #animals td:first-child { grid-column: 1; grid-row: 1; }
  #animals td:last-child:not([colspan]) { grid-column: 2; grid-row: 1; text-align: right; }
  #animals td:nth-child(2), #animals td:nth-child(3) { border-top: 1px solid var(--line); padding-top: 12px; }
  #animals td:nth-child(2)::before { content: 'Categoría'; }
  #animals td:nth-child(3)::before { content: 'Lote actual'; }
  #animals td:nth-child(4)::before { content: 'Edad'; }
  #animals td:nth-child(5)::before { content: 'Peso'; }
  #animals td:nth-child(n+2):nth-child(-n+5)::before { display: block; margin-bottom: 3px; font-size: .6875rem; line-height: 1.4; color: var(--muted); font-weight: 400; }
  #animals td[colspan] { grid-column: 1 / -1; }
  #animals tbody tr:has(td[colspan]) { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  #animals { padding: 18px 16px 32px; }
  #animals .section-head { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 18px; }
  #animals .section-head > div:first-child { flex: initial; width: 100%; margin: 0 0 12px; }
  #animals .section-head > .primary { order: 1; }
  #animals .section-head > .section-import-btn { order: 2; display: none; }
  #animals .section-head > button { flex: initial; width: 100%; min-height: 44px; padding: 11px 16px; font-size: .875rem; }
  #animals .toolbar { flex-direction: column; gap: 10px; margin-bottom: 18px; }
  #animals .toolbar > button { width: 100%; }
  #animals .animal-status-menu { width: 100%; }
  #animals tbody { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}

/* Operador en tablet táctil: reutilizar las seis celdas como tarjetas.
   El puntero principal evita convertir la tabla de un PC con ratón.
   Las filas originales y sus índices/eventos no se reconstruyen ni reordenan. */
@media (min-width: 901px) and (max-width: 1600px) and (pointer: coarse) {
  body[data-field-role="operator"] #animals .table-wrap { overflow: visible; border: 0; border-radius: 0; background: transparent; }
  body[data-field-role="operator"] #animals table { display: block; min-width: 0; }
  body[data-field-role="operator"] #animals thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  body[data-field-role="operator"] #animals tbody { display: grid; }
  body[data-field-role="operator"] #animals tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid var(--line); border-radius: 14px; background: #fff; min-width: 0; align-content: start; }
  body[data-field-role="operator"] #animals td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; font-size: .875rem; }
  body[data-field-role="operator"] #animals td:first-child { grid-column: 1; grid-row: 1; }
  body[data-field-role="operator"] #animals td:last-child:not([colspan]) { grid-column: 2; grid-row: 1; text-align: right; }
  body[data-field-role="operator"] #animals td:nth-child(2),
  body[data-field-role="operator"] #animals td:nth-child(3) { border-top: 1px solid var(--line); }
  body[data-field-role="operator"] #animals td:nth-child(2)::before { content: 'Categoría'; }
  body[data-field-role="operator"] #animals td:nth-child(3)::before { content: 'Lote actual'; }
  body[data-field-role="operator"] #animals td:nth-child(4)::before { content: 'Edad'; }
  body[data-field-role="operator"] #animals td:nth-child(5)::before { content: 'Peso'; }
  body[data-field-role="operator"] #animals td:nth-child(n+2):nth-child(-n+5)::before { display: block; margin-bottom: 3px; font-size: .6875rem; line-height: 1.4; color: var(--muted); font-weight: 400; }
  body[data-field-role="operator"] #animals td[colspan] { grid-column: 1 / -1; }
  body[data-field-role="operator"] #animals tbody tr:has(td[colspan]) { grid-column: 1 / -1; }
}
@media (min-width: 721px) and (max-width: 1600px) and (pointer: coarse) {
  body[data-field-role="operator"] #animals .table-wrap { container: animal-cards / inline-size; }
  body[data-field-role="operator"] #animals tbody { grid-template-columns: minmax(0,1fr); gap: 14px; }
  body[data-field-role="operator"] #animals tbody tr { padding: 14px; gap: 10px 14px; }
  body[data-field-role="operator"] #animals td:nth-child(2),
  body[data-field-role="operator"] #animals td:nth-child(3) { padding-top: 10px; }
  body[data-field-role="operator"] #animals .section-head p { font-size: .94rem; line-height: 1.5; font-weight: 400; letter-spacing: normal; }
}
/* Dos tarjetas solo en horizontal y con >=720px reales para la lista:
   mínimo aproximado de 353px por tarjeta, después del espacio entre ambas. */
@media (min-width: 721px) and (max-width: 1600px) and (pointer: coarse) and (orientation: landscape) {
  @container animal-cards (min-width: 720px) {
    body[data-field-role="operator"] #animals tbody { grid-template-columns: repeat(2,minmax(0,1fr)); }
  }
}

/* Créditos de Animales en flujo normal: nunca sobre la última ficha.
   El resto de módulos y el escritorio conservan su presentación existente. */
@media (max-width: 720px), (min-width: 721px) and (max-width: 1600px) and (pointer: coarse) {
  body.authenticated:has(#animals.active)::after {
    display: block; position: static; inset: auto; z-index: auto;
    width: auto; min-width: 0; margin: 0;
    padding: 12px 16px max(16px,env(safe-area-inset-bottom));
    line-height: 1.45; white-space: normal; overflow-wrap: anywhere;
  }
}
@media (min-width: 721px) and (max-width: 1180px) and (pointer: coarse) {
  body.authenticated:has(#animals.active)::after { margin-left: 70px; padding-inline: 20px; }
}
@media (min-width: 1181px) and (max-width: 1600px) and (pointer: coarse) {
  body.authenticated:has(#animals.active)::after { margin-left: 242px; padding-inline: 30px; }
}

/* PC: separación sutil solicitada entre animales, manteniendo una sola tabla
   nativa y las seis columnas compartidas con el encabezado. */
@media (min-width: 901px) and (pointer: fine), (min-width: 1601px) {
  #animals .table-wrap { border: 0; border-radius: 0; background: transparent; padding: 2px 14px 28px; margin: -2px -14px -28px; }
  #animals table { border-collapse: separate; border-spacing: 0 6px; }
  #animals th:first-child { border-radius: 10px 0 0 10px; }
  #animals th:last-child { border-radius: 0 10px 10px 0; }
  :is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr > td {
    background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  }
  :is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr > td:first-child { border-left: 1px solid var(--line); border-radius: 10px 0 0 10px; }
  :is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr > td:last-child { border-right: 1px solid var(--line); border-radius: 0 10px 10px 0; }
  :is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr > td[colspan] { border-radius: 10px; }
  :is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr { border-radius: 10px; }
  :is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr:hover > td,
  :is(#animals #animals-body, #reproduction-females-body, #reproduction-bull-exposures-body) > tr:focus-visible > td { border-color: #cbd7ce; }
}


/* Tablet: separate the native animal rows as on PC. Operator cards retain
   their existing grid; portrait cards only tighten the space between them. */
@media (min-width: 901px) and (max-width: 1600px) and (pointer: coarse) {
  body:not([data-field-role="operator"]) #animals .table-wrap { border: 0; border-radius: 0; background: transparent; padding: 2px 14px 28px; margin: -2px -14px -28px; }
  body:not([data-field-role="operator"]) #animals table { border-collapse: separate; border-spacing: 0 6px; }
  body:not([data-field-role="operator"]) #animals th:first-child { border-radius: 10px 0 0 10px; }
  body:not([data-field-role="operator"]) #animals th:last-child { border-radius: 0 10px 10px 0; }
  body:not([data-field-role="operator"]) #animals #animals-body > tr > td { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  body:not([data-field-role="operator"]) #animals #animals-body > tr > td:first-child { border-left: 1px solid var(--line); border-radius: 10px 0 0 10px; }
  body:not([data-field-role="operator"]) #animals #animals-body > tr > td:last-child { border-right: 1px solid var(--line); border-radius: 0 10px 10px 0; }
  body:not([data-field-role="operator"]) #animals #animals-body > tr > td[colspan] { border-radius: 10px; }
  body:not([data-field-role="operator"]) #animals #animals-body > tr:not(:has(td[colspan])) { border-radius: 10px; box-shadow: 0 3px 10px rgba(23,63,50,.05); }
}
@media (min-width: 721px) and (max-width: 900px) and (pointer: coarse) {
  #animals #animals-body { gap: 12px; }
}

/* Hembras uses the approved animal row style while retaining all seven fields. */
#reproduction :is([data-reproduction-panel="females"], [data-reproduction-panel="bulls"]) .reproduction-females-table-panel {
  padding: 0; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
#reproduction :is([data-reproduction-panel="females"], [data-reproduction-panel="bulls"]) .table-wrap {
  border: 0; border-radius: 0; background: transparent; padding: 2px 14px 28px; margin: -2px -14px -28px;
}
#reproduction :is([data-reproduction-panel="females"], [data-reproduction-panel="bulls"]) .reproduction-females-table { border-collapse: separate; border-spacing: 0 6px; }
#reproduction :is([data-reproduction-panel="females"], [data-reproduction-panel="bulls"]) .reproduction-females-table th {
  padding: 12px 18px; text-transform: none; letter-spacing: 0; font-size: .8125rem; font-weight: 650; line-height: 1.3;
}
#reproduction :is([data-reproduction-panel="females"], [data-reproduction-panel="bulls"]) .reproduction-females-table th:first-child { border-radius: 10px 0 0 10px; }
#reproduction :is([data-reproduction-panel="females"], [data-reproduction-panel="bulls"]) .reproduction-females-table th:last-child { border-radius: 0 10px 10px 0; }
:is(#reproduction-females-body, #reproduction-bull-exposures-body) > tr { background: #fff; border-radius: 10px; }
:is(#reproduction-females-body, #reproduction-bull-exposures-body) > tr > td {
  padding: 10px 18px; font-size: .875rem; vertical-align: middle; background: #fff;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
:is(#reproduction-females-body, #reproduction-bull-exposures-body) > tr > td:nth-child(n+2):not([colspan]) { font-weight: 600; line-height: 1.3; }
:is(#reproduction-females-body, #reproduction-bull-exposures-body) > tr > td:first-child { border-left: 1px solid var(--line); border-radius: 10px 0 0 10px; }
:is(#reproduction-females-body, #reproduction-bull-exposures-body) > tr > td:last-child { border-right: 1px solid var(--line); border-radius: 0 10px 10px 0; }
:is(#reproduction-females-body, #reproduction-bull-exposures-body) > tr > td[colspan] { border-radius: 10px; }
:is(#reproduction-females-body, #reproduction-bull-exposures-body) > tr:hover,
:is(#reproduction-females-body, #reproduction-bull-exposures-body) > tr:focus-visible,
:is(#reproduction-females-body, #reproduction-bull-exposures-body) > tr:focus { background: #fff; outline: none; }
:is(#reproduction-females-body, #reproduction-bull-exposures-body) > tr:hover > td,
:is(#reproduction-females-body, #reproduction-bull-exposures-body) > tr:focus-visible > td { border-color: #cbd7ce; }
:is(#reproduction-females-body, #reproduction-bull-exposures-body) > tr[hidden] { display: none !important; }
#reproduction [data-reproduction-panel="females"] .reproduction-females-toolbar { gap: 12px; margin-bottom: 18px; }
#reproduction-females-search { flex: 1 1 390px; width: auto; min-width: 0; min-height: 44px; font-size: .875rem; }
/* The same responsive card layout as Animales, with reproductive state at top right. */
@media (max-width: 900px) {
  #reproduction [data-reproduction-panel="females"] .table-wrap { overflow: visible; padding: 0; margin: 0; }
  #reproduction [data-reproduction-panel="females"] .reproduction-females-table { display: block; min-width: 0; }
  #reproduction [data-reproduction-panel="females"] .reproduction-females-table thead {
    position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  #reproduction-females-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  #reproduction-females-body > tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px;
    padding: 16px; border: 1px solid var(--line); border-radius: 14px; min-width: 0; align-content: start;
  }
  #reproduction-females-body > tr > td { display: block; padding: 0; border: 0; border-radius: 0; min-width: 0; overflow-wrap: anywhere; }
  #reproduction-females-body > tr > td:first-child,
  #reproduction-females-body > tr > td:last-child { border-inline: 0; border-radius: 0; }
  #reproduction-females-body > tr > td:first-child { grid-column: 1; grid-row: 1; }
  #reproduction-females-body > tr > td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
  #reproduction-females-body > tr > td:nth-child(2),
  #reproduction-females-body > tr > td:nth-child(3) { border-top: 1px solid var(--line); padding-top: 12px; }
  #reproduction-females-body > tr > td:nth-child(2)::before { content: 'Categoría'; }
  #reproduction-females-body > tr > td:nth-child(3)::before { content: 'Lote actual'; }
  #reproduction-females-body > tr > td:nth-child(5)::before { content: 'Último evento'; }
  #reproduction-females-body > tr > td:nth-child(6)::before { content: 'Próxima acción'; }
  #reproduction-females-body > tr > td:nth-child(7)::before { content: 'Días abiertos'; }
  #reproduction-females-body > tr > td:nth-child(n+2):not(:nth-child(4))::before {
    display: block; margin-bottom: 3px; font-size: .6875rem; line-height: 1.4; color: var(--muted); font-weight: 400;
  }
  #reproduction-females-body > tr > .reproduction-days-open { grid-column: 1 / -1; text-align: left; }
  #reproduction-females-body > tr > td[colspan] { grid-column: 1 / -1; }
  #reproduction-females-body > tr:has(td[colspan]) { grid-column: 1 / -1; }
  #reproduction-females-search { flex: initial; width: 100%; }
}
@media (min-width: 901px) and (max-width: 1600px) and (pointer: coarse) {
  body[data-field-role="operator"] #reproduction [data-reproduction-panel="females"] .table-wrap { overflow: visible; padding: 0; margin: 0; }
  body[data-field-role="operator"] #reproduction [data-reproduction-panel="females"] .reproduction-females-table { display: block; min-width: 0; }
  body[data-field-role="operator"] #reproduction [data-reproduction-panel="females"] .reproduction-females-table thead {
    position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  body[data-field-role="operator"] #reproduction-females-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  body[data-field-role="operator"] #reproduction-females-body > tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px;
    padding: 16px; border: 1px solid var(--line); border-radius: 14px; min-width: 0; align-content: start;
  }
  body[data-field-role="operator"] #reproduction-females-body > tr > td { display: block; padding: 0; border: 0; border-radius: 0; min-width: 0; overflow-wrap: anywhere; }
  body[data-field-role="operator"] #reproduction-females-body > tr > td:first-child,
  body[data-field-role="operator"] #reproduction-females-body > tr > td:last-child { border-inline: 0; border-radius: 0; }
  body[data-field-role="operator"] #reproduction-females-body > tr > td:first-child { grid-column: 1; grid-row: 1; }
  body[data-field-role="operator"] #reproduction-females-body > tr > td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
  body[data-field-role="operator"] #reproduction-females-body > tr > td:nth-child(2),
  body[data-field-role="operator"] #reproduction-females-body > tr > td:nth-child(3) { border-top: 1px solid var(--line); padding-top: 12px; }
  body[data-field-role="operator"] #reproduction-females-body > tr > td:nth-child(2)::before { content: 'Categoría'; }
  body[data-field-role="operator"] #reproduction-females-body > tr > td:nth-child(3)::before { content: 'Lote actual'; }
  body[data-field-role="operator"] #reproduction-females-body > tr > td:nth-child(5)::before { content: 'Último evento'; }
  body[data-field-role="operator"] #reproduction-females-body > tr > td:nth-child(6)::before { content: 'Próxima acción'; }
  body[data-field-role="operator"] #reproduction-females-body > tr > td:nth-child(7)::before { content: 'Días abiertos'; }
  body[data-field-role="operator"] #reproduction-females-body > tr > td:nth-child(n+2):not(:nth-child(4))::before {
    display: block; margin-bottom: 3px; font-size: .6875rem; line-height: 1.4; color: var(--muted); font-weight: 400;
  }
  body[data-field-role="operator"] #reproduction-females-body > tr > .reproduction-days-open { grid-column: 1 / -1; text-align: left; }
  body[data-field-role="operator"] #reproduction-females-body > tr > td[colspan] { grid-column: 1 / -1; }
  body[data-field-role="operator"] #reproduction-females-body > tr:has(td[colspan]) { grid-column: 1 / -1; }
  body[data-field-role="operator"] #reproduction-females-search { flex: initial; width: 100%; }
}

@media (max-width: 720px) {
  #reproduction-females-body { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}

/* Exposición de toros: six original cells become labeled cards on tablets and phones. */
@media (max-width: 900px) {
  #reproduction [data-reproduction-panel="bulls"] .table-wrap { overflow: visible; padding: 0; margin: 0; }
  #reproduction [data-reproduction-panel="bulls"] .reproduction-females-table { display: block; min-width: 0; }
  #reproduction [data-reproduction-panel="bulls"] thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #reproduction-bull-exposures-body { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
  #reproduction-bull-exposures-body > tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 16px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; min-width: 0; background: #fff; }
  #reproduction-bull-exposures-body > tr > td { display: block; min-width: 0; padding: 0; border: 0; border-radius: 0; overflow-wrap: anywhere; }
  #reproduction-bull-exposures-body > tr > td:first-child, #reproduction-bull-exposures-body > tr > td:last-child { border-inline: 0; border-radius: 0; }
  #reproduction-bull-exposures-body > tr > td:first-child { grid-column: 1; grid-row: 1; }
  #reproduction-bull-exposures-body > tr > td:nth-child(5) { grid-column: 2; grid-row: 1; text-align: right; }
  #reproduction-bull-exposures-body > tr > td:nth-child(2) { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px; }
  #reproduction-bull-exposures-body > tr > td:nth-child(2)::before { content: 'Lote'; }
  #reproduction-bull-exposures-body > tr > td:nth-child(3)::before { content: 'Desde'; }
  #reproduction-bull-exposures-body > tr > td:nth-child(4)::before { content: 'Hasta'; }
  #reproduction-bull-exposures-body > tr > td:nth-child(n+2):nth-child(-n+4)::before { display: block; margin-bottom: 3px; font-size: .6875rem; color: var(--muted); font-weight: 400; }
  #reproduction-bull-exposures-body > tr > td:last-child { grid-column: 1 / -1; text-align: right; }
  #reproduction-bull-exposures-body > tr:has(td[colspan]), #reproduction-bull-exposures-body > tr > td[colspan] { grid-column: 1 / -1; }
}
@media (min-width: 901px) and (max-width: 1600px) and (pointer: coarse) {
  body[data-field-role="operator"] #reproduction [data-reproduction-panel="bulls"] .table-wrap { overflow: visible; padding: 0; margin: 0; }
  body[data-field-role="operator"] #reproduction [data-reproduction-panel="bulls"] .reproduction-females-table { display: block; min-width: 0; }
  body[data-field-role="operator"] #reproduction [data-reproduction-panel="bulls"] thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  body[data-field-role="operator"] #reproduction-bull-exposures-body { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
  body[data-field-role="operator"] #reproduction-bull-exposures-body > tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 16px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; min-width: 0; background: #fff; }
  body[data-field-role="operator"] #reproduction-bull-exposures-body > tr > td { display: block; min-width: 0; padding: 0; border: 0; border-radius: 0; overflow-wrap: anywhere; }
  body[data-field-role="operator"] #reproduction-bull-exposures-body > tr > td:first-child, body[data-field-role="operator"] #reproduction-bull-exposures-body > tr > td:last-child { border-inline: 0; border-radius: 0; }
  body[data-field-role="operator"] #reproduction-bull-exposures-body > tr > td:first-child { grid-column: 1; grid-row: 1; }
  body[data-field-role="operator"] #reproduction-bull-exposures-body > tr > td:nth-child(5) { grid-column: 2; grid-row: 1; text-align: right; }
  body[data-field-role="operator"] #reproduction-bull-exposures-body > tr > td:nth-child(2) { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px; }
  body[data-field-role="operator"] #reproduction-bull-exposures-body > tr > td:nth-child(2)::before { content: 'Lote'; }
  body[data-field-role="operator"] #reproduction-bull-exposures-body > tr > td:nth-child(3)::before { content: 'Desde'; }
  body[data-field-role="operator"] #reproduction-bull-exposures-body > tr > td:nth-child(4)::before { content: 'Hasta'; }
  body[data-field-role="operator"] #reproduction-bull-exposures-body > tr > td:nth-child(n+2):nth-child(-n+4)::before { display: block; margin-bottom: 3px; font-size: .6875rem; color: var(--muted); font-weight: 400; }
  body[data-field-role="operator"] #reproduction-bull-exposures-body > tr > td:last-child { grid-column: 1 / -1; text-align: right; }
  body[data-field-role="operator"] #reproduction-bull-exposures-body > tr:has(td[colspan]), body[data-field-role="operator"] #reproduction-bull-exposures-body > tr > td[colspan] { grid-column: 1 / -1; }
}
@media (max-width: 720px) { #reproduction-bull-exposures-body { grid-template-columns: minmax(0,1fr); gap: 14px; } }
