/* =========================================================
   FondoSolida — Custom Stylesheet
   Aesthetic: Dark Finance — Navy/Gold/Emerald
   Font: Sora (UI) + Space Mono (numbers)
   ========================================================= */

:root {
  --fs-navy:      #0a0f1e;
  --fs-navy-card: #111827;
  --fs-navy-2:    #1a2236;
  --fs-navy-3:    #243050;
  --fs-gold:      #f5c842;
  --fs-gold-dim:  #c9a030;
  --fs-emerald:   #10b981;
  --fs-emerald-dim:#059669;
  --fs-coral:     #f97316;
  --fs-red:       #ef4444;
  --fs-purple:    #8b5cf6;
  --fs-text:      #e2e8f0;
  --fs-text-muted:#94a3b8;
  --fs-border:    #1e2d45;
  --fs-radius:    12px;
  --fs-radius-lg: 20px;
  --fs-shadow:    0 4px 24px rgba(0,0,0,0.4);
  --fs-shadow-gold: 0 0 20px rgba(245,200,66,0.15);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Sora', sans-serif;
  background-color: var(--fs-navy);
  color: var(--fs-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-wrapper {
  flex: 1;
  padding: 1.5rem 1rem 2rem;
}

/* ── Numbers & Code ── */
.mono, .money-val, .score-val, .stat-number {
  font-family: 'Space Mono', monospace;
}

/* ── NAVBAR ── */
.fs-navbar {
  background: rgba(10, 15, 30, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--fs-border);
  padding: 0.75rem 0;
  z-index: 1040;
}

.brand-icon { font-size: 1.5rem; }
.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--fs-gold), var(--fs-emerald));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.nav-link {
  color: var(--fs-text-muted) !important;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.875rem !important;
  border-radius: 8px;
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
  color: var(--fs-text) !important;
  background: var(--fs-navy-2);
}

/* Score Pill */
.score-pill {
  display: flex;
  align-items: baseline;
  gap: 3px;
  background: linear-gradient(135deg, var(--fs-navy-3), var(--fs-navy-2));
  border: 1px solid var(--fs-gold-dim);
  border-radius: 50px;
  padding: 4px 14px;
}
.score-val {
  font-family: 'Space Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--fs-gold);
}
.score-lbl {
  font-size: 0.7rem;
  color: var(--fs-text-muted);
}

/* ── CARDS ── */
.fs-card {
  background: var(--fs-navy-card);
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius-lg);
  box-shadow: var(--fs-shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.fs-card:hover { transform: translateY(-2px); box-shadow: var(--fs-shadow-gold); }

.fs-card-header {
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--fs-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fs-card-body { padding: 1.5rem; }

/* ── STAT CARDS ── */
.stat-card {
  background: var(--fs-navy-card);
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.gold::before   { background: var(--fs-gold); }
.stat-card.green::before  { background: var(--fs-emerald); }
.stat-card.orange::before { background: var(--fs-coral); }
.stat-card.red::before    { background: var(--fs-red); }
.stat-card.purple::before { background: var(--fs-purple); }

.stat-card:hover { transform: translateY(-3px); }
.stat-icon {
  font-size: 2rem;
  opacity: 0.7;
  margin-bottom: 0.75rem;
  display: block;
}
.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--fs-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* ── PROGRESS BAR (Bolsa Común) ── */
.fondo-progress-wrap {
  background: var(--fs-navy-2);
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius-lg);
  padding: 1.5rem;
  position: relative;
}
.fondo-bar-track {
  background: var(--fs-navy-3);
  border-radius: 50px;
  height: 12px;
  overflow: hidden;
  margin: 1rem 0;
}
.fondo-bar-fill {
  height: 100%;
  border-radius: 50px;
  background: linear-gradient(90deg, var(--fs-emerald), var(--fs-gold));
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.fondo-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer { to { left: 200%; } }

/* ── SCORE RING ── */
.score-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.score-ring-svg { filter: drop-shadow(0 0 8px rgba(245,200,66,0.3)); }

/* ── BADGE OVERRIDES ── */
.badge-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── TABLE ── */
.table {
  color: var(--fs-text) !important;
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255,255,255,0.02);
  --bs-table-hover-bg: rgba(255,255,255,0.04);
  --bs-table-border-color: var(--fs-border);
}
.table thead th {
  background: var(--fs-navy-2) !important;
  color: var(--fs-text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--fs-border);
  font-weight: 600;
}

/* ── FORM CONTROLS ── */
.form-control, .form-select {
  background: var(--fs-navy-2) !important;
  border: 1px solid var(--fs-border) !important;
  color: var(--fs-text) !important;
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--fs-gold) !important;
  box-shadow: 0 0 0 3px rgba(245,200,66,0.15) !important;
  outline: none;
}
.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fs-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}
.form-control::placeholder { color: var(--fs-text-muted) !important; opacity: 0.5; }

/* ── BUTTONS ── */
.btn-fs-gold {
  background: var(--fs-gold);
  color: var(--fs-navy);
  font-weight: 700;
  border: none;
  border-radius: 8px;
  transition: all 0.2s;
}
.btn-fs-gold:hover {
  background: var(--fs-gold-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245,200,66,0.3);
}
.btn-fs-emerald {
  background: var(--fs-emerald);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  transition: all 0.2s;
}
.btn-fs-emerald:hover {
  background: var(--fs-emerald-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(16,185,129,0.12), transparent),
    radial-gradient(ellipse 60% 50% at 80% 110%, rgba(245,200,66,0.10), transparent),
    var(--fs-navy);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--fs-navy-card);
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius-lg);
  padding: 2.5rem;
  box-shadow: 0 8px 48px rgba(0,0,0,0.5);
}
.login-logo {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.login-title {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--fs-gold), var(--fs-emerald));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
}

/* ── STATUS BADGES ── */
.status-activo    { background: rgba(16,185,129,0.15); color: #10b981; }
.status-pagado    { background: rgba(99,102,241,0.15); color: #6366f1; }
.status-vencido   { background: rgba(239,68,68,0.15);  color: #ef4444; }
.status-pendiente { background: rgba(245,200,66,0.15); color: #f5c842; }
.status-mora      { background: rgba(239,68,68,0.2);   color: #ef4444; }
.status-en_curso  { background: rgba(16,185,129,0.2);  color: #10b981; }
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── TIMELINE ── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem; top: 0; bottom: 0;
  width: 2px;
  background: var(--fs-border);
}
.timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
}
.timeline-dot {
  position: absolute;
  left: -1.625rem;
  top: 0.25rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--fs-emerald);
  border: 2px solid var(--fs-navy);
}
.timeline-dot.late  { background: var(--fs-coral; }
.timeline-dot.miss  { background: var(--fs-red); }

/* ── REUNIÓN COBROS ── */
.cobro-row {
  background: var(--fs-navy-2);
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}
.cobro-row.cobrado { border-color: var(--fs-emerald); }
.cobro-row.vencido { border-color: var(--fs-red); }

/* ── FOOTER ── */
.app-footer {
  background: var(--fs-navy-card);
  border-top: 1px solid var(--fs-border);
}

/* ── UTILITIES ── */
.text-gold   { color: var(--fs-gold) !important; }
.text-emerald { color: var(--fs-emerald) !important; }
.text-coral  { color: var(--fs-coral) !important; }
.bg-navy-2   { background: var(--fs-navy-2); }
.border-gold { border-color: var(--fs-gold) !important; }
.rounded-xl  { border-radius: var(--fs-radius-lg); }

/* ── DATATABLES dark ── */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  background: var(--fs-navy-2) !important;
  border-color: var(--fs-border) !important;
  color: var(--fs-text) !important;
  border-radius: 6px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--fs-text-muted) !important;
  border-radius: 6px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--fs-gold) !important;
  color: var(--fs-navy) !important;
  border-color: var(--fs-gold) !important;
}
.dataTables_wrapper .dataTables_info { color: var(--fs-text-muted); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .main-wrapper { padding: 1rem 0.75rem; }
  .stat-number  { font-size: 1.4rem; }
  .login-card   { margin: 1rem; padding: 1.75rem; }
}