/* -------------------------------------------------------------------------
   GestFel CSS · 30-mobile-modules.css
   Listados responsive de módulos, tareas, dashboard personalizable, visor de fotos, informes y formularios móviles.
   Orden de carga: respetar la numeración de los ficheros para conservar
   la cascada original y evitar regresiones visuales.
   ------------------------------------------------------------------------- */

@layer modules {

/* Listados responsive en adopciones y casas de acogida */
.listing-card {
  overflow: hidden;
}
.listing-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.listing-head h2 {
  margin: 0 0 0.25rem;
  text-align: left;
}
.listing-head p {
  margin: 0;
}
.adoptions-table,
.foster-table,
.foster-cats-table,
.adoption-followups-table {
  min-width: 860px;
}
.adoptions-table td,
.foster-table td,
.foster-cats-table td,
.adoption-followups-table td {
  vertical-align: middle;
}
.adoptions-table td:nth-child(2),
.adoptions-table td:nth-child(3),
.foster-table td:first-child,
.adoption-followups-table td[data-label="Notas"] {
  min-width: 12rem;
}
.adoptions-table .actions,
.foster-table .actions,
.foster-cats-table .actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  white-space: nowrap;
}
.adoptions-table .actions .btn,
.foster-table .actions .btn,
.foster-cats-table .actions .btn {
  padding: 0.45rem 0.7rem;
  min-height: 36px;
}
@media (max-width: 720px) {
  .listing-head {
    display: grid;
  }
  .adoptions-table,
  .foster-table,
  .foster-cats-table,
  .adoption-followups-table {
    min-width: 0;
  }
  .adoptions-table td:nth-child(2),
  .adoptions-table td:nth-child(3),
  .foster-table td:first-child,
  .adoption-followups-table td[data-label="Notas"] {
    min-width: 0;
  }
  .responsive-list-table tr:not(:first-child) {
    box-shadow: 0 12px 30px rgba(15, 36, 55, 0.06);
  }
  .responsive-list-table td {
    grid-template-columns: minmax(105px, 0.38fr) minmax(0, 1fr);
  }
  .responsive-list-table td[data-label="Foto"] {
    grid-template-columns: 1fr;
  }
  .responsive-list-table td[data-label="Foto"]::before {
    display: none;
  }
  .responsive-list-table td[data-label="Gato"],
  .responsive-list-table td[data-label="Casa"],
  .responsive-list-table td[data-label="Adoptante"],
  .responsive-list-table td[data-label="Notas"] {
    align-items: start;
  }
  .responsive-list-table .actions,
  .adoptions-table .actions,
  .foster-table .actions,
  .foster-cats-table .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .responsive-list-table .actions .btn,
  .adoptions-table .actions .btn,
  .foster-table .actions .btn,
  .foster-cats-table .actions .btn {
    flex: 1 1 130px;
    min-height: 42px;
  }
}

/* Tareas sanitarias y adjuntos veterinarios */
.task-alert-panel {
  background: linear-gradient(135deg, rgba(var(--brand-soft-rgb, 230, 244, 241), 0.76), rgba(255, 255, 255, 0.98));
  border: 1px solid color-mix(in srgb, var(--teal) 24%, var(--line));
  border-radius: 22px;
  box-shadow: 0 14px 36px rgba(15, 36, 55, 0.08);
  padding: 1rem;
  margin-bottom: 1rem;
}
.task-alert-list {
  display: grid;
  gap: 0.65rem;
}
.task-alert-item {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 0.75rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--teal) 12%, var(--line));
  border-left: 5px solid color-mix(in srgb, var(--teal) 55%, #fff);
}
.task-alert-item.urgency--green {
  border-left-color: var(--teal);
  background: linear-gradient(90deg, color-mix(in srgb, var(--teal) 10%, #fff), rgba(255,255,255,.96));
}
.task-alert-item.urgency--yellow {
  border-left-color: var(--orange);
  background: linear-gradient(90deg, rgba(245, 158, 11, .14), rgba(255,255,255,.96));
}
.task-alert-item.urgency--red {
  border-left-color: var(--coral);
  background: linear-gradient(90deg, rgba(239, 111, 97, .16), rgba(255,255,255,.96));
  box-shadow: 0 10px 26px rgba(159, 18, 57, .08);
}
.task-alert-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}
.task-alert-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.urgency-badge {
  display: inline-block;
  width: fit-content;
  flex-shrink: 0;
  border: 1px solid transparent;
  font-size: 0.72rem;
  font-weight: 850;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.urgency-badge--green  { background: color-mix(in srgb, var(--teal) 13%, #fff); border-color: color-mix(in srgb, var(--teal) 26%, #fff); color: var(--teal); }
.urgency-badge--yellow { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.urgency-badge--red    { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.task-alert-item span {
  color: var(--muted);
  font-size: 0.92rem;
}
.task-alert-detail {
  color: #0b7d6d;
  font-style: normal;
  font-weight: 700;
  font-size: 0.94rem;
}
.task-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
  align-items: center;
}
.task-alert-actions .task-status-form {
  min-width: 0;
  grid-template-columns: minmax(10.5rem, 1.45fr) auto;
  align-items: center;
  gap: .42rem;
}
.task-status-form select {
  min-height: 42px;
  border: 1px solid color-mix(in srgb, var(--teal) 38%, var(--line));
  border-radius: 13px;
  background: #fff;
  color: var(--dark);
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72), 0 6px 16px rgba(15,36,55,.08);
}
.task-status-form .btn {
  min-height: 38px;
  padding: .48rem .72rem;
  border-color: color-mix(in srgb, var(--teal) 24%, var(--line));
  background: rgba(255,255,255,.72);
  color: color-mix(in srgb, var(--teal) 78%, var(--dark));
  font-size: .86rem;
  box-shadow: none;
}
.task-status-form .btn:hover,
.task-status-form .btn:focus-visible {
  background: color-mix(in srgb, var(--teal) 8%, #fff);
  border-color: color-mix(in srgb, var(--teal) 44%, var(--line));
}
.task-alert-item.priority--urgente {
  outline: 1px solid rgba(239, 111, 97, .22);
}
.task-alert-item.priority--alta:not(.urgency--red) {
  border-left-color: var(--orange);
}
.task-alert-item.priority--baja:not(.urgency--red):not(.urgency--yellow) {
  opacity: .92;
}
.task-alert-item.task-status--en_curso .task-status-form select {
  border-color: color-mix(in srgb, var(--teal) 48%, var(--line));
  background: color-mix(in srgb, var(--teal) 7%, #fff);
}
/* Tareas completadas o canceladas: gris neutro, sin colores de urgencia/prioridad */
.task-alert-item.task-status--completada,
.task-alert-item.task-status--cancelada {
  background: #f8fafc;
  border-left-color: #cbd5e1;
  border-color: #e2e8f0;
  box-shadow: none;
  opacity: .82;
}
.tasks-table {
  border-collapse: separate;
  border-spacing: 0 .48rem;
}
.tasks-table th {
  border-bottom: 1px solid color-mix(in srgb, var(--teal) 14%, var(--line));
}
.tasks-table td {
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid color-mix(in srgb, var(--teal) 10%, var(--line));
  border-top: 1px solid color-mix(in srgb, var(--teal) 10%, var(--line));
}
.tasks-table tr:not(:first-child) td:first-child {
  border-left: 5px solid color-mix(in srgb, var(--teal) 55%, #fff);
  border-radius: 16px 0 0 16px;
}
.tasks-table tr:not(:first-child) td:last-child {
  border-right: 1px solid color-mix(in srgb, var(--teal) 10%, var(--line));
  border-radius: 0 16px 16px 0;
}
.tasks-table tr.urgency--green td {
  background: color-mix(in srgb, var(--teal) 6%, #fff);
}
.tasks-table tr.urgency--green td:first-child {
  border-left-color: var(--teal);
}
.tasks-table tr.urgency--yellow td {
  background: #fffaf2;
}
.tasks-table tr.urgency--yellow td:first-child,
.tasks-table tr.priority--alta:not(.urgency--red) td:first-child {
  border-left-color: var(--orange);
}
.tasks-table tr.urgency--red td {
  background: #fff4f3;
  border-top-color: rgba(239, 111, 97, .22);
  border-bottom-color: rgba(239, 111, 97, .22);
}
.tasks-table tr.urgency--red td:first-child,
.tasks-table tr.priority--urgente td:first-child {
  border-left-color: var(--coral);
}
.tasks-table tr.priority--urgente td {
  box-shadow: inset 0 1px 0 rgba(239, 111, 97, .12), inset 0 -1px 0 rgba(239, 111, 97, .12);
}
.tasks-table tr.priority--baja:not(.urgency--red):not(.urgency--yellow) td {
  color: color-mix(in srgb, var(--dark) 82%, var(--muted));
}
.tasks-table td:first-child strong {
  color: var(--dark);
}
.tasks-table td:first-child a {
  color: var(--teal);
  font-weight: 800;
}
/* Tareas completadas o canceladas en tabla: gris neutro */
.tasks-table tr.task-status--completada td,
.tasks-table tr.task-status--cancelada td {
  background: #f8fafc;
  border-top-color: #e2e8f0;
  border-bottom-color: #e2e8f0;
  box-shadow: none;
  color: color-mix(in srgb, var(--dark) 60%, var(--muted));
  opacity: .82;
}
.tasks-table tr.task-status--completada td:first-child,
.tasks-table tr.task-status--cancelada td:first-child {
  border-left-color: #cbd5e1;
}
/* Filas de tareas más compactas: menos relleno y columnas más estrechas */
.tasks-table {
  border-spacing: 0 .3rem;
}
.tasks-table th,
.tasks-table td {
  padding: .5rem .65rem;
}
.tasks-table th:not(.actions),
.tasks-table td:not(.actions) {
  min-width: 6rem;
}
.tasks-table th:first-child,
.tasks-table td:first-child {
  min-width: 9rem;
}
.tasks-table small {
  font-size: .78rem;
}
/* Acciones de la fila en una sola línea compacta en vez de bloques apilados */
.tasks-table td.task-actions-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  min-width: 9rem;
}
.tasks-table td.task-actions-cell form {
  display: contents;
}
.tasks-table td.task-actions-cell .task-status-form {
  display: contents;
}
.tasks-table td.task-actions-cell .task-status-form select {
  width: auto;
  min-width: 0;
  padding: .32rem .5rem;
  font-size: .82rem;
}
.tasks-table td.task-actions-cell .btn {
  padding: .32rem .6rem;
  font-size: .8rem;
}

/* Reportes e incidencias — mismo patrón visual que la tabla de tareas */
.status-reports-table {
  border-collapse: separate;
  border-spacing: 0 .48rem;
}
.status-reports-table tr[data-incident-row] td {
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid color-mix(in srgb, var(--teal) 10%, var(--line));
  border-top: 1px solid color-mix(in srgb, var(--teal) 10%, var(--line));
}
.status-reports-table tr[data-incident-row] td:first-child {
  border-left: 5px solid color-mix(in srgb, var(--teal) 55%, #fff);
  border-radius: 16px 0 0 16px;
}
.status-reports-table tr[data-incident-row] td:last-child {
  border-right: 1px solid color-mix(in srgb, var(--teal) 10%, var(--line));
  border-radius: 0 16px 16px 0;
}
/* Prioridad urgente */
.status-reports-table tr.priority--urgente td {
  background: #fff4f3;
  border-top-color: rgba(239,111,97,.22);
  border-bottom-color: rgba(239,111,97,.22);
}
.status-reports-table tr.priority--urgente td:first-child {
  border-left-color: var(--coral);
}
/* Prioridad alta */
.status-reports-table tr.priority--alta td {
  background: #fffaf2;
}
.status-reports-table tr.priority--alta td:first-child {
  border-left-color: var(--orange);
}
/* Prioridad media */
.status-reports-table tr.priority--media td {
  background: color-mix(in srgb, var(--teal) 6%, #fff);
}
.status-reports-table tr.priority--media td:first-child {
  border-left-color: var(--teal);
}
/* Cerrados/resueltos/rechazados — gris, igual que tareas completadas */
.status-reports-table tr.report-status--resuelto td,
.status-reports-table tr.report-status--cerrado td,
.status-reports-table tr.report-status--rechazado td {
  background: #e8ecf0;
  border-top-color: #d0d7e0;
  border-bottom-color: #d0d7e0;
  box-shadow: none;
  color: color-mix(in srgb, var(--dark) 45%, var(--muted));
}
.status-reports-table tr.report-status--resuelto td:first-child,
.status-reports-table tr.report-status--cerrado td:first-child,
.status-reports-table tr.report-status--rechazado td:first-child {
  border-left-color: #a0adb8;
}
.status-reports-table tr.report-status--resuelto .report-pill,
.status-reports-table tr.report-status--cerrado .report-pill,
.status-reports-table tr.report-status--rechazado .report-pill {
  filter: saturate(0.2) brightness(0.85);
}
.task-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .22rem .58rem;
  font-size: .82rem;
  font-weight: 850;
  line-height: 1.15;
  white-space: nowrap;
}
.task-chip--priority-baja {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}
.task-chip--priority-media {
  background: color-mix(in srgb, var(--teal) 10%, #fff);
  border-color: color-mix(in srgb, var(--teal) 24%, #fff);
  color: var(--teal);
}
.task-chip--priority-alta {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}
.task-chip--priority-urgente {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}
.task-chip--urgency.urgency--green {
  background: color-mix(in srgb, var(--teal) 13%, #fff);
  border-color: color-mix(in srgb, var(--teal) 26%, #fff);
  color: var(--teal);
}
.task-chip--urgency.urgency--yellow {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}
.task-chip--urgency.urgency--red {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}
.task-chip--status-pendiente {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}
.task-chip--status-en_curso {
  background: color-mix(in srgb, var(--teal) 13%, #fff);
  border-color: color-mix(in srgb, var(--teal) 26%, #fff);
  color: var(--teal);
}
.task-chip--status-completada {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}
.task-chip--status-cancelada {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}
.task-date {
  display: block;
  margin-top: .32rem;
  color: var(--muted);
  font-weight: 750;
}
.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}
.attachment-list a {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(15, 36, 55, 0.14);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: rgba(255,255,255,0.82);
  font-size: 0.9rem;
  text-decoration: none;
}
.vet-attachments-inline {
  margin-top: 0.65rem;
}
@media (max-width: 720px) {
  .task-alert-item {
    grid-template-columns: 1fr;
  }
  .task-alert-actions {
    justify-content: stretch;
  }
  .task-alert-actions .task-status-form {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

/* Dashboard personalizable */
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  justify-content: flex-end;
  align-items: center;
}
.dashboard-fixed-panel {
  margin-bottom: 1rem;
}
.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .75rem 1rem;
  border: 1px solid rgba(16, 185, 129, .18);
  border-radius: 18px;
  background: rgba(236, 253, 245, .82);
  color: #315348;
  margin: 1rem 0;
}
.dashboard-custom-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.dashboard-widget {
  grid-column: span var(--widget-span, 6);
  min-height: 190px;
  max-height: none;
  overflow: auto;
  transition: box-shadow .18s ease, transform .18s ease, opacity .18s ease, outline-color .18s ease;
}
.dashboard-custom-grid.is-editing .dashboard-widget {
  resize: vertical;
  outline: 1px dashed rgba(11, 125, 109, .18);
  outline-offset: 4px;
}
.dashboard-custom-grid.is-editing .dashboard-widget:hover {
  box-shadow: 0 16px 36px rgba(15, 36, 55, .12);
}
.dashboard-widget[data-size="4"] { --widget-span: 4; }
.dashboard-widget[data-size="6"] { --widget-span: 6; }
.dashboard-widget[data-size="8"] { --widget-span: 8; }
.dashboard-widget[data-size="12"] { --widget-span: 12; }
.dashboard-widget.is-dragging {
  opacity: .45;
  transform: scale(.99);
}
.dashboard-widget.is-drop-target {
  outline: 2px dashed rgba(11, 125, 109, .45);
  outline-offset: 4px;
}
.dashboard-widget-titlebar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}
.dashboard-widget-titlebar h2 {
  margin: 0;
}
.dashboard-drag-handle,
.dashboard-size-controls,
.dashboard-move-controls,
.dashboard-edit-action {
  display: none;
}
.dashboard-custom-grid.is-editing .dashboard-drag-handle,
.dashboard-custom-grid.is-editing .dashboard-size-controls,
.dashboard-custom-grid.is-editing .dashboard-move-controls,
body.dashboard-editing .dashboard-edit-action {
  display: inline-flex;
}
.dashboard-custom-grid.is-editing .dashboard-widget-titlebar {
  cursor: grab;
}
.dashboard-custom-grid.is-editing .dashboard-widget-titlebar:active {
  cursor: grabbing;
}
.dashboard-drag-handle {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(11, 125, 109, .20);
  border-radius: 12px;
  background: #f3fbf8;
  color: #0b7d6d;
  cursor: grab;
  user-select: none;
  font-weight: 800;
  line-height: 1;
}
.dashboard-drag-handle:active {
  cursor: grabbing;
}
.dashboard-size-controls,
.dashboard-move-controls {
  flex: 0 0 auto;
  gap: .25rem;
  padding: .2rem;
  border-radius: 999px;
  background: #f6faf8;
  border: 1px solid rgba(15, 23, 42, .08);
}
.dashboard-widget-tools {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .35rem;
  margin-left: auto;
}
.dashboard-size-controls button,
.dashboard-move-controls button {
  border: 0;
  background: transparent;
  color: #315348;
  border-radius: 999px;
  padding: .28rem .48rem;
  font-weight: 700;
  cursor: pointer;
  font-size: .78rem;
}
.dashboard-size-controls button:hover,
.dashboard-size-controls button.is-active,
.dashboard-move-controls button:hover {
  background: #0b7d6d;
  color: #fff;
}
#dashboard-edit-toggle.is-active {
  background: #0b7d6d;
  color: #fff;
  border-color: #0b7d6d;
}
.dashboard-widget .widget-head {
  margin: 0;
  width: 100%;
}
@media (max-width: 1100px) {
  .dashboard-widget[data-size="4"],
  .dashboard-widget[data-size="6"],
  .dashboard-widget[data-size="8"] { --widget-span: 6; }
}
@media (max-width: 760px) {
  .page-actions { justify-content: stretch; }
  .page-actions .btn { flex: 1 1 auto; }
  .dashboard-custom-grid { grid-template-columns: 1fr; }
  .dashboard-widget,
  .dashboard-widget[data-size="4"],
  .dashboard-widget[data-size="6"],
  .dashboard-widget[data-size="8"],
  .dashboard-widget[data-size="12"] { grid-column: 1 / -1; }
  .dashboard-widget-titlebar { flex-wrap: wrap; }
  .dashboard-widget-tools { width: 100%; justify-content: flex-start; padding-left: 40px; }
}

/* Visor modal de fotos */
.photo-modal-trigger {
  cursor: zoom-in;
}
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2rem);
}
.photo-lightbox.is-open {
  display: flex;
}
.photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 22, 36, .78);
  backdrop-filter: blur(4px);
}
.photo-lightbox-dialog {
  position: relative;
  max-width: min(1100px, 96vw);
  max-height: 92vh;
  display: grid;
  gap: .75rem;
  justify-items: center;
}
.photo-lightbox-image {
  max-width: 100%;
  max-height: calc(92vh - 70px);
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.32);
  background: #fff;
}
.photo-lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #0f2437;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(0,0,0,.2);
}
.photo-lightbox-caption {
  margin: 0;
  max-width: min(860px, 92vw);
  color: #fff;
  text-align: center;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}
body.modal-open {
  overflow: hidden;
}
.conditional-field[hidden] {
  display: none;
}
.vet-vaccine-review {
  display: grid;
  gap: .45rem;
  padding: .85rem .95rem;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
  font-size: .93rem;
}
.vet-vaccine-review[hidden] {
  display: none;
}
.vet-vaccine-review strong {
  color: #7c2d12;
}
.vet-vaccine-review ul {
  margin: 0;
  padding-left: 1.1rem;
}
.vet-vaccine-review li + li {
  margin-top: .25rem;
}

/* Informes: sistema de personalización del dashboard */
.reports-dashboard-grid {
  margin-top: 1rem;
}
.dashboard-widget-heading {
  min-width: 0;
}
.dashboard-widget-heading h2 {
  margin: 0.1rem 0 0.2rem;
  text-align: left;
  font-size: 1.35rem;
}
.dashboard-widget-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}
.reports-dashboard-grid .report-widget {
  min-width: 0;
}
.reports-dashboard-grid .feeding-badge,
.reports-dashboard-grid .badge {
  flex: 0 0 auto;
}
.reports-dashboard-grid .report-chart {
  width: 100%;
}

/* Informe: barras HTML responsivas para gráfico de gatos por colonia */
.report-bars {
  display: grid;
  gap: .75rem;
  margin-top: .8rem;
}
.report-bars-head,
.report-bars-row {
  display: grid;
  grid-template-columns: minmax(150px, 230px) 1fr;
  gap: 1rem;
  align-items: stretch;
}
.report-bars-head {
  color: var(--muted);
  font-weight: 800;
  font-size: .86rem;
  padding: 0 .55rem;
}
.report-bars-row {
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: linear-gradient(180deg, #fff, #fbfefd);
  padding: .85rem;
  box-shadow: 0 8px 24px rgba(15, 36, 55, .035);
}
.report-bars-label {
  display: flex;
  align-items: center;
  min-width: 0;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.2;
}
.report-bars-values {
  display: grid;
  gap: .55rem;
  min-width: 0;
}
.report-bars-item {
  display: grid;
  grid-template-columns: minmax(135px, 190px) 1fr minmax(2.2rem, auto);
  gap: .65rem;
  align-items: center;
  min-width: 0;
}
.report-bars-name {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-weight: 800;
  font-size: .92rem;
  min-width: 0;
  white-space: nowrap;
}
.report-bars-name i {
  width: .72rem;
  height: .72rem;
  border-radius: .25rem;
  flex: 0 0 auto;
}
.report-bars-track {
  height: .78rem;
  border-radius: 999px;
  background: #edf5f3;
  overflow: hidden;
  min-width: 90px;
}
.report-bars-track span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
}
.report-bars-item strong {
  color: var(--ink);
  font-weight: 900;
  text-align: right;
}
@media (max-width: 820px) {
  .report-bars-head { display: none; }
  .report-bars-row { grid-template-columns: 1fr; gap: .7rem; }
  .report-bars-item { grid-template-columns: 1fr minmax(2rem, auto); }
  .report-bars-track { grid-column: 1 / -1; }
}


/* Tablas sanitarias: tarjetas en móvil para evitar columnas estrechas */
.health-events-table td,
.health-events-table th {
  word-break: normal;
  overflow-wrap: break-word;
}
.health-events-table td[data-label="Tratamiento"],
.health-events-table td[data-label="Centro"],
.health-events-table td[data-label="Ubicación"] {
  min-width: 10rem;
}
@media (max-width: 720px) {
  .health-events-wrap {
    overflow: visible;
  }
  .health-events-table.responsive-list-table {
    width: 100%;
    min-width: 0;
  }
  .health-events-table.responsive-list-table td {
    grid-template-columns: minmax(7.5rem, 42%) minmax(0, 1fr);
    word-break: normal;
    overflow-wrap: break-word;
  }
  .health-events-table.responsive-list-table td[data-label="Tratamiento"],
  .health-events-table.responsive-list-table td[data-label="Centro"],
  .health-events-table.responsive-list-table td[data-label="Ubicación"] {
    min-width: 0;
  }
  .health-events-table.responsive-list-table td[data-label="Tratamiento"] {
    align-items: start;
  }
  .health-events-table.responsive-list-table .badge {
    white-space: normal;
    text-align: center;
  }
}

/* Ocultación robusta de campos condicionales */
.is-hidden { display: none !important; }

/* Usabilidad en fichas de colonia y alta de gatos */
.form-field {
  display: grid;
  gap: 0.35rem;
}
.field-label {
  font-weight: 800;
  color: var(--ink);
}
.multi-check-list {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
}
.check-row:hover {
  background: #f4fbfa;
  border-color: var(--line);
}
.check-row input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--teal);
}
.inline-uploader summary.upload-summary {
  width: fit-content;
  margin-top: 0.85rem;
  list-style: none;
}
.inline-uploader summary.upload-summary::-webkit-details-marker {
  display: none;
}
.inline-uploader[open] summary.upload-summary {
  margin-bottom: 0.85rem;
}
.inline-uploader summary.upload-summary::before {
  content: "📷";
  font-size: 1rem;
}
.cat-location-grid > label {
  align-self: start;
  align-content: start;
}
.field-help-placeholder {
  visibility: hidden;
}
@media (max-width: 760px) {
  .multi-check-list {
    padding: 0.6rem;
  }
  .check-row {
    padding: 0.65rem;
  }

  input[type="file"] {
    width: 100%;
    height: 64px;
    min-height: 40px;
    border: 2px dashed var(--brand-primary);
    border-radius: 12px;
    background: color-mix(in srgb, var(--brand-primary) 6%, #fff);
    color: var(--brand-primary);
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
  }
  input[type="file"]::file-selector-button {
    height: 2.2rem;
    padding: 0 .9rem;
    border: 0;
    border-radius: 8px;
    background: var(--brand-primary);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    margin-right: .75rem;
    vertical-align: middle;
  }

  .inline-uploader summary.upload-summary {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .7rem 1rem;
    border: 2px dashed var(--brand-primary);
    border-radius: 12px;
    background: color-mix(in srgb, var(--brand-primary) 6%, #fff);
    color: var(--brand-primary);
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
  }
  .inline-uploader summary.upload-summary::before {
    font-size: 1.3rem;
  }
}


/* Ajustes visuales en colonias, alimentación y alta de gatos */
.feeding-kpi-grid {
  gap: 1rem;
  margin-top: 1.15rem;
  margin-bottom: 1.15rem;
}
.feeding-kpi-card {
  min-height: 112px;
  padding: 1.1rem 1.15rem;
  align-content: center;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fbfdfc);
}
.feeding-refill-card {
  display: grid;
  gap: 1rem;
  align-content: start;
}
.feeding-refill-card .chart {
  margin-top: 0.2rem;
}
.feeding-action {
  width: fit-content;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.25rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 133, 112, 0.16);
}
.cat-identity-grid {
  align-items: start;
}
.cat-identity-grid .form-field {
  align-content: start;
}
.cat-identity-grid input:not([type="file"]),
.cat-identity-grid select {
  min-height: 42px;
  height: 42px;
}
.cat-identity-grid .field-label {
  min-height: 1.35em;
  display: flex;
  align-items: center;
}
@media (max-width: 760px) {
  .feeding-action {
    width: 100%;
  }
  .feeding-kpi-grid {
    gap: 0.75rem;
  }
}

/* Formularios y paneles móviles */
.form-actions {
  margin-top: .5rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(15, 23, 42, .08);
  align-items: center;
}
.form-actions .button,
.form-actions .btn {
  min-height: 44px;
}
.dashboard-custom-grid.is-editing .dashboard-widget-titlebar {
  touch-action: none;
  user-select: none;
}
.dashboard-widget.is-touch-drag-ready {
  outline: 2px dashed rgba(11, 125, 109, .25);
  outline-offset: 4px;
}
@media (max-width: 720px) {
  .dashboard-widget-tools {
    width: 100%;
    justify-content: flex-start;
    padding-left: 0;
  }
  .dashboard-move-controls button,
  .dashboard-size-controls button {
    min-width: 36px;
    min-height: 36px;
  }
}


/* Reportes e incidencias unificados */
.report-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .22rem .58rem;
  font-size: .82rem;
  font-weight: 850;
  line-height: 1.15;
  white-space: nowrap;
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}
.report-pill.priority-urgente,
.report-pill.status-abierto { background: #fff1f2; color: #9f1239; border-color: #fecdd3; }
.report-pill.priority-alta,
.report-pill.status-en_revision { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.report-pill.priority-media,
.report-pill.status-en_curso { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.report-pill.priority-baja { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.report-pill.status-resuelto,
.report-pill.status-cerrado { background: color-mix(in srgb, var(--teal) 10%, #fff); color: var(--teal); border-color: color-mix(in srgb, var(--teal) 24%, #fff); }
.report-pill.status-rechazado { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.inline-report-form { display: grid; gap: .35rem; min-width: 150px; }
.inline-report-form select { min-width: 140px; }
.btn.compact { padding: .35rem .6rem; font-size: .85rem; }
.report-routine-fields[hidden],
.report-feeding-field[hidden],
[data-report-cat-field][hidden] { display: none; }
@media (max-width: 760px) {
  .inline-report-form { grid-template-columns: 1fr; }
  .responsive-table td[data-label]::before {
    content: attr(data-label) ': ';
    color: var(--text);
    font-weight: 700;
  }
}

/* Alineación de acciones en formularios móviles */
@media (max-width: 720px) {
  .form-actions {
    display: grid;
    grid-template-columns: minmax(0, min(100%, 18rem));
    justify-content: start;
    align-items: stretch;
    gap: .65rem;
  }

  .form-actions .button,
  .form-actions .btn,
  .form-actions button,
  .form-actions a.button,
  .form-actions a.btn {
    width: 100%;
    min-width: 0;
    max-width: 18rem;
    min-height: 46px;
    padding: .78rem 1.15rem;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
  }
}

@media (max-width: 420px) {
  .form-actions {
    grid-template-columns: minmax(0, min(100%, 17rem));
  }
  .form-actions .button,
  .form-actions .btn,
  .form-actions button,
  .form-actions a.button,
  .form-actions a.btn {
    flex: none;
    max-width: 17rem;
  }
}

/* Listados dominantes y formularios de alta bajo demanda */
.module-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: .75rem 0 1rem;
  flex-wrap: wrap;
}

.module-list-toolbar__text {
  color: var(--muted);
  font-weight: 700;
}

.module-add-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 46px;
  padding: .8rem 1.15rem;
  border-radius: 16px;
  font-weight: 900;
  text-decoration: none;
}

.module-add-toggle::before {
  content: '+';
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: rgba(255,255,255,.42);
  font-weight: 900;
  line-height: 1;
}

.grid.two.list-dominant-grid,
.grid.two.module-list-first {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.grid.two.list-dominant-grid > .module-list-panel,
.grid.two.module-list-first > .module-list-panel {
  min-width: 0;
  width: 100%;
}

.module-add-panel {
  width: min(100%, 58rem);
  justify-self: start;
  position: relative;
}

.module-add-panel.module-add-panel-collapsed {
  display: none;
}

.module-add-panel.module-add-panel-open {
  display: block;
  animation: modulePanelIn .18s ease-out;
}

@keyframes modulePanelIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.module-add-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .85rem;
}

.module-add-panel__head h2 {
  margin: 0;
}

.module-add-panel__close {
  flex: 0 0 auto;
}

.table-wrap {
  position: relative;
}

.table-wrap.is-scrollable {
  border-radius: 18px;
  outline: 1px solid rgba(13, 124, 109, .12);
}

.table-wrap.is-scrollable::after {
  content: 'Desliza para ver más →';
  position: sticky;
  right: .6rem;
  bottom: .6rem;
  float: right;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: .4rem .3rem .1rem auto;
  padding: .35rem .65rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,248,236,.96), rgba(255,242,223,.96));
  border: 1px solid rgba(244, 166, 42, .32);
  color: #7a5200;
  font-size: .82rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(18, 52, 63, .08);
  pointer-events: none;
}

.table-wrap.is-scrollable.has-reached-end::after {
  opacity: 0;
}

.card.module-list-panel h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 900px) {
  .grid.two.list-dominant-grid .table-wrap,
  .grid.two.module-list-first .table-wrap {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .module-list-toolbar {
    align-items: stretch;
  }
  .module-list-toolbar .btn,
  .module-add-toggle {
    width: 100%;
  }
  .module-list-toolbar__text {
    font-size: .94rem;
  }
  .module-add-panel {
    width: 100%;
  }
  .module-add-panel__head {
    align-items: flex-start;
  }
}
} /* end @layer modules */
