/* Estilos adicionales personalizados */
body {
  font-family: "Inter", sans-serif;
}

:root {
  --sidebar-width: 280px;
}

/* Contorno visible para todos los campos de entrada */
input[type="text"],
input[type="number"],
input[type="tel"],
input[type="email"],
input[type="password"],
select,
textarea {
  border: 2.5px solid #94a3b8;
  background-color: #fff;
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
  border-radius: 0.5rem;
}

/* Agregando padding-left para inputs con iconos */
.input-with-icon {
  padding-left: 2.75rem !important;
}

input[type="text"]:hover,
input[type="number"]:hover,
input[type="tel"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
select:hover,
textarea:hover {
  border-color: #64748b;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.2);
}

/* Scrollbar personalizado para la tabla */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0d9488 0%, #14b8a6 100%);
  border-radius: 4px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #0f766e 0%, #0d9488 100%);
}

/* Animaciones suaves */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-in {
  animation: slideIn 0.3s ease-out forwards;
}

/* Agregar animaciones para los efectos blob del login */
@keyframes blob {
  0%,
  100% {
    transform: translate(0px, 0px) scale(1);
  }
  33% {
    transform: translate(30px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

.animate-blob {
  animation: blob 7s infinite;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

/* Mejorar animación de spinner para loading state */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Estados de alerta mejorados con transiciones */
.bg-danger-soft {
  background-color: #fff1f2;
  transition: background-color 0.2s ease;
}

.bg-danger-soft:hover {
  background-color: #ffe4e6;
}

/* Animación sutil para filas con patologías críticas */
.pathology-alert {
  animation: subtle-pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes subtle-pulse {
  0%,
  100% {
    background-color: rgba(254, 242, 242, 0.5);
  }
  50% {
    background-color: rgba(254, 226, 226, 0.6);
  }
}

/* Mejoras visuales para botones */
button {
  transition: all 0.2s ease;
}

button:active {
  transform: scale(0.95);
}

/* Efectos hover mejorados para tabla */
table tbody tr {
  transition: all 0.15s ease;
}

table tbody tr:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transform: translateX(2px);
}

/* Estilos mejorados para la tabla de atenciones */
#eu-table tr {
  transition: all 0.2s ease;
}

#eu-table tr:hover {
  background-color: #f8fafc;
  transform: translateX(2px);
}

#eu-table td {
  padding: 1rem;
  vertical-align: top;
}

#eu-table button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

#eu-table button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Botones de acción específicos */
.btn-edit {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.btn-edit:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-delete {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.btn-delete:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Modal backdrop mejorado */
#edit-modal {
  transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
}

#edit-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

#edit-modal > div {
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Animación para el modal */
#eu-modal.show {
  display: flex !important;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#eu-modal > div {
  animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Estilos para asegurar scroll suave en modal */
#edit-modal > div {
  scrollbar-width: thin;
  scrollbar-color: #14b8a6 #f1f5f9;
}

#edit-modal > div::-webkit-scrollbar {
  width: 6px;
}

#edit-modal > div::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

#edit-modal > div::-webkit-scrollbar-thumb {
  background: #14b8a6;
  border-radius: 3px;
}

#edit-modal > div::-webkit-scrollbar-thumb:hover {
  background: #0d9488;
}

/* Mejoras para checkboxes */
input[type="checkbox"] {
  cursor: pointer;
  transition: all 0.2s ease;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #14b8a6;
}

input[type="checkbox"]:hover {
  transform: scale(1.1);
}

/* Estilo para la columna de patologías destacada */
.pathology-column {
  background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
  border-left: 2px solid #fde047;
}

/* Mejora visual para iconos de lucide */
[data-lucide] {
  transition: all 0.2s ease;
}

button:hover [data-lucide] {
  transform: scale(1.1);
}

/* Estilos para el Sidebar/Menú lateral */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0f766e 0%, #115e59 100%);
  transition: all 0.3s ease;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #ccfbf1;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  margin: 0.25rem 0.75rem;
}

.sidebar-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-link.active {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 500;
}

/* Sidebar moderno mejorado */
.sidebar-modern {
  width: 280px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0d9488 0%, #0f766e 50%, #115e59 100%);
  box-shadow: 4px 0 24px -2px rgba(0, 0, 0, 0.12);
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar moderno FIJO - no se desplaza con el scroll */
.sidebar-modern-fixed {
  width: 280px;
  height: 100vh;
  background: linear-gradient(180deg, #0d9488 0%, #0f766e 50%, #115e59 100%);
  box-shadow: 4px 0 24px -2px rgba(0, 0, 0, 0.12);
  position: fixed;
  left: 0;
  top: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
  overflow-y: auto;
}

.sidebar-modern-fixed.hidden-sidebar {
  transform: translateX(-100%);
  width: 0;
  min-width: 0;
  box-shadow: none;
  overflow: hidden;
}

#main-content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-modern-fixed::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.sidebar-modern::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.sidebar-link-modern {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.25rem;
  color: #ccfbf1;
  border-radius: 0.75rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0.375rem 1rem;
  position: relative;
  overflow: hidden;
}

.sidebar-link-modern::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
  transition: width 0.3s ease;
}

.sidebar-link-modern:hover::before {
  width: 100%;
}

.sidebar-link-modern:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: translateX(4px);
}

.sidebar-link-modern:hover i[data-lucide="chevron-right"] {
  opacity: 1;
}

.sidebar-link-modern.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-left: 3px solid #5eead4;
}

.menu-section {
  margin-bottom: 1rem;
}

.menu-section-title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1.1rem;
  margin: 0 1rem 0.35rem;
  border-radius: 0.75rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(240, 253, 250, 0.95);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.9), rgba(13, 148, 136, 0.6));
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.menu-section-title:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.95), rgba(45, 212, 191, 0.7));
}

.menu-section-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.menu-section-content.hidden {
  display: none;
}

/* Estilos para sidebar colapsable */
.sidebar-modern.collapsed {
  width: 80px;
}

/* Sidebar colapsado fijo */
.sidebar-modern-fixed.collapsed {
  width: 80px;
}

.sidebar-modern.collapsed .sidebar-text {
  display: none;
}

/* Sidebar colapsado fijo */
.sidebar-modern-fixed.collapsed .sidebar-text {
  display: none;
}

.sidebar-modern.collapsed .logo-container-modern {
  flex-direction: column;
  padding: 1.5rem 0.5rem;
}

/* Sidebar colapsado fijo */
.sidebar-modern-fixed.collapsed .logo-container-modern {
  flex-direction: column;
  padding: 1.5rem 0.5rem;
}

.sidebar-modern.collapsed .sidebar-link-modern {
  justify-content: center;
  padding: 0.875rem;
}

/* Sidebar colapsado fijo */
.sidebar-modern-fixed.collapsed .sidebar-link-modern {
  justify-content: center;
  padding: 0.875rem;
}

.sidebar-modern.collapsed .icon-wrapper {
  margin: 0;
}

/* Sidebar colapsado fijo */
.sidebar-modern-fixed.collapsed .icon-wrapper {
  margin: 0;
}

/* Botón de toggle del sidebar */
.toggle-btn {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.sidebar-link-modern:hover .icon-wrapper {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.sidebar-link-modern.active .icon-wrapper {
  background: rgba(255, 255, 255, 0.2);
}

/* Estilos para el Logo placeholder */
.logo-container {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Logo container moderno */
.logo-container-modern {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
}

.logo-placeholder {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(255, 255, 255, 0.3);
}

/* Logo placeholder moderno */
.logo-placeholder-modern {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #5eead4;
  transition: all 0.3s ease;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.logo-placeholder-modern:hover {
  transform: scale(1.05);
  border-style: solid;
}

/* Estilos para Login */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 50%, #99f6e4 100%);
}

.login-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  border: 1px solid #e2e8f0;
}

.login-logo {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(20, 184, 166, 0.4);
}

.login-btn {
  width: 100%;
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: #fff;
  font-weight: 600;
  padding: 0.875rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px -3px rgba(20, 184, 166, 0.4);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(20, 184, 166, 0.5);
}

.login-btn:active {
  transform: translateY(0);
}

/* Header moderno mejorado */
.header-modern {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 1.25rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.95);
}

/* Tarjetas de estadísticas mejoradas */
.stat-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  border: 1px solid;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-primary {
  background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
  border-color: #a5f3fc;
  color: #0e7490;
}

.stat-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #fcd34d;
  color: #b45309;
}

.stat-success {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-color: #6ee7b7;
  color: #047857;
}

.stat-number {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 500;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Botón de iconos y notificaciones */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: #f1f5f9;
  color: #0f766e;
  border-color: #cbd5e1;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  animation: pulse-notification 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.notification-wrapper {
  position: relative;
}

.notification-panel {
  position: absolute;
  right: 0;
  top: 52px;
  width: 300px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  z-index: 60;
  overflow: hidden;
}

.notification-panel-header {
  padding: 0.75rem 0.9rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.notification-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #0f172a;
}

.notification-subtitle {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notification-panel-body {
  max-height: 280px;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
}

.notification-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.6rem;
  border-radius: 0.6rem;
  transition: background 0.2s ease;
}

.notification-item:hover {
  background: #f1f5f9;
}

.notification-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
}

.notification-item-meta {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 0.1rem;
}

.notification-item-badge {
  align-self: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
}

.notification-item-badge.upcoming {
  background: #fef3c7;
  color: #b45309;
}

.notification-item-badge.overdue {
  background: #fee2e2;
  color: #b91c1c;
}

.notification-item-badge.missing {
  background: #dbeafe;
  color: #1d4ed8;
}

.notification-panel-footer {
  padding: 0.65rem 0.85rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  text-align: right;
}

.notification-action {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0f766e;
  background: transparent;
  border: none;
  cursor: pointer;
}

.sidebar-hide-btn {
  position: absolute;
  right: -14px;
  top: 16px;
  z-index: 60;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.sidebar-show-btn {
  position: fixed;
  left: 10px;
  top: 90px;
  width: 36px;
  height: 36px;
  background: #0f766e;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 60;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.sidebar-show-btn:hover {
  filter: brightness(1.05);
}

.notification-action:hover {
  text-decoration: underline;
}

.notification-empty {
  font-size: 0.75rem;
  color: #94a3b8;
  padding: 0.4rem 0.2rem;
}

@keyframes pulse-notification {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Perfil de usuario mejorado */
.user-profile-modern {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
  cursor: pointer;
}

.user-profile-modern:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.avatar-modern {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 8px rgba(20, 184, 166, 0.25);
}

/* Área de contenido */
.content-area {
  flex: 1;
  padding: clamp(1rem, 2.2vw, 1.75rem);
  overflow: auto;
  background: linear-gradient(to bottom, #f8fafc 0%, #f1f5f9 100%);
  min-height: 0;
}

/* Estados de carga y error mejorados */
.loading-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  animation: fadeIn 0.3s ease-out;
}

.loading-spinner {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(20, 184, 166, 0.15);
}

.loading-bar {
  width: 200px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 1rem;
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #14b8a6 0%, #0d9488 100%);
  border-radius: 2px;
  animation: loading-progress 1.5s ease-in-out infinite;
}

@keyframes loading-progress {
  0% {
    width: 0%;
    margin-left: 0%;
  }
  50% {
    width: 60%;
    margin-left: 20%;
  }
  100% {
    width: 0%;
    margin-left: 100%;
  }
}

.error-state {
  text-align: center;
}

.error-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15);
}

/* Footer moderno */
.footer-modern {
  padding: 1rem 1.75rem;
  background: #fff;
  border-top: 1px solid #e2e8f0;
}

/* Agregando estilos para página de configuración */

/* Pestañas de configuración */
.config-tab {
  flex: 1;
  min-width: fit-content;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #64748b;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.config-tab:hover {
  background: #f8fafc;
  color: #0f766e;
}

.config-tab.active {
  color: #0f766e;
  border-bottom-color: #14b8a6;
  background: #f0fdfa;
}

/* Contenido de pestañas */
.config-content {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.config-content.active {
  display: block;
}

/* Toggle switches mejorados */
input[type="checkbox"]:checked + div {
  background-color: #14b8a6;
}

/* Slider de riesgo */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.4);
}

input[type="range"]::-moz-range-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.4);
}

/* Widget de clima/UV */
.weather-widget {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.6rem 0.75rem;
  border-radius: 0.85rem;
  min-width: 190px;
}

.weather-time {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.weather-time-value {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.weather-date-value {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: capitalize;
}

.weather-location-value {
  font-size: 0.7rem;
  color: #475569;
  white-space: nowrap;
}

.weather-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.weather-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #334155;
}

.uv-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.uv-low {
  background: #dcfce7;
  color: #166534;
}

.uv-moderate {
  background: #fef9c3;
  color: #92400e;
}

.uv-high {
  background: #fed7aa;
  color: #9a3412;
}

.uv-very-high {
  background: #fecaca;
  color: #991b1b;
}

.uv-extreme {
  background: #f5d0fe;
  color: #6b21a8;
}

/* Dashboard charts */
.dashboard-chart {
  height: 240px;
}

@media (max-width: 768px) {
  .dashboard-chart {
    height: 220px;
  }
}

/* Ajustes responsive generales */
@media (max-width: 1024px) {
  body > .flex.min-h-screen {
    flex-direction: column;
  }

  .sidebar-modern-fixed {
    position: relative;
    width: 100%;
    height: auto;
    box-shadow: none;
  }

  .sidebar-modern-fixed.collapsed {
    width: 100%;
  }

  #main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

@media (max-width: 768px) {
  .header-modern {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .header-actions > .flex.gap-2.text-sm {
    flex-wrap: wrap;
    width: 100%;
  }

  .stat-card {
    flex: 1 1 140px;
  }

  .weather-widget {
    width: 100%;
  }

  .notification-panel {
    width: min(90vw, 360px);
  }
}

@media (max-width: 640px) {
  .header-actions > .flex.gap-2.text-sm {
    display: none;
  }

  .header-actions .weather-widget {
    display: none;
  }

  .header-actions .w-px {
    display: none;
  }
}

@media (max-width: 480px) {
  .header-modern {
    padding: 1rem;
  }

  .sidebar-link-modern {
    margin: 0.3rem 0.75rem;
  }

  .notification-panel {
    right: -8px;
  }

  .logo-container-modern {
    padding: 1.5rem 1rem;
  }
}

@media (min-width: 1600px) {
  .content-area {
    padding: clamp(1.75rem, 2.5vw, 3rem);
  }
}

.login-pattern-bg {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2314b8a6' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.sidebar-logo-offset {
  margin-left: -15%;
}
