/* ═══════════════════════════════════════════════════════════
   OpenPay FAST — Fintech Clean Theme
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary:       #1a56db;
  --primary-dark:  #1e429f;
  --success:       #0e9f6e;
  --success-dark:  #057a55;
  --warning:       #d97706;
  --danger:        #dc2626;
  --bg:            #f1f5f9;
  --card-bg:       #ffffff;
  --text:          #111827;
  --text-muted:    #6b7280;
  --border:        #e5e7eb;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:     0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:     0 10px 24px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.06);
  --radius:        14px;
  --radius-sm:     8px;
  --radius-xs:     6px;
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  font-size: 0.9375rem;
  -webkit-font-smoothing: antialiased;
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  padding: 0 1.5rem !important;
  min-height: 58px;
}

.navbar-brand {
  font-weight: 700 !important;
  font-size: 1.05rem !important;
  letter-spacing: -0.02em;
  color: #fff !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand i {
  background: linear-gradient(135deg, #3b82f6, #1a56db);
  border-radius: 8px;
  padding: 6px 7px;
  font-size: 0.875rem;
}

.btn-nav-global {
  background: transparent !important;
  border: none !important;
  color: rgba(255,255,255,.6) !important;
  border-radius: var(--radius-xs) !important;
  padding: 0.4rem 0.875rem !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  transition: all .15s ease !important;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.btn-nav-global:hover {
  background: rgba(255,255,255,.1) !important;
  color: #fff !important;
}

.btn-nav-global.active {
  background: rgba(255,255,255,.15) !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}

/* Reloj navbar */
#navbar-reloj {
  font-size: 0.8125rem !important;
  color: rgba(255,255,255,.5) !important;
  font-variant-numeric: tabular-nums;
}

/* SANDBOX badge */
.badge.bg-warning, span.badge.bg-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #fff !important;
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: var(--radius-xs);
  padding: 4px 10px;
  font-size: 0.7rem;
  text-transform: uppercase;
}

/* Botón Salir */
#btn-salir {
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.15) !important;
  color: rgba(255,255,255,.8) !important;
  border-radius: var(--radius-xs) !important;
  font-size: 0.8125rem !important;
  padding: 0.35rem 0.875rem !important;
  transition: all .15s !important;
}

#btn-salir:hover {
  background: rgba(255,255,255,.16) !important;
  color: #fff !important;
}

/* ── Screens layout ───────────────────────────────────────── */
.screen {
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  background: var(--card-bg) !important;
}

.card-header {
  border-radius: var(--radius) var(--radius) 0 0 !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 0.875rem 1.25rem !important;
  font-weight: 600 !important;
  font-size: 0.9375rem !important;
  background: #fff !important;
}

/* Step card headers (Cobros) */
.card-header.step-header-dark {
  background: linear-gradient(135deg, #1e293b, #0f172a) !important;
  color: #fff !important;
  border-bottom: none !important;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

/* ── KPI Cards ────────────────────────────────────────────── */
.kpi-card {
  border-radius: var(--radius) !important;
  padding: 1.375rem 1.5rem !important;
  position: relative;
  overflow: hidden;
  border: none !important;
  box-shadow: var(--shadow-md) !important;
  height: 100%;
}

.kpi-card::after {
  content: '';
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  pointer-events: none;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 0.375rem;
}

.kpi-value {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.375rem;
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 0.8rem;
  opacity: .75;
  margin: 0;
}

/* Variante azul — Cobrado hoy */
.kpi-today {
  background: linear-gradient(135deg, #1a56db 0%, #1e3a8a 100%);
  color: #fff;
}
.kpi-today .kpi-icon  { background: rgba(255,255,255,.2); color: #fff; }
.kpi-today .kpi-label { color: rgba(255,255,255,.8); }

/* Variante verde — Cobrado mes */
.kpi-month {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff;
}
.kpi-month .kpi-icon  { background: rgba(255,255,255,.2); color: #fff; }
.kpi-month .kpi-label { color: rgba(255,255,255,.8); }

/* Variante blanca — Pendientes */
.kpi-pending {
  background: #fff;
  border: 1px solid var(--border) !important;
  color: var(--text);
}
.kpi-pending .kpi-icon  { background: #fef3c7; color: #d97706; }
.kpi-pending .kpi-label { color: var(--text-muted); }
.kpi-pending .kpi-value { color: #d97706; }
.kpi-pending .kpi-sub   { color: var(--text-muted); }

/* Variante blanca — Fallidas */
.kpi-failed {
  background: #fff;
  border: 1px solid var(--border) !important;
  color: var(--text);
}
.kpi-failed .kpi-icon  { background: #fee2e2; color: #dc2626; }
.kpi-failed .kpi-label { color: var(--text-muted); }
.kpi-failed .kpi-value { color: #dc2626; }
.kpi-failed .kpi-sub   { color: var(--text-muted); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, #1a56db, #1e3a8a) !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.12) !important;
  transition: all .15s !important;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1e3a8a, #1e2d6e) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(26,86,219,.35) !important;
}
.btn-primary:active { transform: translateY(0) !important; }

.btn-success {
  background: linear-gradient(135deg, #059669, #047857) !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
  transition: all .15s !important;
}
.btn-success:hover { transform: translateY(-1px) !important; }

.btn-secondary, .btn-light, .btn-outline-secondary {
  border-radius: var(--radius-sm) !important;
  font-weight: 500 !important;
  transition: all .15s !important;
}

.btn-warning {
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
  transition: all .15s !important;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: var(--radius-sm) !important;
  border-color: var(--border) !important;
  font-size: 0.9375rem !important;
  padding: 0.5rem 0.875rem !important;
  transition: all .15s !important;
  background-color: #fafafa !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(26,86,219,.12) !important;
  background-color: #fff !important;
}

.form-label {
  font-weight: 500 !important;
  font-size: 0.875rem !important;
  color: #374151 !important;
  margin-bottom: 0.375rem !important;
}

/* ── Tables ───────────────────────────────────────────────── */
.table {
  font-size: 0.875rem !important;
}

.table thead th {
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .07em !important;
  color: var(--text-muted) !important;
  border-bottom: 2px solid var(--border) !important;
  padding: 0.625rem 0.75rem !important;
  white-space: nowrap;
}

.table tbody td {
  padding: 0.75rem !important;
  vertical-align: middle !important;
  border-color: #f3f4f6 !important;
}

.table-hover tbody tr:hover {
  background-color: #f8fafc !important;
  cursor: pointer;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  border-radius: var(--radius-xs) !important;
  font-weight: 600 !important;
  font-size: 0.7rem !important;
  padding: 3px 8px !important;
  letter-spacing: .03em;
}

/* ── Tabs (sub-tabs cliente) ──────────────────────────────── */
.nav-tabs {
  border-bottom: 2px solid var(--border) !important;
  gap: 0.25rem;
}

.nav-tabs .nav-link {
  border: none !important;
  border-bottom: 2px solid transparent !important;
  margin-bottom: -2px !important;
  color: var(--text-muted) !important;
  font-weight: 500 !important;
  font-size: 0.875rem !important;
  border-radius: 0 !important;
  padding: 0.625rem 1rem !important;
  transition: all .15s !important;
}

.nav-tabs .nav-link:hover {
  color: var(--text) !important;
  background: rgba(0,0,0,.03) !important;
}

.nav-tabs .nav-link.active {
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
  background: transparent !important;
  font-weight: 600 !important;
}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 2rem;
  text-align: center;
}

.empty-state .empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.empty-state .empty-icon i {
  font-size: 1.75rem;
  color: #9ca3af;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0;
  max-width: 280px;
}

/* ── Dashboard tabla header ───────────────────────────────── */
#screen-dashboard .card-header {
  background: linear-gradient(135deg, #1e293b, #0f172a) !important;
  color: #fff !important;
  border-bottom: none !important;
}

#screen-dashboard .card-header .btn {
  background: rgba(255,255,255,.12) !important;
  border: 1px solid rgba(255,255,255,.2) !important;
  color: rgba(255,255,255,.85) !important;
  font-size: 0.8rem !important;
}

/* ── Inputs group ─────────────────────────────────────────── */
.input-group-text {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
  border-color: var(--border) !important;
  background: #f3f4f6 !important;
}

/* ── Alertas ──────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm) !important;
  border: none !important;
  font-size: 0.875rem !important;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── Toasts ───────────────────────────────────────────────── */
.toast-container .toast {
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-lg) !important;
  font-size: 0.875rem !important;
}

/* ── Responsive tweaks ────────────────────────────────────── */
@media (max-width: 768px) {
  .screen { padding: 1rem; }
  .kpi-card { padding: 1rem 1.125rem !important; }
  .kpi-value { font-size: 1.25rem; }
}

/* ── Registro de Ventas ───────────────────────────────────── */
.reg-page-header {
  padding: 0.25rem 0;
}

.reg-page-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
}

.reg-page-title i {
  color: var(--primary);
}

.reg-banner {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  box-shadow: var(--shadow);
  font-size: 0.875rem;
}

/* ── Configuración ────────────────────────────────────────── */

/* Toggle switches en headers oscuros */
.step-header-dark .form-check-input:checked {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

.step-header-dark .form-check-input {
  background-color: rgba(255,255,255,.25);
  border-color: rgba(255,255,255,.3);
  cursor: pointer;
}

/* Credenciales card — borde y header dorado */
.card.border-warning {
  border-color: #d97706 !important;
}

/* Botón Exportar CSV en Registro */
.step-header-dark .btn-light {
  background: rgba(255,255,255,.12) !important;
  border: 1px solid rgba(255,255,255,.2) !important;
  color: rgba(255,255,255,.85) !important;
}

.step-header-dark .btn-light:hover {
  background: rgba(255,255,255,.2) !important;
  color: #fff !important;
}

/* Botón Actualizar lista en Cobros */
.step-header-dark .btn-sm {
  background: rgba(255,255,255,.12) !important;
  border: 1px solid rgba(255,255,255,.2) !important;
  color: rgba(255,255,255,.85) !important;
  font-size: 0.8rem !important;
}

.step-header-dark .btn-sm:hover {
  background: rgba(255,255,255,.2) !important;
  color: #fff !important;
}

/* ── Login page ───────────────────────────────────────────── */
body.login-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
