/* Portal do desenvolvedor BIX — developer.appbix.com.br
   Paleta da marca (static/core/css/brand.css): azul escuro #0d276b, azul brilhante #0052ff.
   Tema claro/escuro por [data-theme] no <html>; todas as cores são tokens daqui. */

:root, [data-theme="light"] {
    --bg: #ffffff;
    --bg-soft: #f6f8fc;
    --bg-sunken: #eef2f9;
    --surface: #ffffff;
    --border: #e3e8f2;
    --border-strong: #cfd7e6;
    --text: #1b2437;
    --text-soft: #4a5572;
    --text-muted: #6b7690;
    --brand: #0d276b;
    --accent: #0052ff;
    --accent-soft: #e8efff;
    --accent-text: #0047db;
    --code-bg: #0f1a33;
    --code-text: #e4ebfa;
    --code-muted: #8d9bbd;
    --inline-code-bg: #eef2fb;
    --get: #0f9d58;
    --post: #0052ff;
    --put: #b26a00;
    --patch: #8a4fd8;
    --delete: #d93025;
    --ok: #0f9d58;
    --warn: #b26a00;
    --err: #d93025;
    --shadow: 0 1px 2px rgba(13, 39, 107, .06), 0 8px 24px rgba(13, 39, 107, .06);
    --logo-filter: none;
}

[data-theme="dark"] {
    --bg: #0b1222;
    --bg-soft: #0f182c;
    --bg-sunken: #131e36;
    --surface: #111b31;
    --border: #1e2a45;
    --border-strong: #2a3a5c;
    --text: #e6ecf8;
    --text-soft: #b7c2da;
    --text-muted: #8b98b6;
    --brand: #9db8ff;
    --accent: #5b8cff;
    --accent-soft: #16244a;
    --accent-text: #8fb0ff;
    --code-bg: #070d1b;
    --code-text: #dfe7f8;
    --code-muted: #7f8db0;
    --inline-code-bg: #182545;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --logo-filter: brightness(0) invert(1);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 76px; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font: 16px/1.65 "Nunito", -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace; }
[hidden] { display: none !important; }

/* ── Topo ───────────────────────────────────────────────────────────────── */
.topbar {
    position: sticky; top: 0; z-index: 40; height: 64px; display: flex; align-items: center; gap: 16px;
    padding: 0 20px; background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none !important; }
.brand-logo { height: 26px; width: auto; filter: var(--logo-filter); }
.brand-sep { width: 1px; height: 22px; background: var(--border-strong); }
.brand-text { font-weight: 800; letter-spacing: .01em; color: var(--brand); }
.topnav { display: flex; gap: 4px; margin-left: 12px; }
.topnav a { padding: 8px 12px; border-radius: 8px; color: var(--text-soft); font-weight: 700; font-size: 15px; }
.topnav a:hover { background: var(--bg-sunken); text-decoration: none; color: var(--text); }
.topnav a.active { color: var(--accent-text); background: var(--accent-soft); }
.search-trigger {
    margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 220px; height: 38px;
    padding: 0 10px 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft);
    color: var(--text-muted); font: inherit; font-size: 14px; cursor: pointer;
}
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger kbd, .search-input-wrap kbd {
    margin-left: auto; font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-muted);
}
.icon-btn {
    width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px;
    border: 1px solid transparent; background: transparent; color: var(--text-soft); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-sunken); }
[data-theme="light"] .icon-moon, [data-theme="dark"] .icon-sun { display: none; }
.menu-toggle { display: none; }

/* ── Estrutura ──────────────────────────────────────────────────────────── */
.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr) 220px; max-width: 1480px; margin: 0 auto; }
.layout-home { grid-template-columns: 272px minmax(0, 1fr); }
.layout-reference { grid-template-columns: 272px minmax(0, 1fr); }
.sidebar {
    position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; padding: 24px 16px 40px 20px;
    border-right: 1px solid var(--border);
}
.nav-section + .nav-section { margin-top: 22px; }
.nav-title {
    font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted);
    padding: 0 10px 6px;
}
.nav-link { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text-soft); font-size: 15px; }
.nav-link:hover { background: var(--bg-sunken); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.content { min-width: 0; padding: 36px 48px 24px; }
.toc { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; padding: 36px 20px 24px 8px; font-size: 14px; }
.toc-title { font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 8px; }
.toc a { display: block; padding: 4px 0 4px 12px; color: var(--text-muted); border-left: 2px solid var(--border); }
.toc a.toc-sub { padding-left: 24px; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--accent-text); border-left-color: var(--accent); }
.footer {
    margin-top: 64px; padding: 20px 0; border-top: 1px solid var(--border); display: flex; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; color: var(--text-muted); font-size: 14px;
}

/* ── Home ───────────────────────────────────────────────────────────────── */
.hero {
    position: relative; padding: 40px 40px 36px; border-radius: 20px; overflow: hidden; color: #fff;
    background: radial-gradient(1200px 400px at 90% -20%, rgba(0, 82, 255, .55), transparent 60%),
                linear-gradient(135deg, #0d276b 0%, #0a1f57 60%, #08183f 100%);
}
.hero-eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #9fbaff; }
.hero h1 { font-size: 40px; line-height: 1.15; margin: 10px 0 12px; max-width: 760px; }
.hero-lead { font-size: 18px; color: #d6e1ff; max-width: 680px; margin: 0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 22px; }
.btn {
    display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border-radius: 12px; font-weight: 800;
    font-size: 15px; text-decoration: none !important;
}
.btn-primary { background: #fff; color: #0d276b; }
.btn-primary:hover { background: #e8efff; }
.btn-ghost { color: #fff; border: 1px solid rgba(255, 255, 255, .35); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.hero-start {
    display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.6fr); gap: 20px; align-items: center;
    padding: 18px 20px; border-radius: 14px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16);
}
.hero-start-head { display: flex; gap: 14px; align-items: center; color: #fff; text-decoration: none !important; }
.hero-start-head .card-icon { margin: 0; flex: none; background: rgba(255, 255, 255, .12); }
.hero-start-head .card-icon::after { background: #fff; }
.hero-start-title { font-weight: 800; font-size: 18px; }
.hero-start-head p { margin: 2px 0 0; color: #c9d6f5; font-size: 14px; }
.hero-start-head:hover .hero-start-title { text-decoration: underline; }
.hero-start-links { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-start-links a {
    padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #e4ebfa;
    background: rgba(4, 10, 28, .45); border: 1px solid rgba(255, 255, 255, .12); text-decoration: none !important;
}
.hero-start-links a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.tok-c { color: #8d9bbd; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 28px; }
.card {
    display: block; padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
    color: var(--text); box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease;
}
a.card:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.card p { margin: 6px 0 0; color: var(--text-soft); font-size: 15px; }
.card-title { font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-accent { background: linear-gradient(180deg, var(--accent-soft), var(--surface)); }
.card-icon {
    width: 40px; height: 40px; border-radius: 12px; margin-bottom: 14px; background: var(--accent-soft);
    -webkit-mask-repeat: no-repeat; position: relative;
}
.card-icon::after {
    content: ""; position: absolute; inset: 9px; background: var(--accent);
    -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
.card-icon-rocket { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2c4 2 6 6 6 10l-3 3H9l-3-3c0-4 2-8 6-10zm0 6a2 2 0 100 4 2 2 0 000-4zM8 17l-2 5 4-2m6-3l2 5-4-2'/%3E%3C/svg%3E"); }
.card-icon-database { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cellipse cx='12' cy='5' rx='8' ry='3'/%3E%3Cpath d='M4 5v14c0 1.7 3.6 3 8 3s8-1.3 8-3V5c0 1.7-3.6 3-8 3S4 6.7 4 5zm0 7c0 1.7 3.6 3 8 3s8-1.3 8-3'/%3E%3C/svg%3E"); }
.card-icon-clipboard { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 2h6v3H9zM6 4h2v3h8V4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2zm2 9l2 2 5-5 1.4 1.4L10 17.8 6.6 14.4z'/%3E%3C/svg%3E"); }
.card-icon-shelf { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h2v18H3zm16 0h2v18h-2zM5 10h14v2H5zm0 8h14v2H5zM7 5h3v5H7zm5 2h3v3h-3zM7 13h4v5H7z'/%3E%3C/svg%3E"); }
.card-icon-calendar { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h2v2h6V2h2v2h2a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V6a2 2 0 012-2h2zm-2 8v10h14V10zm7 2h5v5h-5z'/%3E%3C/svg%3E"); }
.card-icon-boxes { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 13h8v8H3zm10 0h8v8h-8zM8 3h8v8H8z'/%3E%3C/svg%3E"); }
.card-icon-bolt { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 2L4 14h6l-1 8 9-12h-6z'/%3E%3C/svg%3E"); }
.card-icon-code { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.6 16.6L4 12l4.6-4.6L7.2 6 1.2 12l6 6zm6.8 0L20 12l-4.6-4.6L16.8 6l6 6-6 6z'/%3E%3C/svg%3E"); }
.card-icon-spark { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.2 6.8L21 11l-6.8 2.2L12 20l-2.2-6.8L3 11l6.8-2.2z'/%3E%3C/svg%3E"); }

/* ── Texto ──────────────────────────────────────────────────────────────── */
.prose { max-width: 780px; }
.breadcrumb { font-size: 13px; font-weight: 700; color: var(--accent-text); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.prose h1, .ref-title { font-size: 34px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.01em; }
.prose h2 { font-size: 24px; margin: 40px 0 12px; padding-top: 8px; letter-spacing: -.005em; }
.prose h3 { font-size: 18px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--text-soft); }
.prose strong, .prose b { color: var(--text); }
.lead { font-size: 18px; color: var(--text-soft); margin-top: 0; }
.prose :not(pre) > code, .param-facts code, .op-meta code {
    background: var(--inline-code-bg); color: var(--text); padding: 1px 6px; border-radius: 6px; font-size: .86em;
}
code.scope { color: var(--accent-text) !important; }
.prose pre, .operation-aside pre {
    background: var(--code-bg); color: var(--code-text); padding: 16px 18px; border-radius: 12px; overflow-x: auto;
    font-size: 13.5px; line-height: 1.6; position: relative;
}
.prose pre:has(.copy-inline) { padding-right: 88px; }
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 800; }
.prose blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--text-soft); }
.admonition { margin: 20px 0; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-soft); }
.admonition-title { font-weight: 800; margin: 0 0 4px; color: var(--text); }
.admonition > p:last-child { margin-bottom: 0; }
.admonition.tip, .admonition.note { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: var(--accent-soft); }
.admonition.warning, .admonition.danger { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: color-mix(in srgb, var(--warn) 9%, var(--surface)); }
.mermaid-wrap { margin: 20px 0; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow-x: auto; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; max-width: 780px; }
.pager a {
    flex: 1; display: flex; flex-direction: column; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px;
    color: var(--text); font-weight: 700; text-decoration: none !important;
}
.pager a:hover { border-color: var(--accent); }
.pager a span { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 800; }
.pager-next { text-align: right; }

/* ── Selos ──────────────────────────────────────────────────────────────── */
.method {
    display: inline-block; min-width: 54px; text-align: center; padding: 2px 8px; border-radius: 6px; font-size: 12px;
    font-weight: 800; letter-spacing: .03em; color: #fff; font-family: "JetBrains Mono", monospace;
}
.method-get { background: var(--get); }
.method-post { background: var(--post); }
.method-put { background: var(--put); }
.method-patch { background: var(--patch); }
.method-delete { background: var(--delete); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.badge-soon { background: var(--accent-soft); color: var(--accent-text); }
.badge-required { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.status { font-weight: 800; font-family: "JetBrains Mono", monospace; font-size: 13px; }
.status-2xx { color: var(--ok); }
.status-4xx { color: var(--warn); }
.status-5xx { color: var(--err); }
.op-link { display: inline-flex; align-items: center; gap: 8px; padding: 2px 10px 2px 3px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text) !important; text-decoration: none !important; vertical-align: middle; }
.op-link:hover { border-color: var(--accent); }
.op-link code { background: none !important; padding: 0 !important; }
.op-link .method { min-width: 0; font-size: 11px; }

/* ── Referência ─────────────────────────────────────────────────────────── */
.op-list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.op-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text); border-bottom: 1px solid var(--border); }
.op-row:last-child { border-bottom: 0; }
.op-row:hover { background: var(--bg-soft); text-decoration: none; }
.op-row code { background: none !important; font-weight: 600; }
.op-row-summary { margin-left: auto; color: var(--text-muted); font-size: 14px; }
.operation {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 36px; padding: 36px 0;
    border-top: 1px solid var(--border);
}
.operation:first-of-type { border-top: 0; padding-top: 16px; }
.operation-aside { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 16px; }
.op-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.op-path { font-size: 16px; font-weight: 600; background: none !important; padding: 0 !important; }
.copy-link { margin-left: auto; border: 0; background: none; color: var(--text-muted); font-size: 18px; cursor: pointer; }
.copy-link:hover { color: var(--accent-text); }
.op-summary { margin: 12px 0 4px !important; padding-top: 0 !important; font-size: 26px !important; }
.op-meta { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.params { margin: 8px 0 0; border-top: 1px solid var(--border); }
.param { padding: 14px 0; border-bottom: 1px solid var(--border); }
.param dt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.param-name { font-weight: 700; color: var(--text); background: none !important; padding: 0 !important; font-size: 15px !important; }
.param-type { font-size: 13px; color: var(--text-muted); }
.param dd { margin: 6px 0 0; }
.param dd p { margin: 0; }
.params-nested { margin: 8px 0 0 14px; padding-left: 14px; border-left: 2px solid var(--border); border-top: 0; }
.params-nested .param { padding: 10px 0; }
.param-facts { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; color: var(--text-muted); }
.notes li { margin: 4px 0; }
.code-panel { border-radius: 12px; overflow: hidden; background: var(--code-bg); border: 1px solid var(--border); }
.code-panel pre { margin: 0; border-radius: 0; max-height: 520px; }
.code-tabs { display: flex; align-items: center; gap: 2px; padding: 6px 8px; background: color-mix(in srgb, var(--code-bg) 80%, #000); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.code-tabs button, .code-label {
    border: 0; background: none; color: var(--code-muted); font: inherit; font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 8px; cursor: pointer;
}
.code-tabs button.active { color: #fff; background: rgba(255, 255, 255, .08); }
.code-label { cursor: default; display: inline-flex; gap: 8px; align-items: center; color: #dfe7f8; }
.code-tabs .copy-btn { margin-left: auto; }
.code-tabs .copy-btn:hover { color: #fff; }

/* ── Busca ──────────────────────────────────────────────────────────────── */
.search-modal { position: fixed; inset: 0; z-index: 100; }
.search-backdrop { position: absolute; inset: 0; background: rgba(5, 12, 30, .55); backdrop-filter: blur(2px); }
.search-dialog {
    position: relative; max-width: 640px; margin: 10vh auto 0; background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: 0 24px 64px rgba(0, 0, 0, .35); overflow: hidden;
}
.search-input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.search-input-wrap input { flex: 1; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 17px; }
.search-results { max-height: 60vh; overflow-y: auto; padding: 8px; }
.search-result { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.search-result:hover, .search-result.active { background: var(--accent-soft); text-decoration: none; }
.search-result-kind { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.search-result-title { font-weight: 800; }
.search-result-text { font-size: 13px; color: var(--text-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-empty { padding: 24px; text-align: center; color: var(--text-muted); }

/* ── Telas menores ──────────────────────────────────────────────────────── */
@media (max-width: 1240px) {
    .layout { grid-template-columns: 252px minmax(0, 1fr); }
    .toc { display: none; }
    .operation { grid-template-columns: minmax(0, 1fr); }
    .operation-aside { position: static; }
}
@media (max-width: 900px) {
    .menu-toggle { display: inline-flex; }
    .topnav { display: none; }
    .search-trigger { min-width: 0; }
    .search-trigger span, .search-trigger kbd { display: none; }
    .layout, .layout-home, .layout-reference { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: fixed; top: 64px; left: 0; bottom: 0; width: 280px; height: auto; z-index: 30; background: var(--bg);
        transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow);
    }
    body.menu-open .sidebar { transform: none; }
    .content { padding: 24px 16px; }
    .hero { padding: 28px 20px; border-radius: 16px; }
    .hero h1 { font-size: 28px; }
    .hero-start { grid-template-columns: minmax(0, 1fr); }
    .prose h1, .ref-title { font-size: 28px; }
    .op-row { flex-wrap: wrap; }
    .op-row-summary { margin-left: 0; width: 100%; }
    .brand-sep, .brand-text { display: none; }
}
