/* ============================================================================
   Modal — shadcn/ui inspired
   ============================================================================ */

/* Overlay / backdrop */
.modal-container {
  position: fixed;
  inset: 0;
  z-index: var(--z-index-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-container.hidden {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: hsl(0 0% 0% / 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: modal-backdrop-in 150ms ease forwards;
  z-index: var(--z-index-modal-backdrop);
  pointer-events: none;
}

/* Dialog surface */
.modal-content {
  position: relative;
  width: 100%;
  max-width: 32rem;
  max-height: calc(100dvh - 2rem);
  background: hsl(0 0% 100%);
  border: 1px solid hsl(240 5.9% 90%);
  border-radius: 0.5rem;
  box-shadow:
    0 0 0 1px hsl(0 0% 0% / 0.03),
    0 10px 15px -3px hsl(0 0% 0% / 0.08),
    0 4px 6px -4px hsl(0 0% 0% / 0.05);
  display: flex;
  flex-direction: column;
  animation: modal-in 150ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: var(--z-index-modal);
  overflow: hidden;
}

.modal-content.modal-sm {
  max-width: 24rem;
}

/* Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid hsl(240 5.9% 90%);
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: hsl(240 10% 3.9%);
}

/* Close button */
.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  color: hsl(240 3.8% 46.1%);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.modal-close:hover {
  background: hsl(240 4.8% 95.9%);
  color: hsl(240 10% 3.9%);
}

.modal-close:focus-visible {
  outline: 2px solid hsl(240 5.9% 10%);
  outline-offset: 2px;
}

/* Body */
.modal-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Simple message paragraphs inside modals */
#confirmModalMessage,
#printSelectionModalMessage {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: hsl(240 3.8% 46.1%);
  text-align: center;
}


/* Print Selection Modal - Alert Dialog Style */
#printSelectionModal .modal-content {
  max-width: 480px;
}

#printSelectionModal .modal-header {
  padding: var(--spacing-5) var(--spacing-6);
  border-bottom: 1px solid var(--color-border);
}

#printSelectionModal .modal-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

#printSelectionModal .modal-body {
  padding: var(--spacing-6) var(--spacing-6);
}

#printSelectionModalMessage {
  margin-bottom: var(--spacing-8);
  line-height: 1.7;
  padding: 0;
  font-size: 1rem;
  color: var(--color-text-secondary);
}

#printSelectionModal .form-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
  align-items: stretch;
  margin-top: 0;
}

#printSelectionModal .form-buttons .btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 1rem;
  justify-content: center;
  min-height: 48px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#printSelectionModal .form-buttons .btn:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#printSelectionModal .form-buttons .btn-primary {
  background: var(--color-primary, #2563eb);
  border-color: var(--color-primary, #2563eb);
  color: white;
}

#printSelectionModal .form-buttons .btn-primary:hover {
  background: var(--color-primary-dark, #1e40af);
  border-color: var(--color-primary-dark, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#printSelectionModal .form-buttons .btn-secondary {
  background: white;
  border-color: var(--color-border, #d1d5db);
  color: var(--color-text, #374151);
}

#printSelectionModal .form-buttons .btn-secondary:hover {
  background: var(--color-surface-hover, #f9fafb);
  border-color: var(--color-border-hover, #9ca3af);
  color: var(--color-text, #111827);
}

/* Responsive adjustments for print selection modal */
@media (max-width: 640px) {
  #printSelectionModal .modal-content {
    max-width: 95vw;
    margin: 20px auto;
  }

  #printSelectionModal .modal-header {
    padding: var(--spacing-4) var(--spacing-5);
  }

  #printSelectionModal .modal-body {
    padding: var(--spacing-5) var(--spacing-5);
  }

  #printSelectionModalMessage {
    margin-bottom: var(--spacing-6);
    font-size: 0.9375rem;
  }

  #printSelectionModal .form-buttons {
    gap: var(--spacing-3);
    margin-top: var(--spacing-5);
  }

  #printSelectionModal .form-buttons .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
  }
}

@media (max-width: 480px) {

  #printSelectionModal .modal-header,
  #printSelectionModal .modal-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #printSelectionModalMessage {
    font-size: 0.875rem;
  }
}

/* Gestión de Trámites: keep the Excel dialog in the same neutral modal system. */
.excel-export-modal .modal-header {
  padding: 1.25rem 1.5rem;
  background: var(--color-surface);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

.excel-export-modal .modal-header h2 {
  color: var(--color-text);
  font-size: 1.125rem;
  letter-spacing: -0.015em;
}

.excel-export-modal .modal-close {
  color: var(--color-text-secondary);
  background: transparent;
  opacity: 1;
}

.excel-export-modal .modal-close:hover {
  color: var(--color-text);
  background: var(--muted);
  transform: none;
}

.excel-export-modal .modal-body {
  padding: 1.5rem;
  background: var(--color-surface);
}

.excel-export-modal .export-option-card input[type="radio"]:checked + .export-option-label::before {
  border-color: var(--btn-shadcn-default-bg);
  background: var(--btn-shadcn-default-bg);
}

.excel-export-modal .export-option-card input[type="radio"]:checked + .export-option-label {
  background: var(--muted);
  border-color: var(--btn-shadcn-default-bg);
  box-shadow: 0 0 0 1px var(--btn-shadcn-default-bg);
}

.excel-export-modal .export-option-card input[type="radio"]:checked + .export-option-label :is(h3, p),
.excel-export-modal .export-option-header .selected-count,
.excel-export-modal .filter-section h4,
.excel-export-modal .filter-value-option:has(input:checked) label,
.excel-export-modal .export-option:has(input:checked) label {
  color: var(--color-text);
}

.excel-export-modal .export-option-header .selected-count {
  background: var(--muted);
  border-color: var(--color-border);
}

.excel-export-modal .filter-section {
  border-radius: var(--border-radius-md);
  border-color: var(--color-border);
  box-shadow: none;
}

.excel-export-modal .filter-section:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--color-border-hover);
}

.excel-export-modal .filter-section h4 {
  border-bottom-color: var(--color-border-light);
}

.excel-export-modal .filter-section h4::after {
  background: var(--btn-shadcn-default-bg);
}

.excel-export-modal .filter-actions .select-all-btn:hover,
.excel-export-modal .filter-value-option:hover,
.excel-export-modal .export-option:hover,
.excel-export-modal .filter-value-option:has(input:checked),
.excel-export-modal .export-option:has(input:checked) {
  background: var(--muted);
  border-color: var(--color-border-hover);
}

.excel-export-modal :is(.filter-value-option, .export-option) input {
  accent-color: var(--btn-shadcn-default-bg);
}

.excel-export-modal .export-option:focus-within {
  outline-color: var(--btn-shadcn-default-bg);
  border-color: var(--btn-shadcn-default-bg);
}

.excel-export-modal .modal-actions {
  padding: 1.25rem 1.5rem;
  background: var(--color-surface);
  border-top-color: var(--color-border);
}

.excel-export-modal .btn-export {
  background: var(--color-secondary);
  color: white;
  border: 1px solid var(--color-secondary);
  padding: var(--spacing-2) var(--spacing-4);
  border-radius: var(--radius-btn);
  box-shadow: none;
}

.excel-export-modal .btn-export:hover {
  background: var(--color-secondary-hover);
  border-color: var(--color-secondary-hover);
  transform: none;
  box-shadow: none;
}

.excel-export-modal .btn-cancel {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: var(--spacing-2) var(--spacing-4);
  border-radius: var(--radius-btn);
}

.excel-export-modal .btn-cancel:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

/* Terreno options modal - spacing and layout */
#terrenoOptionsModal .modal-content.modal-sm {
  max-width: 460px;
}

#terrenoOptionsMessage {
  margin-bottom: var(--spacing-5);
  font-size: var(--font-size-base);
  color: var(--color-text);
  text-align: left;
}

#terrenoOptionsModal .form-buttons {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--spacing-3);
}

#terrenoOptionsModal .form-buttons .btn {
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
}

/* Responsive adjustments for terreno options modal */
@media (max-width: 576px) {
  #terrenoOptionsModal .modal-content {
    max-width: 95vw;
    height: auto;
    max-height: 90vh;
    border-radius: var(--border-radius-lg);
  }

  #terrenoOptionsModal .modal-body {
    padding: var(--spacing-4);
  }

  #terrenoOptionsMessage {
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-4);
  }

  #terrenoOptionsModal .form-buttons {
    gap: var(--spacing-3);
  }

  #terrenoOptionsModal .form-buttons .btn {
    padding: 12px 18px;
    font-size: var(--font-size-sm);
  }
}

@keyframes modal-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 576px) {
  .modal-container {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    max-width: 100%;
    max-height: 92dvh;
    border-radius: 0.75rem 0.75rem 0 0;
    border-bottom: none;
  }

  .modal-body {
    padding: 1.25rem;
  }
}



/* ============================================================================
   Select con busqueda
   ============================================================================ */
.searchable-select-wrapper {
  position: relative;
  width: 100%;
}

.searchable-select-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  min-height: 40px;
}

.searchable-select-display:hover {
  border-color: #007bff;
  box-shadow: 0 0 0 1px rgba(0, 123, 255, 0.1);
}

.searchable-select-display:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.searchable-select-display.has-value {
  color: #333;
}

.searchable-select-display:not(.has-value) .display-text {
  color: #999;
}

.dropdown-icon {
  margin-left: 8px;
  width: 12px;
  height: 12px;
  color: #666;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.searchable-select-display[aria-expanded="true"] .dropdown-icon {
  transform: rotate(180deg);
}

.searchable-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: white;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 280px;
  overflow: hidden;
  animation: dropdown-in 0.15s ease-out forwards;
}

.searchable-select-dropdown.hidden {
  display: none;
}

.searchable-select-search {
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  outline: none;
  background: #fafafa;
  transition: border-bottom-color 0.2s ease;
}

.searchable-select-search:focus {
  border-bottom-color: #007bff;
  background: white;
}

.searchable-select-options {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 150px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

.searchable-select-options::-webkit-scrollbar {
  width: 6px;
}

.searchable-select-options::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.searchable-select-options::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
  transition: background 0.2s ease;
}

.searchable-select-options::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.searchable-select-option {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid #f8f9fa;
  transition: all 0.15s ease;
  position: relative;
}

.searchable-select-option:hover,
.searchable-select-option.focused {
  background-color: #f8f9fa;
  color: #007bff;
}

.searchable-select-option.selected {
  background-color: #007bff;
  color: white;
  font-weight: 500;
}

.searchable-select-option.selected::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M20 6L9 17L4 12' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.searchable-select-option:last-child {
  border-bottom: none;
}

.searchable-select-no-results {
  padding: 16px 14px;
  text-align: center;
  color: #999;
  font-style: italic;
  font-size: 13px;
}

.form-group .searchable-select-container {
  width: 100%;
}

@keyframes dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .searchable-select-dropdown {
    max-height: 240px;
  }

  .searchable-select-options {
    max-height: 160px;
  }

  .searchable-select-display {
    padding: 12px 14px;
    min-height: 44px;
  }

  .searchable-select-option {
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  .searchable-select-dropdown {
    max-height: 200px;
  }

  .searchable-select-options {
    max-height: 120px;
  }
}

/* ============================================================================
   Lista de usuarios de un rol
   ============================================================================ */
.role-users-container {
  padding: 1.5rem;
}

.users-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.users-header h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
}

.empty-state p {
  margin: 0;
  font-size: 0.95rem;
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.user-item:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.user-email {
  font-size: 0.875rem;
  color: #6b7280;
  word-break: break-word;
}

.user-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}

.user-status.inactive {
  background: #ef4444;
}

@media (max-width: 640px) {
  .role-users-container {
    padding: 1rem;
  }

  .user-item {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .user-name {
    font-size: 0.95rem;
  }

  .user-email {
    font-size: 0.8rem;
  }
}

.excel-export-modal .modal-header {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: white;
  padding: 1.5rem 2rem 1.25rem;
  border: none;
}

.excel-export-modal .modal-header h2 {
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.025em;
}

.excel-export-modal .modal-close {
  color: white;
  opacity: 0.8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  background: transparent;
  border: none;
}

.excel-export-modal .modal-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.excel-export-modal .modal-body {
  padding: 2rem 1.5rem;
  background: #fafafa;
}

.modal-description {
  margin-bottom: 1rem;
  text-align: left;
}

.modal-description p {
  margin: 0;
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.4;
}

.export-type-selection {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.export-option-card {
  position: relative;
  width: 100%;
}

.export-option-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.export-option-card input[type="radio"]+.export-option-label::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 50%;
  margin-right: 0.625rem;
  flex-shrink: 0;
  transition: all 0.15s ease;
  background: white;
  margin-top: 0.125rem;
}

.export-option-card input[type="radio"]:checked+.export-option-label::before {
  border-color: #059669;
  background: #059669;
  box-shadow: inset 0 0 0 2px white;
}

.export-option-label {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0.875rem 1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  text-align: left;
  min-height: auto;
}

.export-option-label:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.export-option-card input[type="radio"]:checked+.export-option-label {
  background: #f0fdf4;
  border-color: #059669;
  box-shadow: 0 0 0 1px #059669;
}

.export-option-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  margin-bottom: 0;
  flex: 1;
}

.export-option-header h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: #111827;
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  line-height: 1.2;
}

.export-option-header .selected-count {
  font-size: 0.7rem;
  font-weight: 500;
  color: #059669;
  background-color: #f0fdf4;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  border: 1px solid #bbf7d0;
  white-space: nowrap;
}

.export-option-card input[type="radio"]:checked+.export-option-label .export-option-header h3 {
  color: #059669;
}

.export-option-icon {
  font-size: 1.25rem;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.export-option-card input[type="radio"]:checked+.export-option-label .export-option-icon {
  opacity: 1;
  color: #059669;
}

.export-option-label p {
  margin: 0;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.3;
  transition: color 0.15s ease;
  text-align: left;
  margin-top: 0.125rem;
}

.export-option-card input[type="radio"]:checked+.export-option-label p {
  color: #047857;
}

.export-sections {
  transition: all 0.3s ease;
}

.export-sections[style*="display: none"] {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.export-columns {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  max-height: 400px;
  overflow-y: auto;
  padding: 2px;
}

.filter-section {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  background: white;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.filter-section:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.filter-section h4 {
  margin: 0 0 1rem 0;
  color: #059669;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 2px solid #f0fdf4;
  padding-bottom: 0.75rem;
  position: relative;
}

.filter-section h4::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, #059669, #047857);
  border-radius: 1px;
}

.filter-count {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  margin-left: 0.5rem;
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filter-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
  flex: 1;
}

.filter-actions .select-all-btn:hover {
  background: #f0fdf4;
  border-color: #059669;
  color: #065f46;
}

.filter-actions .deselect-all-btn:hover {
  background: #fef2f2;
  border-color: #ef4444;
  color: #dc2626;
}

.filter-values {
  display: grid;
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
}

.filter-value-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.filter-value-option:hover {
  background: #f0fdf4;
  border-color: #059669;
  transform: translateX(2px);
}

.filter-value-option input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: #059669;
  cursor: pointer;
}

.filter-value-option label {
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  flex: 1;
  margin: 0;
  user-select: none;
  font-weight: 500;
}

.filter-value-option:has(input:checked) {
  background: #ecfdf5;
  border-color: #059669;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.1);
}

.filter-value-option:has(input:checked) label {
  color: #065f46;
  font-weight: 600;
}

/* Custom scrollbar for webkit browsers */
.export-columns::-webkit-scrollbar,
.filter-values::-webkit-scrollbar {
  width: 6px;
}

.export-columns::-webkit-scrollbar-track,
.filter-values::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.export-columns::-webkit-scrollbar-thumb,
.filter-values::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.export-columns::-webkit-scrollbar-thumb:hover,
.filter-values::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.export-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.export-option:hover {
  background: #f0fdf4;
  border-color: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.export-option:focus-within {
  outline: 2px solid #059669;
  outline-offset: 2px;
  border-color: #059669;
}

.export-option input[type="checkbox"] {
  margin: 0;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #059669;
  border-radius: 4px;
}

.export-option label {
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  flex: 1;
  margin: 0;
  user-select: none;
  font-weight: 500;
  line-height: 1.4;
}

.export-option:has(input:checked) {
  background: #ecfdf5;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.export-option:has(input:checked) label {
  color: #065f46;
}

.export-option.loading {
  opacity: 0.6;
  pointer-events: none;
}

.excel-export-modal .modal-actions {
  padding: 1.5rem 2rem;
  background: white;
  border-top: 1px solid #f3f4f6;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.filter-actions button {
  margin-bottom: 1em;
}

.btn-export {
  background: #059669;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-export:hover {
  background: #047857;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.excel-export-modal .btn-cancel {
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.excel-export-modal .btn-cancel:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #374151;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .excel-export-modal {
    max-width: 95vw !important;
    margin: 20px auto;
    border-radius: 12px;
  }

  .excel-export-modal .modal-header,
  .excel-export-modal .modal-body,
  .excel-export-modal .modal-actions {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .export-type-selection {
    gap: 0.375rem;
  }

  .export-option-label {
    padding: 0.75rem 0.875rem;
  }

  .export-option-header h3 {
    font-size: 0.85rem;
  }

  .export-option-label p {
    font-size: 0.75rem;
  }

  .export-option-card input[type="radio"]+.export-option-label::before {
    width: 14px;
    height: 14px;
    margin-right: 0.5rem;
  }

  .export-columns {
    max-height: 280px;
  }

  .export-option {
    padding: 12px 14px;
  }

  .filter-section {
    padding: 1.25rem;
  }

  .filter-value-option {
    padding: 8px 10px;
  }

  .excel-export-modal .modal-actions {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .excel-export-modal .btn-export,
  .excel-export-modal .btn-cancel {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }
}

@media (max-width: 480px) {

  .excel-export-modal .modal-header,
  .excel-export-modal .modal-body,
  .excel-export-modal .modal-actions {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .export-option-label {
    padding: 0.625rem 0.5rem;
    min-height: 65px;
  }

  .export-option-header h3 {
    font-size: 0.8rem;
  }

  .export-option-label p {
    font-size: 0.65rem;
  }

  .filter-section {
    padding: 1rem;
  }
}

/* ============================================================================
   EIU Proceed Modal - Success (Oficio Found)
   ============================================================================ */
#eiu-proceed-modal .modal-content {
  max-width: 560px;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#eiu-proceed-modal .modal-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 1.5rem 2rem;
  border-radius: 12px 12px 0 0;
}

#eiu-proceed-modal .modal-header h2 {
  color: #111827;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.025em;
}

#eiu-proceed-modal .modal-close {
  color: #6b7280;
  opacity: 1;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
}

#eiu-proceed-modal .modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

#eiu-proceed-modal .modal-body {
  padding: 1.5rem 2rem 2rem;
  background: #ffffff;
}

#eiu-proceed-modal-message {
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  color: #4b5563;
  line-height: 1.6;
  text-align: center;
}

#eiu-proceed-modal .form-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

#eiu-proceed-modal .form-buttons .btn {
  min-width: 140px;
  padding: 0.625rem 1.25rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.15s ease;
  font-size: 0.9375rem;
}

#eiu-proceed-modal .form-buttons .btn-primary {
  background: #111827;
  border-color: #111827;
  color: white;
}

#eiu-proceed-modal .form-buttons .btn-primary:hover {
  background: #1f2937;
  border-color: #1f2937;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#eiu-proceed-modal .form-buttons .btn-secondary {
  background: white;
  border-color: #d1d5db;
  color: #374151;
}

#eiu-proceed-modal .form-buttons .btn-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
}

/* ============================================================================
   EIU Not Found Modal - Failure (Oficio Not Found)
   ============================================================================ */
#eiu-not-found-modal .modal-content {
  max-width: 560px;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#eiu-not-found-modal .modal-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 1.5rem 2rem;
  border-radius: 12px 12px 0 0;
}

#eiu-not-found-modal .modal-header h2 {
  color: #111827;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.025em;
}

#eiu-not-found-modal .modal-close {
  color: #6b7280;
  opacity: 1;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
}

#eiu-not-found-modal .modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

#eiu-not-found-modal .modal-body {
  padding: 1.5rem 2rem 2rem;
  background: #ffffff;
}

#eiu-not-found-modal-message {
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  color: #4b5563;
  line-height: 1.6;
  text-align: center;
}

#eiu-not-found-modal .form-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

#eiu-not-found-modal .form-buttons .btn {
  min-width: 140px;
  padding: 0.625rem 1.25rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.15s ease;
  font-size: 0.9375rem;
}

#eiu-not-found-modal .form-buttons .btn-primary {
  background: #111827;
  border-color: #111827;
  color: white;
}

#eiu-not-found-modal .form-buttons .btn-primary:hover {
  background: #1f2937;
  border-color: #1f2937;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments for EIU modals */
@media (max-width: 640px) {

  #eiu-proceed-modal .modal-content,
  #eiu-not-found-modal .modal-content {
    max-width: 95vw;
    margin: 20px auto;
  }

  #eiu-proceed-modal .modal-header,
  #eiu-not-found-modal .modal-header,
  #eiu-proceed-modal .modal-body,
  #eiu-not-found-modal .modal-body {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  #eiu-proceed-modal .form-buttons,
  #eiu-not-found-modal .form-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }

  #eiu-proceed-modal .form-buttons .btn,
  #eiu-not-found-modal .form-buttons .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {

  #eiu-proceed-modal .modal-header,
  #eiu-not-found-modal .modal-header,
  #eiu-proceed-modal .modal-body,
  #eiu-not-found-modal .modal-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #eiu-proceed-modal-message,
  #eiu-not-found-modal-message {
    font-size: 0.875rem;
  }
}

/* ============================================================================
   Oficio 
   ============================================================================ */
.alert-dialog-body .oficio-type-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
  text-align: left;
}

.alert-dialog-body .oficio-type-btn {
  width: 100%;
  padding: 0.875rem 1rem;
  text-align: left;
  justify-content: flex-start;
  min-width: auto;
  white-space: normal;
}

.alert-dialog-body .oficio-type-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  width: 100%;
}

.alert-dialog-body .oficio-type-label strong {
  font-size: 0.9375rem;
  font-weight: 600;
  color: inherit;
}

.alert-dialog-body .oficio-type-description {
  font-size: 0.8125rem;
  opacity: 0.85;
  font-weight: 400;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .alert-dialog-body .oficio-type-options {
    gap: 0.625rem;
    margin-top: 1rem;
  }

  .alert-dialog-body .oficio-type-btn {
    padding: 0.75rem 0.875rem;
  }

  .alert-dialog-body .oficio-type-label strong {
    font-size: 0.875rem;
  }

  .alert-dialog-body .oficio-type-description {
    font-size: 0.75rem;
  }
}

/* ============================================================================
   Radio Question Group (Oficios Modal)
   ============================================================================ */

.form-group legend {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #111827;
  font-size: 1rem;
}

.radio-options {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: #374151;
  user-select: none;
}

.radio-label:hover {
  color: #111827;
}

/* Specific styling for the radio input class */
.radio-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  margin: 0;
  outline: none;
  cursor: pointer;
  position: relative;
  background-color: #fff;
  transition: all 0.2s ease-in-out;
  display: inline-block;
  vertical-align: middle;
}

.radio-input:checked {
  border-color: #2563eb;
  background-color: #2563eb;
  box-shadow: inset 0 0 0 4px white;
}

.radio-input:focus {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.radio-input:checked:focus {
  box-shadow: inset 0 0 0 4px white, 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* ============================================================================
   PDF Viewer Modal
   ============================================================================ */

#pdfViewerModal .modal-content {
  max-width: 900px;
  width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  background: hsl(0 0% 100%);
  border: 1px solid hsl(240 5.9% 90%);
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.03),
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

#pdfViewerModal .modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid hsl(240 5.9% 90%);
  flex-shrink: 0;
  background: transparent;
}


#pdfViewerModal .modal-header h2 {
  color: hsl(240 10% 3.9%);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}



#pdfViewerModal .modal-header h2 svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: hsl(240 5.9% 45%);
}



/* Close Button */
#pdfViewerModal .modal-close {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  background: transparent;
  border: none;
  color: hsl(240 5.9% 45%);
  cursor: pointer;
}

#pdfViewerModal .modal-close:hover {
  background: hsl(240 4.8% 95.9%);
  color: hsl(240 10% 3.9%);
}

#pdfViewerModal .modal-close:focus-visible {
  outline: 2px solid hsl(240 5.9% 10%);
  outline-offset: 2px;
}


#pdfViewerModal .modal-close svg {
  width: 18px;
  height: 18px;
}

/* Modal Body */
#pdfViewerModal .modal-body {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: hsl(240 4.8% 95.9%);
}



/* PDF Controls Bar */
.pdf-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: hsl(0 0% 100%);
  border-bottom: 1px solid hsl(240 5.9% 90%);
  flex-shrink: 0;
}


/* Navigation Buttons */
.pdf-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid hsl(240 5.9% 90%);
  border-radius: 6px;
  background: hsl(0 0% 100%);
  color: hsl(240 10% 3.9%);
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}

.pdf-nav-btn:hover:not(:disabled) {
  background: hsl(240 4.8% 95.9%);
  border-color: hsl(240 5.9% 70%);
}

.pdf-nav-btn:focus-visible {
  outline: 2px solid hsl(240 5.9% 10%);
  outline-offset: 2px;
}

.pdf-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: hsl(240 5.9% 90%);
}


.pdf-nav-btn svg {
  width: 16px;
  height: 16px;
}

/* Page Info */
.pdf-page-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: hsl(240 3.8% 46.1%);
  font-size: 0.875rem;
  font-weight: 500;
}


/* Page Input */
.pdf-page-input {
  width: 56px;
  padding: 0.375rem 0.625rem;
  border: 1px solid hsl(240 5.9% 90%);
  border-radius: 6px;
  background: hsl(0 0% 100%);
  color: hsl(240 10% 3.9%);
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.pdf-page-input:hover {
  border-color: hsl(240 5.9% 70%);
}

.pdf-page-input:focus {
  outline: none;
  border-color: hsl(240 5.9% 10%);
  box-shadow: 0 0 0 2px hsl(240 5.9% 90%);
}


/* Zoom Controls */
.pdf-zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid hsl(240 5.9% 90%);
}



.pdf-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid hsl(240 5.9% 90%);
  border-radius: 6px;
  background: hsl(0 0% 100%);
  color: hsl(240 10% 3.9%);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 1.125rem;
  font-weight: 500;
}

.pdf-zoom-btn:hover {
  background: hsl(240 4.8% 95.9%);
  border-color: hsl(240 5.9% 70%);
}

.pdf-zoom-btn:focus-visible {
  outline: 2px solid hsl(240 5.9% 10%);
  outline-offset: 2px;
}


.pdf-zoom-level {
  color: hsl(240 3.8% 46.1%);
  font-size: 0.8125rem;
  font-weight: 500;
  min-width: 48px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}



/* PDF Container */
.pdf-container {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1.5rem;
  background: hsl(240 4.8% 95.9%);
}



.pdf-canvas-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100%;
}

#pdfCanvas {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -4px rgba(0, 0, 0, 0.1);
  background: white;
  border-radius: 4px;
}

/* PDF Loading State */
.pdf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: hsl(240 3.8% 46.1%);
  gap: 1rem;
}


.pdf-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid hsl(240 5.9% 90%);
  border-top-color: hsl(240 10% 3.9%);
  border-radius: 50%;
  animation: pdf-spin 1s linear infinite;
}



@keyframes pdf-spin {
  to {
    transform: rotate(360deg);
  }
}

.pdf-loading-text {
  font-size: 0.9375rem;
  color: hsl(240 3.8% 46.1%);
  font-weight: 500;
}


/* PDF Error State */
.pdf-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: hsl(0 84.2% 60.2%);
  gap: 1rem;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  .pdf-error {
    color: hsl(0 72.2% 50.6%);
  }
}

.pdf-error svg,
.pdf-error .pdf-error-icon {
  width: 80px;
  height: 80px;
  opacity: 0.9;
  stroke: #ef4444;
  animation: pdf-error-pulse 2s ease-in-out infinite;
}

@keyframes pdf-error-pulse {

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

  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.pdf-error-text {
  font-size: 0.9375rem;
  color: hsl(0 84.2% 60.2%);
  font-weight: 500;
  max-width: 400px;
  line-height: 1.5;
}

.pdf-error-detail {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 4px;
  word-break: break-all;
  max-width: 400px;
  text-align: center;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
  padding: 0.5rem 1rem;
  background: hsl(240 4.8% 95.9%);
  border-radius: 6px;
  border: 1px solid hsl(240 5.9% 90%);
}

@media (prefers-color-scheme: dark) {
  .pdf-error-text {
    color: hsl(0 72.2% 50.6%);
  }

  .pdf-error-detail {
    background: hsl(240 3.8% 15%);
    border-color: hsl(240 4% 25%);
    color: #94a3b8;
  }
}

/* Image Viewer (para documentos que no son PDF) */
.pdf-image-viewer {
  max-width: 100%;
  max-height: calc(95vh - 150px);
  object-fit: contain;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -4px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

/* Scrollbar Styling */
.pdf-container::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.pdf-container::-webkit-scrollbar-track {
  background: transparent;
}

.pdf-container::-webkit-scrollbar-thumb {
  background: hsl(240 3.8% 46.1% / 0.3);
  border-radius: 6px;
  border: 3px solid hsl(240 4.8% 95.9%);
}

.pdf-container::-webkit-scrollbar-thumb:hover {
  background: hsl(240 3.8% 46.1% / 0.5);
}

/* Responsive */
@media (max-width: 768px) {
  #pdfViewerModal .modal-content {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
  }

  #pdfViewerModal .modal-header {
    padding: 1rem 1.25rem;
  }

  .pdf-controls {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .pdf-zoom-controls {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    width: 100%;
    justify-content: center;
    padding-top: 0.5rem;
    border-top: 1px solid hsl(240 5.9% 90%);
  }

  .pdf-nav-btn {
    width: 40px;
    height: 40px;
  }

  .pdf-container {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  #pdfViewerModal .modal-header {
    padding: 0.875rem 1rem;
  }

  #pdfViewerModal .modal-header h2 {
    font-size: 1rem;
  }

  .pdf-page-info {
    font-size: 0.8125rem;
  }

  .pdf-page-input {
    width: 48px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
  }

  .pdf-container {
    padding: 0.75rem;
  }
}

/* Final neutral parity overrides for the Trámites Excel modal. */
.excel-export-modal .modal-header {
  padding: 1.25rem 1.5rem;
  background: var(--color-surface);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

.excel-export-modal .modal-header h2,
.excel-export-modal .export-option-card input[type="radio"]:checked + .export-option-label :is(h3, p),
.excel-export-modal .export-option-header .selected-count,
.excel-export-modal .filter-section h4,
.excel-export-modal .filter-value-option:has(input:checked) label,
.excel-export-modal .export-option:has(input:checked) label {
  color: var(--color-text);
}

.excel-export-modal .modal-close {
  color: var(--color-text-secondary);
  background: transparent;
  opacity: 1;
}

.excel-export-modal .modal-close:hover {
  color: var(--color-text);
  background: var(--muted);
  transform: none;
}

.excel-export-modal .modal-body,
.excel-export-modal .modal-actions {
  background: var(--color-surface);
}

.excel-export-modal .modal-body {
  padding: 1.5rem;
}

.excel-export-modal .modal-actions {
  padding: 1.25rem 1.5rem;
  border-top-color: var(--color-border);
}

.excel-export-modal .export-option-card input[type="radio"]:checked + .export-option-label::before {
  border-color: var(--btn-shadcn-default-bg);
  background: var(--btn-shadcn-default-bg);
}

.excel-export-modal .export-option-card input[type="radio"]:checked + .export-option-label {
  background: var(--muted);
  border-color: var(--btn-shadcn-default-bg);
  box-shadow: 0 0 0 1px var(--btn-shadcn-default-bg);
}

.excel-export-modal .export-option-header .selected-count {
  background: var(--muted);
  border-color: var(--color-border);
}

.excel-export-modal .filter-section {
  border-radius: var(--border-radius-md);
  border-color: var(--color-border);
  box-shadow: none;
}

.excel-export-modal .filter-section:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--color-border-hover);
}

.excel-export-modal .filter-section h4 {
  border-bottom-color: var(--color-border-light);
}

.excel-export-modal .filter-section h4::after {
  background: var(--btn-shadcn-default-bg);
}

.excel-export-modal .filter-actions .select-all-btn:hover,
.excel-export-modal .filter-value-option:hover,
.excel-export-modal .export-option:hover,
.excel-export-modal .filter-value-option:has(input:checked),
.excel-export-modal .export-option:has(input:checked) {
  background: var(--muted);
  border-color: var(--color-border-hover);
}

.excel-export-modal :is(.filter-value-option, .export-option) input {
  accent-color: var(--btn-shadcn-default-bg);
}

.excel-export-modal .export-option:focus-within {
  outline-color: var(--btn-shadcn-default-bg);
  border-color: var(--btn-shadcn-default-bg);
}

.excel-export-modal .btn-export {
  background: var(--color-secondary);
  color: white;
  border: 1px solid var(--color-secondary);
  padding: var(--spacing-2) var(--spacing-4);
  border-radius: var(--radius-btn);
  box-shadow: none;
}

.excel-export-modal .btn-export:hover {
  background: var(--color-secondary-hover);
  border-color: var(--color-secondary-hover);
  transform: none;
  box-shadow: none;
}

.excel-export-modal .btn-cancel {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: var(--spacing-2) var(--spacing-4);
  border-radius: var(--radius-btn);
}

.excel-export-modal .btn-cancel:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-hover);
  color: var(--color-text);
}
