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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f4f6f9;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* ========== HEADER ========== */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e8ecf1;
  padding: 16px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-placeholder a {
  text-decoration: none;
  display: inline-block;
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  color: #1a3a6b;
  letter-spacing: 1px;
}

/* ========== HERO ========== */
.hero-section {
  background: linear-gradient(135deg, #1a3a6b 0%, #2a5a9c 100%);
  padding: 48px 0 40px;
  text-align: center;
}

.hero-section h1 {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.hero-subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 16px;
}

/* ========== MAIN ========== */
.main-content {
  padding: 32px 16px;
  flex: 1;
}

/* ========== CARDS ========== */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid #e8ecf1;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.card-icon { font-size: 24px; }

.card h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1a3a6b;
}

.card h3 {
  font-size: 17px;
  font-weight: 600;
  color: #1a3a6b;
  margin-bottom: 12px;
}

.card-desc {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 24px;
}

/* ========== FORMS ========== */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #1f2937;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: #2a5a9c;
  box-shadow: 0 0 0 3px rgba(42,90,156,0.12);
}

.form-group input::placeholder { color: #9ca3af; }

.form-group select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.form-group select option { background: #fff; color: #1f2937; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.input-currency { position: relative; }

.currency-symbol {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #2a5a9c;
  font-weight: 700;
  font-size: 18px;
}

.input-currency input { padding-left: 36px; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }

.btn-primary {
  background: #2a5a9c;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #1a3a6b;
}

.btn-success {
  background: #16a34a;
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: #15803d;
}

.btn-outline {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #6b7280;
}

.btn-outline:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* ========== UTILITY ========== */
.hidden { display: none !important; }

.divider {
  border: none;
  border-top: 1px solid #e8ecf1;
  margin: 8px 0 28px;
}

.text-center { text-align: center; color: #6b7280; font-size: 14px; }

/* ========== QR ========== */
.qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0;
}

.qr-image {
  width: 260px;
  height: 260px;
  border-radius: 12px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border: 1px solid #e8ecf1;
}

.qr-section { text-align: center; margin: 20px 0; }
.qr-hint { font-size: 14px; color: #6b7280; margin: 4px 0 0; }
.qr-footer { font-size: 12px; color: #9ca3af; margin-top: 8px; letter-spacing: 1px; text-transform: uppercase; }

/* ========== PAGO INFO ========== */
.pago-info { margin-bottom: 12px; }

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}

.info-row:last-child { border-bottom: none; }
.info-label { color: #6b7280; font-size: 14px; }
.info-value { color: #1f2937; font-size: 14px; font-weight: 500; text-align: right; }

.info-value.monto {
  font-size: 24px;
  font-weight: 800;
  color: #16a34a;
}

.info-row.highlight {
  background: #f0fdf4;
  border-radius: 8px;
  padding: 12px 8px;
  margin: 4px 0;
  border-bottom: none;
}

.info-value code {
  background: #eef2ff;
  color: #2a5a9c;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Consolas', monospace;
}

.referencia-text {
  text-align: center;
  font-size: 14px;
  color: #6b7280;
  margin: 8px 0 16px;
}

.referencia-text span {
  color: #2a5a9c;
  font-weight: 700;
  font-family: 'Consolas', monospace;
  font-size: 16px;
}

/* ========== STEPS ========== */
.steps {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
}

.step {
  text-align: center;
  padding: 16px 8px;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid #f3f4f6;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2a5a9c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  margin: 0 auto 8px;
}

.step p { font-size: 12px; color: #6b7280; line-height: 1.4; }

/* ========== ALERTS ========== */
.alert {
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

/* ========== BADGES ========== */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-completado {
  background: #f0fdf4;
  color: #166534;
}

.badge-validando {
  background: #eff6ff;
  color: #1e40af;
}

.badge-pendiente {
  background: #fffbeb;
  color: #92400e;
}

.badge-rechazado {
  background: #fef2f2;
  color: #991b1b;
}

/* ========== CONSULTA DETALLE ========== */
.consulta-detalle {
  background: #f9fafb;
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0;
}

.consulta-detalle .linea {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid #f3f4f6;
}

.consulta-detalle .linea:last-child { border-bottom: none; }

.consulta-detalle .linea .label {
  color: #6b7280;
}

.consulta-detalle .linea .valor {
  color: #1f2937;
  font-weight: 600;
}

.consulta-detalle .linea .valor.deuda-si {
  color: #dc2626;
}

.consulta-detalle .linea .valor.deuda-no {
  color: #16a34a;
}

.consulta-detalle .linea .valor.monto-consulta {
  color: #16a34a;
  font-size: 20px;
  font-weight: 800;
}

.consulta-acciones { margin-top: 16px; }

.btn-consulta-success {
  background: #2a5a9c;
  color: #fff;
}

.btn-consulta-success:hover:not(:disabled) {
  background: #1a3a6b;
}

/* ========== SPINNER ========== */
.spinner-container {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e8ecf1;
  border-top: 4px solid #2a5a9c;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== FOOTER ========== */
.site-footer {
  background: #fff;
  border-top: 1px solid #e8ecf1;
  padding: 20px 0;
  text-align: center;
  margin-top: auto;
}

.site-footer p {
  color: #9ca3af;
  font-size: 13px;
}

/* ========== STATS ========== */
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 16px; }
.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 0; }
.stat-card { background: #f9fafb; border: 1px solid #f3f4f6; border-radius: 12px; padding: 16px; text-align: center; }
.stat-num { font-size: 22px; font-weight: 800; color: #1f2937; }
.stat-label { font-size: 11px; color: #6b7280; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-total .stat-num { color: #2a5a9c; }
.stat-success .stat-num { color: #16a34a; }
.stat-pending .stat-num { color: #d97706; }
.stat-validating .stat-num { color: #2563eb; }
.stat-rejected .stat-num { color: #dc2626; }
.stat-money .stat-num { color: #16a34a; }

/* ========== TABLE ========== */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th,
.table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f3f4f6; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #6b7280; font-weight: 600; }
.table td code { background: #eef2ff; color: #2a5a9c; padding: 2px 6px; border-radius: 4px; font-size: 12px; font-family: 'Consolas', monospace; }

/* ========== LOGS ========== */
.logs-container { max-height: 400px; overflow-y: auto; }
.logs-container::-webkit-scrollbar { width: 4px; }
.logs-container::-webkit-scrollbar-thumb { background: #e8ecf1; border-radius: 2px; }
.log-entry { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f3f4f6; font-size: 13px; flex-wrap: wrap; }
.log-time { color: #9ca3af; font-size: 11px; white-space: nowrap; min-width: 140px; }
.log-accion { color: #2563eb; font-weight: 600; text-transform: uppercase; font-size: 11px; min-width: 100px; }
.log-detalle { color: #4b5563; flex: 1; }
.log-ref code { background: #eef2ff; color: #2a5a9c; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-family: 'Consolas', monospace; }

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
  .hero-section { padding: 32px 0 28px; }
  .hero-section h1 { font-size: 24px; }
  .card { padding: 24px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .main-content { padding: 24px 12px; }
}
