/* Wiki Grupo Agil */
:root {
  --grad: linear-gradient(135deg, #00c2ff 0%, #6d5dfc 55%, #c04dff 100%);
  --violet: #6d5dfc; --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}
[data-theme="light"] {
  color-scheme: light; --bg: #f6f7fb; --panel: #fff; --panel2: #f1f3f9; --line: #e3e7f1; --text: #141a2e;
  --muted: #5d6786; --link: #5a48f0; --code: #eef0f8;
  --tip: #e7f8ef; --tip-b: #22c55e; --warn: #fff6e0; --warn-b: #f59e0b; --info: #e8f1ff; --info-b: #3b82f6; --bad: #ffecec; --bad-b: #ef4444;
}
[data-theme="dark"] {
  color-scheme: dark; --bg: #080b14; --panel: #0f1527; --panel2: #141b31; --line: #222b45; --text: #e6eaf6;
  --muted: #8f99b8; --link: #9d92ff; --code: #1a2240;
  --tip: rgba(34,197,94,.1); --tip-b: #22c55e; --warn: rgba(245,158,11,.1); --warn-b: #f59e0b;
  --info: rgba(59,130,246,.12); --info-b: #3b82f6; --bad: rgba(239,68,68,.1); --bad-b: #ef4444;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 80px; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15.5px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* topo */
.top { position: sticky; top: 0; z-index: 20; height: 62px; display: flex; align-items: center; gap: 18px; padding: 0 22px;
  background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 16px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .dot { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); }
.systems { display: flex; gap: 4px; }
.systems a { padding: 6px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.systems a:hover, .systems a.on { background: var(--panel2); color: var(--text); text-decoration: none; }
.search { position: relative; margin-left: auto; width: min(360px, 40vw); }
.search input { width: 100%; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2);
  color: var(--text); font: inherit; font-size: 14px; }
.search input:focus { outline: 2px solid var(--violet); outline-offset: -1px; }
#results { position: absolute; top: 46px; right: 0; width: min(520px, 92vw); max-height: 70vh; overflow-y: auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.18); }
#results a { display: block; padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--text); }
#results a:hover, #results a.on { background: var(--panel2); text-decoration: none; }
#results small { color: var(--violet); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
#results span { display: block; color: var(--muted); font-size: 13px; }
#results mark { background: #ffe58a; color: #000; border-radius: 3px; }
#results .none { padding: 14px; color: var(--muted); }
.ibtn { border: 1px solid var(--line); background: var(--panel2); color: var(--text); width: 38px; height: 38px; border-radius: 10px;
  cursor: pointer; font-size: 17px; flex: none; }
.menu-btn { display: none; }

/* layout com menu */
body.has-nav { display: grid; grid-template-columns: 270px minmax(0, 1fr) 230px; grid-template-rows: 62px 1fr auto;
  grid-template-areas: "top top top" "side main toc" "side foot foot"; min-height: 100vh; }
.top { grid-area: top; }
.side { grid-area: side; position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto; padding: 22px 16px 40px;
  border-right: 1px solid var(--line); background: var(--panel); }
.side .sys-home { display: block; font-weight: 800; font-size: 16px; color: var(--text); padding: 6px 10px; border-radius: 9px; }
.side h4 { margin: 20px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.side li a:hover { background: var(--panel2); color: var(--text); text-decoration: none; }
.side a.on { background: var(--panel2); color: var(--text); font-weight: 650; box-shadow: inset 3px 0 0 var(--violet); }
.side-links { margin: 22px 10px 0; font-size: 13.5px; }
.main { grid-area: main; padding: 30px 48px 60px; min-width: 0; max-width: 900px; }
.toc { grid-area: toc; position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto; padding: 30px 18px; font-size: 13px; }
.toc b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 3px 0 3px 12px; color: var(--muted); }
.toc li.l3 a { padding-left: 24px; font-size: 12.5px; }
.foot { grid-area: foot; padding: 20px 48px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* conteúdo */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.doc h1 { font-size: 34px; line-height: 1.2; letter-spacing: -.6px; margin: 0 0 8px; }
.doc .lead { font-size: 18px; color: var(--muted); margin: 0 0 26px; }
.doc h2 { font-size: 23px; margin: 42px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); letter-spacing: -.3px; }
.doc h3 { font-size: 18px; margin: 28px 0 8px; }
.doc .headerlink { opacity: 0; margin-left: 8px; font-weight: 400; color: var(--muted); }
.doc h2:hover .headerlink, .doc h3:hover .headerlink { opacity: 1; }
.doc ol, .doc ul { padding-left: 24px; }
.doc li { margin: 5px 0; }
.doc ol > li::marker { font-weight: 800; color: var(--violet); }
.doc code { font-family: var(--mono); font-size: .88em; background: var(--code); padding: 2px 6px; border-radius: 6px; }
.doc pre { background: var(--code); padding: 14px 16px; border-radius: 12px; overflow-x: auto; }
.doc pre code { background: none; padding: 0; }
.doc kbd { font-family: var(--mono); font-size: 12px; padding: 2px 7px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; background: var(--panel); }
.doc table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14.5px; background: var(--panel); border-radius: 12px;
  overflow: hidden; border: 1px solid var(--line); }
.doc th, .doc td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc th { background: var(--panel2); font-size: 13px; }
.doc tr:last-child td { border-bottom: 0; }
.doc blockquote { margin: 16px 0; padding: 10px 16px; border-left: 4px solid var(--violet); background: var(--panel2); border-radius: 0 10px 10px 0; }
.doc dt { font-weight: 700; margin-top: 12px; }
.doc dd { margin: 2px 0 8px 18px; color: var(--muted); }
.admonition { margin: 18px 0; padding: 12px 16px 12px 16px; border-radius: 12px; border-left: 4px solid var(--info-b); background: var(--info); }
.admonition > p { margin: 6px 0; }
.admonition-title { font-weight: 800; margin: 0 0 4px !important; }
.admonition.dica { background: var(--tip); border-color: var(--tip-b); }
.admonition.dica .admonition-title::before { content: "💡 "; }
.admonition.atencao { background: var(--warn); border-color: var(--warn-b); }
.admonition.atencao .admonition-title::before { content: "⚠️ "; }
.admonition.importante { background: var(--bad); border-color: var(--bad-b); }
.admonition.importante .admonition-title::before { content: "❗ "; }
.admonition.nota .admonition-title::before { content: "ℹ️ "; }
.tela { display: inline-block; font-weight: 700; padding: 1px 8px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); font-size: .92em; }
.botao { display: inline-block; font-weight: 700; padding: 1px 9px; border-radius: 7px; color: #fff; background: var(--grad); font-size: .9em; }

/* cards e paginação */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 30px; }
.card { display: block; padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text); transition: .15s; }
.card:hover { transform: translateY(-2px); border-color: var(--violet); text-decoration: none; }
.card small { color: var(--violet); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
.card b { display: block; font-size: 16px; margin: 3px 0; }
.card span { color: var(--muted); font-size: 13.5px; }
.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 50px; }
.pager a { flex: 1; max-width: 48%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-weight: 650; }
.pager a:hover { border-color: var(--violet); text-decoration: none; }
.pager .next { text-align: right; margin-left: auto; }
.pager small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }

/* capa */
body.home .main { max-width: 1100px; margin: 0 auto; padding: 50px 24px 70px; }
.hero { text-align: center; margin-bottom: 40px; }
.hero h1 { font-size: clamp(32px, 5vw, 48px); letter-spacing: -1px; margin: 0 0 12px; }
.hero h1 span, .folder-name span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 18px; max-width: 640px; margin: 0 auto; }
.folders { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }
.folder { position: relative; display: block; padding: 30px 28px 24px; border-radius: 6px 22px 22px 22px; background: var(--panel);
  border: 1px solid var(--line); color: var(--text); transition: .18s; margin-top: 18px; }
.folder::before { content: ""; position: absolute; left: -1px; top: -18px; width: 42%; height: 20px; background: var(--panel);
  border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; }
.folder:hover { transform: translateY(-3px); border-color: var(--violet); box-shadow: 0 14px 40px rgba(109,93,252,.18); text-decoration: none; }
.folder-ico { font-size: 40px; }
.folder-name { font-size: 28px; font-weight: 850; letter-spacing: -.5px; margin: 6px 0; }
.folder p { color: var(--muted); margin: 0 0 16px; }
.folder-meta { font-size: 13px; font-weight: 650; color: var(--link); }
.quick { margin-top: 50px; }
.quick h2 { font-size: 22px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.quick-grid a { padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.quick-grid a:hover { border-color: var(--violet); text-decoration: none; }
.quick-grid b { display: block; }
.quick-grid span { color: var(--muted); font-size: 13.5px; }
body.home .foot { text-align: center; }

@media (max-width: 1200px) { body.has-nav { grid-template-columns: 260px minmax(0, 1fr); grid-template-areas: "top top" "side main" "side foot"; }
  .toc { display: none; } }
@media (max-width: 860px) {
  body.has-nav { display: block; }
  .menu-btn { display: inline-block; }
  .side { position: fixed; top: 62px; left: 0; width: 290px; z-index: 30; transform: translateX(-100%); transition: .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  body.nav-open .side { transform: none; }
  .systems { display: none; }
  .main { padding: 22px 18px 50px; }
  .doc h1 { font-size: 28px; }
  .brand b { display: none; }
}
@media print { .top, .side, .toc, .pager, .foot { display: none !important; } body.has-nav { display: block; } }
