/* ==========================================================================
   AmautAI — Design System
   Tailwind CDN ya carga utilidades; este archivo agrega:
   - Fuente Inter
   - Variables de marca
   - Clases componentes (.btn, .card, .input, .badge, .empty-state, etc.)
   - Animaciones suaves
   - Estilos para gradientes y efectos
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tipografía
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;
  --brand-900: #312e81;
  --gradient-brand: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);
  --gradient-brand-soft: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  --gradient-danger:  linear-gradient(135deg, #ef4444 0%, #ec4899 100%);
  --gradient-info:    linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --shadow-brand: 0 10px 25px -5px rgba(79, 70, 229, 0.25);
  --shadow-soft:  0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-pop:   0 20px 50px -12px rgba(15, 23, 42, 0.18);
}

html { font-family: 'Inter', system-ui, -apple-system, sans-serif; }
body { font-feature-settings: 'cv11', 'ss01', 'ss03'; }

/* --------------------------------------------------------------------------
   Componentes — botones
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.625rem;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.25;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--gradient-brand);
  color: #ffffff;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -8px rgba(79,70,229,0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-success {
  background: var(--gradient-success);
  color: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.25);
}
.btn-success:hover { transform: translateY(-1px); }

.btn-danger {
  background: var(--gradient-danger);
  color: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover { transform: translateY(-1px); }

.btn-secondary {
  background: #ffffff;
  color: #475569;
  border-color: #e2e8f0;
}
.btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }

.btn-ghost {
  background: transparent;
  color: #64748b;
}
.btn-ghost:hover { background: #f1f5f9; color: #1e293b; }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; border-radius: 0.5rem; }
.btn-lg { padding: 0.875rem 1.5rem; font-size: 1rem; border-radius: 0.75rem; }

/* --------------------------------------------------------------------------
   Componentes — inputs
   -------------------------------------------------------------------------- */
.input,
.select,
.textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  background-color: #ffffff;
  color: #0f172a;
  transition: all 0.15s ease;
  line-height: 1.5;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.input::placeholder { color: #94a3b8; }

.field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.375rem;
}
.field-help {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.375rem;
  line-height: 1.4;
}
.field-error {
  font-size: 0.75rem;
  color: #dc2626;
  margin-top: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* --------------------------------------------------------------------------
   Componentes — cards
   -------------------------------------------------------------------------- */
.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: var(--shadow-soft);
}
.card-hover { transition: all 0.2s ease; }
.card-hover:hover {
  transform: translateY(-2px);
  border-color: var(--brand-300);
  box-shadow: var(--shadow-pop);
}
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
}
.card-body { padding: 1.5rem; }

/* --------------------------------------------------------------------------
   Componentes — badges
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-purple  { background: #ede9fe; color: #6d28d9; }
.badge-slate   { background: #f1f5f9; color: #475569; }

/* --------------------------------------------------------------------------
   Animaciones
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
@keyframes shimmer {
  0%   { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
.animate-fade-in { animation: fadeIn 0.4s ease forwards; }
.animate-slide-in { animation: slideInRight 0.3s ease forwards; }
.animate-pulse-soft { animation: pulse-soft 2s infinite; }

/* --------------------------------------------------------------------------
   Layouts utilidades
   -------------------------------------------------------------------------- */
.page-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}
@media (min-width: 640px) { .page-container { padding: 2rem 1.5rem; } }
@media (min-width: 1024px) { .page-container { padding: 2rem 2rem; } }

.page-narrow {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Empty states
   -------------------------------------------------------------------------- */
.empty-state {
  background: #ffffff;
  border: 2px dashed #e2e8f0;
  border-radius: 1rem;
  padding: 3rem 2rem;
  text-align: center;
}
.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  background: var(--gradient-brand-soft);
  border-radius: 1rem;
  color: var(--brand-600);
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Avatar
   -------------------------------------------------------------------------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-weight: 600;
  color: #ffffff;
  flex-shrink: 0;
  background: var(--gradient-brand);
}
.avatar-sm { width: 2rem; height: 2rem; font-size: 0.75rem; }
.avatar-md { width: 2.5rem; height: 2.5rem; font-size: 0.875rem; }
.avatar-lg { width: 3.5rem; height: 3.5rem; font-size: 1.125rem; }
.avatar-xl { width: 5rem; height: 5rem; font-size: 1.5rem; }

/* Variantes de color del avatar (basadas en la primera letra) */
.avatar-blue   { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.avatar-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.avatar-pink   { background: linear-gradient(135deg, #ec4899, #db2777); }
.avatar-green  { background: linear-gradient(135deg, #10b981, #059669); }
.avatar-amber  { background: linear-gradient(135deg, #f59e0b, #d97706); }
.avatar-red    { background: linear-gradient(135deg, #ef4444, #dc2626); }
.avatar-cyan   { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.avatar-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); }

/* --------------------------------------------------------------------------
   Stat tile (KPI)
   -------------------------------------------------------------------------- */
.stat {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem;
  overflow: hidden;
  transition: all 0.2s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient-brand);
}
.stat.stat-success::before { background: var(--gradient-success); }
.stat.stat-warning::before { background: var(--gradient-warning); }
.stat.stat-danger::before  { background: var(--gradient-danger); }
.stat.stat-info::before    { background: var(--gradient-info); }

/* --------------------------------------------------------------------------
   Section header (titulo + descripción + acciones)
   -------------------------------------------------------------------------- */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.025em;
}
.section-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   Hover ring para items clicables
   -------------------------------------------------------------------------- */
.ring-hover {
  transition: all 0.15s ease;
}
.ring-hover:hover {
  background-color: #f8fafc;
  box-shadow: inset 4px 0 0 var(--brand-500);
}

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */
.topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid #e2e8f0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  border-radius: 0.625rem;
  transition: all 0.15s ease;
}
.nav-link:hover { background: #f1f5f9; color: #0f172a; }
.nav-link.active {
  background: var(--brand-50);
  color: var(--brand-700);
}

/* --------------------------------------------------------------------------
   Brand mark (logo)
   -------------------------------------------------------------------------- */
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--gradient-brand);
  color: #ffffff;
  font-weight: 800;
  border-radius: 0.625rem;
  box-shadow: var(--shadow-brand);
}

/* --------------------------------------------------------------------------
   Form section divider
   -------------------------------------------------------------------------- */
.form-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.form-section-desc {
  font-size: 0.8125rem;
  color: #64748b;
  margin-bottom: 1.25rem;
}

/* --------------------------------------------------------------------------
   Tabs
   -------------------------------------------------------------------------- */
.tab-group {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 0.625rem;
  padding: 0.25rem;
  gap: 0.125rem;
}
.tab-item {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab-item:hover { color: #0f172a; }
.tab-item.active {
  background: #ffffff;
  color: var(--brand-700);
  box-shadow: var(--shadow-soft);
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */
.toast {
  border-left: 4px solid;
  background: #ffffff;
  padding: 0.875rem 1.125rem;
  border-radius: 0.625rem;
  box-shadow: var(--shadow-pop);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.toast-success { border-left-color: #10b981; }
.toast-danger  { border-left-color: #ef4444; }
.toast-warning { border-left-color: #f59e0b; }
.toast-info    { border-left-color: #3b82f6; }

/* --------------------------------------------------------------------------
   Patrón de fondo decorativo
   -------------------------------------------------------------------------- */
.bg-grid-soft {
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.bg-aurora {
  background:
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(236, 72, 153, 0.10) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(20, 184, 166, 0.08) 0px, transparent 50%);
}

/* --------------------------------------------------------------------------
   Scrollbar suave (Webkit)
   -------------------------------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid #f1f5f9; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
