/* Casa Próspera · Controle — marfim quente, verde floresta e dourado. */
:root {
  --bg: #F6F2EA;
  --bg-2: #EFE9DE;
  --surface: #FFFFFF;
  --surface-2: #FBF8F2;
  --ink: #1C2620;
  --ink-2: #47524B;
  --muted: #858A80;
  --line: #E6DFD2;
  --line-2: #D9D0C0;
  --brand: #2F5D4E;
  --brand-ink: #FFFFFF;
  --brand-2: #3F7A66;
  --brand-soft: #E5EFEA;
  --gold: #A9812F;
  --gold-2: #D4AF63;
  --gold-soft: #F4ECDC;
  --ok: #2E7A57;      --ok-bg: #E4F1EA;
  --warn: #A66A12;    --warn-bg: #FBF0DA;
  --danger: #B0453A;  --danger-bg: #F8E5E1;
  --alert: #BD5A1C;   --alert-bg: #FCEADB;
  --info: #3A6A8B;    --info-bg: #E3EDF4;
  --neutral: #6F746C; --neutral-bg: #EEECE6;
  --wa: #1F9D57;
  --shadow-sm: 0 1px 2px rgba(28, 38, 32, .06);
  --shadow: 0 1px 2px rgba(28, 38, 32, .05), 0 6px 24px -8px rgba(28, 38, 32, .12);
  --shadow-lg: 0 24px 64px -12px rgba(20, 28, 24, .28);
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --side: 244px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101512; --bg-2: #151C18; --surface: #18201B; --surface-2: #1C2520; --ink: #EDE9E0; --ink-2: #BFC4BB; --muted: #868D84;
    --line: #28322C; --line-2: #34403A; --brand: #6FB39A; --brand-ink: #0D1A14; --brand-2: #86C4AC; --brand-soft: #1D2E27;
    --gold: #D4AF63; --gold-2: #E2C27F; --gold-soft: #2A2618;
    --ok: #6BC497; --ok-bg: #17291F; --warn: #E2B45C; --warn-bg: #2B2414; --danger: #EC8A7E; --danger-bg: #2E1A17;
    --alert: #F09A5E; --alert-bg: #2E1F14; --info: #8DBAD8; --info-bg: #17242E; --neutral: #9BA097; --neutral-bg: #222A25;
    --wa: #3CC57A; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px -10px rgba(0,0,0,.6); --shadow-lg: 0 24px 64px -12px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  --bg: #101512; --bg-2: #151C18; --surface: #18201B; --surface-2: #1C2520; --ink: #EDE9E0; --ink-2: #BFC4BB; --muted: #868D84;
  --line: #28322C; --line-2: #34403A; --brand: #6FB39A; --brand-ink: #0D1A14; --brand-2: #86C4AC; --brand-soft: #1D2E27;
  --gold: #D4AF63; --gold-2: #E2C27F; --gold-soft: #2A2618;
  --ok: #6BC497; --ok-bg: #17291F; --warn: #E2B45C; --warn-bg: #2B2414; --danger: #EC8A7E; --danger-bg: #2E1A17;
  --alert: #F09A5E; --alert-bg: #2E1F14; --info: #8DBAD8; --info-bg: #17242E; --neutral: #9BA097; --neutral-bg: #222A25;
  --wa: #3CC57A; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px -10px rgba(0,0,0,.6); --shadow-lg: 0 24px 64px -12px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, .tab { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-name { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; }
.brand-sub { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: var(--ink-2); font-weight: 500; text-decoration: none; transition: background .15s, color .15s; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand); }
.nav a.on svg { opacity: 1; }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.env { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-2); border-radius: 10px; padding: 3px; }
.env button { border: 0; background: transparent; padding: 7px 0; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.env button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.env button.on.test { color: var(--warn); }
.side-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); padding: 0 4px; }
.linkbtn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; font-size: 12px; }
.linkbtn:hover { color: var(--ink); }

.main { min-width: 0; padding: 22px clamp(16px, 2.4vw, 36px) 48px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.top h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -.015em; line-height: 1.15; }
.top p { margin: 4px 0 0; color: var(--muted); }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.banner { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--r); margin-bottom: 16px; font-size: 13.5px; border: 1px solid; }
.banner.test { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--ink); }
.banner.info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.banner.danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.banner b { font-weight: 600; }
.banner > svg { width: 20px; height: 20px; flex: none; }
.banner.info > svg { color: var(--info); }
.banner.test > svg { color: var(--warn); }
.banner.danger > svg { color: var(--danger); }
.banner .btn { margin-left: auto; }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-2); }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.wa:hover { filter: brightness(1.05); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line-2)); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 34px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.loading { pointer-events: none; opacity: .7; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (min-width: 1200px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 15px 16px 14px; box-shadow: var(--shadow-sm); min-height: 112px; display: flex; flex-direction: column; }
.kpi.click { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.kpi.click:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.kpi-label .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.kpi-value { font-family: var(--serif); font-size: clamp(24px, 2.1vw, 30px); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums lining-nums; }
.kpi-value small { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.kpi-foot { margin-top: auto; padding-top: 8px; font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.kpi-foot b { color: var(--ink-2); font-weight: 600; }
.kpi.accent { background: linear-gradient(160deg, #2F5D4E 0%, #1E4034 100%); border-color: transparent; color: #fff; }
.kpi.accent .kpi-label, .kpi.accent .kpi-foot, .kpi.accent .kpi-foot b, .kpi.accent .kpi-value small { color: rgba(255,255,255,.82); }
.kpi.accent .kpi-label .dot { background: var(--gold-2); }
:root[data-theme="dark"] .kpi.accent, :root:not([data-theme="light"]) .kpi.accent { color: #fff; }
.kpi.tone-alert .kpi-label .dot { background: var(--alert); }
.kpi.tone-danger .kpi-label .dot { background: var(--danger); }
.kpi.tone-warn .kpi-label .dot { background: var(--warn); }
.kpi.tone-ok .kpi-label .dot { background: var(--ok); }
.kpi.tone-info .kpi-label .dot { background: var(--info); }
.kpi.tone-gold .kpi-label .dot { background: var(--gold); }
.kpi.hot { border-color: color-mix(in srgb, var(--alert) 45%, var(--line)); background: linear-gradient(180deg, var(--alert-bg), var(--surface) 70%); }
.delta { font-weight: 600; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }

/* ---------- cards / grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 0; flex-wrap: wrap; }
.card-h h2, .card-h h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.card-h .hint { color: var(--muted); font-size: 12.5px; }
.card-b { padding: 14px 16px 16px; }
.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mb { margin-bottom: 14px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }

/* ---------- chips / pills / badges ---------- */
.filters { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 520px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .15s; }
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip .n { font-size: 11.5px; padding: 0 6px; border-radius: 99px; background: var(--bg-2); color: var(--muted); min-width: 20px; text-align: center; line-height: 18px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip.on .n { background: rgba(255,255,255,.18); color: inherit; }
.chip.t-alert .n { background: var(--alert-bg); color: var(--alert); }
.chip.t-danger .n { background: var(--danger-bg); color: var(--danger); }
.chip.t-warn .n { background: var(--warn-bg); color: var(--warn); }
.chip.on.t-alert .n, .chip.on.t-danger .n, .chip.on.t-warn .n { background: rgba(255,255,255,.18); color: inherit; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search input { height: 34px; width: min(300px, 70vw); padding: 0 12px 0 34px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); }
.search svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--muted); }
select.input, input.input, textarea.input { height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; width: 100%; }
input.input:focus, select.input:focus, textarea.input:focus, .search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.pill.alert { background: var(--alert-bg); color: var(--alert); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.muted { background: var(--neutral-bg); color: var(--neutral); }
.pill.plain::before { display: none; }
.pill.lg { height: 28px; font-size: 13px; padding: 0 12px 0 10px; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.tag.anual { background: var(--gold-soft); color: var(--gold); }
.tag.mensal { background: var(--brand-soft); color: var(--brand); }
.tag.test { background: var(--warn-bg); color: var(--warn); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--bg-2); color: var(--ink-2); }
.badge.hot { background: var(--alert); color: #fff; }
.badge.err { background: var(--danger); color: #fff; }
.mem { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.mem i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.mem.in i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.mem.out i { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.mem.unk { color: var(--muted); }

/* ---------- tabela ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 980px; }
.t th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t th.sort { cursor: pointer; user-select: none; }
.t th.sort:hover { color: var(--ink); }
.t th .arr { opacity: .6; margin-left: 3px; }
.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tbody tr { cursor: pointer; transition: background .12s; }
.t tbody tr:hover { background: var(--surface-2); }
.t tbody tr.sel { background: var(--brand-soft); }
.t tbody tr.hl-alert td:first-child { box-shadow: inset 3px 0 0 var(--alert); }
.t tbody tr.hl-alert { background: color-mix(in srgb, var(--alert-bg) 55%, transparent); }
.t tbody tr.hl-danger td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.t tbody tr:last-child td { border-bottom: 0; }
.t .r { text-align: right; }
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--brand); background: var(--brand-soft); letter-spacing: .02em; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; font-family: var(--serif); }
.person .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.person .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.cell-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.cell-sub.alert { color: var(--alert); font-weight: 600; }
.cell-sub.danger { color: var(--danger); font-weight: 600; }
.cell-sub.warn { color: var(--warn); font-weight: 600; }
.wa-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--wa); border: 1px solid color-mix(in srgb, var(--wa) 30%, var(--line)); background: var(--surface); }
.wa-btn:hover { background: color-mix(in srgb, var(--wa) 10%, var(--surface)); text-decoration: none; }
.wa-btn svg { width: 17px; height: 17px; }
.t-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }
.mini { min-width: 0 !important; }
.mini td, .mini th { padding: 9px 12px; }

/* ---------- atenção ---------- */
.attn { display: flex; flex-direction: column; }
.attn-item { display: flex; align-items: center; gap: 11px; padding: 10px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.attn-item:hover { background: var(--surface-2); }
.attn-item .grow { flex: 1; min-width: 0; }
.attn-item .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn-item .why { font-size: 12px; color: var(--muted); }

/* ---------- gráficos ---------- */
.chart { width: 100%; height: auto; max-height: 280px; display: block; }
.chart text { fill: var(--muted); font: 11px var(--sans); }
.chart .grid-l { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .ax { stroke: var(--line-2); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: var(--surface); padding: 7px 10px; border-radius: 8px; font-size: 12px; box-shadow: var(--shadow); white-space: nowrap; }
.bars-h { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-track { height: 10px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--brand); }

/* ---------- gaveta ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(16, 22, 18, .34); backdrop-filter: blur(2px); animation: fade .18s ease; }
.drawer { position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .22s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
.dr-head { padding: 18px 20px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.dr-top { display: flex; align-items: flex-start; gap: 14px; }
.dr-top .grow { flex: 1; min-width: 0; }
.dr-name { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -.015em; line-height: 1.15; margin: 2px 0 6px; word-break: break-word; }
.dr-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dr-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.dr-body { flex: 1; overflow-y: auto; padding: 16px 20px 28px; display: flex; flex-direction: column; gap: 14px; }
.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.sec-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 0; gap: 8px; }
.sec-h h3 { margin: 0; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sec-b { padding: 10px 14px 14px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.fact .k { font-size: 12px; color: var(--muted); }
.fact .v { font-weight: 600; margin-top: 1px; word-break: break-word; }
.fact .v.big { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.callout { border-radius: 10px; padding: 11px 13px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.callout.alert { background: var(--alert-bg); color: var(--ink); }
.callout.alert svg { color: var(--alert); }
.callout.danger { background: var(--danger-bg); }
.callout.danger svg { color: var(--danger); }
.callout.info { background: var(--info-bg); }
.callout.info svg { color: var(--info); }
.callout.ok { background: var(--ok-bg); }
.callout.ok svg { color: var(--ok); }
.callout b { font-weight: 600; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 14px 22px; }
.tl li::before { content: ''; position: absolute; left: 5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.tl li::after { content: ''; position: absolute; left: 8.5px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.tl li:last-child::after { display: none; }
.tl li.k-hubla::before { background: var(--brand); }
.tl li.k-grupo::before { background: var(--gold); }
.tl li.k-acao::before { background: var(--alert); }
.tl li.k-contact::before { background: var(--wa); }
.tl li.k-note::before { background: var(--info); }
.tl .when { font-size: 11.5px; color: var(--muted); }
.tl .what { font-weight: 600; font-size: 13.5px; }
.tl .det { font-size: 12.5px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.inv { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.inv:first-child { border-top: 0; padding-top: 0; }
.inv .grow { flex: 1; min-width: 0; }
.inv .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.menu { position: relative; display: inline-block; }
.menu-list { position: absolute; z-index: 70; top: calc(100% + 6px); left: 0; min-width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 9px 11px; border-radius: 8px; border: 0; background: none; color: var(--ink); font-size: 13px; cursor: pointer; text-decoration: none; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); text-decoration: none; }
.menu-list small { display: block; color: var(--muted); font-size: 11.5px; }

/* ---------- modal / toast ---------- */
.modal { position: fixed; z-index: 81; inset: 0; display: grid; place-items: center; padding: 16px; }
.modal-box { width: min(720px, 100%); max-height: 88vh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.modal-box.sm { width: min(440px, 100%); }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal-h h3 { margin: 0; font-family: var(--serif); font-size: 19px; font-weight: 600; }
.modal-b { padding: 16px 18px; overflow: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; }
pre.code { margin: 0; padding: 12px 14px; background: var(--bg-2); border-radius: 10px; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; overflow: auto; max-height: 52vh; white-space: pre; }
#toast-root { position: fixed; z-index: 95; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: var(--surface); padding: 11px 16px; border-radius: 12px; font-weight: 500; box-shadow: var(--shadow-lg); animation: pop .2s ease; max-width: min(560px, 92vw); }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok { background: var(--brand); color: var(--brand-ink); }

/* ---------- formulários / configurações ---------- */
.form { display: grid; gap: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { appearance: none; width: 40px; height: 23px; border-radius: 99px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(17px); }
.copy { display: flex; gap: 6px; align-items: center; }
.copy code { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px; background: var(--bg-2); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 9px; align-items: center; font-size: 13px; }
.checklist .ck { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 11px; font-weight: 700; }
.checklist .ck.y { background: var(--ok-bg); color: var(--ok); }
.checklist .ck.n { background: var(--bg-2); color: var(--muted); }
.checklist code { font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.stat-line { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.stat-line:first-child { border-top: 0; }
.stat-line b { font-variant-numeric: tabular-nums; }
.recon { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.recon .card { display: flex; flex-direction: column; }
.recon .big { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1; }
.recon ul { list-style: none; margin: 10px 0 0; padding: 0; max-height: 240px; overflow: auto; }
.recon li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.recon li:hover { color: var(--brand); }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-art { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 10% 10%, #3E7A66 0%, #2F5D4E 45%, #1B3A30 100%); color: #F4ECDC; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(212,175,99,.35); box-shadow: 0 0 0 40px rgba(212,175,99,.06), 0 0 0 90px rgba(212,175,99,.04); }
.login-art h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; letter-spacing: -.02em; margin: 0; max-width: 520px; }
.login-art p { max-width: 440px; color: rgba(244,236,220,.78); font-size: 15px; }
.login-art .gold { color: #D4AF63; }
.login-form { display: grid; place-items: center; padding: 32px 20px; background: var(--bg); }
.login-box { width: min(380px, 100%); }
.login-box h2 { font-family: var(--serif); font-size: 26px; margin: 0 0 6px; font-weight: 600; }
.login-box input { width: 100%; height: 44px; margin: 18px 0 12px; }
.login-box .btn { width: 100%; height: 44px; }
.err-msg { color: var(--danger); font-size: 13px; min-height: 18px; }

.skel { background: linear-gradient(90deg, var(--bg-2), var(--surface-2), var(--bg-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- responsivo ---------- */
@media (max-width: 1180px) {
  .g-21, .g-12, .g-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  :root { --side: 0px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; z-index: 40; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; gap: 10px; }
  .brand { padding: 0; }
  .brand-text { display: none; }
  .nav { flex-direction: row; gap: 2px; }
  .nav a { padding: 8px 10px; }
  .nav a span.lbl { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; flex-direction: row; align-items: center; }
  .side-meta { display: none; }
  .env button { padding: 6px 10px; }
  .g-2 { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { min-height: 260px; padding: 28px 22px; }
}
@media (max-width: 560px) {
  .main { padding: 16px 16px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { min-height: 100px; padding: 12px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .dr-head, .dr-body { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
