/* ========== DISEÑO GENERAL ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f7ff;
  color: #1a1a2e;
}

#app {
  min-height: 100vh;
}

/* ========== SECCIÓN LOGIN ========== */
.login-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 2rem;
}

.login-container {
  width: 100%;
  max-width: 450px;
}

.login-card {
  background: white;
  border-radius: 1.5rem;
  padding: 3rem 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-card h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: #1a1a2e;
}

.login-card .subtitle {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: #1a1a2e;
  font-size: 0.95rem;
}

.form-group input {
  padding: 0.9rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 0.8rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-login {
  padding: 1rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 0.8rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1rem;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-login:active {
  transform: translateY(0);
}

.login-note {
  text-align: center;
  color: #999;
  font-size: 0.85rem;
  margin-top: 1.5rem;
}

/* ========== SECCIÓN DASHBOARD ========== */
.dashboard-section {
  background: #f5f7ff;
  min-height: 100vh;
}

.dashboard-header {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.brand .dealer-name {
  font-size: 0.95rem;
  opacity: 0.9;
}

.btn-logout {
  padding: 0.7rem 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid white;
  border-radius: 0.6rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* ========== MAIN CONTENT ========== */
.dashboard-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: white;
  border-radius: 1.2rem;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 1.5rem;
  align-items: center;
  transition: all 0.3s ease;
  border-left: 4px solid #667eea;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.stat-icon {
  font-size: 2.5rem;
  min-width: 60px;
}

.stat-content h3 {
  font-size: 0.85rem;
  color: #999;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a1a2e;
}

/* Leads Section */
.leads-section {
  background: white;
  border-radius: 1.2rem;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  margin-bottom: 3rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: 1.5rem;
  color: #1a1a2e;
}

.filter-group {
  display: flex;
  gap: 1rem;
}

.filter-select {
  padding: 0.6rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 0.6rem;
  font-size: 0.9rem;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Tabla */
.table-container {
  overflow-x: auto;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
}

.leads-table thead {
  background: #f8f9fa;
  border-bottom: 2px solid #e0e0e0;
}

.leads-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #1a1a2e;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.leads-table td {
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
  color: #333;
}

.leads-table tbody tr {
  transition: all 0.3s ease;
}

.leads-table tbody tr:hover {
  background: #f8f9fa;
}

.loading-row td {
  text-align: center;
  color: #999;
  padding: 2rem 1rem;
}

/* Status Badge */
.status-badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 0.6rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pendiente {
  background: #fff3cd;
  color: #856404;
}

.status-contactado {
  background: #d1ecf1;
  color: #0c5460;
}

.status-confirmado {
  background: #d4edda;
  color: #155724;
}

/* Botones de Acciones */
.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-confirm {
  background: #d4edda;
  color: #155724;
}

.btn-confirm:hover {
  background: #c3e6cb;
  transform: translateY(-2px);
}

.btn-view {
  background: #d1ecf1;
  color: #0c5460;
}

.btn-view:hover {
  background: #bee5eb;
  transform: translateY(-2px);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #999;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state p {
  font-size: 1.1rem;
}

/* Commission Section */
.commission-section {
  background: white;
  border-radius: 1.2rem;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.commission-section h2 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: #1a1a2e;
}

.commission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.commission-card {
  background: linear-gradient(135deg, #667eea15, #764ba215);
  border: 2px solid #667eea30;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
}

.commission-card h3 {
  color: #1a1a2e;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.commission-amount {
  font-size: 2rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 0.5rem;
}

.commission-desc {
  color: #666;
  font-size: 0.9rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .dashboard-header {
    padding: 1.5rem;
  }

  .header-content {
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-start;
  }

  .brand h1 {
    font-size: 1.3rem;
  }

  .dashboard-main {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 1.5rem;
  }

  .leads-section {
    padding: 1rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .leads-table {
    font-size: 0.85rem;
  }

  .leads-table th,
  .leads-table td {
    padding: 0.7rem 0.5rem;
  }

  .action-buttons {
    flex-direction: column;
  }

  .btn-small {
    width: 100%;
  }

  .login-card {
    padding: 2rem 1.5rem;
  }

  .login-card h1 {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    flex-direction: column;
    text-align: center;
  }

  .stat-icon {
    min-width: auto;
  }

  .commission-grid {
    grid-template-columns: 1fr;
  }

  .leads-table th:nth-child(n+5),
  .leads-table td:nth-child(n+5) {
    display: none;
  }
}
