/* =============================================
   RESET Y VARIABLES GLOBALES
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --card2: #f8fafc;
  --border: #e2e8f0;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #d97706;
  --purple: #9333ea;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #475569;
  --sidebar-w: 240px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

html, body {
  height: 100%;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* =============================================
   LAYOUT PRINCIPAL
   ============================================= */
.app { display: flex; height: 100vh; overflow: hidden; }

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  width: var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0 8px;
  margin: 16px 0 8px;
}
.nav-label:first-child { margin-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-bottom: 2px;
  user-select: none;
}
.nav-item:hover { background: var(--card2); color: var(--text); }
.nav-item.active { background: rgba(59, 130, 246, 0.15); color: var(--accent); }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 7px;
  font-family: 'Space Mono', monospace;
}

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.user-card { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text-muted); }

/* =============================================
   ÁREA DE CONTENIDO PRINCIPAL
   ============================================= */
.main { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.topbar-title { font-size: 18px; font-weight: 700; }
.topbar-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

/* =============================================
   BOTONES
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-soft); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--card2); color: var(--text); }
.btn-success { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.btn-success:hover { background: rgba(34,197,94,0.25); }
.btn-warning { background: rgba(245,158,11,0.15); color: var(--yellow); border: 1px solid rgba(245,158,11,0.3); }
.btn-warning:hover { background: rgba(245,158,11,0.25); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-ai { background: linear-gradient(135deg, #6366f1, #3b82f6); color: #fff; }
.btn-ai:hover { opacity: 0.9; transform: translateY(-1px); }

.notif-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--card2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; transition: background 0.2s;
}
.notif-btn:hover { background: var(--border); }
.notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px;
  background: var(--red); border-radius: 50%; border: 2px solid var(--card);
}

/* Contenido scrollable */
.content { flex: 1; overflow-y: auto; padding: 28px; }
.section { display: none; animation: fadeIn 0.3s ease; }
.section.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   TARJETAS KPI
   ============================================= */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; border-radius: var(--radius) var(--radius) 0 0;
}
.kpi-card.blue::before { background: var(--accent); }
.kpi-card.red::before  { background: var(--red); }
.kpi-card.green::before{ background: var(--green); }
.kpi-card.yellow::before{ background: var(--yellow); }

.kpi-icon { font-size: 22px; margin-bottom: 12px; }
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.kpi-value { font-family: 'Space Mono', monospace; font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.kpi-delta { font-size: 11px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--red); }

/* =============================================
   GRID DE CONTENIDO (2 columnas)
   ============================================= */
.content-grid { display: grid; grid-template-columns: 1fr 380px; gap: 16px; margin-bottom: 24px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-header {
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }

/* =============================================
   TABLA DE CLIENTES
   ============================================= */
.table-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

.search-box { flex: 1; min-width: 200px; position: relative; }
.search-box input {
  width: 100%;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px 9px 36px;
  color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 13px;
  outline: none; transition: border-color 0.2s;
}
.search-box input:focus { border-color: var(--accent); }
.search-box input::placeholder { color: var(--text-muted); }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--text-muted); }

.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  padding: 7px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border); background: transparent;
  color: var(--text-soft); transition: all 0.2s; font-family: 'DM Sans', sans-serif;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  padding: 10px 12px; text-align: left; color: var(--text-muted);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; border-bottom: 1px solid var(--border);
}
.data-table td { padding: 12px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { cursor: pointer; transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--card2); }

.client-info { display: flex; align-items: center; gap: 10px; }
.client-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.client-name { font-weight: 600; font-size: 13px; }
.client-cedula { font-size: 11px; color: var(--text-muted); font-family: 'Space Mono', monospace; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-green  { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-red    { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-yellow { background: rgba(245,158,11,0.15); color: var(--yellow); }
.badge-blue   { background: rgba(59,130,246,0.15); color: var(--accent); }
.badge-muted  { background: rgba(100,116,139,0.15); color: var(--text-muted); }

.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; min-width: 60px; }
.progress-fill { height: 100%; border-radius: 2px; transition: width 0.4s ease; }
.progress-label { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--text-muted); white-space: nowrap; }

.money { font-family: 'Space Mono', monospace; font-size: 12px; font-weight: 700; }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: all 0.25s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; width: 520px;
  max-width: calc(100vw - 32px); max-height: calc(100vh - 64px);
  overflow-y: auto; transform: scale(0.95) translateY(10px); transition: transform 0.25s;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px; border-radius: 50%; background: var(--card2);
  border: none; color: var(--text-soft); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 16px; transition: background 0.2s;
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* Formulario */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.form-control {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px;
  color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 13px;
  outline: none; transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--text-muted); }
.form-control option { background: var(--card2); }

/* =============================================
   DETALLE DE CUOTAS
   ============================================= */
.detail-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.detail-back {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-soft); transition: all 0.2s;
}
.detail-back:hover { background: var(--card2); color: var(--text); }
.detail-client-big { display: flex; align-items: center; gap: 14px; }
.detail-avatar-big {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff;
}
.detail-name { font-size: 18px; font-weight: 700; }
.detail-phone-model { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.detail-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.detail-stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.detail-stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.detail-stat-value { font-family: 'Space Mono', monospace; font-size: 16px; font-weight: 700; }

.cuotas-list { display: flex; flex-direction: column; gap: 8px; }
.cuota-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  display: flex; align-items: center; gap: 14px; transition: border-color 0.2s;
}
.cuota-item:hover { border-color: rgba(59,130,246,0.3); }
.cuota-num {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; font-family: 'Space Mono', monospace; flex-shrink: 0;
}
.cuota-num.pagada   { background: rgba(34,197,94,0.15); color: var(--green); }
.cuota-num.pendiente{ background: rgba(59,130,246,0.15); color: var(--accent); }
.cuota-num.vencida  { background: rgba(239,68,68,0.15); color: var(--red); }
.cuota-info { flex: 1; }
.cuota-fecha { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cuota-desc { font-size: 13px; font-weight: 500; }
.cuota-valor { font-family: 'Space Mono', monospace; font-size: 14px; font-weight: 700; text-align: right; }
.cuota-estado { display: flex; align-items: center; flex-direction: column; gap: 6px; align-items: flex-end; }

/* =============================================
   ALERTAS
   ============================================= */
.alert-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.alert-item:last-child { border-bottom: none; }
.alert-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.alert-icon.warn   { background: rgba(245,158,11,0.15); }
.alert-icon.danger { background: rgba(239,68,68,0.15); }
.alert-text { flex: 1; }
.alert-title { font-size: 13px; font-weight: 600; }
.alert-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* =============================================
   GRÁFICAS (Canvas)
   ============================================= */
.chart-container { position: relative; }
canvas { display: block; }

/* =============================================
   REPORTES
   ============================================= */
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.report-stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.report-stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.report-stat-val { font-family: 'Space Mono', monospace; font-size: 18px; font-weight: 700; margin-top: 4px; }
.report-stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* =============================================
   TOAST NOTIFICATION
   ============================================= */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow); min-width: 300px;
  animation: slideIn 0.3s ease; pointer-events: all;
}
@keyframes slideIn  { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(120%); opacity: 0; } }
.toast-icon { font-size: 20px; }
.toast-msg { font-size: 13px; font-weight: 500; flex: 1; }
.toast.success { border-left: 3px solid var(--green); }
.toast.warning { border-left: 3px solid var(--yellow); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--accent); }

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* =============================================
   SECTION TÍTULOS
   ============================================= */
.section-heading { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.section-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.cuota-connector { width: 2px; height: 16px; background: var(--border); margin-left: 15px; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-msg { font-size: 14px; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .detail-stats { grid-template-columns: repeat(2, 1fr); }
  .altaia-hero { grid-template-columns: 1fr; }
  .insights-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 60px; }
  .sidebar-logo img { max-width: 36px; }
  .nav-item span:not(.nav-icon), .nav-label, .user-name, .user-role { display: none; }
  .nav-item { justify-content: center; }
  .nav-badge { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .report-grid { grid-template-columns: 1fr 1fr; }
}

/* =============================================
   LUCIDE ICONS — TAMAÑOS
   ============================================= */
.nav-icon svg { width: 18px; height: 18px; stroke-width: 2; }
.kpi-icon { display: flex; align-items: center; justify-content: flex-start; margin-bottom: 12px; }
.kpi-icon svg { width: 22px; height: 22px; stroke-width: 2; }
.card-title svg { width: 16px; height: 16px; stroke-width: 2; vertical-align: -2px; }
.btn svg { width: 15px; height: 15px; stroke-width: 2; flex-shrink: 0; }
.btn-sm svg { width: 13px; height: 13px; }
.section-heading svg { width: 22px; height: 22px; stroke-width: 2; vertical-align: -4px; margin-right: 6px; }
.modal-title svg { width: 18px; height: 18px; stroke-width: 2; vertical-align: -3px; margin-right: 4px; }
.notif-btn svg { width: 17px; height: 17px; stroke-width: 2; }
.report-stat-icon { margin-bottom: 10px; color: var(--accent); }
.report-stat-icon svg { width: 26px; height: 26px; stroke-width: 1.8; }
.search-icon svg { width: 15px; height: 15px; }
.alert-icon svg { width: 20px; height: 20px; stroke-width: 2; }
.detail-back svg { width: 18px; height: 18px; stroke-width: 2.5; }
.toast-icon svg { width: 18px; height: 18px; stroke-width: 2; }

.report-stat.gold .report-stat-icon    { color: var(--yellow); }
.report-stat.danger .report-stat-icon  { color: var(--red); }
.report-stat.success .report-stat-icon { color: var(--green); }

/* Colores avatares */
.av-blue   { background: linear-gradient(135deg,#3b82f6,#6366f1); }
.av-purple { background: linear-gradient(135deg,#a855f7,#ec4899); }
.av-green  { background: linear-gradient(135deg,#22c55e,#10b981); }
.av-orange { background: linear-gradient(135deg,#f59e0b,#ef4444); }
.av-cyan   { background: linear-gradient(135deg,#06b6d4,#3b82f6); }
.av-pink   { background: linear-gradient(135deg,#ec4899,#a855f7); }
.av-teal   { background: linear-gradient(135deg,#14b8a6,#22c55e); }
.av-red    { background: linear-gradient(135deg,#ef4444,#f59e0b); }

/* =============================================
   CALCULADORA DE CRÉDITO — MODAL
   ============================================= */
.calc-result-box {
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(99,102,241,0.08));
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 16px;
}
.calc-result-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid rgba(59,130,246,0.1);
}
.calc-result-row:last-child { border-bottom: none; padding-top: 10px; }
.calc-result-row.total { font-weight: 700; font-size: 15px; }
.calc-result-label { font-size: 12px; color: var(--text-soft); }
.calc-result-val { font-family: 'Space Mono', monospace; font-size: 14px; font-weight: 700; color: var(--accent); }
.calc-result-row.total .calc-result-val { font-size: 18px; }

.amort-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 14px; }
.amort-table th { padding: 7px 10px; background: var(--bg); color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; }
.amort-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); font-family: 'Space Mono', monospace; font-size: 11px; }
.amort-table tr:last-child td { border-bottom: none; }

/* =============================================
   ALTAIA — ANÁLISIS INTELIGENTE
   ============================================= */
.altaia-section-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(59,130,246,0.12));
  border: 1px solid rgba(99,102,241,0.25);
  color: #6366f1; padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.altaia-section-badge svg { width: 12px; height: 12px; }

.altaia-hero { display: grid; grid-template-columns: 220px 1fr; gap: 20px; margin-bottom: 20px; }

.health-gauge-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 20px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.health-gauge-title { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.health-score-status { font-size: 15px; font-weight: 700; margin-top: 8px; }
.health-score-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.insights-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.insight-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  position: relative; overflow: hidden;
}
.insight-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 3px; height: 100%; border-radius: 3px 0 0 3px;
}
.insight-card.info::before    { background: var(--accent); }
.insight-card.warning::before { background: var(--yellow); }
.insight-card.danger::before  { background: var(--red); }
.insight-card.success::before { background: var(--green); }

.insight-header { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.insight-icon {
  width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px;
}
.insight-icon svg { width: 14px; height: 14px; stroke-width: 2.5; }
.insight-card.info .insight-icon    { background: rgba(59,130,246,0.12); color: var(--accent); }
.insight-card.warning .insight-icon { background: rgba(245,158,11,0.12); color: var(--yellow); }
.insight-card.danger .insight-icon  { background: rgba(239,68,68,0.12); color: var(--red); }
.insight-card.success .insight-icon { background: rgba(34,197,94,0.12); color: var(--green); }

.insight-title { font-size: 12px; font-weight: 700; color: var(--text); line-height: 1.4; }
.insight-body  { font-size: 12px; color: var(--text-soft); line-height: 1.5; }

/* Risk Matrix */
.risk-matrix-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.risk-matrix-table th { padding: 10px 12px; text-align: left; color: var(--text-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; border-bottom: 1px solid var(--border); }
.risk-matrix-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.risk-matrix-table tr:last-child td { border-bottom: none; }
.risk-matrix-table tbody tr:hover { background: var(--card2); }

.risk-score-cell { display: flex; align-items: center; gap: 8px; }
.risk-bar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; min-width: 60px; }
.risk-bar-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.risk-score-num { font-family: 'Space Mono', monospace; font-size: 11px; font-weight: 700; width: 28px; text-align: right; flex-shrink: 0; }

.risk-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.risk-badge.alto  { background: rgba(239,68,68,0.15); color: var(--red); }
.risk-badge.medio { background: rgba(245,158,11,0.15); color: var(--yellow); }
.risk-badge.bajo  { background: rgba(34,197,94,0.15); color: var(--green); }
.risk-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* Payment probability bars */
.pred-grid { display: flex; flex-direction: column; gap: 10px; }
.pred-row { display: flex; align-items: center; gap: 10px; }
.pred-name { font-size: 12px; font-weight: 500; width: 130px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pred-bar-outer { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.pred-bar-inner { height: 100%; border-radius: 4px; transition: width 1s ease; }
.pred-pct { font-size: 12px; font-weight: 700; font-family: 'Space Mono', monospace; width: 36px; text-align: right; flex-shrink: 0; }

/* =============================================
   CHAT IA
   ============================================= */
.chat-wrapper { display: flex; flex-direction: column; height: 480px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }

.chat-msg { display: flex; align-items: flex-end; gap: 8px; }
.chat-msg.user { flex-direction: row-reverse; }

.ai-avatar {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.ai-avatar svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 2; fill: none; }

.chat-bubble { max-width: 78%; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.55; }
.chat-bubble.ai-bubble { background: var(--card2); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }
.chat-bubble.user-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble strong { font-weight: 700; }

.typing-dots { display: flex; gap: 4px; align-items: center; padding: 4px 0; }
.typing-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: typingBounce 1.2s infinite ease-in-out; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--card2); }
.chat-chip {
  padding: 5px 12px; border-radius: 20px;
  background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2);
  color: var(--accent); font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all 0.2s; font-family: 'DM Sans', sans-serif;
}
.chat-chip:hover { background: rgba(59,130,246,0.16); border-color: var(--accent); }

.chat-input-row { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.chat-input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 14px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text);
  outline: none; transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--text-muted); }

/* =============================================
   WELCOME OVERLAY
   ============================================= */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}
.welcome-overlay.open {
  display: flex;
  animation: welcomeFadeIn 0.5s ease;
}

.welcome-bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at top left, rgba(99,102,241,0.18), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(59,130,246,0.15), transparent 50%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}
.welcome-bg-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(99,102,241,0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(59,130,246,0.08) 0%, transparent 40%);
  animation: welcomePulse 6s ease-in-out infinite;
}

@keyframes welcomePulse {
  0%, 100% { opacity: 0.8; }
  50%      { opacity: 1; }
}
@keyframes welcomeFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes welcomeSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.welcome-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 24px;
  padding: 44px 48px 36px;
  text-align: center;
  box-shadow:
    0 40px 100px rgba(0,0,0,0.5),
    0 0 0 1px rgba(99,102,241,0.3),
    0 0 60px rgba(99,102,241,0.25);
  animation: welcomeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}
.welcome-logo {
  max-width: 200px;
  width: 100%;
  height: auto;
  display: block;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(59,130,246,0.08));
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #6366f1;
  margin-bottom: 18px;
}
.welcome-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
  animation: welcomePulse 1.8s ease-in-out infinite;
}

.welcome-title {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.welcome-subtitle {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 4px;
}
.welcome-product {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.welcome-desc {
  font-size: 14px;
  color: #475569;
  line-height: 1.65;
  margin-bottom: 26px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.welcome-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 30px;
}
.welcome-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  justify-content: flex-start;
}
.welcome-feature svg {
  width: 16px;
  height: 16px;
  color: #6366f1;
  flex-shrink: 0;
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.welcome-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 8px 24px rgba(99,102,241,0.4);
}
.welcome-btn-primary svg { width: 18px; height: 18px; }
.welcome-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(99,102,241,0.5);
}

.welcome-btn-ghost {
  padding: 11px 20px;
  background: transparent;
  color: #64748b;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.18s;
}
.welcome-btn-ghost:hover {
  background: #f8fafc;
  color: #0f172a;
}

@media (max-width: 520px) {
  .welcome-card { padding: 32px 24px 26px; }
  .welcome-title { font-size: 23px; }
  .welcome-features { grid-template-columns: 1fr; }
}

/* =============================================
   FRECUENCIA DE PAGO (mensual / quincenal)
   ============================================= */
.frec-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.frec-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
}
.frec-btn svg {
  width: 22px;
  height: 22px;
  color: #94a3b8;
  flex-shrink: 0;
  transition: color 0.2s;
}
.frec-btn:hover { background: #f8fafc; }
.frec-btn.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(99,102,241,0.04));
  border-color: #6366f1;
}
.frec-btn.active svg { color: #6366f1; }
.frec-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1px;
}
.frec-btn.active .frec-title { color: #6366f1; }
.frec-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* =============================================
   VISTA PREVIA DEL PLAN DE PAGOS
   ============================================= */
.plan-preview {
  margin-top: 20px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(59,130,246,0.02));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 14px;
}
.plan-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(99,102,241,0.2);
}
.plan-preview-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #6366f1;
}
.plan-preview-title svg { width: 16px; height: 16px; }
.plan-preview-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.plan-preview-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.plan-sum-item {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.plan-sum-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  font-weight: 600;
}
.plan-sum-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Space Mono', monospace;
}
.plan-sum-val.accent { color: #6366f1; }
.plan-sum-val.small { font-size: 12px; font-family: 'DM Sans', sans-serif; font-weight: 600; }

.plan-preview-table-wrap {
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.plan-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.plan-preview-table thead {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}
.plan-preview-table th {
  text-align: left;
  padding: 9px 14px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.plan-preview-table td {
  padding: 8px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text);
}
.plan-preview-table tbody tr:last-child td { border-bottom: none; }
.plan-preview-table tbody tr:hover { background: #f8fafc; }
.plan-cuota-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(99,102,241,0.1);
  color: #6366f1;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Space Mono', monospace;
}
@media (max-width: 700px) {
  .plan-preview-summary { grid-template-columns: 1fr 1fr; }
}

/* =============================================
   PAGOS: botones tipo (completo/parcial)
   ============================================= */
.pago-tipo-row {
  display: flex;
  gap: 8px;
}
.pago-tipo-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.pago-tipo-btn svg { width: 16px; height: 16px; }
.pago-tipo-btn:hover { background: #f8fafc; }
.pago-tipo-btn.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(99,102,241,0.04));
  border-color: #6366f1;
  color: #6366f1;
}

/* =============================================
   ALERTA DE INTERESES DE MORA
   ============================================= */
.mora-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(239,68,68,0.03));
  border: 1px solid rgba(239,68,68,0.25);
  border-left: 4px solid var(--red);
  border-radius: 10px;
}
.mora-alert-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(239,68,68,0.15);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mora-alert-icon svg { width: 20px; height: 20px; }
.mora-alert-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--red);
  margin-bottom: 2px;
}
.mora-alert-sub {
  font-size: 12px;
  color: var(--text-soft);
}

/* =============================================
   RECIBO DE PAGO (modal)
   ============================================= */
.recibo-container {
  padding: 28px 32px;
  background: #fff;
  font-family: 'DM Sans', sans-serif;
  color: #0f172a;
}
.recibo-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}
.recibo-logo-text {
  font-size: 22px;
  font-weight: 800;
  color: #6366f1;
  letter-spacing: -0.02em;
}
.recibo-sub {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}
.recibo-num-label {
  font-size: 10px;
  color: #94a3b8;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.recibo-num {
  font-family: 'Space Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}
.recibo-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: #475569;
  margin-bottom: 12px;
}
.recibo-meta strong { color: #0f172a; font-weight: 600; }
.recibo-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 14px 0;
}
.recibo-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #6366f1;
  margin-bottom: 8px;
}
.recibo-client { font-size: 13px; line-height: 1.5; color: #0f172a; }
.recibo-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.recibo-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #334155;
}
.recibo-row.recibo-total {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 2px solid #0f172a;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.recibo-row.recibo-total span:last-child { color: #22c55e; }
.recibo-firmas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 40px;
}
.recibo-firma-line {
  border-top: 1px solid #0f172a;
  margin-bottom: 5px;
}
.recibo-firma-label {
  text-align: center;
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.recibo-footer {
  text-align: center;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px dashed #cbd5e1;
}

/* =============================================
   REPORTE AGING (cartera por antigüedad)
   ============================================= */
.aging-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.aging-summary-item {
  padding: 10px 14px;
  background: var(--card2);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.aging-summary-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}
.aging-summary-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Space Mono', monospace;
}
.aging-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.aging-row {}
.aging-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.aging-row-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}
.aging-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.aging-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}
.aging-row-amount {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.aging-bar-track {
  height: 12px;
  background: var(--card2);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.aging-bar-fill {
  height: 100%;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
  border-radius: 5px;
}
.aging-row-footer {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
@media (max-width: 700px) {
  .aging-summary { grid-template-columns: 1fr; }
}

/* =============================================
   TOUR INTERACTIVO — PASO A PASO
   ============================================= */
#tour-root {
  transition: opacity 0.35s ease;
}

/* Overlay SVG con efecto spotlight */
.tour-svg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9000;
  pointer-events: all;
}

/* Anillo de resalte alrededor del elemento destacado */
#tour-ring {
  position: fixed;
  z-index: 9100;
  border-radius: 14px;
  border: 2px solid #6366f1;
  box-shadow:
    0 0 0 5px rgba(99,102,241,0.18),
    0 0 32px rgba(99,102,241,0.35),
    inset 0 0 0 1px rgba(99,102,241,0.1);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, left 0.35s cubic-bezier(0.4,0,0.2,1),
              top 0.35s cubic-bezier(0.4,0,0.2,1),
              width 0.35s cubic-bezier(0.4,0,0.2,1),
              height 0.35s cubic-bezier(0.4,0,0.2,1);
}

/* Tarjeta del tour */
.tour-card {
  position: fixed;
  z-index: 9200;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #ffffff;
  border: 2px solid #6366f1;
  border-radius: 18px;
  padding: 24px 26px 22px;
  box-shadow:
    0 32px 80px rgba(0,0,0,0.35),
    0 0 0 6px rgba(99,102,241,0.15),
    0 4px 20px rgba(99,102,241,0.25);
  opacity: 1;
  backdrop-filter: none;
  transition:
    top  0.38s cubic-bezier(0.4,0,0.2,1),
    left 0.38s cubic-bezier(0.4,0,0.2,1);
}

.tour-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* Puntos de progreso */
.tour-dots {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  max-width: 240px;
}

.tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.tour-dot.active {
  background: #6366f1;
  width: 22px;
  border-radius: 4px;
}

.tour-dot.done {
  background: rgba(99,102,241,0.4);
}

/* Botón saltar */
.tour-skip-btn {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}
.tour-skip-btn:hover {
  color: var(--text-soft);
  background: var(--bg);
}

/* Numeración del paso */
.tour-step-num {
  font-size: 10.5px;
  font-weight: 700;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 7px;
}

/* Título del paso */
.tour-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 10px;
}

/* Descripción del paso */
.tour-body {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.65;
  margin-bottom: 20px;
}

.tour-dot { background: #e2e8f0; }
.tour-skip-btn { color: #94a3b8; }
.tour-skip-btn:hover { color: #475569; background: #f1f5f9; }
.tour-btn-ghost { color: #475569; border-color: #e2e8f0; background: #fff; }
.tour-btn-ghost:hover { background: #f8fafc; color: #0f172a; }

/* Fila de botones */
.tour-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Botones del tour */
.tour-btn {
  padding: 9px 18px;
  border-radius: 9px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: -0.01em;
}

.tour-btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border);
}
.tour-btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

.tour-btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.tour-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.45);
}

.tour-btn-success {
  background: linear-gradient(135deg, var(--green), #16a34a);
  color: #fff;
  box-shadow: 0 4px 14px rgba(34,197,94,0.35);
}
.tour-btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(34,197,94,0.45);
}

/* Botón flotante para iniciar el tour */
.tour-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 8000;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 13px 20px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 28px rgba(99,102,241,0.45);
  transition: all 0.2s ease;
  letter-spacing: -0.01em;
}
.tour-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(99,102,241,0.55);
}
.tour-fab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
