:root {
  --bg: #0b1220;
  --surface: #141c2e;
  --surface-2: #1b2438;
  --border: #26304a;
  --border-strong: #35415f;
  --text: #e8edf7;
  --text-2: #b7c1d6;
  --muted: #8593ab;
  --primary: #6366f1;
  --primary-2: #818cf8;
  --primary-soft: rgba(99, 102, 241, .16);
  --ink: #0a0f1c;
  --ok: #34d399;
  --ok-soft: rgba(16, 185, 129, .15);
  --warn: #fbbf24;
  --warn-soft: rgba(245, 158, 11, .15);
  --err: #f87171;
  --err-soft: rgba(239, 68, 68, .15);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, .15);
  --radius: 14px;
  --radius-sm: 10px;
  --copilot-w: 384px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
  font-family: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-feature-settings: "tnum" 1;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }

.app { display: grid; grid-template-columns: 248px minmax(0, 1fr) var(--copilot-w); min-height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar { width: 248px; flex-shrink: 0; background: var(--ink); color: #aab3c5; display: flex; flex-direction: column;
  padding: 22px 14px 18px; position: sticky; top: 0; height: 100vh; border-right: 1px solid #18213a; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 10px 26px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #4338ca); box-shadow: 0 6px 18px rgba(79, 70, 229, .45); }
.brand-name { color: #fff; font-weight: 800; font-size: 17px; letter-spacing: .18em; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #5b6478; padding: 16px 12px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; font-weight: 500; transition: background .15s, color .15s; }
.nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav a.active { background: rgba(99, 102, 241, .18); color: #fff; box-shadow: inset 2px 0 0 #818cf8; }
.nav a.brain-link { color: #e0e7ff; background: linear-gradient(90deg, rgba(99, 102, 241, .22), rgba(99, 102, 241, .06)); margin-bottom: 6px; }
.nav a.brain-link.active { background: linear-gradient(90deg, rgba(99, 102, 241, .42), rgba(99, 102, 241, .14)); }
.nav .tag { margin-left: auto; font-size: 10px; font-weight: 600; color: #7c86a0; border: 1px solid #2a3147; border-radius: 999px; padding: 0 7px; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid #1c2336; font-size: 12px; color: #6b7590; }
.sidebar-foot strong { color: #cbd3e6; font-weight: 600; display: block; }

/* ---------- topbar ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 66px; background: rgba(11, 18, 32, .82); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 22px; padding: 0 30px; position: sticky; top: 0; z-index: 10; overflow: hidden; }
.tb-block { display: flex; flex-direction: column; min-width: 0; }
.tb-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tb-value { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-sep { width: 1px; height: 30px; background: var(--border); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 14px; min-width: 0; flex-shrink: 1; }
.tb-company .tb-value { max-width: 150px; }
.user .tb-value { max-width: 150px; }
.tb-company, .status, .tb-online, .tb-date, .tb-icon, .user .avatar, .period-tabs, .tb-burger { flex-shrink: 0; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.status.ok .dot { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
.status.err .dot { background: var(--err); }
.user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; }
.user .tb-value { font-size: 13.5px; }

.content { padding: 28px 30px 48px; max-width: 1360px; width: 100%; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: 4px; }

/* ---------- surfaces ---------- */
.grid { display: grid; gap: 16px; }
.g-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1700px) { .g-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 26px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font-size: 15px; font-weight: 650; }
.panel-head .sub { font-size: 12.5px; color: var(--muted); }
.section-title { font-size: 13px; font-weight: 650; color: var(--text-2); text-transform: uppercase; letter-spacing: .07em; margin: 28px 0 12px; }

/* ---------- KPI ---------- */
.kpi { position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 550; }
.kpi-value { font-size: 30px; font-weight: 750; letter-spacing: -.02em; margin: 10px 0 2px; line-height: 1.1; }
.kpi-value small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 5px; letter-spacing: 0; }
.kpi-caption { font-size: 12px; color: var(--text-2); font-weight: 550; }
.kpi-meta { font-size: 12px; color: var(--muted); margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 8px; }
.kpi-meta div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.na .kpi-value { font-size: 15px; color: var(--muted); font-weight: 650; letter-spacing: 0; margin: 14px 0 6px; }
.kpi.na .kpi-meta { white-space: normal; }
.kpi.na .kpi-meta div { white-space: normal; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 650; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* ---------- Cérebro block ---------- */
.brain { background: radial-gradient(1200px 300px at 0% 0%, #4338ca 0%, #312e81 45%, #1e1b4b 100%); color: #e0e7ff; border: 0;
  border-radius: 18px; padding: 24px 26px; box-shadow: 0 10px 30px rgba(49, 46, 129, .25); }
.brain-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.brain-head h2 { color: #fff; font-size: 18px; font-weight: 700; }
.brain-head p { margin: 2px 0 0; color: #c7d2fe; font-size: 13px; }
.brain-cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 22px; }
.brain h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: #a5b4fc; margin-bottom: 8px; font-weight: 650; }
.brain ul { margin: 0; padding: 0; list-style: none; }
.brain li { position: relative; padding-left: 16px; margin: 7px 0; color: #eef2ff; }
.brain li::before { content: ""; position: absolute; left: 0; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: #818cf8; }
.brain .attn li::before { background: #fbbf24; }
.brain .muted-list li { color: #c7d2fe; font-size: 13px; }
.brain .muted-list li::before { background: #6366f1; }
.brain-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(165, 180, 252, .2); display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: #a5b4fc; }
.btn { display: inline-flex; align-items: center; gap: 7px; border: 0; cursor: pointer; font-weight: 600; padding: 9px 15px; border-radius: 10px;
  background: var(--primary); color: #fff; transition: background .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: #4338ca; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.glass { background: rgba(255, 255, 255, .14); color: #fff; }
.btn.glass:hover { background: rgba(255, 255, 255, .22); }

/* ---------- lists ---------- */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.row:first-child { border-top: 0; padding-top: 2px; }
.row .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-weight: 700; }
.ic.ok { background: var(--ok-soft); color: var(--ok); }
.ic.warn { background: var(--warn-soft); color: var(--warn); }
.ic.info { background: var(--info-soft); color: var(--info); }
.ic.muted { background: var(--surface-2); color: var(--muted); }
.ic.err { background: var(--err-soft); color: var(--err); }
.row .body { flex: 1; min-width: 0; }
.row .t { font-weight: 600; }
.row .d { font-size: 12.5px; color: var(--muted); }
.row .v { font-weight: 700; white-space: nowrap; text-align: right; }
.row .v small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }

/* reconciliation highlight */
.recon { display: flex; flex-direction: column; justify-content: space-between; }
.recon-status { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; }
.recon-mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; font-weight: 800; }
.recon-mark.ok { background: var(--ok-soft); color: var(--ok); }
.recon-mark.warn { background: var(--warn-soft); color: var(--warn); }
.recon-title { font-size: 20px; font-weight: 750; }
.recon p { margin: 0; color: var(--text-2); font-size: 13px; }
.recon .flow { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.recon .flow span.node { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 4px 9px; color: var(--text-2); font-weight: 550; }

/* big number feature */
.feature-num { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.feature-sub { color: var(--muted); margin-top: 6px; }

/* empty */
.empty { text-align: center; padding: 34px 18px; }
.empty .glyph { width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 22px; }
.empty h3 { font-size: 16px; margin-bottom: 6px; }
.empty p { color: var(--muted); margin: 0 auto 14px; max-width: 460px; }

/* requirement table */
.req { width: 100%; border-collapse: collapse; }
.req th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.req td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.req tr:last-child td { border-bottom: 0; }

/* data table */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.tabs button { border: 0; background: transparent; padding: 7px 13px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.search { border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 12px; min-width: 260px; font: inherit; outline: 0; background: var(--surface); }
.search:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-soft); }

/* charts */
.chart { width: 100%; height: 220px; display: block; }
.chart text { font-size: 10px; fill: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: 28px minmax(0, 1fr) 90px; align-items: center; gap: 10px; padding: 7px 0; }
.hbar .rank { color: var(--muted); font-weight: 650; font-size: 12px; text-align: right; }
.hbar .name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.hbar .track { height: 7px; background: var(--surface-2); border-radius: 999px; margin-top: 5px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #818cf8); }
.hbar .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: 10px 0 12px; }
.stack span { display: block; height: 100%; }


/* Cérebro — respostas estruturadas */
.examples-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #a5b4fc; margin-top: 16px; }
.qa-q .when { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.qa-understood { font-size: 12px; color: var(--primary); background: var(--primary-soft); border-radius: 8px; padding: 4px 10px; display: inline-block; margin-bottom: 10px; font-weight: 600; }
.qa-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.qa-stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.qa-stat .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.qa-stat .v { font-size: 22px; font-weight: 750; letter-spacing: -.01em; margin: 2px 0; }
.qa-stat .d { font-size: 12px; color: var(--muted); }
.qa-chart { margin-top: 14px; }
.qa-chart .chart { height: 170px; }
.qa-table { margin-top: 10px; }
.qa-table summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.qa-table .table-wrap { max-height: 320px; }
.qa-rows { margin-top: 14px; max-height: 360px; }
.qa-notes { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; }
.chip.light { border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.chip.light:hover { border-color: var(--primary); color: var(--primary); background: var(--surface); }

/* Cérebro page */
.brain-page { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.ask-hero { background: radial-gradient(900px 260px at 0% 0%, #4338ca 0%, #312e81 55%, #1e1b4b 100%); border-radius: 18px; padding: 26px; color: #e0e7ff; box-shadow: 0 10px 30px rgba(49, 46, 129, .22); }
.ask-hero h1 { color: #fff; font-size: 24px; }
.ask-hero p { margin: 4px 0 18px; color: #c7d2fe; }
.composer { display: flex; gap: 10px; background: #fff; border-radius: 14px; padding: 7px; box-shadow: 0 6px 24px rgba(15, 23, 42, .18); }
.composer input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 15px; padding: 9px 12px; color: var(--text); min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { border: 1px solid rgba(199, 210, 254, .35); background: rgba(255, 255, 255, .08); color: #eef2ff; border-radius: 999px; padding: 6px 13px; cursor: pointer; font-size: 13px; transition: background .15s; }
.chip:hover { background: rgba(255, 255, 255, .18); }
.thread { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.qa { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.qa-q { display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 600; }
.qa-q .who { width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.qa-a { padding: 16px; }
.qa-a .ans { font-size: 15px; font-weight: 550; }
.qa-a ul { margin: 10px 0 0; padding-left: 18px; color: var(--text-2); }
.qa-a li { margin: 4px 0; }
.qa-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--muted); }
.qa-meta b { color: var(--text-2); font-weight: 600; }
.side-card h3 { font-size: 13px; margin-bottom: 10px; }
.side-card ul { margin: 0; padding-left: 16px; color: var(--text-2); font-size: 13px; }
.side-card li { margin: 5px 0; }
.typing { color: var(--muted); font-style: italic; }

.error-box { background: var(--err-soft); border: 1px solid rgba(248, 113, 113, .4); color: #fca5a5; padding: 16px; border-radius: var(--radius); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, #141c2e 0%, #1e2740 50%, #141c2e 100%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- topbar extras ---------- */
.tb-online { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ok);
  background: var(--ok-soft); border: 1px solid rgba(52, 211, 153, .3); padding: 3px 9px; border-radius: 999px; }
.tb-online i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); }
.tb-chip { font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 5px 11px; border-radius: 999px; white-space: nowrap; }

/* ---------- copilot (Cérebro fixo à direita) ---------- */
.copilot { grid-column: 3; background: var(--surface); border-left: 1px solid var(--border); position: sticky; top: 0;
  height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.copilot-head { display: flex; align-items: center; gap: 11px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.ch-avatar { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #4338ca); box-shadow: 0 6px 18px rgba(79, 70, 229, .4); }
.ch-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ch-title { font-weight: 700; font-size: 15px; color: var(--text); }
.ch-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-online { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ok); }
.ch-online i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); }
.ch-close { display: none; border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 6px; }
/* cérebro neural (VFX plexus) — modo foco */
.copilot-brain { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 12px 8px;
  background: radial-gradient(200px 130px at 50% 42%, rgba(30, 110, 200, .22), rgba(10, 30, 60, 0) 72%); }
.brain-stage { position: relative; width: 100%; height: 150px; display: grid; place-items: center; }
.brain-plexus { position: absolute; inset: 0; width: 100%; height: 100%; }
.brain-glyph { position: relative; z-index: 2; width: 82px; height: 82px; fill: none; stroke: #8fe3ff; stroke-width: 1;
  stroke-linecap: round; stroke-linejoin: round; animation: brain-breathe 3s ease-in-out infinite;
  filter: drop-shadow(0 0 7px rgba(56, 189, 248, .95)) drop-shadow(0 0 18px rgba(56, 189, 248, .55)); }
@keyframes brain-breathe {
  0%, 100% { opacity: .9; transform: scale(1); filter: drop-shadow(0 0 6px rgba(56, 189, 248, .75)) drop-shadow(0 0 16px rgba(56, 189, 248, .45)); }
  50% { opacity: 1; transform: scale(1.04); filter: drop-shadow(0 0 12px rgba(56, 189, 248, 1)) drop-shadow(0 0 26px rgba(56, 189, 248, .7)); }
}
.brain-status { font-size: 12.5px; color: var(--text-2); font-weight: 600; letter-spacing: .01em; text-align: center; padding: 0 6px; }
.copilot-brain.thinking .brain-glyph { stroke: #c4b5fd; animation-duration: 1s;
  filter: drop-shadow(0 0 11px rgba(167, 139, 250, 1)) drop-shadow(0 0 24px rgba(139, 92, 246, .7)); }
.copilot-brain.thinking .brain-status { color: var(--primary-2); }
@media (prefers-reduced-motion: reduce) { .brain-glyph { animation: none; } }

.copilot-thread { flex: 1; overflow-y: auto; padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.copilot-thread::-webkit-scrollbar { width: 8px; }
.copilot-thread::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
.copilot-input { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.copilot-input input { flex: 1; min-width: 0; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  border-radius: 12px; padding: 11px 14px; font: inherit; font-size: 14px; outline: 0; }
.copilot-input input:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-soft); }
.send-btn { flex-shrink: 0; width: 40px; height: 40px; border-radius: 11px; border: 0; cursor: pointer; background: var(--primary);
  color: #fff; font-size: 16px; display: grid; place-items: center; transition: background .15s; }
.send-btn:hover { background: #4f46e5; }
.send-btn:disabled { opacity: .5; cursor: default; }
.copilot-foot { padding: 8px 16px 12px; font-size: 11px; color: var(--muted); text-align: center; }
.copilot-fab { display: none; position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 56px; height: 56px; border-radius: 50%;
  border: 0; cursor: pointer; font-size: 24px; background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff; box-shadow: 0 10px 30px rgba(49, 46, 129, .5); }

/* mensagens em formato de conversa */
.copilot-thread .qa { background: transparent; border: 0; box-shadow: none; overflow: visible; }
.copilot-thread .qa-q { background: transparent; border: 0; padding: 0 0 10px; justify-content: flex-end; }
.copilot-thread .qa-q .who { display: none; }
.copilot-thread .qa-q .bubble { background: var(--primary); color: #fff; border-radius: 14px 14px 4px 14px; padding: 9px 13px; font-weight: 500; max-width: 86%; }
.copilot-thread .qa-q .when { margin: 0; width: 100%; text-align: right; }
.copilot-thread .qa-a { padding: 0; }
.copilot-thread .qa-a .ans { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: 11px 13px; font-size: 14px; font-weight: 450; }
.copilot-empty { color: var(--muted); font-size: 13px; padding: 8px 4px; }
.copilot-empty .chips { margin-top: 12px; }

/* ---------- brand + sidebar badges ---------- */
.brand-block { display: flex; flex-direction: column; line-height: 1.05; }
.brand-tag { font-size: 9.5px; text-transform: uppercase; letter-spacing: .16em; color: #6b7590; font-weight: 600; }
.nav .tag.on { color: var(--ok); border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .1); }
.nav .tag.alert { margin-left: auto; background: var(--err); color: #fff; border: 0; min-width: 18px; text-align: center; }
.nav .tag.alert:empty { display: none; }

/* ---------- topbar (referência) ---------- */
.tb-burger { display: none; border: 0; background: transparent; color: var(--text); font-size: 20px; cursor: pointer; }
.tb-company { display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px 12px; }
.tb-co-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-size: 14px; }
.period-tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; }
.period-tabs button { border: 0; background: transparent; color: var(--muted); font-weight: 600; padding: 7px 16px; border-radius: 9px; cursor: pointer; font-size: 13px; }
.period-tabs button.on { background: var(--primary); color: #fff; }
.month-select { border: 0; background: transparent; color: var(--muted); font-weight: 600; padding: 7px 12px; border-radius: 9px;
  cursor: pointer; font-size: 13px; font-family: inherit; outline: 0; max-width: 150px; }
.month-select.on { background: var(--primary); color: #fff; }
.month-select option { background: var(--surface); color: var(--text); }
.tb-date { font-size: 13px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; white-space: nowrap; }
.tb-icon { position: relative; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.tb-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tb-bell-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--err); border: 2px solid var(--surface); }

/* ---------- dashboard (Visão Geral) ---------- */
.greeting { margin: 4px 0 22px; }
.greeting h1 { font-size: 26px; font-weight: 750; }
.greeting p { margin: 5px 0 0; color: var(--muted); }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; container-type: inline-size; }
.kpi-card .kc-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kc-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.kc-ic.green { background: rgba(52, 211, 153, .16); color: var(--ok); }
.kc-ic.amber { background: rgba(245, 158, 11, .16); color: var(--warn); }
.kc-ic.blue { background: rgba(56, 189, 248, .16); color: var(--info); }
.kc-ic.violet { background: rgba(129, 140, 248, .18); color: var(--primary-2); }
.kc-ic.rose { background: rgba(244, 114, 182, .16); color: #f472b6; }
.kpi-card .kc-label { font-size: 13px; color: var(--muted); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-card .kc-value { font-size: clamp(18px, 12cqw, 27px); font-weight: 780; letter-spacing: -.02em; line-height: 1.12;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-card .kc-value.na { font-size: 15px; color: var(--muted); font-weight: 650; }
.kc-delta { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.kc-delta.up { color: var(--ok); }
.kc-delta.down { color: var(--err); }
.kc-delta.flat { color: var(--muted); }
.kc-delta small { color: var(--muted); font-weight: 500; }

.panel-head .drop { font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; }
.combo { width: 100%; height: 240px; display: block; }
.combo text { font-size: 10px; fill: var(--muted); }
.dash-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.dash-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.dash-legend .ln { width: 14px; height: 3px; border-radius: 2px; }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { flex-shrink: 0; }
.donut-legend { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 8px; }
.donut-legend .dl { display: grid; grid-template-columns: 12px 1fr auto auto; align-items: center; gap: 9px; font-size: 13px; }
.donut-legend .dot2 { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend .dl .nm { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-legend .dl .qt { font-weight: 700; font-variant-numeric: tabular-nums; }
.donut-legend .dl .pc { color: var(--muted); width: 40px; text-align: right; }

.alert-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); }
.alert-row:first-child { border-top: 0; }
.alert-row .ai { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; font-weight: 700; }
.alert-row .at { font-weight: 600; }
.alert-row .ad { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.goal-row { padding: 12px 0; border-top: 1px solid var(--border); }
.goal-row:first-child { border-top: 0; }
.goal-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 7px; }
.goal-top .gt { font-weight: 600; }
.goal-top .gv { color: var(--muted); font-variant-numeric: tabular-nums; }
.goal-track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.goal-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #818cf8); }
.na-panel { display: grid; place-items: center; text-align: center; color: var(--muted); min-height: 150px; gap: 6px; padding: 10px; }
.na-panel .glyph2 { font-size: 26px; opacity: .6; }

/* seletor de período (Vendas) */
.date-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dr-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.dr-sep { color: var(--muted); font-size: 13px; }
.date-range input[type="date"] { background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text);
  border-radius: 9px; padding: 7px 10px; font: inherit; color-scheme: dark; outline: 0; }
.date-range input[type="date"]:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-soft); }

/* painel do Cérebro acoplado + coluna principal estreita: esconde itens secundários da topbar */
@media (min-width: 1281px) and (max-width: 1780px) { .topbar .status, .user .tb-block { display: none; } }
@media (min-width: 1281px) and (max-width: 1480px) { .tb-date { display: none; } }

@media (max-width: 1280px) {
  .app { grid-template-columns: 248px minmax(0, 1fr); }
  .copilot { position: fixed; top: 0; right: 0; width: min(400px, 92vw); z-index: 50; transform: translateX(100%);
    transition: transform .22s ease; box-shadow: -12px 0 40px rgba(0, 0, 0, .5); }
  .copilot.open { transform: translateX(0); }
  .ch-close { display: block; }
  .copilot-fab { display: grid; place-items: center; }
}

@media (max-width: 1100px) {
  .g-4, .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2, .g-2-1, .g-1-2, .brain-cols, .brain-page { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .period-tabs button { padding: 7px 11px; }
  .tb-date { display: none; }
}
@media (max-width: 780px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 45; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .tb-burger { display: block; }
  .period-tabs { display: none; }
  .topbar { gap: 12px; padding: 0 16px; }
  .content { padding: 20px 16px 40px; }
  .g-4, .g-3, .g-6 { grid-template-columns: 1fr; }
}
