/*!
 * EdFactura API
 *
 * Copyright (c) 2026 LISANDRO ANTONIO NUNEZ MARTE.
 * Nombre comercial: ALUTECS SERVICES.
 * Todos los derechos reservados.
 *
 * Este software es confidencial y propietario. Queda estrictamente
 * prohibida su reproducción, distribución o modificación sin la
 * autorización previa y por escrito de su titular.
 */
/* =====================================================================
   EdFactura API — sistema de diseño
   Tokens en :root; modo oscuro por preferencia del sistema o data-theme.
   Sin estilos en línea.
   ===================================================================== */

/* Fuentes alojadas en el sitio (SIL Open Font License 1.1; licencias en assets/fonts/*-OFL.txt).
   Variables: un archivo por subconjunto cubre todos los pesos. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/inter-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("../fonts/jetbrainsmono-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("../fonts/jetbrainsmono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f0f3f8;
  --surface-3: #e7ecf3;
  --border: #e2e7ef;
  --border-strong: #cfd7e3;
  --text: #0e1726;
  --text-2: #334155;
  --muted: #64748b;
  --primary: #10a15a;
  --primary-hover: #0c8a4c;
  --primary-soft: #e3f6ec;
  --primary-text: #0b7a43;
  /* Botón primario con contraste AA (≥ 4.5:1) */
  --btn-primary: #0b7a43;
  --btn-primary-hover: #096338;
  --on-primary: #ffffff;
  --on-danger: #ffffff;
  --accent: #0ea5e9;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --warning: #b45309;
  --warning-soft: #fdf3e2;
  --info-soft: #e6f4fd;
  --code-bg: #0b1220;
  --code-border: #1c2638;
  --code-text: #d7e0ee;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 6px 24px -8px rgba(15, 23, 42, .14), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 64px -24px rgba(15, 23, 42, .28);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --container: 1180px;
  --header-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080c14;
    --surface: #0f1622;
    --surface-2: #141d2c;
    --surface-3: #1b2638;
    --border: #1f2a3c;
    --border-strong: #2b3a52;
    --text: #e8edf5;
    --text-2: #c3cddb;
    --muted: #8b97aa;
    --primary: #22c872;
    --primary-hover: #34d884;
    --primary-soft: rgba(34, 200, 114, .12);
    --primary-text: #4fe095;
    --btn-primary: #22c872;
    --btn-primary-hover: #34d884;
    --on-primary: #04210f;
    --on-danger: #2a0707;
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, .12);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, .1);
    --info-soft: rgba(14, 165, 233, .12);
    --code-bg: #060a12;
    --code-border: #1a2436;
    --shadow: 0 6px 24px -8px rgba(0, 0, 0, .6), 0 1px 3px rgba(0, 0, 0, .4);
    --shadow-lg: 0 24px 64px -24px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #080c14;
  --surface: #0f1622;
  --surface-2: #141d2c;
  --surface-3: #1b2638;
  --border: #1f2a3c;
  --border-strong: #2b3a52;
  --text: #e8edf5;
  --text-2: #c3cddb;
  --muted: #8b97aa;
  --primary: #22c872;
  --primary-hover: #34d884;
  --primary-soft: rgba(34, 200, 114, .12);
  --primary-text: #4fe095;
  --btn-primary: #22c872;
  --btn-primary-hover: #34d884;
  --on-primary: #04210f;
  --on-danger: #2a0707;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, .1);
  --info-soft: rgba(14, 165, 233, .12);
  --code-bg: #060a12;
  --code-border: #1a2436;
  --shadow: 0 6px 24px -8px rgba(0, 0, 0, .6), 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-lg: 0 24px 64px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -.035em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; color: var(--text-2); }
code, pre, kbd { font-family: var(--mono); font-size: .88em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--border); padding: .1em .4em; border-radius: 6px; color: var(--text); word-break: break-word; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 1000; padding: 10px 14px; border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: var(--shadow, 0 4px 16px rgba(0,0,0,.2)); }
.skip-link:focus { left: 16px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 24px; } }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-lg { width: 22px; height: 22px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font: 600 14.5px/1 var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
  text-decoration: none !important;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--btn-primary); color: var(--on-primary); box-shadow: 0 6px 18px -8px var(--btn-primary); }
.btn-primary:hover { background: var(--btn-primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border-strong); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 15.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; }

/* ---------- Encabezado del sitio ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; height: 100%; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; font-size: 17px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; height: 28px; width: auto; }
.brand-logo-dark { display: none; }
:root[data-theme="dark"] .brand-logo-light, .auth-aside .brand-logo-light { display: none; }
:root[data-theme="dark"] .brand-logo-dark, .auth-aside .brand-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo-light { display: none; }
  :root:not([data-theme="light"]) .brand-logo-dark { display: block; }
}
.brand small { font-weight: 600; font-size: 11px; color: var(--primary-text); background: var(--primary-soft); padding: 2px 7px; border-radius: 99px; letter-spacing: 0; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav a { color: var(--text-2); font-weight: 550; font-size: 14.5px; padding: 8px 12px; border-radius: 8px; }
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.is-active { color: var(--text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; }

@media (max-width: 860px) {
  .nav, .header-actions .hide-mobile { display: none; }
  .menu-toggle { display: inline-flex; }
  .site-header.is-open .nav {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: var(--header-h); left: 0; right: 0; margin: 0;
    padding: 12px 16px 16px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .site-header.is-open .nav a { padding: 12px; }
  .site-header.is-open .nav .nav-mobile-only { display: block; }
}
.nav .nav-mobile-only { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 72px 0 56px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 720px; z-index: -1;
  background:
    radial-gradient(600px 300px at 20% 30%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 70%),
    radial-gradient(520px 280px at 85% 10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px;
  padding: 5px 12px 5px 6px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface); font-size: 13px; font-weight: 550; color: var(--text-2); box-shadow: var(--shadow-sm);
}
.eyebrow .dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); }
.eyebrow .dot::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }
.hero h1 .grad { background: linear-gradient(100deg, var(--primary), #0ea5a4 60%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.12rem; max-width: 560px; margin: 18px 0 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 36px; max-width: 560px; }
.stat { padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.stat strong { display: block; font-size: 1.35rem; font-weight: 750; letter-spacing: -.02em; color: var(--text); }
.stat span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 960px) {
  .hero { padding: 48px 0 40px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}
@media (max-width: 480px) { .hero-stats { grid-template-columns: 1fr 1fr; } .hero-stats .stat:last-child { grid-column: span 2; } }

/* ---------- Ventana de código ---------- */
.code-window {
  background: var(--code-bg); border: 1px solid var(--code-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden; color: var(--code-text); min-width: 0;
}
.code-window-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--code-border); background: rgba(255, 255, 255, .02); }
.dots { display: flex; gap: 6px; margin-right: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #334155; }
.dots i:nth-child(1) { background: #f87171; } .dots i:nth-child(2) { background: #fbbf24; } .dots i:nth-child(3) { background: #34d399; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; } /* sin desplazamiento horizontal: pasan a otra línea */
.tab {
  appearance: none; border: 0; background: transparent; color: #8b97aa; cursor: pointer;
  font: 550 12.5px/1 var(--font); padding: 7px 10px; border-radius: 7px; white-space: nowrap;
}
.tab:hover { color: #e2e8f0; }
.tab[aria-selected="true"] { background: rgba(255, 255, 255, .08); color: #fff; }
.copy-btn {
  margin-left: auto; appearance: none; border: 1px solid var(--code-border); background: transparent; color: #8b97aa;
  border-radius: 7px; padding: 5px 9px; font: 550 12px/1 var(--font); cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.copy-btn:hover { color: #fff; border-color: #334155; }
.copy-btn .i { width: 14px; height: 14px; }
.code-window pre, pre.code {
  margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 13px; line-height: 1.65; color: var(--code-text); background: var(--code-bg);
}
.code-window .panel + .panel { border-top: 1px solid var(--code-border); }
.code-label { display: flex; align-items: center; gap: 8px; padding: 8px 18px 0; font: 600 11px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: #64748b; }
.code-label .status { color: #34d399; letter-spacing: 0; text-transform: none; font-family: var(--mono); font-weight: 500; }
.code-label .status.is-error { color: #f87171; }
/* Resaltado de sintaxis (JSON y comandos) */
.tok-key { color: #7dd3fc; } .tok-str { color: #86efac; } .tok-num { color: #fca5a5; } .tok-bool { color: #c4b5fd; } .tok-null { color: #94a3b8; }
.tok-cmd { color: #f9a8d4; } .tok-flag { color: #fcd34d; } .tok-comment { color: #64748b; font-style: italic; }

/* ---------- Secciones ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin: 0 auto 44px; text-align: center; }
.section-head .kicker { display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--primary-text); margin-bottom: 10px; }
.section-head p { font-size: 1.05rem; }
@media (max-width: 720px) { .section { padding: 56px 0; } }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-sm); min-width: 0;
}
.card-hover { transition: transform .2s, box-shadow .2s, border-color .2s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.card h3 { margin-top: 14px; }
.card p:last-child { margin-bottom: 0; }
.icon-badge { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.icon-badge.muted { background: var(--surface-2); color: var(--muted); }
.card > .tag { position: absolute; top: 20px; right: 20px; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; font: 650 11.5px/1 var(--font);
  padding: 5px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap;
}
.tag-success { background: var(--primary-soft); color: var(--primary-text); border-color: transparent; }
.tag-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.tag-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.tag-mono { font-family: var(--mono); font-weight: 500; }

.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); font-size: 14.5px; }
.check-list .i { color: var(--primary); margin-top: 3px; width: 16px; height: 16px; stroke-width: 2.4; }

/* Pasos */
.steps { counter-reset: step; }
.step { padding-left: 0; }
.step-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; background: var(--text); color: var(--bg); margin-bottom: 14px; font-size: 14px; }

/* Precios */
.pricing { align-items: stretch; }
.plan { display: flex; flex-direction: column; }
.plan.is-featured { border: 2px solid var(--primary); box-shadow: var(--shadow); }
.plan .price { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 2px; color: var(--text); }
.plan .price small { font-size: .95rem; font-weight: 550; color: var(--muted); letter-spacing: 0; }
.plan .check-list { margin: 20px 0 24px; flex: 1; }

/* FAQ */
.faq { max-width: 780px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 20px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 18px; margin: 0; }

/* CTA final */
.cta-band {
  border-radius: var(--radius-lg); padding: 48px 32px; text-align: center; color: #fff;
  background: radial-gradient(500px 200px at 20% 0%, rgba(255, 255, 255, .18), transparent), linear-gradient(120deg, #0b7a43, #0e8f8e);
}
.cta-band h2, .cta-band p { color: #fff; }
.cta-band .btn-secondary { background: #fff; color: #0b3b25; border-color: #fff; }

/* Pie */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 40px; font-size: 14px; color: var(--muted); }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer a { color: var(--muted); }
.site-footer-contact { margin-top: 6px; }
.error-contact { margin-top: 18px; font-size: 14px; }
.error-ref { font-size: 14px; color: var(--muted); }

/* ---------- Formularios ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-weight: 600; font-size: 13.5px; color: var(--text); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field .error { font-size: 12.5px; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: 400 14.5px var(--font); transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 14px; resize: vertical; font-family: var(--mono); font-size: 13px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.input.is-invalid { border-color: var(--danger); }
.input-group { position: relative; }
.input-group .input { padding-right: 44px; }
.input-group .btn-icon { position: absolute; right: 3px; top: 3px; width: 38px; height: 38px; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); cursor: pointer; }
.checkbox input { width: 17px; height: 17px; margin-top: 3px; accent-color: var(--primary); flex: none; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 18px; border: 1px solid transparent; }
.alert .i { margin-top: 2px; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--primary-soft); color: var(--primary-text); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-info { background: var(--info-soft); color: var(--text-2); }
.alert ul { margin: 0; padding-left: 18px; }

/* ---------- Autenticación ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-aside {
  position: relative; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; color: #e8edf5; overflow: hidden;
  background: radial-gradient(520px 320px at 10% 10%, rgba(34, 200, 114, .28), transparent 70%), radial-gradient(420px 300px at 90% 90%, rgba(14, 165, 233, .22), transparent 70%), #07101c;
}
.auth-aside .brand { color: #fff; }
.auth-aside h2 { color: #fff; font-size: 2rem; max-width: 420px; }
.auth-aside p { color: #a9b5c8; max-width: 420px; }
.auth-aside .check-list li { color: #cbd5e1; }
.auth-aside .code-window { margin-top: 28px; max-width: 460px; }
.auth-main { display: grid; place-items: center; padding: 40px 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.8rem; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 28px; }
.auth-card .alt { margin-top: 22px; text-align: center; font-size: 14px; color: var(--muted); }
.auth-mobile-brand { display: none; margin-bottom: 28px; }
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .auth-mobile-brand { display: inline-flex; }
}

/* ---------- Panel (app) ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--border);
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(127, 127, 127, .22) transparent; /* fina y casi transparente */
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(127, 127, 127, .22); border-radius: 6px; }
.sidebar:hover::-webkit-scrollbar-thumb { background: rgba(127, 127, 127, .38); }
.sidebar .brand { padding: 6px 8px 18px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a, .side-nav button {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; color: var(--text-2);
  font: 550 14px/1.2 var(--font); border: 0; background: transparent; width: 100%; cursor: pointer; text-align: left;
}
.side-nav a:hover, .side-nav button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-nav a.is-active { background: var(--primary-soft); color: var(--primary-text); }
.side-nav .nav-count { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--warning); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.side-label { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 6px; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--primary-soft); color: var(--primary-text); flex: none; }
.user-chip .meta { min-width: 0; }
.user-chip strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .meta span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.app-main { min-width: 0; }
.app-top {
  position: sticky; top: 0; z-index: 20; height: var(--header-h); display: flex; align-items: center; gap: 12px;
  padding: 0 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.app-top h1 { font-size: 1.15rem; margin: 0; letter-spacing: -.01em; font-weight: 700; }
.app-top .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.app-content { padding: 28px; max-width: 1200px; }
.app-menu-toggle { display: none; }
@media (max-width: 920px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .app.is-open .sidebar { transform: none; }
  .app-menu-toggle { display: inline-flex; }
  .app-top { padding: 0 16px; }
  .app-content { padding: 20px 16px; }
}
.backdrop { display: none; }
@media (max-width: 920px) { .app.is-open .backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(2, 6, 23, .5); } }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpis { grid-template-columns: minmax(0, 1fr); } }
.kpi { padding: 18px 20px; }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 550; display: flex; align-items: center; gap: 8px; }
.kpi .value { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; margin-top: 6px; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: .9rem; color: var(--muted); font-weight: 550; }
.bar-track { height: 7px; border-radius: 99px; background: var(--surface-3); margin-top: 12px; overflow: hidden; }
.bar-track svg { width: 100%; height: 100%; }
.bar-track rect { fill: var(--primary); }
.bar-track.is-warning rect { fill: var(--warning); }
.bar-track.is-danger rect { fill: var(--danger); }

.panel-card { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 1rem; margin: 0; letter-spacing: -.01em; }
.panel-head .actions { margin-left: auto; display: flex; gap: 8px; }
.panel-body { padding: 20px; }

.chart { width: 100%; height: 190px; }
.chart .bar { fill: var(--primary); opacity: .85; }
.chart .bar-err { fill: var(--danger); opacity: .85; }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.chart text { fill: var(--muted); font: 500 10.5px var(--font); }
.chart-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); padding: 0 20px 16px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--primary); }
.chart-legend i.err { background: var(--danger); }

.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 11px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 20px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .mono { font-family: var(--mono); font-size: 12.5px; }
.table tr.is-revoked td { opacity: .55; }
.key-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; } /* en la tabla, siempre en una fila */
/* Datos secundarios de la llave: líneas cortas que hacen salto, sin ensanchar la columna Nombre */
.table td.key-code, .table td.nowrap { white-space: nowrap; overflow-wrap: normal; } /* llaves, importes y fechas no se parten */
.key-meta { display: block; max-width: 22rem; font-size: 13.5px; line-height: 1.45; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .icon-badge { margin: 0 auto 14px; }

.method { display: inline-block; font: 700 11px/1 var(--mono); padding: 5px 7px; border-radius: 6px; letter-spacing: .02em; }
.method-get { background: rgba(14, 165, 233, .14); color: #0284c7; }
.method-post { background: var(--primary-soft); color: var(--primary-text); }
.method-put { background: var(--warning-soft); color: var(--warning); }
.method-delete { background: var(--danger-soft); color: var(--danger); }
:root[data-theme="dark"] .method-get { color: #7dd3fc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .method-get { color: #7dd3fc; } }
.status-code { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.status-code.ok { color: var(--primary-text); } .status-code.err { color: var(--danger); }

.key-reveal { border: 1px solid var(--primary); background: var(--primary-soft); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; }
.key-reveal h3 { margin: 0 0 4px; font-size: 1rem; }
.key-reveal p { margin: 0 0 12px; font-size: 14px; }
.key-box { display: flex; align-items: center; gap: 8px; background: var(--code-bg); border-radius: 10px; padding: 6px 6px 6px 14px; }
.key-box code { flex: 1; min-width: 0; color: #86efac; background: none; border: 0; padding: 0; font-size: 13.5px; overflow-x: auto; white-space: nowrap; }

.scope-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.scope-option:hover { border-color: var(--border-strong); }
.scope-option input { accent-color: var(--primary); width: 17px; height: 17px; margin-top: 2px; }
.scope-option code { font-size: 12.5px; }
.scope-option span { display: block; font-size: 13px; color: var(--muted); }

details.advanced { border: 1px dashed var(--border-strong); border-radius: 10px; padding: 0 14px; margin-bottom: 16px; }
details.advanced summary { cursor: pointer; padding: 12px 0; font-weight: 600; font-size: 14px; color: var(--text-2); }
details.advanced[open] { padding-bottom: 4px; }

.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .layout-2 { grid-template-columns: minmax(0, 1fr); } }

/* Playground */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; }
.segmented button { appearance: none; border: 0; background: transparent; padding: 8px 12px; border-radius: 8px; font: 600 13.5px var(--font); color: var(--text-2); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.play-form { display: flex; gap: 10px; margin-top: 16px; }
.play-form .input { font-family: var(--mono); }
/* Pantallas angostas: el botón Enviar siempre al final (después de los campos extra de NCF / e-CF);
   720 px es el mismo punto en que esos campos pasan a una columna */
@media (max-width: 720px) {
  .play-form-wrap { display: flex; flex-direction: column; }
  .play-form { display: contents; }
  .play-form-wrap .play-field { order: 1; margin-top: 16px; }
  .play-form-wrap .play-extra { order: 2; }
  .play-form-wrap .play-form > .btn { order: 3; margin-top: 12px; }
}
.play-field { position: relative; flex: 1; min-width: 0; }
.play-field .input { width: 100%; }
.play-suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; margin: 0; padding: 4px; list-style: none; max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
.play-suggest[hidden] { display: none; }
.play-suggest li { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.play-suggest li code { font-family: var(--mono); font-size: 13px; color: var(--muted); flex-shrink: 0; }
.play-suggest li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-suggest li[aria-selected="true"], .play-suggest li:hover { background: var(--surface-2); }
.play-suggest .empty { color: var(--muted); cursor: default; }
pre[data-play-output] { max-height: 560px; overflow: auto; }
.play-meta { display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--muted); }

/* ---------- Documentación ---------- */
.docs { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; padding: 36px 0 60px; }
.container.docs { padding-left: 16px; padding-right: 16px; } /* el margen lateral de .container (en pantallas estrechas el texto tocaba el borde) */
.docs-nav { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; font-size: 14px; }
.docs-nav h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 22px 0 8px; }
.docs-nav h4:first-child { margin-top: 0; }
.docs-nav a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 7px; color: var(--text-2); border-left: 2px solid transparent; }
.docs-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.docs-nav a.is-active { color: var(--primary-text); background: var(--primary-soft); }
.docs-nav .method { font-size: 9.5px; padding: 3px 5px; }
.docs-content { min-width: 0; max-width: 860px; }
.docs-content > section { padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid var(--border); }
.docs-content > section:last-child { border-bottom: 0; }
.docs-content h2 { font-size: 1.6rem; }
.docs-content .docs-title { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 750; }
.docs-content h3 { margin-top: 26px; }
.docs-content ul, .docs-content ol { color: var(--text-2); padding-left: 20px; }
.docs-content li { margin-bottom: 6px; }
.endpoint-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-family: var(--mono); font-size: 14px; word-break: break-all; }
.endpoint-head .tag { margin-left: auto; font-family: var(--font); }
.docs-content .table-wrap { border: 1px solid var(--border); border-radius: var(--radius); margin: 12px 0 20px; background: var(--surface); }
.docs-content .table td, .docs-content .table th { padding: 10px 14px; }
.docs-content .code-window { margin: 12px 0 20px; box-shadow: none; }
@media (max-width: 960px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 20px; }
  .docs-nav { position: static; max-height: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface); }
}

/* Página de error */
.error-page { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 60px 16px; }
.error-page .code { font-size: 5rem; font-weight: 800; letter-spacing: -.05em; color: var(--border-strong); line-height: 1; }

/* Página de estado */
.status-banner { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; margin: 24px 0 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.status-banner strong { display: block; font-size: 1.05rem; color: var(--text); margin-bottom: 4px; }
.status-banner.is-ok { border-color: transparent; background: var(--primary-soft); }
.status-banner.is-down { border-color: transparent; background: var(--danger-soft); }
.status-dot { flex: none; width: 12px; height: 12px; margin-top: 6px; border-radius: 50%; background: var(--primary); }
.status-banner.is-down .status-dot { background: var(--danger); }
.status-list { list-style: none; margin: 0 0 8px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.status-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 13px 16px; border-top: 1px solid var(--border); }
.status-list li:first-child { border-top: 0; }
.status-name { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-weight: 550; color: var(--text); }
.status-page .meta-grid { margin-bottom: 20px; }
@media (max-width: 560px) { .status-page .meta-grid { grid-template-columns: minmax(0, 1fr); } }

/* Texto legal */
.prose { max-width: 760px; margin: 0 auto; padding: 48px 16px 32px; } /* con margen lateral: en pantallas estrechas el texto tocaba el borde */
.prose h2 { font-size: 1.25rem; margin-top: 32px; }
.prose li { color: var(--text-2); margin-bottom: 6px; }

.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mb-3 { margin-bottom: 24px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-center { justify-content: center; }
.spacer { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Cuentas, roles y ambientes ---------- */
.account-switch { display: grid; gap: 6px; padding: 0 8px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.account-switch .label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.account-switch .select { height: 38px; font-size: 13.5px; padding: 0 10px; }
.account-name { font-weight: 650; font-size: 14px; }
.admin-badge { display: inline-flex; align-items: center; gap: 8px; margin: 0 8px 14px; padding: 6px 10px; border-radius: 8px; background: var(--warning-soft); color: var(--warning); font-weight: 650; font-size: 13px; }
.admin-badge .i { width: 16px; height: 16px; }
.tag-env-sandbox { background: var(--info-soft); color: #0369a1; border-color: transparent; }
.tag-env-production { background: var(--primary-soft); color: var(--primary-text); border-color: transparent; }
:root[data-theme="dark"] .tag-env-sandbox { color: #7dd3fc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag-env-sandbox { color: #7dd3fc; } }
.env-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.env-choice label { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 13px; color: var(--muted); }
.env-choice label strong { display: block; color: var(--text); font-size: 14px; }
.env-choice input { accent-color: var(--primary); margin-top: 3px; }
.env-choice label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form .select { height: 34px; width: auto; font-size: 13px; padding: 0 8px; }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--muted); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.filters .input { max-width: 320px; height: 38px; }
.filters .select { width: auto; height: 38px; }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--text); }
.play-extra { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
@media (max-width: 720px) { .play-extra { grid-template-columns: minmax(0, 1fr); } .env-choice { grid-template-columns: minmax(0, 1fr); } .dl { grid-template-columns: minmax(0, 1fr); } }
.play-extra[hidden] { display: none; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }

/* ---------- Seguridad: 2FA, bloqueo, sesiones ---------- */
.text-danger { color: var(--danger); }
kbd { font-family: var(--mono); font-size: .82em; padding: .1em .45em; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); color: var(--text); }
.input-code { font-family: var(--mono); letter-spacing: .18em; font-size: 16px; max-width: 220px; }
/* Código de verificación en casillas (partials/otp + app.js [data-otp]); sin JS queda el campo .input-code */
.otp { display: grid; gap: 8px; min-width: 0; }
.otp-cells { display: flex; gap: 8px; max-width: 336px; }
.otp-cells[hidden] { display: none; }
.otp-cell { flex: 1 1 0; min-width: 0; width: 100%; height: 52px; padding: 0; text-align: center; font-family: var(--mono); font-size: 22px; font-weight: 600; }
.otp-cell:nth-child(3) { margin-right: 8px; }
.otp-cell.is-filled { border-color: var(--primary); }
.otp-switch { justify-self: start; padding: 0; border: 0; background: none; color: var(--primary-text); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.otp-switch:hover { color: var(--text); }
.row > .otp, .row .otp { flex: 0 1 336px; }
/* Segundo paso del inicio de sesión */
.auth-step { margin-bottom: 22px; }
.auth-step .icon-badge-lg { margin-bottom: 16px; }
.auth-step .sub { margin-bottom: 0; }
.icon-badge-lg { width: 52px; height: 52px; border-radius: 14px; }
.auth-step-form .otp-cells { max-width: none; }
.auth-step-form .otp-cell { height: 58px; font-size: 24px; }
.auth-step-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 14px; }
.auth-step-foot form { display: flex; align-items: center; gap: 6px; }
.codes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.codes-grid code { display: block; text-align: center; padding: 8px; font-size: 14px; background: var(--surface); border: 1px solid var(--border); }
.tfa-setup { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 8px; }
.tfa-setup img { width: 200px; height: 200px; border-radius: 10px; background: #fff; padding: 6px; border: 1px solid var(--border); }
.steps-list { padding-left: 18px; margin: 0 0 14px; color: var(--text-2); }
.steps-list li { margin-bottom: 6px; }
.copyable { user-select: all; }
.lock-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.lock-head h1 { margin: 0; }
.avatar-lg { width: 56px; height: 56px; font-size: 22px; }
.narrow-card { max-width: 460px; margin: 20px auto; }
.stack { display: grid; gap: 10px; }
.dl-compact { grid-template-columns: 110px 1fr; }
@media (max-width: 620px) { .tfa-setup { grid-template-columns: minmax(0, 1fr); } .codes-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Documentación interactiva ---------- */
.docs-search { position: relative; display: flex; align-items: center; margin-bottom: 14px; }
.docs-search .i { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.docs-search input { width: 100%; height: 38px; padding: 0 34px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 400 14px var(--font); }
.docs-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.docs-search kbd { position: absolute; right: 8px; font-size: 11px; }
.docs-empty { font-size: 13px; color: var(--muted); padding: 4px 10px; }
.docs-nav a[hidden], .docs-nav h4[hidden] { display: none; }
.docs-quick { margin-top: 20px; }
.docs-quick .card { color: var(--text); text-decoration: none; padding: 18px; }
.docs-quick .card h3 { font-size: 1rem; margin-top: 10px; }
.docs-quick .card p { font-size: 13.5px; }
.anchor { margin-left: 8px; font-size: .75em; color: var(--muted); opacity: 0; text-decoration: none; transition: opacity .15s; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; text-decoration: none; }
.table-filter { max-width: 420px; margin: 4px 0 4px; height: 38px; }
.try { margin: -8px 0 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.try > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-weight: 600; font-size: 14px; color: var(--primary-text); }
.try > summary::-webkit-details-marker { display: none; }
.try[open] > summary { border-bottom: 1px solid var(--border); }
.try-body { padding: 16px; }
.try-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; }
.try-grid .input { height: 38px; font-family: var(--mono); font-size: 13px; }
.try-url { font-size: 12.5px; word-break: break-all; }
.try .code-window { margin: 12px 0 0; }

/* Ventana modal (<dialog>): edición sin desplazar la tabla */
.modal { width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.modal::backdrop { background: rgba(7, 16, 28, .55); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal > form { padding: 16px 20px; }
.modal fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.modal legend { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.modal-danger { border-top: 1px solid var(--border); }
.btn-danger-solid { background: var(--danger); color: var(--on-danger); border-color: transparent; }
.btn-danger-solid:hover { filter: brightness(.95); }
/* Confirmación (reemplaza window.confirm) */
.modal.modal-confirm { width: min(440px, calc(100vw - 32px)); }
.modal-confirm-body { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px 6px; }
.modal-confirm-body p { margin: 0; color: var(--text-2); line-height: 1.55; }
.modal-confirm-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); }
.modal-confirm.is-danger .modal-confirm-icon { background: var(--danger-soft); color: var(--danger); }
.modal-confirm-actions { padding: 14px 20px 18px; }
.small { font-size: 12.5px; }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions form, .key-actions form { display: inline-flex; margin: 0; }
.btn-action { border-radius: 8px; justify-content: center; }
.btn-action .i { margin: 0; }

/* Tablas responsive: cuando la tarjeta es angosta (móvil o columna lateral) cada fila
   se muestra como una ficha con etiquetas, en lugar de desplazarse horizontalmente.
   Las etiquetas (data-label) las pone app.js desde el encabezado de la tabla. */
.table-wrap { container-type: inline-size; overflow-x: visible; }
.table td, .table th { overflow-wrap: anywhere; }
@container (max-width: 620px) {
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table tr:last-child { border-bottom: 0; }
  .table td { display: grid; grid-template-columns: minmax(84px, 34%) minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 5px 0 !important; border: 0 !important; text-align: left; white-space: normal; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; padding-top: 2px; }
  .table td:not([data-label])::before, .table td[data-label=""]::before { content: none; }
  .table td > .btn, .table td > .tag { justify-self: start; } /* ancho natural, no estirados */
  .table td:not([data-label]), .table td[data-label=""] { grid-template-columns: minmax(0, 1fr); }
  .table td.num { text-align: left; }
  .table .cell-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
  .table .key-actions { justify-content: flex-start; flex-wrap: wrap; }
}


/* Integraciones (SDK) */
.m-0 { margin: 0; }
.code-window-bar .code-title { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.sdk-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
[data-tab-panel] > h3 { margin: 26px 0 10px; font-size: 16px; }

/* Documentación completa dentro del panel (/app/docs) */
.docs.docs-in-panel { padding: 0 0 40px; gap: 32px; grid-template-columns: 250px minmax(0, 1fr); }
.docs-in-panel .docs-nav { top: 16px; max-height: calc(100vh - 32px); }
@media (max-width: 1200px) {
  .docs.docs-in-panel { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .docs-in-panel .docs-nav { position: static; max-height: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface); }
}
/* Pestañas sobre fondo claro (tarjetas del panel) */
.panel-card > .panel-head .tab { color: var(--text-2); }
.panel-card > .panel-head .tab:hover { color: var(--text); background: var(--surface-2); }
.panel-card > .panel-head .tab[aria-selected="true"] { color: var(--primary-text); background: var(--primary-soft); }

/* Formulario de API key (crear / editar) */
.key-form { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.key-form-side { position: sticky; top: 16px; }
.module-scopes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.module-scope-edf { grid-column: 1 / -1; }
.module-scope-edf .access-grid { margin-top: 12px; }
.module-scope { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 0; min-width: 0; }
.module-scope-head { display: flex; gap: 12px; align-items: flex-start; }
.module-scope-head > span:last-child { display: grid; gap: 2px; }
.module-scope-head .muted { font-size: 13px; line-height: 1.4; }
.module-scope-head .icon-badge { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.module-scope-options { display: grid; gap: 8px; margin-top: 10px; }
.module-scope-options .scope-option div { display: grid; gap: 3px; }
@media (max-width: 960px) {
  .key-form { grid-template-columns: minmax(0, 1fr); }
  .key-form-side { position: static; }
}
.scope-option .tag { display: inline-flex; width: fit-content; font-size: 11.5px; }
[data-tab-panel] .code-window + .code-window { margin-top: 10px; }
.sdk-capabilities { gap: 8px 28px; margin-bottom: 14px; }
.pagination-actions { display: inline-flex; gap: 8px; }
@media (max-width: 560px) { .pagination { flex-wrap: wrap; justify-content: space-between; padding: 12px 14px; } }

/* Sin desplazamiento horizontal: el código se ajusta */
pre, pre.code, .code-window pre { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; overflow-x: hidden; }
/* Botones con texto largo: nunca más anchos que su contenedor; el texto pasa a otra línea */
.btn { max-width: 100%; }
@media (max-width: 560px) {
  .btn { white-space: normal; height: auto; min-height: 42px; padding-top: 9px; padding-bottom: 9px; line-height: 1.25; text-align: center; }
  .row > form, .row > .btn { max-width: 100%; }
}
/* Pestañas internas por framework (Integraciones) */
.fw-tabs { margin-top: 10px; }
.fw-tablist { gap: 6px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; margin-bottom: 12px; }
.fw-tablist .tab { color: var(--text-2); }
.fw-tablist .tab:hover { color: var(--text); background: var(--surface); }
.fw-tablist .tab[aria-selected="true"] { background: var(--surface); color: var(--primary-text); box-shadow: var(--shadow-sm); }
.try-body-field { grid-column: 1 / -1; }
.try-body-field textarea { font-size: 12.5px; white-space: pre; }

/* Código largo (comandos, URL) que debe partirse en vez de desbordar */
code.wrap { white-space: normal; overflow-wrap: anywhere; }
.checkbox.indent { padding-left: 27px; }
/* Botón de acción de tabla (solo ícono): mismo tamaño también en móvil */
.btn.btn-action { width: 32px; height: 32px; min-height: 32px; padding: 0; flex: none; }
/* Modo de ambiente del panel (Sandbox / Producción) */
.env-switch { padding: 3px; flex-wrap: nowrap; } /* nunca en dos líneas, aunque el título sea largo */
.env-switch button { padding: 6px 10px; font-size: 13px; }
.env-banner { padding: 7px 24px; font-size: 13px; border-bottom: 1px solid var(--border); }
.env-banner-sandbox { background: var(--warning-soft); color: var(--warning); }
.env-banner-production { background: var(--primary-soft); color: var(--primary-text); }
@media (max-width: 720px) { .env-banner { padding: 7px 16px; } .env-switch button { padding: 6px 8px; } }
/* Celdas con texto largo (nombres, rutas): se parten en vez de desbordar la tabla */
.table td.cell-wrap { white-space: normal; overflow-wrap: anywhere; min-width: 12rem; }
/* Filtros de la página Peticiones */
.filters .field { margin: 0; display: grid; gap: 4px; }
.filters .field label { font-size: 12px; color: var(--muted); }
.filters-actions { display: flex; gap: 8px; align-items: flex-end; }
.inline-filter { display: inline-flex; gap: 6px; align-items: center; }
.input.input-sm { height: 32px; padding: 4px 10px; font-size: 13px; width: auto; }
/* Datos de prueba del modo sandbox */
/* Modal ancho de solo lectura (detalle de una petición) */
.modal.modal-wide { width: min(620px, calc(100vw - 32px)); }
.modal-body { padding: 16px 20px; display: grid; gap: 14px; }
/* Ficha de administración: cabecera con acciones, indicadores con nota y pestañas con contador */
.entity-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; padding: 20px 24px; margin-bottom: 20px; }
.entity-head-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.entity-head h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.01em; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.entity-head p { margin: 4px 0 0; font-size: 14px; }
.entity-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kpi .sub { margin-top: 8px; font-size: 13px; color: var(--muted); }
.tabs-lg .tab { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; padding: 9px 12px; border-radius: 9px; }
.tab-count { font: 650 11.5px/1 var(--font); padding: 3px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.tab[aria-selected="true"] .tab-count { background: var(--surface); color: var(--primary-text); }
.modal.modal-xl { width: min(760px, calc(100vw - 32px)); }
.panel-card[data-tabs] > .panel-head { flex-wrap: wrap; }
/* Detalle de un registro (auditoría): acción destacada, ficha de datos y tabla de cambios */
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.record-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.record-title code { font-size: 14px; font-weight: 600; padding: 6px 11px; border: 0; border-radius: 8px; background: var(--primary-soft); color: var(--primary-text); }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.meta-grid dt { margin-bottom: 3px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.meta-grid dd { margin: 0; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
@media (max-width: 520px) { .meta-grid { grid-template-columns: minmax(0, 1fr); } }
.section-label { margin: 0 0 8px; font-size: 13.5px; font-weight: 650; color: var(--text); }
.table-boxed { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.table-compact th { padding: 8px 14px; }
.table-compact td { padding: 9px 14px; font-size: 13.5px; vertical-align: top; }
.table-boxed + .hint { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
/* Desplazamiento dentro de una ventana modal: barra fina y casi invisible, sin carril */
.modal, .modal pre { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 28%, transparent) transparent; }
.diff-old, .diff-new { display: inline-block; padding: 2px 7px; border-radius: 6px; font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.diff-old { background: var(--danger-soft); color: var(--danger); text-decoration: line-through; }
.diff-new { background: var(--primary-soft); color: var(--primary-text); }
.entity-head h2 .tag { align-self: center; }
/* Negocios de EdFactura vinculados (panel del cliente) */
.empty-card { text-align: center; padding: 40px 24px; }
.empty-card .icon-badge { margin: 0 auto 14px; }
.empty-card h3 { margin: 0 0 6px; }
.empty-card p { max-width: 560px; margin: 0 auto 18px; }
.link-card { display: grid; gap: 16px; align-content: start; }
.link-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.link-card-head h3 { margin: 0; font-size: 1.05rem; }
.link-card-head p { margin: 4px 0 0; font-size: 13.5px; }
.link-card .label { display: block; margin-bottom: 6px; }
.link-card-actions { padding-top: 14px; border-top: 1px solid var(--border); }
.link-card-actions form { margin: 0; }
.scope-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.scope-chips .small { width: 100%; }
.scope-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
@media (max-width: 340px) { .scope-row { grid-template-columns: minmax(0, 1fr); } }
.scope-row:last-child { border-bottom: 0; }
.scope-row-checks { display: inline-flex; gap: 6px; }
.scope-row-all { padding-top: 2px; font-size: 13px; }
/* Selector de permisos de EdFactura: casillas como píldoras; la de grupo marca/desmarca la columna */
.pill-check { position: relative; display: inline-flex; cursor: pointer; }
.pill-check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pill-check span, .pill-toggle { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 500; line-height: 1; white-space: nowrap; user-select: none; transition: background-color .12s, border-color .12s, color .12s; }
.pill-check span::before, .pill-toggle::before { content: ''; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .55; }
.pill-check:hover span, .pill-toggle:hover { border-color: var(--primary); }
.pill-check input:checked + span, .pill-toggle[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); }
.pill-check input:checked + span::before, .pill-toggle[aria-pressed="true"]::before { background: currentColor; opacity: 1; }
.pill-toggle[aria-pressed="mixed"] { border-color: var(--primary); border-style: dashed; color: var(--primary-text); }
.pill-toggle[aria-pressed="mixed"]::before { background: linear-gradient(90deg, currentColor 50%, transparent 50%); opacity: 1; }
.pill-toggle { cursor: pointer; }
.pill-check input:focus-visible + span, .pill-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.scope-picker-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-top: 16px; }
.scope-picker-bar p { font-size: 13px; }
.scope-presets { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 560px) { .scope-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; } .scope-presets .btn { padding: 0 6px; white-space: normal; line-height: 1.15; } }
.scope-picker-foot { position: sticky; bottom: -1px; justify-content: space-between; align-items: center; margin-top: 14px; padding: 12px 0 2px; background: var(--surface); border-top: 1px solid var(--border); }
.scope-picker-foot [data-scope-empty] { color: var(--danger); }
/* Formulario en rejilla con grupos (ficha de cuenta → Acceso y límites) */
.access-grid { gap: 14px; margin-top: 14px; }
.access-grid fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 14px; margin: 0; min-width: 0; display: grid; gap: 8px; align-content: start; }
.access-grid legend { padding: 0 6px; font-weight: 600; font-size: 13.5px; color: var(--text); }
.access-grid .field { margin-bottom: 0; }
/* Módulos de EdFactura en Planes y en Acceso y límites: plegables, agrupados */
.edf-modules { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.edf-modules > summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 2px 0; }
.edf-modules[open] > summary { margin-bottom: 6px; }
.edf-modules .hint { margin: 0 0 6px; }
.edf-modules-group { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; display: grid; gap: 4px; }
.edf-modules-all span { font-weight: 600; }
.access-grid .edf-modules-group { border: 0; border-radius: 0; padding: 0; gap: 4px; }
.access-grid .access-edf { grid-column: 1 / -1; }
.access-edf .edf-modules { border: 0; padding: 0; }
.access-edf .edf-modules > summary { font-weight: 400; }
.edf-modules-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 18px; margin-top: 4px; }
.edf-modules-group legend, .edf-modules-label { display: block; padding: 0; margin: 6px 0 2px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dl.dl-compact { grid-template-columns: 130px minmax(0, 1fr); gap: 10px 16px; align-items: baseline; }
@media (max-width: 560px) { .dl.dl-compact { grid-template-columns: minmax(0, 1fr); gap: 2px 0; } .dl.dl-compact dd { margin-bottom: 8px; } }
.test-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.test-list li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13.5px; }
.test-list .btn.mono { font-family: var(--mono); }
/* Página Datos de prueba */
.steps-list { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); }
.qr-list li { align-items: flex-start; }
.qr-list .qr-url { height: auto; white-space: normal; text-align: left; word-break: break-all; line-height: 1.45; padding-top: 4px; padding-bottom: 4px; }
/* Playground: endpoints agrupados por módulo y campos por tipo (JSON / archivo TXT) */
/* Playground: listado vertical de APIs con buscador (escritorio) o selector desplegable (pantallas angostas) */
.play-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 560px; }
.play-nav { border-right: 1px solid var(--border); padding: 16px 12px; min-width: 0; position: relative; }
/* El índice ocupa el alto de la columna (el del formulario y su respuesta) y se desplaza por dentro */
.play-nav-panel { position: absolute; inset: 16px 12px; display: flex; flex-direction: column; }
.play-nav-toggle { display: none; }
.play-nav-search { position: relative; margin-bottom: 6px; }
.play-nav-search .i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.play-nav-search .input { width: 100%; padding-left: 32px; }
.play-nav-groups { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.play-idem { display: flex; gap: 6px; }
.play-idem .input { flex: 1 1 auto; min-width: 0; }
.play-idem .btn { flex: none; border: 1px solid var(--border-strong); }
.play-edf-fields .field[data-play-edf-idem] { grid-column: span 2; }
@media (max-width: 560px) { .play-edf-fields .field[data-play-edf-idem] { grid-column: auto; } }
.play-nav-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.play-nav-group[hidden], .play-nav-group li[hidden] { display: none; }
.play-nav-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: var(--radius-sm); }
.play-nav-group > summary::-webkit-details-marker { display: none; }
.play-nav-group > summary:hover { background: var(--surface-2); }
.play-nav-group[open] > summary { margin-bottom: 4px; }
.play-group-title { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--text-2); }
.play-group-title .i { width: 15px; height: 15px; flex: none; color: var(--primary-text); }
.play-nav-group + .play-nav-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.play-nav-item .method { flex: none; font-size: 9.5px; padding: 3px 5px; min-width: 34px; text-align: center; }
.play-nav-note { display: flex; gap: 8px; margin: 12px 4px 4px; padding: 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-2); }
.play-nav-note .i { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--muted); }
.play-edf { display: grid; gap: 4px; margin-top: 16px; }
.play-edf[hidden], .play-edf .field[hidden], .play-edf-title[hidden] { display: none; }
.play-edf-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 12px; }
.play-edf-fields .field { margin: 0 0 10px; display: grid; gap: 4px; min-width: 0; }
.play-edf-fields label, .play-edf-fields .label { font-size: 13px; color: var(--text-2); }
.play-edf-fields .input { width: 100%; font-size: 13px; }
.play-edf-title { margin: 4px 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.play-nav-item { display: flex; align-items: center; gap: 8px; appearance: none; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: var(--radius-sm); font: 500 14px var(--font); color: var(--text-2); cursor: pointer; }
.play-nav-item:hover, .play-nav-item:focus-visible { background: var(--surface-2); color: var(--text); }
.play-nav-item[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary-text); font-weight: 650; }
.play-nav-empty { margin: 10px; font-size: 13.5px; }
.play-main { min-width: 0; }
.play-main .code-window { margin: 0 20px 20px; box-shadow: none; }
@media (max-width: 1024px) {
  .play-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .play-nav-panel { position: static; }
  .play-nav-groups { max-height: 60vh; }
  .play-nav { border-right: 0; padding: 16px 20px 0; position: relative; }
  .play-nav-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: 600 14.5px var(--font); cursor: pointer; text-align: left; }
  .play-nav-toggle .i { flex: none; transition: transform .15s; }
  .play-nav-toggle[aria-expanded="true"] .i { transform: rotate(180deg); }
  .play-nav-panel { display: none; margin-top: 6px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm); }
  .play-nav.is-open .play-nav-panel { display: block; }
  .play-nav-groups { max-height: 55vh; }
}
.play-json, .play-fmt { display: grid; gap: 6px; margin-top: 16px; }
.play-json[hidden], .play-fmt[hidden], .play-field[hidden] { display: none; }
.play-json label, .play-fmt label { font-size: 13px; color: var(--text-2); }
.play-json textarea, .play-fmt textarea { font-family: var(--mono); font-size: 13px; min-height: 160px; resize: vertical; }
.play-fmt-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.play-fmt-row .field { margin: 0; display: grid; gap: 4px; }
.play-fmt-row .checkbox[hidden] { display: none; }

/* ---------- Documentación: índice plegable y ficha de cada endpoint ---------- */
.dn-group, .dn-sub { border: 0; margin: 0; }
.dn-group[hidden], .dn-sub[hidden] { display: none; }
.dn-group > summary, .dn-sub > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-radius: 8px; }
.dn-group > summary::-webkit-details-marker, .dn-sub > summary::-webkit-details-marker { display: none; }
.dn-group > summary:hover, .dn-sub > summary:hover { background: var(--surface-2); }
.dn-group > summary { padding: 8px 10px; margin-bottom: 3px; line-height: 18px; font-weight: 650; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }
.dn-group > summary::after, .dn-sub > summary::after { content: ""; flex: none; width: 7px; height: 7px; margin-left: 2px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.dn-group[open] > summary::after, .dn-sub[open] > summary::after { transform: rotate(45deg); }
.dn-group > summary .dn-count, .dn-sub > summary .dn-count { margin-left: auto; }
.dn-group[open] > summary { border-color: var(--border-strong); }
.dn-group > :not(summary) { margin-left: 10px; padding-left: 8px; border-left: 2px solid var(--border); }
.dn-group[open] > summary { color: var(--text); }
.dn-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.dn-title .i { width: 15px; height: 15px; flex: none; color: var(--primary-text); }
.dn-sub { margin-left: 6px; }
.dn-sub > summary { font-size: 13.5px; font-weight: 600; color: var(--text-2); padding: 7px 8px; }
.dn-sub[open] > summary { color: var(--primary-text); }
.dn-sub a { margin-left: 6px; font-size: 13.5px; }
/* Opciones del índice con el mismo estilo que las del playground (.play-nav-item) */
.docs-nav a { padding: 7px 10px; border-radius: var(--radius-sm); border-left: 0; font: 500 14px var(--font); }
.docs-nav a.is-active { font-weight: 650; }
.docs-nav a .method { flex: none; min-width: 34px; text-align: center; }
.dn-count { flex: none; font: 650 11px/1 var(--font); padding: 3px 7px; border-radius: 99px; background: var(--primary-soft); color: var(--muted); letter-spacing: 0; text-transform: none; }
.docs-nav h4 { padding: 0 8px; }
.docs-nav { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; } /* el índice se distingue del fondo de la página */
.docs-crumb { font-size: 13.5px; color: var(--muted); margin: 0 0 10px; }
.ep-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.ep-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: 99px; font-size: 13.5px; color: var(--text-2); background: var(--surface); }
.ep-chip:hover { border-color: var(--primary); color: var(--primary-text); text-decoration: none; }
.ep-chip span { font-size: 11px; color: var(--muted); }
.ep { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 8px; scroll-margin-top: calc(var(--header-h) + 16px); }
.docs-in-panel .ep { scroll-margin-top: 16px; }
.ep > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 14px; flex-wrap: wrap; border-radius: 12px; }
.ep > summary::-webkit-details-marker { display: none; }
.ep > summary:hover { background: var(--surface-2); }
.ep > summary .method { flex: none; min-width: 52px; text-align: center; }
.ep-path { font-size: 13px; background: none; border: 0; padding: 0; overflow-wrap: anywhere; color: var(--text); }
.ep-title { color: var(--muted); font-size: 13.5px; margin-left: auto; text-align: right; }
.ep-chev { flex: none; width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.ep[open] { border-color: var(--border-strong); }
.ep[open] > summary { border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0; }
.ep[open] .ep-chev { transform: rotate(180deg); }
.ep-body { padding: 14px 16px 6px; min-width: 0; }
.ep-body > p:first-child { margin-top: 0; }
.ep-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; color: var(--text-2); margin: 4px 0 14px; }
.ep-meta code { overflow-wrap: anywhere; }
.ep-tabs { margin-bottom: 6px; background: var(--surface-2); padding: 4px; border-radius: 11px; width: fit-content; max-width: 100%; }
.ep-tabs .tab { color: var(--text-2); }
.ep-tabs .tab:hover { color: var(--text); }
.ep-tabs .tab[aria-selected="true"] { background: var(--surface); color: var(--primary-text); box-shadow: var(--shadow-sm); }
.docs-content .ep-h { margin: 16px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ep-table td { vertical-align: top; }
.ep-table td:first-child { min-width: 150px; max-width: 290px; white-space: normal; overflow-wrap: normal; word-break: normal; } /* varios campos en una fila se parten por sus espacios; un nombre solo, nunca */
.ep-table td:nth-child(2) { overflow-wrap: normal; word-break: normal; } /* el tipo se parte por sus espacios, no por letras */
.ep-notes { font-size: 14px; margin-top: 8px; }
.ep-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.ep-cat { border: 1px solid var(--border); border-radius: 10px; margin: 8px 0; padding: 0 12px; }
.ep-cat > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding: 10px 0; font-size: 13.5px; color: var(--text-2); }
.ep-rules { margin: 18px 0 6px; }
.ep-rules h3 { margin-top: 0; }
.ep-rules .check-list { margin: 12px 0; }
.ep .try { margin: 0 0 14px; }
@media (max-width: 760px) {
  .ep-title { margin-left: 0; flex-basis: 100%; text-align: left; order: 3; }
  .ep-chev { margin-left: auto; }
  .ep-table td:first-child { white-space: normal; }
  .ep-body { padding: 12px 12px 4px; }
}
.docs-top { position: fixed; right: 24px; bottom: 24px; z-index: 30; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 99px; background: var(--surface); color: var(--text-2); font: 600 13.5px var(--font); box-shadow: var(--shadow-sm); cursor: pointer; }
.docs-top:hover, .docs-top:focus-visible { color: var(--primary-text); border-color: var(--primary); }
.docs-top[hidden] { display: none; }
.docs-top .i { width: 16px; height: 16px; transform: rotate(180deg); }
@media (max-width: 760px) { .docs-top { right: 16px; bottom: 16px; padding: 0; width: 40px; justify-content: center; } .docs-top span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
