:root {
  --bg-dark: #0a0a0c;
  --bg-card: #141419;
  --primary: #2DD4BF;
  --primary-glow: rgba(45, 212, 191, 0.4);
  --text-main: #FFFFFF;
  --text-muted: #8892b0;
  --font-main: 'Plus Jakarta Sans', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow-x: hidden;
}

/* --- CONTROL DE VISTAS (SPA) --- */
.view {
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.view.active {
  display: block;
  opacity: 1;
}

/* --- NAVBAR --- */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 5%;
  background: rgba(10, 10, 12, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-img {
  height: 40px;
  width: auto;
}
.brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

/* --- BOTONES --- */
button {
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s ease;
  font-size: 1rem;
}
.btn-primary {
  background-color: var(--primary);
  color: #000;
  border: none;
  padding: 10px 24px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--primary-glow);
}
.btn-ghost {
  background: transparent;
  color: var(--text-main);
  border: none;
  padding: 10px 24px;
}
.btn-ghost:hover {
  color: var(--primary);
}
.btn-large {
  padding: 16px 40px;
  font-size: 1.1rem;
  margin-top: 30px;
}
.btn-glow {
  box-shadow: 0 0 25px rgba(45, 212, 191, 0.3);
}

/* --- SECCIONES & HERO --- */
.section-padding {
  padding: 180px 5% 100px;
}
.hero {
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- EFECTOS APPLE PREMIUM --- */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.5;
  animation: pulseGlow 8s infinite alternate ease-in-out;
  pointer-events: none;
}
.glow-1 {
  top: -10%;
  left: 50%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.15) 0%, rgba(10, 10, 12, 0) 70%);
  transform: translateX(-50%);
}
.glow-2 {
  bottom: 10%;
  right: -10%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.1) 0%, rgba(10, 10, 12, 0) 70%);
  animation-delay: -4s;
}

@keyframes pulseGlow {
  0% { opacity: 0.3; transform: translateX(-50%) scale(1); }
  100% { opacity: 0.6; transform: translateX(-50%) scale(1.1); }
}

.hero-title-huge {
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 25px;
}
.text-gradient {
  background: linear-gradient(135deg, #FFFFFF 0%, #2DD4BF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

/* --- TARJETA FLOTANTE GLASSMORPHISM --- */
.hero-visual {
  margin-top: 80px;
  display: flex;
  justify-content: center;
  width: 100%;
}
.glass-card {
  background: rgba(20, 20, 25, 0.5);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 35px;
  border-radius: 24px;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6);
}
.floating {
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
  100% { transform: translateY(0px); }
}
.card-header {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 15px;
}
.card-value {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 25px;
  text-align: left;
}
.text-turquoise { color: var(--primary); font-weight: 600; }
.mini-chart {
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, rgba(45,212,191,0.1) 0%, var(--primary) 100%);
  border-radius: 2px;
  position: relative;
}
.mini-chart::after {
  content: '';
  position: absolute;
  right: 0;
  top: -5px;
  width: 14px;
  height: 14px;
  background: var(--text-main);
  border: 3px solid var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--primary);
}

/* --- BENTO GRID (ESTRUCTURA Y ESTILOS) --- */
.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 50px;
  letter-spacing: -0.02em;
}
.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  max-width: 1100px;
  margin: 0 auto;
}
.bento-card {
  position: relative;
  background: rgba(25, 25, 32, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 32px;
  padding: 45px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.bento-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: rgba(45, 212, 191, 0.5);
  box-shadow: 0 20px 40px rgba(45, 212, 191, 0.15);
}
.large-card {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.feature-title {
  color: var(--text-main);
  margin-bottom: 15px;
  font-size: 1.4rem;
}
.bento-card p {
  color: var(--text-muted);
  line-height: 1.6;
}

/* Detalles decorativos dentro del Bento */
.card-glow-internal {
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.25) 0%, rgba(0,0,0,0) 70%);
  pointer-events: none;
}
.fake-ui-line {
  height: 8px;
  width: 100%;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  margin-top: 30px;
}
.fake-ui-line.short {
  width: 60%;
  margin-top: 15px;
  background: linear-gradient(90deg, var(--primary) 0%, rgba(255,255,255,0.1) 100%);
}

/* Iconos de las tarjetas */
.card-icon-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
  transition: transform 0.3s ease;
}
.bento-card:hover .card-icon-wrapper {
  transform: scale(1.1);
}
.primary-icon {
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.2);
  box-shadow: 0 0 25px rgba(45, 212, 191, 0.15);
}
.purple-icon {
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.2);
  box-shadow: 0 0 25px rgba(167, 139, 250, 0.15);
}
.card-glow-internal-small {
  position: absolute;
  top: -30%;
  right: -30%;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(50px);
}
.purple-glow { background: radial-gradient(circle, rgba(167, 139, 250, 0.12) 0%, rgba(0,0,0,0) 70%); }
.turquoise-glow { background: radial-gradient(circle, rgba(45, 212, 191, 0.12) 0%, rgba(0,0,0,0) 70%); }

/* Responsive para el Bento */
@media (max-width: 768px) {
  .bento-grid { grid-template-columns: 1fr; }
  .large-card { grid-column: span 1; }
}

/* --- ANIMACIONES DE ENTRADA --- */
.animate-fade-down {
  animation: fadeDown 0.8s ease forwards;
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
.observe-fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.observe-fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- ESTILOS DE AUTENTICACIÓN (LOGIN / REGISTRO) --- */
.auth-container {
  max-width: 440px;
  margin: 120px auto 40px;
  background: rgba(20, 20, 26, 0.7);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 40px 30px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 10;
}
.auth-header {
  text-align: center;
  margin-bottom: 30px;
}
.auth-logo {
  height: 50px;
  margin-bottom: 15px;
}
.auth-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 5px;
}
.auth-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Pestañas de Auth */
.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 30px;
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
}
.auth-tab.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Formularios y campos de entrada */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.auth-form.hidden {
  display: none;
}
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.input-group input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px 16px;
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s ease;
}
.input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.2);
}
.form-options {
  text-align: right;
  margin-top: -10px;
}
.forgot-link {
  color: var(--primary);
  font-size: 0.85rem;
  text-decoration: none;
}
.forgot-link:hover {
  text-decoration: underline;
}
.btn-full {
  width: 100%;
  padding: 14px;
  margin-top: 10px;
}

/* Mensajes de estado (Firebase Auth) */
.auth-status {
  margin-top: 15px;
  font-size: 0.9rem;
  text-align: center;
  min-height: 20px;
}
.auth-status.error { color: #FB7185; }
.auth-status.success { color: var(--primary); }

.back-btn {
  width: 100%;
  margin-top: 20px;
  font-size: 0.85rem;
}
/* --- DASHBOARD PRIVADO (FASE 3) --- */

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 5%;
  min-height: 100vh;
}

/* Cabecera del Dash */
.dash-header {
  display: flex;
  flex-wrap: wrap; /* 🔥 Si no cabe en móvil, lo baja de renglón automáticamente */
  justify-content: space-between;
  align-items: flex-start; /* 🔥 Alineamos arriba para que no se descuadre */
  margin-bottom: 40px;
  margin-top: 20px;
  gap: 20px; /* Le da espacio vertical cuando se rompe en dos líneas */
  width: 100%;
}

.dash-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.dash-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

.dash-actions {
  display: flex;
  flex-wrap: wrap; /* 🔥 Los botones también se acomodan solos si la pantalla es muy estrecha */
  gap: 15px;
  align-items: center;
}
.btn-icon-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 45px;
  height: 45px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
}
.btn-icon-ghost:hover {
  background: rgba(251, 113, 133, 0.1);
  color: #FB7185;
  border-color: #FB7185;
}

/* Grid de KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}
.kpi-card {
  padding: 30px;
}
.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.kpi-label {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}
.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.danger-icon {
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.2);
  box-shadow: 0 0 20px rgba(251, 113, 133, 0.15);
}
.kpi-value {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 15px;
}
.kpi-trend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}
.kpi-trend.positive { color: var(--primary); }
.kpi-trend.negative { color: #FB7185; }

/* Tabla Glassmorphism */
.table-section {
  padding: 30px;
  max-width: 100%;
  margin-top: 20px;
}
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}
.table-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
}
.table-filters {
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 5px;
  border-radius: 10px;
}
.filter-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 15px;
  border-radius: 6px;
  font-size: 0.85rem;
}
.filter-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.kobra-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

/* El seguro anti-aplastamiento para móvil */
.kobra-table th, 
.kobra-table td {
  min-width: 110px;
  white-space: nowrap;
}

/* Le damos más espacio al nombre del cliente para que respire */
.kobra-table th:first-child,
.kobra-table td:first-child {
  min-width: 200px; 
}

.kobra-table th {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.kobra-table td {
  padding: 20px 10px 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

/* Info del Cliente en Tabla */
.client-info {
  display: flex;
  align-items: center;
  gap: 15px;
}
.client-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}
.danger-avatar {
  background: #FB7185;
  color: #fff;
}
.client-name {
  font-weight: 600;
  font-size: 0.95rem;
}
.client-phone {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 3px;
}
.amount {
  font-weight: 600;
  font-family: monospace;
  font-size: 1.05rem;
}

/* Insignias (Badges) */
.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-success {
  background: rgba(45, 212, 191, 0.15);
  color: var(--primary);
  border: 1px solid rgba(45, 212, 191, 0.3);
}
.badge-danger {
  background: rgba(251, 113, 133, 0.15);
  color: #FB7185;
  border: 1px solid rgba(251, 113, 133, 0.3);
  animation: pulseDanger 2s infinite;
}
@keyframes pulseDanger {
  0% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(251, 113, 133, 0); }
  100% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0); }
}

/* Botón WhatsApp */
.btn-whatsapp {
  background: rgba(45, 212, 191, 0.1);
  color: var(--primary);
  border: 1px solid rgba(45, 212, 191, 0.3);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.btn-whatsapp:hover {
  background: var(--primary);
  color: #000;
  transform: scale(1.1);
}
.danger-wa {
  background: rgba(251, 113, 133, 0.1);
  color: #FB7185;
  border-color: rgba(251, 113, 133, 0.3);
}
.danger-wa:hover {
  background: #FB7185;
  color: #fff;
}
/* --- MODAL (NUEVO PRÉSTAMO) --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  width: 90%;
  max-width: 420px;
  transform: translateY(30px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}
.modal-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
}
/* --- OJITO DE CONTRASEÑA --- */
.password-wrapper {
  position: relative;
  width: 100%;
  display: block;
}

.password-wrapper input {
  width: 100% !important;
  box-sizing: border-box !important;
  padding-right: 45px !important;
}

.btn-ojito {
  position: absolute !important;
  right: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer;
  color: #a0a0a0;
  display: flex;
  align-items: center;
}

.btn-ojito:hover {
  color: #00ffcc !important;
}
/* --- NOTIFICACIONES TOAST (ALERTAS ELEGANTES) --- */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999; /* Para que siempre esté por encima de todo */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-kobra {
  background-color: #1a1a1a; /* Fondo oscuro premium */
  color: #ffffff;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  border-left: 4px solid #00ffcc; /* Borde verde por defecto (éxito) */
  font-weight: 500;
  transform: translateX(120%);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.toast-kobra.mostrar {
  transform: translateX(0);
  opacity: 1;
}

/* Variante para errores (rojo) */
.toast-kobra.error {
  border-left-color: #ff3366; 
}
/* --- MODAL DE CONFIRMACIÓN --- */
.kobra-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px); /* Efecto cristal */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.kobra-modal-overlay.activo {
  opacity: 1;
  visibility: visible;
}

.kobra-modal-box {
  background: #121212;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 25px;
  width: 90%;
  max-width: 350px;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.kobra-modal-overlay.activo .kobra-modal-box {
  transform: scale(1);
}

.kobra-modal-title {
  color: #fff;
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.kobra-modal-msg {
  color: #a0a0a0;
  margin-bottom: 25px;
  font-size: 0.95rem;
}

.kobra-modal-actions {
  display: flex;
  gap: 15px;
}

.kobra-modal-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: 0.3s;
}

.btn-cancelar {
  background: transparent;
  color: #a0a0a0;
  border: 1px solid #444 !important;
}

.btn-cancelar:hover { background: #333; color: #fff; }

.btn-aceptar {
  background: #00ffcc;
  color: #000;
}

.btn-aceptar:hover { background: #00ccaa; }
/* ========================================== */
/* MODAL: PERFIL DEL CLIENTE E HISTORIAL      */
/* ========================================== */

.perfil-modal {
  max-width: 500px; /* Un poco más ancho para que quepa bien todo */
}

/* Tarjetas superiores */
.perfil-resumen {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 25px;
}

.resumen-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 15px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.resumen-card.highlight-card {
  background: rgba(0, 255, 204, 0.05);
  border-color: rgba(0, 255, 204, 0.2);
}

.resumen-label {
  font-size: 0.7rem;
  color: #a0a0a0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.resumen-valor {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

/* Sección del Historial */
.historial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.historial-header h4 {
  margin: 0;
  font-size: 1rem;
  color: #e0e0e0;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.lista-pagos {
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 5px;
}

/* Personalizar la barra de desplazamiento (Scrollbar) para que se vea premium */
.lista-pagos::-webkit-scrollbar {
  width: 6px;
}
.lista-pagos::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}
.lista-pagos::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 204, 0.2);
  border-radius: 10px;
}
.lista-pagos::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 204, 0.5);
}

/* Estilo para cuando inyectemos cada pago con JavaScript */
.pago-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 15px;
  border-radius: 8px;
  border-left: 3px solid #00ffcc;
  transition: background 0.3s ease;
}
.pago-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.pago-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pago-fecha {
  font-size: 0.8rem;
  color: #a0a0a0;
}
.pago-monto {
  font-weight: bold;
  color: #00ffcc;
}
.btn-cerrar {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a0a0a0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
}
.btn-cerrar:hover {
  background: rgba(251, 113, 133, 0.1);
  color: #FB7185;
  border-color: rgba(251, 113, 133, 0.3);
}
/* --- ESTILOS NUEVOS: REPORTE GLOBAL Y NOTAS --- */
.btn-global-pdf {
  background: rgba(167, 139, 250, 0.15);
  color: #A78BFA;
  border: 1px solid rgba(167, 139, 250, 0.3);
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}
.btn-global-pdf:hover {
  background: #A78BFA;
  color: #000;
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
}

.notas-container {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 15px;
}
.notas-container h4 {
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: #e0e0e0;
}
.notas-container textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 80px;
  outline: none;
}
.notas-container textarea:focus {
  border-color: #2DD4BF;
}
/* --- ADAPTACIÓN DEL PANEL PARA MÓVILES --- */
@media (max-width: 768px) {
  /* FUERZA BRUTA: Obligamos a la cabecera a romperse sí o sí */
  .dash-header {
    display: block !important; 
    width: 100% !important;
  }

  .dash-greeting {
    margin-bottom: 20px !important; 
    display: block !important;
  }

  /* Obligamos a los botones a acomodarse en su propia línea */
  .dash-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    width: 100% !important;
  }

  /* Botones principales ocupan todo el ancho posible */
  .dash-actions .btn-global-pdf,
  .dash-actions #btn-new-loan {
    flex: 1 1 100% !important; 
    margin-bottom: 5px !important;
  }

  /* Los iconos cuadraditos se quedan abajo juntos */
  .dash-actions .btn-icon-ghost {
    flex: 1 1 auto !important; 
  }
}