/* ============================================================
   RentaFlow — Estilos globales
   ============================================================ */

:root {
  --blue-900: #1e3a8a;
  --blue-800: #1e40af;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-100: #dbeafe;
  --green-500: #22c55e;
  --green-100: #dcfce7;
  --red-500: #ef4444;
  --red-100: #fee2e2;
  --yellow-500: #f59e0b;
  --yellow-100: #fef3c7;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--blue-400); border-radius: 99px; }

/* ── LANDING ── */
.hero-bg {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e40af 100%);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}
.hero-bg::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 70%);
  top: -200px; right: -200px;
  pointer-events: none;
}
.hero-bg::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(6,182,212,0.1) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  pointer-events: none;
}
.hero-float {
  animation: heroFloat 6s ease-in-out infinite;
}
@keyframes heroFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ── Botones ── */
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: white;
  color: var(--blue-600);
  border: 1.5px solid var(--blue-200, #bfdbfe);
  border-radius: 12px;
  padding: 11px 22px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-secondary:hover { background: var(--blue-100); }

.btn-success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-sm { padding: 6px 14px; font-size: 0.82rem; border-radius: 8px; }

/* ── Cards ── */
.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid var(--gray-200);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.1); }

.card-stat {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 50px; height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #0f172a 0%, #1e3a8a 100%);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s;
}
.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  border-radius: 10px;
  margin: 2px 10px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s;
  border: none;
  background: transparent;
  text-align: left;
  width: calc(100% - 20px);
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: white; }
.nav-item.active { background: rgba(59,130,246,0.25); color: #93c5fd; border-left: 3px solid #3b82f6; }
.nav-item i { width: 20px; text-align: center; }

/* ── Main content ── */
.main-content {
  margin-left: 260px;
  min-height: 100vh;
  transition: margin-left 0.3s;
}

/* ── Top bar ── */
.topbar {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

/* ── Inputs ── */
.rf-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: 0.9rem;
  transition: border-color 0.2s;
  background: white;
  color: var(--gray-900);
}
.rf-input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
.rf-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--gray-700); margin-bottom: 5px; }
.rf-group { margin-bottom: 14px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  gap: 4px;
}
.badge-green { background: var(--green-100); color: #15803d; }
.badge-red { background: var(--red-100); color: #b91c1c; }
.badge-yellow { background: var(--yellow-100); color: #92400e; }
.badge-blue { background: var(--blue-100); color: #1d4ed8; }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }

/* ── Tabla ── */
.rf-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.rf-table th { background: var(--gray-50); padding: 10px 14px; text-align: left; font-weight: 600; color: var(--gray-500); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid var(--gray-200); }
.rf-table td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.rf-table tr:hover td { background: var(--gray-50); }

/* ── Tabs ── */
.tab-btn { padding: 8px 18px; border-radius: 10px; font-weight: 600; font-size: 0.85rem; cursor: pointer; border: none; background: transparent; color: var(--gray-500); transition: all 0.2s; }
.tab-btn.active { background: var(--blue-600); color: white; }

/* ── Sección de alerta vencimiento ── */
.alert-warning { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 12px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.alert-danger { background: #fef2f2; border: 1px solid #fca5a5; border-radius: 12px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }

/* ── Pricing cards ── */
.plan-card {
  border-radius: 20px;
  padding: 28px 24px;
  border: 2px solid var(--gray-200);
  background: white;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
}
.plan-card.popular {
  border-color: var(--blue-500);
  box-shadow: 0 8px 30px rgba(37,99,235,0.18);
}
.plan-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.1); }

/* ── Mobile ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    display: none;
  }
  .sidebar-overlay.show { display: block; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .show-mobile { display: none !important; }
}

/* ── Animaciones ── */
.fade-in { animation: fadeIn 0.3s ease; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ── Progress bar ── */
.progress-bar { height: 6px; background: var(--gray-100); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #2563eb, #06b6d4); border-radius: 99px; transition: width 0.5s ease; }

/* ── Notificación dot ── */
.notif-dot { width: 8px; height: 8px; background: #ef4444; border-radius: 50%; position: absolute; top: 6px; right: 6px; animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ── Feature icon ── */
.feature-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* ── Auth form ── */
.auth-card {
  background: white;
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  width: 100%;
  max-width: 420px;
}

/* ── Empty state ── */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }

/* ── PWA banner ── */
#pwaBanner {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 99999; padding: 0 12px 12px;
  pointer-events: none;
}
#pwaBannerInner {
  background: linear-gradient(135deg, #1e40af, #1d4ed8);
  border-radius: 20px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -4px 30px rgba(30,64,175,0.4), 0 8px 30px rgba(0,0,0,0.3);
  pointer-events: all;
  animation: bannerSlide 0.5s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes bannerSlide {
  from { transform: translateY(120px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Colores de fondo para secciones ── */
.section-page {
  padding: 24px;
  min-height: calc(100vh - 65px);
}
