/* ElERP — documentación (estilo Odoo Docs). Layout de 3 columnas. */

.docs-header {
  position: sticky; top: 0; z-index: 60;
  background: #fff; border-bottom: 1px solid var(--border);
}
.docs-header-inner { display: flex; align-items: center; gap: 20px; height: 60px; padding: 0 24px; }
.docs-header .brand .wordmark { font-size: 18px; }
.docs-header .dh-tag { font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--muted);
  border-left: 1px solid var(--border); padding-left: 14px; margin-left: 2px; }
.docs-header .dh-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.docs-header .dh-right a { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.docs-header .dh-right a:hover { color: var(--navy); }
/* El botón es un <a> dentro de .dh-right: la regla de arriba le ganaba en especificidad
   a .btn-primary y lo dejaba con texto gris sobre morado. */
.docs-header .dh-right a.btn, .docs-header .dh-right a.btn:hover { color: #fff; }
.docs-header .btn { padding: 8px 14px; font-size: 14px; }
.docs-menu-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 6px; padding: 7px; cursor: pointer; }

.docs-layout {
  display: grid; grid-template-columns: 264px minmax(0, 1fr) 220px;
  gap: 40px; max-width: 1280px; margin: 0 auto; padding: 0 24px; align-items: start;
}

/* ---- Sidebar ---- */
.docs-sidebar { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px);
  overflow-y: auto; padding: 28px 8px 40px 0; }
.docs-search { position: relative; margin-bottom: 18px; }
.docs-search input {
  width: 100%; font-family: var(--font-body); font-size: 14px; color: var(--ink);
  padding: 9px 12px 9px 34px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2);
}
.docs-search input:focus { outline: none; border-color: var(--navy); background: #fff; box-shadow: 0 0 0 3px rgba(106,44,240,.1); }
.docs-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
/* Rótulo de BLOQUE del menú de documentación: separa la base (siempre disponible) de
   los módulos instalables. Más contundente que un `sec-title` para que la jerarquía se
   lea de un vistazo: línea superior, mayúsculas y color de marca. */
.docs-nav .doc-grupo {
  margin: 4px 0 12px; padding-top: 14px;
  border-top: 1px solid var(--border);
  font-family: var(--font-display); font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .09em; color: var(--navy);
}
.docs-nav .doc-grupo:first-child { padding-top: 0; border-top: 0; }

.docs-nav .sec { margin-bottom: 22px; }
.docs-nav .sec-title { font-family: var(--font-display); font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--faint); margin: 0 0 8px; padding: 0 10px; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav li a { display: block; padding: 7px 10px; border-radius: 6px; font-size: 14.5px; color: var(--ink-2); line-height: 1.35; }
.docs-nav li a:hover { background: var(--bg-2); color: var(--navy); }
.docs-nav li a.active { background: var(--navy-tint); color: var(--navy); font-weight: 600; }
.docs-nav .no-results { padding: 10px; font-size: 14px; color: var(--muted); }

/* ---- Resultados de búsqueda de texto completo ---- */
.docs-results { margin-bottom: 22px; }
.docs-results .no-results { padding: 10px; font-size: 14px; color: var(--muted); }
.docs-results-count { font-family: var(--font-display); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 0 0 8px; padding: 0 10px; }
.docs-result { display: block; padding: 9px 10px; border-radius: 6px; margin-bottom: 2px; }
.docs-result:hover { background: var(--bg-2); }
.docs-result .dr-sec { display: block; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.docs-result .dr-title { display: block; font-size: 14.5px; font-weight: 600; color: var(--navy); line-height: 1.3; }
.docs-result .dr-snippet { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 3px; }
.docs-result mark, .docs-result .dr-title mark { background: #FEF3C7; color: inherit; padding: 0 1px; border-radius: 2px; }

/* ---- Content ---- */
.docs-content { padding: 32px 0 80px; min-width: 0; }
.docs-breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.docs-breadcrumb a { color: var(--muted); }
.docs-breadcrumb a:hover { color: var(--navy); }
.docs-article h1 { font-size: 34px; margin-bottom: 10px; }
.docs-article .lede { font-size: 18px; color: var(--ink-2); margin-bottom: 28px; }
.docs-article h2 { font-size: 24px; margin: 40px 0 14px; padding-top: 8px; scroll-margin-top: 76px; }
.docs-article h3 { font-size: 18px; margin: 28px 0 10px; scroll-margin-top: 76px; }
.docs-article p { color: var(--ink-2); }
.docs-article ul, .docs-article ol { color: var(--ink-2); padding-left: 22px; margin: 0 0 1em; }
.docs-article li { margin-bottom: 7px; }
.docs-article strong { color: var(--ink); }
.docs-article a { color: var(--navy); text-decoration: underline; text-decoration-color: rgba(106,44,240,.3); text-underline-offset: 2px; }
.docs-article a:hover { text-decoration-color: var(--navy); }
.docs-article code { background: var(--bg-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--navy-dark); }
.docs-article pre { background: #10203f; color: #F3EFFE; border-radius: var(--radius); padding: 16px 18px; overflow-x: auto; margin: 0 0 1.4em; font-size: 13.5px; line-height: 1.5; }
.docs-article pre code { background: none; border: none; padding: 0; color: inherit; }
.docs-article hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* Callouts */
.callout { border: 1px solid var(--border); border-left: 3px solid var(--navy); background: var(--surface);
  border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 1.4em; font-size: 15px; }
.callout p:last-child { margin-bottom: 0; }
.callout .ct { font-family: var(--font-display); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; display: block; }
.callout.note { border-left-color: var(--navy); } .callout.note .ct { color: var(--navy); }
.callout.tip { border-left-color: var(--teal); } .callout.tip .ct { color: var(--teal-dark); }
.callout.warn { border-left-color: var(--warning); } .callout.warn .ct { color: var(--warning); }

/* Definition-style cards / steps inside docs */
.doc-steps { list-style: none; padding: 0; margin: 0 0 1.4em; counter-reset: dstep; }
.doc-steps li { position: relative; padding: 4px 0 4px 40px; margin-bottom: 14px; }
.doc-steps li::before { counter-increment: dstep; content: counter(dstep); position: absolute; left: 0; top: 2px;
  width: 26px; height: 26px; border-radius: 7px; background: var(--navy); color: #fff; font-family: var(--font-mono); font-weight: 700;
  font-size: 13px; display: flex; align-items: center; justify-content: center; }

/* Tables */
.docs-article table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: 14.5px; }
.docs-article th, .docs-article td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.docs-article th { font-family: var(--font-display); font-weight: 600; color: var(--ink); background: var(--bg-2); }
.docs-article td { color: var(--ink-2); }

/* Page nav (prev/next) */
.docs-pagenav { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; border-top: 1px solid var(--border); padding-top: 24px; }
.docs-pagenav a { flex: 1; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; text-decoration: none; }
.docs-pagenav a:hover { border-color: var(--navy); background: var(--bg-2); }
.docs-pagenav .lbl { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.docs-pagenav .ttl { font-family: var(--font-display); font-weight: 600; color: var(--navy); font-size: 15px; }
.docs-pagenav .next { text-align: right; }

/* ---- TOC ---- */
.docs-toc { position: sticky; top: 60px; align-self: start; padding: 34px 0; font-size: 13.5px; }
.docs-toc .toc-title { font-family: var(--font-display); font-weight: 700; font-size: 12px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--faint); margin-bottom: 10px; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.docs-toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); line-height: 1.35; }
.docs-toc li a:hover { color: var(--navy); }
.docs-toc li a.active { color: var(--navy); border-left-color: var(--navy); font-weight: 600; }
.docs-toc li.h3 a { padding-left: 26px; font-size: 13px; }

/* ---- Docs portal (index) ---- */
.docs-portal { max-width: var(--maxw); margin: 0 auto; padding: 48px 24px 80px; }
.docs-portal .ph { margin-bottom: 40px; }
.docs-portal .ph h1 { font-size: 38px; margin-bottom: 10px; }
.docs-portal .ph p { font-size: 18px; color: var(--ink-2); max-width: 640px; }
.portal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .portal-grid { grid-template-columns: 1fr; } }
.portal-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s; text-decoration: none; }
.portal-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.portal-card .pc-num { font-family: var(--font-mono); font-size: 13px; color: var(--teal-dark); font-weight: 700; }
.portal-card h3 { font-size: 17px; margin: 6px 0 6px; }
.portal-card p { font-size: 14px; color: var(--muted); margin: 0; }

/* ---- Responsive docs ---- */
@media (max-width: 1080px) {
  .docs-layout { grid-template-columns: 240px minmax(0,1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 820px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-menu-toggle { display: block; }
  .docs-sidebar { position: fixed; top: 60px; left: 0; bottom: 0; width: 300px; max-width: 84vw;
    background: #fff; border-right: 1px solid var(--border); padding: 24px 20px; transform: translateX(-102%);
    transition: transform .2s ease; z-index: 55; box-shadow: var(--shadow-md); max-height: none; }
  .docs-sidebar.open { transform: translateX(0); }
  .docs-scrim { display: none; position: fixed; inset: 60px 0 0 0; background: rgba(20,30,60,.35); z-index: 54; }
  .docs-scrim.open { display: block; }
}

/* ===== Racimo modular — acento de marca en la cabecera de docs =====
   Definido una sola vez sobre .dh-tag (presente en las 11 páginas + la portada),
   así queda consistente en toda la documentación sin tocar cada HTML.
   Un solo hub verde; decorativo (pseudo-elemento, fuera del árbol de accesibilidad). */
.docs-header .dh-tag { position: relative; }
.docs-header .dh-tag::after {
  content: ""; position: absolute; left: calc(100% + 16px); top: 50%; transform: translateY(-50%);
  width: 62px; height: 34px; background: var(--racimo-header) no-repeat center / contain;
  pointer-events: none;
}
/* En pantallas medianas/chicas el encabezado se aprieta: ocultamos el racimo. */
@media (max-width: 980px) { .docs-header .dh-tag::after { display: none; } }

/* Portada de docs — racimo de marca en el hero (solo docs/index.html). */
.docs-portal { position: relative; }
.docs-portal .ph, .docs-portal .portal-block { position: relative; z-index: 1; }
.docs-portal::before {
  content: ""; position: absolute; top: 34px; right: 24px;
  width: 142px; height: 110px; background: var(--racimo-luz) no-repeat center / contain;
  pointer-events: none; z-index: 0;
}
@media (max-width: 860px) { .docs-portal::before { display: none; } }


/* ===== Capturas de pantalla en la documentación =====
   Una captura que ilustra un paso tiene que poder LEERSE: se muestra a ancho completo,
   con un borde suave que la separa del texto y un pie que dice qué se está mirando (y no
   repite el párrafo de al lado). El borde importa: sin él, una captura de fondo claro se
   confunde con la página. */
/* Red de seguridad: ninguna imagen del cuerpo puede desbordar su columna. Sin esto una
   captura se dibuja a su tamaño natural (1440px) y se monta encima del árbol de la
   derecha — que es exactamente lo que pasaba. */
.docs-content img { max-width: 100%; height: auto; }

.docs-content figure.captura { margin: 24px 0; }
/* La captura se ve al ancho de la columna (legible, no gigante) y se amplía con la lupa.
   El botón lo pone docs.js: sin JS queda la imagen sola, igual acotada. */
.docs-content figure.captura .cap-zoom {
  position: relative; display: block; width: 100%; padding: 0; cursor: zoom-in;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-sm); transition: box-shadow .15s;
}
.docs-content figure.captura .cap-zoom:hover { box-shadow: var(--shadow-md); }
.docs-content figure.captura .cap-zoom:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.docs-content figure.captura img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface);
}
.docs-content figure.captura .cap-zoom img { border: 0; border-radius: 0; }
.cap-lupa {
  position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; font-family: var(--font-body); font-size: 12px; font-weight: 600;
  color: #fff; background: rgba(24, 26, 33, .78); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
.cap-zoom:hover .cap-lupa, .cap-zoom:focus-visible .cap-lupa { opacity: 1; }
@media (hover: none) { .cap-lupa { opacity: 1; } }
.docs-content figure.captura figcaption {
  margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.5;
}
.docs-content figure.captura figcaption strong { color: var(--ink-2); font-weight: 600; }

/* Visor: la captura a tamaño real sobre el resto de la página. */
.cap-visor {
  position: fixed; inset: 0; z-index: 90; display: none;
  align-items: center; justify-content: center; padding: 28px;
  background: rgba(18, 19, 26, .82);
}
.cap-visor.abierto { display: flex; }
.cap-visor-caja { max-width: 1200px; width: 100%; max-height: 100%; display: flex; flex-direction: column; gap: 12px; }
.cap-visor img {
  display: block; max-width: 100%; max-height: calc(100vh - 140px); margin: 0 auto;
  border-radius: 10px; background: var(--surface); box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.cap-visor figcaption, .cap-visor .cap-pie { color: rgba(255,255,255,.86); font-size: 13.5px; line-height: 1.5; text-align: center; }
.cap-visor .cap-pie strong { color: #fff; font-weight: 600; }
.cap-visor .cap-cerrar {
  position: absolute; top: 16px; right: 18px; width: 40px; height: 40px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.24);
}
.cap-visor .cap-cerrar:hover { background: rgba(255,255,255,.24); }
body.cap-abierto { overflow: hidden; }
@media (max-width: 620px) { .cap-visor { padding: 14px; } .cap-visor img { max-height: calc(100vh - 120px); } }

/* Portal: la base y los módulos instalables son dos bloques distintos a propósito */
.portal-block + .portal-block { margin-top: 40px; }
.portal-sec { font-size: 13px; letter-spacing: .09em; text-transform: uppercase; color: var(--teal-dark);
  margin: 0 0 4px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.portal-sec-nota { font-size: 14px; color: var(--muted); margin: 10px 0 18px; max-width: 62ch; }
.portal-card .pc-chip { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--teal-dark); background: #F3EFFE;
  border-radius: 999px; padding: 3px 9px; }

/* Encabezado de docs en celular: el rótulo y los dos enlaces secundarios aprietan
   la barra a 390px. Se dejan la marca y el botón Entrar, que es lo accionable. */
@media (max-width: 620px) {
  .docs-header-inner { gap: 10px; padding: 0 14px; }
  .docs-header .dh-tag { display: none; }
  .docs-header .dh-right a:not(.btn) { display: none; }
  .docs-portal { padding: 32px 16px 64px; }
  .docs-portal .ph h1 { font-size: 30px; }
  .docs-portal .ph p { font-size: 16px; }
  .portal-card { padding: 18px; }
}
