/* 🌐 General */
body {
  font-family: var(--app-font-family, 'Inter', sans-serif);
  background: linear-gradient(180deg, var(--background-light) 0%, var(--white) 100%);
  color: var(--text-main);
}

:root {
  --surface-card: var(--white);
  --surface-card-alt: var(--gray-50);
  --surface-border: var(--gray-200);
  --surface-text: var(--text-main);
  --surface-text-muted: var(--text-secondary);
}

.bg-white {
  background-color: var(--surface-card) !important;
}

.bg-gray-50,
.bg-gray-100 {
  background-color: var(--surface-card-alt) !important;
}

.border-gray-200 {
  border-color: var(--surface-border) !important;
}

.text-gray-900,
.text-gray-800,
.text-gray-700 {
  color: var(--surface-text) !important;
}

.text-gray-600,
.text-gray-500,
.text-gray-400 {
  color: var(--surface-text-muted) !important;
}

.placeholder\:text-gray-400::placeholder {
  color: var(--surface-text-muted) !important;
}

.dark-mode .content-wrapper {
  background-color: var(--dark-bg) !important;
  color: var(--gray-350) !important;
}

/* 🔝 Navbar */
.main-header {
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  border-bottom: 1px solid var(--gray-300);
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.main-header .nav-link {
  color: var(--white);
  font-weight: 500;
}

.main-header .nav-link:hover {
  color: var(--highlight);
}

.profile-avatar {
  width: 40px;
  height: 40px;
  object-fit: cover;
}


.topbar-nav {
  flex-wrap: nowrap;
  justify-content: space-between;
}

.topbar-actions {
  gap: 0.75rem;
  flex: 0 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.topbar-actions > li {
  flex: 0 1 auto;
  min-width: 0;
}

.topbar-actions a,
.topbar-actions button,
.online-indicator {
  max-width: 100%;
}

.online-indicator {
  white-space: nowrap;
}

.weather-clock-widget {
  flex: 0 1 auto;
}

.weather-clock-card {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.weather-clock-icon {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: var(--highlight);
  flex-shrink: 0;
}

.topbar-accent-icon {
  color: var(--highlight);
}

.weather-clock-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.1;
}

.weather-clock-location {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.weather-clock-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
}

.weather-clock-separator {
  color: rgba(255, 255, 255, 0.6);
}

.dropdown-panel {
  z-index: 60;
}

@media (max-width: 640px) {
  .topbar-nav {
    gap: 0.5rem;
    flex-wrap: nowrap;
  }

  .topbar-actions {
    gap: 0.45rem;
    flex: 0 1 auto;
    flex-wrap: nowrap;
  }

  .topbar-actions > li,
  .weather-clock-widget {
    min-width: 0;
    flex-shrink: 1;
  }

  .weather-clock-card {
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    width: 100%;
  }

  .weather-clock-icon {
    width: 1.8rem;
    height: 1.8rem;
  }

  .weather-clock-location {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
  }

  .weather-clock-meta {
    gap: 0.3rem;
    font-size: 0.8rem;
  }

  .dropdown-panel {
    width: min(18rem, calc(100vw - 1.5rem));
    max-width: min(18rem, calc(100vw - 1.5rem));
  }
}

/* 📦 Sidebar */
.main-sidebar {
  background: linear-gradient(180deg, var(--secondary) 0%, var(--primary) 100%);
}

.main-sidebar .brand-link {
  border-bottom: none !important;
}

.brand-link.logo {
  background: transparent;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-logo-gif {
  max-height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.25));
}

.user-panel .image img {
  border: 2px solid var(--primary);
}

/* Oculta el perfil cuando se colapsa el sidebar */
.sidebar-collapse .user-panel {
  opacity: 0;
  height: 0;
  visibility: hidden;
  overflow: hidden;
}
/* 📁 Sidebar Links */
.nav-sidebar .nav-link {
  color: var(--white);
  transition: background-color 0.2s;
  position: relative;
}

.nav-sidebar .nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--white);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

.nav-sidebar .nav-link:hover,
.nav-sidebar .nav-link.active {
  background-color: var(--blue-hover) !important;
  color: var(--white) !important;
}

.nav-sidebar .nav-link:hover::before,
.nav-sidebar .nav-link.active::before {
  transform: scaleY(1);
}

.nav-sidebar .nav-link i,
.nav-sidebar .nav-link p {
  color: var(--white);
}

/* Reduce size of submenu bullet icons */
.nav-treeview .nav-icon {
  font-size: 0.5rem;
}

/* 🔴 Logout */
.nav-link.text-danger {
  color: var(--highlight) !important;
}

/* 📦 Notificaciones Dropdown */
.notifications-menu .dropdown-menu {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 400px;
  width: max-content;
  max-width: 500px;
  white-space: normal;
}

/* 👤 Mini profile menu */
.mini-profile-menu {
  min-width: 200px;
  padding: 0;
  border: 1px solid var(--border-detail);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
}

.mini-profile-menu .profile-info {
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--white);
}

.mini-profile-menu .profile-info small {
  color: var(--white);
}

.mini-profile-menu .dropdown-item {
  color: var(--text-main);
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.mini-profile-menu .dropdown-item:hover {
  background-color: var(--secondary);
  color: var(--white);
}

.mini-profile-menu .dropdown-divider {
  margin: 0;
  border-color: var(--border-detail);
}

/* 🧾 Toasts */
.toast {
  z-index: 1060;
  font-weight: 500;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* 🟢 Toast Success */
.toast .bg-success {
  background-color: var(--highlight) !important;
}

/* 🔵 Toast Info */
.toast .bg-info {
  background-color: var(--secondary) !important;
}

/* 🟨 Alertas */
.alert-success {
  background-color: var(--highlight);
  color: var(--text-main);
  border-left: 4px solid var(--green-accent-dark);
}

.alert-danger {
  background-color: var(--red-light);
  color: var(--red-main);
  border-left: 4px solid var(--red-main);
}


.alert-warning {
  background-color: var(--yellow-light);
  color: var(--warning-text);
  border-left: 4px solid var(--orange-warning);
}

.alert-info {
  background-color: var(--secondary);
  color: white;
  border-left: 4px solid var(--primary);
}

.alert {
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 📝 Inputs */
.form-control:focus {
  border-color: var(--border-detail);
  box-shadow: 0 0 0 0.2rem rgba(140, 82, 255, 0.25);
}

label {
  font-weight: 600;
  color: var(--text-main);
}

/* 🔘 Botones */
/* Estilo base para todos los botones */
.btn {
  background-color: var(--button-light);
  color: var(--text-main);
  border: 1px solid var(--border-detail);
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.btn:hover {
  background-color: var(--secondary);
  color: var(--white);
}

/* Variantes de color */
.btn-primary {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--white) !important;
}

.btn-primary:hover {
  background-color: var(--secondary) !important;
  border-color: var(--secondary) !important;
}

.btn-success {
  background-color: var(--highlight);
  border-color: var(--highlight);
}

.btn-success:hover {
  background-color: var(--green-accent);
  border-color: var(--green-accent);
}

.btn-secondary {
  background-color: var(--button-light);
  color: var(--text-main);
  border: none;
}

.btn-secondary:hover {
  background-color: var(--secondary);
  color: var(--white);
}

.btn-danger {
  background-color: var(--red-main);
  border-color: var(--red-main);
  color: var(--white);
}

.btn-danger:hover {
  background-color: var(--red-dark);
  border-color: var(--red-dark);
}

.btn-warning {
  background-color: var(--orange-warning);
  border-color: var(--orange-warning);
  color: var(--white);
}

.btn-warning:hover {
  background-color: var(--orange-alert);
  border-color: var(--orange-alert);
  color: var(--white);
}

.btn-info {
  background-color: var(--cyan-info);
  border-color: var(--cyan-info);
  color: var(--white);
}

.btn-info:hover {
  background-color: var(--blue-info);
  border-color: var(--blue-info);
  color: var(--white);
}

/* 📄 Select2 */
.select2-container--default .select2-selection--single {
  border: 1px solid var(--border-detail);
  height: 38px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px;
}

/* 📁 Input file */
.form-control-file {
  border: 1px solid var(--border-detail);
  padding: 6px;
  border-radius: 4px;
  background-color: var(--gray-100);
  transition: border-color 0.2s ease;
}
.form-control-file:hover {
  border-color: var(--secondary);
}

/* 🧩 Headers personalizados para cards */
.card-header-turno {
  background-color: var(--primary) !important;
  color: white !important;
  border-bottom: 1px solid var(--border-detail);
}

.card-header-disponibilidad {
  background-color: var(--highlight) !important;
  color: var(--text-main) !important;
  border-bottom: 1px solid var(--highlight);
}

/* 🖼️ Fondo de contenido */
.content-wrapper {
  background-color: transparent;
  color: var(--text-main);
}

/* ⬇️ Footer */
footer {
  background: var(--button-light);
  color: var(--text-main);
  font-size: 0.9rem;
}

/* 📋 Card contenedora de turnos */
.card.card-outline.card-info {
  border: 1px solid var(--secondary);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

/* 🧠 Encabezado de la card */
.card.card-outline.card-info .card-header {
  background-color: var(--secondary);
  color: white;
  border-bottom: 1px solid var(--primary);
}

/* 🔍 Filtros */
#form-filtros {
  background-color: var(--gray-50);
  border: 1px solid var(--border-detail);
  border-radius: 6px;
}

#form-filtros label {
  color: var(--text-main);
  font-weight: 600;
}

/* 📋 Tabla turnos */
#tabla-turnos {
  border: 1px solid var(--gray-300);
  background-color: white;
  font-size: 0.9rem;
}

#tabla-turnos thead {
  background-color: var(--secondary);
  color: white;
}

#tabla-turnos th,
#tabla-turnos td {
  vertical-align: middle;
  text-align: center;
}

/* 📋 Tabla historias clinicas */
#tabla-historias {
  border: 1px solid var(--gray-300);
  background-color: white;
  font-size: 0.9rem;
}

#tabla-historias thead {
  background-color: var(--secondary);
  color: white;
}

#tabla-historias th,
#tabla-historias td {
  vertical-align: middle;
  text-align: center;
}

/* 🏷️ Badges dinámicos por estado */
.badge.bg-success {
  background-color: var(--highlight) !important;
  color: var(--text-main);
}

.badge.bg-info {
  background-color: var(--secondary) !important;
  color: white;
}

.badge.bg-warning {
  background-color: var(--button-light) !important;
  color: var(--text-main);
}

.badge.bg-secondary {
  background-color: var(--gray-400) !important;
  color: white;
}

/* ⚙️ Botones de acción */
#tabla-turnos .btn-warning {
  background-color: var(--orange-alert);
  border-color: var(--orange-alert-border);
  color: white;
}

#tabla-turnos .btn-warning:hover {
  background-color: var(--orange-alert-dark);
  border-color: var(--orange-alert-darker);
}

#tabla-turnos .btn-danger {
  background-color: var(--red-mid);
  border-color: var(--red-border);
  color: white;
}

#tabla-turnos .btn-danger:hover {
  background-color: var(--red-deep);
  border-color: var(--red-deeper);
}
/* 📅 Contenedor del calendario */
#calendar {
  background-color: white;
  border-radius: 6px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-detail);
}

/* 🗓️ FullCalendar botones */
.fc .fc-button {
  background-color: var(--primary);
  border: none;
  color: white;
  font-weight: 500;
  border-radius: 4px;
  padding: 0.5rem 1rem;
}

.fc .fc-button:hover,
.fc .fc-button:focus {
  background-color: var(--secondary);
  outline: none;
  box-shadow: none;
}

/* 🧭 Toolbar */
.fc-toolbar-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-main);
}

/* 📌 Evento */
.fc-event {
  background-color: var(--highlight);
  color: var(--text-main);
  border: none;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 4px;
}

.fc-event:hover {
  background-color: var(--green-accent);
}

/* 📎 Día actual */
.fc .fc-daygrid-day.fc-day-today {
  background-color: var(--purple-light);
}

/* 🌙 Dark Mode para calendar */
.dark-mode #calendar {
  background-color: var(--dark-panel);
  border-color: var(--primary);
}

.dark-mode .fc .fc-toolbar-title,
.dark-mode .fc .fc-button {
  color: white;
}

.dark-mode .fc-event {
  background-color: var(--highlight);
  color: var(--dark-text);
}

/* 🧾 Modal de Detalle Turno */
#modalTurnoDetalle .modal-content {
  border-radius: 10px;
  border: 1px solid var(--border-detail);
}

#modalTurnoDetalle .modal-header {
  background-color: var(--primary);
  color: white;
  border-bottom: 1px solid var(--border-detail);
}

#modalTurnoDetalle .modal-body {
  background-color: var(--white);
  color: var(--text-main);
  font-size: 0.9rem;
  padding: 1rem 1.2rem;
}

#modalTurnoDetalle .modal-body p {
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

#modalTurnoDetalle .modal-body strong {
  color: var(--text-main);
}

/* 🌙 Dark mode para modal */
.dark-mode #modalTurnoDetalle .modal-content {
  background-color: var(--dark-panel-alt);
  color: var(--gray-350);
}

.dark-mode #modalTurnoDetalle .modal-header {
  background-color: var(--primary);
  color: white;
}

/* 📋 Tabla de comprobantes */
.table {
  border: 1px solid var(--gray-300);
  font-size: 0.92rem;
  background-color: white;
}

.table th {
  font-weight: 600;
  text-align: center;
  background-color: var(--secondary);
  color: white;
}

.table td {
  vertical-align: middle;
  text-align: center;
}

/* 📎 Ver PDF botón */
.btn.btn-secondary {
  background-color: var(--button-light);
  color: var(--text-main);
  border: none;
}

.btn.btn-secondary:hover {
  background-color: var(--secondary);
  color: white;
}

/* ✅ Estado: Aprobado */
.badge.bg-success {
  background-color: var(--highlight) !important;
  color: var(--text-main);
}

/* ⚠️ Estado: Pendiente */
.badge.bg-warning {
  background-color: var(--button-light) !important;
  color: var(--text-main);
}

/* ❌ Estado: Rechazado */
.badge.bg-danger {
  background-color: var(--red-bright) !important;
  color: white;
}

/* 🔘 Botones de acción aprobar/rechazar */
.btn-sm.btn-success {
  background-color: var(--highlight);
  border-color: var(--highlight);
  color: var(--text-main);
}

.btn-sm.btn-success:hover {
  background-color: var(--green-accent);
  border-color: var(--green-accent);
  color: var(--text-main);
}

.btn-sm.btn-danger {
  background-color: var(--red-dark);
  border-color: var(--red-dark);
  color: white;
}

.btn-sm.btn-danger:hover {
  background-color: var(--red-darker);
  border-color: var(--red-darker);
}

/* 🖼️ Comprobante imagen preview */
td img {
  border: 1px solid var(--border-detail);
  border-radius: 6px;
  max-height: 70px;
}

/* ℹ️ Mensaje sin comprobantes */
.alert-info {
  background-color: var(--secondary);
  color: white;
  border-left: 4px solid var(--primary);
}

/* 🔹 Color de fondo para secciones informativas */
.bg-info {
  background-color: var(--blue-info);
  color: var(--white);
}

/* 🟪 Override para bg-info en tablas */
.table thead.bg-info {
  background-color: var(--secondary) !important;
  color: white !important;
}

/* 💬 Burbuja violeta para mensajes del admin */
.bg-primary.text-white {
  background-color: var(--primary) !important;
  color: white !important;
}
.calendar-icon-custom {
  color: var(--primary) !important;
}
.icono-turno-manual {
  color: var(--primary) !important;
}
.icono-feriado {
  color: var(--primary) !important;
  margin-right: 8px;
  font-size: 1.3em;     
}
.icono-panelprincipal {
  color: var(--primary) !important;
}
.icono-turnodia {
  color: var(--primary) !important;
}
.titulo-seccion {
  color: var(--gray-500)cf;
  font-weight: 600;
}
/* 💬 Mejor estilo para el contador de mensajes o notificaciones */
.navbar-badge {
  font-size: 0.7rem;
  padding: 0.3em 0.5em;
  line-height: 1;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-2px);
  background-color: var(--highlight);
  color: var(--text-main);
}

/* 🎨 Estilo custom para toast de mensajes nuevos */
.toast.bg-info {
  background-color: var(--primary) !important; /* Cambiá por el color que quieras */
  color: var(--gray-cloud) !important; /* Texto más visible */
}

.toast.bg-info .toast-header {
  background-color: var(--blue-muted) !important;
  color: var(--gray-cloud) !important;
}

.toast.bg-info .toast-body a {
  color: var(--primary);
  font-weight: bold;
  text-decoration: underline;
}
.fc-event {
  background-color: var(--highlight) !important;
  color: var(--text-main) !important;
  font-size: 14px;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 6px;
  overflow: visible !important;
  white-space: nowrap !important;
  text-overflow: unset !important;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.fc-event-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  text-align: center;
}

.fc-daygrid-event-dot {
  display: none;
}
.card.border-left-success {
  border-left: 5px solid var(--green-success) !important;
}
.card.border-left-warning {
  border-left: 5px solid var(--orange-warning) !important;
}
/* Colores de eventos dinámicos */
.fc-event.evento-ocupado {
  background-color: var(--red-bright) !important;
  color: white !important;
  font-weight: bold;
  font-size: 13px;
  text-align: center;
}

.fc-event.evento-libre {
  background-color: var(--highlight) !important;
  color: var(--text-main) !important;
  font-weight: bold;
  font-size: 13px;
  text-align: center;
}
.fc-event-title {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  width: auto !important;
  text-align: center;
}

/* 📨 Panel de mensajes rápidos */
.quick-msg-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 260px;
  max-height: 70vh;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  display: none;
}

.quick-msg-panel.open {
  display: block;
}

.quick-msg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--gray-300);
}

.quick-msg-body {
  padding: 0.75rem;
  overflow-y: auto;
  max-height: calc(70vh - 52px);
}

.quick-msg-item {
  cursor: pointer;
}
.quick-msg-item:hover {  background-color: var(--background-light);
}

/* 📎 Nombre de archivo adjunto en chat */
#archivo-nombre {
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 📭 Panel vacío de chat */
/* El estilo principal se maneja con clases de Tailwind en la plantilla */

/* 💬 Card de conversación */
.chat-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.chat-item .flex-grow-1 {
  min-width: 0;
}

.chat-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-preview {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-item > a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.chat-item > a:hover {
  background-color: var(--button-light);
  cursor: pointer;
}

/* 🦴 Skeleton loading */
.skeleton-loading {
  height: 20px;
  width: 100%;
  border-radius: 4px;
  background-color: var(--gray-200);
  animation: skeleton-pulse 1.5s infinite ease-in-out;
}

@keyframes skeleton-pulse {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}
.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover,
.btn-outline-primary.active {
  background-color: var(--primary);
  color: white;
}

.btn-outline-secondary {
  color: var(--secondary);
  border-color: var(--secondary);
}
.btn-outline-secondary:hover,
.btn-outline-secondary.active {
  background-color: var(--secondary);
  color: white;
}

/* ESTADO ACTIVO GLOBAL PARA OUTLINE GROUP BUTTONS */
.btn-toggle-group .btn {
  transition: all 0.2s ease-in-out;
}

.btn-toggle-group .btn-outline-primary.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.btn-toggle-group .btn-outline-primary:not(.active) {
  background-color: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-toggle-group .btn-outline-secondary.active {
  background-color: var(--secondary);
  border-color: var(--secondary);
  color: var(--white);
}

.btn-toggle-group .btn-outline-secondary:not(.active) {
  background-color: transparent;
  border-color: var(--secondary);
  color: var(--secondary);
}

/* 📦 Sidebar personalizado */
.main-sidebar {
  background: linear-gradient(180deg, var(--secondary), var(--primary));
  color: var(--white);
}

.main-sidebar .brand-link {
  background: transparent;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-logo-gif {
  max-height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.25));
}

/* 📁 Sidebar Links */
.nav-sidebar .nav-link {
  color: var(--white);
  transition: background-color 0.2s;
  position: relative;
}

.nav-sidebar .nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--white);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

.nav-sidebar .nav-link:hover,
.nav-sidebar .nav-link.active {
  background-color: var(--blue-hover) !important;
  color: var(--white) !important;
}

.nav-sidebar .nav-link:hover::before,
.nav-sidebar .nav-link.active::before {
  transform: scaleY(1);
}

.nav-sidebar .nav-icon,
.nav-sidebar .nav-link p {
  color: var(--white);
}

/* Menú secundario */
.nav-treeview .nav-link {
  padding-left: 2rem;
  font-size: 0.92rem;
  color: var(--gray-100);
}

.nav-treeview .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

/* Indicador flecha */
.nav-sidebar .right.fa-angle-right {
  transition: transform 0.3s ease;
}

.nav-sidebar .menu-open > .nav-link .right.fa-angle-right {
  transform: rotate(90deg);
}

/* 🎨 Palette transition overlay */
.palette-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  animation: palette-fade 0.5s ease-in-out;
  z-index: 2000;
}

@keyframes palette-fade {
  from {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* 📱 Ajustes responsivos globales */
@media (max-width: 1200px) {
  .content-wrapper nav {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .content-wrapper nav > .flex {
    width: 100%;
    justify-content: space-between;
  }

  .content-wrapper nav ul {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .topbar-actions .topbar-link-text {
    display: none;
  }

  .topbar-actions a {
    gap: 0.5rem;
  }

  .weather-clock-card {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .content-wrapper main {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .content-wrapper nav ul {
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  .weather-clock-widget {
    order: -1;
    width: 100%;
  }

  .weather-clock-card {
    width: 100%;
    border-radius: 1rem;
    justify-content: center;
  }

  .content-wrapper nav li {
    width: auto;
  }

  .content-wrapper nav #avatarBtn,
  .content-wrapper nav #notiBtn {
    width: 2.5rem;
    height: 2.5rem;
  }

  .content-wrapper nav #sidebarToggle {
    width: 2.75rem;
    height: 2.75rem;
  }

  .content-wrapper nav .status-dot {
    display: none;
  }

  .content-wrapper nav li.hidden.sm\:flex {
    display: none;
  }

  .content-wrapper nav > ul {
    order: 3;
  }

  .content-wrapper nav > div {
    order: 1;
  }

  .content-wrapper nav > ul li:last-child {
    margin-left: auto;
  }

  table[data-mobile-table] {
    border: none;
    width: 100%;
  }

  table[data-mobile-table] thead {
    display: none;
  }

  table[data-mobile-table] tbody {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  table[data-mobile-table] tbody tr {
    display: flex;
    flex-direction: column;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-200);
  }

  table[data-mobile-table] tbody tr td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.35rem 0;
    text-align: left !important;
    border-bottom: 1px solid var(--gray-200);
  }

  table[data-mobile-table] tbody tr td:last-child {
    border-bottom: none;
  }

  table[data-mobile-table] tbody tr td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--gray-600);
    flex: 1 1 auto;
    min-width: 0;
  }

  table[data-mobile-table] tbody tr td > * {
    flex: 1 1 auto;
  }

  table[data-mobile-table] tbody tr td > .flex,
  table[data-mobile-table] tbody tr td > .inline-flex {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  table[data-mobile-table] tbody tr td form {
    width: auto;
  }
}

@media (max-width: 480px) {
  .content-wrapper main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  table[data-mobile-table] tbody tr {
    padding: 0.5rem;
  }

  table[data-mobile-table] tbody tr td {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  table[data-mobile-table] tbody tr td::before {
    font-size: 0.85rem;
  }

  table[data-mobile-table] tbody tr td > * {
    width: 100%;
  }

  table[data-mobile-table] tbody tr td > .flex,
  table[data-mobile-table] tbody tr td > .inline-flex {
    justify-content: flex-start;
  }
}

.chat-phone-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.chat-phone {
  width: min(420px, 100%);
  background: linear-gradient(180deg, #111827 0%, #1f2937 30%, #111827 100%);
  border-radius: 32px;
  padding: 1.5rem 1rem 1rem;
  box-shadow: 0 20px 40px -20px rgba(15, 23, 42, 0.6);
  position: relative;
  color: #f9fafb;
}

.chat-phone__bezel {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 24px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.chat-phone__camera {
  width: 12px;
  height: 12px;
  background: radial-gradient(circle at 30% 30%, #60a5fa 0%, #1e293b 70%);
  border-radius: 50%;
}

.chat-phone__speaker {
  width: 58px;
  height: 6px;
  background: rgba(148, 163, 184, 0.8);
  border-radius: 999px;
}

.chat-phone__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 0 1rem;
}

.chat-phone__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22d3ee, #0ea5e9);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #0f172a;
}

.chat-phone__name {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.chat-phone__meta {
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.9);
}

.chat-phone__messages {
  background: linear-gradient(180deg, #ece5dd 0%, #d1f1d6 100%);
  border-radius: 24px;
  padding: 1.25rem;
  height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: inset 0 6px 12px rgba(15, 23, 42, 0.15);
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message-row {
  display: flex;
  width: 100%;
}

.message-row--incoming {
  justify-content: flex-start;
}

.message-row--outgoing {
  justify-content: flex-end;
}

.message-row--system {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 82%;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.message-bubble--incoming {
  background: #ffffff;
  color: #0f172a;
  border-bottom-left-radius: 4px;
}

.message-bubble--outgoing {
  background: linear-gradient(135deg, #2dd4bf, #0ea5e9);
  color: #0f172a;
  border-bottom-right-radius: 4px;
}

.message-bubble--system {
  background: rgba(254, 243, 199, 0.95);
  color: #92400e;
  border: 1px solid rgba(250, 204, 21, 0.6);
  text-align: left;
  max-width: 75%;
}

.message-sender {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.message-sender--system {
  color: rgba(146, 64, 14, 0.85);
  opacity: 1;
}

.message-text {
  white-space: pre-line;
  line-height: 1.4;
}

.message-file {
  border-radius: 16px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.08);
}

.message-image {
  width: 100%;
  display: block;
}

.message-file__link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.message-file__link:hover {
  text-decoration: underline;
}

.message-meta {
  font-size: 0.7rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.3rem;
  color: rgba(15, 23, 42, 0.7);
}

.message-row--outgoing .message-meta {
  color: rgba(15, 23, 42, 0.6);
}

.message-row--system .message-meta {
  justify-content: flex-start;
}

.read-mark {
  font-weight: 700;
}

.chat-phone__composer {
  margin-top: 1rem;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 18px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-phone__composer.disabled {
  justify-content: center;
  color: rgba(148, 163, 184, 0.7);
}

.composer-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.45);
  color: #f9fafb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.composer-btn:hover {
  transform: translateY(-2px);
  background: rgba(14, 165, 233, 0.85);
}

.composer-textarea {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.composer-textarea .form-control {
  background: rgba(15, 23, 42, 0.35);
  border: none;
  color: #f9fafb;
  min-height: 42px;
  box-shadow: none;
}

.composer-textarea .form-control::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.composer-textarea .form-control:focus {
  background: rgba(15, 23, 42, 0.55);
  color: #f9fafb;
}

.archivo-nombre {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.9);
}

.chat-phone .btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none;
  box-shadow: 0 10px 18px -12px rgba(16, 185, 129, 0.9);
}

.chat-phone .btn-success:hover {
  filter: brightness(1.05);
}

@media (max-width: 768px) {
  .chat-phone {
    padding: 1.25rem 0.75rem 0.75rem;
    border-radius: 24px;
  }

  .chat-phone__messages {
    height: 420px;
    padding: 1rem;
  }

  .message-bubble {
    max-width: 90%;
  }
}
