/* Design: Nexus Intelligence (Stitch) — wiki/knowledge hub */
:root {
    --bg: #fbf9f8; --panel: #ffffff; --sidebar-bg: #f4f4f4;
    --line: #ededf1; --line-strong: #e5e5e5;
    --text: #333333; --text-strong: #1b1c1c; --muted: #666666;
    --brand: #004481; --brand-deep: #002e5a; --brand-hover: #00629e;
    --brand-soft: #e8f0fb; --accent: #2f7d4f; --danger: #ba1a1a; --mark: #fff2b0;
    --radius: 8px; --sidebar-w: 300px; --header-h: 60px;
    --shadow: 0 1px 2px rgba(16,38,63,.04), 0 4px 20px rgba(16,38,63,.05);
    --shadow-soft: 0 4px 20px rgba(0,0,0,.05);
    --font: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-label: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #131316; --panel: #1b1c1f; --sidebar-bg: #161619;
        --line: #2a2b30; --line-strong: #34353b;
        --text: #d9dde3; --text-strong: #f1f3f6; --muted: #9aa0aa;
        --brand: #6fa8ef; --brand-deep: #a6c8ff; --brand-hover: #99cbff;
        --brand-soft: #1a2740; --mark: #5d4d11; --shadow: 0 1px 3px rgba(0,0,0,.4); --shadow-soft: 0 4px 20px rgba(0,0,0,.35);
    }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 40; height: var(--header-h);
    display: flex; align-items: center; gap: 16px; padding: 0 18px;
    background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--brand); white-space: nowrap; text-decoration: none; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--brand-deep)); display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 800; }
.global-search { flex: 1; max-width: 620px; position: relative; margin: 0 auto; }
.global-search--placeholder { pointer-events: none; }
.global-search input { width: 100%; height: 40px; padding: 0 38px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 14px; outline: none; }
.global-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.global-search .gs-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.global-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-family: var(--font); font-size: 11px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; background: var(--panel); }
.menu-toggle { display: none; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 18px; }

.search-results { position: absolute; top: 48px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); max-height: 70vh; overflow: auto; display: none; padding: 6px; }
.search-results.open { display: block; }
.sr-meta { padding: 8px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.sr-item { display: block; padding: 10px 12px; border-radius: 9px; text-decoration: none; color: var(--text); }
.sr-item:hover, .sr-item.active { background: var(--brand-soft); }
.sr-title { font-weight: 600; font-size: 14px; color: var(--brand); }
.sr-path { font-size: 11.5px; color: var(--muted); margin: 2px 0; word-break: break-all; }
.sr-snippet { font-size: 12.5px; color: var(--text); opacity: .85; line-height: 1.45; }
.sr-empty { padding: 16px 12px; font-size: 13px; color: var(--muted); }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- User menu ---------- */
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 5px 8px; cursor: pointer; color: var(--text); }
.user-btn:hover { background: var(--bg); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.user-name { font-size: 13.5px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caret { color: var(--muted); font-size: 11px; }
.user-dropdown { position: absolute; right: 0; top: 48px; min-width: 230px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 60; }
.user-dropdown.open { display: block; }
.user-dropdown a { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 13.5px; }
.user-dropdown a:hover { background: var(--bg); }
.ud-head { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; gap: 2px; }
.ud-head span { font-size: 12px; color: var(--muted); }
.ud-logout { color: var(--danger) !important; }
.badge { display: inline-block; align-self: flex-start; margin-top: 4px; font-size: 11px; background: var(--brand-soft); color: var(--brand); padding: 1px 8px; border-radius: 999px; }
@media (min-width: 861px) { .user-name { display: inline; } }

/* ---------- Flash ---------- */
.flash { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 70; padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; }
.flash--success { background: #ecf8ef; color: #176c34; border: 1px solid #b9e4c3; }
.flash--error { background: #fff0f0; color: var(--danger); border: 1px solid #efbcbc; }
.flash--info { background: var(--brand-soft); color: var(--brand); border: 1px solid var(--line-strong); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; align-items: start; }
body.no-sidebar .layout { grid-template-columns: 1fr; }

/* ---------- Sidebar ---------- */
.sidebar { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow: auto; padding: 14px 10px 40px; border-right: 1px solid var(--line-strong); background: var(--sidebar-bg); }
.sidebar-head { padding: 4px 8px 10px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.menu-search { position: relative; margin: 0 6px 12px; }
.menu-search input { width: 100%; height: 36px; padding: 0 30px 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--bg); color: var(--text); font-size: 13px; outline: none; }
.menu-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.menu-search button { position: absolute; right: 4px; top: 4px; width: 28px; height: 28px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; border-radius: 6px; }
.menu-search button:hover { background: var(--line); }
.tree-level, .doc-list { list-style: none; margin: 0; padding: 0; }
.tree-level .tree-level, .tree-level .doc-list { padding-left: 14px; border-left: 1px solid var(--line); margin-left: 9px; }
.tree-node { margin: 1px 0; }
details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--text); padding: 6px 8px; border-radius: 8px; user-select: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary:hover { background: var(--bg); }
.folder-ico { width: 14px; height: 14px; flex: none; }
.folder-ico::before { content: "▸"; font-size: 11px; transition: transform .15s ease; display: inline-block; color: var(--muted); }
details[open] > summary .folder-ico::before { transform: rotate(90deg); }
.folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-item a { display: flex; align-items: center; gap: 7px; text-decoration: none; color: var(--text); font-size: 13px; padding: 6px 8px 6px 10px; border-radius: 8px; }
.doc-ico { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); flex: none; }
.doc-item a:hover { background: rgba(0,68,129,.06); }
.doc-item.active a { background: var(--brand-soft); color: var(--brand); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.doc-item.active .doc-ico { background: var(--brand); }
.doc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-empty-search, .empty { margin: 6px; padding: 12px; font-size: 13px; color: var(--muted); background: var(--bg); border: 1px dashed var(--line-strong); border-radius: 10px; }
.error { margin: 6px; border: 1px solid #efc8cb; background: #fff4f4; color: #9f2e38; border-radius: 10px; padding: 10px 12px; font-size: 13px; }

/* ---------- Content ---------- */
.content-wrap { display: grid; grid-template-columns: minmax(0,1fr) 240px; gap: 32px; padding: 28px 40px 80px; max-width: 1280px; }
.content-wrap.no-toc { grid-template-columns: minmax(0,1fr); }
.article-col { min-width: 0; }
.breadcrumb { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.breadcrumb span:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--line-strong); }
.breadcrumb .crumb-current { color: var(--text); font-weight: 600; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-title { font-size: 32px; line-height: 1.15; margin: 4px 0 12px; color: var(--brand-deep); font-weight: 700; letter-spacing: -0.01em; }
.page-actions { display: flex; gap: 8px; flex: none; padding-top: 8px; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.doc-meta a { color: var(--brand); text-decoration: none; word-break: break-all; }

/* TOC */
.toc-col { position: sticky; top: calc(var(--header-h) + 28px); align-self: start; max-height: calc(100vh - var(--header-h) - 60px); overflow: auto; }
.toc-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.toc-list { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc-list li a { display: block; padding: 4px 0 4px 12px; margin-left: -2px; border-left: 2px solid transparent; text-decoration: none; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.toc-list li a:hover { color: var(--text); }
.toc-list li a.active { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
.toc-list li.lvl-3 a { padding-left: 24px; font-size: 12px; }
.toc-list li.lvl-4 a { padding-left: 36px; font-size: 12px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); border-radius: 9px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--bg); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn--danger { color: var(--danger); border-color: #e6b8b8; }
.btn--danger:hover { background: #fff0f0; }
.btn--sm { padding: 5px 10px; font-size: 12.5px; }

/* ---------- Markdown ---------- */
.markdown { line-height: 1.7; color: var(--text); overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.markdown a { overflow-wrap: anywhere; word-break: break-all; }
.markdown p, .markdown li { overflow-wrap: anywhere; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 { color: var(--text); line-height: 1.3; font-weight: 700; scroll-margin-top: calc(var(--header-h) + 16px); }
.markdown h1 { font-size: 26px; margin: 32px 0 12px; }
.markdown h2 { font-size: 21px; margin: 30px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.markdown h3 { font-size: 17px; margin: 24px 0 8px; }
.markdown h4 { font-size: 15px; margin: 18px 0 6px; }
.markdown p, .markdown li, .markdown blockquote { font-size: 15px; }
.markdown ul, .markdown ol { margin: 8px 0 14px; padding-left: 26px; }
.markdown li { margin: 4px 0; }
.markdown pre { background: #0f1720; color: #f7f9fc; border-radius: 10px; padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.5; }
.markdown code { background: var(--brand-soft); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: 13px; font-family: var(--mono); }
.markdown pre code { background: transparent; border: 0; padding: 0; color: inherit; }
.markdown blockquote { margin: 14px 0; padding: 4px 16px; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 8px 8px 0; }
.markdown table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 14px; }
.markdown th, .markdown td { border: 1px solid var(--line-strong); padding: 8px 12px; text-align: left; }
.markdown th { background: var(--bg); }
.md-image { max-width: 100%; height: auto; display: block; margin: 16px 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.markdown .md-block { border-radius: 10px; padding: 12px 14px; margin: 14px 0; border: 1px solid transparent; }
.markdown .md-block.is-info { background: #eef6ff; border-color: #b8d6fb; }
.markdown .md-block.is-success { background: #ecf8ef; border-color: #b9e4c3; }
.markdown .md-block.is-warning { background: #fff7e9; border-color: #f2d4a1; }
.markdown .md-block.is-danger { background: #fff0f0; border-color: #efbcbc; }

.scroll-top { position: fixed; right: 22px; bottom: 22px; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--panel); color: var(--brand); font-size: 20px; box-shadow: var(--shadow); cursor: pointer; display: none; z-index: 30; }
.scroll-top.visible { display: inline-flex; align-items: center; justify-content: center; }
.sidebar-backdrop { display: none; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 0%, var(--brand-soft) 0, transparent 45%), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 32px 28px; }
.login-logo { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--brand-deep)); display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 800; margin: 0 auto 16px; }
.login-card h1 { text-align: center; font-size: 20px; margin: 0 0 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; padding: 10px 12px; font-size: 14px; background: var(--bg); color: var(--text); outline: none; font-family: var(--font); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.login-error { background: #fff0f0; color: var(--danger); border: 1px solid #efbcbc; border-radius: 9px; padding: 10px 12px; font-size: 13px; margin-bottom: 16px; }

/* ---------- Home ---------- */
.home { max-width: 1100px; margin: 0 auto; padding: 40px 32px 80px; }
.home-hero { text-align: center; margin-bottom: 40px; }
.home-hero h1 { font-size: 32px; margin: 0 0 8px; }
.home-hero p { color: var(--muted); font-size: 15px; margin: 0; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.home-card { display: block; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.home-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.home-card .hc-ico { font-size: 22px; }
.home-card h3 { margin: 10px 0 4px; font-size: 16px; color: var(--brand); }
.home-card p { margin: 0; font-size: 13px; color: var(--muted); }
.home-section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 36px 0 14px; }

/* ---------- Editor ---------- */
.editor-wrap { padding: 24px 32px 80px; max-width: 1280px; margin: 0 auto; }
.editor-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.editor-bar .field { margin: 0; flex: 1; min-width: 240px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.editor-pane, .preview-pane { min-width: 0; }
.editor-pane h4, .preview-pane h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 8px; }
.editor-pane textarea { width: 100%; min-height: 60vh; resize: vertical; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; border: 1px solid var(--line-strong); border-radius: 10px; padding: 14px; background: var(--panel); color: var(--text); outline: none; }
.editor-pane textarea:focus { border-color: var(--brand); }
.preview-pane .preview-box { min-height: 60vh; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; background: var(--panel); overflow: auto; overflow-wrap: anywhere; word-break: break-word; }
.editor-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.editor-foot .field { margin: 0; flex: 1; min-width: 240px; }
@media (max-width: 900px) { .editor-grid { grid-template-columns: 1fr; } }

/* ---------- Admin / tables ---------- */
.admin { padding: 28px 32px 80px; max-width: 1100px; margin: 0 auto; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.admin-head h1 { font-size: 24px; margin: 0; }
.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 11px 14px; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.table th { background: var(--bg); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.pill { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line-strong); color: var(--muted); }
.pill--admin { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.pill--on { background: #ecf8ef; color: #176c34; border-color: #b9e4c3; }
.pill--off { background: #fff0f0; color: var(--danger); border-color: #efbcbc; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card h2 { font-size: 16px; margin: 0 0 14px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { flex: 1; min-width: 160px; margin-bottom: 0; }
.checks { display: flex; gap: 16px; align-items: center; font-size: 13.5px; }
.checks label { display: flex; gap: 6px; align-items: center; color: var(--text); font-weight: 500; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 13px; }

/* history diff */
.diff { font-family: var(--mono); font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.diff .add { background: rgba(15,123,66,.14); }
.diff .del { background: rgba(192,57,43,.14); text-decoration: line-through; }

@media (max-width: 1100px) { .content-wrap { grid-template-columns: 1fr; } .toc-col { display: none; } }
@media (max-width: 860px) {
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .global-search kbd { display: none; }
    .user-name { display: none; }
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: fixed; top: var(--header-h); left: 0; bottom: 0; width: 300px; z-index: 50; transform: translateX(-100%); transition: transform .22s ease; height: calc(100vh - var(--header-h)); }
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: var(--header-h) 0 0 0; background: rgba(15,30,50,.4); z-index: 45; }
    .content-wrap, .editor-wrap, .admin, .home { padding-left: 18px; padding-right: 18px; }
    .editor-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 24px; }
}

/* ===== Nexus Intelligence — refinamentos finais ===== */
.brand .brand-text { color: var(--brand-deep); }
.brand .logo { background: var(--brand); border-radius: 6px; }
.sidebar-head, .toc-title, .menu-search input, .global-search kbd,
.breadcrumb, .pill, .badge, .table th, .doc-meta, .login-card .sub,
.home-section-title, .checks, .muted, .field label { font-family: var(--font-label); }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 { color: var(--brand-deep); }
.markdown h2 { border-bottom-color: var(--line-strong); }
.home-hero h1, .home-card h3, .admin-head h1, .card h2, .login-card h1,
.editor-pane h4, .preview-pane h4 { color: var(--brand-deep); }
.home-card h3 { color: var(--brand-deep); }
.home-card:hover { border-color: var(--brand); box-shadow: var(--shadow-soft); }
.global-search input, .menu-search input, .field input, .field select, .field textarea { border-radius: 6px; }
.global-search input:focus, .field input:focus, .field select:focus, .field textarea:focus,
.menu-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,68,129,.1); }
.pill { border-radius: 999px; }
.breadcrumb .crumb-current { color: var(--text-strong); }
.markdown blockquote { border-left-color: var(--brand); background: var(--brand-soft); font-style: italic; }
details > summary:hover { background: rgba(0,68,129,.06); }
.card, .home-card, .table { border-radius: var(--radius); }
.btn { border-radius: 6px; }

/* ===== Editor: toolbar, upload, danger zone ===== */
.editor-toolbar { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; flex-wrap: wrap; }
.upload-status { font-size: 12.5px; color: var(--muted); font-family: var(--font-label); }
.upload-status.ok { color: var(--accent); }
.upload-status.err { color: var(--danger); }
.editor-pane textarea.drop-active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,68,129,.12); background: var(--brand-soft); }
.danger-zone { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line-strong); }
.danger-zone h3 { font-size: 15px; color: var(--brand-deep); margin: 0 0 14px; }
.dz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dz-card { background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 16px 18px; }
.dz-card h4 { margin: 0 0 6px; font-size: 14px; color: var(--text-strong); }
.dz-card p { margin: 0 0 10px; }
.dz-card input[type=text] { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; padding: 9px 12px; font-size: 13.5px; background: var(--bg); color: var(--text); font-family: var(--mono); }
.dz-card input[type=text]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,68,129,.1); }
.dz-card--danger { border-color: #e6b8b8; }
@media (max-width: 900px) { .dz-grid { grid-template-columns: 1fr; } }

/* ===== Toggle switch (pré-visualização) ===== */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin-left: auto; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .2s; flex: none; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(0,68,129,.2); }
.switch-label { font-size: 13px; font-weight: 600; color: var(--text); font-family: var(--font-label); }
.editor-grid.preview-off { grid-template-columns: 1fr; }
.editor-grid.preview-off #previewPane { display: none; }

/* ===== Campos de senha (reveal + confirmação) ===== */
.pwd-wrap { position: relative; }
.pwd-wrap input { width: 100%; padding-right: 40px; }
.pwd-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer; font-size: 15px; padding: 4px 6px; border-radius: 6px; line-height: 1; }
.pwd-eye:hover { background: var(--bg); }
.pwd-msg { display: block; margin-top: 6px; font-size: 12px; font-family: var(--font-label); }
.pwd-msg.ok { color: var(--accent); }
.pwd-msg.err { color: var(--danger); }

/* ===== Lista de checkboxes (membros/grupos) ===== */
.check-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow: auto; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 6px; background: var(--bg); }
.check-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; font-weight: 500; }
.check-item:hover { background: var(--brand-soft); }
.check-item input { width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.check-item span { color: var(--text); }
