@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;400;500;600;700&display=swap');
@import "selector.tailwind.css";
@import "galeria.tailwind.css";
@import "scroll.tailwind.css";
@import "pagy.tailwind.css";
@import "poppers.tailwind.css";
@import "modal.tailwind.css";
@import "publico.tailwind.css";
@import "validation.tailwind.css";
@tailwind base;
@tailwind components;
@tailwind utilities;

:root,
:root[data-marca="andescamel"] {
    --marca-50: 250 250 250;
    --marca-100: 244 244 245;
    --marca-200: 228 228 231;
    --marca-300: 212 212 216;
    --marca-400: 161 161 170;
    --marca-500: 113 113 122;
    --marca-600: 63 63 70;
    --marca-700: 24 24 27;
    --marca-800: 17 17 19;
    --marca-900: 11 11 12;
    --marca-950: 5 5 6;
    --relleno: 24 24 27;
    --relleno-hover: 63 63 70;
    --sobre-relleno: 255 255 255;

    --fondo: #fafaf9;
    --superficie: #f0f0ee;
    --superficie-fuerte: #e6e6e2;
    --papel: #ffffff;
    --borde: #dcdcd7;
    --borde-campo: #8a8a8f;
    --tinta: #0b0b0c;
    --tinta-suave: #55565f;
    --accion: #0b0b0c;
    --accion-hover: #2a2a2e;
    --sobre-accion: #ffffff;
    --acento: #4338ca;
    --acento-suave: #e8e7fb;
    --foco: #4338ca;
    --radio: 6px;
    --linea-de-campo: #8b919b;
}

:root[data-marca="rural_alianza"] {
    --marca-50: 254 244 242;
    --marca-100: 254 229 222;
    --marca-200: 252 205 191;
    --marca-300: 240 170 150;
    --marca-400: 219 132 107;
    --marca-500: 194 101 74;
    --marca-600: 169 78 53;
    --marca-700: 144 56 30;
    --marca-800: 121 43 21;
    --marca-900: 99 32 13;
    --marca-950: 64 13 1;
    --relleno: 144 56 30;
    --relleno-hover: 121 43 21;
    --sobre-relleno: 255 255 255;

    --fondo: #f4ede2;
    --superficie: #e9dcc8;
    --superficie-fuerte: #dccab0;
    --papel: #fffaf2;
    --borde: #cbb595;
    --borde-campo: #a08a6c;
    --tinta: #2a1d14;
    --tinta-suave: #5f4a39;
    --accion: rgb(var(--marca-700));
    --accion-hover: rgb(var(--marca-800));
    --sobre-accion: #fff8ef;
    --acento: #b5791f;
    --acento-suave: #f0dcb4;
    --foco: rgb(var(--marca-700));
    --radio: 10px;
}

html.dark {
    --linea-de-campo: #6b7280;
}

html.dark:not([data-marca="rural_alianza"]) {
    --relleno: 250 250 250;
    --relleno-hover: 228 228 231;
    --sobre-relleno: 9 9 11;
    --fondo: #000000;
    --superficie: #181818;
    --superficie-fuerte: #1f1f1f;
    --papel: #181818;
    --borde: #313131;
    --borde-campo: #7a7a83;
    --tinta: #f5f5f4;
    --tinta-suave: #a1a1aa;
    --accion: #fafaf9;
    --accion-hover: #e4e4e2;
    --sobre-accion: #0b0b0c;
    --acento: #818cf8;
    --acento-suave: #1e1b4b;
    --foco: #a5b4fc;
}

html.dark[data-marca="rural_alianza"] {
    --relleno: 219 132 107;
    --relleno-hover: 240 170 150;
    --sobre-relleno: 26 15 8;
    --fondo: #131209;
    --superficie: #1f1c14;
    --superficie-fuerte: #2a261c;
    --papel: #1f1c14;
    --borde: #3e372a;
    --borde-campo: #94836a;
    --tinta: #f4ede2;
    --tinta-suave: #c4b49e;
    --accion: rgb(var(--marca-400));
    --accion-hover: rgb(var(--marca-300));
    --sobre-accion: #1a0f08;
    --acento: #e0a849;
    --acento-suave: #3a2a10;
    --foco: rgb(var(--marca-400));
}

/*

@layer components {
  .btn-primary {
    @apply py-2 px-4 bg-blue-200;
  }
}

*/

@layer components {
    .title {
        @apply mb-4 text-2xl font-bold tracking-tight text-gray-900 dark:text-gray-100;
    }

    .title-small {
        @apply mb-3 text-base font-semibold text-gray-900 dark:text-gray-100;
    }

    .text-title {
        @apply mb-4 text-2xl font-bold tracking-tight text-gray-900 dark:text-gray-100;
    }

    .label {
        @apply relative mb-2 inline-flex items-center gap-2 text-sm font-medium text-gray-800 dark:text-gray-200;
    }

    .input {
        @apply block min-h-10 w-full rounded-md border bg-white px-3 py-2 text-base text-gray-900 placeholder:text-gray-500 transition-[border-color,box-shadow] duration-150 focus:border-marca-600 focus:outline-none focus:ring-2 focus:ring-marca-600/25 md:text-sm dark:bg-gray-900 dark:text-gray-100 dark:placeholder:text-gray-400 dark:focus:border-marca-400 dark:focus:ring-marca-400/25;
        border-color: var(--linea-de-campo);
    }

    .campo-minutos {
        @apply flex items-stretch gap-1.5;
    }

    .campo-minutos-caja {
        @apply relative min-w-0 flex-1;
    }

    .campo-minutos-numero {
        @apply h-full pr-9 text-center text-base font-semibold tabular-nums;
        -moz-appearance: textfield;
    }

    .campo-minutos-numero::-webkit-outer-spin-button,
    .campo-minutos-numero::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    .campo-minutos-unidad {
        @apply pointer-events-none absolute inset-y-0 right-3 flex items-center text-sm text-gray-500 dark:text-gray-400;
    }

    .campo-minutos-boton {
        @apply inline-flex w-11 min-h-11 shrink-0 items-center justify-center rounded-lg border border-marca-500 bg-gray-100 text-marca-800 transition-colors duration-150 hover:bg-relleno-hover hover:text-sobre-relleno active:scale-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-marca-600 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-gray-100 disabled:hover:text-marca-800 disabled:active:scale-100 dark:bg-gray-800 dark:text-marca-300 dark:disabled:hover:bg-gray-800 dark:disabled:hover:text-marca-300;
    }

    .button {
        @apply inline-flex min-h-10 w-full cursor-pointer items-center justify-center gap-1.5 rounded-md bg-relleno px-4 py-2 text-sm font-semibold text-sobre-relleno transition-[background-color,transform] duration-150 ease-out hover:bg-relleno-hover enabled:active:scale-[0.96] focus:outline-none focus-visible:ring-2 focus-visible:ring-marca-600 focus-visible:ring-offset-2 sm:w-auto dark:focus-visible:ring-offset-gray-900 border border-black/10 dark:border-white/15;
    }

    .button-large-secondary {
        @apply inline-flex min-h-10 w-full cursor-pointer items-center justify-center gap-1.5 rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-semibold text-gray-800 transition-[background-color,transform] duration-150 ease-out hover:bg-gray-50 enabled:active:scale-[0.96] focus:outline-none focus-visible:ring-2 focus-visible:ring-marca-600 sm:w-auto dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100 dark:hover:bg-gray-800;
    }

    .button-secondary {
        @apply inline-flex min-h-9 w-full cursor-pointer items-center justify-center gap-1.5 rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm font-medium text-gray-800 transition-[background-color,transform] duration-150 ease-out hover:bg-gray-50 enabled:active:scale-[0.96] focus:outline-none focus-visible:ring-2 focus-visible:ring-marca-600 sm:w-auto dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100 dark:hover:bg-gray-800;
    }

    .button-red {
        @apply inline-flex min-h-9 w-full cursor-pointer items-center justify-center gap-1.5 rounded-md border border-red-300 bg-white px-3 py-1.5 text-sm font-medium text-red-700 transition-[background-color,color,transform] duration-150 ease-out hover:border-red-600 hover:bg-red-600 hover:text-white enabled:active:scale-[0.96] focus:outline-none focus-visible:ring-2 focus-visible:ring-red-500 sm:w-auto dark:border-red-500/40 dark:bg-gray-900 dark:text-red-300 dark:hover:bg-red-700 dark:hover:text-white;
    }

    .button-link {
        @apply flex items-center p-2 text-gray-50 rounded-lg hover:bg-relleno-hover hover:text-sobre-relleno group;
    }

    .button-menu {
        @apply flex-1 ms-3 text-sm whitespace-nowrap group-hover:text-gray-50 dark:group-hover:text-gray-100;
    }

    .button-blue {
        @apply inline-flex min-h-9 items-center gap-1.5 whitespace-nowrap rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm font-medium text-gray-800 transition-[background-color,border-color] duration-150 hover:border-marca-600 hover:bg-marca-50 hover:text-marca-800 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100 dark:hover:border-marca-400 dark:hover:bg-marca-900/40 dark:hover:text-marca-100;
    }

    .button-close-right {
        @apply absolute top-3 right-3 text-gray-800 bg-transparent hover:bg-gray-800 hover:text-gray-50 rounded-lg text-sm w-8 h-8 inline-flex justify-center items-center dark:text-gray-200 dark:hover:bg-gray-700;
    }

    .card {
        @apply mb-4 flex items-start gap-2 rounded-md border border-red-200 bg-red-50 px-3 py-2.5 text-sm text-red-800 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200;
    }

    .opcion-de-color {
        @apply flex min-h-11 cursor-pointer items-center gap-3 rounded-md border border-gray-300 bg-white px-3 text-sm font-medium text-gray-800 transition-[background-color,border-color] duration-150 has-[:checked]:border-marca-600 has-[:checked]:bg-marca-50 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100 dark:has-[:checked]:border-marca-400 dark:has-[:checked]:bg-marca-900/40;
    }

    .aviso {
        @apply mb-4 flex items-start gap-2 rounded-md border px-3 py-2.5 text-sm;
    }

    .aviso-error {
        @apply border-red-200 bg-red-50 text-red-800 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200;
    }

    .aviso-exito {
        @apply border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-900/60 dark:bg-emerald-950/40 dark:text-emerald-200;
    }

    .aviso-alerta {
        @apply border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-900/60 dark:bg-amber-950/40 dark:text-amber-200;
    }

    .aviso-info {
        @apply border-gray-200 bg-gray-50 text-gray-800 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-200;
    }

    .nota {
        @apply mt-1.5 text-sm text-gray-600 dark:text-gray-400;
    }

    .etiqueta-exito {
        @apply bg-emerald-50 text-emerald-800 dark:bg-emerald-950/50 dark:text-emerald-200;
    }

    .etiqueta-error {
        @apply bg-red-50 text-red-800 dark:bg-red-950/50 dark:text-red-200;
    }

    .etiqueta-alerta {
        @apply bg-amber-50 text-amber-900 dark:bg-amber-950/50 dark:text-amber-200;
    }

    .etiqueta-neutra {
        @apply bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300;
    }

    .tabla-datos {
        @apply w-full border-collapse text-left text-sm tabular-nums text-gray-800 dark:text-gray-200;
    }

    .tabla-datos td {
        @apply py-1 pr-4 align-top;
    }

    .tabla-datos td:first-child {
        @apply whitespace-nowrap text-gray-500 dark:text-gray-400;
    }

    .casilla {
        @apply flex min-h-10 items-center gap-2 rounded-md border border-gray-300 bg-white px-3 text-sm transition-[background-color,border-color] duration-150 has-[:checked]:border-marca-600 has-[:checked]:bg-marca-50 dark:border-gray-700 dark:bg-gray-900 dark:has-[:checked]:border-marca-400 dark:has-[:checked]:bg-marca-900/40;
    }

    .acciones-formulario {
        @apply mt-6 flex flex-wrap items-center justify-end gap-2;
    }

    .kpis {
        @apply grid gap-px overflow-hidden rounded-lg border border-gray-200 bg-gray-200 dark:border-gray-800 dark:bg-gray-800;
    }

    .kpi {
        @apply bg-white px-5 py-4 dark:bg-gray-900;
    }

    .linea-de-venta {
        @apply grid grid-cols-2 items-end gap-3 border-b border-gray-100 pb-3 md:grid-cols-[minmax(0,1fr)_9rem_9rem_auto_auto] dark:border-gray-800;
    }

    .card-small {
        @apply mb-4 w-full max-w-2xl rounded-lg border border-gray-200 bg-white p-5 sm:p-6 dark:border-gray-800 dark:bg-gray-900;
    }

    .card-large {
        @apply mb-4 w-full rounded-lg border border-gray-200 bg-white p-5 text-gray-700 sm:p-6 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-300;
    }

    .grid-col {
        @apply grid sm:grid-cols-2 lg:grid-cols-3 gap-6;
    }

    .table {
        @apply w-full border-collapse text-left text-sm tabular-nums text-gray-800 dark:text-gray-200;
    }

    .thead {
        @apply border-b border-gray-200 text-xs font-normal text-gray-500 dark:border-gray-700 dark:text-gray-400;
    }

    .tr {
        @apply border-b border-gray-100 dark:border-gray-800;
    }

    .scroll {
        @apply relative mt-4 overflow-x-auto rounded-lg border border-gray-200 bg-white dark:border-gray-800 dark:bg-gray-900;
    }

    .input-shear {
        @apply block w-full md:w-auto p-2 pl-10 text-sm text-gray-900 border border-gray-700 rounded-lg bg-transparent focus:ring-1 focus:ring-gray-500 focus:border-gray-500 placeholder:text-gray-400 dark:text-gray-100 dark:border-gray-600 dark:placeholder:text-gray-500;
    }

    .icon-search {
        @apply absolute top-1/2 left-3 transform -translate-y-1/2 w-4 h-4 text-gray-700 dark:text-gray-400;
    }

    .input-select {
        @apply block min-h-10 w-full rounded-md border bg-white py-2 pl-3 pr-9 text-base text-gray-900 focus:border-marca-600 focus:outline-none focus:ring-2 focus:ring-marca-600/25 md:w-auto md:text-sm dark:bg-gray-900 dark:text-gray-100;
        border-color: var(--linea-de-campo);
    }

    .container-title {
        @apply mb-4 flex flex-wrap items-center justify-between gap-x-4 gap-y-2;
    }

    .tarjeta-animal {
        @apply relative flex min-h-[7.5rem] min-w-0 flex-col items-center justify-center rounded-lg border border-gray-300 bg-white p-3 text-center shadow-sm transition duration-150 hover:border-marca-600 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-marca-600 dark:border-gray-700 dark:bg-gray-900 dark:hover:border-marca-500;
    }

    .tarjeta-animal.active-card {
        @apply border-marca-600 bg-marca-50 ring-1 ring-marca-600 dark:border-marca-500 dark:bg-marca-950/50 dark:ring-marca-500;
    }

    .pestana {
        @apply inline-flex min-h-9 items-center gap-1.5 whitespace-nowrap rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm font-medium text-gray-700 transition-[background-color,border-color,color] duration-150 hover:border-gray-400 hover:bg-gray-50 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-marca-600 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 dark:hover:border-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-100;
    }

    .pestana-activa {
        @apply border-black/10 bg-relleno text-sobre-relleno hover:border-black/10 hover:bg-relleno-hover hover:text-sobre-relleno dark:border-white/15 dark:bg-relleno dark:text-sobre-relleno dark:hover:border-white/15 dark:hover:bg-relleno-hover dark:hover:text-sobre-relleno;
    }

    .pestana-peligro {
        @apply border-red-500/70 text-red-700 hover:border-red-600 hover:bg-red-600 hover:text-white dark:border-red-500/50 dark:text-red-300 dark:hover:bg-red-700;
    }

    .pagina-encabezado {
        @apply mb-4 flex flex-wrap items-end justify-between gap-x-4 gap-y-3;
    }

    .pagina-titulo {
        @apply text-2xl font-bold tracking-tight text-gray-900 dark:text-gray-100;
    }

    .pagina-subtitulo {
        @apply mt-0.5 text-sm text-gray-600 dark:text-gray-400;
    }

    .boton-principal {
        @apply inline-flex min-h-9 cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md bg-relleno px-3 py-2 text-sm font-semibold text-sobre-relleno transition-[background-color,transform] duration-150 ease-out hover:bg-relleno-hover enabled:active:scale-[0.96] focus:outline-none focus-visible:ring-2 focus-visible:ring-marca-600 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-gray-900 border border-black/10 dark:border-white/15;
    }

    .boton-principal:disabled {
        @apply cursor-not-allowed bg-gray-300 text-gray-500 shadow-none hover:bg-gray-300 dark:bg-gray-800 dark:text-gray-500 dark:hover:bg-gray-800;
    }

    .campo-busqueda {
        @apply block min-h-10 w-full rounded-md border bg-white py-2 pl-9 pr-3 text-base text-gray-900 placeholder:text-gray-500 transition-[border-color,box-shadow] duration-150 focus:border-marca-600 focus:outline-none focus:ring-2 focus:ring-marca-600/25 sm:text-sm dark:bg-gray-900 dark:text-gray-100 dark:placeholder:text-gray-400 dark:focus:border-marca-400 dark:focus:ring-marca-400/25;
        border-color: var(--linea-de-campo);
    }

    .pestana-alerta {
        @apply border-amber-500 text-amber-800 hover:border-amber-600 hover:bg-amber-600 hover:text-white dark:border-amber-500/70 dark:text-amber-300 dark:hover:bg-amber-700;
    }

    .pestana .cuenta {
        @apply rounded-full bg-gray-100 px-1.5 text-xs tabular-nums text-gray-700 dark:bg-gray-800 dark:text-gray-200;
    }

    .pestana-activa .cuenta {
        @apply bg-white/25 text-white;
    }

    /* Agenda del campo: el día, cada trabajo y la planilla para anotar. */
    .agenda-dia {
        @apply mb-2 mt-5 text-sm font-semibold text-gray-700 first:mt-0 dark:text-gray-300;
    }

    .agenda-dia-vencido {
        @apply text-amber-700 dark:text-amber-400;
    }

    .tarjeta-trabajo {
        @apply flex items-center justify-between gap-3 rounded-lg border border-gray-200 bg-white p-3 dark:border-gray-800 dark:bg-gray-950/40;
    }

    .titulo-de-tarjeta {
        @apply font-semibold text-gray-900 hover:text-marca-700 hover:underline dark:text-gray-100 dark:hover:text-marca-400;
    }

    .tarjeta-trabajo-vencida {
        @apply border-amber-300 bg-amber-50/60 dark:border-amber-800/70 dark:bg-amber-950/30;
    }

    .tarjeta-trabajo:has(.titulo-de-tarjeta[aria-current="true"]) {
        @apply border-marca-600 bg-marca-50 ring-1 ring-marca-600 dark:border-marca-500 dark:bg-marca-950/40 dark:ring-marca-500;
    }

    .linea-del-plan {
        @apply relative ml-3 space-y-5 border-l border-gray-200 pl-6 dark:border-gray-800;
    }

    .momento {
        @apply relative;
    }

    .momento-marca {
        @apply absolute -left-[2.15rem] top-0.5 flex size-5 items-center justify-center rounded-full border-2 border-gray-300 bg-white text-[0.7rem] font-bold text-white dark:border-gray-700 dark:bg-gray-950;
    }

    .momento-hecho .momento-marca {
        @apply border-relleno bg-relleno text-sobre-relleno dark:border-relleno dark:bg-relleno;
    }

    .momento-ahora .momento-marca {
        @apply border-marca-600 ring-4 ring-marca-600/20;
    }

    .momento-atrasado .momento-marca {
        @apply border-amber-500 ring-amber-500/25;
    }

    .momento-despues {
        @apply opacity-75;
    }

    .momento-despues .momento-marca {
        @apply border-dashed;
    }

    .aviso-del-panel {
        @apply mb-4 flex items-start gap-2 rounded-md border border-gray-200 bg-gray-50 px-3 py-2.5 text-sm text-gray-800 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-200;
    }

    .aviso-del-panel-error {
        @apply border-red-200 bg-red-50 text-red-800 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200;
    }

    .barra-avance {
        @apply mt-1.5 h-1.5 w-full max-w-40 overflow-hidden rounded-full bg-gray-200 dark:bg-gray-800;
    }

    .barra-avance>span {
        @apply block h-full rounded-full bg-relleno;
    }

    .opcion-de-actividad {
        @apply flex min-h-[5.5rem] flex-col justify-center rounded-lg border border-gray-200 bg-white p-4 transition-colors duration-150 hover:border-marca-600 hover:bg-marca-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-marca-600 dark:border-gray-800 dark:bg-gray-950/40 dark:hover:border-marca-500 dark:hover:bg-marca-950/40;
    }

    .opcion-de-paso {
        @apply flex cursor-pointer items-start gap-2.5 rounded-lg border border-gray-200 bg-white p-3 text-sm transition-colors duration-150 hover:border-marca-600 has-[:checked]:border-marca-600 has-[:checked]:bg-marca-50 dark:border-gray-800 dark:bg-gray-950/40 dark:hover:border-marca-500 dark:has-[:checked]:bg-marca-950/40;
    }

    /* hidden debe ganarle a flex o grid en lo que muestran y ocultan los controladores. */
    [data-controller~="planilla"] [hidden],
    [data-controller~="paso-de-plan"] [hidden],
    [data-controller~="seleccion-animales"] [hidden] {
        @apply hidden;
    }

    #pasos-del-protocolo {
        counter-reset: paso;
    }

    .paso-de-plan {
        counter-increment: paso;
    }

    .paso-de-plan-numero::before {
        content: "Paso " counter(paso) " · ";
    }

    .planilla {
        @apply divide-y divide-gray-100 rounded-lg border border-gray-200 bg-white dark:divide-gray-800 dark:border-gray-800 dark:bg-gray-900;
    }

    .planilla-fila {
        @apply flex flex-wrap items-center gap-3 px-3 py-2;
    }

    .planilla-estado {
        @apply flex size-6 shrink-0 items-center justify-center rounded-full bg-gray-100 text-sm font-bold text-gray-400 dark:bg-gray-800 dark:text-gray-500;
    }

    .planilla-fila-guardado {
        @apply bg-marca-50 dark:bg-marca-950/30;
    }

    .planilla-fila-guardado .planilla-estado {
        @apply bg-relleno text-sobre-relleno;
    }

    .planilla-fila-error {
        @apply bg-red-50 dark:bg-red-950/30;
    }

    .planilla-fila-error .planilla-estado {
        @apply bg-red-600 text-white dark:bg-red-600;
    }

    .planilla-extras {
        @apply grid basis-full grid-cols-2 gap-2 pl-8 sm:grid-cols-3 lg:grid-cols-6;
    }

    .planilla-fila:has(input[type=checkbox]:not(:checked)) .planilla-animal {
        @apply text-gray-400 line-through dark:text-gray-600;
    }

    .planilla-marca {
        @apply size-5 shrink-0 cursor-pointer rounded border-gray-400 text-marca-700 focus:ring-marca-600 dark:border-gray-600 dark:bg-gray-800;
    }

    .planilla-valor {
        @apply w-24 shrink-0 rounded-lg border border-marca-500 bg-gray-100 p-2 text-right text-base tabular-nums text-gray-700 focus:border-marca-500 focus:ring-marca-500 disabled:border-gray-300 disabled:opacity-50 md:text-sm dark:border-marca-600 dark:bg-gray-800 dark:text-gray-200 dark:disabled:border-gray-700;
    }

    .registros {
        container-type: inline-size;
        container-name: registros;
    }

    .registros-encabezado {
        @apply mb-3 flex flex-wrap items-end justify-between gap-x-4 gap-y-2;
    }

    .registros-titulo {
        @apply text-base font-semibold text-gray-900 dark:text-gray-100;
    }

    .registros-marco {
        @apply relative w-full overflow-x-auto rounded-lg border border-gray-200 bg-white dark:border-gray-800 dark:bg-gray-900;
    }

    .tabla-registros {
        @apply w-full border-collapse text-left text-sm tabular-nums text-gray-800 dark:text-gray-200;
    }

    .tabla-registros th {
        @apply h-10 whitespace-nowrap border-b border-gray-200 px-3 text-xs font-normal text-gray-500 dark:border-gray-700 dark:text-gray-400;
    }

    .tabla-registros td {
        @apply border-b border-gray-100 px-3 py-2.5 align-top dark:border-gray-800/80;
    }

    .tabla-registros tbody tr:last-child td {
        @apply border-b-0;
    }

    .tabla-registros th.num {
        @apply text-right;
    }

    .tabla-registros>tbody>tr {
        transition: background-color 150ms ease-out;
    }

    @media (hover: hover) {
        .tabla-registros>tbody>tr:hover {
            @apply bg-gray-50 dark:bg-white/[0.03];
        }
    }

    .tabla-registros .num {
        @apply text-right tabular-nums;
    }

    .tabla-registros .acciones {
        @apply w-px whitespace-nowrap text-right;
    }

    .tabla-registros .apagado {
        @apply text-gray-400 dark:text-gray-600;
    }

    .boton-icono {
        @apply inline-flex size-9 items-center justify-center rounded-md text-gray-600 transition-[background-color,color] duration-150 hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-marca-600 dark:text-gray-300 dark:hover:bg-gray-800 dark:hover:text-gray-100;
    }

    .etiqueta-estado {
        @apply inline-flex h-6 flex-none items-center gap-1.5 whitespace-nowrap rounded-full px-2.5 text-xs font-medium;
    }

    .registros-vacio {
        @apply rounded-lg border border-dashed border-gray-300 px-4 py-10 text-center text-sm text-gray-600 dark:border-gray-700 dark:text-gray-400;
    }

    .informe {
        @apply rounded-lg border border-gray-200 bg-white text-gray-800 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-200 print:border-0 print:bg-transparent;
    }
    .informe-seccion {
        @apply border-t border-gray-200 px-5 py-6 sm:px-8 dark:border-gray-800 print:break-inside-avoid print:px-0;
    }
    .informe .tabla-registros th:first-child,
    .informe .tabla-registros td:first-child {
        @apply pl-0;
    }
    .informe .tabla-registros th:last-child,
    .informe .tabla-registros td:last-child {
        @apply pr-0;
    }
    .posicion-en-grupo {
        @apply relative h-5 w-full min-w-40;
    }
    .posicion-en-grupo-tramos {
        @apply absolute inset-x-0 top-1/2 flex h-1.5 -translate-y-1/2 gap-0.5;
    }
    .posicion-en-grupo-tramos span {
        @apply flex-1 bg-gray-200 first:rounded-l-full last:rounded-r-full dark:bg-gray-700;
    }
    .posicion-en-grupo-tramos[data-con-objetivo] span:first-child {
        @apply bg-amber-200 dark:bg-amber-700/70;
    }
    .posicion-en-grupo-tramos[data-con-objetivo] span:last-child {
        @apply bg-emerald-200 dark:bg-emerald-700/70;
    }
    .posicion-en-grupo-promedio {
        @apply absolute inset-y-0 left-1/2 w-0.5 -translate-x-1/2 rounded-full bg-gray-400 dark:bg-gray-500;
    }
    .posicion-en-grupo-punto {
        @apply absolute top-1/2 size-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-marca-600 ring-2 ring-white dark:bg-marca-400 dark:ring-gray-900 print:ring-0;
    }
    .posicion-en-grupo-punto[data-neutro] {
        @apply bg-gray-500 dark:bg-gray-400;
    }
    hr.line {
        @apply border-gray-200 dark:border-gray-800;
    }
    .segmentos {
        @apply inline-flex max-w-full flex-wrap gap-0.5 rounded-lg bg-gray-200/80 p-0.5 dark:bg-gray-800;
    }

    .segmento {
        @apply inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium text-gray-600 transition-colors duration-150 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-marca-600 dark:text-gray-400 dark:hover:text-gray-100;
    }

    .segmento-activo {
        @apply bg-white text-gray-900 shadow-sm ring-1 ring-black/5 dark:bg-gray-700 dark:text-white dark:ring-white/10;
    }

    .pestanas-linea {
        @apply flex gap-5 overflow-x-auto border-b border-gray-200 [scrollbar-width:none] dark:border-gray-800;
    }

    .pestana-linea {
        @apply -mb-px shrink-0 border-b-2 border-transparent py-2 text-sm font-medium text-gray-600 transition-colors duration-150 hover:border-gray-300 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-marca-600 dark:text-gray-400 dark:hover:border-gray-600 dark:hover:text-gray-100;
    }

    .pestana-linea-activa {
        @apply border-relleno text-gray-900 hover:border-relleno dark:border-relleno dark:text-white;
    }

    .enlace-lateral {
        @apply flex items-center gap-3 rounded-lg p-2 text-sm text-gray-700 transition-colors duration-150 hover:bg-marca-200/60 hover:text-marca-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-marca-600 dark:text-gray-300 dark:hover:bg-marca-400/15 dark:hover:text-marca-100;
    }

    .enlace-lateral-activo {
        @apply bg-relleno font-semibold text-sobre-relleno shadow-sm ring-1 ring-black/10 hover:bg-relleno-hover hover:text-sobre-relleno dark:bg-relleno dark:text-sobre-relleno dark:ring-white/15 dark:hover:bg-relleno-hover dark:hover:text-sobre-relleno;
    }

    .icono-hato {
        @apply h-5 w-8 shrink-0 bg-current;
        mask: url(/icons/hato.svg) center / contain no-repeat;
    }

    .menu-registros {
        @apply min-w-56 rounded-lg border border-gray-200 bg-white p-1 text-left text-sm text-gray-800 shadow-lg dark:border-gray-700 dark:bg-gray-900 dark:text-gray-200 dark:shadow-black/50;
    }

    .menu-registros .tabla-datos {
        @apply mx-3 mb-2 w-auto;
    }

    .menu-registros-opcion {
        @apply flex w-full items-center gap-2 rounded-md px-3 py-2 text-gray-700 transition-colors duration-150 hover:bg-marca-100 hover:text-marca-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-marca-600 dark:text-gray-200 dark:hover:bg-marca-400/15 dark:hover:text-marca-100;
    }

    .menu-registros-peligro {
        @apply text-red-700 hover:bg-red-50 hover:text-red-800 dark:text-red-400 dark:hover:bg-red-950/40 dark:hover:text-red-300;
    }

    @container registros (max-width: 40rem) {
        .tabla-registros thead {
            @apply sr-only;
        }

        .tabla-registros,
        .tabla-registros tbody {
            @apply block;
        }

        .tabla-registros tbody tr {
            @apply grid grid-cols-2 gap-x-4 gap-y-2 border-b border-gray-200 p-3 dark:border-gray-800;
        }

        .tabla-registros tbody tr:last-child {
            @apply border-b-0;
        }

        .tabla-registros td {
            @apply block min-w-0 whitespace-normal border-0 !p-0 [overflow-wrap:anywhere];
        }

        .tabla-registros td[data-etiqueta]::before {
            content: attr(data-etiqueta);
            @apply mb-0.5 block text-xs text-gray-500 dark:text-gray-400;
        }

        .tabla-registros td[data-etiqueta=""]::before {
            @apply hidden;
        }

        .tabla-registros td[data-ancho-completo] {
            @apply col-span-2;
        }

        .informe .tabla-registros tbody tr {
            @apply px-0;
        }

        .tabla-registros .num {
            @apply text-left;
        }

        .tabla-registros .ancho,
        .tabla-registros .acciones {
            @apply col-span-2;
        }

        .tabla-registros .acciones {
            @apply w-auto border-t border-gray-100 !pt-2 dark:border-gray-800;
        }
    }

    .lista-animales-barra {
        @apply mb-3 pt-1;
    }

    .tarjeta-animal mark {
        @apply rounded-sm bg-marca-200 px-0.5 text-gray-900 dark:bg-marca-700/70 dark:text-white;
    }

    .lista-animales-ficha {
        @apply hidden;
    }

    .lista-animales[data-detalle="abierto"] .lista-animales-ficha {
        @apply fixed inset-0 z-40 block overflow-y-auto bg-gray-100 px-3 pb-10 pt-3 dark:bg-gray-950;
    }

    .lista-animales-ficha-barra {
        @apply mb-2 flex items-center justify-between;
    }

    @media (min-width: 768px) {
        .lista-animales[data-detalle="abierto"] {
            @apply grid items-start gap-4;
            grid-template-columns: minmax(16rem, 1fr) minmax(0, 2fr);
        }

        .lista-animales[data-detalle="abierto"] .lista-animales-columna {
            @apply sticky top-16 max-h-[calc(100dvh-4rem)] overflow-y-auto overscroll-contain pb-6 pr-1 2xl:top-0 2xl:max-h-dvh;
        }

        .lista-animales[data-detalle="abierto"] .lista-animales-barra {
            @apply sticky top-0 z-10 bg-gray-100/95 pb-2 backdrop-blur dark:bg-gray-950/95;
        }

        .lista-animales[data-detalle="abierto"] .lista-animales-ficha {
            @apply static z-auto min-w-0 overflow-visible rounded-lg border border-gray-200 bg-white px-4 pt-3 dark:border-gray-800 dark:bg-gray-900;
        }
    }

    [role="tooltip"] {
        @apply border border-transparent dark:border-gray-600 dark:shadow-lg dark:shadow-black/50;
    }
}

/*
 * Capa de compatibilidad para vistas heredadas. :where() mantiene una
 * especificidad baja: una variante dark: declarada en la vista siempre gana.
 */
html.dark {
    color-scheme: dark;
}

/*
 * Tailwind trae cinco paletas neutras (gray, slate, zinc, neutral, stone) y las
 * vistas las mezclan. Hay que cubrirlas todas: si sólo se cubre `gray`, una
 * tarjeta con `bg-slate-50` se queda blanca en modo oscuro.
 */
html.dark :where(.bg-white) {
    background-color: #111827;
}

html.dark :where(.bg-gray-50, .bg-slate-50, .bg-zinc-50, .bg-neutral-50, .bg-stone-50) {
    background-color: #111827;
}

html.dark :where(.bg-gray-100, .bg-slate-100, .bg-zinc-100, .bg-neutral-100, .bg-stone-100) {
    background-color: #1f2937;
}

html.dark :where(.bg-gray-200, .bg-slate-200, .bg-zinc-200, .bg-neutral-200, .bg-stone-200) {
    background-color: #374151;
}

html.dark :where(.bg-gray-300, .bg-slate-300, .bg-zinc-300, .bg-neutral-300, .bg-stone-300) {
    background-color: #4b5563;
}

html.dark :where(.bg-white\/70, .bg-white\/80, .bg-white\/90, .bg-white\/95) {
    background-color: rgb(17 24 39 / 0.9);
}

html.dark :where(.bg-gray-50\/50, .bg-gray-100\/50, .bg-slate-50\/50) {
    background-color: rgb(31 41 55 / 0.5);
}

html.dark :where(.text-black, .text-gray-900, .text-slate-900, .text-zinc-900, .text-neutral-900, .text-stone-900) {
    color: #f8fafc;
}

html.dark :where(.text-gray-800, .text-slate-800, .text-zinc-800, .text-neutral-800, .text-stone-800) {
    color: #f1f5f9;
}

html.dark :where(.text-gray-700, .text-slate-700, .text-zinc-700, .text-neutral-700, .text-stone-700) {
    color: #e2e8f0;
}

html.dark :where(.text-gray-600, .text-slate-600, .text-zinc-600, .text-neutral-600, .text-stone-600) {
    color: #cbd5e1;
}

html.dark :where(.text-gray-500, .text-gray-400, .text-slate-500, .text-slate-400, .text-zinc-500, .text-zinc-400, .text-neutral-500, .text-neutral-400, .text-stone-500, .text-stone-400) {
    color: #94a3b8;
}

html.dark :where(.border-gray-100, .border-gray-200, .border-gray-300, .border-slate-100, .border-slate-200, .border-slate-300, .border-zinc-100, .border-zinc-200, .border-neutral-100, .border-neutral-200, .border-stone-100, .border-stone-200) {
    border-color: #374151;
}

html.dark :where(.border-gray-400, .border-gray-500, .border-slate-400, .border-slate-500) {
    border-color: #4b5563;
}

/*
 * `border` / `border-t` sin tono heredan el gris claro (#e5e7eb) que el
 * preflight de Tailwind pone en `*, ::before, ::after`. Envolver el ancestro en
 * :where() deja esta regla en especificidad (0,0,0), igual que el preflight:
 * como va después en el archivo le gana, pero pierde contra cualquier clase de
 * color explícita como `.border-marca-600` (0,1,0), que es justo lo que se
 * busca.
 */
:where(html.dark) *,
:where(html.dark) ::before,
:where(html.dark) ::after {
    border-color: #374151;
}

html.dark :where(.divide-gray-100, .divide-gray-200, .divide-gray-300, .divide-slate-100, .divide-slate-200)> :not([hidden])~ :not([hidden]) {
    border-color: #374151;
}

/*
 * OJO con la especificidad en los estados hover: Tailwind genera
 * `.hover\:bg-gray-50:hover`, que puntúa (0,2,0). Si metemos el `:hover` dentro
 * del :where() nos quedamos en (0,1,1) y Tailwind gana, dejando la fila blanca
 * en modo oscuro. Con el `:hover` fuera del :where() subimos a (0,2,1) y
 * ganamos por un pelo, sin ensuciar la especificidad para las vistas que sí
 * declaran su propia variante dark:.
 */
html.dark :where(.hover\:bg-gray-50, .hover\:bg-gray-100, .hover\:bg-gray-200, .hover\:bg-slate-50, .hover\:bg-slate-100, .hover\:bg-slate-200, .hover\:bg-zinc-50, .hover\:bg-zinc-100, .hover\:bg-neutral-50, .hover\:bg-neutral-100, .hover\:bg-stone-50, .hover\:bg-stone-100):hover {
    background-color: #374151;
}

html.dark :where(.hover\:bg-white):hover {
    background-color: #1f2937;
}

html.dark :where(.hover\:text-blue-600, .hover\:text-blue-700, .hover\:text-blue-800, .hover\:text-sky-600, .hover\:text-sky-700, .hover\:text-indigo-600, .hover\:text-indigo-700, .hover\:text-indigo-800, .hover\:text-indigo-900):hover {
    color: #93c5fd;
}

html.dark :where(.hover\:text-emerald-600, .hover\:text-emerald-700, .hover\:text-teal-600, .hover\:text-teal-700):hover {
    color: #86efac;
}

html.dark :where(.hover\:text-red-600, .hover\:text-red-700, .hover\:text-red-800, .hover\:text-red-900, .hover\:text-rose-600, .hover\:text-rose-700):hover {
    color: #fca5a5;
}

html.dark :where(.hover\:text-gray-700, .hover\:text-gray-800, .hover\:text-gray-900, .hover\:text-slate-700, .hover\:text-slate-800, .hover\:text-slate-900, .hover\:text-black):hover {
    color: #f1f5f9;
}

html.dark :where(.hover\:border-gray-300, .hover\:border-gray-400, .hover\:border-slate-300, .hover\:border-slate-400):hover {
    border-color: #4b5563;
}

html.dark :where(.bg-emerald-50, .bg-emerald-100, .bg-emerald-200, .bg-teal-50, .bg-teal-100, .bg-teal-200, .bg-lime-50, .bg-lime-100) {
    background-color: rgb(20 83 45 / 0.42);
}

html.dark :where(.bg-blue-50, .bg-blue-100, .bg-blue-200, .bg-indigo-50, .bg-indigo-100, .bg-indigo-200, .bg-sky-50, .bg-sky-100, .bg-sky-200, .bg-cyan-50, .bg-cyan-100) {
    background-color: rgb(30 58 138 / 0.38);
}

html.dark :where(.bg-purple-50, .bg-purple-100, .bg-purple-200, .bg-fuchsia-50, .bg-fuchsia-100, .bg-violet-50, .bg-violet-100, .bg-violet-200) {
    background-color: rgb(88 28 135 / 0.36);
}

html.dark :where(.bg-red-50, .bg-red-100, .bg-red-200, .bg-pink-50, .bg-pink-100, .bg-rose-50, .bg-rose-100, .bg-rose-200) {
    background-color: rgb(127 29 29 / 0.38);
}

html.dark :where(.bg-yellow-50, .bg-yellow-100, .bg-yellow-200, .bg-amber-50, .bg-amber-100, .bg-amber-200, .bg-orange-50, .bg-orange-100, .bg-orange-200) {
    background-color: rgb(120 53 15 / 0.38);
}

html.dark :where(.text-emerald-800, .text-emerald-900, .text-teal-800, .text-teal-900) {
    color: #86efac;
}

html.dark :where(.text-blue-800, .text-blue-900, .text-indigo-800, .text-indigo-900, .text-sky-800, .text-sky-900) {
    color: #93c5fd;
}

html.dark :where(.text-red-800, .text-red-900, .text-rose-800, .text-rose-900, .text-pink-800, .text-pink-900) {
    color: #fca5a5;
}

html.dark :where(.text-yellow-800, .text-yellow-900, .text-amber-800, .text-amber-900, .text-orange-800, .text-orange-900) {
    color: #fcd34d;
}

html.dark :where(.text-purple-800, .text-purple-900, .text-violet-800, .text-violet-900, .text-fuchsia-800, .text-fuchsia-900) {
    color: #d8b4fe;
}

html.dark :where(.text-emerald-600, .text-emerald-700, .text-teal-600, .text-teal-700, .text-lime-600, .text-lime-700) {
    color: #4ade80;
}

html.dark :where(.text-blue-600, .text-blue-700, .text-indigo-600, .text-indigo-700, .text-sky-600, .text-sky-700, .text-cyan-600, .text-cyan-700) {
    color: #60a5fa;
}

html.dark :where(.text-purple-600, .text-purple-700, .text-fuchsia-600, .text-fuchsia-700, .text-violet-600, .text-violet-700) {
    color: #c084fc;
}

html.dark :where(.text-red-600, .text-red-700, .text-pink-600, .text-pink-700, .text-rose-600, .text-rose-700) {
    color: #f87171;
}

html.dark :where(.text-yellow-600, .text-yellow-700, .text-amber-600, .text-amber-700, .text-orange-600, .text-orange-700) {
    color: #fbbf24;
}

html.dark :where(.border-emerald-100, .border-emerald-200, .border-teal-100, .border-teal-200) {
    border-color: #166534;
}

html.dark :where(.border-blue-100, .border-blue-200, .border-indigo-100, .border-indigo-200, .border-sky-100, .border-sky-200, .border-cyan-100, .border-cyan-200) {
    border-color: #1e40af;
}

html.dark :where(.border-red-100, .border-red-200, .border-pink-100, .border-pink-200, .border-rose-100, .border-rose-200) {
    border-color: #991b1b;
}

html.dark :where(.border-yellow-100, .border-yellow-200, .border-amber-100, .border-amber-200, .border-orange-100, .border-orange-200) {
    border-color: #92400e;
}

html.dark :where(.border-purple-100, .border-purple-200, .border-violet-100, .border-violet-200, .border-fuchsia-100, .border-fuchsia-200) {
    border-color: #6b21a8;
}

html.dark :where(.hover\:text-marca-600, .hover\:text-marca-700):hover {
    color: rgb(var(--marca-300));
}

html.dark :where(.bg-marca-50, .bg-marca-100, .bg-marca-200) {
    background-color: rgb(var(--marca-900) / 0.42);
}

html.dark :where(.text-marca-800, .text-marca-900) {
    color: rgb(var(--marca-200));
}

html.dark :where(.text-marca-600, .text-marca-700) {
    color: rgb(var(--marca-400));
}

html.dark :where(.border-marca-100, .border-marca-200) {
    border-color: rgb(var(--marca-800));
}

html.dark :where(.from-white) {
    --tw-gradient-from: #111827 var(--tw-gradient-from-position);
    --tw-gradient-to: rgb(17 24 39 / 0) var(--tw-gradient-to-position);
}

html.dark :where(.to-white) {
    --tw-gradient-to: #111827 var(--tw-gradient-to-position);
}

html.dark :where(.from-gray-50, .from-slate-50, .from-zinc-50, .from-neutral-50, .from-stone-50) {
    --tw-gradient-from: #1f2937 var(--tw-gradient-from-position);
    --tw-gradient-to: rgb(31 41 55 / 0) var(--tw-gradient-to-position);
}

html.dark :where(.to-gray-50, .to-slate-50, .to-zinc-50, .to-neutral-50, .to-stone-50) {
    --tw-gradient-to: #111827 var(--tw-gradient-to-position);
}

html.dark :where(.from-sky-50, .from-cyan-50) {
    --tw-gradient-from: #082f49 var(--tw-gradient-from-position);
    --tw-gradient-to: rgb(8 47 73 / 0) var(--tw-gradient-to-position);
}

html.dark :where(.from-rose-50) {
    --tw-gradient-from: #4c0519 var(--tw-gradient-from-position);
    --tw-gradient-to: rgb(76 5 25 / 0) var(--tw-gradient-to-position);
}

html.dark :where(.from-teal-50, .from-lime-50) {
    --tw-gradient-from: #042f2e var(--tw-gradient-from-position);
    --tw-gradient-to: rgb(4 47 46 / 0) var(--tw-gradient-to-position);
}

html.dark :where(.to-sky-50, .to-cyan-50) {
    --tw-gradient-to: #082f49 var(--tw-gradient-to-position);
}

html.dark :where(.to-rose-50) {
    --tw-gradient-to: #4c0519 var(--tw-gradient-to-position);
}

html.dark :where(.to-teal-50, .to-lime-50) {
    --tw-gradient-to: #042f2e var(--tw-gradient-to-position);
}

html.dark :where(.from-emerald-50) {
    --tw-gradient-from: #052e16 var(--tw-gradient-from-position);
    --tw-gradient-to: rgb(5 46 22 / 0) var(--tw-gradient-to-position);
}

html.dark :where(.to-emerald-50) {
    --tw-gradient-to: #052e16 var(--tw-gradient-to-position);
}

html.dark :where(.from-marca-50) {
    --tw-gradient-from: rgb(var(--marca-950)) var(--tw-gradient-from-position);
    --tw-gradient-to: rgb(var(--marca-950) / 0) var(--tw-gradient-to-position);
}

html.dark :where(.to-marca-50) {
    --tw-gradient-to: rgb(var(--marca-950)) var(--tw-gradient-to-position);
}

html.dark :where(.from-blue-50, .from-indigo-50) {
    --tw-gradient-from: #172554 var(--tw-gradient-from-position);
    --tw-gradient-to: rgb(23 37 84 / 0) var(--tw-gradient-to-position);
}

html.dark :where(.from-purple-50, .from-fuchsia-50) {
    --tw-gradient-from: #3b0764 var(--tw-gradient-from-position);
    --tw-gradient-to: rgb(59 7 100 / 0) var(--tw-gradient-to-position);
}

html.dark :where(.from-red-50, .from-pink-50) {
    --tw-gradient-from: #450a0a var(--tw-gradient-from-position);
    --tw-gradient-to: rgb(69 10 10 / 0) var(--tw-gradient-to-position);
}

html.dark :where(.from-yellow-50, .from-amber-50, .from-orange-50) {
    --tw-gradient-from: #451a03 var(--tw-gradient-from-position);
    --tw-gradient-to: rgb(69 26 3 / 0) var(--tw-gradient-to-position);
}

html.dark :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="submit"], [type="button"], [type="reset"], [type="color"]), select, textarea) {
    background-color: #111827;
    border-color: var(--linea-de-campo);
    color: #f1f5f9;
}

html.dark :where(input, select, textarea)::placeholder {
    color: #94a3b8;
}

@layer base {
    input:is([type="checkbox"], [type="radio"]) {
        color: rgb(var(--marca-600));
    }
}

html.dark :where(input[type="checkbox"], input[type="radio"]) {
    background-color: #1f2937;
    border-color: #6b7280;
    color: rgb(var(--marca-500));
}

html.dark :where(input, select, textarea):focus {
    border-color: rgb(var(--marca-400));
    box-shadow: 0 0 0 2px rgb(var(--marca-400) / 0.25);
}

html.dark :where(a, button, input, select, textarea):focus-visible {
    outline: 2px solid rgb(var(--marca-400));
    outline-offset: 2px;
}

html.dark :where([aria-invalid="true"], .is-invalid-input) {
    border-color: #fb7185 !important;
    box-shadow: 0 0 0 1px rgb(251 113 133 / 0.45);
}

html.dark :where(.shadow, .shadow-sm, .shadow-md, .shadow-lg, .shadow-xl, .shadow-2xl) {
    --tw-shadow-color: rgb(0 0 0 / 0.45);
}

[hidden]:not([hidden="until-found"]) {
    display: none !important;
}

/* Sin @layer a propósito: debe ganarle a cualquier utilidad de la vista y al color del dueño. */
:is(input, select, textarea):is(:disabled, [readonly]):not([type="checkbox"], [type="radio"], [type="submit"], [type="button"], [type="reset"], [type="hidden"], [type="color"], [type="file"], .flatpickr-input),
.ts-wrapper.disabled .ts-control,
.ts-wrapper.locked .ts-control {
    background-color: #f3f4f6;
    border: 1px dashed #9ca3af;
    color: #4b5563;
    -webkit-text-fill-color: #4b5563;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
}

:is(input, textarea)[readonly]:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"], [type="hidden"], [type="color"], [type="file"], .flatpickr-input),
input:disabled:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"], [type="reset"], [type="hidden"], [type="color"], [type="file"], .flatpickr-input) {
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%236b7280'%3E%3Cpath d='M208,80H176V56a48,48,0,0,0-96,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80ZM96,56a32,32,0,0,1,64,0V80H96ZM208,208H48V96H208V208Zm-68-56a12,12,0,1,1-12-12A12,12,0,0,1,140,152Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

:is(input, textarea)[readonly]:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"], [type="hidden"], [type="color"], [type="file"], .flatpickr-input) {
    cursor: default;
}

html.dark :is(input, select, textarea):is(:disabled, [readonly]):not([type="checkbox"], [type="radio"], [type="submit"], [type="button"], [type="reset"], [type="hidden"], [type="color"], [type="file"], .flatpickr-input),
html.dark .ts-wrapper.disabled .ts-control,
html.dark .ts-wrapper.locked .ts-control {
    background-color: #1f2937;
    border-color: #4b5563;
    color: #9ca3af;
    -webkit-text-fill-color: #9ca3af;
}

:is(.button, .boton-principal, .button-secondary, .button-large-secondary, .button-red, .pestana):disabled {
    background-color: #e5e7eb;
    border-color: #e5e7eb;
    color: #4b5563;
    cursor: not-allowed;
    opacity: 1;
}

html.dark :is(.button, .boton-principal, .button-secondary, .button-large-secondary, .button-red, .pestana):disabled {
    background-color: #374151;
    border-color: #374151;
    color: #d1d5db;
}

@media (forced-colors: active) {
    :is(input, select, textarea):is(:disabled, [readonly]) {
        border-style: dashed;
    }
}

@media print {
    @page {
        margin: 14mm;
    }
}
/* Calendario (flatpickr) con la paleta del proyecto. Va después del tema base airbnb. */
.flatpickr-calendar {
    --cal-fondo: #ffffff;
    --cal-texto: #1f2937;
    --cal-tenue: #6b7280;
    --cal-apagado: #d1d5db;
    --cal-borde: #e5e7eb;
    --cal-hover: #f3f4f6;
    --cal-acento: rgb(var(--marca-700));
    --cal-acento-hover: rgb(var(--marca-800));
    --cal-acento-suave: rgb(var(--marca-100));
    --cal-acento-texto: rgb(var(--marca-800));
    --cal-sombra: 0 12px 28px -6px rgb(17 24 39 / 0.18), 0 2px 6px rgb(17 24 39 / 0.06);

    font-family: inherit;
    background: var(--cal-fondo);
    color: var(--cal-texto);
    border: 1px solid var(--cal-borde);
    border-radius: 12px;
    box-shadow: var(--cal-sombra);
    font-variant-numeric: tabular-nums;
}

html.dark .flatpickr-calendar {
    --cal-fondo: #111827;
    --cal-texto: #f3f4f6;
    --cal-tenue: #9ca3af;
    --cal-apagado: #4b5563;
    --cal-borde: #374151;
    --cal-hover: #1f2937;
    --cal-acento: rgb(var(--marca-700));
    --cal-acento-hover: rgb(var(--marca-600));
    --cal-acento-suave: rgb(var(--marca-900) / 0.55);
    --cal-acento-texto: rgb(var(--marca-300));
    --cal-sombra: 0 16px 36px -8px rgb(0 0 0 / 0.6), 0 2px 6px rgb(0 0 0 / 0.3);
}

.flatpickr-calendar::before,
.flatpickr-calendar::after {
    display: none;
}

.flatpickr-calendar.arrowTop { margin-top: 6px; }
.flatpickr-calendar.arrowBottom { margin-top: -6px; }

.flatpickr-calendar.animate.open {
    animation: calendario-aparece 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes calendario-aparece {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .flatpickr-calendar.animate.open { animation: none; }
}

.flatpickr-calendar .flatpickr-months .flatpickr-month,
.flatpickr-calendar .flatpickr-current-month input.cur-year,
.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months {
    color: var(--cal-texto);
    fill: var(--cal-texto);
    background: transparent;
}

.flatpickr-calendar .flatpickr-months .flatpickr-month {
    height: 48px;
}

.flatpickr-calendar .flatpickr-current-month {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 48px;
    padding: 0;
    font-size: 1rem;
    font-weight: 700;
}

.flatpickr-selector {
    appearance: none;
    padding: 4px 26px 4px 8px;
    border: 1px solid var(--cal-borde);
    border-radius: 8px;
    background: var(--cal-fondo) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath d='M5.3 7.3a1 1 0 0 1 1.4 0L10 10.6l3.3-3.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E") no-repeat right 6px center / 14px;
    color: var(--cal-texto);
    font: inherit;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    transition: border-color 120ms ease-out, background-color 120ms ease-out;
}

.flatpickr-selector:hover { border-color: var(--cal-acento); }

.flatpickr-selector:focus-visible {
    outline: 2px solid var(--cal-acento);
    outline-offset: 1px;
}

.flatpickr-selector option {
    background: var(--cal-fondo);
    color: var(--cal-texto);
}

.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-calendar .flatpickr-current-month input.cur-year {
    font-weight: 700;
    border-radius: 6px;
}

.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months:hover,
.flatpickr-calendar .flatpickr-current-month input.cur-year:hover {
    background: var(--cal-hover);
}

.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {
    background: var(--cal-fondo);
    color: var(--cal-texto);
}

.flatpickr-calendar .flatpickr-months .flatpickr-prev-month,
.flatpickr-calendar .flatpickr-months .flatpickr-next-month {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 6px;
    padding: 0;
    border-radius: 8px;
    color: var(--cal-tenue);
    fill: var(--cal-tenue);
    transition: background-color 120ms ease-out, color 120ms ease-out;
}

.flatpickr-calendar .flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-calendar .flatpickr-months .flatpickr-next-month:hover {
    background: var(--cal-hover);
}

.flatpickr-calendar .flatpickr-months .flatpickr-prev-month svg,
.flatpickr-calendar .flatpickr-months .flatpickr-next-month svg {
    width: 16px;
    height: 16px;
}

.flatpickr-calendar .flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-calendar .flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--cal-acento-texto);
}

.flatpickr-calendar span.flatpickr-weekday {
    background: transparent;
    color: var(--cal-tenue);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.flatpickr-calendar span.flatpickr-day,
.flatpickr-calendar span.flatpickr-day.prevMonthDay,
.flatpickr-calendar span.flatpickr-day.nextMonthDay {
    border: 1px solid transparent;
    border-radius: 8px !important;
    max-width: 40px;
}

.flatpickr-calendar .flatpickr-day {
    color: var(--cal-texto);
    font-weight: 500;
    transition: background-color 120ms ease-out, color 120ms ease-out;
}

.flatpickr-calendar .flatpickr-day:hover,
.flatpickr-calendar .flatpickr-day:focus {
    background: var(--cal-hover);
    border-color: transparent;
}

.flatpickr-calendar .flatpickr-day:focus-visible {
    outline: 2px solid var(--cal-acento);
    outline-offset: 1px;
}

.flatpickr-calendar .flatpickr-day.prevMonthDay,
.flatpickr-calendar .flatpickr-day.nextMonthDay {
    color: var(--cal-tenue);
    opacity: 0.7;
}

.flatpickr-calendar span.flatpickr-day.today:not(.selected),
.flatpickr-calendar span.flatpickr-day.today:not(.selected):hover,
.flatpickr-calendar span.flatpickr-day.today:not(.selected):focus {
    border-color: transparent;
    color: var(--cal-acento-texto);
    font-weight: 700;
}

.flatpickr-calendar span.flatpickr-day.today:not(.selected):hover,
.flatpickr-calendar span.flatpickr-day.today:not(.selected):focus {
    background: var(--cal-acento-suave);
}

.flatpickr-calendar span.flatpickr-day.today::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 5px;
    width: 4px;
    height: 4px;
    border-radius: 9999px;
    background: currentColor;
    transform: translateX(-50%);
}

.flatpickr-calendar .flatpickr-day.selected,
.flatpickr-calendar .flatpickr-day.selected:hover,
.flatpickr-calendar .flatpickr-day.startRange,
.flatpickr-calendar .flatpickr-day.endRange,
.flatpickr-calendar .flatpickr-day.range-start,
.flatpickr-calendar .flatpickr-day.range-end {
    background: var(--cal-acento);
    border-color: var(--cal-acento);
    box-shadow: none;
    color: #ffffff;
    font-weight: 700;
}

.flatpickr-calendar .flatpickr-day.selected:hover,
.flatpickr-calendar .flatpickr-day.range-start:hover,
.flatpickr-calendar .flatpickr-day.range-end:hover {
    background: var(--cal-acento-hover);
}

.flatpickr-calendar .flatpickr-day.inRange,
.flatpickr-calendar .flatpickr-day.in-range {
    background: var(--cal-acento-suave);
    border-color: transparent;
    border-radius: 0 !important;
    color: var(--cal-acento-texto);
    box-shadow: -5px 0 0 var(--cal-acento-suave), 5px 0 0 var(--cal-acento-suave);
}

.flatpickr-calendar span.flatpickr-day.range-start { border-radius: 8px 0 0 8px !important; }
.flatpickr-calendar span.flatpickr-day.range-end { border-radius: 0 8px 8px 0 !important; }
.flatpickr-calendar span.flatpickr-day.range-start.range-end { border-radius: 8px !important; }

.flatpickr-calendar .flatpickr-day.flatpickr-disabled,
.flatpickr-calendar .flatpickr-day.flatpickr-disabled:hover,
.flatpickr-calendar .flatpickr-day.notAllowed {
    background: transparent;
    border-color: transparent;
    color: var(--cal-apagado);
    cursor: not-allowed;
}

.flatpickr-calendar .flatpickr-time {
    border-top: 1px solid var(--cal-borde);
    font-size: 1.25rem;
    line-height: 44px;
    max-height: 44px;
}

.flatpickr-calendar .flatpickr-time input,
.flatpickr-calendar .flatpickr-time .flatpickr-am-pm,
.flatpickr-calendar .flatpickr-time .flatpickr-time-separator {
    color: var(--cal-texto);
    font-size: 1.25rem;
    font-weight: 600;
    height: 44px;
    background: transparent;
}

.flatpickr-calendar .flatpickr-time input:hover,
.flatpickr-calendar .flatpickr-time input:focus,
.flatpickr-calendar .flatpickr-time .flatpickr-am-pm:hover {
    background: var(--cal-hover);
}

.flatpickr-calendar .numInputWrapper span {
    border-color: transparent;
}

.flatpickr-calendar .numInputWrapper span.arrowUp::after { border-bottom-color: var(--cal-tenue); }
.flatpickr-calendar .numInputWrapper span.arrowDown::after { border-top-color: var(--cal-tenue); }

.flatpickr-time__header {
    display: flex;
    justify-content: space-around;
    padding: 8px 0 2px;
    border-top: 1px solid var(--cal-borde);
    color: var(--cal-tenue);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.flatpickr-buttons-wrapper {
    display: flex;
    gap: 6px;
    width: 100%;
    padding: 6px;
    border-top: 1px solid var(--cal-borde);
}

.flatpickr-today-button,
.flatpickr-clear-button {
    flex: 1;
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 120ms ease-out, color 120ms ease-out;
}

.flatpickr-today-button { color: var(--cal-acento-texto); }
.flatpickr-today-button:hover { background: var(--cal-acento-suave); }
.flatpickr-clear-button { color: var(--cal-tenue); }
.flatpickr-clear-button:hover { background: var(--cal-hover); color: var(--cal-texto); }

.flatpickr-today-button:focus-visible,
.flatpickr-clear-button:focus-visible {
    outline: 2px solid var(--cal-acento);
    outline-offset: -2px;
}
.foto-marco {
    position: relative;
    display: block;
    overflow: hidden;
    isolation: isolate;
    background-color: rgb(17 24 39);
    cursor: zoom-in;
}

.foto-marco::before {
    content: "";
    position: absolute;
    inset: -12%;
    z-index: -1;
    background-image: var(--foto);
    background-position: center;
    background-size: cover;
    filter: blur(18px) saturate(1.15) brightness(0.7);
}

.foto-marco>img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.foto-marco:hover>img {
    transform: scale(1.03);
}

.foto-marco:focus-visible {
    @apply outline outline-2 outline-offset-2 outline-marca-500;
}

.visor {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    color: white;
    outline: none;
}

.visor::backdrop {
    background: transparent;
}

.visor-marco {
    position: absolute;
    inset: 0;
    outline: none;
}

.visor-marco:fullscreen {
    width: 100%;
    height: 100%;
    background: rgb(3 7 18);
}

.visor-marco::backdrop {
    background: rgb(3 7 18);
}

.visor-fondo {
    position: absolute;
    inset: 0;
    background: rgb(3 7 18 / 0.94);
    transition: opacity 0.24s ease;
}

.visor-arrastrando .visor-fondo {
    transition: none;
}

.visor-escena {
    position: absolute;
    inset: 0;
    cursor: zoom-out;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.visor-foto {
    position: absolute;
    max-width: none;
    object-fit: contain;
    transform-origin: 50% 50%;
    will-change: transform;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
    @apply rounded-sm shadow-2xl;
}

.visor-ampliada .visor-foto {
    cursor: grab;
}

.visor-ampliada .visor-escena:active .visor-foto {
    cursor: grabbing;
}

.visor-cargando {
    position: absolute;
    left: 50%;
    top: 50%;
    @apply -ml-5 -mt-5 size-10 animate-spin rounded-full border-2 border-white/25 border-t-white;
}

.visor-error {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    @apply text-sm text-white/80;
}

.visor-cargando[hidden],
.visor-error[hidden] {
    display: none;
}

.visor-barra {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: none;
    background: linear-gradient(to bottom, rgb(0 0 0 / 0.55), transparent);
    @apply px-3 py-2 sm:px-4;
}

.visor-contador {
    @apply shrink-0 text-sm font-semibold tabular-nums text-white/90;
}

.visor-titulo {
    @apply min-w-0 flex-1 truncate text-sm text-white/80;
}

.visor-acciones {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
    pointer-events: auto;
}

.visor-boton {
    @apply inline-flex size-10 items-center justify-center rounded-full text-white/90 transition-colors hover:bg-white/15 focus-visible:outline focus-visible:outline-2 focus-visible:outline-marca-400;
}

.visor-boton svg,
.visor-flecha svg {
    @apply size-5;
}

.visor-boton[hidden] {
    display: none;
}

.visor-flecha {
    position: absolute;
    top: 50%;
    z-index: 2;
    @apply inline-flex size-12 -translate-y-1/2 items-center justify-center rounded-full bg-black/35 text-white transition hover:bg-black/60 focus-visible:outline focus-visible:outline-2 focus-visible:outline-marca-400 disabled:pointer-events-none disabled:opacity-0;
}

.visor-flecha-anterior {
    left: 1rem;
}

.visor-flecha-siguiente {
    right: 1rem;
}

.visor-miniaturas {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    display: flex;
    justify-content: safe center;
    gap: 0.5rem;
    overflow-x: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    background: linear-gradient(to top, rgb(0 0 0 / 0.6), transparent);
    @apply px-3 pb-3 pt-6;
}

.visor-miniaturas::-webkit-scrollbar {
    display: none;
}

.visor-miniatura {
    flex: none;
    overflow: hidden;
    opacity: 0.5;
    @apply size-12 rounded-md ring-1 ring-white/20 transition sm:size-14;
}

.visor-miniatura:hover {
    opacity: 0.85;
}

.visor-miniatura[aria-current="true"] {
    opacity: 1;
    @apply ring-2 ring-marca-400;
}

.visor-miniatura img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.visor-barra,
.visor-flecha,
.visor-miniaturas {
    transition: opacity 0.2s ease;
}

.visor[open] .visor-barra,
.visor[open] .visor-flecha:not(:disabled),
.visor[open] .visor-miniaturas {
    animation: visor-aparecer 0.3s ease both;
}

.visor-sin-controles .visor-barra,
.visor-sin-controles .visor-flecha,
.visor-sin-controles .visor-miniaturas,
.visor-cerrando .visor-barra,
.visor-cerrando .visor-flecha,
.visor-cerrando .visor-miniaturas,
.visor-ampliada .visor-flecha,
.visor-ampliada .visor-miniaturas {
    opacity: 0 !important;
    pointer-events: none !important;
}

.visor-unica .visor-flecha,
.visor-unica .visor-miniaturas,
.visor-unica .visor-contador {
    display: none;
}

@keyframes visor-aparecer {
    from {
        opacity: 0;
    }
}

@media (hover: none) {
    .visor-flecha {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    .foto-marco>img,
    .visor-fondo,
    .visor-barra,
    .visor-flecha,
    .visor-miniaturas {
        transition: none;
        animation: none;
    }
}

.zona-fotos {
    position: relative;
    @apply rounded-xl;
}

.zona-fotos.dz-drag-hover {
    @apply outline-dashed outline-2 outline-offset-4 outline-marca-500;
}

.zona-fotos-lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    @apply gap-3;
}

.zona-fotos-agregar {
    @apply flex min-h-[11.5rem] flex-col items-center justify-center gap-1 rounded-xl border-2 border-dashed border-gray-300 bg-gray-50 px-3 text-center text-sm text-gray-700 transition-colors hover:border-marca-500 hover:bg-marca-50 hover:text-marca-800 focus-visible:outline focus-visible:outline-2 focus-visible:outline-marca-500 dark:border-gray-700 dark:bg-gray-900/60 dark:text-gray-300 dark:hover:border-marca-500 dark:hover:bg-marca-900/20 dark:hover:text-marca-200;
}

.zona-fotos.dz-drag-hover .zona-fotos-agregar {
    @apply border-marca-500 bg-marca-50 text-marca-800 dark:bg-marca-900/30 dark:text-marca-200;
}

.zona-fotos-aviso {
    @apply mb-3 rounded-md border px-3 py-2.5 text-sm;
}

.zona-fotos-aviso[data-tipo="listo"] {
    @apply border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-900/60 dark:bg-emerald-950/40 dark:text-emerald-200;
}

.zona-fotos-aviso[data-tipo="error"] {
    @apply border-red-200 bg-red-50 text-red-800 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200;
}

.foto-carga {
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    @apply rounded-lg border border-gray-200 bg-white transition-colors hover:border-gray-300 dark:border-gray-800 dark:bg-gray-900 dark:hover:border-gray-700;
}

.foto-carga.dz-error {
    @apply border-red-400 dark:border-red-700;
}

.foto-carga-imagen {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    isolation: isolate;
    background-color: rgb(17 24 39);
}

.foto-carga-guardada .foto-carga-imagen {
    cursor: zoom-in;
}

.foto-carga-foto {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.foto-carga-guardada:hover .foto-carga-foto {
    transform: scale(1.03);
}

.foto-carga-fondo {
    position: absolute;
    inset: -12%;
    width: 124%;
    height: 124%;
    max-width: none;
    object-fit: cover;
    filter: blur(16px) saturate(1.1) brightness(0.65);
}

.foto-carga-foto:not([src]),
.foto-carga-fondo:not([src]) {
    visibility: hidden;
}

.foto-carga-progreso {
    position: absolute;
    z-index: 2;
    inset: auto 0.5rem 0.5rem 0.5rem;
    height: 0.375rem;
    overflow: hidden;
    opacity: 0;
    @apply rounded-full bg-black/45 transition-opacity;
}

.foto-carga-progreso>span {
    display: block;
    width: 0;
    height: 100%;
    @apply bg-marca-400 transition-[width] duration-200;
}

.dz-processing:not(.dz-complete) .foto-carga-progreso {
    opacity: 1;
}

.foto-carga-listo {
    position: absolute;
    z-index: 2;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    @apply inline-flex size-7 items-center justify-center rounded-full bg-relleno text-sobre-relleno shadow;
}

.foto-carga-listo svg {
    @apply size-4;
}

.dz-success .foto-carga-listo {
    animation: foto-carga-listo 2.6s ease forwards;
}

.foto-carga-pie {
    display: flex;
    align-items: center;
    @apply gap-1 px-2.5 py-1.5;
}

.foto-carga-datos {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.foto-carga-nombre {
    @apply truncate text-xs font-medium text-gray-800 dark:text-gray-200;
}

.foto-carga-peso {
    @apply text-[0.7rem] tabular-nums text-gray-500 dark:text-gray-400;
}

.foto-carga-peso strong {
    font-weight: 600;
}

.foto-carga-acciones {
    display: flex;
    flex-shrink: 0;
}

.foto-carga-boton {
    @apply inline-flex size-8 items-center justify-center rounded-lg text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline focus-visible:outline-2 focus-visible:outline-marca-500 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-100;
}

.foto-carga-boton[hidden] {
    display: none;
}

.foto-carga-boton svg {
    @apply size-[1.1rem];
}

.foto-carga-eliminar:hover {
    @apply bg-red-50 text-red-700 dark:bg-red-900/30 dark:text-red-300;
}

.foto-carga-error {
    display: none;
    @apply px-2.5 pb-2 text-xs text-red-700 dark:text-red-300;
}

.dz-error .foto-carga-error {
    display: block;
}

@keyframes foto-carga-listo {
    0% {
        opacity: 0;
        transform: scale(0.6);
    }

    15% {
        opacity: 1;
        transform: scale(1);
    }

    80% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1);
    }
}

.feria-tarjeta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: calc(var(--radio, 6px) * 2);
    border: 1px solid var(--borde, #dcdcd7);
    background: var(--papel, #ffffff);
    transition: border-color 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.feria-tarjeta:hover {
    border-color: var(--tinta-suave, #55565f);
}

.feria-tarjeta-texto {
    display: flex;
    flex-direction: column;
    @apply gap-0.5 px-4 py-3.5;
}

.foto-animal-escenario {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    isolation: isolate;
    @apply rounded-xl border border-gray-200 bg-gray-100 dark:border-gray-800 dark:bg-gray-900;
}

.foto-animal-vacia {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    @apply m-3 gap-1 rounded-lg border-2 border-dashed border-gray-300 px-6 text-sm text-gray-600 dark:border-gray-700 dark:text-gray-400;
}

.foto-animal-sello {
    position: absolute;
    z-index: 2;
    left: 0.625rem;
    top: 0.625rem;
    pointer-events: none;
    @apply rounded-full bg-black/60 px-2.5 py-0.5 text-xs font-semibold text-white backdrop-blur;
}

.foto-animal-sello-nueva {
    @apply bg-marca-600/90;
}

.foto-animal-soltar {
    position: absolute;
    z-index: 3;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    @apply m-2 rounded-lg border-2 border-dashed border-marca-400 bg-marca-950/70 text-sm font-semibold text-white backdrop-blur-sm;
}

.foto-animal-arrastrando .foto-animal-soltar {
    opacity: 1;
}

.foto-animal-progreso {
    position: absolute;
    z-index: 3;
    inset: auto 0 0 0;
    height: 0.25rem;
    overflow: hidden;
    opacity: 0;
    @apply bg-black/30;
}

.foto-animal-progreso>span {
    position: absolute;
    inset: 0 auto 0 0;
    width: 35%;
    @apply bg-marca-400;
}

.foto-animal-enviando .foto-animal-progreso {
    opacity: 1;
}

.foto-animal-enviando .foto-animal-progreso>span {
    animation: foto-animal-progreso 1.1s ease-in-out infinite;
}

.foto-animal-enviando .foto-animal-escenario img {
    filter: saturate(0.6) brightness(0.85);
    transition: filter 0.2s ease;
}

@keyframes foto-animal-progreso {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(300%);
    }
}

.visor-miniatura {
    position: relative;
    @apply bg-gray-800;
}

.visor-miniatura::before {
    content: attr(data-numero);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    @apply text-[0.7rem] font-semibold text-white/60;
}

.visor-miniatura img {
    position: relative;
}

.visor-miniatura img:not([src]) {
    visibility: hidden;
}

.foto-animal-cuenta {
    position: absolute;
    right: -0.375rem;
    bottom: -0.375rem;
    pointer-events: none;
    @apply inline-flex min-w-[1.375rem] items-center justify-center rounded-full bg-relleno px-1.5 py-0.5 text-[0.7rem] font-bold tabular-nums text-sobre-relleno shadow ring-2 ring-white dark:ring-gray-900;
}

.foto-animal-pila {
    @apply flex size-16 flex-col items-center justify-center gap-0.5 rounded-xl border-2 border-dashed border-gray-300 text-gray-600 transition-colors hover:border-marca-500 hover:text-marca-700 dark:border-gray-700 dark:text-gray-400 dark:hover:text-marca-300;
}

[data-controller~="galeria"][aria-busy="true"] {
    cursor: progress;
}

/* ================= Genealogy Tree Base ================= */
/* El árbol crece de izquierda a derecha, como en el PDF: el animal a la
   izquierda y cada generación en una columna, con el padre arriba y la madre
   abajo. Así el ancho crece una columna por generación y lo que se multiplica
   es el alto, que la página recorre sola. Cada <li> es una grilla: el recuadro
   en la primera columna y, en la segunda, la <ul> con sus padres. */
.gene-tree {
    /* Variables para fácil ajuste */
    --box-w: 136px;             /* ancho de los recuadros */
    --stub: 14px;               /* cada tramo horizontal de los conectores */
    --row-gap: 3px;             /* aire arriba y abajo de cada recuadro */
    --line: #D1D5DB;            /* color de líneas */
    --hover: #fbbf24;           /* color de resalte (hover) */
    --origin: #fb923c;          /* color del nodo origen (hover) */
    --node-bg: #FFFFFF;         /* fondo del nodo */
    --node-fg: #111827;          /* texto del nodo */
    --node-border: #9CA3AF;     /* borde del nodo */

    overflow-x: auto;
    padding: 16px;
    background: transparent; /* evita conflicto con bg-* del contenedor */
}

html.dark .gene-tree {
    --line: #64748b;
    --node-bg: #1f2937;
    --node-fg: #f1f5f9;
    --node-border: #64748b;
}

.gene-tree ul {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
    padding: 0 0 0 var(--stub);
}

.gene-tree > ul { padding-left: 0; }

.gene-tree li {
    list-style: none;
    position: relative;
    display: grid;
    grid-template-columns: var(--box-w) auto;
    grid-template-rows: 1fr auto 1fr; /* el recuadro, centrado entre sus padres */
    padding: var(--row-gap) 0 var(--row-gap) var(--stub);
}

.gene-tree > ul > li { padding-left: 0; }

.gene-tree li > .gene-node,
.gene-tree li > .gene-role { grid-column: 1; grid-row: 2; }
.gene-tree li > .gene-more { grid-column: 2; grid-row: 2; }
.gene-tree li > ul { grid-column: 2; grid-row: 1 / -1; }

/* ================= Líneas del Árbol ================= */
/* Del recuadro sale el tronco (ul::before) hasta una barra vertical que va del
   padre a la madre; cada <li> pinta su mitad de la barra (border-left) y el
   tramo hasta su recuadro: el padre, la mitad de abajo (::after) y la madre,
   la de arriba (::before). */
.gene-tree li::before,
.gene-tree li::after {
    content: '';
    position: absolute;
    left: 0;
    width: var(--stub);
    height: 50%;
    border-left: 1px solid var(--line);
    display: block;
    transition: border-color 0.2s ease;
    pointer-events: none; /* <- líneas no capturan el mouse */
}

.gene-tree li::before {
    top: 0;
    border-bottom: 1px solid var(--line);
}

.gene-tree li::after {
    top: 50%;
    border-top: 1px solid var(--line);
}

.gene-tree li:first-child::before { border: 0 none; }
.gene-tree li:last-child::after { border: 0 none; }

.gene-tree li:only-child::before,
.gene-tree li:only-child::after {
    display: none;
}

.gene-tree ul ul::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: var(--stub);
    height: 0;
    border-top: 1px solid var(--line);
    transition: border-color 0.2s ease;
    pointer-events: none; /* <- tronco no bloquea hover */
}

/* ================= Columnas ================= */
/* Un título por generación, alineado con su columna de recuadros. */
.gene-columns {
    display: flex;
    margin-bottom: 8px;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #6B7280;
    white-space: nowrap;
}

.gene-column {
    flex: none;
    width: calc(var(--box-w) + 2 * var(--stub));
    padding-left: calc(2 * var(--stub));
    overflow: hidden;
    text-overflow: ellipsis;
}

.gene-column.is-first {
    width: var(--box-w);
    padding-left: 0;
}

html.dark .gene-columns { color: #94a3b8; }

/* ================= Nodos ================= */
.gene-node {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    column-gap: 6px;
    min-width: 0;
    /* arriba, el lugar del parentesco (.gene-role, que va encima) */
    padding: calc(5px + .7rem * 1.25) 8px 5px 9px;
    background: var(--node-bg);
    color: var(--node-fg);
    border: 1px solid var(--node-border);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-weight: 600;
    font-size: .9rem;
    line-height: 1.2;
    text-align: left;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: auto;
    user-select: text;
}

.gene-arete {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.gene-meta {
    display: flex;
    gap: 4px;
}

.gene-name {
    font-size: .7rem;
    color: #6b7280;
    font-weight: normal;
    white-space: nowrap;
}

/* El parentesco, en la primera línea del recuadro: va en la misma celda de
   la grilla, arriba, y deja pasar el mouse al recuadro. */
.gene-role {
    align-self: start;
    position: relative;
    z-index: 1;
    min-width: 0;
    padding: 5px 8px 0 12px; /* el borde izquierdo de color mide 3px */
    font-size: .7rem;
    line-height: 1.25;
    color: #6B7280;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

/* ================= Estados Base ================= */
.gene-node.is-missing {
    background: #F9FAFB;
    border-style: dashed;
    color: #9CA3AF;
    font-weight: 500;
    white-space: nowrap;
}

.gene-node.is-root {
    background: #f0fdf4;
    border-color: #10b981;
    border-width: 2px;
}

html.dark .gene-name,
html.dark .gene-role { color: #cbd5e1; }

html.dark .gene-node.is-missing {
    background: #111827;
    border-color: #475569;
    color: #94a3b8;
}

html.dark .gene-node.is-root {
    background: #052e16;
    border-color: #34d399;
}

.gene-node.is-male { border-left: 3px solid #60a5fa; }
.gene-node.is-female { border-left: 3px solid #f472b6; }

/* ================= Hasta dónde se ve ================= */
/* Se ven a la vez las generaciones que entran a lo ancho (las cuenta el
   controlador genealogy, hasta cuatro) desde el recuadro de la izquierda: el
   animal o el antepasado al que se llegó con la flecha. Antes de que el
   controlador mida, hasta los tatarabuelos. */
.gene-tree:not(.is-ready) li[data-depth="4"] > ul,
.gene-tree:not(.is-ready) .gene-columns,
.gene-tree li.at-edge > ul { display: none; }

/* Flecha de los recuadros del borde con antepasados registrados */
.gene-more { display: none; }

.gene-tree li.at-edge > .gene-more {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 22px;
    height: 22px;
    margin-left: 4px;
    border: 1px solid var(--node-border);
    border-radius: 9999px;
    background: var(--node-bg);
    color: var(--node-fg);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.gene-tree li.at-edge > .gene-more:hover,
.gene-tree li.at-edge > .gene-more:focus-visible {
    border-color: #10b981;
    color: #047857;
    outline: none;
}

html.dark .gene-tree li.at-edge > .gene-more:hover,
html.dark .gene-tree li.at-edge > .gene-more:focus-visible {
    border-color: #34d399;
    color: #34d399;
}

/* Siguiendo una línea: los <li> desde el animal hasta el recuadro de la
   izquierda (focus-line) quedan solo como envoltorio; de ellos no se ve el
   recuadro, ni las líneas, ni el otro padre. */
.gene-tree li.focus-line {
    display: block;
    padding: 0;
}

.gene-tree li.focus-line > :not(ul),
.gene-tree li.focus-line > ul > li:not(.focus-line):not(.focus-root) { display: none; }

.gene-tree li.focus-line > ul { padding-left: 0; }

.gene-tree li.focus-line::before,
.gene-tree li.focus-line::after,
.gene-tree li.focus-line > ul::before,
.gene-tree li.focus-line > ul::after,
.gene-tree li.focus-root::before,
.gene-tree li.focus-root::after { display: none; }

.gene-tree li.focus-root { padding-left: 0; }

/* Ruta desde el animal hasta el recuadro de la izquierda */
.gene-trail {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin-bottom: 12px;
    font-size: .8rem;
    color: #4b5563;
}

.gene-trail[hidden] { display: none; }

.gene-trail-label { font-weight: 600; }

.gene-trail-step {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #111827;
}

button.gene-trail-step:hover,
button.gene-trail-step:focus-visible {
    border-color: #10b981;
    background: #f0fdf4;
    outline: none;
}

.gene-trail-step.is-current {
    border-color: #10b981;
    border-width: 2px;
    background: #f0fdf4;
}

.gene-trail-step small {
    font-size: .7rem;
    color: #6b7280;
}

.gene-trail-separator { color: #9ca3af; }

html.dark .gene-trail { color: #cbd5e1; }

html.dark .gene-trail-step {
    border-color: #475569;
    background: #1f2937;
    color: #f1f5f9;
}

html.dark button.gene-trail-step:hover,
html.dark button.gene-trail-step:focus-visible,
html.dark .gene-trail-step.is-current {
    border-color: #34d399;
    background: #052e16;
}

html.dark .gene-trail-step small { color: #cbd5e1; }

/* ================= Estados de Hover ================= */
.gene-node:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* Recuadros de la línea hasta el animal (solo el li activo, no sus hijos) */
li.hover-active > .gene-node {
    background: #fef3c7;
    border-color: var(--hover);
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.2);
}

html.dark li.hover-active > .gene-node,
html.dark li.pinned-trace > .gene-node {
    background: #422006;
    color: #fef3c7;
}

/* Nodo origen del hover */
li.hover-origin > .gene-node {
    background: #fed7aa;
    border-color: var(--origin);
    border-width: 2px;
    box-shadow: 0 3px 6px rgba(251, 146, 60, 0.25);
}

html.dark li.hover-origin > .gene-node,
html.dark li.pinned-origin > .gene-node {
    background: #431407;
    color: #ffedd5;
}

/* Líneas resaltadas: el tronco a la derecha del recuadro (ul::before), el
   tramo vertical hasta cada padre marcado (ul::after, que mide el controlador
   genealogy) y el tramo horizontal que llega a ese padre (li.link-*). */
.gene-tree ul.has-hover-child::before,
.gene-tree ul.has-pinned-child::before {
    border-color: var(--hover);
}

.gene-tree ul.has-segment::after {
    content: '';
    position: absolute;
    left: var(--stub);
    top: var(--segment-top);
    height: var(--segment-height);
    border-left: 1px solid var(--hover);
    pointer-events: none;
}

.gene-tree li.link-hover::before,
.gene-tree li.link-pin::before {
    border-bottom-color: var(--hover);
}

.gene-tree li.link-hover::after,
.gene-tree li.link-pin::after {
    border-top-color: var(--hover);
}

/* Antepasados del recuadro (modo "Sus ancestros") */
li.hover-ancestor > .gene-node {
    background: #dbeafe;
    border-color: #60a5fa;
}

html.dark li.hover-ancestor > .gene-node {
    background: #172554;
    color: #dbeafe;
}

/* ================= Estado Pineado ================= */
li.pinned > .gene-node::before {
    content: "📌";
    position: absolute;
    top: -12px;
    right: -8px;
    font-size: 18px;
    z-index: 10;
}

/* Igual que hover, pero para el trazo fijo (pin) */
li.pinned-trace > .gene-node {
    background: #fef3c7;
    border-color: var(--hover);
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.2);
}

/* Origen pineado (además del 📌 visual) */
li.pinned-origin > .gene-node {
    background: #fed7aa;
    border-color: var(--origin);
    border-width: 2px;
    box-shadow: 0 3px 6px rgba(251, 146, 60, 0.25);
}

/* ================= Responsividad ================= */
@media (max-width: 768px) {
    .gene-tree {
        padding: 10px;
        -webkit-overflow-scrolling: touch;
        --box-w: 118px;
        --stub: 10px;
    }

    .gene-node { font-size: 0.8rem; }

    .gene-role,
    .gene-columns { font-size: 0.65rem; }
}
@layer components {
    .modal {
        --modal-fondo: rgb(3 7 18 / 0.45);
        --modal-entrada: 240ms cubic-bezier(0.2, 0, 0, 1);
        --modal-salida: 150ms ease-out;
        --modal-desde: translateY(8px) scale(0.97);

        position: fixed;
        inset: 0;
        z-index: 40;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1.5rem;
        background: var(--modal-fondo);
        opacity: 1;
        transition: opacity var(--modal-entrada);
    }

    html.dark .modal {
        --modal-fondo: rgb(0 0 0 / 0.6);
    }

    .modal[data-pos="center"] {
        --modal-desde: translateY(12px) scale(0.96);
    }

    .modal[data-pos="center"][data-cerrando] {
        --modal-desde: translateY(-12px) scale(0.96);
    }

    .modal[data-pos="center"] .modal-panel {
        transform-origin: calc(50% + var(--origen-x, 0px)) calc(50% + var(--origen-y, 0px));
    }

    .modal[data-pos="top"] {
        align-items: flex-start;
        padding-top: 4rem;
        --modal-desde: translateY(-16px);
    }

    .modal[data-pos="bottom"] {
        align-items: flex-end;
        padding-bottom: 0;
        --modal-desde: translateY(24px);
    }

    .modal[data-pos="left"] {
        justify-content: flex-start;
        padding: 0;
        --modal-desde: translateX(-100%);
    }

    .modal[data-pos="right"] {
        justify-content: flex-end;
        padding: 0;
        --modal-desde: translateX(100%);
    }

    .modal-panel {
        position: relative;
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 64rem;
        min-height: 12rem;
        max-height: 100%;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0 1.5rem 1rem;
        border-radius: 12px;
        background: #f3f4f6;
        color: #111827;
        box-shadow: 0 24px 48px -12px rgb(0 0 0 / 0.35), 0 4px 12px rgb(0 0 0 / 0.08);
        transform: none;
        opacity: 1;
        filter: blur(0);
        transition: transform var(--modal-entrada), opacity var(--modal-entrada), filter var(--modal-entrada);
    }

    html.dark .modal-panel,
    .modal-panel[data-tema="oscuro"] {
        background: #111827;
        color: #f3f4f6;
        box-shadow: 0 24px 48px -12px rgb(0 0 0 / 0.7);
    }

    .modal-panel:focus-visible {
        outline: 2px solid rgb(var(--marca-600));
        outline-offset: 2px;
    }

    .modal-panel[data-tam="tiny"] {
        max-width: 32rem;
    }

    .modal-panel[data-tam="small"] {
        max-width: 48rem;
    }

    .modal-panel[data-tam="large"] {
        max-width: 83.333%;
    }

    .modal-panel[data-tam="full"] {
        max-width: none;
        height: 100%;
    }

    .modal[data-pos="bottom"] .modal-panel {
        border-radius: 16px 16px 0 0;
    }

    .modal[data-pos="left"] .modal-panel,
    .modal[data-pos="right"] .modal-panel {
        height: 100%;
    }

    .modal[data-pos="left"] .modal-panel {
        border-radius: 0 16px 16px 0;
    }

    .modal[data-pos="right"] .modal-panel {
        border-radius: 16px 0 0 16px;
    }

    .modal[data-morfismo],
    .modal[data-morfismo] .modal-panel {
        transition: none;
    }

    @starting-style {
        .modal {
            opacity: 0;
        }

        .modal-panel {
            opacity: 0;
            transform: var(--modal-desde);
            filter: blur(4px);
        }
    }

    .modal[data-cerrando] {
        opacity: 0;
        transition: opacity var(--modal-salida);
    }

    .modal[data-cerrando] .modal-panel {
        opacity: 0;
        transform: var(--modal-desde);
        filter: blur(4px);
        transition: transform var(--modal-salida), opacity var(--modal-salida), filter var(--modal-salida);
    }

    @media (max-width: 639px) {

        .modal,
        .modal[data-pos] {
            align-items: flex-end;
            justify-content: center;
            padding: 0;
            --modal-desde: translateY(100%);
        }

        .modal .modal-panel,
        .modal[data-pos] .modal-panel {
            max-width: none;
            height: auto;
            max-height: 92dvh;
            border-radius: 16px 16px 0 0;
            padding-bottom: calc(1rem + env(safe-area-inset-bottom));
        }

        .modal .modal-panel[data-tam="full"] {
            height: 100dvh;
            max-height: 100dvh;
            border-radius: 0;
        }
    }

    .modal-panel[data-sacudir] {
        animation: modal-sacudir 360ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
    }

    @keyframes modal-sacudir {
        20% {
            translate: -8px 0;
        }

        40% {
            translate: 6px 0;
        }

        60% {
            translate: -4px 0;
        }

        80% {
            translate: 2px 0;
        }
    }

    .modal-cerrar {
        @apply absolute right-3 top-3 z-20 inline-flex size-10 items-center justify-center rounded-lg text-gray-600 transition-colors duration-150 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-marca-600 dark:text-gray-300;
    }

    @media (hover: hover) {
        .modal-cerrar:hover {
            @apply bg-gray-200 text-gray-900 dark:bg-gray-800 dark:text-white;
        }
    }

    @media (pointer: coarse) {
        .modal-cerrar {
            min-width: 44px;
            min-height: 44px;
        }
    }

    .modal-confirmar button {
        min-height: 44px;
    }

    .modal-confirmar button:focus-visible {
        outline: 2px solid rgb(var(--marca-600));
        outline-offset: 2px;
    }

    @media (prefers-reduced-motion: no-preference) {

        .modal button,
        .modal-confirmar button {
            transition: scale 150ms ease-out, background-color 150ms ease-out, color 150ms ease-out;
        }

        .modal button:not(:disabled):active,
        .modal-confirmar button:not(:disabled):active {
            scale: 0.96;
        }
    }

    .modal-pie {
        @apply mt-auto flex justify-center pt-3;
    }

    .modal-panel:has(form [type="submit"]) .modal-pie {
        display: none;
    }

    .modal-cargando {
        @apply absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 rounded-[inherit] bg-gray-100/85 text-sm text-gray-600 dark:bg-gray-900/85 dark:text-gray-400;
    }

    .modal-cargando-anillo {
        @apply size-8 rounded-full border-[3px] border-marca-700 border-t-transparent dark:border-marca-500 dark:border-t-transparent;
        animation: modal-girar 800ms linear infinite;
    }

    @keyframes modal-girar {
        to {
            rotate: 360deg;
        }
    }

    .modal-error {
        @apply py-8 text-center text-red-700 dark:text-red-300;
    }

    .modal-title {
        @apply mb-4 pr-10 text-xl font-bold tracking-tight text-gray-900 dark:text-gray-100;
    }

    .modal-panel turbo-frame > .modal-title:first-of-type,
    .modal-panel form > .modal-title:first-of-type {
        @apply mt-5;
    }

    .modal-confirmar {
        @apply w-[min(28rem,calc(100%-2rem))] rounded-xl border border-transparent bg-gray-100 p-0 text-gray-900 shadow-2xl dark:border-gray-800 dark:bg-gray-900 dark:text-gray-100;
        opacity: 0;
        transform: translateY(-12px) scale(0.96);
        filter: blur(4px);
        max-height: calc(100dvh - 2rem);
        overscroll-behavior: contain;
        transition: opacity 150ms ease-out, transform 150ms ease-out, filter 150ms ease-out, overlay 150ms allow-discrete, display 150ms allow-discrete;
    }

    .modal-confirmar[open] {
        opacity: 1;
        transform: none;
        filter: blur(0);
        transition: opacity 240ms cubic-bezier(0.2, 0, 0, 1), transform 240ms cubic-bezier(0.2, 0, 0, 1), filter 240ms cubic-bezier(0.2, 0, 0, 1), overlay 240ms allow-discrete, display 240ms allow-discrete;
    }

    .modal-confirmar::backdrop {
        background: rgb(3 7 18 / 0);
        transition: background-color 160ms ease-in, overlay 160ms allow-discrete, display 160ms allow-discrete;
    }

    .modal-confirmar[open]::backdrop {
        background: rgb(3 7 18 / 0.45);
    }

    html.dark .modal-confirmar[open]::backdrop {
        background: rgb(0 0 0 / 0.6);
    }

    @starting-style {
        .modal-confirmar[open] {
            opacity: 0;
            transform: translateY(12px) scale(0.96);
            filter: blur(4px);
        }

        .modal-confirmar[open]::backdrop {
            background: rgb(3 7 18 / 0);
        }
    }

    .overlay {
        @apply fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4;
        transition: opacity 200ms ease-out;
    }

    .modal-tiny {
        @apply relative w-full max-w-screen-md overflow-y-auto rounded-xl border border-marca-700 bg-gray-100 px-6 pb-4 max-h-[92dvh] dark:border-marca-600 dark:bg-gray-900 dark:text-gray-100;
        overscroll-behavior: contain;
        transition: transform 240ms cubic-bezier(0.2, 0, 0, 1), opacity 240ms cubic-bezier(0.2, 0, 0, 1);
    }

    .overlay[data-cerrando] {
        opacity: 0;
        transition-duration: 150ms;
    }

    .overlay[data-cerrando] .modal-tiny {
        opacity: 0;
        transform: translateY(-12px);
        transition-duration: 150ms;
    }

    @starting-style {
        .overlay {
            opacity: 0;
        }

        .modal-tiny {
            opacity: 0;
            transform: translateY(12px) scale(0.96);
        }
    }

    @media (prefers-reduced-motion: reduce) {

        .modal,
        .modal[data-pos],
        .modal .modal-panel {
            --modal-desde: none;
        }

        .modal,
        .modal .modal-panel,
        .modal[data-cerrando] .modal-panel,
        .overlay,
        .overlay .modal-tiny {
            filter: none;
            transition: opacity 100ms ease-out;
        }

        .modal-confirmar,
        .modal-confirmar[open] {
            transform: none;
            filter: none;
            transition: opacity 100ms ease-out, overlay 100ms allow-discrete, display 100ms allow-discrete;
        }

        .modal-tiny,
        .overlay[data-cerrando] .modal-tiny {
            transform: none;
        }

        .modal-panel[data-sacudir] {
            animation: none;
            box-shadow: 0 0 0 3px rgb(var(--marca-700)), 0 24px 48px -12px rgb(0 0 0 / 0.35);
        }
    }
}

:root:has(.modal[data-bloquea-scroll]),
:root:has(.modal-confirmar[open]),
:root[data-sidebar-abierto],
:root:has(body.no-scroll) {
    overflow: hidden;
    scrollbar-gutter: stable;
}

@layer components {
    html[data-transicion]::view-transition-group(*) {
        @apply ease-suave;
        animation-duration: 320ms;
    }

    html[data-transicion]::view-transition-old(root) {
        @apply z-[1] animate-desaparece-fondo;
    }

    html[data-transicion]::view-transition-new(root) {
        animation: none;
    }

    html[data-transicion]::view-transition-group(morfismo) {
        @apply z-[100] overflow-clip rounded-xl;
    }

    html[data-transicion]::view-transition-image-pair(morfismo) {
        @apply bg-gray-100;
    }

    html.dark[data-transicion]::view-transition-image-pair(morfismo) {
        @apply bg-gray-900;
    }

    html[data-transicion="salida"]::view-transition-group(morfismo) {
        animation-duration: 260ms;
    }

    html[data-transicion="salida"]::view-transition-image-pair(morfismo) {
        @apply animate-morfismo-fondo-sale;
    }

    html[data-transicion="salida"]::view-transition-group(fondo-modal) {
        @apply z-50;
    }

    html[data-transicion="salida"]::view-transition-old(fondo-modal) {
        @apply animate-desaparece-fondo;
    }

    html[data-transicion]::view-transition-old(morfismo),
    html[data-transicion]::view-transition-new(morfismo) {
        @apply h-full object-none object-top;
    }

    html[data-transicion]::view-transition-old(morfismo) {
        @apply animate-desaparece;
    }

    html[data-transicion]::view-transition-new(morfismo) {
        @apply animate-aparece;
    }

    html[data-transicion="salida"]::view-transition-old(morfismo) {
        @apply animate-contenido-sale;
    }

    html[data-transicion="salida"]::view-transition-new(morfismo) {
        @apply animate-destino-entra;
    }

    html[data-transicion="salida"][data-sin-destino]::view-transition-image-pair(morfismo),
    html.dark[data-transicion="salida"][data-sin-destino]::view-transition-image-pair(morfismo) {
        @apply bg-transparent;
        animation: none;
    }

    html[data-transicion="salida"][data-sin-destino]::view-transition-old(morfismo) {
        @apply animate-fila-sale;
    }

    html[data-transicion]::view-transition-group-children(.marco) {
        overflow: clip;
    }

    html[data-transicion]::view-transition-group(.marco) {
        @apply overflow-clip rounded-lg;
    }

    html[data-transicion]::view-transition-group(.panel-filas) {
        @apply overflow-clip rounded-xl;
    }

    html[data-transicion]::view-transition-old(.marco),
    html[data-transicion]::view-transition-old(.panel-filas) {
        @apply hidden;
    }

    html[data-transicion]::view-transition-new(.marco),
    html[data-transicion]::view-transition-new(.panel-filas) {
        animation: none;
    }

    html[data-transicion]::view-transition-old(.fila),
    html[data-transicion]::view-transition-new(.fila) {
        animation-duration: 150ms;
    }

    html[data-transicion]::view-transition-old(.fila):only-child {
        @apply block animate-fila-sale;
    }

    html[data-transicion]::view-transition-new(.fila):only-child {
        @apply animate-fila-entra;
    }

    @media (prefers-reduced-motion: no-preference) {
        .flash-border {
            @apply animate-fila-resalta;
        }

        html.dark .flash-border {
            @apply animate-fila-resalta-oscuro;
        }
    }
}
.pagy {
    @apply flex flex-wrap justify-center gap-1 font-semibold text-sm text-gray-600 dark:text-gray-300;

    a:not(.gap) {
        @apply block rounded-lg border border-transparent px-3 py-1 bg-gray-200 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-200 transition-colors;

        &:hover {
            @apply bg-gray-300 dark:bg-gray-700 dark:border-gray-500 dark:text-white;
        }

        &:not([href]) {
            @apply text-gray-400 bg-gray-100 cursor-default dark:text-gray-600 dark:bg-gray-900 dark:border-gray-800;
        }

        &.current {
            @apply text-sobre-relleno bg-relleno border-relleno shadow-sm dark:text-sobre-relleno dark:bg-relleno dark:border-relleno;
        }
    }

    label {
        @apply inline-block whitespace-nowrap bg-gray-200 rounded-lg px-3 py-0.5 dark:bg-gray-800 dark:text-gray-200;

        input {
            @apply bg-gray-100 border-none rounded-md dark:bg-gray-900 dark:text-gray-100;
        }
    }
}
@layer components {
    [data-popper-arrow] {
        @apply absolute w-0 h-0 border-solid;
        content: "";
    }

    .arrow-tooltip[data-popper-placement^="top"] {
        @apply bottom-[-6px] border-x-[6px] border-x-transparent border-t-[6px] border-t-gray-800 dark:border-t-gray-600;
    }

    .arrow-tooltip[data-popper-placement^="bottom"] {
        @apply top-[-6px] border-x-[6px] border-x-transparent border-b-[6px] border-b-gray-800 dark:border-b-gray-600;
    }

    .arrow-tooltip[data-popper-placement^="left"] {
        @apply right-[-6px] border-y-[6px] border-y-transparent border-l-[6px] border-l-gray-800 dark:border-l-gray-600;
    }

    .arrow-tooltip[data-popper-placement^="right"] {
        @apply left-[-6px] border-y-[6px] border-y-transparent border-r-[6px] border-r-gray-800 dark:border-r-gray-600;
    }

    .portal-dropdown {
        @apply z-[60];
        transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1), translate 180ms cubic-bezier(0.22, 1, 0.36, 1);
    }

    .portal-dropdown[data-cerrando] {
        opacity: 0;
        translate: 0 -4px;
        transition-duration: 120ms;
    }

    .portal-dropdown[data-popper-placement^="top"][data-cerrando] {
        translate: 0 4px;
    }

    .flecha-menu {
        @apply absolute z-[1] h-2 w-4;
    }

    .flecha-menu svg {
        @apply block size-full fill-white stroke-gray-200 dark:fill-gray-900 dark:stroke-gray-700;
        stroke-width: 1;
    }

    .portal-dropdown[data-popper-placement^="bottom"] .flecha-menu {
        @apply -top-[7px];
    }

    .portal-dropdown[data-popper-placement^="top"] .flecha-menu {
        @apply -bottom-[7px] rotate-180;
    }
}

@starting-style {
    .portal-dropdown:not([hidden]) {
        opacity: 0;
        translate: 0 -6px;
    }

    .portal-dropdown[data-popper-placement^="top"]:not([hidden]) {
        translate: 0 6px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .portal-dropdown,
    .portal-dropdown[data-cerrando] {
        translate: none;
        transition: opacity 120ms ease-out;
    }
}
@layer components {
    .publico-andescamel { font-family: "Geist", ui-sans-serif, system-ui, sans-serif; }
    .publico-rural_alianza { font-family: "Manrope", ui-sans-serif, system-ui, sans-serif; }

    .publico-rural_alianza :is(.heading-1, .heading-2, .heading-3) { font-weight: 800; letter-spacing: -0.03em; }

    .publico {
        @apply min-h-screen antialiased;
        background: var(--fondo);
        color: var(--tinta);
        color-scheme: light;
        caret-color: var(--foco);
        accent-color: var(--accion);
        scrollbar-color: var(--borde) var(--fondo);
    }
    html.dark .publico { color-scheme: dark; }

    .publico ::selection { background: var(--acento-suave); color: var(--tinta); }
    .publico :focus-visible { outline: 2px solid var(--foco); outline-offset: 3px; border-radius: 4px; }

    .heading-1 { @apply text-4xl font-semibold tracking-tight sm:text-5xl md:text-6xl; text-wrap: balance; }
    .heading-2 { @apply text-4xl font-semibold tracking-tight md:text-5xl; text-wrap: balance; }
    .heading-3 { @apply text-3xl font-semibold tracking-tight md:text-4xl; text-wrap: balance; }
    .heading-4 { @apply text-2xl font-semibold tracking-tight md:text-3xl; text-wrap: balance; }
    .heading-5 { @apply text-2xl font-semibold tracking-tight; text-wrap: balance; }
    .title-2 { @apply text-lg font-medium; }
    .title-3 { @apply text-base font-medium; }
    .body-1 { @apply text-lg; text-wrap: pretty; }
    .body-3 { @apply text-base; text-wrap: pretty; }
    .body-6 { @apply text-sm; text-wrap: pretty; }
    .caption-2 { @apply text-sm; }
    .tinta-suave { color: var(--tinta-suave); }

    .pub-columna { @apply mx-auto w-full max-w-6xl px-6 md:px-10; }
    .pub-texto { @apply max-w-xl; }

    .pub-boton {
        @apply inline-flex min-h-11 items-center justify-center gap-2 px-5 py-2 text-base font-semibold transition duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] active:scale-[0.98];
        border-radius: var(--radio);
        background: var(--accion);
        color: var(--sobre-accion);
    }
    .pub-boton:hover { background: var(--accion-hover); }

    .pub-enlace {
        @apply inline-flex min-h-11 items-center gap-1.5 text-base font-semibold underline-offset-4 transition-colors duration-300 hover:underline;
        color: var(--tinta);
    }
    .pub-enlace-acento { color: var(--acento); }

    .pub-panel {
        @apply overflow-hidden;
        border-radius: calc(var(--radio) * 2);
        background: var(--superficie);
    }

    .pub-papel { background: var(--papel); }
    .pub-invertido { background: var(--accion); color: var(--sobre-accion); }

    .pub-foto { @apply block h-auto w-full object-cover; border-radius: calc(var(--radio) * 2); }
    .pub-captura { @apply overflow-hidden; border-radius: calc(var(--radio) * 2); border: 1px solid var(--borde); background: var(--superficie); }
    .pub-credito { @apply mt-2 text-xs; color: var(--tinta-suave); }

    .pub-nav { @apply sticky top-3 z-30 mx-auto mt-3 flex w-[min(100%-1.5rem,72rem)] items-center justify-between gap-4 px-4 py-2 backdrop-blur-md; border-radius: calc(var(--radio) * 2); background: color-mix(in oklab, var(--fondo) 82%, transparent); box-shadow: 0 0 0 1px color-mix(in oklab, var(--borde) 70%, transparent); }
    .pub-nav-enlace { @apply hidden min-h-11 items-center px-3 text-sm font-medium transition-colors duration-300 md:inline-flex; color: var(--tinta-suave); }
    .pub-nav-enlace:hover, .pub-nav-enlace[aria-current="page"] { color: var(--tinta); }

    .pub-tema { @apply inline-flex size-10 items-center justify-center transition-colors duration-300; border-radius: var(--radio); color: var(--tinta-suave); }
    .pub-tema:hover { color: var(--tinta); background: var(--superficie); }
    .pub-logo-marca { @apply size-11 shrink-0 object-contain p-0.5; border-radius: var(--radio); background: #ffffff; box-shadow: 0 0 0 1px var(--borde); }

    .pub-etiqueta { @apply mb-1.5 block text-sm font-medium; color: var(--tinta); }
    .pub-ojo { @apply absolute right-1 top-[1.85rem] inline-flex size-10 cursor-pointer items-center justify-center p-2; color: var(--tinta-suave); }
    .pub-opcion { @apply flex min-h-11 cursor-pointer items-center gap-3 px-3 text-sm font-medium transition-colors duration-300; border-radius: var(--radio); border: 1px solid var(--borde-campo); background: var(--papel); }
    .pub-opcion:has(:checked) { border-color: var(--foco); background: var(--acento-suave); }

    .pub-seccion { @apply py-16 md:py-24; }

    .pub-revelar { transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1); }
    .pub-revelar[data-oculto] { opacity: 0; transform: translateY(32px); }

    .pub-palabra { transition: opacity 500ms cubic-bezier(0.22, 1, 0.36, 1); opacity: 0.3; }
    .pub-palabra[data-activa] { opacity: 1; }

    .pub-tabla { @apply w-full text-left; border-collapse: collapse; }
    .pub-tabla td, .pub-tabla th { @apply px-4 py-3.5 text-base; }
    .pub-tabla tbody tr:nth-child(even) > * { background: var(--superficie); }

    .pub-punto { @apply inline-block size-2 shrink-0 rounded-full; background: var(--tinta-suave); }
    [aria-selected="true"] > .pub-punto, [aria-expanded="true"] > .pub-punto { background: var(--acento); }

    @media (prefers-reduced-motion: reduce) {
        .pub-revelar, .pub-revelar[data-oculto] { opacity: 1; transform: none; transition: none; }
        .pub-palabra { opacity: 1; transition: none; }
    }
}

/* Sin @layer a propósito: las reglas oscuras de input de la app no tienen capa y ganarían. */
.publico .pub-campo {
    @apply block min-h-11 w-full px-3 py-2 text-base transition-shadow duration-200;
    border-radius: var(--radio);
    border: 1px solid var(--borde-campo);
    background: var(--papel);
    color: var(--tinta);
}
.publico .pub-campo.pub-con-ojo { padding-right: 3rem; }
.publico .pub-campo:focus { outline: none; border-color: var(--foco); box-shadow: 0 0 0 3px color-mix(in oklab, var(--foco) 30%, transparent); }
.publico .pub-campo[aria-invalid="true"] { border-color: #dc2626; }
.publico input.pub-boton { border: 0; background: var(--accion); color: var(--sobre-accion); }
.publico .pub-boton:disabled { @apply cursor-not-allowed opacity-50; }
.publico .pub-opcion input[type="radio"] { color: var(--acento); border-color: var(--borde-campo); background-color: var(--papel); }
.publico .pub-opcion input[type="radio"]:checked { background-color: currentColor; border-color: currentColor; }
::-webkit-scrollbar {
}

::-webkit-scrollbar-track {
    @apply bg-transparent rounded-lg !important;
}

::-webkit-scrollbar-thumb {
    @apply bg-gray-200 dark:bg-gray-700 rounded-lg border border-gray-300 dark:border-gray-600 !important;
}

::-webkit-scrollbar-thumb:hover {
    @apply bg-gray-500 dark:bg-gray-600 border rounded-md !important;
}

::-webkit-scrollbar-corner {
    background-color: transparent;
}
.ts-hidden-accessible {
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    width: 1px !important;
    white-space: nowrap !important;
}

.input-hidden .ts-control > input {
    position: absolute;
    left: -10000px;
    opacity: 0;
}

.ts-wrapper {
    @apply relative w-full;
}
.ts-control {
    border-color: var(--linea-de-campo);
    @apply relative z-[1] flex min-h-10 w-full cursor-text flex-wrap items-center gap-1 overflow-hidden rounded-md border bg-white py-1.5 pl-3 pr-12 text-base text-gray-900 transition-[border-color,box-shadow] duration-150 md:text-sm dark:bg-gray-900 dark:text-gray-100;
}
.ts-wrapper.single .ts-control {
    @apply cursor-pointer;
}
.ts-wrapper.single .ts-control::after {
    content: "";
    @apply pointer-events-none absolute right-3.5 top-1/2 h-2 w-2 -translate-y-3/4 rotate-45 border-b-2 border-r-2 border-gray-500 dark:border-gray-400;
}
.ts-wrapper.focus .ts-control {
    @apply border-marca-600 ring-2 ring-marca-600/25 dark:border-marca-400 dark:ring-marca-400/25;
}
.ts-control > input,
.plugin-dropdown_input .items-placeholder {
    @apply m-0 min-w-[4rem] flex-1 border-0 bg-transparent p-0 text-inherit shadow-none outline-none placeholder:text-gray-500 focus:ring-0 dark:placeholder:text-gray-400;
}
.plugin-dropdown_input.has-items .items-placeholder,
.plugin-dropdown_input.dropdown-active .items-placeholder {
    @apply hidden;
}
.ts-control > .item {
    @apply min-w-0 truncate;
}
.ts-wrapper.multi .ts-control > .item {
    @apply inline-flex items-center rounded-md bg-marca-100 px-2 py-0.5 text-sm text-marca-900 dark:bg-marca-900/50 dark:text-marca-100;
}
.ts-wrapper .item .remove {
    @apply ml-1 px-1 text-inherit no-underline hover:opacity-70;
}
.plugin-clear_button .clear-button {
    @apply absolute right-7 top-1/2 z-[2] -translate-y-1/2 cursor-pointer px-1 text-lg leading-none text-gray-500 opacity-0 transition-opacity hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100;
}
.plugin-clear_button.has-items:hover .clear-button,
.plugin-clear_button.focus.has-items .clear-button {
    @apply opacity-100;
}
.ts-dropdown {
    @apply absolute left-0 top-full z-[60] mt-1 w-full overflow-hidden rounded-lg border border-gray-200 bg-white text-base text-gray-800 shadow-lg md:text-sm dark:border-gray-700 dark:bg-gray-900 dark:text-gray-200;
}
.plugin-dropdown_input .dropdown-input {
    @apply block w-full border-0 border-b border-gray-200 bg-transparent px-3 py-2 text-base text-gray-900 placeholder:text-gray-500 focus:border-marca-600 focus:ring-0 md:text-sm dark:border-gray-700 dark:text-gray-100 dark:placeholder:text-gray-400;
}
.ts-dropdown-content {
    @apply max-h-64 overflow-y-auto overscroll-contain py-1;
}
.ts-dropdown .option,
.ts-dropdown .no-results,
.ts-dropdown .optgroup-header {
    @apply px-3 py-2;
}
.ts-dropdown [data-selectable] {
    @apply cursor-pointer;
}
.ts-dropdown .option.active {
    @apply bg-marca-50 text-marca-900 dark:bg-marca-900/40 dark:text-marca-100;
}
.ts-dropdown .option.selected {
    @apply font-semibold;
}
.ts-dropdown .option[aria-disabled="true"] {
    @apply cursor-default text-xs text-gray-500 dark:text-gray-400;
}
.ts-dropdown .highlight {
    @apply rounded-sm bg-marca-200 text-gray-900 dark:bg-marca-700/70 dark:text-white;
}
.ts-dropdown .no-results {
    @apply text-gray-500 dark:text-gray-400;
}
.ts-dropdown .spinner {
    @apply mx-3 my-2 inline-block h-5 w-5 animate-spin rounded-full border-2 border-gray-300 border-t-marca-700 dark:border-gray-700 dark:border-t-marca-400;
}
.selector-detalle {
    @apply block text-xs text-gray-500 dark:text-gray-400;
}
:root {
    --validation-error-text: #9f1239;
    --validation-error-border: #be123c;
    --validation-error-surface: #fff1f2;
    --validation-success-border: #15803d;
    --validation-success-surface: #f0fdf4;
}

html.dark {
    --validation-error-text: #fda4af;
    --validation-error-border: #fb7185;
    --validation-error-surface: #3b1d29;
    --validation-success-border: #4ade80;
    --validation-success-surface: #102d24;
}

.fv-message {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
    margin-block-start: 0.375rem;
    margin-block-end: 0.5rem;
    max-inline-size: 100%;
    color: var(--validation-error-text);
    font-size: 0.875rem;
    line-height: 1.4;
}

.fv-message > svg {
    flex: 0 0 1rem;
    inline-size: 1rem;
    block-size: 1rem;
    margin-block-start: 0.1rem;
}

.jv-error-label {
    min-inline-size: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.fv-control[data-validation-state="invalid"] {
    --validation-field-border: var(--validation-error-border);
    --validation-field-surface: var(--validation-error-surface);
}

.fv-control[data-validation-state="valid"] {
    --validation-field-border: var(--validation-success-border);
    --validation-field-surface: var(--validation-success-surface);
}

/* Los estados compartidos prevalecen sobre los colores base y el foco de Tom Select. */
html .fv-control[data-validation-state] {
    border-color: var(--validation-field-border) !important;
    background-color: var(--validation-field-surface);
    box-shadow: none;
    transition-property: border-color, background-color, color;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

html .fv-control[data-validation-state]:focus-visible,
html .ts-wrapper.focus .fv-control[data-validation-state] {
    outline: 2px solid var(--validation-field-border);
    outline-offset: 2px;
    box-shadow: none;
}

[data-controller~="form-validation"] .nested-fields > td {
    vertical-align: top;
}

@media (prefers-reduced-motion: reduce) {
    html .fv-control[data-validation-state] { transition: none; }
}

@media (forced-colors: active) {
    html .fv-control[data-validation-state="invalid"] { border-style: dashed; }
    .fv-message { color: CanvasText; }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

.turbo-progress-bar {
    visibility: hidden;
}

html.dark .andescamel-logo {
    filter: brightness(0) invert(1);
    opacity: 0.94;
}

@keyframes vt-fade-in-up {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes vt-fade-in-left {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes vt-fade-in-right {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

@supports (view-transition-name: none) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 160ms;
        animation-timing-function: ease-out;
    }

    ::view-transition-old(root) {
        animation: none;
    }

    ::view-transition-new(root) {
        animation-name: vt-fade-in-up;
    }

    html[data-turbo-visit-direction="forward"]::view-transition-new(root) {
        animation-name: vt-fade-in-left;
    }

    html[data-turbo-visit-direction="back"]::view-transition-new(root) {
        animation-name: vt-fade-in-right;
    }

    html[data-turbo-preview]::view-transition-old(root),
    html[data-turbo-preview]::view-transition-new(root) {
        animation: none !important;
    }

    @media (prefers-reduced-motion: reduce) {
        ::view-transition-old(root),
        ::view-transition-new(root) {
            animation: none !important;
        }
    }
}

@media print {
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    .shadow-sm {
        box-shadow: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .animate-spin { animation: none !important; }
}
