/* ============================================================================
   Pushfy Docs — tema enterprise (tokens alinhados ao design system do V2).
   Vanilla, sem libs pesadas. Light/Dark. Prefixo .dx-
   ========================================================================== */
:root {
  --accent: #4979FF; --accent-2: #6f9bff;
  --grad: linear-gradient(135deg, #4979FF 0%, #6f9bff 100%);
  --font: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --side-w: 268px; --toc-w: 220px; --top-h: 58px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --ease: cubic-bezier(.16,1,.3,1);
}
:root[data-theme="light"] {
  --bg: #ffffff; --bg-2: #f6f7fb; --surface: #ffffff; --surface-2: #f1f3f8;
  --text: #171a23; --muted: #626a7a; --border: #e6e8f0;
  --code-bg: #0f172a; --code-text: #e2e8f0; --accent-weak: rgba(73,121,255,.09);
  --shadow: 0 10px 30px rgba(16,24,40,.10);
}
:root[data-theme="dark"] {
  --bg: #0b0e15; --bg-2: #090b11; --surface: #11141d; --surface-2: #181d29;
  --text: #e7e9f1; --muted: #98a0b3; --border: #232838;
  --code-bg: #0a0d14; --code-text: #e2e8f0; --accent-weak: rgba(73,121,255,.16);
  --shadow: 0 12px 34px rgba(0,0,0,.45);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
kbd { font-family: var(--mono); font-size: .72em; background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--muted); }

/* ---- Topbar ---- */
.dx-top { position: sticky; top: 0; z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 14px;
  padding: 0 18px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border); }
.dx-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); font-size: 1.02rem; }
.dx-brand:hover { text-decoration: none; }
.dx-logo { width: 26px; height: 26px; border-radius: 7px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem; box-shadow: 0 4px 12px rgba(73,121,255,.4); }
.dx-brand-sub { color: var(--muted); font-weight: 500; }
.dx-search-open { margin-left: 10px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); border-radius: var(--r-pill,999px); padding: 7px 12px; font: inherit; font-size: .85rem; cursor: pointer; min-width: 210px; }
.dx-search-open:hover { border-color: var(--accent); }
.dx-search-open kbd { margin-left: auto; }
.dx-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.dx-icon-btn { background: transparent; border: 1px solid transparent; color: var(--text); border-radius: var(--r-sm); padding: 6px 9px; cursor: pointer; font: inherit; display: inline-flex; align-items: center; gap: 5px; }
.dx-icon-btn:hover { background: var(--surface-2); }
.dx-app-link { display: inline-flex; align-items: center; gap: 6px; background: var(--grad); color: #fff; padding: 7px 14px; border-radius: var(--r-sm); font-size: .85rem; font-weight: 600; }
.dx-app-link:hover { text-decoration: none; filter: brightness(1.05); }
.dx-burger { display: none; }
.dx-lang { position: relative; }
.dx-lang-menu { position: absolute; right: 0; top: 110%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 6px; display: none; min-width: 160px; z-index: 50; }
.dx-lang-menu.open { display: block; }
.dx-lang-menu a { display: block; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text); font-size: .88rem; cursor: pointer; }
.dx-lang-menu a:hover { background: var(--surface-2); text-decoration: none; }

/* ---- Shell / layout ---- */
.dx-shell { display: grid; grid-template-columns: var(--side-w) minmax(0,1fr) var(--toc-w); max-width: 1440px; margin: 0 auto; }
.dx-side { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 20px 10px 40px 18px; border-right: 1px solid var(--border); }
.dx-nav-group { margin: 16px 0 4px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 10px; }
.dx-nav a { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: var(--r-sm); color: var(--muted); font-size: .88rem; margin: 1px 0; }
.dx-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.dx-nav a.active { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.dx-nav a i { font-size: .95rem; width: 16px; }

/* ---- Main / article ---- */
.dx-main { min-width: 0; padding: 26px 44px 60px; }
.dx-crumbs { font-size: .8rem; color: var(--muted); margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.dx-crumbs a { color: var(--muted); }
.dx-article { max-width: 780px; }
.dx-article h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 8px; line-height: 1.15; }
.dx-article h2 { font-size: 1.3rem; font-weight: 700; margin: 38px 0 12px; letter-spacing: -.01em; scroll-margin-top: calc(var(--top-h) + 16px); }
.dx-article h3 { font-size: 1.05rem; font-weight: 700; margin: 26px 0 8px; scroll-margin-top: calc(var(--top-h) + 16px); }
.dx-article p, .dx-article li { color: var(--text); }
.dx-article .lead { font-size: 1.12rem; color: var(--muted); margin: 0 0 22px; }
.dx-article ul, .dx-article ol { padding-left: 22px; }
.dx-article li { margin: 5px 0; }
.dx-article code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.dx-article hr { border: 0; border-top: 1px solid var(--border); margin: 34px 0; }
.dx-article table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .88rem; display: block; overflow-x: auto; }
.dx-article th { text-align: left; font-weight: 700; padding: 9px 11px; border-bottom: 2px solid var(--border); color: var(--muted); white-space: nowrap; }
.dx-article td { padding: 9px 11px; border-bottom: 1px solid var(--border); vertical-align: top; }
.dx-article td code { white-space: nowrap; }

/* Hero (home) */
.dx-hero { background: linear-gradient(135deg, var(--accent-weak), transparent 70%); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 34px 32px; margin-bottom: 26px; }
.dx-hero h1 { margin: 0 0 10px; }
.dx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 14px; margin: 18px 0; }
.dx-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; transition: transform var(--ease) .2s, border-color .2s, box-shadow .2s; color: var(--text); }
.dx-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: var(--shadow); text-decoration: none; }
.dx-card .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-weak); color: var(--accent); display: grid; place-items: center; font-size: 1.2rem; margin-bottom: 10px; }
.dx-card b { display: block; margin-bottom: 3px; }
.dx-card span { color: var(--muted); font-size: .85rem; }

/* Callouts */
.dx-note { border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--accent-weak); border-radius: var(--r-md); padding: 12px 16px; margin: 16px 0; font-size: .9rem; }
.dx-note.warn { border-left-color: #d9870a; background: rgba(217,135,10,.10); }
.dx-note.danger { border-left-color: #e0383b; background: rgba(224,56,59,.10); }
.dx-note.ok { border-left-color: #12b76a; background: rgba(18,183,106,.10); }
.dx-note b { display: block; margin-bottom: 2px; }

/* Code blocks + tabs */
.dx-code { background: var(--code-bg); border-radius: var(--r-md); margin: 16px 0; overflow: hidden; border: 1px solid var(--border); }
.dx-code-tabs { display: flex; gap: 2px; background: rgba(255,255,255,.04); padding: 6px 8px 0; overflow-x: auto; }
.dx-code-tabs button { background: transparent; border: 0; color: #94a3b8; font: inherit; font-size: .78rem; font-weight: 600; padding: 6px 12px; border-radius: 7px 7px 0 0; cursor: pointer; white-space: nowrap; }
.dx-code-tabs button.active { color: #fff; background: rgba(255,255,255,.08); }
.dx-code-body { position: relative; }
.dx-code pre { margin: 0; padding: 15px 16px; overflow-x: auto; font-family: var(--mono); font-size: .82rem; line-height: 1.6; color: var(--code-text); }
.dx-code pre[hidden] { display: none; }
.dx-code .cp { color: #c084fc; } .dx-code .cs { color: #86efac; } .dx-code .cc { color: #64748b; } .dx-code .cn { color: #fbbf24; }
.dx-copy { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #cbd5e1; border-radius: 6px; padding: 4px 9px; font: inherit; font-size: .74rem; cursor: pointer; }
.dx-copy:hover { background: rgba(255,255,255,.16); }
.dx-copy.done { color: #86efac; border-color: #12b76a; }

/* method pills / endpoint */
.dx-ep { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 14px; margin: 14px 0; font-family: var(--mono); font-size: .84rem; overflow-x: auto; }
.dx-m { font-weight: 700; padding: 2px 8px; border-radius: 5px; color: #fff; font-size: .72rem; letter-spacing: .04em; }
.dx-m.get { background: #12b76a; } .dx-m.post { background: #4979FF; } .dx-m.put { background: #d9870a; } .dx-m.del { background: #e0383b; }

/* prev/next */
.dx-prevnext { display: flex; gap: 14px; margin: 40px 0 10px; max-width: 780px; }
.dx-prevnext a { flex: 1; border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; color: var(--text); }
.dx-prevnext a:hover { border-color: var(--accent); text-decoration: none; }
.dx-prevnext a.nx { text-align: right; }
.dx-prevnext small { color: var(--muted); display: block; }
.dx-prevnext b { color: var(--accent); }
.dx-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: .82rem; max-width: 780px; }

/* TOC */
.dx-toc { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 26px 16px; font-size: .82rem; }
.dx-toc .t { font-weight: 700; text-transform: uppercase; font-size: .7rem; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.dx-toc a { display: block; padding: 3px 10px; color: var(--muted); border-left: 2px solid var(--border); }
.dx-toc a.h3 { padding-left: 22px; }
.dx-toc a:hover { color: var(--text); text-decoration: none; }
.dx-toc a.active { color: var(--accent); border-left-color: var(--accent); }

/* Search modal */
.dx-search-modal { position: fixed; inset: 0; z-index: 100; background: rgba(9,11,17,.5); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.dx-search-modal[hidden] { display: none; }  /* o atributo hidden precisa vencer o display:flex acima */
.dx-search-box { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.dx-search-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.dx-search-in input { flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 1rem; outline: none; }
.dx-search-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.dx-search-results a { display: block; padding: 10px 12px; border-radius: var(--r-sm); color: var(--text); }
.dx-search-results a:hover, .dx-search-results a.sel { background: var(--surface-2); text-decoration: none; }
.dx-search-results .g { font-size: .72rem; color: var(--muted); }
.dx-search-results .h { font-weight: 600; }
.dx-search-empty { padding: 22px; text-align: center; color: var(--muted); }
.dx-loading { color: var(--muted); padding: 40px 0; }
.dx-side-scrim { display: none; }

/* Responsive */
@media (max-width: 1080px) { .dx-shell { grid-template-columns: var(--side-w) minmax(0,1fr); } .dx-toc { display: none; } }
@media (max-width: 860px) {
  .dx-shell { grid-template-columns: 1fr; }
  .dx-search-open { display: none; }
  .dx-burger { display: inline-flex; }
  .dx-app-link span, .dx-brand-sub { display: none; }
  .dx-side { position: fixed; top: var(--top-h); left: 0; width: 280px; background: var(--surface); z-index: 60; transform: translateX(-100%); transition: transform var(--ease) .25s; }
  .dx-side.open { transform: none; }
  .dx-side-scrim.open { display: block; position: fixed; inset: var(--top-h) 0 0; background: rgba(0,0,0,.4); z-index: 55; }
  .dx-main { padding: 20px 18px 50px; }
  .dx-article h1 { font-size: 1.6rem; }
}

/* Diagramas (SVG inline, theme-aware) */
.dx-diagram { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; margin: 16px 0; overflow-x: auto; }
.dx-diagram svg { display: block; min-width: 640px; }

/* ---- Submenu de endpoints na sidebar (children do nav.js) ----
   Só é renderizado para a página ativa (docs.js), então a barra não cresce
   para quem está em outra seção. */
.dx-nav-sub { margin: 2px 0 6px 14px; padding-left: 8px; border-left: 1px solid var(--border); }
.dx-nav a.sub { padding: 4px 8px; font-size: .81rem; gap: 6px; }
.dx-nav a.sub .dx-nav-sub-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-nav a.sub.active { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.dx-nav-m { font-size: .6rem; font-weight: 700; letter-spacing: .04em; padding: 1px 4px; border-radius: 4px; flex: none; min-width: 30px; text-align: center; }
.dx-nav-m.get { background: rgba(34,153,84,.14); color: #2e9e5b; }
.dx-nav-m.post { background: rgba(73,121,255,.14); color: var(--accent); }
