:root {
  /* Premium Color Palette (HSL) */
  --primary: 220 70% 50%;
  /* Deep Blue */
  --primary-foreground: 210 40% 98%;

  --secondary: 200 95% 10%;
  /* Dark Navy */
  --secondary-foreground: 210 40% 98%;

  --accent: 260 80% 60%;
  /* Vibrant Purple for AI/Highlights */
  --accent-foreground: 210 40% 98%;

  --background: 220 30% 96%;
  /* Light Gray-Blue */
  --foreground: 222 47% 11%;

  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;

  --border: 214 32% 91%;
  --input: 214 32% 91%;

  --muted: 220 23% 94%;
  --muted-foreground: 218 14% 46%;

  --radius: 0.75rem;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

.dark {
  --background: 222 47% 11%;
  --foreground: 210 40% 98%;

  --card: 217 33% 17%;
  --card-foreground: 210 40% 98%;

  --border: 217 33% 25%;
  --input: 217 33% 25%;

  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Desktop styles (ensure mobile elements are hidden) */
@media (min-width: 769px) {

  .mobile-menu-btn,
  .mobile-close-btn {
    display: none !important;
  }
}

/* Utilities */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  outline: none;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-ghost {
  background-color: transparent;
  color: hsl(var(--foreground));
}

.btn-ghost:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Layout */
.layout-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 260px;
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  transition: width 0.3s ease;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: linear-gradient(135deg, hsl(var(--background)) 0%, #f0f4f8 100%);
}

.header {
  height: 64px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid hsl(var(--border));
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
}

.card {
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid hsl(var(--border));
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.text-gradient {
  background: linear-gradient(to right, hsl(var(--primary)), hsl(var(--accent)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Responsive Design */
@media (max-width: 768px) {
  .layout-container {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    transform: translateX(-100%);
    width: 80%;
    max-width: 300px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    display: none;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    width: 100%;
  }

  .header {
    padding: 0 1rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .mobile-menu-btn {
    display: flex !important;
    margin-right: 0.5rem;
  }

  .mobile-close-btn {
    display: flex !important;
  }

  .user-info {
    display: none;
  }
}

/* Background Animation */
@keyframes documentFloat {
  0% { transform: translateY(100vh) rotate(-10deg); opacity: 0; }
  10% { opacity: 0.3; }
  90% { opacity: 0.3; }
  100% { transform: translateY(-20vh) rotate(10deg); opacity: 0; }
}

.bg-animation-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.doc-particle {
  position: absolute;
  animation: documentFloat linear infinite;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ───────────────────────── Landing / Hero ───────────────────────── */
.lp-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(56, 132, 255, 0.28), transparent 60%),
    radial-gradient(1000px 500px at 90% 10%, rgba(150, 90, 255, 0.25), transparent 55%),
    linear-gradient(160deg, #0a1430 0%, #0b1020 55%, #070b18 100%);
  color: #e6ecff;
}

/* Malla de gradientes que se desplaza lentamente */
.lp-hero::before {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(420px 420px at 30% 40%, rgba(56, 132, 255, 0.22), transparent 60%),
    radial-gradient(380px 380px at 70% 60%, rgba(150, 90, 255, 0.20), transparent 60%);
  filter: blur(20px);
  animation: lpMeshDrift 18s ease-in-out infinite alternate;
  pointer-events: none;
}

/* Grilla técnica que late suave */
.lp-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 160, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 255, 0.06) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, black, transparent 75%);
  animation: lpGridPan 24s linear infinite;
  pointer-events: none;
}

@keyframes lpMeshDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(4%, 3%, 0) scale(1.08); }
  100% { transform: translate3d(-3%, 2%, 0) scale(1.04); }
}
@keyframes lpGridPan {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 46px 46px, 46px 46px; }
}

@keyframes lpFadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lp-reveal { opacity: 0; animation: lpFadeUp 0.7s cubic-bezier(.2,.7,.2,1) forwards; }

@keyframes lpFloat {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-14px) rotate(-1.5deg); }
}
.lp-float { animation: lpFloat 6s ease-in-out infinite; }

@keyframes lpCheckPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); opacity: 1; }
}
.lp-check { animation: lpCheckPop 0.45s cubic-bezier(.2,.8,.2,1) forwards; }

@keyframes lpFill { from { width: 0; } }

.lp-gradient-text {
  background: linear-gradient(110deg, #7fb0ff 0%, #b79bff 50%, #5ce0c0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lp-wa {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.9rem 1.6rem; border-radius: 999px;
  background: linear-gradient(135deg, #25d366, #1aa851);
  color: #fff; font-weight: 700; text-decoration: none;
  box-shadow: 0 10px 30px -8px rgba(37, 211, 102, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.lp-wa:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -8px rgba(37, 211, 102, 0.7); }

.lp-ghost {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.9rem 1.4rem; border-radius: 999px;
  background: rgba(255,255,255,0.06); color: #cdd7f5;
  border: 1px solid rgba(255,255,255,0.15); text-decoration: none; font-weight: 600;
  transition: all 0.2s ease;
}
.lp-ghost:hover { background: rgba(255,255,255,0.12); }

.lp-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.85rem; border-radius: 999px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  color: #aab8e0; font-size: 0.8rem; font-weight: 600;
}

.lp-glass {
  background: rgba(18, 26, 51, 0.6);
  border: 1px solid rgba(140, 170, 255, 0.18);
  border-radius: 18px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
}

.lp-feature {
  background: #fff; border: 1px solid hsl(var(--border));
  border-radius: 16px; padding: 1.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.lp-feature:hover { transform: translateY(-4px); box-shadow: 0 18px 30px -12px rgba(20,40,90,0.18); border-color: hsl(var(--primary)); }

@media (max-width: 860px) {
  .lp-hero-grid { grid-template-columns: 1fr !important; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-hero::before, .lp-hero::after, .lp-float, .lp-reveal, .lp-check { animation: none !important; opacity: 1 !important; }
}
/* Barra de progreso indeterminada (procesamiento de bases/presupuesto) */
.kreo-bar { height: 6px; width: 100%; max-width: 340px; margin: 0 auto; background: hsl(var(--muted)); border-radius: 999px; overflow: hidden; }
.kreo-bar-fill { height: 100%; width: 40%; background: hsl(var(--primary)); border-radius: 999px; animation: kreo-indeterminate 1.2s ease-in-out infinite; }
@keyframes kreo-indeterminate { 0% { margin-left: -42%; } 100% { margin-left: 102%; } }
@media (prefers-reduced-motion: reduce) { .kreo-bar-fill { animation: none; width: 100%; opacity: 0.6; } }
