/* CheGasto - Global Styles (Premium Dark Mode v6 - CONFIG + CREDITOS FIX) */

:root {
  /* 🎨 Variables para modo oscuro consistente */
  --cg-dark-bg: #0a0e1a;
  --cg-dark-panel: rgba(17, 24, 39, 0.95);
  --cg-dark-panel-elevated: rgba(30, 41, 59, 0.92);
  --cg-dark-panel-light: rgba(30, 41, 59, 0.65);
  
  /* ⚡ Bordes MUY SUTILES para tablas */
  --cg-dark-border-subtle: rgba(148, 163, 184, 0.06);
  --cg-dark-border: rgba(148, 163, 184, 0.12);
  --cg-dark-border-strong: rgba(148, 163, 184, 0.20);
  
  --cg-dark-hover: rgba(255, 255, 255, 0.08);
  --cg-dark-text: rgba(248, 250, 252, 0.98);
  --cg-dark-text-muted: rgba(203, 213, 225, 0.85);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-subtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
@keyframes spin { 
  to { transform: rotate(360deg); } 
}

.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-pulse-subtle { animation: pulse-subtle 2s ease-in-out infinite; }

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f4f6;
  border-top-color: #6366f1;
  border-radius: 9999px;
  animation: spin 0.8s linear infinite;
}

/* Hide scrollbar utility */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* =========================
   MODALES (Premium + Dark)
   ========================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 60;
}

.modal-backdrop > div {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.60),
              0 10px 30px rgba(99, 102, 241, 0.15);
}

.dark .modal-backdrop {
  background: rgba(2, 6, 23, 0.82);
}

.dark .modal-backdrop > div {
  background: var(--cg-dark-panel-elevated);
  border-color: var(--cg-dark-border-strong);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.80),
              0 10px 30px rgba(99, 102, 241, 0.20);
}

/* Modal form controls */
.dark .modal-backdrop input,
.dark .modal-backdrop textarea,
.dark .modal-backdrop select {
  background: rgba(30, 41, 59, 0.85);
  border-color: var(--cg-dark-border-strong);
  color: var(--cg-dark-text);
}

.dark .modal-backdrop input:focus,
.dark .modal-backdrop textarea:focus,
.dark .modal-backdrop select:focus {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(99, 102, 241, 0.50);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.dark .modal-backdrop input::placeholder,
.dark .modal-backdrop textarea::placeholder {
  color: rgba(148, 163, 184, 0.70);
}

/* Modal backgrounds */
.dark .modal-backdrop .bg-white {
  background-color: var(--cg-dark-panel) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.20);
}

.dark .modal-backdrop .bg-slate-50,
.dark .modal-backdrop .bg-slate-100 {
  background-color: var(--cg-dark-panel-light) !important;
}

/* Cards de Reintegro/Reembolso en modales */
.dark .modal-backdrop .bg-emerald-50 {
  background-color: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
}

.dark .modal-backdrop .border-emerald-200 {
  border-color: rgba(16, 185, 129, 0.25) !important;
}

.dark .modal-backdrop .text-emerald-700,
.dark .modal-backdrop .text-emerald-800,
.dark .modal-backdrop .text-emerald-900 {
  color: rgba(52, 211, 153, 0.95) !important;
}

.dark .modal-backdrop .bg-sky-50 {
  background-color: rgba(14, 165, 233, 0.15) !important;
  border-color: rgba(14, 165, 233, 0.25) !important;
}

.dark .modal-backdrop .border-sky-200 {
  border-color: rgba(14, 165, 233, 0.25) !important;
}

.dark .modal-backdrop .text-sky-700,
.dark .modal-backdrop .text-sky-800,
.dark .modal-backdrop .text-sky-900 {
  color: rgba(56, 189, 248, 0.95) !important;
}

/* Modal borders */
.dark .modal-backdrop .border-slate-100,
.dark .modal-backdrop .border-slate-200 {
  border-color: var(--cg-dark-border) !important;
}

.dark .modal-backdrop .border-slate-300 {
  border-color: var(--cg-dark-border-strong) !important;
}

/* Modal text colors */
.dark .modal-backdrop .text-slate-900 { color: #f8fafc !important; }
.dark .modal-backdrop .text-slate-800 { color: #f1f5f9 !important; }
.dark .modal-backdrop .text-slate-700 { color: #e2e8f0 !important; }
.dark .modal-backdrop .text-slate-600 { color: var(--cg-dark-text-muted) !important; }
.dark .modal-backdrop .text-slate-500 { color: rgba(148, 163, 184, 0.85) !important; }

/* Modal hover states */
.dark .modal-backdrop .hover\:bg-slate-50:hover,
.dark .modal-backdrop .hover\:bg-slate-100:hover,
.dark .modal-backdrop .hover\:bg-white:hover {
  background-color: var(--cg-dark-hover) !important;
}

/* =========================
   MAIN VIEWS (Dark mode)
   ========================= */

/* Cards y KPIs */
.dark #view-container .bg-white {
  background-color: var(--cg-dark-panel) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15),
              0 1px 3px rgba(0, 0, 0, 0.10);
}

.dark #view-container .shadow-sm {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.dark #view-container .shadow-md {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

.dark #view-container .bg-slate-50,
.dark #view-container .bg-slate-100 {
  background-color: var(--cg-dark-panel-light) !important;
}

/* Borders generales */
.dark #view-container .border-slate-50,
.dark #view-container .border-slate-100 {
  border-color: var(--cg-dark-border) !important;
}

.dark #view-container .border-slate-200,
.dark #view-container .border-slate-300 {
  border-color: var(--cg-dark-border-strong) !important;
}

/* Text colors */
.dark #view-container .text-slate-900 { color: #f8fafc !important; }
.dark #view-container .text-slate-800 { color: #f1f5f9 !important; }
.dark #view-container .text-slate-700 { color: #e2e8f0 !important; }
.dark #view-container .text-slate-600 { color: #cbd5e1 !important; }
.dark #view-container .text-slate-500 { color: #94a3b8 !important; }
.dark #view-container .text-slate-400 { color: #94a3b8 !important; }

/* Hover states */
.dark #view-container .hover\:bg-slate-50:hover,
.dark #view-container .hover\:bg-slate-100:hover,
.dark #view-container .hover\:bg-white:hover {
  background-color: var(--cg-dark-hover) !important;
}

/* =========================
   🎯 FIX: CONFIGURACIÓN - Listas de items
   ========================= */

/* Listas dentro de modales de configuración - MÁS SEPARACIÓN */
.dark .modal-backdrop > div > div[class*="max-h"] {
  background-color: rgba(15, 23, 42, 0.40) !important;
}

/* ✅ Tablas: hover sigue funcionando */
.dark #view-container tbody tr:hover {
  background-color: var(--cg-dark-hover) !important;
}

/* ✅ Listas / filas dentro de modales (solo si explícitamente son items con hover:bg...) */
.dark .modal-backdrop .hover\:bg-slate-50:hover,
.dark .modal-backdrop .hover\:bg-slate-100:hover,
.dark .modal-backdrop .hover\:bg-white:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

/* ✅ Bordes solo en elementos que ya tienen clase border-... (no en cualquier div) */
.dark .modal-backdrop .border,
.dark .modal-backdrop .border-slate-100,
.dark .modal-backdrop .border-slate-200,
.dark .modal-backdrop .border-slate-300 {
  border-color: var(--cg-dark-border) !important;
}


/* ============================================================
   🎯 CORRECCIÓN QUIRÚRGICA: CRÉDITOS - Cards de tarjetas
   ============================================================ */

/* 1. Fondo de la tarjeta: Menos saturado, más profundidad */
.dark #view-container .bg-gradient-to-r.from-orange-50.to-red-50 {
  background: linear-gradient(90deg, 
    rgba(30, 41, 59, 0.7) 0%,   /* Slate oscuro para base */
    rgba(234, 88, 12, 0.08) 100% /* Toque sutil de naranja al final */
  ) !important;
  border: 1px solid rgba(251, 146, 60, 0.2) !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* 2. Títulos: Blanco puro para máximo contraste */
.dark #view-container .bg-gradient-to-r.from-orange-50.to-red-50 .text-orange-900,
.dark #view-container .bg-gradient-to-r.from-orange-50.to-red-50 .text-orange-800 {
  color: #ffffff !important; 
  font-weight: 600;
}

/* 3. Monto (Gs.): Amarillo brillante (neón suave) para que resalte */
.dark #view-container .bg-gradient-to-r.from-orange-50.to-red-50 .text-orange-700 {
  color: #fbbf24 !important; /* Amber 400 */
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

/* 4. Textos secundarios (Cierre, Deuda total): Gris claro legible */
.dark #view-container .bg-gradient-to-r.from-orange-50.to-red-50 .text-orange-800\/80,
.dark #view-container .bg-gradient-to-r.from-orange-50.to-red-50 .text-orange-700\/70,
.dark #view-container .bg-gradient-to-r.from-orange-50.to-red-50 .text-xs {
  color: #94a3b8 !important; /* Slate 400 */
}

/* 5. Botón Pagar: Naranja vibrante para el CTA */
.dark #view-container .bg-gradient-to-r.from-orange-50.to-red-50 button,
.dark #view-container .bg-gradient-to-r.from-orange-50.to-red-50 .bg-orange-600 {
  background-color: #ea580c !important; /* Orange 600 */
  color: white !important;
  border: none !important;
}

/* =========================
   TOTAL GASTADO ANUAL
   ========================= */
.dark #view-container .bg-gradient-to-br.from-indigo-50.to-purple-50 {
  background: linear-gradient(135deg,
    rgba(79, 70, 229, 0.18),
    rgba(147, 51, 234, 0.18)
  ) !important;
  border: 1px solid rgba(99, 102, 241, 0.22);
}

.dark #view-container .bg-gradient-to-br.from-indigo-50.to-purple-50 .text-indigo-900,
.dark #view-container .bg-gradient-to-br.from-indigo-50.to-purple-50 .text-indigo-800,
.dark #view-container .bg-gradient-to-br.from-indigo-50.to-purple-50 .text-indigo-700 {
  color: rgba(248, 250, 252, 0.98) !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.50);
}

.dark #view-container .bg-gradient-to-br.from-indigo-50.to-purple-50 .text-indigo-600,
.dark #view-container .bg-gradient-to-br.from-indigo-50.to-purple-50 .text-indigo-500 {
  color: rgba(203, 213, 225, 0.92) !important;
}

/* =========================
   GRADIENTES ESPECIALES
   ========================= */

/* Resumen IRP */
.dark #view-container .bg-gradient-to-r.from-indigo-50.to-purple-50 {
  background: linear-gradient(90deg, 
    rgba(79, 70, 229, 0.22), 
    rgba(147, 51, 234, 0.22)) !important;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.dark #view-container .border-indigo-200 {
  border-color: rgba(99, 102, 241, 0.30) !important;
}

.dark #view-container .text-indigo-600 {
  color: rgba(165, 180, 252, 0.98) !important;
}

/* Dashboard - Balance del mes */
.dark #view-container .bg-gradient-to-br.from-slate-50.to-slate-100 {
  background: linear-gradient(135deg, 
    rgba(30, 41, 59, 0.55), 
    rgba(51, 65, 85, 0.55)) !important;
  border: 1px solid var(--cg-dark-border-strong);
}

/* =========================
   TABLAS - LÍNEAS SUTILES
   ========================= */

/* Headers de tabla */
.dark #view-container thead.bg-slate-50 {
  background-color: rgba(30, 41, 59, 0.60) !important;
  border-bottom: 1px solid var(--cg-dark-border);
}

.dark #view-container thead .border-slate-200 {
  border-color: var(--cg-dark-border) !important;
}

/* Divisores de filas - CASI INVISIBLES */
.dark #view-container .divide-y.divide-slate-100 > * + * {
  border-top-color: var(--cg-dark-border-subtle) !important;
}

/* Bordes de tabla body */
.dark #view-container tbody .border-slate-100 {
  border-color: var(--cg-dark-border-subtle) !important;
}

.dark #view-container tbody .border-slate-200 {
  border-color: var(--cg-dark-border) !important;
}

/* Bordes generales en tablas */
.dark #view-container table .border-t,
.dark #view-container table .border-b {
  border-color: var(--cg-dark-border-subtle) !important;
}

.dark #view-container table .border-t-2 {
  border-color: var(--cg-dark-border) !important;
}

/* Filas hover */
.dark #view-container tbody tr.hover\:bg-slate-50:hover,
.dark #view-container tbody tr.hover\:bg-slate-100:hover {
  background-color: var(--cg-dark-hover) !important;
  transition: background-color 0.15s ease;
}

/* Pills de tipo en tablas */
.dark #view-container .bg-indigo-100 {
  background-color: rgba(99, 102, 241, 0.22) !important;
}

.dark #view-container .text-indigo-700 {
  color: rgba(165, 180, 252, 0.98) !important;
}

.dark #view-container .bg-rose-100 {
  background-color: rgba(244, 63, 94, 0.22) !important;
}

.dark #view-container .text-rose-700 {
  color: rgba(251, 113, 133, 0.98) !important;
}

.dark #view-container .bg-emerald-100 {
  background-color: rgba(16, 185, 129, 0.22) !important;
}

.dark #view-container .text-emerald-700 {
  color: rgba(52, 211, 153, 0.98) !important;
}

/* Pills de estado en views */
.dark #view-container .bg-emerald-50 {
  background-color: rgba(16, 185, 129, 0.15) !important;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.dark #view-container .text-emerald-800,
.dark #view-container .text-emerald-900 {
  color: rgba(52, 211, 153, 0.95) !important;
}

.dark #view-container .bg-sky-50 {
  background-color: rgba(14, 165, 233, 0.15) !important;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

.dark #view-container .text-sky-700,
.dark #view-container .text-sky-800 {
  color: rgba(56, 189, 248, 0.95) !important;
}

/* =========================
   BACKGROUNDS DE COLORES
   ========================= */

.dark #view-container .bg-indigo-50,
.dark #view-container .bg-blue-50,
.dark #view-container .bg-purple-50 {
  background-color: rgba(79, 70, 229, 0.12) !important;
  border: 1px solid rgba(99, 102, 241, 0.20);
}

.dark #view-container .bg-rose-50 {
  background-color: rgba(244, 63, 94, 0.12) !important;
  border: 1px solid rgba(244, 63, 94, 0.20);
}

/* Form controls */
.dark #view-container input,
.dark #view-container textarea,
.dark #view-container select {
  background-color: rgba(30, 41, 59, 0.75);
  border-color: var(--cg-dark-border-strong);
  color: var(--cg-dark-text);
}

.dark #view-container input:focus,
.dark #view-container textarea:focus,
.dark #view-container select:focus {
  background-color: rgba(30, 41, 59, 0.90);
  border-color: rgba(99, 102, 241, 0.50);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.dark #view-container input::placeholder,
.dark #view-container textarea::placeholder {
  color: rgba(148, 163, 184, 0.65);
}

/* Botones neutros */
.dark button.bg-white,
.dark a.bg-white {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--cg-dark-text) !important;
  border-color: var(--cg-dark-border-strong) !important;
}

.dark button.bg-white:hover,
.dark a.bg-white:hover {
  background-color: rgba(255, 255, 255, 0.12) !important;
}

/* Estados seleccionados */
.dark [data-selected="true"],
.dark .tipo-btn.border-indigo-600,
.dark .tipo-inv-btn.border-indigo-600 {
  background-color: rgba(99, 102, 241, 0.20) !important;
  border-color: rgba(99, 102, 241, 0.50) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

/* Color scheme */
.dark input,
.dark textarea,
.dark select {
  color-scheme: dark;
}

/* Scrollbar */
.dark ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.dark ::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.40);
}

.dark ::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.40);
  border-radius: 5px;
  border: 2px solid rgba(30, 41, 59, 0.40);
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.60);
}

/* Fix hover botones dashed */
.dark #view-container .hover\:bg-indigo-50:hover {
  background-color: rgba(99, 102, 241, 0.15) !important;
}

/* Botones de acción */
.dark button.bg-indigo-600,
.dark button.bg-emerald-600,
.dark button.bg-rose-600,
.dark button.bg-orange-600 {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.30);
}

.dark button.bg-indigo-600:hover,
.dark button.bg-emerald-600:hover,
.dark button.bg-rose-600:hover,
.dark button.bg-orange-600:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.40);
  transform: translateY(-1px);
  transition: all 0.15s ease;
}

/* Details/Summary */
.dark details summary {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.dark details summary:hover {
  background-color: var(--cg-dark-hover);
}

/* Tooltips */
.dark .group:hover span[class*="bg-slate-900"] {
  background-color: rgba(15, 23, 42, 0.95) !important;
  border-color: rgba(148, 163, 184, 0.30) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.60);
}

/* =========================
   🎯 FIX: Gradiente -r (horizontal) igual a -br (diagonal)
   Aplica mismo estilo a ambos gradientes indigo/purple
   ========================= */

/* Gradiente horizontal (from-indigo-50 to-purple-50) */
.dark #view-container .bg-gradient-to-r.from-indigo-50.to-purple-50 {
  background: linear-gradient(90deg, 
    rgba(79, 70, 229, 0.18), 
    rgba(147, 51, 234, 0.18)) !important;
  border: 1px solid rgba(99, 102, 241, 0.22);
}

/* Textos dentro del gradiente horizontal - MISMO ESTILO */
.dark #view-container .bg-gradient-to-r.from-indigo-50.to-purple-50 .text-indigo-900,
.dark #view-container .bg-gradient-to-r.from-indigo-50.to-purple-50 .text-indigo-800,
.dark #view-container .bg-gradient-to-r.from-indigo-50.to-purple-50 .text-indigo-700 {
  color: rgba(248, 250, 252, 0.98) !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.50);
}

.dark #view-container .bg-gradient-to-r.from-indigo-50.to-purple-50 .text-indigo-600,
.dark #view-container .bg-gradient-to-r.from-indigo-50.to-purple-50 .text-indigo-500 {
  color: rgba(203, 213, 225, 0.92) !important;
}


/* ============================================================
   🎯 CLEAN-UP TOTAL: CONFIG & MODALS (DARK MODE)
   ============================================================ */

/* 1. Resetear bordes de Tailwind que brillan */
.dark .modal-backdrop .divide-y > * + *,
.dark .modal-backdrop .border-slate-100,
.dark .divide-slate-100 > * + * {
    border-image: none !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    /* Forzamos un ancho mínimo para que no se vea tosco */
    border-top-width: 1px !important;
}

/* 2. Corregir el Header del Modal (La línea de arriba de todo) */
.dark .modal-backdrop div[class*="border-b"] {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

/* 3. Corregir el Footer del Modal (Donde están Crear/Cerrar) */
.dark .modal-backdrop div[class*="border-t"] {
    border-top-color: rgba(255, 255, 255, 0.08) !important;
}

/* 4. Cards de Configuración (Fondo y Bordes) */
.dark .bg-white {
    background-color: rgba(15, 23, 42, 0.6) !important; /* Slate-900 muy oscuro */
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* 5. Títulos y Textos para que no sean negros */
.dark .text-slate-900, 
.dark .text-slate-800,
.dark h3 {
    color: #f1f5f9 !important; /* Casi blanco */
}

.dark .text-slate-500 {
    color: #94a3b8 !important; /* Gris suave */
}

/* 6. Hover de la lista (Sutil) */
.dark .group.hover\:bg-slate-50:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* ============================================================
   🎯 FIX: CHIPS DINÁMICOS (GLASS STYLE)
   Ataca directamente las clases que inyecta el JS
   ============================================================ */

/* EGRESO 🔴 */
.dark .bg-rose-100 {
  background-color: rgba(244, 63, 94, 0.18) !important; /* Fondo translúcido */
  color: #fb7185 !important; /* Texto rosa claro legible */
  border: 1px solid rgba(244, 63, 94, 0.3) !important;
  font-weight: 600 !important;
}

/* INGRESO 🟢 */
.dark .bg-emerald-100 {
  background-color: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important; /* Verde esmeralda claro */
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  font-weight: 600 !important;
}

/* INVERSIÓN 📈 */
.dark .bg-indigo-100 {
  background-color: rgba(99, 102, 241, 0.18) !important;
  color: #a5b4fc !important; /* Indigo claro */
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  font-weight: 600 !important;
}

/* TRANSFERENCIA / OTROS ↔ */
.dark .bg-slate-100 {
  background-color: rgba(148, 163, 184, 0.15) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
  font-weight: 600 !important;
}

/* Ajuste para que el div mt-2 no pegue el chip al texto */
.mt-2 > span[class*="bg-rose-100"],
.mt-2 > span[class*="bg-emerald-100"],
.mt-2 > span[class*="bg-indigo-100"],
.mt-2 > span[class*="bg-slate-100"] {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem !important;
  border-radius: 9999px !important;
  font-size: 0.75rem !important;
}

/* Tooltips con bordes más cuadrados */
.dark .group:hover span[class*="bg-slate-900"],
.dark .group:hover span[class*="bg-white"] {
  border-radius: 0.375rem !important; /* rounded-md */
}

/* Alertas modo oscuro - solo para notificaciones en grid */
.dark button.from-rose-50,
.dark button.from-orange-50 {
  background: #6d3120 !important;
}

.dark button.border-rose-200,
.dark button.border-orange-200 {
  border-color: rgba(213, 197, 191, 0.3) !important;
}

.dark button.from-rose-50 .text-rose-700,
.dark button.from-rose-50 .text-rose-600,
.dark button.from-orange-50 .text-orange-700,
.dark button.from-orange-50 .text-orange-600 {
  color: #d5c5bf !important;
}


/* Suavizar bordes en modo oscuro */
.dark .border-b {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Movimientos - bordes y fondos en modo oscuro */
.dark .border-slate-200 {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.dark .bg-slate-50 {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

.dark .divide-y > * {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.dark .hover\:bg-slate-50:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Select options - modo oscuro */
.dark select option {
  background-color: #1a1a1a;
  color: #ffffff;
}

/* Select options - modo claro */
select option {
  background-color: #ffffff;
  color: #000000;
}
/* Auth pages: ocultar layout general (header/footer) */
body.auth-page header,
body.auth-page footer {
  display: none !important;
}
/* Auth pages: fullscreen real (sin wrapper de app) */
body.auth-page main {
  padding: 0 !important;
  height: 100vh !important;
  overflow: hidden !important;
}

body.auth-page #view-container {
  height: 100vh !important;
}

/* mata el wrapper global max-w-7xl y el padding del main */
body.auth-page main > div {
  max-width: none !important;
  padding: 0 !important;
  height: 100% !important;
}

/* Register: fondo fijo, sin crossfade */
.login-bg-fixed::before,
.login-bg-fixed::after {
  opacity: 0 !important;
}
/* ============================= */
/* Scroll invisible premium */
/* ============================= */

.scrollbar-invisible {
  scrollbar-width: thin;               /* Firefox */
  scrollbar-color: transparent transparent;
}

.scrollbar-invisible:hover {
  scrollbar-color: rgba(148,163,184,.45) transparent;
}

/* WebKit (Chrome, Edge, Safari) */
.scrollbar-invisible::-webkit-scrollbar {
  width: 8px;
}

.scrollbar-invisible::-webkit-scrollbar-track {
  background: transparent;
}

.scrollbar-invisible::-webkit-scrollbar-thumb {
  background-color: rgba(148,163,184,0);
  border-radius: 999px;
  transition: background-color .2s ease;
}

.scrollbar-invisible:hover::-webkit-scrollbar-thumb {
  background-color: rgba(148,163,184,.45);
}

.dark .bg-orange-50 {
  background: #6d3120 !important;
}

/* ============================================================
   🎯 Resumen: cards rosadas/verdes (bg-rose-50 / bg-emerald-50) en DARK
   ============================================================ */

/* --- GASTOS (rose) --- */
.dark #view-container .bg-rose-50 {
  background-color: rgba(244, 63, 94, 0.10) !important;
}

.dark #view-container .border-rose-200 {
  border-color: rgba(244, 63, 94, 0.22) !important;
}

.dark #view-container .bg-rose-50 .text-rose-900,
.dark #view-container .bg-rose-50 .text-rose-800,
.dark #view-container .bg-rose-50 .text-rose-700 {
  color: rgba(251, 113, 133, 0.98) !important;
}

/* --- INGRESOS (emerald) si tenés algo similar --- */
.dark #view-container .bg-emerald-50 {
  background-color: rgba(16, 185, 129, 0.10) !important;
}

.dark #view-container .border-emerald-200 {
  border-color: rgba(16, 185, 129, 0.22) !important;
}

.dark #view-container .bg-emerald-50 .text-emerald-900,
.dark #view-container .bg-emerald-50 .text-emerald-800,
.dark #view-container .bg-emerald-50 .text-emerald-700 {
  color: rgba(52, 211, 153, 0.98) !important;
}

/* =========================================
   Resumen Ingresos/Gastos – FIX hover summary
   ========================================= */

/* No cambiar color ni fondo al pasar el mouse */
details > summary {
  transition: none !important;
}

details > summary:hover {
  background-color: transparent !important;
  color: inherit !important;
}

/* Modo oscuro */
.dark details > summary:hover {
  background-color: transparent !important;
  color: inherit !important;
}

/* Evitar highlight raro al hacer click */
details > summary:active {
  background-color: transparent !important;
}

/* ============================================
   🎓 TUTORIAL MEJORADO - ESTILOS HÍBRIDOS
   ============================================
   AGREGAR AL FINAL DE styles.css
   (Reemplaza los estilos existentes del tutorial)
   ============================================ */

/* ⚡ BACKDROP TRANSPARENTE */
html.chegasto-tour-active::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.08);
  backdrop-filter: blur(0.2px);
  z-index: 9998;
  pointer-events: none;
  animation: backdropFadeIn 0.3s ease-out;
}

@keyframes backdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================
   MODAL BASE - Con Badge "Tutorial"
   ============================================ */

.shepherd-element.chegasto-tour {
  width: min(420px, calc(100vw - 32px));
  max-width: 420px;
  border-radius: 18px;
  overflow: visible; /* 👈 Permitir que el badge se vea fuera */
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 
    0 16px 48px rgba(2, 6, 23, 0.28),
    0 8px 24px rgba(99, 102, 241, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  background: #ffffff;
  color: #0f172a;
  z-index: 10002 !important;
  position: absolute; /* Popper lo controla */
}

/* 🎓 BADGE "TUTORIAL" - Distintivo y visible */
.shepherd-element.chegasto-tour::after {
  content: "🎓 Tutorial";
  position: absolute;
  top: -14px;
  right: 20px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 5px 14px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 
    0 4px 12px rgba(245, 158, 11, 0.4),
    0 0 0 2px rgba(255, 255, 255, 0.9);
  z-index: 1;
  animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 
      0 4px 12px rgba(245, 158, 11, 0.4),
      0 0 0 2px rgba(255, 255, 255, 0.9);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 
      0 6px 16px rgba(245, 158, 11, 0.5),
      0 0 0 2px rgba(255, 255, 255, 0.9);
  }
}

/* ⚡ MODAL CENTRADO (sin attachTo) */
.shepherd-element.chegasto-tour.shepherd-centered {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
}

/* ⚡ ESTADO ARRASTRADO */
.shepherd-element.chegasto-tour.tutorial-dragging {
  cursor: grabbing !important;
  box-shadow: 
    0 24px 60px rgba(2, 6, 23, 0.4),
    0 12px 32px rgba(99, 102, 241, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transition: box-shadow 0.2s;
}

/* Animación de contenido */
.shepherd-element.chegasto-tour .shepherd-content {
  animation: tourContentSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top center;
  will-change: transform, opacity;
}

@keyframes tourContentSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================
   HEADER - Arrastrable con cursor visual
   ============================================ */

.shepherd-element.chegasto-tour .shepherd-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  cursor: move; /* 👈 Siempre "move" para indicar arrastrable */
  user-select: none;
}

/* Icono de "grip" (mover) */
.shepherd-element.chegasto-tour .shepherd-header::after {
  content: '⋮⋮';
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: -2px;
  pointer-events: none;
}

.shepherd-element.chegasto-tour .shepherd-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.12) 0%,
    transparent 70%
  );
  animation: headerGlow 4s ease-in-out infinite;
}

@keyframes headerGlow {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
  50% { transform: translate(8%, 8%) scale(1.08); opacity: 0.7; }
}

.shepherd-element.chegasto-tour .shepherd-title {
  color: #fff !important;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1;
}

/* ============================================
   BODY - Contenido del tutorial
   ============================================ */

.shepherd-element.chegasto-tour .shepherd-text {
  padding: 18px 20px 8px;
  color: #0f172a !important;
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  max-height: 65vh;
  overflow-y: auto;
}

/* Scroll suave */
.shepherd-element.chegasto-tour .shepherd-text::-webkit-scrollbar {
  width: 6px;
}

.shepherd-element.chegasto-tour .shepherd-text::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
}

.shepherd-element.chegasto-tour .shepherd-text::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 10px;
}

.shepherd-element.chegasto-tour .shepherd-text::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}

.shepherd-element.chegasto-tour .shepherd-text strong {
  color: #111827;
  font-weight: 700;
}

.shepherd-element.chegasto-tour .shepherd-text code {
  background: rgba(99, 102, 241, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  color: #4f46e5;
  font-weight: 600;
}

/* ============================================
   FOOTER - Botones de acción
   ============================================ */

.shepherd-element.chegasto-tour .shepherd-footer {
  padding: 14px 20px 16px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background: linear-gradient(to top, #f8fafc, #ffffff);
  border-top: 1px solid rgba(226, 232, 240, 0.95);
}

.shepherd-element.chegasto-tour .shepherd-button {
  border-radius: 11px;
  padding: 11px 18px;
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: 0.3px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.shepherd-element.chegasto-tour .shepherd-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.shepherd-element.chegasto-tour .shepherd-button:hover::before {
  width: 300px;
  height: 300px;
}

.shepherd-element.chegasto-tour .shepherd-button.shepherd-button-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  border: none;
  box-shadow: 
    0 10px 20px rgba(79, 70, 229, 0.25),
    0 4px 8px rgba(79, 70, 229, 0.15);
}

.shepherd-element.chegasto-tour .shepherd-button.shepherd-button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 14px 28px rgba(79, 70, 229, 0.35),
    0 6px 12px rgba(79, 70, 229, 0.25);
}

.shepherd-element.chegasto-tour .shepherd-button.shepherd-button-primary:active {
  transform: translateY(0);
}

.shepherd-element.chegasto-tour .shepherd-button.shepherd-button-secondary {
  background: #ffffff;
  border: 2px solid rgba(226, 232, 240, 0.95);
  color: #475569;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.shepherd-element.chegasto-tour .shepherd-button.shepherd-button-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

/* Botón cerrar (X) */
.shepherd-element.chegasto-tour .shepherd-cancel-icon {
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, 0.9);
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
  cursor: pointer;
}

.shepherd-element.chegasto-tour .shepherd-cancel-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(90deg);
}

/* ============================================
   FLECHA (ARROW) - Popper.js
   ============================================ */

.shepherd-element.chegasto-tour .shepherd-arrow {
  width: 16px;
  height: 16px;
  position: absolute;
}

.shepherd-element.chegasto-tour .shepherd-arrow::before {
  content: '';
  width: 16px;
  height: 16px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  transform: rotate(45deg);
  position: absolute;
  box-shadow: -2px -2px 8px rgba(0, 0, 0, 0.08);
}

/* Posiciones de la flecha */
.shepherd-element.chegasto-tour[data-popper-placement^="top"] .shepherd-arrow {
  bottom: -8px;
}

.shepherd-element.chegasto-tour[data-popper-placement^="bottom"] .shepherd-arrow {
  top: -8px;
}

.shepherd-element.chegasto-tour[data-popper-placement^="left"] .shepherd-arrow {
  right: -8px;
}

.shepherd-element.chegasto-tour[data-popper-placement^="right"] .shepherd-arrow {
  left: -8px;
}

/* ============================================
   ELEMENTO DESTACADO (HIGHLIGHT)
   ============================================ */

.tutorial-highlight {
  position: relative !important;
  z-index: 10001 !important;
  outline: 3px solid rgba(99, 102, 241, 0.8) !important;
  box-shadow:
    0 0 0 8px rgba(99, 102, 241, 0.2),
    0 0 32px rgba(99, 102, 241, 0.4),
    0 12px 40px rgba(2, 6, 23, 0.35) !important;
  border-radius: 14px !important;
  animation: highlightPulse 2.5s ease-in-out infinite;
}

@keyframes highlightPulse {
  0%, 100% {
    outline-color: rgba(99, 102, 241, 0.8);
    box-shadow: 
      0 0 0 8px rgba(99, 102, 241, 0.2),
      0 0 32px rgba(99, 102, 241, 0.4),
      0 12px 40px rgba(2, 6, 23, 0.35);
  }
  50% {
    outline-color: rgba(99, 102, 241, 0.95);
    box-shadow: 
      0 0 0 12px rgba(99, 102, 241, 0.25),
      0 0 40px rgba(99, 102, 241, 0.5),
      0 16px 48px rgba(2, 6, 23, 0.4);
  }
}

/* ============================================
   DARK MODE
   ============================================ */

.dark .shepherd-element.chegasto-tour {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.75),
    0 10px 30px rgba(99, 102, 241, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  color: #e2e8f0;
}

.dark .shepherd-element.chegasto-tour .shepherd-header {
  background: linear-gradient(135deg, #3730a3 0%, #6b21a8 100%);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dark .shepherd-element.chegasto-tour .shepherd-text {
  color: #e2e8f0 !important;
}

.dark .shepherd-element.chegasto-tour .shepherd-text::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.dark .shepherd-element.chegasto-tour .shepherd-text::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
}

.dark .shepherd-element.chegasto-tour .shepherd-text strong {
  color: #f8fafc;
}

.dark .shepherd-element.chegasto-tour .shepherd-text code {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.dark .shepherd-element.chegasto-tour .shepherd-footer {
  background: linear-gradient(to top, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.6));
  border-top-color: rgba(148, 163, 184, 0.15);
}

.dark .shepherd-element.chegasto-tour .shepherd-button.shepherd-button-secondary {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}

.dark .shepherd-element.chegasto-tour .shepherd-button.shepherd-button-secondary:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(148, 163, 184, 0.40);
}

.dark .shepherd-element.chegasto-tour .shepherd-arrow::before {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.25);
}

.dark html.chegasto-tour-active::before {
  background: rgba(2, 6, 23, 0.12);
}

/* ============================================
   RESPONSIVE - Mobile (Drawer)
   ============================================ */

@media (max-width: 768px) {
  /* Modal se convierte en drawer desde abajo */
  .shepherd-element.chegasto-tour {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 24px 24px 0 0 !important;
    max-height: 70vh;
    animation: drawerSlideUp 0.3s ease-out;
  }

  @keyframes drawerSlideUp {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  /* Badge en mobile más pequeño */
  .shepherd-element.chegasto-tour::after {
    top: 8px;
    right: 16px;
    font-size: 10px;
    padding: 4px 10px;
  }

  /* Header en mobile */
  .shepherd-element.chegasto-tour .shepherd-header {
    padding: 14px 16px;
    cursor: default; /* En mobile no se arrastra desde header */
  }

  .shepherd-element.chegasto-tour .shepherd-header::after {
    content: '—'; /* Línea horizontal como indicador de drawer */
    right: 50%;
    transform: translate(50%, -50%);
    font-size: 24px;
    color: rgba(255, 255, 255, 0.4);
  }

  .shepherd-element.chegasto-tour .shepherd-title {
    font-size: 15px;
  }

  .shepherd-element.chegasto-tour .shepherd-text {
    padding: 16px;
    font-size: 13.5px;
    max-height: 50vh;
  }

  .shepherd-element.chegasto-tour .shepherd-footer {
    padding: 12px 16px 14px;
    flex-direction: column;
  }

  .shepherd-element.chegasto-tour .shepherd-button {
    padding: 11px 16px;
    font-size: 13px;
    width: 100%;
  }

  /* Highlight más sutil en mobile */
  .tutorial-highlight {
    outline-width: 2px !important;
    box-shadow:
      0 0 0 6px rgba(99, 102, 241, 0.2),
      0 0 24px rgba(99, 102, 241, 0.35) !important;
  }

  /* Flecha no visible en mobile (drawer) */
  .shepherd-element.chegasto-tour .shepherd-arrow {
    display: none;
  }
}

/* ============================================
   OPTIMIZACIÓN DE RENDIMIENTO
   ============================================ */

.shepherd-element.chegasto-tour .shepherd-content,
.tutorial-highlight {
  will-change: transform, opacity;
}

.shepherd-element.chegasto-tour.shepherd-element-attached .shepherd-content {
  will-change: auto;
}

/* ============================================
   ACCESIBILIDAD
   ============================================ */

.shepherd-element.chegasto-tour .shepherd-button:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.5);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .shepherd-element.chegasto-tour .shepherd-content,
  .tutorial-highlight,
  html.chegasto-tour-active::before,
  .shepherd-element.chegasto-tour::after {
    animation: none !important;
    transition: none !important;
  }
}


/* 🔴 Tutorial highlight — borde + fondo pintado */
.tutorial-highlight{
  /* base tuya */
  outline: 4px solid rgba(186, 49, 24, 0.95) !important;

  box-shadow:
    0 0 0 10px rgba(211, 54, 14, 0.28),
    0 0 40px rgba(99,102,241,0.45),
    0 18px 50px rgba(209, 54, 19, 0.55) !important;

  /* 🔥 NUEVO: fondo pintado */
  background-color: rgba(186, 49, 24, 0.14) !important;
  backdrop-filter: saturate(120%) brightness(1.05);
}


/* =========================================
   🟦 Tutorial: header celeste (Shepherd)
   ========================================= */

.shepherd-element.chegasto-tour .shepherd-header {
  background: linear-gradient(135deg, #261188, #094f85) !important; /* celeste */
  border-bottom: 1px solid rgba(255,255,255,0.12) !important;
}

.shepherd-element.chegasto-tour .shepherd-title,
.shepherd-element.chegasto-tour .shepherd-cancel-icon,
.shepherd-element.chegasto-tour .shepherd-cancel-icon span {
  color: #fdfdfd !important; /* texto oscuro para contrastar con celeste */
  text-shadow: none !important;
}

