/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Datepicker popup estilos comunes */
/* estilos para inputs; se elimina cualquier especifico de datepicker */

/* Forzar modo claro incluso si existe .dark */
.dark .datepicker-dropdown,
.dark .datepicker-picker {
  background-color: #ffffff !important;
  color: #1f2937 !important;
}

.datepicker-grid,
.days .days-of-week,
.datepicker .days .grid { display: grid !important; grid-template-columns: repeat(7, minmax(0, 1fr)) !important; gap: 0.25rem !important; }
.datepicker-cell { text-align: center !important; padding: 0.375rem 0.25rem !important; border-radius: 0.375rem !important; display: flex !important; justify-content: center !important; align-items: center !important; line-height: 1.75rem !important; }
.datepicker-view .days .datepicker-grid { justify-items: center !important; align-items: center !important; }
.datepicker-view .days-of-week .dow { text-align: center !important; }
.datepicker-controls .view-switch,
.datepicker-controls .prev-btn,
.datepicker-controls .next-btn,
.datepicker-header .button {
  background-color: #ffffff !important;
  color: #374151 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 0.5rem !important;
}

.dark .datepicker-controls .view-switch,
.dark .datepicker-controls .prev-btn,
.dark .datepicker-controls .next-btn,
.dark .datepicker-header .button {
  background-color: #e5e7eb !important;
  color: #374151 !important;
}

.datepicker-controls .button,
.datepicker-footer .button {
  background-color: #ffffff !important;
  color: #374151 !important; /* gray-700 */
  border: 1px solid #e5e7eb !important;
  border-radius: 0.5rem !important;
}

.datepicker-controls .button:hover,
.datepicker-footer .button:hover {
  background-color: #e5e7eb !important; /* gray-200 */
}

.datepicker-cell {
  color: #374151 !important; /* gray-700 */
}

.datepicker-cell.selected,
.datepicker-cell.focused {
  background-color: #2563eb !important; /* blue-600 */
  color: #ffffff !important;
}

.datepicker-cell.disabled {
  color: #9ca3af !important; /* gray-400 */
}

.datepicker-view .days-of-week .dow { color: #6b7280 !important; font-weight: 600 !important; }
.datepicker-view .month, .datepicker-view .year { color: #374151 !important; }
.pagy.series-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.pagy.series-nav a[aria-disabled="true"],
.pagy.series-nav a[aria-current="page"],
.pagy.series-nav a,
.pagy.series-nav span {
  padding: 0.375rem 0.625rem; /* px-3 py-2 */
  font-size: 0.875rem; /* text-sm */
  line-height: 1.25rem;
  border: 1px solid #e5e7eb; /* gray-300 */
  background-color: #ffffff; /* white */
  color: #374151; /* gray-700 */
  border-radius: 0.375rem; /* rounded-md */
}

.pagy.series-nav a:hover {
  background-color: #f3f4f6; /* gray-100 */
  color: #111827; /* gray-900 */
}

.pagy.series-nav a[aria-disabled="true"] {
  color: #9ca3af; /* gray-400 */
  cursor: not-allowed;
}

.pagy.series-nav a[aria-current="page"],
.pagy.series-nav span[aria-current="page"] {
  background-color: #eff6ff; /* blue-50 */
  border-color: #93c5fd; /* blue-300 */
  color: #1d4ed8; /* blue-700 */
}

/* Posicionamiento relativo dentro del campo fecha */
/* limpiar estilos legacy de datepicker removidos */

input[type="date"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  pointer-events: none;
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-clear-button {
  display: none;
}

.capitalize-letter::first-letter,
.capitalize-first-letter::first-letter,
.capitalize-first::first-letter {
  text-transform: uppercase;
}

/* Focus azul del sistema para todos los inputs y selects */
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus,
.simple_form input:focus,
.simple_form select:focus,
.simple_form textarea:focus {
  outline: none;
  border-color: #3b82f6; /* blue-500 */
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25); /* focus:ring-4 approx */
}

/* Tom Select estilos Flowbite-like */
.ts-wrapper {
  color: #111827; /* gray-900 */
}
.ts-wrapper .ts-control {
  background-color: #f9fafb; /* gray-50 */
  border: 1px solid #d1d5db; /* gray-300 */
  border-radius: 0.5rem; /* rounded-lg */
  padding: 0.625rem 0.75rem; /* p-2.5 */
  cursor: pointer;
  box-shadow: none;
}
.ts-wrapper .ts-control:focus {
  outline: none;
}
.ts-wrapper.focus .ts-control,
.ts-wrapper.dropdown-active .ts-control {
  border-color: #3b82f6; /* blue-500 */
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
.ts-wrapper.error .ts-control,
.ts-wrapper.error.focus .ts-control,
.ts-wrapper.error.dropdown-active .ts-control {
  border-color: #ef4444; /* red-500 */
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}
.ts-dropdown {
  background-color: #ffffff; /* white */
  border: 1px solid #e5e7eb; /* gray-200 */
  border-radius: 0.5rem; /* rounded-lg */
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}
.ts-dropdown .dropdown-input { padding: 0.5rem 0.75rem; border-bottom: 1px solid #e5e7eb; }
.ts-dropdown .dropdown-input input { width: 100%; border: 0; outline: none; }
.ts-dropdown .option,
.ts-dropdown .item {
  font-size: 0.875rem; /* text-sm */
  color: #374151; /* gray-700 */
}
.ts-dropdown .option:hover,
.ts-dropdown .active {
  background-color: #f3f4f6; /* gray-100 */
  color: #111827; /* gray-900 */
}

/* Evitar duplicación visual cuando se inicializa varias veces accidentalmente */
.ts-wrapper + .ts-wrapper { display: none; }
.ts-wrapper { display: block; width: 100%; position: relative; }
.ts-wrapper .ts-control { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; min-height: 2.5rem; width: 100%; position: relative; }
.ts-wrapper .ts-control input { flex: 1 1 auto; min-width: 2rem; border: 0; outline: none; background: transparent; }
.ts-wrapper .ts-control input:focus { box-shadow: none !important; border: 0 !important; outline: none !important; }
.ts-dropdown { position: absolute; z-index: 50; width: 100%; margin-top: 0.25rem; }

.ts-hidden { display: none !important; }
select.ts-native.ts-hidden { display: none; }

.simple_form .ts-wrapper { width: 100%; }

.ts-wrapper.single .ts-control input { display: none; }
.ts-wrapper.single.has-items .ts-control input { display: none; }

.ts-wrapper.multi .ts-control input { flex: 1 1 auto; }

.ts-wrapper.single .ts-control { padding-right: 2.25rem; }

.ts-wrapper.single .ts-control::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid #6b7280; /* gray-600 */
  border-bottom: 2px solid #6b7280;
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

.ts-wrapper.single:not(.has-items) .ts-control { color: #6b7280; /* gray-600 */ }
.ts-wrapper.has-items .ts-control { color: #111827; }
.ts-wrapper .ts-control .item { color: #111827; }

.row-actions {
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.row-actions-parent:hover .row-actions,
.row-actions-parent:focus-within .row-actions {
  opacity: 1;
  pointer-events: auto;
}

:root { --page-margin: 12mm; }
@page { size: A4; margin: var(--page-margin); }
html, body { height: 100%; }
body { background: #ffffff; margin: 0; }

@media print {
  @page { margin: var(--page-margin); }
  body { background: #ffffff; }
  body:not(.pdf-layout) * { visibility: hidden; }
  body:not(.pdf-layout) .print-only,
  body:not(.pdf-layout) .print-only * {
    visibility: visible;
  }
}
