/* DonaTrack — sistema de estilos (tokens + componentes) */
:root {
  --c-primary: oklch(45% 0.18 25); /* #a4161a UTN.BA */
  --c-primary-dark: oklch(36% 0.16 25);
  --c-primary-soft: oklch(96.5% 0.02 25);
  --c-accent: oklch(45% 0.12 250);
  --c-bg: oklch(98% 0.003 25);
  --c-surface: #fff;
  --c-text: oklch(20% 0.01 25);
  --c-muted: oklch(48% 0.01 25);
  --c-border: oklch(88% 0.005 25);
  --c-success: oklch(52% 0.13 150);
  --c-warning: oklch(72% 0.15 75);
  --c-error: oklch(55% 0.18 25);
  --c-info: oklch(55% 0.12 240);
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.06);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hit: 48px;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img,
svg {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin: 0 0 var(--space-3);
  font-weight: 600;
  text-wrap: pretty;
}
h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.4rem;
}
h3 {
  font-size: 1.1rem;
}
p {
  margin: 0 0 var(--space-3);
  text-wrap: pretty;
}
a {
  color: var(--c-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--c-primary-dark);
}
:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  left: var(--space-3);
  top: -60px;
  background: var(--c-primary);
  color: #fff;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  z-index: 200;
}
.skip:focus {
  top: var(--space-3);
}
.muted {
  color: var(--c-muted);
}
.small {
  font-size: 0.9rem;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
}
main.container {
  flex: 1;
}
.page-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.page-head h1 {
  margin: 0;
  flex: 1 1 auto;
  font-size: 1.6rem;
}
.grid {
  display: grid;
  gap: var(--space-4);
}
.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.featured-carousel {
  min-width: 0;
}
.featured-viewport {
  overflow: hidden;
}
.featured-track {
  display: flex;
  gap: var(--space-4);
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.featured-track::-webkit-scrollbar {
  display: none;
}
.featured-track > .card {
  flex: 0 0 calc(25% - var(--space-3));
  min-width: 0;
  scroll-snap-align: start;
}
.featured-carousel .featured-skeleton {
  height: 340px;
}
.featured-controls [disabled] {
  opacity: 0.45;
  cursor: default;
}
@media (max-width: 899px) {
  .featured-track > .card {
    flex-basis: calc(33.333% - 10.667px);
  }
}
@media (max-width: 599px) {
  .featured-track > .card {
    flex-basis: 85%;
  }
}

/* Carrusel de fotos dentro de cada tarjeta de donación */
.card-media-carousel {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--c-bg);
}

.card-media-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.card-media-slides .card-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease-in-out;
  pointer-events: none;
}

.card-media-slides .card-slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .card-media-slides .card-slide {
    transition: none;
  }
}

.card-media-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0.85;
}

@media (hover: hover) {
  .card-media-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    opacity: 1;
    transform: translateY(-50%) scale(1.08);
  }
}

.card-media-btn:active {
  background: rgba(0, 0, 0, 0.9);
  transform: translateY(-50%) scale(0.96);
}

.card-media-btn:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  opacity: 1;
}

.card-media-btn.prev {
  left: 8px;
}

.card-media-btn.next {
  right: 8px;
}

.card-media-counter {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.5px;
  pointer-events: none;
  z-index: 2;
  backdrop-filter: blur(4px);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.row {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}
.row-end {
  justify-content: flex-end;
}
.layout-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
@media (min-width: 900px) {
  .layout-sidebar {
    grid-template-columns: 280px 1fr;
    align-items: start;
  }
}

/* Topbar */
.topbar {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--c-text);
  text-decoration: none;
  min-height: var(--hit);
}
/* logo principal (logo_opcion_1.svg): no es cuadrado (955 x 774), va a 40 px de alto con su ancho proporcional */
.brand-mark {
  height: 40px;
  width: auto;
  border-radius: 6px;
  flex-shrink: 0;
}
.nav {
  display: flex;
  gap: var(--space-1);
  margin-left: auto;
  align-items: center;
}
.nav a:not(.btn) {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  min-height: var(--hit);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--c-text);
  text-decoration: none;
  font-weight: 500;
}
.nav a:not(.btn):hover {
  background: var(--c-primary-soft);
}
.nav a:not(.btn)[aria-current="page"] {
  color: var(--c-primary-dark);
  background: var(--c-primary-soft);
  font-weight: 600;
}
.nav-actions {
  display: flex;
  gap: var(--space-1);
  align-items: center;
}
.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--hit);
  height: var(--hit);
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--c-text);
  cursor: pointer;
  text-decoration: none;
}
.icon-btn:hover {
  background: var(--c-primary-soft);
}
.badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--c-error);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c-primary-soft);
  color: var(--c-primary-dark);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.menu {
  position: relative;
}
.menu summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: var(--hit);
  height: var(--hit);
  border-radius: 50%;
}
.menu summary::-webkit-details-marker {
  display: none;
}
.menu summary:hover {
  background: var(--c-primary-soft);
}
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 220px;
  padding: var(--space-2);
  z-index: 120;
}
.menu-panel .menu-head {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--space-2);
}
.menu-panel a {
  display: flex;
  align-items: center;
  min-height: var(--hit);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--c-text);
}
.menu-panel a:hover {
  background: var(--c-primary-soft);
}
/* el panel vive dentro de .nav: sin esto ".nav a" lo deja inline y no ocupa todo el ancho como "Cerrar sesión" */
.nav .menu-panel a:not(.btn) {
  display: flex;
  width: 100%;
  font-weight: 400;
}
.menu-panel form {
  margin: 0;
}
.nav-toggle {
  display: none;
}
@media (max-width: 1023px) {
  .nav-toggle {
    display: inline-grid;
    margin-left: auto;
  }
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-2) var(--space-4) var(--space-4);
    box-shadow: var(--shadow);
  }
  .nav.open {
    display: flex;
  }
  .nav-actions {
    margin-left: 0;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--hit);
  padding: 0 var(--space-5);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    transform 0.05s;
  white-space: nowrap;
}
.btn-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--c-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--c-primary-dark);
  color: #fff;
}
.btn-login {
  background: var(--c-primary);
  color: #fff;
  transition:
    background 0.15s,
    box-shadow 0.15s,
    transform 0.05s;
}
.btn-login:hover {
  background: var(--c-primary-dark);
  color: #fff;
  box-shadow: 0 0 0 3px var(--c-primary-soft), var(--shadow);
}
.btn-secondary {
  background: var(--c-surface);
  color: var(--c-primary-dark);
  border-color: var(--c-primary);
}
.btn-secondary:hover {
  background: var(--c-primary-soft);
}
.btn-ghost {
  background: transparent;
  color: var(--c-text);
}
.btn-ghost:hover {
  background: var(--c-primary-soft);
}
/* acción destructiva sin fondo (ej. "Cerrar" una necesidad): el color y el ícono la distinguen de las demás */
.btn-ghost-danger {
  background: transparent;
  color: var(--c-error);
}
.btn-ghost-danger:hover {
  background: color-mix(in oklch, var(--c-error) 10%, transparent);
}
/* ícono dentro de un botón (Lucide en línea): acompaña al texto, del mismo color */
.icono-btn {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.btn-danger {
  background: var(--c-surface);
  color: var(--c-error);
  border-color: var(--c-error);
}
.btn-danger:hover {
  background: oklch(96% 0.03 25);
}
/* Variante sólida de peligro: rojo de alarma con texto blanco (acciones destructivas) */
.btn-danger-solid {
  background: oklch(48% 0.2 25);
  color: #fff;
  border-color: transparent;
}
.btn-danger-solid:hover {
  background: oklch(40% 0.2 25);
  color: #fff;
}
.btn-sm {
  min-height: var(--hit);
  padding: 0 var(--space-4);
  font-size: 0.95rem;
}
.btn-block {
  width: 100%;
}
.btn[disabled],
.btn[aria-busy="true"] {
  opacity: 0.7;
}
.btn[disabled] {
  cursor: not-allowed;
}
.btn[aria-busy="true"] {
  cursor: progress;
}
.btn .spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

/* Cards & lists */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: var(--space-4);
}
.card-hover:hover {
  box-shadow: var(--shadow);
}
.card h3 {
  margin-bottom: var(--space-1);
}
.list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}
.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
}
.list-item .body {
  flex: 1;
  min-width: 0;
}
.list-item .title {
  font-weight: 600;
  margin: 0;
}
.list-item .meta {
  color: var(--c-muted);
  font-size: 0.9rem;
  margin: 0;
}
.list-item .actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
/* Si una acción viene envuelta en <form> (ej. botón Habilitar), que el form no
   rompa el centrado vertical: se comporta como ítem centrado y sin margen propio. */
.list-item .actions > form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}
/* Lista compacta (p. ej. formato del CSV de importación) */
.list.list-compact {
  gap: var(--space-2);
}
.list-compact .list-item {
  padding: var(--space-2) var(--space-3);
}
.list-compact .list-item .title,
.list-compact .list-item .meta {
  line-height: 1.3;
}
.list-compact .list-item .meta {
  font-size: 0.85rem;
}

/* Importar donantes: el formato del archivo es la columna más ancha y cada campo va en una sola línea */
@media (min-width: 1000px) {
  .importar-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
  }
}
.formato-fila {
  display: grid;
  grid-template-columns: 2rem 11rem 1fr;
  align-items: center;
  column-gap: var(--space-4);
}
.formato-fila .icono {
  font-size: 1.2rem;
  line-height: 1;
  text-align: center;
  color: var(--c-primary);
}
.formato-fila .nombre {
  font-weight: 600;
}
.formato-fila .detalle {
  color: var(--c-muted);
  font-size: 0.9rem;
  line-height: 1.3;
}
@media (max-width: 599px) {
  .formato-fila {
    grid-template-columns: 2rem 1fr;
  }
  .formato-fila .detalle {
    grid-column: 2;
  }
}

@media (max-width: 599px) {
  .list-item {
    flex-wrap: wrap;
  }
  .list-item .actions {
    width: 100%;
    justify-content: flex-end;
  }
}
.thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: repeating-linear-gradient(
    135deg,
    oklch(93% 0.004 25) 0 8px,
    oklch(96% 0.004 25) 8px 16px
  );
  border: 1px solid var(--c-border);
  display: grid;
  place-items: center;
  color: var(--c-muted);
  font-size: 0.7rem;
  font-family: ui-monospace, monospace;
  text-align: center;
}
.bien-foto-slide[hidden],
.bien-descripcion-slide[hidden] {
  display: none;
}
.access-icon {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  object-fit: contain;
}
.thumb-lg {
  width: 100%;
  height: 180px;
  aspect-ratio: auto;
}
.thumb-xl {
  width: 100%;
  height: 260px;
}
.photo-ph {
  border-radius: var(--radius);
  background: repeating-linear-gradient(
    135deg,
    oklch(93% 0.004 25) 0 10px,
    oklch(96% 0.004 25) 10px 20px
  );
  border: 1px solid var(--c-border);
  display: grid;
  place-items: center;
  color: var(--c-muted);
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  text-align: center;
  padding: var(--space-3);
}

/* Chips / badges */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--c-primary-soft);
  color: var(--c-primary-dark);
  border: 1px solid transparent;
}
.chip-neutral {
  background: oklch(94% 0.003 25);
  color: var(--c-muted);
}
.chip-success {
  background: oklch(94% 0.05 150);
  color: oklch(38% 0.12 150);
}
.chip-warning {
  background: oklch(95% 0.06 80);
  color: oklch(45% 0.12 70);
}
.chip-error {
  background: oklch(95% 0.04 25);
  color: oklch(42% 0.16 25);
}
.chip-info {
  background: oklch(94% 0.04 240);
  color: oklch(40% 0.12 240);
}
.chip-btn {
  cursor: pointer;
  min-height: var(--hit);
  padding: 0 var(--space-4);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  font: inherit;
  font-weight: 500;
}
.chip-btn[aria-pressed="true"] {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}
.chip-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-4);
}
.field label,
.legend {
  font-weight: 600;
}
.field .hint {
  color: var(--c-muted);
  font-size: 0.9rem;
}
.field .error-msg {
  color: var(--c-error);
  font-size: 0.9rem;
  display: none;
}
.field.invalid .error-msg {
  display: block;
}
.field.invalid input,
.field.invalid select {
  border-color: var(--c-error);
}
/* Asterisco de campo obligatorio. La información para el lector de pantalla la da
   el atributo required del input: el asterisco va con aria-hidden, solo como señal visual. */
.req {
  color: var(--c-error);
  font-weight: 700;
  margin-left: 2px;
}
/* Marca de campo opcional, contraparte del asterisco de obligatorio. También es solo visual:
   que el campo se pueda dejar vacío ya lo dice la ausencia de required en el input. */
.opt {
  color: var(--c-muted);
  font-weight: 400;
  font-size: 0.85rem;
  margin-left: 4px;
}
/* Dato que un formulario muestra pero no deja editar, como la razón social de la entidad */
.dato-fijo {
  margin: 0;
}
/* Botón cuadrado con un solo icono adentro, como el de quitar un medio de contacto */
.btn-icono-solo {
  flex: none;
  width: var(--hit);
  padding: 0;
}
/* Campo con un botón adentro, como el ojo de la contraseña */
.input-con-boton {
  position: relative;
  display: flex;
  align-items: center;
}
.input-con-boton input {
  padding-right: var(--hit);
}
.btn-ojo {
  position: absolute;
  right: 0;
  display: grid;
  place-items: center;
  width: var(--hit);
  height: var(--hit);
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-muted);
  cursor: pointer;
}
.btn-ojo:hover {
  color: var(--c-text);
}
/* El ojo es uno solo: con la contraseña oculta se muestra tachado, y al mostrarla la rayita desaparece */
.btn-ojo .ojo-tachado {
  display: none;
}
.btn-ojo[aria-pressed="false"] .ojo-tachado {
  display: inline;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="tel"],
select,
textarea {
  width: 100%;
  min-height: var(--hit);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--c-surface);
  color: var(--c-text);
}
textarea {
  min-height: 110px;
  resize: vertical;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--c-muted);
}
/* que se note que no se puede completar (ej. "Cada cuántos días" en una necesidad extraordinaria) */
input:disabled,
select:disabled,
textarea:disabled {
  background: var(--c-bg);
  color: var(--c-muted);
  border-color: var(--c-border);
  cursor: not-allowed;
}
.check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--hit);
  cursor: pointer;
}
.check input {
  width: 22px;
  height: 22px;
  accent-color: var(--c-primary);
  margin: 0;
  flex-shrink: 0;
}
/* interruptor (checkbox con role="switch"): apagado gris sobre blanco, prendido en el color principal con tilde */
.check input.switch {
  appearance: none;
  box-sizing: border-box;
  position: relative;
  width: 52px;
  height: 30px;
  border: 2px solid var(--c-muted);
  border-radius: 999px;
  background: var(--c-surface);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.check input.switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c-muted);
  transition: transform 0.15s;
}
.check input.switch:checked {
  background: var(--c-primary);
  border-color: var(--c-primary);
}
.check input.switch:checked::before {
  transform: translateX(22px);
  background: var(--c-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a4161a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L19 7'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.check input.switch:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}
.check-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}
.check-tree ul {
  list-style: none;
  margin: 0;
  padding-left: var(--space-6);
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space-4);
}
legend {
  font-weight: 600;
  margin-bottom: var(--space-2);
  padding: 0;
}
.form-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}
/* Pie de una card con acciones alineadas a la derecha */
.card-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: var(--space-4);
}
/* Card en columna: el pie de acciones queda pegado al borde inferior */
.acciones-card {
  display: flex;
  flex-direction: column;
}
.acciones-card .card-actions {
  margin-top: auto;
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--space-5);
  gap: var(--space-2);
}
.tabs button {
  min-height: var(--hit);
  padding: 0 var(--space-4);
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--c-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.tabs button[aria-selected="true"] {
  color: var(--c-primary-dark);
  border-color: var(--c-primary);
}
[role="tabpanel"][hidden] {
  display: none;
}
.dropzone {
  border: 2px dashed var(--c-border);
  border-radius: var(--radius);
  padding: var(--space-7) var(--space-4);
  text-align: center;
  background: var(--c-surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.dropzone:hover,
.dropzone:focus-within {
  border-color: var(--c-primary);
  background: var(--c-primary-soft);
}
.dropzone input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.dropzone .icon {
  width: 56px;
  height: 56px;
  color: var(--c-primary);
}
.progress {
  height: 8px;
  background: var(--c-border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: var(--space-2);
}
.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--c-primary);
  transition: width 0.4s;
}
.progress-lg {
  height: 12px;
}

/* Anillo de progreso (fragments/progreso :: anillo) */
.anillo {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}
.anillo svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.anillo circle {
  fill: none;
  stroke-width: 4;
}
.anillo-fondo {
  stroke: var(--c-border);
}
.anillo-valor {
  stroke: var(--c-primary);
  stroke-linecap: round;
  transition: stroke-dasharray 0.4s;
}
.anillo-valor[stroke-dasharray^="0 "] {
  stroke: none;
}
.anillo-success .anillo-valor {
  stroke: var(--c-success);
}
.anillo-info .anillo-valor {
  stroke: var(--c-info);
}
.anillo-neutral .anillo-valor {
  stroke: var(--c-muted);
}
.anillo-texto {
  position: absolute;
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Necesidades: cobertura por fila y diferencia visual entre tipos */
.cobertura {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 170px;
}
.cobertura-detalle {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
tr.fila-extraordinaria td {
  background: oklch(98.5% 0.025 80);
}
tr.fila-extraordinaria td:first-child {
  box-shadow: inset 4px 0 0 var(--c-warning);
}
tr.fila-extraordinaria:hover td {
  background: oklch(97% 0.04 80);
}
tr.fila-cerrada td {
  color: var(--c-muted);
}
.chip-tipo {
  white-space: nowrap;
}
.motivo {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 260px;
}
.resumen-necesidades {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.resumen-necesidades .row {
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
}
.filtros-necesidades {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  margin-bottom: var(--space-4);
}
.filtros-necesidades .chip-row {
  align-items: center;
}
.filtros-necesidades .filtro-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-muted);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
th,
td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-muted);
  font-weight: 600;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: var(--c-bg);
}

/* Feedback: toasts, banners, modals, loaders */
.toast-region {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 300;
  max-width: min(380px, calc(100% - 32px));
}
.toast {
  background: var(--c-text);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  display: flex;
  gap: var(--space-3);
  align-items: center;
  animation: toast-in 0.25s ease-out;
  border-left: 4px solid var(--c-primary);
}
.toast-success {
  border-left-color: var(--c-success);
}
.toast-error {
  border-left-color: var(--c-error);
}
.toast-info {
  border-left-color: var(--c-info);
}
.toast button {
  margin-left: auto;
  background: none;
  border: 0;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  width: var(--hit);
  height: var(--hit);
  border-radius: 50%;
  flex-shrink: 0;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.banner {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid;
  margin-bottom: var(--space-4);
}
.banner-info {
  background: oklch(96% 0.03 240);
  border-color: oklch(85% 0.05 240);
  color: oklch(35% 0.1 240);
}
.banner-warning {
  background: oklch(97% 0.05 85);
  border-color: oklch(85% 0.1 85);
  color: oklch(40% 0.1 70);
}
.banner-success {
  background: oklch(95% 0.05 150);
  border-color: oklch(82% 0.08 150);
  color: oklch(35% 0.12 150);
}
.banner-error {
  background: oklch(95% 0.04 25);
  border-color: oklch(82% 0.08 25);
  color: oklch(42% 0.16 25);
}
.banner p {
  margin: 0;
}
dialog {
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  max-width: min(520px, calc(100% - 32px));
  box-shadow: var(--shadow);
  width: 100%;
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.modal-body {
  padding: var(--space-5);
}
.modal-body h2 {
  margin-bottom: var(--space-2);
}
.dlg-confirm {
  max-width: min(400px, calc(100% - 32px));
}
.dlg-confirm .modal-body {
  padding: var(--space-4);
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.page-btn {
  min-width: var(--hit);
  height: var(--hit);
  padding: 0 var(--space-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.page-btn:hover {
  background: var(--c-primary-soft);
}
.page-btn.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}
.page-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.skeleton {
  background: linear-gradient(
    90deg,
    oklch(93% 0.003 25) 25%,
    oklch(97% 0.003 25) 50%,
    oklch(93% 0.003 25) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius-sm);
  min-height: 16px;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
.sk-line {
  height: 14px;
  margin-bottom: 10px;
}
.sk-line.w60 {
  width: 60%;
}
.sk-line.w40 {
  width: 40%;
}
.sk-block {
  height: 72px;
  margin-bottom: var(--space-3);
}
[data-loading]:not(.loaded) .real {
  display: none;
}
[data-loading].loaded .skeleton-group {
  display: none;
}
.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--c-muted);
}

/* Map */
.map {
  position: relative;
  height: 520px;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  overflow: hidden;
  background-color: oklch(96% 0.004 25);
  background-image:
    linear-gradient(oklch(90% 0.004 25) 1px, transparent 1px),
    linear-gradient(90deg, oklch(90% 0.004 25) 1px, transparent 1px),
    linear-gradient(oklch(85% 0.004 25) 2px, transparent 2px),
    linear-gradient(90deg, oklch(85% 0.004 25) 2px, transparent 2px);
  background-size:
    40px 40px,
    40px 40px,
    200px 200px,
    200px 200px;
}
.map-route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.marker {
  position: absolute;
  transform: translate(-50%, -100%);
  width: var(--hit);
  height: var(--hit);
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.marker .pin {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--c-primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.marker[aria-pressed="true"] .pin,
.marker:hover .pin {
  background: var(--c-accent);
  transform: rotate(-45deg) scale(1.15);
}
.marker .truck {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--c-info);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border: 2px solid #fff;
}
.map-controls {
  position: absolute;
  right: var(--space-3);
  top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  background: var(--c-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.map-controls button {
  width: var(--hit);
  height: var(--hit);
  border: 0;
  background: var(--c-surface);
  font-size: 1.3rem;
  cursor: pointer;
}
.map-controls button:hover {
  background: var(--c-primary-soft);
}
.map-legend {
  position: absolute;
  left: var(--space-3);
  bottom: var(--space-3);
  background: rgba(255, 255, 255, 0.95);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  gap: var(--space-3);
}
.map-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--c-primary);
}
.map-legend .truck-l::before {
  background: var(--c-info);
  border-radius: 2px;
}
.map-layout {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .map-layout {
    grid-template-columns: 1fr 340px;
  }
}
@media (max-width: 599px) {
  .map {
    height: 380px;
  }
}
.detail-panel {
  position: sticky;
  top: 80px;
}

/* Landing */
.hero {
  display: grid;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-7) 0;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.1fr 1fr;
  }
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}
.hero p.lead {
  font-size: 1.2rem;
  color: var(--c-muted);
  max-width: 52ch;
}
.section {
  padding: var(--space-6) 0;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.section-head h2 {
  margin: 0;
}
.stat {
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-primary-dark);
  line-height: 1;
}
footer.footer {
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  margin-top: var(--space-6);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  color: var(--c-muted);
  font-size: 0.9rem;
}
.footer-inner nav {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.footer-inner a {
  min-height: var(--hit);
  display: inline-flex;
  align-items: center;
}

/* Auth */
.auth {
  max-width: 480px;
  margin: var(--space-6) auto;
}
.auth .card {
  padding: var(--space-6);
}

/* Incentivos */
.badge-grid {
  display: grid;
  /* auto-fit + tope de ancho: las tarjetas no se estiran ni quedan pegadas a la izquierda,
     el espacio sobrante se reparte a los costados. */
  grid-template-columns: repeat(auto-fit, minmax(150px, 200px));
  gap: var(--space-3);
  justify-content: center;
}
.badge-card {
  text-align: center;
  padding: var(--space-4);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
}
.badge-card .medal {
  display: block;
  width: min(100%, 144px);
  aspect-ratio: 1;
  height: auto;
  object-fit: contain;
  margin: 0 auto var(--space-3);
  border-radius: var(--radius);
}
.badge-card.locked {
  opacity: 0.5;
  filter: grayscale(1);
}
.rank-medal {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.gold {
  background: oklch(80% 0.16 90);
}
.silver {
  background: oklch(75% 0.01 260);
}
.bronze {
  background: oklch(60% 0.1 45);
}
.rank-n {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--c-primary-soft);
  color: var(--c-primary-dark);
  flex-shrink: 0;
}

/* Notificaciones */
.notif {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}
.notif.unread {
  border-left: 4px solid var(--c-primary);
  background: var(--c-primary-soft);
}
.notif .ico {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--c-primary-dark);
}
.notif .body {
  flex: 1;
}
.notif .time {
  color: var(--c-muted);
  font-size: 0.85rem;
}
.notif .actions {
  display: flex;
  gap: var(--space-1);
}

.steps {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
  font-size: 0.9rem;
}
.steps .step {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--c-muted);
}
.steps .step .n {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-border);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
}
.steps .step.active {
  color: var(--c-primary-dark);
  font-weight: 600;
}
.steps .step.active .n {
  background: var(--c-primary);
  color: #fff;
}
.steps .sep {
  width: 24px;
  height: 1px;
  background: var(--c-border);
}

.empty {
  text-align: center;
  padding: var(--space-7) var(--space-4);
  color: var(--c-muted);
  border: 1px dashed var(--c-border);
  border-radius: var(--radius);
}
.tooltip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--c-border);
  color: var(--c-muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
  margin-left: 4px;
}
.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-text);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 50;
}
.tooltip:hover::after,
.tooltip:focus::after {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Leaflet */
#map {
  height: 520px;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  z-index: 0;
  position: relative;
}
#map:not(.loaded)::after {
  content: "Cargando mapa…";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: oklch(96% 0.004 25);
  color: var(--c-muted);
  z-index: 500;
  font-weight: 600;
}
@media (max-width: 599px) {
  #map {
    height: 380px;
  }
}
/* camión del mapa en vivo: visto desde arriba, sin fondo, con sombra; .truck-rumbo lo gira según hacia dónde va */
.truck-pin {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}
.truck-rumbo {
  display: grid;
  place-items: center;
  transition: transform 0.6s ease;
}
.leaflet-popup-content {
  font-family: var(--font);
  font-size: 0.95rem;
}
#detalle:not(.loaded) .real {
  display: none;
}
#detalle.loaded .skeleton-group {
  display: none;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.timeline li {
  position: relative;
  padding-left: 36px;
  padding-bottom: var(--space-4);
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c-border);
  border: 2px solid var(--c-surface);
  box-shadow: 0 0 0 2px var(--c-border);
}
.timeline li::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 22px;
  bottom: 0;
  width: 2px;
  background: var(--c-border);
}
.timeline li:last-child::after {
  display: none;
}
.timeline li.done::before {
  background: var(--c-success);
  box-shadow: 0 0 0 2px var(--c-success);
}
.timeline li.current::before {
  background: var(--c-primary);
  box-shadow: 0 0 0 2px var(--c-primary);
}
.timeline .t-title {
  font-weight: 600;
  margin: 0;
}
.timeline .t-meta {
  color: var(--c-muted);
  font-size: 0.9rem;
  margin: 0;
}
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2) var(--space-4);
  margin: 0;
}
.kv dt {
  color: var(--c-muted);
  font-size: 0.9rem;
}
.kv dd {
  margin: 0;
  font-weight: 500;
}
/* acción debajo de una lista de datos (ej. "Editar perfil") */
.kv + .btn {
  margin-top: var(--space-5);
}
/* perfil de una sola tarjeta: que no se estire a todo el ancho */
.perfil {
  max-width: 720px;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-2);
}
.photo-grid .photo-ph {
  aspect-ratio: 1;
  padding: var(--space-2);
}


.page-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  flex: 1 1 auto;
}
.page-title h1 {
  flex: 0 0 auto;
}
.stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.stat-chips .chip strong {
  font-weight: 800;
}


.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.search {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 300px;
  max-width: 420px;
  margin: 0;
}
.search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--hit);
}
.search .icon-btn {
  flex: 0 0 auto;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
}
.search .icon-btn:hover {
  background: var(--c-primary-soft);
}
.toolbar .chip-row {
  align-items: center;
}


a.chip-btn,
a.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--hit);
  text-decoration: none;
}
.chip-btn[aria-current="true"] {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}
a.page-btn[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}


.page-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  flex: 1 1 auto;
}
.page-title h1 {
  flex: 0 0 auto;
}
.stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.stat-chips .chip strong {
  font-weight: 800;
}


.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.search {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 300px;
  max-width: 420px;
  margin: 0;
}
.search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--hit);
}
.search .icon-btn {
  flex: 0 0 auto;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
}
.search .icon-btn:hover {
  background: var(--c-primary-soft);
}
.toolbar .chip-row {
  align-items: center;
}


a.chip-btn,
a.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--hit);
  text-decoration: none;
}
.chip-btn[aria-current="true"] {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}
a.page-btn[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}

.menu-panel .menu-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--hit);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  color: var(--c-text);
  text-align: left;
  cursor: pointer;
}

.menu-panel .menu-link:hover {
  background: var(--c-primary-soft);
}

.hero-photo {
  display: block;
  width: 100%;
  height: 350px;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Sugerencias de dirección (fragments/direccion.html): las renderiza el servidor y las inserta htmx */
.sugerencias {
  margin: 2px 0 0; padding: 0; list-style: none;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  max-height: 200px; overflow-y: auto;
}
.sugerencias button {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: var(--space-3) var(--space-4);
  background: none; border: 0; color: inherit; font: inherit;
}
.sugerencias button:hover,
.sugerencias button:focus-visible { background: var(--c-primary-soft); }

/* Registro de donación: Tarjetas dinámicas de bienes */
.bien-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bien-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  border-bottom: 1px solid var(--c-border);
  padding-bottom: var(--space-2);
}

.bien-card.is-collapsed .bien-card-head {
  border-bottom: 0;
  padding-bottom: 0;
}

.bien-card-head .bien-card-title {
  margin-right: auto;
}

.bien-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-text);
  margin: 0;
}

.grid-dims {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 12px;
}

@media (max-width: 599px) {
  .grid-dims {
    grid-template-columns: 1fr;
    gap: var(--space-2) 0;
  }
}

.impact-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-5) 0;
}

.impact-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.impact-stat strong {
  color: var(--c-primary);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
}

.impact-chart-card {
  margin-top: var(--space-5);
}

.impact-chart-card .section-head {
  margin-bottom: var(--space-4);
}

.impact-chart-card .section-head p {
  margin: var(--space-2) 0 0;
}

.impact-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-3);
  align-items: end;
  min-height: 240px;
  margin: 0;
  padding: var(--space-4) var(--space-2) 0;
  border-bottom: 1px solid var(--c-border);
}

.impact-chart-column {
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  align-items: end;
  gap: var(--space-2);
  min-width: 0;
  height: 100%;
}

.impact-chart-value,
.impact-chart-label {
  color: var(--c-muted);
  font-size: 0.8rem;
  text-align: center;
}

.impact-chart-track {
  display: flex;
  align-items: end;
  justify-content: center;
  width: min(100%, 52px);
  height: 170px;
  border-radius: var(--radius-2, 8px) var(--radius-2, 8px) 0 0;
  background: var(--c-primary-soft);
}

.impact-chart-bar {
  width: 100%;
  min-height: 0;
  border-radius: inherit;
  background: var(--c-primary);
  transition: height 180ms ease;
}

.impact-chart-label {
  padding-bottom: var(--space-3);
  white-space: nowrap;
}

.impact-month {
  margin-top: var(--space-5);
}

.impact-month p:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .impact-stats {
    grid-template-columns: 1fr;
  }

  .impact-chart {
    gap: var(--space-1);
    min-height: 210px;
    padding-inline: 0;
  }

  .impact-chart-track {
    height: 140px;
  }

  .impact-chart-value,
  .impact-chart-label {
    font-size: 0.7rem;
  }
}
