/* ConnHub — identidade ConnIP: grafite quente + laranja */
:root {
  --orange: #F26A1B; --orange-2: #FF8A3D; --orange-soft: #FFF1E8; --orange-ink: #B9470A;
  --ink: #17120E; --ink-2: #221B16; --ink-line: #2F2621; --ink-tx: #CFC6BE; --ink-tx2: #8E847B;
  --bg: #F6F3EF; --surface: #FFFFFF; --surface-2: #FBF9F7; --line: #ECE5DD; --line-2: #E0D7CD;
  --tx: #1C1814; --tx2: #6B625A; --tx3: #A0968C;
  --green: #15803D; --green-soft: #E8F6EC; --red: #DC2626; --red-soft: #FDECEC; --amber: #B45309; --amber-soft: #FEF4E2;
  --blue: #2563EB; --blue-soft: #EAF0FE; --violet: #7C3AED; --violet-soft: #F1EBFE;
  --radius: 14px; --radius-sm: 9px; --shadow: 0 1px 2px rgba(23,18,14,.05), 0 4px 16px rgba(23,18,14,.04);
  --shadow-lg: 0 20px 50px rgba(23,18,14,.22);
  --grad: linear-gradient(135deg, #FF8A3D 0%, #F26A1B 55%, #E2550A 100%);
  --font: 'Montserrat', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F0C0A; --surface: #191411; --surface-2: #1F1915; --line: #2B231E; --line-2: #3A3029;
  --tx: #F2ECE6; --tx2: #B3A89E; --tx3: #7E7369; --orange-soft: #33200F; --orange-ink: #FFA466;
  --green-soft: #12291A; --red-soft: #351515; --amber-soft: #33240E; --blue-soft: #14213F; --violet-soft: #241A3B;
  --green: #4ADE80; --red: #F87171; --amber: #FBBF24; --blue: #7AA2FF; --violet: #B596FF;
  --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--tx); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--orange); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
::selection { background: rgba(242,106,27,.25); }

/* ---------- layout */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: var(--ink-tx); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px 18px; }
.brand-name { font-weight: 800; font-size: 19px; color: #fff; letter-spacing: -.02em; line-height: 1; }
.brand-name b { color: var(--orange); font-weight: 800; }
.brand-sub { font-size: 10.5px; color: var(--ink-tx2); letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }
.nav { padding: 6px 12px 20px; flex: 1; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-tx2); padding: 16px 10px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--ink-tx); font-weight: 500; font-size: 13.5px; text-decoration: none; position: relative; }
.nav a svg { width: 18px; height: 18px; opacity: .8; flex: none; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(242,106,27,.22), rgba(242,106,27,.06)); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--orange); }
.nav a.active svg { color: var(--orange); opacity: 1; }
.nav .count { margin-left: auto; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px; }
.side-foot { padding: 14px 16px; border-top: 1px solid var(--ink-line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.side-foot .who { flex: 1; min-width: 0; } .side-foot .who b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { font-size: 11.5px; color: var(--ink-tx2); }
.side-foot button { background: none; border: 0; color: var(--ink-tx2); cursor: pointer; padding: 6px; border-radius: 8px; }
.side-foot button:hover { color: #fff; background: var(--ink-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.topbar .menu-btn { display: none; }
.search { flex: 1; max-width: 460px; position: relative; }
.search input { width: 100%; padding: 9px 12px 9px 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font: inherit; color: var(--tx); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--tx3); }
.topbar .spacer { flex: 1; }
.content { padding: 26px 28px 60px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--tx2); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 12.5px; color: var(--tx3); margin-bottom: 6px; } .crumb a { color: var(--tx2); }

/* ---------- componentes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 14.5px; font-weight: 700; } .card-head .sub { color: var(--tx3); font-size: 12.5px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--tx2); } .faint { color: var(--tx3); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.right { margin-left: auto; } .nowrap { white-space: nowrap; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .label { color: var(--tx2); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kpi .value { font-size: 28px; font-weight: 800; margin-top: 8px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .hint { color: var(--tx3); font-size: 12px; margin-top: 2px; }
.kpi.hero { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpi.hero .label { color: var(--ink-tx); } .kpi.hero .hint { color: var(--ink-tx2); }
.kpi.hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(242,106,27,.55), transparent 70%); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--tx); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: .15s; }
.btn:hover { border-color: var(--tx3); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 2px 10px rgba(242,106,27,.3); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.danger { color: var(--red); } .btn.danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn.solid-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--tx2); } .btn.ghost:hover { background: var(--surface-2); color: var(--tx); }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; } .btn.xs { padding: 3px 8px; font-size: 12px; border-radius: 7px; }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.btn.loading::after { content: ''; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 8px; color: var(--tx2); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--tx); } .icon-btn svg { width: 17px; height: 17px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--tx2); border: 1px solid var(--line); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge.blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.badge.orange { background: var(--orange-soft); color: var(--orange-ink); border-color: transparent; }
.badge.violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.badge.dark { background: var(--ink); color: #fff; border-color: transparent; }
.chip-inst { display: inline-flex; white-space: nowrap; align-items: center; gap: 6px; font-size: 12px; color: var(--tx2); font-weight: 500; }

/* ---------- tabelas */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--tx3); font-weight: 600; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.click { cursor: pointer; } .t tbody tr.click:hover td { background: var(--surface-2); }
.t .name { font-weight: 600; } .t .sub { color: var(--tx3); font-size: 12px; }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 44px 20px; text-align: center; color: var(--tx2); }
.empty svg { width: 42px; height: 42px; color: var(--tx3); margin-bottom: 8px; }
.empty h4 { color: var(--tx); font-size: 15px; margin-bottom: 4px; }

/* ---------- formulários */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--tx2); }
.field .help { font-size: 11.5px; color: var(--tx3); }
.input, select.input, textarea.input { width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--tx); font: inherit; font-size: 13.5px; transition: .15s; }
.input:focus, .search input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242,106,27,.15); }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.45; }
textarea.code { font-family: var(--mono); font-size: 12px; }
input[type=color].input { padding: 3px; height: 38px; width: 52px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--orange); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 20px; background: var(--line-2); position: relative; cursor: pointer; transition: .2s; flex: none; margin: 0; }
.switch input::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--orange); } .switch input:checked::after { left: 17px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.filters .input { width: auto; min-width: 140px; padding: 7px 10px; font-size: 13px; }
.filters .grow { flex: 1; min-width: 200px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--tx2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--tx); box-shadow: var(--shadow); }
.seg button .n { color: var(--tx3); font-weight: 500; margin-left: 4px; }
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 14px; }

.list-editor .le-row { display: grid; gap: 8px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--surface-2); }
.list-editor .le-row .icon-btn { margin-top: 4px; }

/* ---------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--tx2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--tx); border-bottom-color: var(--orange); }
.tabs button .n { background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: 0 7px; font-size: 11px; margin-left: 5px; }

/* ---------- itens / listas */
.items > * + * { border-top: 1px solid var(--line); }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 600; } .item .meta { color: var(--tx3); font-size: 12px; }
a.item { color: inherit; text-decoration: none; } a.item:hover { background: var(--surface-2); }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.info-grid > div { padding: 12px 20px; border-bottom: 1px solid var(--line); min-width: 0; }
.info-grid > div:nth-child(odd) { border-right: 1px solid var(--line); }
.info-grid dt { font-size: 11.5px; color: var(--tx3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.info-grid dd { margin: 3px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.timeline { padding: 6px 20px 16px; }
.tl { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.tl:last-child { border-bottom: 0; }
.tl .ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange-ink); flex: none; font-size: 12px; font-weight: 700; }
.tl.sys .ico { background: var(--surface-2); color: var(--tx3); }
.tl .body { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.inst-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.inst-card .top { display: flex; align-items: center; gap: 10px; }
.inst-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; flex: none; }
.copy-field { display: flex; gap: 6px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 6px 6px 6px 10px; font-family: var(--mono); font-size: 12px; }
.copy-field span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.callout { padding: 12px 14px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: 13px; display: flex; gap: 10px; }
.callout.info { background: var(--blue-soft); color: var(--blue); } .callout.orange { background: var(--orange-soft); color: var(--orange-ink); }
.callout.red { background: var(--red-soft); color: var(--red); }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.log { font-family: var(--mono); font-size: 12px; }
.log .ln { display: grid; grid-template-columns: 18px 120px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); align-items: start; }
.log .ln:last-child { border-bottom: 0; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.progress { height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; } .progress > i { display: block; height: 100%; background: var(--grad); }
.color-dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; vertical-align: -1px; border: 1px solid rgba(0,0,0,.08); }

/* ---------- modal / toast */
.overlay { position: fixed; inset: 0; background: rgba(15,12,10,.55); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal.lg { width: min(820px, 100%); } .modal.xl { width: min(1060px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; font-weight: 700; flex: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 16px 16px; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); max-width: 380px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; animation: pop .2s; border-left: 4px solid var(--orange); }
.toast.ok { border-left-color: #22C55E; } .toast.err { border-left-color: #EF4444; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::before { content: ''; position: absolute; width: 520px; height: 520px; right: -160px; bottom: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(242,106,27,.45), transparent 65%); }
.auth-art::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 42px 42px; }
.auth-art > * { position: relative; z-index: 1; }
.auth-art h2 { font-size: 40px; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; max-width: 520px; }
.auth-art h2 em { font-style: normal; color: var(--orange); }
.auth-art ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; color: var(--ink-tx); }
.auth-art li { display: flex; gap: 10px; align-items: center; } .auth-art li svg { color: var(--orange); width: 18px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-form .box { width: min(380px, 100%); }
.auth-form h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }

/* ---------- responsivo */
@media (max-width: 1100px) { .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr; } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: .2s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .topbar { padding: 12px 16px; } .topbar .menu-btn { display: inline-grid; }
  .content { padding: 18px 16px 50px; }
  .g2, .g3, .g4, .g5, .form-grid, .info-grid { grid-template-columns: 1fr; }
  .info-grid > div:nth-child(odd) { border-right: 0; }
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .hide-sm { display: none; }
}

/* tamanho padrão de ícones inline */
svg:not([width]) { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.badge svg:not([width]) { width: 13px; height: 13px; vertical-align: -2px; }
.kpi .label svg { width: 16px; height: 16px; }
.empty svg:not([width]) { width: 42px; height: 42px; }
.inst-mark svg { width: 18px; height: 18px; }

/* Listas de campanha */
.ex-row { display: grid; grid-template-columns: minmax(150px, 220px) 170px 1fr; gap: 10px; align-items: center; }
@media (max-width: 760px) { .ex-row { grid-template-columns: 1fr 1fr; } .ex-row > :first-child { grid-column: 1 / -1; } }

/* Olhinho dos valores financeiros */
.hide-money .money { filter: blur(7px); user-select: none; pointer-events: none; transition: filter .15s; }
.money { transition: filter .15s; }


/* ---------- Documentação */
.docs-shell { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
.docs-main { min-width: 0; }
.docs-tree { position: sticky; top: 84px; max-height: calc(100vh - 104px); display: flex; flex-direction: column; overflow: hidden; }
.dt-head { display: flex; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); align-items: center; }
.dt-search { flex: 1; display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 8px; cursor: text; }
.dt-search svg { width: 15px; height: 15px; color: var(--tx3); flex: none; }
.dt-search input { border: 0; background: none; outline: none; padding: 7px 0; width: 100%; font: inherit; font-size: 13px; color: var(--tx); }
.dt-body { overflow: auto; padding: 6px; flex: 1; }
.dt-row { display: flex; align-items: center; gap: 2px; border-radius: 7px; min-height: 30px; font-size: 13.5px; color: var(--tx2); padding-right: 4px; }
.dt-row:hover { background: var(--surface-2); color: var(--tx); }
.dt-row.active { background: var(--orange-soft); color: var(--orange-ink); font-weight: 600; }
.dt-row.space { font-weight: 700; color: var(--tx); margin-top: 4px; }
.dt-tw { width: 20px; height: 20px; display: grid; place-items: center; border: 0; background: none; color: var(--tx3); cursor: pointer; flex: none; padding: 0; border-radius: 5px; }
button.dt-tw:hover { background: var(--line); }
.dt-tw svg { width: 14px; height: 14px; transition: transform .12s; }
.dt-row.open > .dt-tw svg { transform: rotate(90deg); }
.dt-label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; color: inherit; text-decoration: none; padding: 5px 2px; cursor: pointer; }
.dt-label:hover { text-decoration: none; }
.dt-ic { width: 18px; flex: none; text-align: center; font-size: 14px; line-height: 1; }
.dt-ic svg { width: 15px; height: 15px; vertical-align: -2px; }
.dt-act { display: none; gap: 1px; }
.dt-row:hover .dt-act, .dt-row.menu-open .dt-act { display: flex; }
.dt-act button { width: 24px; height: 24px; border: 0; background: none; border-radius: 5px; color: var(--tx3); cursor: pointer; display: grid; place-items: center; padding: 0; }
.dt-act button:hover { background: var(--line); color: var(--tx); }
.dt-act svg { width: 15px; height: 15px; }
.dt-empty { font-size: 12.5px; color: var(--tx3); padding: 4px 8px 6px; }
.dt-hit { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; color: var(--tx); text-decoration: none; font-size: 13px; }
.dt-hit:hover { background: var(--surface-2); text-decoration: none; }
.dt-hit mark, .doc-body mark { background: var(--orange-soft); color: var(--orange-ink); border-radius: 3px; padding: 0 1px; }
.pop-menu { position: fixed; z-index: 200; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; min-width: 200px; }
.pop-menu button { display: flex; width: 100%; align-items: center; gap: 9px; border: 0; background: none; padding: 8px 10px; border-radius: 7px; font: inherit; font-size: 13.5px; color: var(--tx); cursor: pointer; text-align: left; }
.pop-menu button:hover { background: var(--surface-2); }
.pop-menu button.danger, .pop-menu button.danger svg { color: var(--red); }
.pop-menu svg { width: 16px; height: 16px; color: var(--tx3); flex: none; }
.pop-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.space-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 21px; flex: none; color: var(--tx3); }
.space-ic svg { width: 20px; height: 20px; }
.space-ic.lg { width: 52px; height: 52px; font-size: 28px; margin-right: 6px; }
.space-card { transition: border-color .15s, transform .15s; }
.space-card:hover { border-color: var(--orange); transform: translateY(-1px); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.emoji-grid button { font-size: 22px; padding: 6px; border: 0; background: none; border-radius: 8px; cursor: pointer; }
.emoji-grid button:hover { background: var(--surface-2); }
.doc-paper { padding: 26px 40px 34px; min-height: 60vh; }
.doc-head { display: flex; align-items: center; gap: 8px; }
.doc-emoji { font-size: 30px; width: 48px; height: 48px; border: 0; background: none; border-radius: 10px; cursor: pointer; flex: none; display: grid; place-items: center; color: var(--tx3); padding: 0; }
.doc-emoji:not(:disabled):hover { background: var(--surface-2); }
.doc-emoji:disabled { cursor: default; }
.doc-emoji svg { width: 28px; height: 28px; }
.doc-title { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; font-size: 28px; font-weight: 800; color: var(--tx); padding: 4px 0; letter-spacing: -.01em; }
.doc-meta { font-size: 12.5px; color: var(--tx3); margin: 2px 0 18px 56px; }
.doc-toolbar { position: sticky; top: 72px; z-index: 5; display: flex; flex-wrap: wrap; gap: 2px; padding: 5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; }
.doc-toolbar button { min-width: 30px; height: 30px; padding: 0 7px; border: 0; background: none; border-radius: 6px; color: var(--tx2); cursor: pointer; font: inherit; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; }
.doc-toolbar button:hover, .doc-toolbar button.on { background: var(--line); color: var(--tx); }
.doc-toolbar button svg { width: 16px; height: 16px; }
.doc-toolbar select { height: 30px; border: 0; background: none; font: inherit; font-size: 13px; color: var(--tx2); padding: 0 4px; border-radius: 6px; cursor: pointer; }
.doc-toolbar .sep { width: 1px; background: var(--line-2); margin: 5px 4px; }
.doc-src { width: 100%; min-height: 360px; font-family: var(--mono); font-size: 12.5px; }
.doc-body { outline: none; font-size: 15px; line-height: 1.7; color: var(--tx); min-height: 260px; overflow-wrap: anywhere; }
.doc-body:empty::before { content: attr(data-ph); color: var(--tx3); }
.doc-body > :first-child { margin-top: 0; }
.doc-body h1 { font-size: 24px; margin: 1.1em 0 .4em; } .doc-body h2 { font-size: 20px; margin: 1.1em 0 .4em; } .doc-body h3 { font-size: 17px; margin: 1em 0 .3em; }
.doc-body p { margin: .45em 0; }
.doc-body ul, .doc-body ol { padding-left: 1.6em; margin: .45em 0; }
.doc-body blockquote { border-left: 3px solid var(--orange); margin: .8em 0; padding: .2em 0 .2em 14px; color: var(--tx2); }
.doc-body pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-family: var(--mono); font-size: 13px; white-space: pre-wrap; }
.doc-body code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.doc-body pre code { background: none; padding: 0; }
.doc-body img { max-width: 100%; height: auto; border-radius: 8px; }
.doc-body iframe { max-width: 100%; border: 0; border-radius: 8px; }
.doc-body table { border-collapse: collapse; width: 100%; margin: .8em 0; font-size: 14px; }
.doc-body td, .doc-body th { border: 1px solid var(--line-2); padding: 7px 10px; text-align: left; vertical-align: top; }
.doc-body th { background: var(--surface-2); font-weight: 700; }
.doc-body hr { border: 0; border-top: 1px solid var(--line-2); margin: 1.4em 0; }
.doc-body a { color: var(--orange-ink); text-decoration: underline; }
.doc-body ul.checklist { list-style: none; padding-left: 2px; }
.doc-body ul.checklist li { position: relative; padding-left: 28px; }
.doc-body ul.checklist li::before { content: ''; position: absolute; left: 2px; top: .38em; width: 15px; height: 15px; border: 1.6px solid var(--line-2); border-radius: 4px; background: var(--surface); box-sizing: border-box; }
.doc-body[contenteditable=true] ul.checklist li::before { cursor: pointer; }
.doc-body ul.checklist li[data-checked]::before { background: var(--orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E") center / 11px no-repeat; border-color: var(--orange); }
.doc-body ul.checklist li[data-checked] { color: var(--tx3); text-decoration: line-through; }
.doc-body .secret { filter: blur(5px); background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 4px; padding: 0 5px; cursor: pointer; transition: filter .15s; font-family: var(--mono); font-size: .92em; }
.doc-body .secret.show { filter: none; }
.doc-foot { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.doc-sec { border-top: 1px solid var(--line); padding-top: 12px; }
.doc-sec .row b svg { width: 14px; height: 14px; vertical-align: -2px; color: var(--tx3); }
@media (max-width: 900px) {
  .docs-shell { grid-template-columns: 1fr; }
  .docs-tree { position: static; max-height: 320px; }
  .doc-paper { padding: 18px 16px 24px; }
  .doc-title { font-size: 22px; }
  .doc-meta { margin-left: 0; }
  .doc-foot { grid-template-columns: 1fr; }
  .doc-toolbar { top: 60px; }
}

/* ---------- Perfis de acesso */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.perm-group { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; background: var(--surface-2); }
.perm-head { padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.perm-group .check.small { align-items: flex-start; line-height: 1.35; }
.perm-group .check input { margin-top: 1px; flex: none; }
