/* Reset básico */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Tipografía general */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #73c9a8;
  color: #f1f1f1;
  line-height: 1.6;
  padding-bottom: 80px; /* para que footer fijo no tape contenido */
}

a {
  color: #00d1b2;
  text-decoration: none;
}
a:hover {
  text-decoration: none;
}

/* Encabezados */
h1, h2 {
  text-align: center;
  margin: 20px 0;
  color: #fff;
}

/* Layout - Header y Navegación */
header {
  background: #222;
  padding: 10px 20px;
  border-bottom: 2px solid #00d1b2;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  font-weight: bold;
  font-size: 1.4em;
  color: #00d1b2;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

nav ul li a {
  color: #f1f1f1;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background 0.3s, color 0.3s;
}

nav ul li a:hover,
nav ul li a.active {
  background: #00d1b2;
  color: #000;
}

/* Hero Section (Index) */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  background: linear-gradient(135deg, #00d1b2, #005f56);
  text-align: center;
  padding: 40px 20px;
  color: #fff;
}

.hero .intro {
  max-width: 700px;
}

.hero .intro h1 {
  font-weight: bold;
  margin-bottom: 20px;
}

.hero .vip {
  display: block;
  color: #ffd700;
  font-weight: bold;
  font-size: 5rem;
  line-height: 1.1;
}

.hero .tagline {
  display: block;
  font-size: 2.8rem;
  font-weight: 300;
  margin-top: 10px;
}

.hero .intro p {
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: 30px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.hero .buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.btn {
  background: #00d1b2;
  border: none;
  padding: 15px 30px;
  color: #000;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease;
  text-decoration: none;
}

.btn:hover {
  background: #00a891;
  transform: translateY(-2px);
}

.btn-alt {
  background: #444;
  border: 2px solid #fff;
  color: #fff;
}

.btn-alt:hover {
  background: #fff;
  color: #666;
}

/* ==================================================================== */
/*          ESTILOS DE FORMULARIO UNIFICADOS (LOGIN Y REGISTER)         */
/* ==================================================================== */
.form-container {
  max-width: 550px;
  margin: 50px auto;
  padding: 30px 40px;
  background-color: #174143;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.form-header {
  text-align: center;
  margin-bottom: 30px;
}

.form-header h2 {
  color: #00d1b2;
  font-size: 2.2em;
  margin-bottom: 10px;
}

.form-header p {
  color: #ccc;
  font-size: 1.1em;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: #ccc;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
  width: 100%;
  padding: 15px;
  background-color: #222;
  border: 1px solid #444;
  border-radius: 5px;
  color: #fff;
  font-size: 1em;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #00d1b2;
  box-shadow: 0 0 10px rgba(0, 209, 178, 0.3);
}

.btn-primary-full {
  width: 100%;
  padding: 15px;
  font-size: 1.2em;
  font-weight: bold;
  background-color: #00d1b2;
  color: #111;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  margin-top: 10px;
}

.btn-primary-full:hover {
  background-color: #00a891;
  transform: translateY(-2px);
}

.form-footer-link {
  text-align: center;
  margin-top: 30px;
  color: #ccc;
}

.form-footer-link a {
  color: #00d1b2;
  font-weight: bold;
}

.form-message {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
  text-align: center;
  font-weight: 500;
}

.form-message.error {
  background-color: #4d1c1c;
  color: #ffb3b3;
  border: 1px solid #c73e3e;
}

.form-message.success {
  background-color: #1c4d32;
  color: #b3ffce;
  border: 1px solid #3ec77d;
}

.form-message a {
  color: #fff;
  font-weight: bold;
  text-decoration: underline;
}

/* ==================================================================== */
/*                   FIN DE ESTILOS DE FORMULARIO                       */
/* ==================================================================== */

/* Tablas */
table {
  width: 100%; /* Cambiado a 100% para que se ajuste al .table-container */
  margin: 0; /* Eliminamos el margen para que el contenedor lo maneje */
  border-collapse: collapse;
  background: #1a1a1a;
}
.table-container {
  width: 100%;
  margin: 20px auto 40px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 15px #000000cc;
  border: 1px solid #333;
}
.table-container table td {
  white-space: nowrap;
}

table th, table td {
  border-bottom: 1px solid #333; /* Cambiado a border-bottom para un look más limpio */
  padding: 12px 15px;
  text-align: left; /* Alineación a la izquierda es más legible */
  font-size: 0.95em;
}
table th {
  background: #2a2a2a; /* Fondo más oscuro para el header */
  color: #00d1b2;
  font-weight: bold;
  text-align: left;
}
table tbody tr:hover {
  background-color: #222; /* Un hover un poco más sutil */
}
table td[style*="color:lightgreen"] { font-weight: bold; }
table td[style*="color:red"] { font-weight: bold; }

/* ==================================================================== */
/*                      ESTILOS PARA EL DASHBOARD                       */
/* ==================================================================== */

.dashboard-container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

.dashboard-header h1 {
  font-size: 2.5em;
  color: #fff;
  margin-bottom: 30px;
}
.dashboard-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  border-bottom: 1px solid #333;
  padding-bottom: 20px;
  margin-bottom: 40px;
}
.dashboard-nav a {
  background-color: #2a2a2a;
  color: #f1f1f1;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s, color 0.3s, transform 0.2s;
}
.dashboard-nav a:hover {
  background-color: #383838;
  color: #fff;
  transform: translateY(-2px);
}
.dashboard-nav a.active {
  background-color: #00d1b2;
  color: #111;
  font-weight: bold;
}

/* El grid que contiene las tarjetas (con layout 3x1) */
.dashboard-grid {
  display: grid;
  /* Por defecto, crea 3 columnas. En móvil, auto-fit se encargará. */
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

/* Estilo base para cada tarjeta */
.dashboard-card {
  background-color: #1e1e1e;
  padding: 25px 30px;
  border-radius: 10px;
  border: 1px solid #333;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.4em;
  color: #00d1b2;
  margin-bottom: 25px;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
}

.card-metric { margin-bottom: 20px; }
.card-metric .metric-value { display: block; font-size: 2.5em; font-weight: bold; color: #fff; line-height: 1.1; }
.card-metric .metric-label { font-size: 1em; color: #aaa; }
.progress-info { margin-top: 10px; }
.progress-bar-container { background: #333; border-radius: 10px; width: 100%; height: 25px; overflow: hidden; margin: 10px 0; }
.progress-bar-fill { background: linear-gradient(90deg, #005f56, #00d1b2); height: 100%; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: bold; font-size: 0.8em; transition: width 0.5s ease-in-out; }
.progress-subtext { font-size: 0.9em; color: #ccc; text-align: center; }
.btn-card-action { background-color: #00d1b2; color: #111; padding: 12px 20px; border-radius: 5px; text-align: center; font-weight: bold; transition: all 0.3s ease; margin-top: auto; }
.btn-card-action:hover { background-color: #fff; color: #111; transform: translateY(-2px); }
.card-link { color: #00d1b2; text-align: center; margin-top: 15px; font-size: 0.9em; }
.referral-card { background: linear-gradient(135deg, #222, #111); border-color: #00d1b2; }
.card-description { color: #ccc; margin-bottom: 20px; }
.referral-code-display { background: #111; border: 1px dashed #444; border-radius: 5px; padding: 15px; font-size: 1.5em; font-weight: bold; color: #ffd700; text-align: center; display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.btn-copy { background: #444; color: #fff; border: none; padding: 8px 12px; border-radius: 5px; cursor: pointer; }
.btn-whatsapp { background-color: #25D366; color: white; padding: 12px 20px; border-radius: 5px; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; border: none; cursor: pointer; }
.btn-whatsapp:hover { background-color: #1DAE54; }
.btn-whatsapp svg { width: 20px; height: 20px; }

/* Footer */
footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #222;
  text-align: center;
  padding: 10px 0;
  color: #aaa;
  font-size: 0.9em;
  border-top: 1px solid #333;
  z-index: 100;
}

footer .social-links { margin-bottom: 8px; }
footer .social-links a { color: #aaa; margin: 0 10px; font-weight: bold; text-decoration: none; transition: color 0.3s ease; }
footer .social-links a:hover { color: #00d1b2; text-decoration: none; }

/* How It Works Section */
.how-it-works { padding: 80px 20px; background: #174143; text-align: center; }
.how-it-works h2 { font-size: 2.5em; color: #00d1b2; margin-bottom: 60px; }
.steps-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 40px; }
.step-item { position: relative; background: #222; border: 1px solid #333; border-radius: 10px; padding: 40px 25px 30px 25px; transition: transform 0.3s ease, box-shadow 0.3s ease; flex: 1 1 280px; max-width: 320px; }
.step-item:hover { transform: translateY(-10px); box-shadow: 0 0 20px rgba(0, 209, 178, 0.4); }
.step-number { position: absolute; top: -25px; left: 50%; transform: translateX(-50%); background-color: #00d1b2; color: #1b1b1b; width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5em; font-weight: bold; border: 3px solid #1b1b1b; }
.step-item img { width: 60px; height: 60px; margin-bottom: 20px; }
.step-item h3 { color: #fff; font-size: 1.3em; margin-bottom: 10px; }
.step-item p { color: #ccc; font-size: 1em; line-height: 1.6; }

/* CTA Section */
.cta-section { background-color: #111; background-image: radial-gradient(circle at center, #222 0%, #111 70%); padding: 100px 20px; text-align: center; overflow: hidden; }
.cta-content { max-width: 700px; margin: 0 auto; }
.cta-section h2 { font-size: 3rem; font-weight: bold; color: #00d1b2; margin-bottom: 15px; }
.cta-section p { font-size: 1.2rem; color: #e0e0e0; line-height: 1.6; margin-bottom: 40px; }
.btn-cta { background: #00d1b2; color: #111; border: none; padding: 18px 40px; font-size: 1.2rem; font-weight: bold; border-radius: 8px; cursor: pointer; transition: transform 0.3s ease, box-shadow 0.3s ease; box-shadow: 0 5px 15px rgba(0, 209, 178, 0.2); }
.btn-cta:hover { transform: translateY(-5px) scale(1.05); box-shadow: 0 8px 25px rgba(0, 209, 178, 0.4); }

/* Modal (Mensaje Emergente) */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content { position: relative; background-color: #2c2c2c; margin: 15% auto; padding: 40px; border: 1px solid #444; border-radius: 10px; width: 90%; max-width: 500px; box-shadow: 0 5px 20px rgba(0,0,0,0.5); text-align: center; animation: slideIn 0.4s ease-in-out; }
@keyframes slideIn { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-content h3 { color: #00d1b2; font-size: 1.5rem; margin-bottom: 15px; }
.modal-content p { color: #e0e0e0; font-size: 0.8rem; line-height: 1.6; }
.btn-modal-action { margin-top: 25px; display: inline-block; }
.close-btn { color: #aaa; position: absolute; top: 15px; right: 25px; font-size: 28px; font-weight: bold; transition: color 0.3s ease; }
.close-btn:hover, .close-btn:focus { color: #fff; text-decoration: none; cursor: pointer; }

/* Social Proof Section */
.social-proof-section { padding: 80px 20px; background-color: #1b1b1b; text-align: center; }
.social-proof-section h2 { font-size: 2.5em; color: #00d1b2; margin-bottom: 60px; }
.stats-container { display: flex; justify-content: center; gap: 50px; flex-wrap: wrap; margin-bottom: 80px; }
.stat-item { min-width: 200px; }
.stat-number { display: block; font-size: 4rem; font-weight: bold; color: #00d1b2; line-height: 1; }
.stat-number::before { content: '$'; font-size: 2.5rem; margin-right: 5px; color: #666; }
.stat-item:first-child .stat-number::before, .stat-item:last-child .stat-number::before { content: ''; }
.stat-label { font-size: 1.1rem; color: #ccc; margin-top: 10px; }
.testimonials-container { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }
.testimonial-card { background: #222; border-left: 5px solid #00d1b2; border-radius: 8px; padding: 30px; text-align: left; flex: 1 1 300px; max-width: 380px; transition: transform 0.3s ease; }
.testimonial-card:hover { transform: scale(1.03); }
.testimonial-text { font-size: 1.1rem; color: #e0e0e0; line-height: 1.6; font-style: italic; margin-bottom: 25px; position: relative; }
.testimonial-text::before { content: '“'; position: absolute; top: -20px; left: -20px; font-size: 5rem; color: rgba(255, 255, 255, 0.05); z-index: 0; }
.testimonial-author { display: flex; align-items: center; gap: 15px; }
.testimonial-author img { width: 50px; height: 50px; border-radius: 50%; border: 2px solid #444; object-fit: cover; }
.author-info h4 { margin: 0; color: #fff; font-size: 1.1em; }
.author-info span { font-size: 0.9em; color: #00d1b2; }

/* ==================================================================== */
/*          ESTILOS PARA LA PÁGINA DE REFERIDOS (DASHBOARD)       */
/* ==================================================================== */
.referral-level-group { margin-bottom: 40px; }
.level-header { font-size: 1.5em; color: #fff; padding-bottom: 10px; border-bottom: 1px solid #333; margin-bottom: 15px; }
.level-summary { display: flex; gap: 30px; margin-bottom: 20px; color: #ccc; }
.referral-summary-box { background: linear-gradient(135deg, #005f56, #004d40); padding: 25px; border-radius: 10px; margin-top: 40px; border: 1px solid #00d1b2; }
.summary-title { color: #fff; text-align: left; margin-top: 0; margin-bottom: 20px; }
.summary-metrics p { font-size: 1.1em; color: #f1f1f1; margin-bottom: 10px; }
.summary-metrics p:last-child { margin-bottom: 0; }

/* ==================================================================== */
/*      REVISIÓN FINAL PARA LA PÁGINA DE CANJEAR CRÉDITOS        */
/* ==================================================================== */
.current-balance-box { background-color: #2a2a2a; border-left: 5px solid #00d1b2; border-radius: 8px; padding: 20px; margin-bottom: 30px; text-align: center; }
.dashboard-content-card .current-balance-box p { margin: 0 0 10px 0; color: #ccc; font-size: 1.1em; text-align: center; }
.balance-amount { display: block; font-size: 2.8em; font-weight: bold; color: #ffd700; }
.dashboard-content-card > p { text-align: center; max-width: 600px; margin-left: auto; margin-right: auto; color: #ccc; }
.dashboard-content-card .styled-form { max-width: 450px; margin: 40px auto 0 auto; }
.form-group input[type="number"] { width: 100%; padding: 15px; background-color: #222; border: 1px solid #444; border-radius: 5px; color: #fff; font-size: 1.2em; text-align: center; -moz-appearance: textfield; }
.form-group input[type="number"]::-webkit-outer-spin-button, .form-group input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.form-group input[type="number"]:focus { outline: none; border-color: #00d1b2; box-shadow: 0 0 10px rgba(0, 209, 178, 0.3); }
.dashboard-content-card .btn-primary-full { display: block; width: auto; min-width: 200px; margin-left: auto; margin-right: auto; }

/* ==================================================================== */
/*          ESTILOS PARA LA PÁGINA DE BENEFICIOS (DASHBOARD)      */
/* ==================================================================== */
tr.current-user-level { background-color: #1c4d32; border: 1px solid #00d1b2; }
tr.current-user-level td { color: #fff; font-weight: bold; }
.tier-benefits-list { list-style-type: '✓ '; padding-left: 20px; margin: 0; text-align: left; }
.tier-benefits-list li { margin-bottom: 5px; color: #ccc; }
tr.current-user-level .tier-benefits-list li { color: #f1f1f1; }

/* ==================================================================== */
/*      ESTILOS PARA LA PÁGINA INFORMATIVA DE BENEFICIOS          */
/* ==================================================================== */
.benefits-page-section { max-width: 1400px; margin: 40px auto; padding: 0 20px; }
.benefits-header { text-align: center; margin-bottom: 50px; }
.benefits-header h2 { font-size: 2.8em; color: #00d1b2; }
.benefits-header p { font-size: 1.2em; color: #ccc; max-width: 600px; margin: 10px auto 0; }
.benefit-tier-card { background-color: #1e1e1e; border-radius: 10px; padding: 25px; border: 1px solid #333; border-top-width: 5px; transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; }
.benefit-tier-card:hover { transform: translateY(-5px); }
.tier-bronze { border-top-color: #cd7f32; }
.tier-plata { border-top-color: #c0c0c0; }
.tier-oro { border-top-color: #ffd700; }
.tier-diamante { border-top-color: #00d1b2; }
.benefit-tier-card.is-current { transform: scale(1.03); box-shadow: 0 0 20px rgba(0, 209, 178, 0.5); border-color: #00d1b2; }
.tier-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.tier-header h3 { margin: 0; font-size: 1.8em; }
.current-level-tag { background-color: #00d1b2; color: #111; font-size: 0.8em; font-weight: bold; padding: 4px 10px; border-radius: 20px; }
.tier-meta { background-color: #2a2a2a; padding: 15px; border-radius: 8px; margin-bottom: 20px; }
.tier-meta span { display: block; margin-bottom: 5px; color: #f1f1f1; }
.tier-meta span:last-child { margin-bottom: 0; }
.tier-meta strong { color: #fff; }
.tier-section { margin-bottom: 20px; }
.tier-section h4 { font-size: 1.1em; color: #fff; border-bottom: 1px solid #444; padding-bottom: 8px; margin-bottom: 15px; }
.benefits-list, .commission-list { list-style-type: none; padding-left: 0; color: #ccc; }
.benefits-list li { padding-left: 25px; position: relative; margin-bottom: 8px; }
.benefits-list li::before { content: '✓'; color: #00d1b2; font-weight: bold; position: absolute; left: 0; }
.commission-list li { margin-bottom: 5px; }
.commission-rule { color: #aaa; font-style: italic; }
.how-to-level-up-box { margin-top: 60px; background-color: #1e1e1e; padding: 30px; border-radius: 10px; border-left: 5px solid #00d1b2; }
.how-to-level-up-box h3 { margin-top: 0; color: #fff; }
.how-to-level-up-box p { color: #ccc; }

/* ==================================================================== */
/*   GRID DE BENEFICIOS RESPONSIVE (Layout 2x2 en escritorio)    */
/* ==================================================================== */
.tiers-grid { display: grid; gap: 30px; grid-template-columns: 1fr; }
@media (min-width: 992px) { .tiers-grid { grid-template-columns: repeat(2, 1fr); } }

/* ==================================================================== */
/*          ESTILOS PARA LA PÁGINA DE RETIROS (DASHBOARD)         */
/* ==================================================================== */
.status-badge { padding: 5px 12px; border-radius: 20px; font-weight: bold; font-size: 0.9em; text-transform: capitalize; }
.status-badge.status-pending { background-color: #4a3d0a; color: #ffd700; }
.status-badge.status-completed, .status-badge.status-aprobado { background-color: #1c4d32; color: #b3ffce; } /* Añadido .status-aprobado */
.status-badge.status-rejected, .status-badge.status-rechazado { background-color: #4d1c1c; color: #ffb3b3; } /* Añadido .status-rechazado */

/* ==================================================================== */
/*                ESTILOS PARA LA SECCIÓN DE SOCIOS                 */
/* ==================================================================== */
.partners-section { padding: 80px 20px; background-color: #111; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: 2.5em; color: #00d1b2; }
.section-header p { font-size: 1.2em; color: #ccc; max-width: 700px; margin: 10px auto 0; }
.partners-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.partner-card { background-color: #1e1e1e; border-radius: 10px; border: 1px solid #333; padding: 30px 25px; text-align: center; display: flex; flex-direction: column; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.partner-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); }
.partner-logo { height: 80px; margin-bottom: 25px; display: flex; align-items: center; justify-content: center; }
.partner-logo img { max-height: 100%; max-width: 80%; filter: brightness(0) invert(1) opacity(0.8); transition: filter 0.3s ease; }
.partner-card:hover .partner-logo img { filter: none; }
.partner-name { font-size: 1.5em; color: #fff; margin: 0; }
.partner-category { color: #aaa; font-size: 0.9em; text-transform: uppercase; margin-bottom: 20px; }
.partner-benefit { margin-top: auto; padding: 15px; border-radius: 8px; font-weight: 500; }
.earn-benefit { background-color: rgba(0, 209, 178, 0.1); color: #00d1b2; border: 1px solid #00d1b2; }
.pay-benefit { background-color: rgba(255, 215, 0, 0.1); color: #ffd700; border: 1px solid #ffd700; }

/* ==================================================================== */
/*          ESTILOS PARA LA SECCIÓN CTA DE BENEFICIOS (INDEX)     */
/* ==================================================================== */
.benefits-cta-section { padding: 80px 20px; background-color: #1b1b1b; }
.benefits-cta-content { max-width: 800px; margin: 0 auto; padding: 40px; background-color: #1e1e1e; border: 1px solid #333; border-radius: 10px; text-align: center; }
.benefits-cta-icon { color: #00d1b2; margin-bottom: 20px; }
.benefits-cta-title { font-size: 2.5em; color: #fff; margin-top: 0; margin-bottom: 15px; }
.benefits-cta-text { font-size: 1.2em; color: #ccc; line-height: 1.6; margin-bottom: 30px; }
.btn-cta-secondary { background-color: transparent; color: #00d1b2; border: 2px solid #00d1b2; padding: 15px 35px; border-radius: 5px; font-weight: bold; text-decoration: none; display: inline-block; transition: background-color 0.3s, color 0.3s; }
.btn-cta-secondary:hover { background-color: #00d1b2; color: #111; }

/* ==================================================================== */
/*      CSS DEFINITIVO Y COMPLETO PARA EL PANEL DE ADMINISTRACIÓN       */
/* ==================================================================== */

/* --- 1. LAYOUT GENERAL Y NAVEGACIÓN (TOP NAV) --- */

.admin-page-container + footer {
  display: none;
}
.admin-page-container {
  max-width: 1400px;
  margin: 30px auto;
  padding: 0 20px;
}
.admin-header h1 {
  font-size: 2.8em;
  color: #fff;
  text-align: center;
  margin-bottom: 30px;
}
.admin-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid #333;
}
.admin-nav a {
  background-color: #2a2a2a;
  color: #f1f1f1;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}
.admin-nav a:hover {
  background-color: #383838;
  color: #fff;
  transform: translateY(-2px);
}
.admin-nav a.active {
  background-color: #00d1b2;
  color: #111;
  font-weight: bold;
}

/* --- 2. CONTENIDO DE LAS PÁGINAS INTERNAS --- */

.admin-content-area {
  width: 100%;
}
.admin-content-card {
  background-color: #1e1e1e;
  padding: 30px;
  border-radius: 10px;
  border: 1px solid #333;
}
.admin-content-title {
  font-size: 2em;
  color: #00d1b2;
  margin-top: 0;
  margin-bottom: 30px;
  text-align: left;
  border-bottom: 1px solid #333;
  padding-bottom: 15px;
}

/* --- 3. ESTILOS PARA LA VISTA GENERAL (KPIs) --- */

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}
.kpi-card {
  background-color: #2a2a2a;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid #444;
  position: relative;
}
.kpi-icon {
  font-size: 2em;
  background-color: #333;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-icon.icon-users::before { content: '👥'; }
.kpi-icon.icon-revenue::before { content: '💰'; }
.kpi-icon.icon-withdrawals::before { content: '💸'; }
.kpi-content {
  flex-grow: 1;
  min-width: 0;
}
.kpi-value {
  display: block;
  font-size: 2em;
  font-weight: bold;
  color: #fff;
  line-height: 1.1;
  word-break: break-all;
}
.kpi-label {
  font-size: 1em;
  color: #aaa;
  white-space: normal;
}
.kpi-card.urgent {
  background-color: #4d1c1c;
  border-color: #c73e3e;
}
.kpi-card.urgent .kpi-value, .kpi-card.urgent .kpi-label { color: #ffb3b3; }
.kpi-card.urgent .kpi-icon { background-color: #660000; }
.kpi-link { position: absolute; bottom: 10px; right: 15px; font-size: 0.9em; color: #fff; font-weight: bold; }
.admin-dashboard-columns { display: grid; grid-template-columns: 1fr; gap: 30px; }
.column-title { font-size: 1.4em; color: #fff; margin-bottom: 20px; }
.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-item { display: flex; align-items: center; gap: 15px; padding: 15px 0; border-bottom: 1px solid #2a2a2a; }
.activity-item:last-child { border-bottom: none; }
.activity-icon { font-size: 1.5em; }
.activity-text { flex-grow: 1; color: #ccc; }
.activity-time { font-size: 0.9em; color: #aaa; flex-shrink: 0; }

/* --- 4. ESTILOS PARA TABLAS Y ACCIONES DEL ADMIN --- */

.content-header-with-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}
.content-header-with-actions .admin-content-title {
  margin: 0; padding: 0; border: none;
}
.user-search-input {
  width: 100%;
  max-width: 300px;
  padding: 10px 15px;
  background-color: #2a2a2a;
  border: 1px solid #444;
  border-radius: 5px;
  color: #fff;
  font-size: 1em;
}
.user-search-input:focus { outline: none; border-color: #00d1b2; }

.table-actions { display: flex; gap: 10px; }

/* Estilo base para todos los botones de acción */
.action-btn {
  padding: 6px 12px;
  border-radius: 4px;
  color: #fff !important; /* Forzamos texto blanco para evitar conflictos */
  font-weight: 500;
  font-size: 0.9em;
  text-decoration: none;
  transition: opacity 0.3s;
  border: none;
  cursor: pointer;
}
.action-btn:hover { opacity: 0.8; }

/* Colores específicos para cada acción */
.action-btn.edit { background-color: #0d6efd !important; }
.action-btn.view { background-color: #6c757d !important; }
.action-btn.add { background-color: #198754 !important; }
.action-btn.approve { background-color: #28a745 !important; }
.action-btn.reject { background-color: #dc3545 !important; }

/* --- 5. ESTILOS PARA MODALES Y PANELES DESLIZANTES --- */

.modal-overlay {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1001;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.admin-modal {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background-color: #1e1e1e;
  border-radius: 10px; border: 1px solid #444;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  width: 90%; max-width: 600px;
  z-index: 1002;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.admin-modal.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }

.admin-slide-panel {
  position: fixed; top: 0; right: 0;
  width: 90%; max-width: 500px;
  height: 100%;
  background-color: #1e1e1e;
  box-shadow: -10px 0 30px rgba(0,0,0,0.5);
  z-index: 1002;
  transform: translateX(100%);
  transition: transform 0.4s ease-in-out;
  display: flex; flex-direction: column;
}
.admin-slide-panel.active { transform: translateX(0); }

.modal-header, .slide-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 25px; border-bottom: 1px solid #333;
  flex-shrink: 0;
}
.modal-header h3, .slide-panel-header h3 { margin: 0; font-size: 1.5em; color: #00d1b2; }
.modal-close-btn { background: none; border: none; color: #aaa; font-size: 2em; cursor: pointer; line-height: 1; }
.modal-close-btn:hover { color: #fff; }

.modal-body, .slide-panel-body { padding: 25px; overflow-y: auto; }
.modal-body p { line-height: 1.6; font-size: 1.1em; margin-bottom: 25px; }

.admin-modal .styled-form, .admin-slide-panel .styled-form { margin: 0; }
.form-group select,
.form-group input[type="number"],
.form-group textarea { /* <-- ¡AÑADIDO AQUÍ! */
  width: 100%;
  padding: 15px;
  background-color: #222;
  border: 1px solid #444;
  border-radius: 5px;
  color: #fff;
  font-size: 1em;
  font-family: inherit; /* Asegura que use la misma fuente que el resto del sitio */
  transition: border-color 0.3s, box-shadow 0.3s; /* Añadimos transición para consistencia */
}

/* También añadimos el efecto de foco para el textarea */
.form-group textarea:focus {
  outline: none;
  border-color: #00d1b2;
  box-shadow: 0 0 10px rgba(0, 209, 178, 0.3);
}
.form-group input[type="number"] { -moz-appearance: textfield; }
.form-group input[type="number"]::-webkit-outer-spin-button, .form-group input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}

/* --- ESTILOS PARA LAS ACCIONES DENTRO DEL MODAL --- */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 30px;
  border-top: 1px solid #333;
  padding-top: 20px;
}
.action-btn-alt {
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    background-color: #6c757d;
    color: #fff;
}
.modal-actions .action-btn {
    padding: 10px 20px;
    font-size: 1em;
}

/* ==================================================================== */
/*    CSS ADICIONAL PARA ESTADOS Y CHECKBOXES (PÁGINA DE NIVELES)   */
/* ==================================================================== */

/* Reutilizamos y adaptamos las clases de status-badge que ya teníamos */
.status-badge.status-active {
  background-color: #1c4d32;
  color: #b3ffce;
}

.status-badge.status-inactive {
  background-color: #444;
  color: #aaa;
}

/* Estilo para el contenedor del checkbox para alinearlo bien */
.form-group-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #2a2a2a;
  padding: 15px;
  border-radius: 5px;
}

.form-group-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #00d1b2; /* Moderno, colorea el check */
}

.form-group-checkbox label {
  margin-bottom: 0; /* Quitamos el margen que tienen las otras etiquetas */
  font-weight: normal;
  color: #fff;
}

.modal-container {
  background-color: #1e1e1e;
  border-radius: 10px;
  border: 1px solid #444;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  width: 100%;
  max-width: 900px; /* ¡CORREGIDO! Aumentamos el ancho máximo */
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* ==================================================================== */
/*          CSS PARA LAYOUT DE 2 COLUMNAS EN FORMULARIOS DE ADMIN       */
/* ==================================================================== */

/* Contenedor para los campos del formulario que irán en columnas */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Crea dos columnas de igual tamaño */
  gap: 20px;
}

/* El grupo de checkbox y el textarea ocuparán todo el ancho */
.form-group-checkbox,
.form-group.full-width {
  grid-column: 1 / -1; /* Hace que el elemento ocupe desde la primera a la última columna */
}

/* Estilos para el grupo de comisiones */
.commission-inputs {
  grid-column: 1 / -1;
  background-color: #2a2a2a;
  padding: 20px;
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
}
.commission-inputs label {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

/* Ajustes para pantallas pequeñas (móviles) */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr; /* Vuelve a una sola columna */
  }
}

/* ==================================================================== */
/*      CSS DEFINITIVO PARA VISUALIZADOR DE RED (CON D3-ORG-CHART)  */
/* ==================================================================== */

.orgchart-container {
  width: 100%;
  height: 70vh; /* Altura del 70% de la ventana */
  background-color: #1a1a1a;
  border-radius: 8px;
  overflow: hidden; /* D3 se encargará del scroll/zoom */
}

/* Estilo para la "caja" que generamos con HTML */
.org-node-box {
  background-color: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 10px;
  min-width: 220px;
}

/* Colores de borde superior para cada nivel */
.tier-bronce { border-top: 4px solid #cd7f32; }
.tier-plata { border-top: 4px solid #c0c0c0; }
.tier-oro { border-top: 4px solid #ffd700; }
.tier-diamante { border-top: 4px solid #00d1b2; }

.node-name {
  font-size: 1.1em;
  font-weight: bold;
  color: #fff;
}

.node-id {
  font-size: 0.8em;
  color: #aaa;
  margin-bottom: 8px;
}

.node-tier {
  font-size: 0.9em;
  font-weight: 500;
  color: #00d1b2;
  border-top: 1px solid #444;
  padding-top: 8px;
}

.node-metrics {
  margin-top: 8px;
  font-size: 0.85em;
  color: #ccc;
}
.node-metrics span {
  display: block;
}
.node-metrics strong {
  color: #fff;
}

/* Estilos para las líneas de conexión del gráfico */
.d3-org-chart .link {
  fill: none;
  stroke: #444;
  stroke-width: 2px;
}

.form-message.warning {
  background-color: #4a3d0a;
  color: #ffd700;
  border: 1px solid #c7a93e;
}
/* ==================================================================== */
/*          CSS PARA LAYOUT DE TARJETA HORIZONTAL (DASHBOARD)       */
/* ==================================================================== */

/* Seleccionamos la 4ta tarjeta y le decimos que ocupe todas las columnas */
.dashboard-grid .dashboard-card:nth-child(4) {
  /* ¡CLAVE! El elemento se expandirá desde la primera hasta la última columna */
  grid-column: 1 / -1; 
  
  /* Hacemos el layout interno horizontal para aprovechar el espacio */
  flex-direction: row;
  flex-wrap: wrap; /* Permite que los elementos se ajusten */
  justify-content: space-around; /* Distribuye el espacio equitativamente */
  align-items: center;
}

/* Ajustes para el título y los links dentro de la tarjeta horizontal */
.dashboard-grid .dashboard-card:nth-child(4) .card-title {
  width: 100%; /* El título ocupa todo el ancho */
  text-align: center;
}

.dashboard-grid .dashboard-card:nth-child(4) .card-link {
    width: 100%; /* El link también ocupa todo el ancho */
    margin-top: 20px;
    font-size: 1em; /* Un poco más grande para que destaque */
}

/* Ajustes para cada métrica dentro de la tarjeta horizontal */
.dashboard-grid .dashboard-card:nth-child(4) .card-metric {
    text-align: center;
}

/* CSS adaptado para PWA */
body.pwa-mode header,
body.pwa-mode footer,
body.pwa-mode .popup-instalacion {
  display: none !important;
}

body.pwa-mode .app-navbar {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #005f56;
  color: #fff;
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  z-index: 9999;
}

body.pwa-mode main {
  padding-bottom: 60px;
}
