:root {
  --primary: #0b63ce;
  --primary-soft: #e4f0ff;
  --accent: #ff7a45;
  --bg: #f5f7fb;
  --card-bg: #ffffff;
  --border: #e1e4ec;
  --text: #1f2430;
  --muted: #6b7280;
  --footer-bg: #ffffff;
}

* { box-sizing: border-box; }

body {
  font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .25s ease, color .25s ease;
}

a { text-decoration: none; }

/* DARK MODE */
body.dark-mode {
  --bg: #020617;
  --card-bg: #020617;
  --border: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary-soft: #1d4ed8;
  --footer-bg: #020617;
}

body.dark-mode .sidebar {
  background: #020617;
  border-color: #1f2937;
}

body.dark-mode .manual-card {
  box-shadow: 0 14px 40px rgba(0,0,0,0.6);
}

body.dark-mode .mockup-laptop {
  background: #020617;
  border-color: #1f2937;
  box-shadow: 0 18px 45px rgba(0,0,0,0.8);
}

body.dark-mode .mockup-bar {
  background: linear-gradient(90deg, #111827, #020617);
}

body.dark-mode .mockup-dot {
  background: #4b5563;
}

body.dark-mode #lightbox {
  background: rgba(0,0,0,0.9);
}

body.dark-mode .sidebar-sub {
  color: var(--muted);
}

body.dark-mode .footer {
  border-top-color: #1f2937;
}

/* PORTAL (index.html) */
.portal-body {
  background: var(--bg);
}

.portal-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.portal-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.hero {
  border-radius: 18px;
  padding: 24px 24px 22px;
  background: radial-gradient(circle at top left, #e0f2fe, #f5f7fb);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: background .25s ease, border-color .25s ease;
}

body.dark-mode .hero {
  background: radial-gradient(circle at top left, #0f172a, #020617);
  border-color: #1f2937;
}

.hero-portal {
  margin-bottom: 22px;
}

.hero-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
}

.hero-sub {
  font-size: 14px;
  color: var(--muted);
  max-width: 520px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15,118,255,0.08);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}

body.dark-mode .hero-pill {
  background: rgba(37,99,235,0.25);
  color: #bfdbfe;
}

/* Tarjetas portal */
.portal-card {
  display: block;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 18px 16px 16px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 22px rgba(15,23,42,0.06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .25s ease;
  height: 100%;
}

.portal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(15,23,42,0.12);
  border-color: #bfdbfe;
}

.portal-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  margin-bottom: 10px;
  font-size: 20px;
}

.portal-card-icon.ventas { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.portal-card-icon.inventario { background: linear-gradient(135deg, #22c55e, #16a34a); }
.portal-card-icon.compras { background: linear-gradient(135deg, #f97316, #ea580c); }
.portal-card-icon.cxc { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.portal-card-icon.reportes { background: linear-gradient(135deg, #0f766e, #0d9488); }
.portal-card-icon.fel { background: linear-gradient(135deg, #ec4899, #db2777); }
.portal-card-icon.configuracion { background: linear-gradient(135deg, #6b7280, #4b5563); }
.portal-card-icon.usuarios { background: linear-gradient(135deg, #facc15, #eab308); }

.portal-card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.portal-card-text {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.portal-card-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

/* DARK MODE portal */
body.dark-mode .portal-card {
  box-shadow: 0 14px 40px rgba(0,0,0,0.6);
}

/* DARK MODE TOGGLE */
.theme-toggle-btn {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  padding: 4px 10px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

body.dark-mode .theme-toggle-btn {
  background: #020617;
  border-color: #1f2937;
  color: #e5e7eb;
}

/* SIDEBAR (para ventas.html y otros módulos) */
.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border);
  min-height: 100vh;
  position: sticky;
  top: 0;
  padding-top: 1rem;
  transition: background .25s ease, border-color .25s ease;
}

.sidebar-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
}

.sidebar-sub {
  font-size: 12px;
  color: var(--muted);
}

.nav-link-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
  transition: background .15s ease, color .15s ease, transform .1s ease;
}

.nav-link-custom i {
  width: 18px;
  text-align: center;
  color: var(--muted);
}

/* HOVER CORREGIDO (modo normal) */
.nav-link-custom:hover {
  background: #dbeafe;      /* azul suave pero visible */
  color: #0b63ce;           /* texto azul corporativo */
  transform: translateX(2px);
}

.nav-link-custom:hover i {
  color: #0b63ce;
}

.nav-link-custom.active {
  background: var(--primary);
  color: #fff;
}

.nav-link-custom.active i {
  color: #fff;
}

/* HEADER MÓDULOS */
.manual-header {
  padding: 18px 0 10px;
}

.manual-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

/* CARDS MÓDULOS */
.manual-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 22px 22px 18px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .4s ease, transform .4s ease, background .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.manual-card.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

.manual-card h2 {
  font-size: 20px;
  margin-bottom: 6px;
  color: var(--primary);
}

.tag {
  background: var(--primary-soft);
  color: #0b63ce;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  margin-right: 6px;
}

body.dark-mode .tag {
  background: rgba(37,99,235,0.25);
  color: #bfdbfe;
}

.manual-card p {
  font-size: 14px;
  margin-bottom: 8px;
}

/* BREADCRUMBS */
.breadcrumbs {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

.breadcrumbs i {
  color: var(--muted);
}

.breadcrumbs span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* MOCKUP HUBSPOT/SHOPIFY */
.img-wrapper {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.mockup-laptop {
  background: #f3f4f8;
  border-radius: 18px;
  padding: 14px 16px 18px;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.18);
  max-width: 1100px;
  width: 100%;
  border: 1px solid #dde1ee;
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.mockup-bar {
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e5e7f0, #f5f6fb);
  display: flex;
  align-items: center;
  padding: 0 10px;
  margin-bottom: 10px;
  transition: background .25s ease;
}

.mockup-dots {
  display: flex;
  gap: 5px;
}

.mockup-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d1d5e5;
  transition: background .25s ease;
}

.mockup-screen {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
  border: 1px solid #e1e4ec;
  overflow: hidden;
  transition: background .25s ease, border-color .25s ease;
}

.mockup-screen img {
  max-width: 100%;       /* ← NUNCA más ancho que su tamaño real */
  width: auto;           /* ← anula cualquier width fijo */
  height: auto;          /* ← mantiene la proporción */
  display: block;
  margin: 0 auto;        /* ← centra la imagen */
  border-radius: 8px;
  cursor: zoom-in;
  transition: transform .2s ease, box-shadow .2s ease;
}

.mockup-screen img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

/* LIGHTBOX */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

#lightbox img {
  max-width: 92%;
  max-height: 92%;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

#lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}

/* BUSCADOR */
.highlight {
  background: #fff59d;
  padding: 0 2px;
  border-radius: 3px;
}

/* BOTÓN SUBIR */
#btn-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  border: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.35);
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, background .25s ease;
}

#btn-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#btn-top i { font-size: 18px; }

/* FOOTER */
.footer {
  border-top: 1px solid var(--border);
  background: var(--footer-bg);
  padding: 16px 18px;
  margin-top: 24px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-left img {
  height: 26px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.footer-links a {
  color: var(--primary);
  font-weight: 500;
  font-size: 12px;
}

@media (max-width: 991.98px) {
  .sidebar {
    position: static;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

/* Ocultar nombre de archivo pero mantenerlo en el DOM */
.file-name {
  display: none !important;
}


footer-return {
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}


/* Todas las imágenes del manual */
.manual-img {
  display: block;
  margin: 0 auto;
  height: auto;

  /* Evita que una imagen pequeña se estire más allá de su tamaño real */
  max-width: min(100%, intrinsic);

  /* Mantiene nitidez en imágenes pequeñas */
  image-rendering: auto;
  object-fit: contain;

  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}



/* =====================================================
   MENÚ CONTEXTUAL PERSONALIZADO
   ===================================================== */
#ctx-menu {
  position: fixed;
  z-index: 10000;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.18);
  min-width: 220px;
  max-width: 320px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 6px 0;
  font-family: 'Manrope', system-ui, sans-serif;
  transition: background .25s ease, border-color .25s ease;
}

#ctx-menu .ctx-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}

#ctx-menu .ctx-menu-item i {
  width: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
}

#ctx-menu .ctx-menu-item:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

#ctx-menu .ctx-menu-item:hover i {
  color: var(--primary);
}

/* Scroll minimalista */
#ctx-menu::-webkit-scrollbar {
  width: 4px;
}
#ctx-menu::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.portal-card-icon.podcast {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
}
/*
.podcast-card {
  border-left: 4px solid #7c3aed;
}*/

/* Mini tarjeta de podcast en módulos */
.podcast-mini-card {
  background: rgba(15,118,255,0.03);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

/*
.podcast-mini-card {
  background: rgba(15,118,255,0.03);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  height: 100%;
  transition: background .2s ease;
}
body.dark-mode .podcast-mini-card {
  background: rgba(37,99,235,0.1);
}
.podcast-mini-card strong {
  font-size: 14px;
  color: var(--text);
}
.podcast-mini-card small a {
  color: var(--primary);
  font-weight: 600;
}
*/


/* Toast de copiado */
.toast-copiado {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #0b63ce;
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 10001;
  opacity: 0;
  animation: fadeToast 2s ease forwards;
}
@keyframes fadeToast {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  20% { opacity: 1; transform: translateX(-50%) translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}