/* Sección Crear Factura */
.create-invoice-section {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

/* Título */
.invoice-info-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0971CE;
  margin-bottom: 15px;
}

/* Párrafos */
.invoice-info-card p {
  font-size: 14px;
  color: #444;
  line-height: 1.5;
  margin-bottom: 15px;
}

/* Contenedor de refer-top y create-invoice-section */
.responsive-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Vista desktop: dos columnas */
@media (min-width: 992px) {
  .responsive-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
  }
}

/* Modales de create-invoice-section: asegurar que no se salga en móvil */
.modal .modal-content {
  max-width: 90%; /* ajusta al ancho de pantalla */
  margin: 0 10px; /* pequeño margen lateral */
  box-sizing: border-box;
}


/* Botón */
.invoice-info-card .btn-copy {
  background: #0971CE;
  color: #fff;
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}
.invoice-info-card .btn-copy:hover { background: #085aaa; }

/* ================= MODALES ================= */
.modal {
  display: none;
  position: fixed;
  z-index: 1100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
}

.modal .modal-content {
  background: #fff;
  border-radius: 15px;
  padding: 25px 20px;
  max-width: 450px;
  width: 100%;
  position: relative;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  animation: fadeIn 0.3s ease;
  text-align: center;
  box-sizing: border-box;
}

.modal .modal-content h3 {
  color: #0971CE;
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.modal .modal-content label {
  display: block;
  margin: 8px 0 4px;
  text-align: left;
  font-weight: 500;
}

.modal .modal-content input {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ccc;
  margin-bottom: 10px;
  box-sizing: border-box;
}

.modal .modal-content .modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
}

.modal .modal-content .btn-copy { 
  padding: 8px 15px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}
.modal .modal-content .btn-copy:hover { background: #085aaa; }

.modal .modal-content .close-btn { background: #ccc; color: #000; }
.modal .close-modal { 
  position: absolute;
  top: 12px;
  right: 15px;
  font-size: 22px;
  cursor: pointer;
  color: #888;
  transition: color 0.2s; 
}
.modal .close-modal:hover { color: #000; }

#invoiceResultModal a {
  color: #0971CE;
  word-break: break-all;
  display: block;
  margin: 10px 0;
  text-decoration: none;
}
#invoiceResultModal a:hover { text-decoration: underline; }

/* Animación */
@keyframes fadeIn { 
  from { opacity: 0; transform: translateY(-20px); } 
  to { opacity: 1; transform: translateY(0); } 
}

@media (max-width: 768px) {
  .modal .modal-content {
    max-width: calc(100% - 20px); /* ancho total menos márgenes */
    margin: 0;                    /* eliminamos margen lateral */
    left: 47%;
    transform: translateX(-50%);
    padding: 20px;
  }
}


/* Estilos para el modal */
    #usernameModal {
      display: none;
      position: fixed;
      z-index: 1000;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      overflow: auto;
      background-color: rgba(0,0,0,0.5);
    }
    #usernameModal .modal-content {
      background-color: #fff;
      margin: 15% auto;
      padding: 20px;
      border-radius: 8px;
      text-align: center;
      max-width: 400px;
    }
    #usernameModal .modal-content p {
      margin-bottom: 20px;
      font-size: 16px;
    }
    #usernameModal .modal-content a {
      display: inline-block;
      padding: 10px 20px;
      background-color: #0971CE;
      color: #fff;
      border-radius: 5px;
      text-decoration: none;
      font-weight: bold;
    }

.referidos-container {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding-bottom: 80px;
}

@media (min-width: 1024px) {
  .referidos-container {
    margin-right: 280px;
  }
}

/* Refer code */
.refer-code-card {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.refer-code-card h2 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #0971CE;
  display: flex;
  align-items: center;
  gap: 8px;
}

.refer-code-card p {
  font-size: 14px;
  word-break: break-all;
  background: #f3f3f3;
  padding: 10px;
  border-radius: 8px;
}

.btn-copy {
  margin-top: 10px;
  background: #0971CE;
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Stats */
.stats-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit,minmax(150px,1fr));
}

.stat-card {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.stat-card i {
  font-size: 28px;
  color: #0971CE;
}

.stat-card h3 {
  margin: 10px 0;
  font-size: 20px;
}

.stat-card.highlight {
  background: #0971CE;
  color: #fff;
}

.stat-card.highlight i { color: #fff; }

/* Periods */
.period-grid {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(auto-fit,minmax(130px,1fr));
}

.period-card {
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.period-card span {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #444;
}

.period-card h4 {
  margin: 8px 0 0;
  font-size: 18px;
  font-weight: bold;
  color: #0971CE;
}

/* Contenedor superior (refer code + total ganancias) */
.refer-top {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px; /* espacio debajo */
}

/* En escritorio, dos columnas */
@media (min-width: 992px) {
  .refer-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 40px; /* más respiro en desktop */
  }

  .refer-code-card,
  .total-card {
    height: 100%;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .deposit-content {
    flex-direction: column;
  }
  .deposit-info {
    margin-top: 30px;
  }
}

/* ======================== */
/*        MODO OSCURO       */
/* ======================== */

body.dark-mode {
  background: #021923;
  color: #FFFFFF;
}

/* Topbar */
body.dark-mode .topbar {
  background: #042738;
  color: #FFFFFF;
}

body.dark-mode .actions button {
  color: #FFFFFF;
}

/* Drawer Menu */
body.dark-mode .drawer-menu {
  background: #042738;
  color: #FFFFFF;
}

body.dark-mode .drawer-menu .close-btn {
  color: #FFFFFF;
}

body.dark-mode .drawer-menu li:hover {
  background: rgba(255,255,255,0.1);
}

/* Refer code card */
body.dark-mode .refer-code-card {
  background: rgba(4,36,51,0.6);
  color: #FFFFFF;
}

body.dark-mode .refer-code-card h2 {
  color: #FFFFFF;
}

body.dark-mode .refer-code-card p {
  background: #064165;
  color: #FFFFFF;
}

body.dark-mode .btn-copy {
  background: #0971CE;
  color: #FFFFFF;
}

body.dark-mode .btn-copy:hover {
  background: #085aaa;
}

/* Stats */
body.dark-mode .stat-card {
  background: #042738;
  color: #FFFFFF;
}

body.dark-mode .stat-card i {
  color: #0971CE;
}

body.dark-mode .stat-card.highlight {
  background: #0971CE;
  color: #FFFFFF;
}

body.dark-mode .stat-card.highlight i {
  color: #FFFFFF;
}

/* Periods */
body.dark-mode .period-card {
  background: #042738;
  color: #FFFFFF;
}

body.dark-mode .period-card span {
  color: #e0e0e0;
}

body.dark-mode .period-card h4 {
  color: #0971CE;
}

/* Toast */
body.dark-mode .custom-toast {
  background: #042433;
  color: #FFFFFF;
}

body.dark-mode .custom-toast-content {
  color: #FFFFFF;
}

body.dark-mode .custom-toast-content i {
  color: inherit;
}

body.dark-mode .toast-error i {
  color: #FF4C4C !important;
}

body.dark-mode .toast-warning i {
  color: #FFA500 !important;
}

body.dark-mode .toast-success i {
  color: #28A745 !important;
}

/* Bottom nav */
body.dark-mode .bottom-nav {
  background: #042738;
}

body.dark-mode .bottom-nav button {
  color: #FFFFFF;
}

body.dark-mode .bottom-nav button:hover {
  color: #0971CE;
}

/* Dark mode para Sección Crear Factura */
body.dark-mode .create-invoice-section {
  background: #042738;
  color: #FFF;
}

/* Dark mode para los modales */
body.dark-mode .modal {
  background: rgba(0,0,0,0.6);
}

body.dark-mode .modal .modal-content {
  background: #042738;
  color: #FFFFFF;
}

body.dark-mode .modal .modal-content input {
  background: #064165;
  color: #FFFFFF;
  border: 1px solid #0971CE;
}

body.dark-mode .modal .modal-content label {
  color: #FFFFFF;
}

body.dark-mode .modal .modal-content .btn-copy {
  background: #0971CE;
  color: #FFFFFF;
}

body.dark-mode .modal .modal-content .btn-copy:hover {
  background: #085aaa;
}

body.dark-mode .modal .close-modal {
  color: #FFFFFF;
}

body.dark-mode #invoiceResultModal a {
  color: #0971CE;
}

body.dark-mode .create-invoice-section p,
body.dark-mode .create-invoice-section span,
body.dark-mode .create-invoice-section label {
  color: #FFFFFF;
}
