/* 
 * PEPPER MEDICAL SYSTEM - MODERN UI
 * =================================
 * Interfaz moderna para el sistema médico PEPPER
 */

:root {
  /* Colores principales */
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary-color: #10b981;
  --secondary-dark: #047857;
  
  /* Colores de estado */
  --success-color: #059669;
  --warning-color: #d97706;
  --error-color: #dc2626;
  --info-color: #0284c7;
  
  /* Colores neutros */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Efectos */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Bordes */
  --radius: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Transiciones */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y base - SOLO para elementos específicos, no globales */
.pepper-modern * {
  box-sizing: border-box;
}

/* Aplicar estilos modernos solo donde se necesiten, no globalmente */
.pepper-modern-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--gray-700);
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  min-height: 100vh;
}

/* Mejoras del header de bienvenida */
.pepper-welcome {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 2rem 1rem;
  margin-bottom: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.pepper-welcome::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.1;
}

.pepper-welcome h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pepper-welcome .subtitle {
  position: relative;
  z-index: 1;
  margin-top: 0.5rem;
  opacity: 0.9;
  font-size: 1.1rem;
}

/* Mejoras de tabs */
.pepper-tabs {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 2rem;
}

.pepper-tabs .w3-bar {
  background: var(--gray-50) !important;
  border-bottom: 1px solid var(--gray-200);
  padding: 0;
}

.pepper-tabs .w3-bar-item {
  background: transparent !important;
  color: var(--gray-600) !important;
  border: none !important;
  padding: 1rem 1.5rem !important;
  font-weight: 500 !important;
  font-size: 0.95rem !important;
  transition: var(--transition) !important;
  position: relative;
  border-radius: 0 !important;
}

.pepper-tabs .w3-bar-item:hover {
  background: var(--gray-100) !important;
  color: var(--primary-color) !important;
}

.pepper-tabs .w3-bar-item.active {
  background: white !important;
  color: var(--primary-color) !important;
  border-bottom: 3px solid var(--primary-color) !important;
  font-weight: 600 !important;
}

.pepper-tabs .w3-bar-item.active::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-color);
}

/* Contenido de tabs */
.pepper-tab-content {
  background: white;
  padding: 1.5rem;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Mejoras de formularios */
.pepper-search-form {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.pepper-search-form .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pepper-search-form .form-group {
  flex: 1;
  min-width: 200px;
}

.pepper-search-form label {
  display: block;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.pepper-search-form input,
.pepper-search-form select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: var(--transition);
  background: white;
}

.pepper-search-form input:focus,
.pepper-search-form select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Botones modernos */
.pepper-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.pepper-btn:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  text-decoration: none;
  color: white;
}

.pepper-btn:active {
  transform: translateY(0);
}

.pepper-btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.pepper-btn-secondary:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

.pepper-btn-success {
  background: var(--success-color);
}

.pepper-btn-success:hover {
  background: var(--secondary-dark);
}

.pepper-btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.pepper-btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* Cards modernos */
.pepper-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.pepper-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.pepper-card-header {
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.pepper-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
}

/* Dropdown moderno */
.pepper-dropdown {
  position: relative;
  display: inline-block;
}

.pepper-dropdown-content {
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-200);
  min-width: 200px;
  z-index: 1000;
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
}

.pepper-dropdown:hover .pepper-dropdown-content,
.pepper-dropdown.active .pepper-dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.pepper-dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--gray-700);
  text-decoration: none;
  transition: var(--transition);
  border-bottom: 1px solid var(--gray-100);
}

.pepper-dropdown-item:last-child {
  border-bottom: none;
}

.pepper-dropdown-item:hover {
  background: var(--gray-50);
  color: var(--primary-color);
  text-decoration: none;
}

/* Alertas modernas */
.pepper-alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border-left: 4px solid;
  background: var(--gray-50);
}

.pepper-alert-success {
  border-left-color: var(--success-color);
  background: #ecfdf5;
  color: #065f46;
}

.pepper-alert-warning {
  border-left-color: var(--warning-color);
  background: #fffbeb;
  color: #92400e;
}

.pepper-alert-error {
  border-left-color: var(--error-color);
  background: #fef2f2;
  color: #991b1b;
}

.pepper-alert-info {
  border-left-color: var(--info-color);
  background: #eff6ff;
  color: #1e40af;
}

/* Modales modernos */
.pepper-modal {
  backdrop-filter: blur(4px);
  background-color: rgba(0, 0, 0, 0.5);
}

.pepper-modal-content {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xl) !important;
  border: none !important;
  overflow: hidden;
}

.pepper-modal-header {
  background: var(--primary-color) !important;
  color: white !important;
  padding: 1.5rem !important;
}

.pepper-modal-body {
  padding: 1.5rem !important;
}

/* Responsive */
@media (max-width: 768px) {
  .pepper-welcome h2 {
    font-size: 2rem;
  }
  
  .pepper-search-form .form-row {
    flex-direction: column;
  }
  
  .pepper-search-form .form-group {
    min-width: 100%;
  }
  
  .pepper-tabs .w3-bar-item {
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
  }
}

/* Animaciones */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pepper-fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* Loading spinner moderno */
.pepper-spinner {
  border: 4px solid var(--gray-200);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Status indicators */
.pepper-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.pepper-status-success {
  background: #dcfce7;
  color: #166534;
}

.pepper-status-warning {
  background: #fef3c7;
  color: #92400e;
}

.pepper-status-error {
  background: #fecaca;
  color: #991b1b;
}

.pepper-status-info {
  background: #dbeafe;
  color: #1e40af;
}

/* Mejoras específicas para W3.CSS - REMOVIDAS para evitar conflictos */
/* Las clases w3-theme deben usar sus estilos originales */

.w3-card, .w3-card-2, .w3-card-4 {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow) !important;
  border: none !important;
}

/* Iconos */
.pepper-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

/* Utilidades */
.pepper-text-sm { font-size: 0.875rem; }
.pepper-text-lg { font-size: 1.125rem; }
.pepper-text-xl { font-size: 1.25rem; }
.pepper-text-2xl { font-size: 1.5rem; }

.pepper-font-medium { font-weight: 500; }
.pepper-font-semibold { font-weight: 600; }
.pepper-font-bold { font-weight: 700; }

.pepper-mb-2 { margin-bottom: 0.5rem; }
.pepper-mb-4 { margin-bottom: 1rem; }
.pepper-mb-6 { margin-bottom: 1.5rem; }
.pepper-mb-8 { margin-bottom: 2rem; }

/* ================================
   ESTILOS DE LOGUEAR_NEW.PHP
   ================================ */

/* Quitar flechas de inputs numericos */
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield; /* Propiedad estándar para compatibilidad */
}

/* Dropdown de usuario mejorado */
.w3-dropdown-content {
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  border-radius: 4px;
  animation: dropdownSlide 0.3s ease;
  z-index: 1000;
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-dropdown-item {
  transition: background-color 0.2s ease;
}

.user-dropdown-item:hover {
  background-color: #f5f5f5 !important;
}

/* HEADER MODERNO */
.modern-header {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  background: linear-gradient(135deg, #00538f 0%, #0066aa 100%);
  min-height: 50px !important;
  height: 60px;
}

.modern-header .w3-row {
  height: 100%;
  max-height: 60px;
}

/* TABS ORIGINALES RESTAURADOS */
.modern-tabs-container {
  background: #f8f9fa;
  border-bottom: 3px solid #e9ecef;
  margin-bottom: 0;
  position: relative;
}

.modern-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  overflow-x: auto;
}

.modern-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: #6c757d;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  position: relative;
  min-height: 50px;
}

.modern-tab:hover {
  background: rgba(0, 83, 143, 0.1);
  color: #00538f;
  transform: translateY(-1px);
}

.modern-tab.active {
  color: #00538f;
  border-bottom: 3px solid #00538f;
  background: rgba(0, 83, 143, 0.05);
  font-weight: 600;
}

.tab-icon {
  font-size: 16px;
  transition: color 0.3s ease;
}

.modern-tab .tab-icon {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.modern-tab:hover .tab-icon {
  transform: scale(1.1);
}

.modern-tab.active .tab-icon {
  color: #00538f;
}

/* Botón de usuario transparente */
.user-dropdown-button {
  background: transparent !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  color: white !important;
  transition: all 0.3s ease !important;
}

.user-dropdown-button:hover {
  background: rgba(255,255,255,0.1) !important;
  border: 1px solid rgba(255,255,255,0.4) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
}

.user-dropdown-button:active {
  background: rgba(255,255,255,0.2) !important;
  transform: translateY(0px);
}

/* Responsive para tablets */
@media (max-width: 768px) {
  .modern-tabs {
    padding: 0 10px;
    gap: 0;
  }
  
  .modern-tab {
    padding: 10px 15px;
    font-size: 13px;
    min-width: auto;
  }
  
  .modern-tab span {
    display: none;
  }
  
  .modern-tab .tab-icon {
    font-size: 18px;
  }
}

/* Header responsive */
@media (max-width: 768px) {
  .modern-header {
    height: 50px;
    padding: 4px 8px;
  }
  
  .modern-header .w3-row {
    max-height: 50px;
  }
}

/* ========================================
   NUEVO DISEÑO DE BÚSQUEDA MODERNO Y LIMPIO
   ======================================== */

/* Contenedor principal */
.pepper-search-container {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

/* Contenedor principal de búsqueda */
.pepper-search-main {
  background: white;
  border-radius: 8px;
  padding: 1rem; /* Fede 1.5 */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
}

/* Sección de filtros */
.pepper-search-section {
  margin-bottom: 1rem;
}

/* Grid de campos de búsqueda */
.pepper-search-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* 6 columnas: 5 primera línea + botón buscar */
  grid-template-rows: auto auto; /* 2 filas definidas */
  /* gap: 1rem; /*Fede */
  row-gap: 0.5rem;
  column-gap: 2rem;
  align-items: end; /* Alinear al final para mejor alineación visual */
}

/* Posicionamiento específico de elementos en el grid */
.pepper-search-grid > .pepper-field-group:nth-child(1) { grid-column: 1; grid-row: 1; } /* Nro. Orden */
.pepper-search-grid > .pepper-field-group:nth-child(2) { grid-column: 2; grid-row: 1; } /* Nombre */
.pepper-search-grid > .pepper-field-group:nth-child(3) { grid-column: 3; grid-row: 1; } /* Fecha desde */
.pepper-search-grid > .pepper-field-group:nth-child(4) { grid-column: 4; grid-row: 1; } /* Fecha hasta */
.pepper-search-grid > .pepper-field-group:nth-child(5) { grid-column: 5; grid-row: 1; } /* Botón HOY */
.pepper-search-grid > .pepper-field-group:nth-child(6) { grid-column: 1; grid-row: 2; } /* Modalidad */
.pepper-search-grid > .pepper-field-group:nth-child(7) { grid-column: 2; grid-row: 2; } /* Sede */
.pepper-search-grid > .pepper-field-group:nth-child(8) { grid-column: 3; grid-row: 2; } /* Estado */
.pepper-search-grid > .pepper-field-group:nth-child(9) { grid-column: 4; grid-row: 2; } /* Acciones rápidas */
.pepper-search-grid > .pepper-field-group:nth-child(10) { grid-column: 5; grid-row: 2; } /* Botón Buscar */

/* Grid para sección extra - más compacto */
.pepper-extra-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

/* Grupo de campo individual */
.pepper-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem; /* Mismo margen que modern-input-group */
}

/* Estilo especial para campos con SumoSelect */
.pepper-field-group.pepper-sumo-container {
  position: relative;
  min-height: 56px; /* Altura similar a modern-input-group */
}

/* Etiquetas flotantes para SumoSelect */
.pepper-field-group.pepper-sumo-container .pepper-label {
  position: absolute;
  top: 0;
  left: 1rem;
  font-size: 0.875rem;
  color: #00538f;
  font-weight: 500;
  background: #ffffff;
  padding: 0 0.25rem;
  z-index: 10;
  transform: translateY(-50%);
}

/* Etiquetas modernas generales */
.pepper-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
  margin: 0;
}

/* Inputs modernos */
.pepper-input {
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.75rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  width: 100%;
}

.pepper-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Selects modernos */
.pepper-select {
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem; /* Mismo radio que modern-input-group */
  padding: 1rem; /* Mismo padding que modern-input-group */
  font-size: 1rem; /* Mismo tamaño que modern-input-group */
  transition: all 0.2s ease-in-out;
  min-height: 56px; /* Altura consistente */
  margin-top: 8px; /* Espacio para la etiqueta flotante */
}

.pepper-select:focus {
  outline: none;
  border-color: #00538f; /* Mismo color que modern-input-group */
  box-shadow: 0 0 0 3px rgba(0, 83, 143, 0.1); /* Mismo efecto que modern-input-group */
}

/* Estilos para SumoSelect inicializado */
.pepper-field-group.pepper-sumo-container .SumoSelect {
  margin-top: 8px; /* Espacio para etiqueta flotante */
}

.pepper-field-group.pepper-sumo-container .SumoSelect > .CaptionCont {
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  font-size: 1rem;
  min-height: 56px;
  transition: all 0.2s ease-in-out;
  display: flex;
  align-items: center;
}

.pepper-field-group.pepper-sumo-container .SumoSelect > .CaptionCont:hover,
.pepper-field-group.pepper-sumo-container .SumoSelect.open > .CaptionCont {
  border-color: #00538f;
  box-shadow: 0 0 0 3px rgba(0, 83, 143, 0.1);
}

/* Grupo de fecha con botón */
.pepper-date-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Botones de iconos */
.pepper-icon-btn {
  background: #f8fafc;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
}

.pepper-icon-btn:hover {
  border-color: var(--primary-color);
  background: #f1f5f9;
  transform: translateY(-1px);
}

.pepper-icon-btn i {
  font-size: 1rem;
  color: #6b7280;
  transition: color 0.2s ease;
}

.pepper-icon-btn:hover i {
  color: var(--primary-color);
}

/* Estado deshabilitado para botones de iconos */
.pepper-icon-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  border-color: #e5e7eb !important;
  background: #f9fafb !important;
}

.pepper-icon-btn:disabled:hover {
  transform: none !important;
  border-color: #e5e7eb !important;
  background: #f9fafb !important;
}

.pepper-icon-btn:disabled i {
  color: #9ca3af !important;
}

/* Botón de emergencia con estilo especial */
.pepper-emergency {
  border-color: #fecaca;
  background: #fef2f2;
}

.pepper-emergency:hover {
  border-color: #dc2626;
  background: #fee2e2;
}

.pepper-emergency i {
  color: #dc2626;
}

/* Botón de expandir con animación mejorada */
.pepper-expand i {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pepper-expand.expanded i {
  transform: rotate(180deg);
}

/* Container de botones de acción */
.pepper-action-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Sección de acciones - sin etiqueta, alineación directa */
.pepper-actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* Alinear al final para coincidir con otros campos */
  align-items: stretch;
}

/* Container del botón de búsqueda - alineación con otros elementos */
.pepper-search-btn-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* Alinear al final como los otros campos */
  align-items: stretch;
}

/* Botón principal de búsqueda */
.pepper-search-btn {
  --transition: all 0.2s ease-in-out;
  --shadow: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 20px rgba(0, 83, 143, 0.3);
  
  background: linear-gradient(135deg, #00538f 0%, #003d6b 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow);
  min-width: 140px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Animación de brillo como login-button */
.pepper-search-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0066aa, #007acc);
  transition: var(--transition);
  z-index: -1;
}

.pepper-search-btn:hover::before {
  left: 0;
}

.pepper-search-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.pepper-search-btn:active {
  transform: translateY(-1px);
  transition: all 0.1s ease-in-out;
}

/* Asegurar que el contenido esté por encima del ::before */
.pepper-search-btn > * {
  position: relative;
  z-index: 1;
}

/* Estado deshabilitado durante búsqueda */
.pepper-search-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: var(--shadow) !important;
}

.pepper-search-btn:disabled::before {
  display: none;
}

.pepper-search-btn:disabled:hover {
  transform: none !important;
  box-shadow: var(--shadow) !important;
}

/* ==========================================
   ANIMACIÓN MODERNA DE BÚSQUEDA
========================================== */
@keyframes modernDots {
  0% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0.3; transform: scale(0.8); }
}

.pepper-modern-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.pepper-modern-loading .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: currentColor;
  animation: modernDots 1.4s infinite ease-in-out;
}

.pepper-modern-loading .dot:nth-child(1) { animation-delay: -0.32s; }
.pepper-modern-loading .dot:nth-child(2) { animation-delay: -0.16s; }
.pepper-modern-loading .dot:nth-child(3) { animation-delay: 0s; }

@keyframes modernPulse {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

.pepper-search-btn i {
  font-size: 1.125rem;
}

/* Sección expandida con animación mejorada */
.pepper-search-extra {
  background: #f9fafb;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  border: 1px solid #e5e7eb;
  border-top: 3px solid var(--primary-color);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 500px;
  opacity: 1;
  transform: translateY(0);
}

.pepper-search-extra.hidden {
  max-height: 0;
  padding: 0 1rem;
  margin-top: 0;
  opacity: 0;
  transform: translateY(-10px);
}

/* Checkbox moderno */
.pepper-checkbox-container {
  display: flex;
  align-items: center;
}

.pepper-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pepper-checkbox:checked {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

/* Dashboard de tiempos moderno */
.pepper-dashboard {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* FAB moderno */
.pepper-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.pepper-fab:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 20px rgba(37, 99, 235, 0.4);
}

.pepper-fab i {
  font-size: 1.25rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .pepper-search-container {
    padding: 1rem;
    margin: 0.5rem 0;
  }
  
  .pepper-search-main {
    padding: 1rem;
  }
  
  .pepper-search-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 1rem;
  }
  
  /* Resetear posicionamiento en móvil */
  .pepper-search-grid > .pepper-field-group {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
  
  .pepper-action-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .pepper-search-btn {
    width: 100%;
    justify-content: center;
  }
  
  .pepper-search-btn-container {
    justify-content: center;
  }
  
  .pepper-fab {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
  }
}

/* Animaciones */
.pepper-search-extra {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   REEMPLAZO DE ICONOS CON FONTAWESOME
   ======================================== */

/* Ocultar iconos originales en PNG y mostrar FontAwesome */
.pepper-action-buttons img,
.pepper-icon-btn img,
button[id*="buscar"] img,
button[id*="filtro"] img,
button[onclick*="fnLimpiar"] img,
button[onclick*="fnExpandir"] img,
button[id="td_asignar_multiple"] img {
  display: none !important;
}

/* Icono "Hoy" - Calendario */
#buscar_hoy::before,
img[src*="hoy.png"]::before {
 /* content: '\f073';*/
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 16px;
  color: inherit;
}

/* Icono "Mis estudios" - Usuario */
#buscar_solo_mios::before,
img[src*="mios.png"]::before {
  /*content: '\f007';*/
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 16px;
  color: inherit;
}

/* Icono "Emergencia" - Estetoscopio */
button[onclick*="EMERGENCIA"]::before,
img[src*="emergencia.png"]::before {
  content: '\f0f9';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 16px;
  color: #dc2626;
}

/* Icono "HOY" - Calendario */
button#buscar_hoy::before {
  content: '\f073';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 16px;
  color: inherit;
}

/* Icono "Limpiar" - Papelera */
#btnlimpiarbusqueda::before,
img[src*="tacho.png"]::before {
  /*content: '\f2ed';*/
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 16px;
  color: inherit;
}

/* Icono "Expandir" - Chevron down */
#btnexpandir::before,
img[src*="abajo.png"]::before {
  /*content: '\f078';*/
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 16px;
  color: inherit;
  transition: transform 0.3s ease;
}

/* Rotar icono cuando está expandido */
#btnexpandir.expanded::before {
  transform: rotate(180deg);
}

/* Icono "Guardar filtro" - Disquete */
#guardar_filtro_default::before,
img[src*="guardar_filtro.png"]::before {
  /*content: '\f0c7';*/
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 16px;
  color: inherit;
}

/* Icono "Cargar filtro" - Carpeta */
#cargar_filtro_default::before,
img[src*="cargar_filtro.png"]::before {
  /*content: '\f07c';*/
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 16px;
  color: inherit;
}

/* Icono "Asignar múltiple" - Enlaces/Cadena */
button[id="td_asignar_multiple"]::before,
img[src*="asignar.png"]::before {
  content: '\f0c1';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 20px;
  color: white;
}

/* =================================== 
 * MODERN INPUT GROUPS
 * ===================================
 * Inputs modernos con etiquetas flotantes
 */

.modern-input-group {
  position: relative;
  margin-bottom: 0; /* Reducir margen bottom para grid */
}

.modern-input-group input,
.modern-input-group select {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease-in-out;
  background: #ffffff;
}

.modern-input-group input:focus,
.modern-input-group select:focus {
  outline: none;
  border-color: #00538f;
  box-shadow: 0 0 0 3px rgba(0, 83, 143, 0.1);
}

.modern-input-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

.modern-input-group select:focus {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2300538f' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

.modern-input-group label {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: 1rem;
  pointer-events: none;
  transition: all 0.2s ease-in-out;
  background: #ffffff;
  padding: 0 0.25rem;
}

.modern-input-group input:focus + label,
.modern-input-group input:not(:placeholder-shown) + label,
.modern-input-group select:focus + label,
.modern-input-group select:not([value=""]) + label {
  top: 0;
  font-size: 0.875rem;
  color: #00538f;
  font-weight: 500;
}
