:root {
  --primary: #111827;
  --accent: #4f46e5;

  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, .75);

  --text: #1f2328;
  --muted: #6b7280;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;

  --border: rgba(17, 17, 17, .06);

  --shadow-1: 0 8px 30px rgba(0, 0, 0, .05);
  --shadow-2: 0 18px 55px rgba(0, 0, 0, .08);

  --ring: 0 0 0 4px rgba(79, 70, 229, 0.20);

  --ease: cubic-bezier(.16, 1, .3, 1);
}




* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  display: flex;
  overflow-x: hidden;
}


.animate-up {
  animation: slideUp .55s var(--ease);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.cliente-row {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Estilo del input al escribir */
#filtroDocumento:focus {
  border-color: var(--accent) !important;
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(79, 70, 229, 0.15) !important;
}

/* --- Sidebar Glassmorphism --- */
.sidebar {
  width: 260px;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  position: fixed;
}

.brand {
  font-weight: 700;
  letter-spacing: 4px;
  font-size: 1.2rem;
  margin-bottom: 50px;
  padding-left: 15px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  padding: 12px 15px;
  border-radius: 12px;
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
  background: #f1f1f1;
  color: var(--primary);
  transform: translateX(5px);
}

.nav-link.active {
  background: var(--primary);
  color: var(--bg);
}

/* --- Main Content Animado --- */
.main-content {
  margin-left: 260px;
  padding: 60px;
  width: calc(100% - 260px);
  animation: fadeInPage 0.8s ease;
}

@keyframes fadeInPage {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Cards Premium --- */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  padding: 30px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .08);
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
  font-size: .92rem;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
  box-shadow: 0 12px 25px rgba(0, 0, 0, .10);
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.3);
}

.btn-primary:active {
  transform: translateY(0) scale(.99);
}

.btn-soft {
  background: rgba(17, 17, 17, .04);
  color: var(--primary);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
}

.input-pro,
.search-input,
#filtroDocumento {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  border-radius: 16px;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}

.input-pro:focus,
.search-input:focus,
#filtroDocumento:focus {
  outline: none;
  box-shadow: var(--ring);
  border-color: rgba(79, 70, 229, 0.55);
  background: var(--surface);
  transform: translateY(-1px);
}

/* Contenedor del pie de página de la sidebar */
.sidebar-footer {
  margin-top: auto;
  padding: 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* Estilo del Perfil de Usuario */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.user-avatar {
  width: 35px;
  height: 35px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

.user-role {
  font-size: 0.7rem;
  color: #999;
}

/* Botones de acción inferiores */
.footer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  color: #666;
  text-decoration: none;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: 0.3s;
}

.footer-link:hover {
  color: var(--accent);
}

.footer-link.logout:hover {
  color: #e74c3c;
  /* Rojo suave para cerrar sesión */
}

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

nav {
  flex: 1;
  /* Esto empuja el footer hacia abajo */
  padding: 20px 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  text-decoration: none;
  color: #555;
  transition: 0.3s;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

/* ====== Layout helpers (centro / full height) ====== */
html,
body {
  height: 100%;
}

.main-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* ✅ evita “huecos” raros */
}

.page {
  flex: 1;
  /* ✅ ocupa el alto restante */
  width: 100%;
}

/* ✅ Para páginas cortas tipo formulario */
.page--center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.page--center>* {
  width: min(980px, 100%);
  /* ✅ ancho pro */
}

/* ===== FIX SIDEBAR FOOTER (Dashboard y todas) ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  /* en vez de height:100vh */
  width: 260px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* evita que el footer se “pierda” */
}

/* IMPORTANTE: NO uses nav global para layout, solo el nav del sidebar */
.sidebar nav {
  flex: 1;
  overflow-y: auto;
  /* si hay muchos items, el scroll será aquí */
  padding: 20px 0;
}

/* Footer siempre visible */
.sidebar-footer {
  flex-shrink: 0;
  margin-top: 0;
  /* ya no dependemos de margin-top:auto */
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* (Opcional) scroll más limpio */
.sidebar nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar nav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.10);
  border-radius: 10px;
}

.sidebar nav::-webkit-scrollbar-track {
  background: transparent;
}