/**
 * This injects Tailwind's base styles and any base styles registered by
 * plugins.
 */
 @tailwind base;

 @layer base {
    h1 {
      @apply text-2xl;
    }
    h2 {
      @apply text-xl;
    }
    h3 {
      @apply text-lg;
    }
    /* Botón "Elegir archivo" de todos los campos de archivo, con los colores
       del sistema (Flowbite lo pintaba gris oscuro). */
    input[type='file']::file-selector-button {
      @apply ms-0 me-3 cursor-pointer rounded-md border-0 bg-primary-50 px-3 py-1.5 text-sm font-medium text-primary-700 hover:bg-primary-100 dark:bg-gray-700 dark:text-gray-200;
    }
  }

 /**
  * This injects Tailwind's component classes and any component classes
  * registered by plugins.
  */
 /* Con el visor de archivos abierto (autorizaciones) el contenido se corre
    para que el visor no lo tape. Ver visor_archivos_controller.js. */
 @media (min-width: 1024px) {
   html.visor-abierto #main-content { padding-right: var(--visor-ancho, 40vw); }
   /* El panel de gestión pasa debajo de las pestañas para dejar el ancho a la carga. */
   html.visor-abierto .detalle-autorizacion { grid-template-columns: minmax(0, 1fr); }
   html.visor-abierto .detalle-autorizacion > * { grid-column: auto; }
 }

 /* Menú lateral escondido en escritorio con el botón de la barra superior.
    Ver menu_colapsable_controller.js. */
 @media (min-width: 1024px) {
   #main-content { transition: padding-left 300ms ease-in-out; }
   html.menu-lateral-oculto #drawer-navigation { transform: translateX(-100%); }
   html.menu-lateral-oculto #main-content { padding-left: 0; }
 }

 @tailwind components;

 /* Componentes del panel administrativo: mismos botones, paneles, tablas y
    campos en todas las secciones. Ver también shared/_encabezado. */
 @layer components {
   .pagina { @apply bg-gray-50 dark:bg-gray-900 min-h-screen; }
   .pagina-contenido { @apply py-6 px-4 mx-auto max-w-screen-2xl lg:px-8; }
   .panel { @apply bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700; }
   .panel-titulo { @apply text-base font-semibold text-gray-900 dark:text-white; }

   .btn { @apply inline-flex items-center justify-center gap-2 px-3.5 py-2 text-sm font-medium rounded-lg whitespace-nowrap transition-colors focus:outline-none focus:ring-4 disabled:opacity-50 disabled:cursor-not-allowed; }
   .btn-primario { @apply btn text-white bg-primary-700 hover:bg-primary-800 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800; }
   .btn-secundario { @apply btn text-gray-700 bg-white border border-gray-300 hover:bg-gray-50 focus:ring-gray-200 dark:bg-gray-800 dark:text-gray-200 dark:border-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-700; }
   .btn-peligro { @apply btn text-red-700 bg-white border border-red-200 hover:bg-red-50 focus:ring-red-100 dark:bg-gray-800 dark:text-red-400 dark:border-red-900 dark:hover:bg-red-950; }
   .btn-icono { @apply inline-flex items-center justify-center w-8 h-8 rounded-lg text-gray-500 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white; }

   .etiqueta { @apply block mb-1 text-xs font-medium text-gray-600 dark:text-gray-400; }
   .campo { @apply block w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 placeholder-gray-400 focus:border-primary-500 focus:ring-primary-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:placeholder-gray-400; }

   .tabla { @apply w-full text-sm text-left text-gray-700 dark:text-gray-300; }
   .tabla thead { @apply text-xs font-semibold uppercase tracking-wide text-gray-500 bg-gray-50 dark:bg-gray-700/50 dark:text-gray-400; }
   .tabla th { @apply px-4 py-3 whitespace-nowrap; }
   .tabla td { @apply px-4 py-3 align-middle; }
   .tabla tbody tr { @apply border-t border-gray-100 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700/40; }

   .chip { @apply inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium whitespace-nowrap; }
   .chip-gris { @apply chip bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300; }
   .chip-verde { @apply chip bg-green-100 text-green-800 dark:bg-green-900/40 dark:text-green-300; }
   .chip-ambar { @apply chip bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300; }
   .chip-rojo { @apply chip bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-300; }
   .chip-azul { @apply chip bg-primary-100 text-primary-800 dark:bg-primary-900/40 dark:text-primary-300; }

   /* Páginas que arma pagy_nav: <nav class="pagy nav"> con un <a> por página;
      la actual lleva aria-current y las deshabilitadas (anterior/siguiente en
      los extremos y los "…") aria-disabled. */
   .pagy.nav { @apply inline-flex flex-wrap items-center gap-1 text-sm; }
   .pagy.nav a { @apply inline-flex items-center justify-center min-w-[2.25rem] h-9 px-3 font-medium rounded-lg border border-gray-300 bg-white text-gray-700 transition-colors hover:bg-gray-50 hover:text-primary-700 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white; }
   .pagy.nav a[aria-current="page"] { @apply border-primary-600 bg-primary-600 text-white hover:bg-primary-600 hover:text-white dark:border-primary-500 dark:bg-primary-600 dark:hover:bg-primary-600; }
   .pagy.nav a[aria-disabled="true"]:not([aria-current]) { @apply cursor-default text-gray-400 hover:bg-white hover:text-gray-400 dark:text-gray-500 dark:hover:bg-gray-800 dark:hover:text-gray-500; }
   .pagy.nav a.gap { @apply border-transparent bg-transparent px-1 min-w-0 hover:bg-transparent dark:bg-transparent dark:hover:bg-transparent; }
 }
 
 /**
  * This injects Tailwind's utility classes and any utility classes registered
  * by plugins.
  */
 @tailwind utilities;

 @layer utilities {
   /* antes lo daba el plugin de flowbite */
   .h-modal {
     height: calc(100% - 2rem);
   }
   .animate-fadeInUp {
     animation: fadeInUp 0.8s ease-out;
   }
   .animate-fadeInUp-200 {
     animation: fadeInUp 0.8s ease-out 0.2s both;
   }
   .animate-fadeInUp-300 {
     animation: fadeInUp 0.8s ease-out 0.3s both;
   }
   .animate-fadeInUp-400 {
     animation: fadeInUp 0.8s ease-out 0.4s both;
   }
   .animate-fadeInUp-500 {
     animation: fadeInUp 0.8s ease-out 0.5s both;
   }
   .animate-fadeIn {
     animation: fadeIn 1.05s ease forwards;
   }
   .animate-boot-eyebrow {
     animation: bReveal 0.6s cubic-bezier(0.2,0.8,0.2,1) 0.1s forwards;
   }
   .animate-boot-brand {
     animation: bReveal 0.6s cubic-bezier(0.2,0.8,0.2,1) 0.25s forwards;
   }
   .animate-check-pop {
     animation: checkPop 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
   }
   .hide-scrollbar {
     -ms-overflow-style: none;
     scrollbar-width: none;
   }
   .hide-scrollbar::-webkit-scrollbar {
     display: none;
   }
 }

 @keyframes fadeInUp {
   from {
     opacity: 0;
     transform: translateY(30px);
   }
   to {
     opacity: 1;
     transform: translateY(0);
   }
 }

 @keyframes fadeIn {
   from { opacity: 0; }
   to { opacity: 1; }
 }

 @keyframes bReveal {
   from { opacity: 0; transform: translateY(15px); filter: blur(4px); }
   to { opacity: 1; transform: translateY(0); filter: blur(0); }
 }

 @keyframes checkPop {
   0% { transform: scale(0); opacity: 0; }
   70% { transform: scale(1.08); opacity: 1; }
   100% { transform: scale(1); }
 }

 @keyframes toastIn {
   0% { opacity: 0; transform: translateX(100%) scale(0.9); }
   60% { transform: translateX(-8px) scale(1.02); }
   100% { opacity: 1; transform: translateX(0) scale(1); }
 }

 @keyframes toastOut {
   0% { opacity: 1; transform: translateX(0) scale(1); }
   100% { opacity: 0; transform: translateX(100%) scale(0.9); }
 }

 .animate-toast-in {
   animation: toastIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
 }

 .animate-toast-out {
   animation: toastOut 0.4s cubic-bezier(0.55, 0, 1, 0.45) forwards;
 }

 @keyframes bellRing {
   0%, 100% { transform: rotate(0deg); }
   20% { transform: rotate(15deg); }
   40% { transform: rotate(-15deg); }
   60% { transform: rotate(10deg); }
   80% { transform: rotate(-10deg); }
 }

 .animate-bell-ring {
   animation: bellRing 0.6s ease-in-out;
 }

 @keyframes badgePop {
   0% { transform: scale(0); }
   60% { transform: scale(1.2); }
   100% { transform: scale(1); }
 }

 .animate-badge-pop {
   animation: badgePop 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
 }
 
 /**
  * Use this directive to control where Tailwind injects the responsive
  * variations of each utility.
  *
  * If omitted, Tailwind will append these classes to the very end of
  * your stylesheet by default.
  */
 /* @tailwind screens; */
 