/* ============================================
   BEZALEEL PLATFORM — Design System v1.0
   Dark Premium · Gold Accent · Inter Font
   ============================================ */

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

:root {
  /* Colores principales - Mercado Nocturno */
  --gold:        #F4D03F; /* Amarillo mercado / luz incandescente */
  --gold-light:  #f9e79f;
  --gold-dim:    #d4ac0d;
  --gold-glow:   rgba(244, 208, 63, 0.15);
  --amber:       #E67E22; /* Naranja terracota / arcilla */
  --neon-green:  #58D68D; /* Verde neón suave para éxito */

  /* Fondos */
  --bg:          #1A1F2E; /* Azul petróleo oscuro */
  --bg-2:        #252B3D; /* Azul grisáceo */
  --bg-card:     #252B3D;
  --bg-card-2:   rgba(62, 74, 97, 0.4);

  /* Bordes */
  --border:      rgba(244, 208, 63, 0.1); /* Borde sutil amarillo */
  --border-sub:  rgba(255, 255, 255, 0.05);

  /* Texto */
  --text:        #F8F9FA; /* Blanco hueso */
  --text-sub:    #cbd5e1;
  --muted:       #94a3b8;

  /* Utilidades */
  --radius:      14px;
  --radius-sm:   8px;
  --radius-lg:   20px;
  --shadow:      0 20px 60px rgba(0,0,0,0.5);
  --shadow-gold: 0 0 40px var(--gold-glow);
  --transition:  0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }

/* === TIPOGRAFÍA === */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
.gradient-text {
  background: linear-gradient(135deg, #F8F9FA 0%, var(--gold-light) 60%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gold-text { color: var(--gold-light); }
.muted { color: var(--muted); }

/* === LAYOUT === */
.container { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
.section    { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }

/* === BOTONES === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 0.7rem 1.5rem; border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); text-decoration: none;
  border: none; white-space: nowrap;
}
.btn-primary {
  background: var(--gold);
  color: #1A1F2E; /* Negro sobre amarillo para máximo contraste */
  box-shadow: 0 4px 15px rgba(244, 208, 63, 0.2);
}
.btn-primary:hover {
  background: var(--gold-light);
  box-shadow: 0 0 35px rgba(196,161,71,0.5);
  transform: translateY(-2px);
}
.btn-outline {
  background: transparent;
  color: var(--gold-light);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  background: var(--gold-glow);
  border-color: var(--gold);
}
.btn-ghost {
  background: transparent;
  color: var(--text-sub);
}
.btn-ghost:hover { color: var(--gold-light); }
.btn-lg { padding: 0.9rem 2rem; font-size: 1rem; border-radius: var(--radius-sm); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }

/* === CARDS === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

/* === FORMULARIOS === */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-sub); }
.form-control {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-sub);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  padding: 0.7rem 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none; width: 100%;
}
.form-control:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(196,161,71,0.12);
}
.form-control::placeholder { color: var(--muted); }

/* === BADGE === */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.75rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.badge-gold { background: rgba(196,161,71,0.12); border: 1px solid rgba(196,161,71,0.3); color: var(--gold-light); }
.badge-green { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.25); color: #86efac; }
.badge-red { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #fca5a5; }
.badge-blue { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.25); color: #93c5fd; }

/* === NAVBAR === */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 68px;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-sub);
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1.5rem;
}
.nav-logo {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.nav-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--gold), var(--amber));
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.nav-links { display: flex; align-items: center; gap: 0.5rem; }

/* === BACKGROUND EFFECTS === */
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(196,161,71,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196,161,71,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.orb {
  position: fixed; border-radius: 50%; filter: blur(100px); pointer-events: none;
  animation: floatOrb 10s ease-in-out infinite alternate;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(244, 208, 63, 0.08), transparent 70%);
  top: -100px; left: -100px; animation-delay: 0s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(230, 126, 34, 0.1), transparent 70%);
  bottom: -80px; right: -80px; animation-delay: -5s;
}
@keyframes floatOrb {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(25px, 15px) scale(1.08); }
}

/* === TABLA === */
.saas-table { width: 100%; border-collapse: collapse; }
.saas-table th, .saas-table td {
  padding: 0.85rem 1rem; text-align: left;
  border-bottom: 1px solid var(--border-sub); font-size: 0.875rem;
}
.saas-table th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.saas-table tr:last-child td { border-bottom: none; }
.saas-table tbody tr:hover td { background: rgba(196,161,71,0.03); }

/* === DIVIDER === */
.divider {
  display: flex; align-items: center; gap: 0.75rem; margin: 1.5rem 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}
.divider span { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

/* === TOAST === */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: white; padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4); z-index: 9999;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === ALERT === */
.alert { padding: 0.85rem 1rem; border-radius: var(--radius-sm); font-size: 0.875rem; display: none; }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.25); color: #86efac; }
.alert.show { display: block; }

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px); z-index: 500;
  display: none; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem; width: 100%; max-width: 720px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.3rem; line-height: 1; transition: color var(--transition); }
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* === SIDEBAR LAYOUT === */
.saas-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; min-height: 100vh; flex-shrink: 0;
  background: var(--bg-2); border-right: 1px solid var(--border-sub);
  display: flex; flex-direction: column; padding: 1.5rem 0;
}
.sidebar-logo {
  padding: 0 1.25rem 1.5rem; border-bottom: 1px solid var(--border-sub);
  margin-bottom: 1rem;
}
.sidebar-logo .logo-wrap { display: flex; align-items: center; gap: 0.5rem; }
.sidebar-logo .logo-icon { width: 30px; height: 30px; background: linear-gradient(135deg, var(--gold), var(--amber)); border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; }
.sidebar-logo .logo-name { font-weight: 800; font-size: 0.95rem; letter-spacing: -0.02em; }
.nav-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 1.25rem; border-radius: 0; cursor: pointer;
  color: var(--muted); font-size: 0.875rem; font-weight: 500;
  text-decoration: none; transition: all var(--transition);
  border-left: 3px solid transparent;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.nav-item.active { color: var(--gold-light); border-left-color: var(--gold); background: rgba(196,161,71,0.06); }
.sidebar-footer { margin-top: auto; padding: 1rem 1.25rem; border-top: 1px solid var(--border-sub); }
.main-content { flex: 1; overflow-y: auto; }
.content-header {
  padding: 1.5rem 2rem; border-bottom: 1px solid var(--border-sub);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(10,15,30,0.5); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 50;
}
.content-body { padding: 2rem; }

/* === STATS CARD === */
.stat-card {
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
}
.stat-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -0.04em; }
.stat-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }

/* === UTILITIES === */
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; } .gap-6 { gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; } .mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; } .mb-4 { margin-bottom: 1rem; }
.text-sm { font-size: 0.875rem; } .text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; } .font-semibold { font-weight: 600; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content-body { padding: 1rem; }
}
