/* Xux CRM — estilos sobre Tailwind CDN */

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.xux-app-shell {
  min-height: 0;
}

:root {
  --xux-gold: #C5A059;
  --xux-turquoise: #2D6A74;
  --xux-dark-blue: #223E44;
  --xux-text: #546E7A;
  --xux-bg-light: #F8F9FA;
  --xux-text-strong: #1F2937;
  --xux-text-medium: #334155;
  --xux-text-soft: #64748B;
}

/* Scrollbar personalizado */
::-webkit-scrollbar            { width: 6px; height: 6px; }
::-webkit-scrollbar-track      { background: transparent; }
::-webkit-scrollbar-thumb      { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover{ background: #9ca3af; }

/* Chat messages */
.msg-bubble {
  max-width: 75%;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Textarea auto-resize helper */
textarea.auto-resize { resize: none; overflow: hidden; }

/* Fade-in para nuevos mensajes */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg-new { animation: fadeSlideUp .15s ease-out; }

/* Skeleton loader */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 400px 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 6px;
}

/* Barra superior de página (ritmo unificado) */
.xux-topbar {
  flex-shrink: 0;
  height: 3.5rem;
  display: flex;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Sidebar */
.xux-sidebar nav a {
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Eslogan en sidebar (turquesa aclarado sobre fondo oscuro) */
.xux-brand-slogan {
  color: rgba(165, 218, 226, 0.92);
}

/* Sidebar active link — alineado con --xux-turquoise (antes #3498DB) */
.nav-item-active {
  background: rgba(45, 106, 116, 0.28);
  font-weight: 600;
  box-shadow: inset 3px 0 0 0 var(--xux-gold);
}

/* Títulos de bloque dentro de tarjetas */
.xux-card-heading {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--xux-text-medium);
  letter-spacing: 0.02em;
}

/* Título principal de cada vista (barra superior) */
.xux-page-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--xux-dark-blue);
}

/* Elevación suave en KPIs / tarjetas destacadas */
.xux-hover-lift {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.xux-hover-lift:hover {
  box-shadow: 0 10px 28px rgba(44, 62, 80, 0.09);
  transform: translateY(-1px);
}

/* Lead card hover */
.lead-card:hover { background: var(--xux-bg-light); }
.lead-card.selected { background: rgba(45, 106, 116, 0.08); border-left: 3px solid var(--xux-turquoise); }

/* Toasts flotantes (public/assets/js/api.js → toast()) */
.xux-toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.875rem 1.125rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  line-height: 1.35;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 1;
  transform: translateY(0);
}
.xux-toast svg {
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.xux-toast--ok {
  background: var(--xux-gold);
  color: #fff;
}
.xux-toast--info {
  background: var(--xux-turquoise);
  color: #fff;
}
.xux-toast--err {
  background: var(--xux-dark-blue);
  color: #fecaca;
  border-left: 4px solid #f87171;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(248, 113, 113, 0.15) inset;
}

/* Bloques de error / aviso en formularios y modales */
.xux-alert--error {
  background: rgba(45, 106, 116, 0.08);
  border: 1px solid rgba(45, 106, 116, 0.22);
  border-left: 4px solid #dc6b6b;
  color: var(--xux-dark-blue);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(34, 62, 68, 0.06);
}

.xux-alert--warn {
  background: rgba(197, 160, 89, 0.12);
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-left: 4px solid var(--xux-gold);
  color: #4a3d22;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}

/* Alertas en listado (ej. partner dashboard) */
.xux-inline-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: 0.625rem;
  padding: 0.625rem 1rem;
  border: 1px solid;
}
.xux-inline-alert--critical {
  background: rgba(45, 106, 116, 0.08);
  border-color: rgba(220, 107, 107, 0.38);
  color: var(--xux-dark-blue);
}
.xux-inline-alert--critical .xux-inline-alert__dot {
  background: #e85d5d;
}
.xux-inline-alert--warn {
  background: rgba(197, 160, 89, 0.14);
  border-color: rgba(197, 160, 89, 0.4);
  color: #4a3d22;
}
.xux-inline-alert--warn .xux-inline-alert__dot {
  background: var(--xux-gold);
}
.xux-inline-alert__link {
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  opacity: 0.95;
}
.xux-inline-alert__link:hover {
  opacity: 1;
}

/* Mejora de contraste global para mantener legibilidad */
.text-gray-900, .text-gray-800 { color: var(--xux-text-strong) !important; }
.text-gray-700, .text-gray-600 { color: var(--xux-text-medium) !important; }
.text-gray-500, .text-gray-400 { color: var(--xux-text-soft) !important; }

/* Acabado visual de paneles */
.bg-white.rounded-xl.border,
.bg-white.rounded-2xl.border {
  box-shadow: 0 1px 3px rgba(44, 62, 80, 0.07);
}
