/* ========================================
   COBROSEGURO - Estilos Globales
   Optimizado para móviles económicos
   ======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --bg-light: #f1f5f9;
  --white: #ffffff;
  --border: #e2e8f0;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

/* Login */
.login-container {
  background: var(--white);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  margin: 100px auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.logo {
  text-align: center;
  margin-bottom: 30px;
}
.logo h1 {
  color: var(--primary);
  font-size: 28px;
}
.logo p {
  color: var(--text-light);
  font-size: 14px;
}

/* Formularios */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
}
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}
/* ========================================
   TOGGLE PASSWORD BUTTON
   ======================================== */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 45px; /* Espacio para el botón */
}

.toggle-password {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 8px;
  opacity: 0.6;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password:hover {
  opacity: 1;
}

.toggle-password:active {
  transform: scale(0.95);
}
/* Botones */
.btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s;
}
.btn-primary {
  background: var(--primary);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--primary-dark);
}
.btn-success {
  background: var(--success);
  color: var(--white);
}
.btn-warning {
  background: var(--warning);
  color: var(--white);
}
.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Header */
.header {
  background: var(--white);
  padding: 16px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header h1 {
  font-size: 20px;
  color: var(--text-dark);
}
.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-logout {
  padding: 8px 16px;
  background: var(--danger);
  color: var(--white);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.stat-card {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}
.stat-card h3 {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 8px;
}
.stat-card .valor {
  font-size: 28px;
  font-weight: 700;
}
.stat-card .icon {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 32px;
  opacity: 0.3;
}
/* Icono WhatsApp */
.icon-whatsapp {
  width: 65px;
  height: 65px;
  fill: #25d366; /* Verde oficial de WhatsApp */
  transition: transform 0.3s ease;
}

.icon-whatsapp:hover {
  transform: scale(1.1);
}

/* Para íconos más pequeños en botones */
.icon-whatsapp-sm {
  width: 20px;
  height: 20px;
  fill: white;
  vertical-align: middle;
}
.stat-card.azul {
  border-left: 4px solid var(--primary);
}
.stat-card.verde {
  border-left: 4px solid var(--success);
}
.stat-card.rojo {
  border-left: 4px solid var(--danger);
}
.stat-card.amarillo {
  border-left: 4px solid var(--warning);
}

/* Section */
.section {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.section-header h2 {
  font-size: 18px;
}

/* Tablas */
.table-responsive {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  background: #f8fafc;
  color: var(--text-light);
  font-weight: 600;
  font-size: 13px;
}
.text-center {
  text-align: center;
}

/* Alertas */
.alert {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.alert-error {
  background: #fef2f2;
  color: #dc2626;
}
.alert-success {
  background: #f0fdf4;
  color: #16a34a;
}

/* Menú Móvil */
.menu-movil {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  padding: 12px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}
.menu-movil a {
  display: inline-block;
  padding: 12px;
  text-align: center;
  text-decoration: none;
  color: var(--text-light);
  font-size: 12px;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 20px;
  color: var(--text-light);
  font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
  .menu-movil {
    display: flex;
    justify-content: space-around;
  }
  .container {
    padding: 16px;
    padding-bottom: 80px;
  }
  .btn {
    width: 100%;
    text-align: center;
  }
  .btn-group {
    flex-direction: column;
  }
  .login-container {
    margin: 20px;
    padding: 24px;
  }
}
/* Modales */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #64748b;
}

/* Botones de filtro */
.filter-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-btn.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

/* Badges de estado */
.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-activo {
  background: #dcfce7;
  color: #166534;
}

.badge-vencido {
  background: #fee2e2;
  color: #991b1b;
}

.badge-pagado {
  background: #e0e7ff;
  color: #3730a3;
}

/* Botones pequeños */
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Menú móvil */
.menu-movil {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  padding: 12px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.menu-movil a {
  display: inline-block;
  padding: 12px;
  text-align: center;
  text-decoration: none;
  color: #64748b;
  font-size: 12px;
}

@media (max-width: 768px) {
  .menu-movil {
    display: flex;
    justify-content: space-around;
  }

  .container {
    padding: 16px;
    padding-bottom: 80px;
  }
}
