/* =============================================================================
   techub-v18.css · Camada visual do sistema, 100% sobre os tokens do kit
   -----------------------------------------------------------------------------
   Substitui styles.css + design-v9.css (V17). Nada aqui altera cálculo, filtro,
   consolidação, importação ou exportação: só aparência e espaçamento.
   Regras do kit seguidas em todo o arquivo:
   · cor = papel (receita, custo, resultado), nunca decoração; valores em tinta
   · rem sobre raiz fluida (14–26px), nada de px solto em texto
   · foco visível 2px, alvo mínimo 2,35rem nos controles
   · sem zebra, sem borda lateral colorida, sem texto < .86rem
   Índice
   01 Base            02 Rail            03 Topo e botões     04 Filtros
   05 KPIs            06 Cards e grades  07 Gráficos          08 Listas
   09 Tabelas         10 Selos           11 Projetos          12 Rodapé e modal
   13 Executivo       14 Catálogo        15 Responsivo        16 Impressão
============================================================================= */

/* 01 Base ------------------------------------------------------------------- */
html {
  font-size: clamp(14px, 7.85px + .45vw, 26px);
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
  background: var(--canvas);
  scroll-behavior: smooth;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
  --gap: var(--space-4);
  --pad-card: var(--space-5);
  --row-pad: .6rem;
  --exec-row: 6.5rem;
  --kpi-min: 14rem;
  --shell-pad: var(--layout-pad);
  --topbar-h: 4.7rem;
}
body[data-density="compact"] { --gap: var(--space-3); --pad-card: var(--space-4); --row-pad: .38rem; --exec-row: 6rem; --kpi-min: 12.5rem; }
body[data-density="comfortable"] { --gap: var(--space-5); --pad-card: var(--space-6); --row-pad: .8rem; --exec-row: 7.25rem; --kpi-min: 15rem; }
h1, h2, h3, h4, p, figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; }
a { color: var(--brand-text); text-decoration: none; border-bottom: 1px solid currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--ok-soft); }
.num, .money { font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* 02 Rail ------------------------------------------------------------------- */
.rail {
  position: fixed; inset: 0 auto 0 0; z-index: 70;
  width: var(--rail-w);
  display: flex; flex-direction: column;
  background: var(--rail); color: var(--on-rail);
  overflow: hidden;
  transition: width .22s var(--ease);
}
.rail:hover, .rail.is-pinned { width: var(--rail-open); box-shadow: var(--shadow-3); }
.rail.is-pinned { box-shadow: none; }
.rail .brand-block {
  position: relative; flex: 0 0 4.2rem;
  display: flex; align-items: center;
  width: 100%; margin: 0; padding: 0 0 0 calc((var(--rail-w) - 1.1rem) / 2);
  min-width: 0; overflow: hidden; background: transparent; border: 0;
}
.brand-emblem { display: none; }
.rail .brand-copy { width: 100%; min-width: 0; }
.rail .brand-copy > h1, .rail .brand-copy > p { display: none; }
.rail .brand-name { display: flex; align-items: center; gap: 0; font-size: 0; line-height: 0; }
.rail .brand-name::before {
  content: ""; flex: 0 0 1.1rem;
  width: 1.1rem; height: 1.1rem; margin-right: 0;
  border-radius: 4px;
  background: var(--brand-neon);
  box-shadow: 0 0 .9rem rgba(50, 255, 50, .5);
}
.rail .brand-name span { display: none; }
.rail .brand-name img { display: none; height: 1.6rem; width: auto; margin-left: .85rem; }
.rail:hover .brand-name img, .rail.is-pinned .brand-name img { display: block; }
.rail-pin {
  position: absolute; top: 1.1rem; right: .8rem;
  width: 1.9rem; height: 1.9rem;
  display: none; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .08); color: var(--on-rail); cursor: pointer;
}
.rail:hover .rail-pin, .rail.is-pinned .rail-pin { display: flex; }
.rail-pin:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.rail.is-pinned .rail-pin { color: var(--brand-neon); }
.rail-pin svg { width: 1.05rem; height: 1.05rem; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rail .tabs {
  flex: 1 1 auto; width: 100%; margin: 0;
  padding: .5rem .8rem 1rem;
  display: flex; flex-direction: column; gap: .3rem;
  overflow: hidden auto; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  scrollbar-width: none;
}
.tab {
  position: relative; width: 100%; min-height: 2.6rem;
  padding: 0 .85rem;
  display: flex; align-items: center; justify-content: flex-start; gap: 0;
  border-radius: var(--radius-md); background: transparent; color: var(--on-rail);
  font-family: var(--font-sans); font-size: 0; font-weight: 500; text-align: left; white-space: nowrap;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.rail:hover .tab, .rail.is-pinned .tab { font-size: .93rem; gap: .8rem; }
.tab .tab-icon { flex: 0 0 1.3rem; width: 1.3rem; height: 1.3rem; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tab:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.tab.active { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; }
.tab.active .tab-icon { color: var(--brand-neon); }
.tab.active::after {
  content: ""; position: absolute; left: -.8rem; top: .55rem; bottom: .55rem;
  width: .2rem; border-radius: 0 .2rem .2rem 0; background: var(--brand-neon);
}
.tab:focus-visible { outline-color: var(--brand-neon); }
.rail-foot {
  flex: 0 0 auto; display: flex; align-items: center; gap: .65rem;
  padding: .8rem 0 1rem calc((var(--rail-w) - .5rem) / 2);
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 0; color: var(--on-rail); white-space: nowrap;
}
.rail:hover .rail-foot, .rail.is-pinned .rail-foot { font-size: .86rem; }
.rail-foot i { flex: 0 0 .5rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--brand-neon); box-shadow: 0 0 .6rem rgba(50, 255, 50, .5); }

/* 03 Topo e botões ---------------------------------------------------------- */
.app-shell {
  min-height: 100vh; display: flex; flex-direction: column;
  margin-left: var(--rail-w); padding-bottom: 2.6rem;
  background: var(--canvas);
  transition: margin-left .22s var(--ease);
}
body.rail-pinned .app-shell { margin-left: var(--rail-open); }
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--shell-pad);
  background: var(--canvas); border: 0;
}
.page-heading { min-width: 0; max-width: 100%; flex: 1 1 auto; }
.page-heading h1 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; line-height: 1.2; letter-spacing: .03em;
  text-transform: uppercase; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.page-heading p { margin-top: .15rem; font-size: .93rem; line-height: 1.4; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.update-card { display: none; }
.topbar-actions { flex: 0 1 auto; margin-left: auto; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 2.35rem; padding: 0 .95rem;
  border: 1px solid var(--control-border); border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink);
  font-family: var(--font-sans); font-size: .93rem; font-weight: 500; line-height: 1; letter-spacing: 0;
  white-space: nowrap; cursor: pointer;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary, .btn-brand { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
.btn-primary:hover:not(:disabled), .btn-brand:hover:not(:disabled) { background: var(--brand); filter: brightness(.94); }
.btn-secondary, .btn-light { background: var(--surface); color: var(--ink); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--brand-text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.topbar .btn-ghost { border-color: var(--control-border); color: var(--ink); background: var(--surface); }
.btn-small { min-height: 1.95rem; padding: 0 .7rem; font-size: .86rem; }
.btn svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* segmentado: densidade e demais alternâncias */
.density-switch, .seg {
  display: inline-flex; gap: 2px; padding: 2px;
  border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--surface);
}
.density-switch button, .seg button {
  min-height: 1.95rem; padding: 0 .8rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: calc(var(--radius-md) - 2px); background: transparent; color: var(--ink-2);
  font-size: .93rem; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.density-switch button:hover, .seg button:hover { background: var(--surface-2); }
.density-switch button.active, .seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); font-weight: 600; }
.density-switch button svg { display: none; }

/* aviso de importação (Estados do kit): sempre legível, cor + ícone + palavra */
.upload-status {
  display: flex; align-items: flex-start; gap: var(--space-3);
  margin: 0 var(--shell-pad) var(--space-3); padding: .6rem .85rem;
  border-radius: var(--radius-md); background: var(--info-soft); color: var(--info-text);
  font-size: .93rem; line-height: 1.4;
}
.upload-status .status-line { flex: 0 0 1.05rem; width: 1.05rem; height: 1.05rem; margin-top: .15rem; align-self: flex-start; border-radius: 50%; border: 2px solid currentColor; background: none; position: relative; }
.upload-status .status-line::after { content: ""; position: absolute; left: 50%; top: 22%; width: 2px; height: 34%; margin-left: -1px; background: currentColor; }
.upload-status strong { font-weight: 700; color: inherit; }
.upload-status p { margin-top: .05rem; font-size: .93rem; color: inherit; }
.upload-status.is-ok { background: var(--ok-soft); color: var(--ok-text); }
.upload-status.is-warn { background: var(--warn-soft); color: var(--warn-text); }
.upload-status.is-err { background: var(--crit-soft); color: var(--crit-text); }
.upload-status.is-busy .status-line { border-right-color: transparent; animation: kit-spin .9s linear infinite; }
.upload-status.is-busy .status-line::after { display: none; }
@keyframes kit-spin { to { transform: rotate(360deg); } }

/* estado vazio (antes da primeira importação) */
.state {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .6rem;
  padding: var(--space-6) var(--space-5);
  background: var(--surface); border: 1px dashed var(--control-border); border-radius: var(--radius-lg);
}
.state .ico { width: 2.6rem; height: 2.6rem; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); background: var(--neutral-soft); color: var(--ink-2); }
.state .ico svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.state h3 { font-family: var(--font-display); font-weight: 600; font-size: .93rem; line-height: 1.3; color: var(--ink); }
.state p { max-width: 34rem; font-size: .93rem; line-height: 1.5; color: var(--ink-2); }
.state--err .ico { background: var(--crit-soft); color: var(--crit-text); }
.state-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; margin-top: .2rem; }
#emptyState { margin: var(--space-4) var(--shell-pad) 0; }
#emptyState[hidden], #dashboard:not([hidden]) ~ #emptyState { display: none !important; }
#dashboard[hidden] ~ #emptyState[hidden] { display: flex !important; }
.skl { border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: skl 1.4s linear infinite; }
@keyframes skl { to { background-position: -200% 0; } }

/* 04 Filtros ---------------------------------------------------------------- */
.filter-panel {
  position: sticky; top: var(--topbar-h); z-index: 35;
  margin: 0; padding: 0 var(--shell-pad) var(--space-3);
  background: var(--canvas);
}
.filter-grid {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
/* campo = pílula "rótulo  valor ⌄" (ftrig do kit) */
.filter-field {
  position: relative; display: flex; align-items: center; gap: .5rem;
  min-width: 0; min-height: 2.35rem; padding: 0 .8rem;
  border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--surface);
  cursor: pointer;
}
.filter-field:hover { background: var(--surface-2); }
.filter-field:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.filter-field > span { display: flex; align-items: center; margin: 0; font-size: .93rem; font-weight: 400; color: var(--muted); white-space: nowrap; }
.filter-field > span svg { display: none; }
.filter-field .multi-filter { position: static; flex: 1 1 auto; min-width: 0; width: auto; }
.multi-trigger {
  position: relative; display: flex; align-items: center; gap: .5rem; width: 100%; min-height: 2.2rem;
  padding: 0 1.5rem 0 0; border: 0; background: transparent; color: var(--ink);
  font-size: .93rem; font-weight: 600; text-align: left; cursor: pointer;
}
.multi-trigger:focus-visible { outline: none; }
.multi-trigger span { display: block; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-trigger i {
  position: absolute; right: .15rem; top: 50%; width: .5rem; height: .5rem;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transform: translateY(-70%) rotate(45deg); transition: transform .18s var(--ease);
}
.multi-filter.open .multi-trigger i { transform: translateY(-30%) rotate(225deg); }
.multi-menu {
  position: absolute; left: 0; top: calc(100% + .4rem); z-index: 60;
  display: none; min-width: 14rem; max-width: min(22rem, 88vw);
  padding: .4rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-3);
}
.multi-menu.align-right { left: auto; right: 0; }
.multi-filter.open .multi-menu { display: block; }
.multi-clear {
  width: 100%; min-height: 1.95rem; padding: 0 .6rem; margin-bottom: .2rem;
  border-radius: var(--radius-sm); background: transparent; color: var(--brand-text);
  font-size: .86rem; font-weight: 600; text-align: left; cursor: pointer;
}
.multi-clear:hover { background: var(--surface-2); }
.multi-options { max-height: 16rem; overflow: auto; scrollbar-width: thin; }
.multi-option {
  display: grid; grid-template-columns: 1.05rem minmax(0, 1fr); align-items: center; gap: .6rem;
  min-height: 2rem; padding: .35rem .6rem; border-radius: var(--radius-sm);
  font-size: .93rem; font-weight: 400; color: var(--ink); cursor: pointer;
}
.multi-option:hover { background: var(--surface-2); }
.multi-option input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--brand-text); }
.multi-option span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: normal; max-height: 2.8rem; }
.multi-empty { padding: .7rem; font-size: .93rem; color: var(--muted); }
.filter-search { flex: 1 1 16rem; min-width: 14rem; cursor: text; }
.filter-search:hover { background: var(--surface); }
.filter-search > span { gap: .45rem; }
.filter-search input {
  flex: 1 1 auto; min-width: 0; width: 100%; height: 2.2rem; padding: 0; border: 0; outline: none;
  background: transparent; color: var(--ink); font-size: .93rem;
}
.filter-search input::placeholder { color: var(--muted); }
.filter-search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
#btnResetFilters, .btn.btn-light#btnClearProjectFocus { border-color: transparent; background: transparent; color: var(--brand-text); font-weight: 600; }
#btnResetFilters:hover:not(:disabled), #btnClearProjectFocus:hover:not(:disabled) { background: var(--surface-2); }
#btnResetFilters::before, #btnClearProjectFocus::before {
  content: ""; width: .8rem; height: .8rem; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat;
}
.scope-chips { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0 var(--shell-pad) var(--space-3); font-size: .93rem; color: var(--ink-2); }
.scope-chips b, .scope-chips strong { color: var(--ink); font-weight: 600; }
.scope-chip { display: inline-flex; align-items: center; gap: .4rem; min-height: 1.65rem; padding: 0 .3rem 0 .65rem; border-radius: var(--radius-pill); background: var(--neutral-soft); color: var(--ink-2); font-size: .86rem; font-weight: 500; }
.scope-chip b { font-weight: 700; color: var(--ink); }
.scope-chip button { width: 1.2rem; height: 1.2rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: transparent; color: var(--ink-2); font-size: 1rem; line-height: 1; cursor: pointer; }
.scope-chip button:hover { background: var(--line); }
.scope-chips .btn { min-height: 1.65rem; padding: 0 .65rem; font-size: .86rem; border-color: transparent; background: transparent; color: var(--brand-text); font-weight: 600; }
.pa-status-notice {
  display: flex; align-items: flex-start; gap: var(--space-3); flex-wrap: wrap;
  margin: 0 var(--shell-pad) var(--space-3); padding: .6rem .85rem;
  border-radius: var(--radius-md); background: var(--warn-soft); color: var(--warn-text); font-size: .93rem; line-height: 1.4;
}
.pa-status-notice button { min-height: 1.65rem; padding: 0 .75rem; border: 1px solid var(--warn-text); border-radius: var(--radius-pill); background: transparent; color: var(--warn-text); font-size: .86rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pa-status-notice button:hover { background: rgba(138, 90, 0, .1); }

/* 05 KPIs ------------------------------------------------------------------- */
.content { flex: 1; padding: 0 var(--shell-pad) var(--space-6); margin: 0; max-width: none; }
.dashboard { display: block; padding: 0; }
.summary-strip, .kpi-toolbar { display: none; }
.is-refreshing .kpi-card, .is-refreshing .card { animation: none; }
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--kpi-min), 1fr));
  gap: var(--gap); margin: 0 0 var(--gap);
}
.kpi-card {
  --c: var(--ink);
  position: relative; min-width: 0;
  display: flex; flex-direction: column; gap: .35rem;
  padding: var(--space-4) var(--space-5);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.kpi-label { display: flex; align-items: center; gap: .5rem; font-size: .93rem; font-weight: 500; line-height: 1.3; color: var(--ink-2); text-transform: none; letter-spacing: 0; }
.kpi-label span { order: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-label i { order: 1; display: none; flex: none; width: .6rem; height: .6rem; border-radius: 2px; background: var(--c); }
/* marcador só quando o KPI é um papel financeiro (classe role-* posta por techub-kit-ui.js) */
.kpi-card.role-rl, .kpi-card.role-rb { --c: var(--rl); }
.kpi-card.role-custo { --c: var(--custo); }
.kpi-card.role-resultado { --c: var(--resultado); }
.kpi-card.role-ajuste { --c: var(--ajuste); }
.kpi-card[class*="role-"] .kpi-label i { display: block; }
.kpi-card.role-rb .kpi-label i { background: var(--rb); box-shadow: inset 0 0 0 2px var(--rl); }
.kpi-value {
  margin: 0; font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums;
  font-size: 1.85rem; font-weight: 650; line-height: 1.1; letter-spacing: -.01em; color: var(--ink);
  white-space: nowrap; min-width: 0;
}
.kpi-value.nd, .kpi-value.is-nd { color: var(--muted); }
.kpi-meta {
  margin: 0; min-height: 0; display: flex; align-items: center; gap: .4rem;
  font-size: .86rem; line-height: 1.35; color: var(--muted);
}
.kpi-meta.positive { color: var(--ok-text); font-weight: 600; }
.kpi-meta.negative { color: var(--crit-text); font-weight: 600; }
.kpi-meta.warning { color: var(--warn-text); font-weight: 600; }
.kpi-spark { height: 2.1rem; margin-top: .2rem; }
.kpi-spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.kpi-spark polyline, .kpi-spark path { fill: none; stroke: var(--c, var(--ink)); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.kpi-spark circle { fill: var(--c, var(--ink)); }
/* variação: ícone + valor colorido pelo status que o próprio cartão já calcula; o resto em cinza */
:root {
  --ic-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M6 11l6-6 6 6'/%3E%3C/svg%3E");
  --ic-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M6 13l6 6 6-6'/%3E%3C/svg%3E");
  --ic-flat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
}
.kpi-meta .kg { flex: none; display: inline-block; width: .9rem; height: .9rem; font-size: 0; background: currentColor; -webkit-mask: var(--ic-up) center / contain no-repeat; mask: var(--ic-up) center / contain no-repeat; }
.kpi-meta .kg.dn { -webkit-mask-image: var(--ic-down); mask-image: var(--ic-down); }
.kpi-meta .kg.eq { -webkit-mask-image: var(--ic-flat); mask-image: var(--ic-flat); }
.kpi-meta .kd { font-weight: 650; }
.kpi-meta .kx { display: none; }
.kpi-card.status-positive .kpi-meta .kg, .kpi-card.status-positive .kpi-meta .kd { color: var(--ok-text); }
.kpi-card.status-negative .kpi-meta .kg, .kpi-card.status-negative .kpi-meta .kd { color: var(--crit-text); }
.kpi-card.status-warning .kpi-meta .kg, .kpi-card.status-warning .kpi-meta .kd { color: var(--warn-text); }
.kpi-card.status-neutral .kpi-meta .kg, .kpi-card.status-neutral .kpi-meta .kd { color: var(--ink-2); }

/* 06 Cards e grades ---------------------------------------------------------- */
.panel { display: none; }
.panel.active { display: block; }
.card {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4);
  padding: var(--pad-card) var(--pad-card) var(--space-2);
  border: 0; background: transparent;
}
.card-header h3 { font-family: var(--font-display); font-weight: 600; font-size: .93rem; line-height: 1.3; letter-spacing: .01em; color: var(--ink); }
.card-header p { margin-top: .15rem; font-size: .93rem; line-height: 1.4; color: var(--muted); }
.table-header { align-items: center; }
.grid-2x1 { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.panel > .card { margin-bottom: var(--gap); }

/* controles de seção: cada controle é uma pílula "rótulo  valor" (fbar do kit) */
.section-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
  margin: 0 0 var(--gap); padding: var(--space-3) var(--space-4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.section-controls label {
  position: relative; display: flex; align-items: center; gap: .5rem;
  flex: 0 1 auto; min-width: 0; max-width: 100%; min-height: 2.35rem; padding: 0 .8rem;
  border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--surface);
}
.section-controls label:hover { background: var(--surface-2); }
.section-controls label:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.section-controls label span { margin: 0; font-size: .93rem; font-weight: 400; color: var(--muted); white-space: nowrap; text-transform: none; letter-spacing: 0; }
.section-controls input, .section-controls select {
  min-width: 0; height: 2.2rem; padding: 0; border: 0; outline: none; background: transparent;
  color: var(--ink); font-size: .93rem; font-weight: 600;
}
.section-controls input[type="search"] { width: 14rem; font-weight: 500; }
.section-controls input[type="number"] { width: 7.5rem; font-weight: 500; }
.section-controls input::placeholder { color: var(--muted); font-weight: 400; }
select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 1.4rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0d0f' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right .1rem center / .9rem no-repeat;
}
.section-controls .btn { min-height: 2.35rem; }

/* 07 Gráficos ---------------------------------------------------------------- */
.chart-card { display: flex; flex-direction: column; min-height: 0; }
.chart-card .card-header { flex: 0 0 auto; }
.v8-legacy-canvas, .chart-card canvas { display: none; }
.v8-chart { position: relative; width: 100%; padding: .1rem var(--pad-card) .25rem; flex: 1 1 auto; min-height: var(--chart-min-h); }
.v8-svg, .tk-plot svg { display: block; width: 100%; height: 100%; overflow: visible; max-width: 100%; }
.tk-plot { position: relative; width: 100%; }
/* SVG dos gráficos (kit): eixos, rótulos, grade, alvos de hover */
.tk-plot .ax { fill: var(--ink-2); font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums; }
.tk-plot .ax.m { fill: var(--muted); }
.tk-plot .lbl { fill: var(--ink); font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums; font-weight: 600; }
.tk-plot .lbl.s { font-weight: 500; fill: var(--ink-2); }
.tk-plot .gl { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.tk-plot .zl { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.tk-plot .hit { fill: transparent; }
.tk-plot svg text { pointer-events: none; }
.tk-tip .r i.nos { display: none; }
.tk-plot .halo { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.tk-plot .cross { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.tk-plot .col:hover .cross { opacity: .9; }
.tk-plot .col .pt { opacity: 0; }
.tk-plot .col:hover .pt { opacity: 1; }
.tk-plot .mk { transition: opacity .1s; }
.tk-plot .dim { opacity: .18; }
/* foco ao passar o mouse */
.tk-plot svg :is(path.bar, path.mk, rect.mk, circle.mk, g[data-tip], text.lbl, polyline, circle.pt) { transition: opacity .14s ease, filter .14s ease, stroke-width .14s ease; }
.tk-plot svg .tk-dim { opacity: .22; }
.tk-plot svg .sib { opacity: .62; }
.tk-plot svg .zone { fill: var(--ink); opacity: .07; pointer-events: none; }
.tk-plot svg circle.zone { opacity: .14; }
.tk-plot svg .guide { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.tk-plot svg .tmp { pointer-events: none; }
.tk-plot svg :is(path, rect, circle).is-m { stroke: var(--ink) !important; stroke-width: 2px !important; filter: drop-shadow(0 2px 5px rgba(0,0,0,.32)); }
.tk-plot svg g.is-m > :is(path, rect:not(.hit)) { stroke: var(--ink); stroke-width: 2px; filter: drop-shadow(0 2px 5px rgba(0,0,0,.28)); }
.tk-plot svg :is(circle.pt, circle.mk).is-m { transform-box: fill-box; transform-origin: center; transform: scale(1.7); }
.tk-plot svg[data-c="scatter"] g.is-m > :is(path, rect:not(.hit), circle:not(.hit)) { transform-box: fill-box; transform-origin: center; transform: scale(1.8); stroke: var(--ink) !important; stroke-width: 2px !important; }
.tk-plot svg polyline.is-s { stroke-width: 3.5px !important; }
.tk-plot svg g[data-pk] { cursor: pointer; }
/* animação de abertura (uma vez, quando o gráfico aparece) */
@keyframes tk-sy { from { transform: scaleY(0); } }
@keyframes tk-sx { from { transform: scaleX(0); } }
@keyframes tk-pop { from { transform: scale(0); } }
@keyframes tk-fade { from { opacity: 0; } }
@keyframes tk-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.tk-in :is(.a-up, .a-dn, .a-rt, .a-lt, .a-pop) { transform-box: fill-box; }
.tk-in .a-up { transform-origin: 50% 100%; animation: tk-sy .7s cubic-bezier(.22,.8,.24,1) both; animation-delay: var(--d, 0ms); }
.tk-in .a-dn { transform-origin: 50% 0; animation: tk-sy .7s cubic-bezier(.22,.8,.24,1) both; animation-delay: var(--d, 0ms); }
.tk-in .a-rt { transform-origin: 0 50%; animation: tk-sx .7s cubic-bezier(.22,.8,.24,1) both; animation-delay: var(--d, 0ms); }
.tk-in .a-lt { transform-origin: 100% 50%; animation: tk-sx .7s cubic-bezier(.22,.8,.24,1) both; animation-delay: var(--d, 0ms); }
.tk-in .a-pop { transform-origin: 50% 50%; animation: tk-pop .45s cubic-bezier(.3,1.5,.5,1) both; animation-delay: var(--d, 0ms); }
.tk-in .a-fade { animation: tk-fade .5s ease-out both; animation-delay: var(--d, 0ms); }
.tk-in .a-draw { stroke-dasharray: 1; animation: tk-draw .9s ease-out both; animation-delay: var(--d, 300ms); }
@media (prefers-reduced-motion: reduce) { .tk-in :is(.a-up, .a-dn, .a-rt, .a-lt, .a-pop, .a-fade, .a-draw) { animation: none !important; } .tk-plot svg * { transition: none !important; } }
.v8-empty { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 8rem; font-size: .93rem; color: var(--muted); }
.v8-chart.is-clickable { cursor: pointer; }
.chart-legend, .v9-legend {
  display: flex; flex-wrap: wrap; gap: .35rem var(--space-4);
  padding: .1rem var(--pad-card) var(--pad-card);
  font-size: .93rem; color: var(--ink-2);
}
.chart-legend span { display: inline-flex; align-items: center; gap: .45rem; min-height: 0; padding: 0; border: 0; background: transparent; font-weight: 400; }
.chart-legend i { flex: none; width: .7rem; height: .7rem; border-radius: 2px; background: var(--ajuste); box-shadow: none; }
.chart-legend .legend-net { background: var(--rl); }
.chart-legend .legend-exp { background: var(--custo); }
.chart-legend .legend-result { background: var(--resultado); border-radius: 50%; }
.chart-legend .legend-brut { background: var(--rb); box-shadow: inset 0 0 0 2px var(--rl); }
.chart-legend .legend-trend { height: 0; width: 1.1rem; border-radius: 0; background: none; border-top: 2px dashed var(--ink-2); }
#panel-costs .chart-legend .legend-net { background: var(--custo-2); border-radius: 2px; }
#panel-costs .chart-legend .legend-result { background: var(--cat-5); border-radius: 2px; }
.compact-legend { padding-top: 0; }
.v9-legend button {
  all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: .45rem;
  padding: .1rem .35rem; border-radius: var(--radius-sm); color: var(--ink-2); font-size: .93rem; cursor: pointer;
}
.v9-legend button i { flex: none; width: .7rem; height: .7rem; border-radius: 2px; }
.v9-legend button:hover { background: var(--surface-2); }
.v9-legend button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.v9-legend button.is-off { opacity: .45; }
.risk-legend { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: .1rem var(--pad-card) var(--pad-card); }
.risk-legend span { display: inline-flex; align-items: center; height: 1.65rem; padding: 0 .65rem; border-radius: var(--radius-pill); font-size: .86rem; font-weight: 600; }
.risk-legend span::before { content: ""; flex: none; width: .62rem; height: .62rem; margin-right: .4rem; background: currentColor; border-radius: 50%; }
.risk-legend .risk-critical::before { border-radius: 1px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.risk-legend .risk-attention::before { border-radius: 0; clip-path: polygon(50% 5%, 100% 95%, 0 95%); }
.risk-critical { background: var(--crit-soft); color: var(--crit-text); }
.risk-attention { background: var(--warn-soft); color: var(--warn-text); }
.risk-healthy { background: var(--ok-soft); color: var(--ok-text); }
.risk-excellent { background: var(--ok-soft); color: var(--ok-text); }
/* cartão de série temporal no kit: tooltip e rótulos de SVG */
.chart-tooltip, .tk-tip {
  position: fixed; z-index: 200; pointer-events: none;
  min-width: 11rem; max-width: 20rem; padding: .55rem .75rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-3);
  font-size: .93rem; line-height: 1.4; opacity: 0; transition: opacity .08s;
}
.chart-tooltip.is-visible, .tk-tip.on { opacity: 1; }
.chart-tooltip strong, .tk-tip b { display: block; margin-bottom: .3rem; font-weight: 600; color: var(--ink); }
.chart-tooltip span { display: flex; align-items: center; gap: .5rem; margin-top: .1rem; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-tooltip span i { flex: none; width: .65rem; height: .65rem; border-radius: 2px; }
.tk-tip .r { display: flex; align-items: center; gap: .5rem; color: var(--ink-2); }
.tk-tip .r i { flex: none; width: .65rem; height: .65rem; border-radius: 2px; background: var(--c); }
.tk-tip .r i.ln { height: 0; width: .9rem; border-radius: 0; background: none; border-top: 2px solid var(--c); }
.tk-tip .r i.dot { border-radius: 50%; }
.tk-tip .r span { flex: 1; }
.tk-tip .r em { font-style: normal; font-family: var(--font-num); font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.tk-tip .r.on { margin: 0 -.35rem; padding: .05rem .35rem; border-radius: .3rem; background: var(--surface-2); }
.tk-tip .r.on span { color: var(--ink); font-weight: 600; }
.tk-tip .n { margin-top: .3rem; font-size: .86rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .chart-tooltip, .tk-tip, .skl { transition: none; animation: none; } }

/* slicer de período dentro do cartão de evolução */
.chart-slicer { margin: 0 var(--pad-card) var(--pad-card); padding: var(--space-3) var(--space-4); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-md); }
.chart-slicer-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.chart-slicer-head span { display: block; font-size: .86rem; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 400; }
.chart-slicer-head strong { display: block; font-size: .93rem; font-weight: 600; color: var(--ink); }
.chart-slicer-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
.toggle-check { display: inline-flex; align-items: center; gap: .45rem; min-height: 1.95rem; padding: 0 .7rem; border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink-2); font-size: .86rem; font-weight: 500; cursor: pointer; }
.toggle-check input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--brand-text); }
.dual-range { position: relative; height: 1.4rem; margin: .4rem .45rem 0; }
.dual-range::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: .3rem; margin-top: -.15rem; border-radius: var(--radius-pill); background: var(--line-strong); }
.dual-range input[type="range"] { position: absolute; left: 0; top: 0; width: 100%; height: 1.4rem; margin: 0; background: transparent; pointer-events: none; appearance: none; -webkit-appearance: none; }
.dual-range input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--ink); border: 2px solid var(--surface); box-shadow: var(--shadow-2); cursor: pointer; pointer-events: auto; }
.dual-range input[type="range"]::-moz-range-thumb { width: 1rem; height: 1rem; border-radius: 50%; background: var(--ink); border: 2px solid var(--surface); box-shadow: var(--shadow-2); cursor: pointer; pointer-events: auto; }
.dual-range input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--focus); outline-offset: 2px; }
.dual-range-labels { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--space-2); align-items: center; font-size: .86rem; color: var(--muted); }
.dual-range-labels span:nth-child(2) { color: var(--brand-text); font-weight: 600; text-align: center; }
.dual-range-labels span:last-child { text-align: right; }

/* 08 Listas ------------------------------------------------------------------ */
.mini-list, .bar-list, .alerts-list, .critical-list, .pareto-list { padding: .25rem var(--pad-card) var(--pad-card); }
.mini-list { display: grid; gap: .1rem; }
.mini-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3);
  padding: .45rem 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent;
  font-size: .93rem;
}
.mini-item:last-child { border-bottom: 0; }
.mini-item span { color: var(--ink-2); font-size: .93rem; }
.mini-item strong { font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums; font-weight: 600; font-size: .93rem; text-align: right; color: var(--ink); }

/* Ranking do kit: rótulo à esquerda, barra a partir de um eixo, valor ao fim */
.bar-list { display: grid; gap: .55rem; }
.bar-row {
  --c: var(--custo);
  position: relative; min-width: 0; margin: 0; padding: .1rem 0;
  display: grid; grid-template-columns: minmax(7rem, 36%) minmax(0, 1fr) auto; column-gap: var(--space-3); row-gap: .15rem; align-items: center;
  border-radius: var(--radius-sm);
}
.bar-row-head { display: contents; }
.bar-row-head strong {
  grid-column: 1; grid-row: 1; min-width: 0; max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: right; font-size: .93rem; font-weight: 400; color: var(--ink);
}
.bar-row-head span {
  grid-column: 3; grid-row: 1; max-width: none; white-space: nowrap;
  font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums; font-size: .93rem; font-weight: 600; color: var(--ink);
}
.bar-track {
  grid-column: 2; grid-row: 1; position: relative; height: 1.3rem; overflow: visible;
  border-radius: 0; background: transparent; box-shadow: none; border-left: 1px solid var(--line-strong);
}
.bar-fill {
  display: block; height: 100%; min-width: 2px; border-radius: 0 var(--chart-bar-radius) var(--chart-bar-radius) 0;
  background: var(--c); box-shadow: none; transform-origin: left center;
  animation: kit-grow-x .7s cubic-bezier(.22, .8, .24, 1) both;
}
@keyframes kit-grow-x { from { transform: scaleX(0); } }
.bar-fill.green { --c: var(--rl); } .bar-fill.red { --c: var(--div-neg-2); }
.bar-fill.warn { --c: var(--custo-2); } .bar-fill.neutral { --c: var(--custo); }
#revenueByType .bar-fill, #topProjects .bar-fill { background: var(--rl); }
#marginByType .bar-fill.green, #topProjects.is-result .bar-fill.green { background: var(--resultado); }
#marginByType .bar-fill.red, #topProjects.is-result .bar-fill.red { background: var(--div-neg-2); }
#revenueDeductionsBreakdown .bar-fill { background: var(--custo-2); }
#costComposition .bar-fill, .project-cost-bars .bar-fill { background: var(--custo); }
.bar-sub { grid-column: 2 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: .1rem var(--space-3); margin: 0; font-size: .86rem; line-height: 1.35; color: var(--muted); min-width: 0; }
.bar-sub span { padding: 0; }
.bar-sub:empty { display: none; }
.bar-row.project-action-trigger { cursor: pointer; }
.bar-row.project-action-trigger:hover, .bar-row.is-clickable:hover { background: var(--surface-2); }
/* divergente: barras saem de um eixo central (resultado negativo à esquerda) */
.bar-list.is-diverging .bar-track { border-left: 0; }
.bar-list.is-diverging .bar-track::before { content: ""; position: absolute; left: 50%; top: -.1rem; bottom: -.1rem; width: 1px; background: var(--line-strong); }
.bar-list.is-diverging .bar-fill { position: absolute; top: 0; left: 50%; border-radius: 0 var(--chart-bar-radius) var(--chart-bar-radius) 0; transform: scaleX(.5); transform-origin: left center; animation: kit-grow-div .7s cubic-bezier(.22, .8, .24, 1) both; }
.bar-list.is-diverging .bar-row[data-neg] .bar-fill { left: auto; right: 50%; border-radius: var(--chart-bar-radius) 0 0 var(--chart-bar-radius); transform-origin: right center; }
@keyframes kit-grow-div { from { transform: scaleX(0); } }
.empty-row, .multi-empty { color: var(--muted); font-size: .93rem; }
.data-table td.empty-row { text-align: center; padding: 1.4rem; }

.pareto-list { display: grid; gap: .55rem; }
.pareto-item { display: grid; grid-template-columns: minmax(7rem, 36%) minmax(0, 1fr) 3.4rem; gap: var(--space-3); align-items: center; margin: 0; font-size: .93rem; }
.pareto-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; color: var(--ink); }
.pareto-bar { height: 1.1rem; overflow: visible; border-radius: 0; background: transparent; border-left: 1px solid var(--line-strong); }
.pareto-bar > i { display: block; height: 100%; border-radius: 0 var(--chart-bar-radius) var(--chart-bar-radius) 0; background: var(--custo); transform-origin: left center; animation: kit-grow-x .7s cubic-bezier(.22, .8, .24, 1) both; }
.pareto-item b { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums; font-size: .93rem; font-weight: 600; color: var(--ink); }

/* pontos de atenção: selo de status em vez de barra colorida lateral */
.alerts-list { display: grid; gap: var(--space-2); }
.alert-card {
  --st: var(--crit-text); --stbg: var(--crit-soft);
  display: block; padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface);
}
.alert-card.warn { --st: var(--warn-text); --stbg: var(--warn-soft); }
.alert-card.good { --st: var(--ok-text); --stbg: var(--ok-soft); }
.alert-card[data-project-key] { cursor: pointer; transition: background-color .15s, border-color .15s; }
.alert-card[data-project-key]:hover { background: var(--surface-2); }
.alert-card[data-open-project] { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.alert-card[data-open-project] .alert-main { flex: 1 1 auto; min-width: 0; }
.alert-card[data-open-project]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.alert-go { flex: none; display: flex; align-items: center; gap: .35rem; }
.alert-open { display: inline-flex; align-items: center; gap: .2rem; font-size: .86rem; font-weight: 600; color: var(--muted); }
.alert-open i { font-style: normal; font-size: 1.15rem; line-height: 1; transition: transform .15s; }
.alert-card[data-open-project]:hover .alert-open, .alert-card[data-open-project]:focus-visible .alert-open { color: var(--ink); }
.alert-card[data-open-project]:hover .alert-open i, .alert-card[data-open-project]:focus-visible .alert-open i { transform: translateX(2px); }
.alert-more { width: 1.9rem; height: 1.9rem; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: var(--radius-pill); background: transparent; color: var(--muted); font-size: 1.05rem; line-height: 1; cursor: pointer; }
.alert-more:hover, .alert-more:focus-visible { background: var(--surface); border-color: var(--line); color: var(--ink); }
@media (max-width: 520px) { .alert-open { display: none; } }
.alert-card::before { display: none; }
.alert-card strong { display: flex; align-items: center; gap: .5rem; font-size: .93rem; font-weight: 600; line-height: 1.3; color: var(--ink); }
.alert-card strong::before {
  content: ""; flex: none; width: 1.4rem; height: 1.4rem; border-radius: var(--radius-pill);
  background: var(--st); -webkit-mask: none; mask: none;
  background-color: var(--stbg);
  background-image: var(--ic-crit); background-repeat: no-repeat; background-position: center; background-size: .95rem;
}
.alert-card p { margin-top: .25rem; font-size: .93rem; line-height: 1.4; color: var(--ink-2); }
.alert-metrics { display: flex; flex-wrap: wrap; gap: .2rem var(--space-5); margin-top: .35rem; font-size: .86rem; color: var(--muted); }
.alert-metrics span { display: flex; flex-direction: column; gap: .05rem; }
.alert-metrics b { font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums; font-size: .93rem; font-weight: 600; color: var(--ink); }
.alert-metrics b.negative, .alert-metrics b.positive, .alert-metrics b.warning { color: var(--ink); }

.critical-list { display: block; }
.critical-row {
  display: grid; grid-template-columns: minmax(7rem, 1.4fr) repeat(3, minmax(4.5rem, .75fr)); gap: var(--space-3); align-items: center;
  padding: var(--row-pad) .5rem; border-bottom: 1px solid var(--line);
  font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums; font-size: .93rem;
}
.critical-row > span:not(:first-child) { text-align: right; }
.critical-row strong { font-family: var(--font-sans); font-size: .93rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.critical-row.header { border: 0; border-bottom: 1px solid var(--line-strong); background: var(--surface-2); font-family: var(--font-sans); font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.critical-row:not(.header) { cursor: pointer; }
.critical-row:not(.header):hover { background: var(--surface-2); }
.critical-row .negative, .critical-row .positive, .critical-row .warning { color: var(--ink); font-weight: 400; }
.margin-summary { display: none; }

/* 09 Tabelas ------------------------------------------------------------------ */
.table-scroll { width: 100%; overflow: auto; max-height: calc(100vh - 18rem); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.table-scroll-x { max-height: 62vh; }
.detail-table-scroll { max-height: min(58vh, 40rem); }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .93rem; line-height: 1.35; }
.wide-table { width: max-content; min-width: 100%; }
.data-table thead th {
  position: sticky; top: 0; z-index: 3;
  padding: .6rem .85rem; text-align: left; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2);
  font-size: .86rem; font-weight: 600; letter-spacing: 0; text-transform: none;
  border-bottom: 1px solid var(--line-strong);
}
.data-table tbody td { padding: var(--row-pad) .85rem; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; vertical-align: middle; color: var(--ink); font-variant-numeric: tabular-nums lining-nums; }
.data-table th.num, .data-table td.num { text-align: right; font-family: var(--font-num); }
.data-table tbody tr:hover td { background: var(--surface-2); }
.data-table .positive, .data-table .negative, .money.positive, .money.negative { color: var(--ink); font-weight: inherit; }
.money { font-weight: 400; }
.data-table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--line-strong); border-bottom: 0; }
.data-table td.nd, .data-table .nd { color: var(--muted); }
.project-name { display: flex; flex-direction: column; gap: .1rem; min-width: 11rem; max-width: 22rem; }
.project-name strong { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; font-size: .93rem; font-weight: 600; }
.project-name span { font-size: .86rem; color: var(--muted); }
.project-action-trigger { cursor: pointer; }
.data-table tbody tr.project-action-trigger:hover td { background: var(--surface-2); }
/* primeira coluna fixa (rolagem horizontal sem cortar colunas) */
.freeze-first .data-table thead th:first-child, .freeze-first .data-table tbody td:first-child,
.wide-table td:first-child, .wide-table th:first-child { position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--line); }
.freeze-first .data-table thead th:first-child, .wide-table th:first-child { z-index: 4; background: var(--surface-2); }
.freeze-first .data-table tbody td:first-child, .wide-table td:first-child { background: var(--surface); font-weight: 600; }
.freeze-first .data-table tbody tr:hover td:first-child, .wide-table tbody tr:hover td:first-child { background: var(--surface-2); }
.data-table thead th.is-sortable { cursor: pointer; user-select: none; padding-right: 1.5rem; }
.data-table thead th.is-sortable::after { content: ""; position: absolute; right: .6rem; top: 50%; width: .45rem; height: .45rem; margin-top: -.3rem; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); opacity: 0; transition: opacity .14s var(--ease); }
.data-table thead th.is-sortable:hover::after { opacity: .6; }
.data-table thead th.sort-asc::after { opacity: 1; transform: rotate(-135deg); margin-top: -.1rem; border-color: var(--ink); }
.data-table thead th.sort-desc::after { opacity: 1; transform: rotate(45deg); border-color: var(--ink); }
.data-table th.sel-col, .data-table td.sel-col { width: 2.2rem; padding-left: .85rem; padding-right: 0; }
.data-table input.row-check, .data-table input.all-check { width: 1.05rem; height: 1.05rem; margin: 0; vertical-align: middle; accent-color: var(--brand-text); cursor: pointer; }
.data-table tbody tr.is-selected td { background: var(--ok-soft); }
.tbl-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); padding: 0 var(--pad-card) var(--space-3); }
.tbl-pills { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--surface); }
.tbl-pill { min-height: 1.95rem; padding: 0 .8rem; border-radius: calc(var(--radius-md) - 2px); background: transparent; color: var(--ink-2); font-size: .93rem; font-weight: 500; white-space: nowrap; cursor: pointer; }
.tbl-pill:hover { background: var(--surface-2); }
.tbl-pill.active { background: var(--ink); color: var(--surface); font-weight: 600; }
.tbl-spacer { flex: 1 1 auto; }
.tbl-btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 1.95rem; padding: 0 .7rem; border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font-size: .86rem; font-weight: 500; white-space: nowrap; cursor: pointer; }
.tbl-btn:hover { background: var(--surface-2); }
.tbl-btn svg { width: 1.05em; height: 1.05em; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tbl-search { position: relative; }
.tbl-search input { height: 1.95rem; width: 14rem; padding: 0 .7rem 0 2rem; border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--surface); font-size: .93rem; color: var(--ink); }
.tbl-search input::placeholder { color: var(--muted); }
.tbl-search input:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.tbl-search svg { position: absolute; left: .65rem; top: .5rem; width: .95rem; height: .95rem; stroke: var(--muted); stroke-width: 1.8; fill: none; }
.tbl-menu { position: fixed; z-index: 320; min-width: 14rem; max-height: 20rem; overflow: auto; padding: .4rem; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-3); }
.tbl-menu strong { display: block; padding: .3rem .6rem .5rem; font-size: .86rem; font-weight: 600; color: var(--muted); }
.tbl-menu label { display: flex; align-items: center; gap: .6rem; padding: .4rem .6rem; border-radius: var(--radius-sm); font-size: .93rem; color: var(--ink); cursor: pointer; }
.tbl-menu label:hover { background: var(--surface-2); }
.tbl-menu input { width: 1.05rem; height: 1.05rem; accent-color: var(--brand-text); }
.tbl-bulk { display: flex; align-items: center; gap: var(--space-3); margin: 0 var(--pad-card) var(--space-3); padding: .5rem .85rem; border-radius: var(--radius-md); background: var(--ink); color: var(--surface); font-size: .93rem; }
.tbl-bulk b { font-weight: 700; }
.tbl-bulk button { min-height: 1.65rem; padding: 0 .7rem; border: 1px solid rgba(255, 255, 255, .3); border-radius: var(--radius-md); background: transparent; color: var(--surface); font-size: .86rem; font-weight: 600; cursor: pointer; }
.tbl-bulk button:hover { background: rgba(255, 255, 255, .14); }
.table-pagination, .tbl-pager { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--pad-card); border-top: 1px solid var(--line); font-family: var(--font-num); font-size: .93rem; color: var(--muted); }
.table-pagination > div, .tbl-pager > div { display: flex; align-items: center; gap: var(--space-2); }
.tbl-pager select { height: 1.95rem; padding: 0 1.5rem 0 .5rem; border: 1px solid var(--control-border); border-radius: var(--radius-md); background-color: var(--surface); font-size: .93rem; color: var(--ink); }
.tbl-pager button { min-width: 1.95rem; height: 1.95rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); cursor: pointer; }
.tbl-pager button:disabled { opacity: .45; cursor: not-allowed; }
.tbl-pager button:hover:not(:disabled) { background: var(--surface-2); }
.detail-groups { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); padding: 0 var(--pad-card) var(--space-3); border: 0; background: transparent; }
.detail-group-chip { display: inline-flex; align-items: center; gap: .4rem; min-height: 1.95rem; padding: 0 .8rem; border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink-2); font-size: .93rem; font-weight: 500; cursor: pointer; }
.detail-group-chip:hover { background: var(--surface-2); }
.detail-group-chip.active { background: var(--ink); border-color: var(--ink); color: var(--surface); font-weight: 600; }
.detail-group-chip span { font-size: .86rem; opacity: .75; }
.detail-group-chip.detail-all { margin-left: auto; }
.cost-lines-card { margin-top: var(--gap); }
.cost-lines-table { min-width: 60rem; width: 100%; }
.cost-audit { padding: var(--pad-card); line-height: 1.5; font-size: .93rem; }
.cost-audit h3 { margin-bottom: var(--space-2); font-family: var(--font-display); font-weight: 600; font-size: .93rem; }
.cost-audit p { max-width: 70rem; margin: .7rem 0; color: var(--ink-2); font-size: .93rem; }
.audit-line { display: flex; justify-content: space-between; gap: var(--space-5); padding: .5rem 0; border-bottom: 1px solid var(--line); }
.audit-line strong { white-space: nowrap; font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums; font-weight: 600; }
.cost-audit details { margin-top: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); padding: .75rem 1.1rem; background: var(--surface-2); }
.cost-audit summary { cursor: pointer; font-weight: 600; }
.cost-total td { background: var(--surface-2); font-weight: 650; }
.cost-relation { display: block; margin-top: .25rem; color: var(--muted); font-size: .86rem; white-space: normal; }
.cost-component td:nth-child(2) { padding-left: 1.6rem; }
.revenue-monthly-card { margin-top: var(--gap); }
.revenue-monthly-controls { margin: 0 var(--pad-card) var(--space-3); box-shadow: none; background: var(--surface-2); }
.revenue-matrix-scroll { max-height: 58vh; }
.matrix-table th:first-child, .matrix-table td:first-child { min-width: 16rem; }
.matrix-table th:not(:first-child), .matrix-table td:not(:first-child) { min-width: 7.5rem; }

/* 10 Selos --------------------------------------------------------------------- */
:root {
  --ic-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.7 2.7L16 9.5'/%3E%3C/svg%3E");
  --ic-warn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4l9 16H3z'/%3E%3Cpath d='M12 10v4M12 17v.5'/%3E%3C/svg%3E");
  --ic-crit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9 9l6 6M15 9l-6 6'/%3E%3C/svg%3E");
  --ic-nd: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12h8'/%3E%3C/svg%3E");
  --ic-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8v.5'/%3E%3C/svg%3E");
}
.status-badge, .pill, .type-tag, .trend-pill, .pa-chip, .status-chip {
  --ic: none;
  display: inline-flex; align-items: center; gap: .4rem; width: fit-content; max-width: 100%;
  height: 1.65rem; min-height: 0; padding: 0 .65rem 0 .5rem; border: 0; border-radius: var(--radius-pill);
  background: var(--neutral-soft); color: var(--ink-2);
  font-size: .86rem; font-weight: 600; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.status-badge::before, .trend-pill::before, .pa-chip::before { content: ""; flex: none; width: .95em; height: .95em; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.pill, .type-tag { padding-left: .65rem; font-weight: 500; }
.type-tag { height: 1.4rem; max-width: 11rem; }
.status-excellent, .status-good, .trend-pill.up, .pa-chip.ok { --ic: var(--ic-ok); background: var(--ok-soft); color: var(--ok-text); }
.status-attention, .pa-chip.warn { --ic: var(--ic-warn); background: var(--warn-soft); color: var(--warn-text); }
.status-critical, .trend-pill.down, .pa-chip.neg { --ic: var(--ic-crit); background: var(--crit-soft); color: var(--crit-text); }
.status-neutral, .trend-pill.flat, .pa-chip.mute { --ic: var(--ic-nd); background: var(--neutral-soft); color: var(--ink-2); }
.pa-chip.info { --ic: var(--ic-info); background: var(--info-soft); color: var(--info-text); }
.trend-pill { padding-left: .5rem; }
.pa-chip { margin: 0 .25rem .25rem 0; }

/* 11 Projetos ------------------------------------------------------------------ */
.project-deep-dive { margin-bottom: var(--gap); }
.project-empty-card { background: var(--surface); }
.project-focus-card { overflow: hidden; }
.project-focus-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); padding: var(--pad-card); border: 0; background: transparent; }
.project-focus-head span { display: block; font-size: .86rem; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 400; }
.project-focus-head h3 { margin-top: .1rem; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; line-height: 1.25; letter-spacing: .02em; color: var(--ink); }
.project-focus-head p { margin-top: .2rem; font-size: .93rem; color: var(--muted); }
.project-focus-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
.project-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--gap); padding: 0 var(--pad-card) var(--pad-card); }
.project-mini-card { display: flex; flex-direction: column; gap: .3rem; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: none; }
.project-mini-card span { display: block; font-size: .93rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink-2); }
.project-mini-card strong { display: block; margin: 0; font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums; font-size: 1.5rem; font-weight: 650; line-height: 1.1; letter-spacing: -.01em; color: var(--ink); }
.project-mini-card small { display: block; margin: 0; font-size: .86rem; line-height: 1.35; color: var(--muted); font-weight: 400; }
.project-mini-card.positive small { color: var(--ok-text); font-weight: 600; }
.project-mini-card.negative small { color: var(--crit-text); font-weight: 600; }
.project-mini-card.positive strong, .project-mini-card.negative strong { color: var(--ink); }
.project-visual-grid, .project-detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(18rem, .75fr); gap: var(--gap); padding: 0 var(--pad-card) var(--pad-card); align-items: stretch; }
.project-detail-block, .project-chart-block { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; min-width: 0; }
.project-detail-block h4 { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); background: var(--surface-2); font-family: var(--font-display); font-weight: 600; font-size: .93rem; letter-spacing: .01em; color: var(--ink); }
.project-detail-block .table-scroll { max-height: 20rem; }
.project-lines { padding: var(--space-3) var(--space-4) var(--space-4); }
.project-lines .mini-item span { max-width: 68%; white-space: normal; line-height: 1.3; }
.project-subtitle { border-top: 1px solid var(--line); }
.project-cost-bars { padding-top: var(--space-3); }
.project-monthly-block { display: flex; flex-direction: column; min-height: 100%; }
.project-monthly-scroll { flex: 1 1 auto; max-height: none; min-height: 20rem; }
.project-monthly-table { height: 100%; }
.project-focus-field { position: relative; display: flex; align-items: center; flex: 1 1 22rem; min-width: min(100%, 18rem); max-width: 34rem; gap: .5rem; padding: 0 .8rem; min-height: 2.35rem; border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--surface); }
.project-focus-field:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.project-focus-field > span { font-size: .93rem; font-weight: 400; color: var(--muted); white-space: nowrap; }
.project-focus-combobox { position: relative; flex: 1 1 auto; min-width: 0; }
.project-focus-combobox input { width: 100%; height: 2.2rem; padding: 0 2.2rem 0 0; border: 0; outline: none; background: transparent; font-size: .93rem; font-weight: 600; color: var(--ink); }
.project-focus-combobox input::placeholder { color: var(--muted); font-weight: 400; }
.project-focus-toggle { position: absolute; top: 50%; right: 0; width: 2rem; height: 2rem; margin-top: -1rem; border-radius: var(--radius-sm); background: transparent; color: var(--ink); font-size: 1rem; line-height: 1; cursor: pointer; }
.project-focus-toggle:hover, .project-focus-toggle.is-open { background: var(--surface-2); }
.project-focus-suggestions { position: absolute; z-index: 120; top: calc(100% + .7rem); left: -1.9rem; right: -.8rem; max-height: 22rem; overflow-y: auto; padding: .4rem; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-3); }
.project-focus-option { display: grid; width: 100%; gap: .15rem; padding: .5rem .6rem; border-radius: var(--radius-sm); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.project-focus-option:hover, .project-focus-option.active { background: var(--surface-2); }
.project-focus-option strong { overflow: hidden; font-size: .93rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.project-focus-option span { overflow: hidden; font-size: .86rem; font-weight: 400; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.project-focus-no-results { padding: .8rem .6rem; font-size: .93rem; color: var(--muted); }
.project-subproject-picker { display: grid; min-width: min(22rem, 72vw); gap: .25rem; text-align: left; }
.project-focus-head .project-subproject-picker span { font-size: .86rem; letter-spacing: 0; text-transform: none; }
.project-subproject-picker select { width: 100%; height: 2.35rem; padding: 0 1.8rem 0 .8rem; border: 1px solid var(--control-border); border-radius: var(--radius-md); background-color: var(--surface); background-position: right .6rem center; font-size: .93rem; color: var(--ink); outline: none; }
.project-subproject-picker select:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.project-action-menu { position: fixed; z-index: 160; width: 20rem; padding: var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-3); }
.project-action-menu strong { display: block; font-size: .93rem; font-weight: 600; line-height: 1.3; color: var(--ink); }
.project-action-menu span { display: block; margin: .15rem 0 .6rem; font-size: .86rem; color: var(--muted); }
.project-action-menu button { display: block; width: 100%; min-height: 2.2rem; margin-top: .2rem; padding: 0 .7rem; border-radius: var(--radius-sm); background: transparent; color: var(--ink); font-size: .93rem; font-weight: 500; text-align: left; cursor: pointer; }
.project-action-menu button:hover { background: var(--surface-2); }
.margin-hero-grid, .costs-top-grid { margin-bottom: var(--gap); }
.margin-grid-bottom { margin-top: 0; }
.revenue-kpi-grid, .revenue-grid-bottom { margin-bottom: var(--gap); }
.revenue-kpi-grid { align-items: stretch; }
.trend-pill { margin-left: .4rem; }

/* 12 Rodapé e modal ------------------------------------------------------------ */
.local-footer {
  position: fixed; left: var(--rail-w); right: 0; bottom: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  height: 2.1rem; padding: 0 var(--shell-pad);
  background: var(--surface); border-top: 1px solid var(--line);
  font-size: .86rem; color: var(--muted);
  transition: left .22s var(--ease);
}
body.rail-pinned .local-footer { left: var(--rail-open); }
.local-footer i { display: inline-block; width: .5rem; height: .5rem; margin-right: .5rem; border-radius: 50%; background: var(--brand-neon); box-shadow: 0 0 .5rem rgba(50, 255, 50, .5); }
body.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: var(--space-5); background: rgba(10, 15, 20, .55); }
.modal-backdrop[hidden] { display: none !important; pointer-events: none; visibility: hidden; }
.export-modal { position: relative; width: min(66rem, 100%); max-height: min(88vh, 52rem); overflow: auto; padding: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--canvas); box-shadow: var(--shadow-3); }
.export-modal-close { position: absolute; right: 1.1rem; top: 1rem; z-index: 5; width: 2.35rem; height: 2.35rem; display: grid; place-items: center; border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.export-modal-close:hover { background: var(--surface-2); }
.export-hero { display: flex; gap: var(--space-4); align-items: flex-start; padding: 0 3rem var(--space-4) 0; background: transparent; }
.export-emblem { display: block; flex: none; width: 1.4rem; height: 1.4rem; margin-top: .35rem; border-radius: 5px; background: var(--brand-neon); box-shadow: 0 0 1rem rgba(50, 255, 50, .5); }
.export-emblem span { display: none; }
.export-hero span, .export-option > span, .export-preview span { display: block; font-size: .86rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.export-hero h2 { margin-top: .15rem; font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; line-height: 1.2; letter-spacing: .03em; text-transform: uppercase; color: var(--ink); }
.export-hero p { max-width: 46rem; margin-top: .5rem; font-size: .93rem; line-height: 1.5; color: var(--ink-2); }
.export-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.export-preview div { padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.export-preview strong { display: block; margin-top: .2rem; font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums; font-size: 1.25rem; font-weight: 650; color: var(--ink); }
.export-preview .positive, .export-preview .negative { color: var(--ink); }
.export-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.export-option { display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; min-height: 13rem; padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.export-option.primary { border-color: var(--brand-text); box-shadow: inset 0 0 0 1px var(--brand-text); }
.export-option strong { font-family: var(--font-display); font-weight: 600; font-size: .93rem; line-height: 1.3; letter-spacing: .01em; color: var(--ink); }
.export-option p { flex: 1; font-size: .93rem; line-height: 1.5; color: var(--ink-2); }
.export-option.compact { grid-column: 1 / -1; min-height: 0; display: grid; grid-template-columns: 11rem 1fr auto; align-items: center; }
.export-option.compact p { margin: 0; }
.export-note { margin-top: var(--space-3); padding: .6rem .85rem; border-radius: var(--radius-md); background: var(--info-soft); color: var(--info-text); font-size: .93rem; line-height: 1.4; }

/* 13 Dashboard Executivo ------------------------------------------------------- */
#panel-executive { padding-bottom: var(--space-2); }
.exec-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap;
  margin: 0 0 var(--gap); padding: var(--space-2) var(--space-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
}
.exec-views { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 2px; border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--surface); }
.exec-view { min-height: 1.95rem; padding: 0 .9rem; border-radius: calc(var(--radius-md) - 2px); background: transparent; color: var(--ink-2); font-size: .93rem; font-weight: 500; cursor: pointer; white-space: nowrap; }
.exec-view:hover { background: var(--surface-2); }
.exec-view.active { background: var(--ink); color: var(--surface); font-weight: 600; }
.exec-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.exec-scope { margin-right: var(--space-1); font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.exec-actions .btn, .exec-addbar .btn { min-height: 1.95rem; height: auto; padding: 0 .85rem; font-size: .93rem; }
.exec-actions .btn svg, .exec-addbar .btn svg { width: 1.05em; height: 1.05em; margin-right: .4rem; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; }
.exec-actions .exec-icon-btn { width: 1.95rem; padding: 0; }
.exec-actions .exec-icon-btn svg { margin: 0; }
.exec-actions .btn-brand { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.exec-actions .btn-brand:hover { background: var(--brand-neon); border-color: var(--brand-neon); }
.exec-actions .exec-create-view { background: var(--surface); color: var(--ink); border: 1px solid var(--control-border); }
.exec-actions .exec-create-view:hover { background: var(--surface-2); }
.exec-chipbar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin: 0 0 var(--gap); }
.exec-chip { display: inline-flex; align-items: center; gap: .5rem; min-height: 1.95rem; padding: .2rem .35rem .2rem .8rem; border-radius: var(--radius-pill); background: var(--ok-soft); color: var(--ok-text); font-size: .93rem; font-weight: 500; }
.exec-chip b { font-weight: 700; }
.exec-chip button { width: 1.45rem; height: 1.45rem; border-radius: 50%; background: transparent; color: var(--ok-text); font-size: 1rem; line-height: 1; cursor: pointer; }
.exec-chip button:hover { background: rgba(0, 112, 12, .14); }
.exec-chip-note { font-size: .86rem; color: var(--muted); }

.exec-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: var(--exec-row); gap: var(--gap); }
.exec-widget { position: relative; min-width: 0; overflow: hidden; }
.exec-widget.kpi-card { min-height: 0; padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; }
.exec-widget .kpi-label { flex: 0 0 auto; line-height: 1.15; }
.exec-widget .kpi-value { flex: 0 0 auto; margin-top: .25rem; font-size: clamp(1.25rem, 1.15vw + .6rem, 1.7rem); line-height: 1.05; }
.exec-widget .kpi-meta { flex: 0 0 auto; margin-top: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 0; line-height: 1.15; }
.exec-widget .kpi-spark { flex: 0 0 1.35rem; height: 1.35rem; min-height: 1.35rem; margin-top: .3rem; }
.exec-widget .kpi-spark svg { height: 1.35rem; min-height: 1.35rem; overflow: visible; }
.exec-widget .v8-chart { padding-left: var(--space-3); padding-right: var(--space-3); }
.exec-placeholder { grid-column: span 12; display: flex; align-items: center; justify-content: center; min-height: 12rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); font-size: .93rem; color: var(--muted); }

#panel-executive.is-editing .exec-grid { padding: .4rem; border-radius: var(--radius-lg); background-image: repeating-linear-gradient(90deg, rgba(10, 15, 20, .03) 0 1px, transparent 1px 8.3333%); }
#panel-executive.is-editing .exec-widget { outline: 1px dashed var(--line-strong); outline-offset: 2px; border-radius: var(--radius-lg); }
#panel-executive.is-editing .exec-widget.is-dragging { opacity: .4; }
#panel-executive.is-editing .exec-widget.is-drop { outline: 2px solid var(--brand); }
#panel-executive.is-editing .exec-widget.is-resizing { outline: 2px solid var(--ink); }
.exec-tools { position: absolute; top: .5rem; right: .5rem; z-index: 6; display: flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-1); }
.exec-tools button, .exec-drag { display: flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: var(--radius-sm); background: transparent; color: var(--ink-2); cursor: pointer; }
.exec-drag { cursor: grab; }
.exec-tools button:hover { background: var(--surface-2); color: var(--ink); }
.exec-tools svg, .exec-drag svg { width: 1.05rem; height: 1.05rem; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.exec-menu-btn { position: absolute; top: .5rem; right: .5rem; z-index: 5; width: 1.75rem; height: 1.75rem; display: flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .14s var(--ease), background .14s var(--ease); }
.exec-widget:hover .exec-menu-btn, .exec-menu-btn.is-open, .exec-menu-btn:focus-visible { opacity: 1; }
.exec-menu-btn:hover, .exec-menu-btn.is-open { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.exec-menu-btn svg { width: 1.1rem; height: 1.1rem; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.exec-popmenu { position: absolute; z-index: 130; min-width: 14rem; padding: .4rem; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-3); }
.exec-popmenu button { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 2.1rem; padding: 0 .6rem; border-radius: var(--radius-sm); background: transparent; color: var(--ink); font-size: .93rem; text-align: left; cursor: pointer; }
.exec-popmenu button:hover { background: var(--surface-2); }
.exec-popmenu button.danger { color: var(--crit-text); }
.exec-popmenu button.danger:hover { background: var(--crit-soft); }
.exec-popmenu button svg { width: 1.05rem; height: 1.05rem; flex: 0 0 1.05rem; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.exec-popmenu hr { margin: .3rem .25rem; border: 0; border-top: 1px solid var(--line); }
.exec-popmenu-label { padding: .45rem .6rem .25rem; font-size: .86rem; font-weight: 600; color: var(--muted); }
.exec-resize { position: absolute; right: .3rem; bottom: .3rem; z-index: 6; width: 1rem; height: 1rem; border-right: 2px solid var(--line-strong); border-bottom: 2px solid var(--line-strong); border-bottom-right-radius: 5px; cursor: nwse-resize; }
.exec-resize:hover { border-color: var(--brand-text); }
.exec-hbar { padding: var(--space-3) var(--pad-card) var(--space-4); }
.exec-headline { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.exec-headline strong { font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums; font-size: clamp(1.4rem, 1.2vw + .7rem, 1.9rem); font-weight: 650; letter-spacing: -.01em; color: var(--ink); }
.exec-headline-delta { font-size: .93rem; font-weight: 600; color: var(--ink-2); }
.exec-headline-delta.positive { color: var(--ok-text); }
.exec-headline-delta.negative { color: var(--crit-text); }
.exec-headline-note { font-size: .86rem; color: var(--muted); }
.exec-hbar .bar-row.is-clickable { cursor: pointer; }
.exec-table-scroll { max-height: 100%; }
.exec-widget .exec-row { cursor: pointer; }
.exec-insights { padding: var(--space-2) var(--pad-card) var(--space-4); display: grid; gap: var(--space-2); align-content: start; }
.exec-insight { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: start; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.exec-insight i { display: block; width: 1.4rem; height: 1.4rem; border-radius: var(--radius-pill); background-color: var(--neutral-soft); background-image: var(--ic-info); background-repeat: no-repeat; background-position: center; background-size: .95rem; }
.exec-insight.good i { background-color: var(--ok-soft); background-image: var(--ic-ok); }
.exec-insight.bad i { background-color: var(--crit-soft); background-image: var(--ic-crit); }
.exec-insight.warn i { background-color: var(--warn-soft); background-image: var(--ic-warn); }
.exec-insight p { font-size: .93rem; line-height: 1.45; color: var(--ink-2); }
.exec-insight b { color: var(--ink); }

/* gavetas e diálogos (configurar widget, catálogo, nome da visão, construtor) */
.exec-drawer-backdrop, .cb-backdrop { position: fixed; inset: 0; display: flex; justify-content: flex-end; background: rgba(10, 15, 20, .45); animation: kit-fade .18s var(--ease) both; }
.exec-drawer-backdrop { z-index: 300; } .cb-backdrop { z-index: 340; }
@keyframes kit-fade { from { opacity: 0; } }
.exec-drawer, .cb { display: flex; flex-direction: column; height: 100%; background: var(--surface); box-shadow: var(--shadow-3); animation: kit-slide .22s var(--ease) both; }
@keyframes kit-slide { from { transform: translateX(1.5rem); opacity: 0; } }
.exec-drawer { width: min(28rem, 92vw); } .cb { width: min(42rem, 96vw); }
.exec-drawer header, .cb-head, .wcat header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); }
.cb-head { align-items: flex-start; }
.exec-drawer header h3, .cb-head h3, .wcat header h3 { font-family: var(--font-display); font-weight: 600; font-size: 1rem; line-height: 1.3; letter-spacing: .01em; color: var(--ink); }
.cb-kicker { display: block; font-size: .86rem; font-weight: 500; color: var(--muted); }
.cb-head p, .wcat header p { margin-top: .25rem; max-width: 46ch; font-size: .93rem; line-height: 1.5; color: var(--ink-2); }
.exec-drawer-close, .wcat-close, .cb-close, .exec-view-dialog-close { flex: none; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; margin-left: auto; border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.exec-drawer-close:hover, .wcat-close:hover, .cb-close:hover, .exec-view-dialog-close:hover { background: var(--surface-2); }
.exec-drawer-body, .cb-body { flex: 1 1 auto; overflow-y: auto; padding: var(--space-4) var(--space-5); display: grid; gap: var(--space-4); align-content: start; }
.exec-field, .cb-field { display: grid; gap: .3rem; }
.exec-field > span, .cb-field > span, .exec-view-dialog-form > label { font-size: .93rem; font-weight: 600; color: var(--ink); }
.exec-field select, .exec-field input[type="text"], .cb-field select, .cb-field input[type="text"], .exec-view-dialog-form > input, .wcat-filters input, .wcat-filters select {
  width: 100%; min-height: 2.35rem; padding: 0 .8rem; border: 1px solid var(--control-border); border-radius: var(--radius-md); background-color: var(--surface); font-size: .93rem; color: var(--ink);
}
.exec-field select:focus, .exec-field input:focus, .cb-field select:focus, .cb-field input:focus, .exec-view-dialog-form > input:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.exec-view-dialog-form > input[aria-invalid="true"] { border-color: var(--crit); outline-color: var(--crit); }
.exec-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem var(--space-3); }
.exec-checks label { display: flex; align-items: center; gap: .5rem; font-size: .93rem; color: var(--ink); }
.exec-checks input { accent-color: var(--brand-text); width: 1.05rem; height: 1.05rem; }
.exec-drawer footer, .cb-foot, .wcat footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-5); border-top: 1px solid var(--line); font-size: .86rem; color: var(--muted); }
.cb-foot > div { display: flex; align-items: center; gap: var(--space-2); }
.cb-foot .btn, .exec-drawer footer .btn, .exec-view-dialog-form footer .btn { min-height: 2.1rem; height: auto; padding: 0 1rem; font-size: .93rem; }
.exec-drawer footer .btn-brand, .cb-foot .btn-brand, .exec-view-dialog-form footer .btn-brand { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.exec-drawer footer .btn-brand:hover, .cb-foot .btn-brand:hover, .exec-view-dialog-form footer .btn-brand:hover { background: var(--brand-neon); border-color: var(--brand-neon); }
.cb-danger { min-height: 2.1rem; padding: 0 .9rem; border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font-size: .93rem; font-weight: 500; cursor: pointer; }
.cb-danger:hover { border-color: var(--crit); background: var(--crit-soft); color: var(--crit-text); }
.cb-previewbox { flex: 0 0 auto; padding: var(--space-4) var(--space-5); background: var(--canvas); border-bottom: 1px solid var(--line); }
.cb-previewhead { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); font-size: .86rem; color: var(--muted); }
.cb-previewhead b { font-family: var(--font-num); font-weight: 600; color: var(--ink-2); }
.cb-preview { display: grid; }
.cb-preview .cb-ghost { min-width: 0; overflow: hidden; }
.cb-previewfoot { margin-top: var(--space-2); font-size: .86rem; color: var(--muted); }
.cb-group { display: grid; gap: var(--space-3); }
.cb-group h4 { font-size: .93rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
.cb-help { font-size: .86rem; font-style: normal; line-height: 1.45; color: var(--muted); }
.cb-note { padding: var(--space-3); border-radius: var(--radius-md); background: var(--info-soft); font-size: .93rem; line-height: 1.5; color: var(--info-text); }
.cb-note b { color: var(--info-text); }
.cb-seg { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px; max-width: 100%; width: fit-content; padding: 2px; border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--surface); }
.cb-seg button { min-width: 2.6rem; min-height: 1.95rem; padding: 0 .85rem; border-radius: calc(var(--radius-md) - 2px); background: transparent; color: var(--ink-2); font-size: .93rem; font-weight: 500; cursor: pointer; }
.cb-seg button:hover { background: var(--surface-2); }
.cb-seg button.active { background: var(--ink); color: var(--surface); font-weight: 600; }
.cb-visuals { display: grid; grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr)); gap: var(--space-2); }
.cb-visuals button { display: grid; justify-items: center; gap: .3rem; padding: .6rem .4rem .5rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--muted); cursor: pointer; }
.cb-visuals button svg { width: 3rem; height: 1.85rem; }
.cb-visuals button em { font-style: normal; font-size: .86rem; font-weight: 500; color: var(--ink-2); }
.cb-visuals button:hover { background: var(--surface-2); }
.cb-visuals button.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); }
.cb-visuals button.active em { color: var(--ink); font-weight: 600; }

.wcat-backdrop, .exec-view-dialog-backdrop { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: var(--space-5); background: rgba(10, 15, 20, .5); animation: kit-fade .18s var(--ease) both; }
.wcat-backdrop { z-index: 320; } .exec-view-dialog-backdrop { z-index: 360; }
.wcat { display: flex; flex-direction: column; width: min(64rem, 96vw); max-height: min(84vh, 50rem); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-3); overflow: hidden; }
.wcat-filters { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--line); }
.wcat-body { flex: 1; overflow-y: auto; padding: var(--space-4) var(--space-5) var(--space-5); display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--space-3); align-content: start; background: var(--canvas); }
.wcat-card { display: grid; grid-template-columns: 5.4rem 1fr; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); cursor: pointer; }
.wcat-card:hover { background: var(--surface-2); border-color: var(--line-strong); }
.wcat-thumb { display: flex; align-items: center; justify-content: center; height: 5.4rem; border-radius: var(--radius-md); background: var(--surface-2); overflow: hidden; }
.wcat-thumb svg { width: 100%; height: 100%; }
.wcat-info { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.wcat-info strong { font-size: .93rem; font-weight: 600; }
.wcat-info p { font-size: .86rem; line-height: 1.45; color: var(--muted); }
.wcat-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .1rem; }
.wcat-tag { padding: .15rem .55rem; border-radius: var(--radius-pill); background: var(--neutral-soft); color: var(--ink-2); font-size: .86rem; font-weight: 500; }
.wcat-add { align-self: flex-start; margin-top: .4rem; display: inline-flex; align-items: center; min-height: 1.85rem; padding: 0 .9rem; border-radius: var(--radius-md); background: var(--ink); color: var(--surface); font-size: .86rem; font-weight: 600; cursor: pointer; }
.wcat-card:hover .wcat-add, .wcat-card:focus-visible .wcat-add { background: var(--brand-text); }
.wcat-add.is-added { background: var(--ok-soft); color: var(--ok-text); }
.exec-view-dialog { width: min(30rem, 100%); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-3); animation: kit-pop .2s var(--ease) both; }
@keyframes kit-pop { from { opacity: 0; transform: translateY(.5rem) scale(.985); } }
.exec-view-dialog-head { position: relative; display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) 2.1rem; gap: var(--space-3); align-items: start; padding: var(--space-5) var(--space-5) var(--space-4); border-bottom: 1px solid var(--line); background: var(--surface); }
.exec-view-dialog-icon { display: flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: var(--radius-md); background: var(--ok-soft); color: var(--ok-text); }
.exec-view-dialog-icon svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.exec-view-dialog-kicker { display: block; font-size: .86rem; font-weight: 500; color: var(--muted); letter-spacing: 0; text-transform: none; }
.exec-view-dialog-head h3 { margin-top: .15rem; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; line-height: 1.25; color: var(--ink); }
.exec-view-dialog-head p { margin-top: .3rem; max-width: 46ch; font-size: .93rem; line-height: 1.5; color: var(--ink-2); }
.exec-view-dialog-form { display: grid; padding: var(--space-4) var(--space-5) 0; }
.exec-view-dialog-form > label { margin-bottom: .35rem; }
.exec-view-dialog-fieldline { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: .3rem; color: var(--muted); }
.exec-view-dialog-fieldline small { font-size: .86rem; }
.exec-view-dialog-error { margin-top: .4rem; font-size: .86rem; font-weight: 600; color: var(--crit-text); }
.exec-view-dialog-form footer { display: flex; justify-content: flex-end; gap: var(--space-2); margin: var(--space-4) calc(-1 * var(--space-5)) 0; padding: var(--space-3) var(--space-5); border-top: 1px solid var(--line); background: var(--surface-2); }

/* 15 Responsivo ---------------------------------------------------------------- */
/* A raiz é fluida (14–26px): tudo em rem escala junto. Aqui só mudam as colunas. */
@media (max-width: 1480px) {
  :root { --rail-open: 13.2rem; }
  .grid-2x1 { grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 1fr); }
}
@media (max-width: 1400px) {
  .page-heading p { display: none; }
  .detail-table-scroll { max-height: min(52vh, 32rem); }
  .project-visual-grid, .project-detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1180px) {
  .grid-2x1 { grid-template-columns: 1fr; }
  .exec-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .exec-widget { grid-column: span 6 !important; }
  .tbl-search input { width: 11rem; }
  .export-options { grid-template-columns: 1fr; }
  .export-option.compact { grid-template-columns: 1fr; }
}
@media (max-height: 800px) {
  body { --kpi-min: 12rem; }
  .detail-table-scroll { max-height: 46vh; }
}
@media (max-width: 760px) {
  body { --shell-pad: var(--space-4); }
  .rail { width: 3.6rem; --rail-w: 3.6rem; }
  .app-shell { margin-left: 3.6rem; }
  .local-footer { left: 3.6rem; }
  .topbar { flex-wrap: wrap; }
  .filter-grid { grid-template-columns: 1fr; }
  .export-modal { padding: var(--space-4); }
}

/* 16 Movimento reduzido e impressão -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}
@media print {
  .rail, .filter-panel, .topbar-actions, .local-footer, .tbl-toolbar, .tbl-bulk, .tbl-pager, .exec-tools, .exec-menu-btn, .exec-resize, .exec-bar { display: none !important; }
  html { font-size: 12px; }
  .app-shell { margin-left: 0 !important; }
  .topbar { position: static !important; }
  body { background: #fff; }
  .card, .kpi-card { box-shadow: none; break-inside: avoid; }
}

/* =============================================================================
   V18.1 · categorias em rosca, mapa de receita × margem e cartões que ocupam o espaço
============================================================================= */
/* amostra de cor nas listas que acompanham a rosca */
.sw-l { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.sw { flex: none; display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; background: var(--ajuste); }
/* rosca: nome da legenda em tinta principal; fatia em foco sai um pouco do anel */
.tk-plot .lgn { fill: var(--ink); }
.tk-plot svg[data-c="donut"] path.seg { transition: transform .16s ease, opacity .14s ease, filter .16s ease; }
.tk-plot svg[data-c="donut"] path.seg.is-m { stroke: var(--surface) !important; stroke-width: 2px !important; transform: translate(var(--tx, 0), var(--ty, 0)); filter: drop-shadow(0 3px 6px rgba(16,40,30,.28)); }
.tk-plot svg[data-c="donut"] g.lg-row .hit { cursor: default; }
.tk-share { min-height: 16rem; }

/* listas de barras e Pareto: quando o cartão é esticado pelo vizinho, as linhas se distribuem em vez de sobrar espaço embaixo */
.card > .bar-list, .card > .pareto-list { flex: 1 1 auto; align-content: space-evenly; }
.card > .alerts-list, .card > .critical-list { flex: 1 1 auto; align-content: start; }

/* custos: dois gráficos empilhados à esquerda, tabela larga à direita (sem colunas cortadas nem vazio) */
.grid-2.costs-mid-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); grid-template-rows: auto auto; }
.costs-mid-grid > :nth-child(1) { grid-column: 1; grid-row: 1; }
.costs-mid-grid > :nth-child(2) { grid-column: 1; grid-row: 2; }
.costs-mid-grid > :nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
@media (max-width: 1100px) {
  .grid-2.costs-mid-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .costs-mid-grid > :nth-child(n) { grid-column: auto; grid-row: auto; }
}

/* mapa de receita × margem: barra de controles, cursor de arrastar, foco de teclado */
.tk-map { position: relative; border-radius: var(--radius-md); }
.tk-map:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tk-map svg { touch-action: pan-y; cursor: default; }
.tk-map.is-zoomed svg { touch-action: none; cursor: grab; }
.tk-map.is-grab svg { cursor: grabbing; }
.tk-map.is-grab svg g[data-pk] { cursor: grabbing; }
.tk-map-ctl { position: absolute; z-index: 2; top: .1rem; right: var(--pad-card); display: flex; align-items: center; gap: .3rem; font-size: .86rem; }
.tk-map-ctl button {
  all: unset; box-sizing: border-box; min-width: 1.75rem; height: 1.75rem; padding: 0 .5rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink); font-weight: 600; line-height: 1; cursor: pointer;
}
.tk-map-ctl button:hover:not(:disabled) { background: var(--surface-2); border-color: var(--control-border); }
.tk-map-ctl button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tk-map-ctl button:disabled { opacity: .4; cursor: default; }
.tk-map-z { margin-right: .4rem; color: var(--ink-2); font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.tk-map-z:empty { display: none; }
@media (max-width: 720px) { .tk-map-z { display: none; } }
.map-hint { margin: 0; padding: 0 var(--pad-card) var(--pad-card); font-size: .86rem; line-height: 1.4; color: var(--muted); }
.risk-legend + .map-hint { margin-top: -.45rem; }
