/* Auditoria - folha de estilo do protótipo (Fase 1)
   Conceito de layout: mesa de auditoria - barra fina no topo, trilho de navegação à esquerda,
   superfícies brancas sobre cinza de "papel de arquivo", marcas de régua e selo nos detalhes. */
:root {
  /* Neutros: cinza com leve viés azul-ardósia (tinta de carimbo) */
  --bg: var(--user-bg-light, #eceef1);
  --surface: var(--user-surface-light, #ffffff);
  --surface-2: #f5f6f8;
  --surface-3: #e6e9ed;
  --border: #dbdfe4;
  --border-strong: #c2c8d0;
  --text: #1a1e23;
  --text-2: #4d5560;
  --muted: #7b838d;
  /* Cor primária e destaque (sobrescritas pela personalização do usuário) */
  --primary: var(--user-primary-light, #2c5f8d);
  --primary-ink: #ffffff;
  --primary-soft: color-mix(in srgb, var(--primary) 11%, transparent);
  --accent: var(--user-accent-light, #a8801c);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  /* Semântica de prazo - FIXA */
  --st-ok: #7cc49a;
  --st-warn: #f0cf6b;
  --st-late: #e88f8f;
  --st-ok-soft: #e4f4ea;
  --st-warn-soft: #fbf3d9;
  --st-late-soft: #fbe6e6;
  --st-ok-ink: #2c6e47;
  --st-warn-ink: #7a5d0b;
  --st-late-ink: #9c3535;
  --danger: #c0443f;
  --danger-soft: #fbe9e8;
  --shadow: 0 1px 2px rgba(20, 30, 45, .06), 0 4px 16px rgba(20, 30, 45, .06);
  --shadow-pop: 0 10px 40px rgba(20, 30, 45, .18);
  --radius: 10px;
  --radius-sm: 6px;
  --font-ui: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --topbar-h: 56px;
  --nav-w: 216px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--user-bg-dark, #1b1e22);
    --surface: var(--user-surface-dark, #24282d);
    --surface-2: #2a2f35;
    --surface-3: #323840;
    --border: #353b42;
    --border-strong: #48505a;
    --text: #f2f4f6;
    --text-2: #bcc3cb;
    --muted: #8b939c;
    --primary: var(--user-primary-dark, #7aa7d6);
    --primary-ink: #0f1924;
    --accent: var(--user-accent-dark, #d4ac4a);
    --st-ok-soft: rgba(124, 196, 154, .16);
    --st-warn-soft: rgba(240, 207, 107, .15);
    --st-late-soft: rgba(232, 143, 143, .16);
    --st-ok-ink: #9fdcb6;
    --st-warn-ink: #f2d98b;
    --st-late-ink: #f2abab;
    --danger: #ec7c76;
    --danger-soft: rgba(236, 124, 118, .14);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .18);
    --shadow-pop: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: var(--user-bg-dark, #1b1e22);
  --surface: var(--user-surface-dark, #24282d);
  --surface-2: #2a2f35;
  --surface-3: #323840;
  --border: #353b42;
  --border-strong: #48505a;
  --text: #f2f4f6;
  --text-2: #bcc3cb;
  --muted: #8b939c;
  --primary: var(--user-primary-dark, #7aa7d6);
  --primary-ink: #0f1924;
  --accent: var(--user-accent-dark, #d4ac4a);
  --st-ok-soft: rgba(124, 196, 154, .16);
  --st-warn-soft: rgba(240, 207, 107, .15);
  --st-late-soft: rgba(232, 143, 143, .16);
  --st-ok-ink: #9fdcb6;
  --st-warn-ink: #f2d98b;
  --st-late-ink: #f2abab;
  --danger: #ec7c76;
  --danger-soft: rgba(236, 124, 118, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .18);
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
table { font-size: inherit; border-collapse: collapse; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--primary); }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; line-height: 1.2; }
p { margin: 0; }
.mono { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 22px; height: 22px; }

/* ---------- Estrutura ---------- */
.app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-inline: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-wrap, .bell-wrap { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 4px 4px; border: 1px solid transparent; border-radius: 999px;
  background: transparent; cursor: pointer; min-width: 0;
}
.user-btn:hover, .user-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--border); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--primary); color: var(--primary-ink);
  font-weight: 600; font-size: 13px; letter-spacing: .02em;
  background-size: cover; background-position: center;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border-strong);
}
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.user-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; }
.user-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.user-role { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
/* Nome e foto na barra superior (rodada 27): data-tu-show = both | photo | name; data-tu-pos = menu | center | end */
.topbar[data-tu-show="photo"] .user-text, .topbar[data-tu-show="photo"] .user-btn > .ic { display: none; }
.topbar[data-tu-show="photo"] .user-btn { padding: 3px; gap: 0; }
.topbar[data-tu-show="name"] #userAvatar { display: none; }
.topbar[data-tu-show="name"] .user-btn { padding-left: 10px; }
.tb-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; min-width: 0; max-width: 40vw; }
.topbar[data-tu-pos="center"] .user-menu { left: 50%; transform: translateX(-50%); }
.topbar[data-tu-pos="end"] .user-menu, .topbar[data-tu-show="off"] .user-menu { left: auto; right: 0; }
/* Rodada 28: "Desativado" esconde o operador (o menu continua no Alt+U); abaixo do nome só o cargo; engrenagem no menu */
.topbar[data-tu-show="off"] .user-btn { display: none; }
.topbar[data-tu-show="off"] .user-wrap { align-self: stretch; display: flex; align-items: flex-end; }
.user-role:empty { display: none; }
.um-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.um-name b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-tucfg { margin-left: auto; flex: none; }
.um-tucfg[aria-expanded="true"] { background: var(--primary-soft); color: var(--primary); }
.user-menu.tu-mode > .menu-item, .user-menu.tu-mode > .menu-sep { display: none; }
.user-menu.tu-mode { width: min(360px, calc(100vw - 24px)); }
.tu-panel { padding: 2px 6px 6px; display: flex; flex-direction: column; gap: 8px; }
.tu-panel-head { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.tu-panel-foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tu-prev-bar[data-show="off"] .tu-u { display: none; }
/* Linhas que expandem ao clicar (operadores e cargos, rodada 28) */
tr.ac-urow, tr.rl-row { cursor: pointer; }
tr.ac-urow:hover > td, tr.rl-row:hover > td { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.rl-tog .ic { transition: transform .15s ease; }
.rl-tog[aria-expanded="true"] .ic { transform: rotate(180deg); }
.rl-exp > td { background: var(--surface-2); padding: 8px 12px 12px; }
.rl-exp-box { display: flex; flex-direction: column; gap: 8px; }
.rl-users { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow: auto; }
.rl-user { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: var(--radius-sm); }
.rl-user:hover { background: var(--surface); }
.rl-user.off { opacity: .65; }
.rl-user-name { flex: 1; min-width: 0; line-height: 1.25; }
.rl-add-sel { width: auto; min-width: 220px; max-width: 360px; }
/* Editor da foto do perfil (rodada 28) */
.ph-ed { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.ph-stage { width: 300px; height: 300px; flex: none; border-radius: var(--radius); overflow: hidden; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 20px 20px; box-shadow: inset 0 0 0 1px var(--border); }
.ph-stage canvas { width: 300px; height: 300px; display: block; cursor: grab; touch-action: none; }
.ph-stage canvas.grabbing { cursor: grabbing; }
.ph-stage canvas:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.ph-side { flex: 1 1 220px; min-width: 220px; display: flex; flex-direction: column; gap: 10px; }
.ph-prev { display: flex; align-items: flex-end; gap: 12px; }
.ph-row { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 8px; font-size: 12.5px; }
.ph-row input[type="range"] { width: 100%; }
@media (max-width: 560px) { .ph-stage, .ph-stage canvas { width: 260px; height: 260px; } }
.tu-compact { gap: 8px; }
.tu-compact .seg { display: flex; }
.tu-compact .seg-opt { flex: 1 1 auto; justify-content: center; padding: 5px 8px; font-size: 12px; }
.tu-compact .tu-hint { font-size: 11.5px; margin: 0; }
@media (max-width: 900px) { .tb-center { position: static; transform: none; max-width: none; } }
.tu-seg { margin-top: 4px; }
.tu-prev { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 8px; background: var(--surface-2); }
.tu-prev-bar { display: flex; align-items: center; gap: 8px; position: relative; height: 34px; padding: 0 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; font-style: normal; }
.tu-prev-bar i { font-style: normal; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tu-prev-bar .tu-sp { flex: 1; }
.tu-prev-bar .tu-u { padding: 2px 6px; border-radius: 999px; background: var(--primary-soft); }
.tu-prev-bar .avatar.sm { width: 20px; height: 20px; font-size: 9px; box-shadow: none; }
.tu-prev-bar .tu-b { color: var(--muted); }
.tu-prev-bar[data-show="photo"] .tu-u b, .tu-prev-bar[data-show="name"] .tu-u .avatar { display: none; }
.tu-prev-bar[data-pos="center"] .tu-u { position: absolute; left: 50%; transform: translateX(-50%); }
.tu-prev-bar[data-pos="center"] .tu-b, .tu-prev-bar[data-pos="end"] .tu-b { order: 1; }
.tu-prev-bar .tu-m { order: 0; }
.tu-prev-bar[data-pos="menu"] .tu-u { order: 1; }
.tu-prev-bar[data-pos="menu"] .tu-b { order: 2; }
.tu-prev-bar .tu-sp { order: 3; }
.tu-prev-bar .tu-r { order: 4; }
.tu-prev-bar[data-pos="end"] .tu-u { order: 5; }
.brand {
  display: flex; align-items: center; gap: 7px; text-decoration: none; color: var(--muted);
  padding-left: 12px; margin-left: 2px; border-left: 1px solid var(--border);
  font-size: 13px; white-space: nowrap;
}
.brand b { color: var(--text-2); font-weight: 600; }
.brand:hover b { color: var(--primary); }
.brand-logo { width: 24px; height: 24px; display: grid; place-items: center; }
.brand-logo img, .brand-logo svg { width: 24px; height: 24px; object-fit: contain; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 6px; }
.icon-btn.sm .ic { width: 15px; height: 15px; }
.badge {
  position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface);
}
.search-trigger {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--muted);
  cursor: pointer; min-width: 0;
}
.search-trigger:hover { border-color: var(--border-strong); color: var(--text-2); }
.search-trigger kbd, kbd {
  font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
}

.shell { flex: 1; display: flex; min-height: 0; }
.sidenav {
  width: var(--nav-w); flex: none; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px;
  border-right: 1px solid var(--border); background: var(--bg);
  position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  transition: width .16s ease, margin-right .16s ease;
}
.sidenav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--text-2); text-decoration: none; font-weight: 500;
}
.sidenav a:hover { background: var(--surface); color: var(--text); }
.sidenav a.active { background: var(--surface); color: var(--primary); box-shadow: inset 0 0 0 1px var(--border); }
.sidenav a.active .ic { stroke: var(--primary); }
body.nav-rail .sidenav { width: 62px; padding-inline: 8px; }
body.nav-rail .sidenav a { justify-content: center; padding: 9px 0; }
body.nav-rail .sidenav a span, body.nav-rail .nav-foot { display: none; }
.nav-foot { margin-top: auto; padding: 12px 10px 4px; display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; color: var(--muted); letter-spacing: .04em; border-top: 1px dashed var(--border); }
.view { flex: 1; min-width: 0; padding: 12px 22px 40px; outline: none; }

/* ---------- Menus ---------- */
.menu {
  position: absolute; top: calc(100% + 6px); z-index: 80; min-width: 230px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-pop); padding: 6px;
}
.user-menu { left: 0; }
.bell-menu { right: 0; width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; padding: 0; }
.menu-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; color: var(--text);
}
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }
.menu-item.muted { color: var(--muted); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.popover { position: fixed; z-index: 120; }

/* ---------- Tipografia de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; row-gap: 8px; }
.page-head h1 { font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
.eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; display: block; }
.page-head .sub { color: var(--text-2); margin-top: 2px; max-width: 80ch; font-size: 13px; line-height: 1.45; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.section-title .count { font-family: var(--font-mono); font-size: 11px; color: var(--muted); font-weight: 500; }

/* ---------- Botões e formulários ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: calc(var(--radius) * .8); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); cursor: pointer; font-weight: 500; white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 6px; }
.btn .ic { width: 16px; height: 16px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group .btn.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); position: relative; z-index: 1; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 34px; padding: 0 10px; border-radius: calc(var(--radius) * .7);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
}
.textarea { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; font-family: var(--font-mono); font-size: 12.5px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input.sm, .select.sm { height: 28px; font-size: 12.5px; padding: 0 8px; }
.input[type="color"] { padding: 2px; width: 46px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.err { color: var(--danger); font-size: 12.5px; }

/* ---------- Superfícies ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 0; flex-wrap: wrap; }
.card-head .hint { font-size: 12px; color: var(--muted); }
.card-body { padding: 10px 18px 16px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 9px 14px; border: 0; background: transparent; cursor: pointer; color: var(--text-2); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }
.empty {
  padding: 36px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty .ic { width: 28px; height: 28px; stroke: var(--border-strong); }

/* ---------- Pílulas de status (semântica fixa) ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 6px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.pill .ic { width: 13px; height: 13px; stroke-width: 2.2; }
.pill.ok { background: var(--st-ok-soft); color: var(--st-ok-ink); }
.pill.warn { background: var(--st-warn-soft); color: var(--st-warn-ink); }
.pill.late { background: var(--st-late-soft); color: var(--st-late-ink); }
.pill.info { background: var(--primary-soft); color: var(--primary); }
.pill.neutral { background: var(--surface-3); color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.tag { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }

/* ---------- Home / KPIs ---------- */
.filters-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters-bar .select { width: auto; min-width: 150px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  position: relative; padding: 14px 16px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow: hidden;
}
.kpi .k-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.kpi .k-sub { font-size: 12px; color: var(--muted); }
.kpi .k-meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.kpi .k-meter > i { display: block; height: 100%; border-radius: 3px; background: var(--primary); }
/* Régua de auditoria: marcas de escala na base dos cartões */
.kpi::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 4px; opacity: .5;
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 1px, transparent 1px 10px);
}
.kpi.st-ok { border-top: 3px solid var(--st-ok); }
.kpi.st-warn { border-top: 3px solid var(--st-warn); }
.kpi.st-late { border-top: 3px solid var(--st-late); }
.home-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
.chart-box { height: 280px; width: 100%; position: relative; }
.chart-box.tall { height: 340px; }

/* Tabelas simples */
.table-wrap { overflow-x: auto; max-width: 100%; }
.tbl { width: 100%; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.clickable { cursor: pointer; }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.bar-cell .track { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar-cell .track > i { display: block; height: 100%; border-radius: 3px; }
.rank-no { font-family: var(--font-mono); color: var(--muted); font-size: 12px; }
.countdown { font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }

/* ---------- Fontes de dados ---------- */
.source-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stype {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; text-align: left;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; color: var(--text);
}
.stype:hover { border-color: var(--border-strong); }
.stype.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.stype .ic { stroke: var(--primary); width: 22px; height: 22px; }
.stype b { font-weight: 600; font-size: 13.5px; }
.stype span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 30px 16px; text-align: center;
  background: var(--surface-2); color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer;
}
.dropzone.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.dropzone .ic { width: 30px; height: 30px; stroke: var(--primary); }
.dropzone .formats { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.preview-wrap { max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.preview-wrap .tbl th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--text-2); }
.preview-wrap .tbl td { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.type-sel { display: block; margin-top: 4px; height: 24px; font-size: 11.5px; padding: 0 4px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface); }
.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; font-size: 13px;
  background: var(--primary-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
}
.notice .ic { stroke: var(--primary); margin-top: 1px; }
.notice.warn { background: var(--st-warn-soft); border-color: color-mix(in srgb, var(--st-warn) 50%, transparent); }
.notice.warn .ic { stroke: var(--st-warn-ink); }
.notice.err { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.notice.err .ic { stroke: var(--danger); }
.notice.ok { background: var(--st-ok-soft); border-color: color-mix(in srgb, var(--st-ok) 50%, transparent); }
.notice.ok .ic { stroke: var(--st-ok-ink); }
.codebox { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-family: var(--font-mono); font-size: 12.5px; word-break: break-all; }
.codebox span { flex: 1; min-width: 0; user-select: all; }
pre.code { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font: 12px/1.5 var(--font-mono); overflow-x: auto; }

/* ---------- Grid de dados ---------- */
.grid-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.grid-toolbar .input { width: 220px; }
.grid-toolbar .spacer { flex: 1; }
.dirty-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--st-warn-ink); background: var(--st-warn-soft); padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.dg-wrap { overflow: auto; max-height: calc(100vh - 290px); min-height: 280px; }
.dg { font-size: 13px; min-width: 100%; }
.dg th, .dg td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0; white-space: nowrap; }
.dg thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; }
.dg .th-in { display: flex; align-items: center; gap: 6px; padding: 7px 8px; min-width: 120px; }
.dg .th-name { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.dg .th-type { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); border: 1px solid var(--border); padding: 0 4px; border-radius: 3px; }
.dg td.cell { padding: 6px 8px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; cursor: text; }
.dg td.cell.num { text-align: right; font-variant-numeric: tabular-nums; }
.dg td.cell.changed { background: var(--st-warn-soft); }
.dg td.cell.editing { padding: 0; }
.dg td.cell input { width: 100%; min-width: 120px; height: 32px; border: 0; border-radius: 0; padding: 0 8px; outline: 2px solid var(--primary); background: var(--surface); }
.dg .ck { width: 38px; text-align: center; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.dg thead .ck { z-index: 3; background: var(--surface-2); }
.dg tr.sel td { background: var(--primary-soft); }
.dg tr.sel .ck { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.dg th.rn .th-in { min-width: 0; }
.dg .rownum { font-family: var(--font-mono); font-size: 11px; color: var(--muted); padding: 0 8px; text-align: right; }
.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.pager .spacer { flex: 1; }

/* ---------- Construtor de painéis ---------- */
.panel-tabs { display: flex; align-items: center; gap: 4px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.ptab { display: inline-flex; align-items: center; gap: 3px; padding: 4px 4px 4px 10px; font-size: 12.5px; border-radius: 8px 8px 0 0; border: 1px solid transparent; border-bottom: 0; cursor: pointer; background: transparent; color: var(--text-2); white-space: nowrap; font-weight: 500; }
.ptab:hover { background: var(--surface-2); }
.ptab.on { background: var(--surface); border-color: var(--border); color: var(--text); margin-bottom: -1px; padding-bottom: 5px; }
.ptab .icon-btn { width: 20px; height: 20px; }
.panel-tabs { justify-content: flex-start; }
.panel-tabs > .btn.sm { height: 24px; font-size: 12px; padding: 0 8px; }
.ptab.drop-before { box-shadow: inset 3px 0 0 var(--primary); }
.lib-toggle { flex: none; margin-right: 6px; }
.lib-toggle.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
/* Biblioteca de painéis: menu suspenso logo abaixo do botão "Biblioteca" (posição calculada em builder.js;
   sobreposto, não altera a grade do painel) */
.lib-toggle .ic-sm { margin-left: 2px; transition: transform .15s ease; }
.lib-toggle[aria-expanded="true"] .ic-sm { transform: rotate(180deg); }
.lib-drop { position: fixed; top: 0; left: 8px; width: min(340px, calc(100vw - 16px)); max-height: 70vh; z-index: 55; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 10px); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; overflow: hidden; animation: lib-drop-in .12s ease-out; }
.lib-drop[hidden] { display: none; }
@keyframes lib-drop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lib-drop { animation: none; } .lib-toggle .ic-sm { transition: none; } }
.lib-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.lib-tools { display: grid; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.lib-body { flex: 1; overflow-y: auto; padding: 6px 8px 16px; }
.lib-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3, var(--text-2)); margin: 12px 4px 4px; font-weight: 600; }
.lib-fhead { display: flex; align-items: center; gap: 6px; padding: 4px 4px; border-radius: 6px; font-weight: 600; }
.lib-fhead.over { background: var(--primary-soft); outline: 1px dashed var(--primary); }
.lib-fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-caret { width: 18px; flex: none; border: 0; background: none; color: var(--text-2); cursor: pointer; padding: 0; font-size: 12px; }
.lib-children { padding-left: 14px; border-left: 1px solid var(--border); margin-left: 12px; }
.lib-board { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 6px; cursor: pointer; }
.lib-board:hover { background: var(--surface-2); }
.lib-board.on { background: var(--primary-soft); }
.lib-bname { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lib-bname b, .lib-bname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-star { border: 0; background: none; cursor: pointer; color: var(--text-2); opacity: .45; font-size: 15px; padding: 0 2px; }
.lib-star.on { color: #e0a100; opacity: 1; }
.lib-star:disabled { cursor: default; }
@media print { .lib-drop { display: none !important; } }
.builder { --fc: var(--fields-w, 200px); --pc: var(--props-w, 272px); display: grid; grid-template-columns: var(--fc) minmax(0, 1fr) var(--pc); gap: 12px; align-items: start; }
.builder.fields-collapsed { --fc: 26px; } .builder.props-collapsed { --pc: 26px; }
.builder > section { position: relative; }
/* alças para alargar as colunas de Campos e de Formato (arrastar; duplo clique volta ao padrão) */
.pane-grip { position: absolute; top: 0; bottom: 0; width: 12px; z-index: 6; cursor: col-resize; touch-action: none; border-radius: 6px; }
.pane-grip.l { left: -12px; } .pane-grip.r { right: -12px; }
.pane-grip::after { content: ''; position: absolute; top: 40px; left: 5px; width: 2px; height: 46px; border-radius: 2px; background: var(--border-strong); opacity: 0; transition: opacity .15s; }
.pane-grip:hover::after, .pane-grip:focus-visible::after, .pane-grip.on::after { opacity: 1; background: var(--primary); }
.pane-grip:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.builder.preview-mode .pane-grip { display: none; }
body.pane-resizing, body.pane-resizing * { cursor: col-resize !important; user-select: none !important; }
.builder.preview-mode { grid-template-columns: minmax(0, 1fr); }
.builder.preview-mode .fields-pane, .builder.preview-mode .props-pane { display: none; }
.pane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; position: sticky; top: calc(var(--topbar-h) + 12px); max-height: calc(100vh - var(--topbar-h) - 24px); overflow-y: auto; }
.pane-head { padding: 12px 14px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--border); }
.pane-head h3 { font-size: 13px; font-weight: 600; }
.pane-body { padding: 10px 12px 14px; }
.field-list { display: flex; flex-direction: column; gap: 2px; }
.field-group-label { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin: 10px 4px 4px; }
.fld {
  display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 6px; cursor: grab; font-size: 13px;
  border: 1px solid transparent; user-select: none;
}
.fld:hover { background: var(--surface-2); border-color: var(--border); }
.fld .t { font-family: var(--font-mono); font-size: 10px; width: 22px; text-align: center; color: var(--muted); border: 1px solid var(--border); border-radius: 3px; flex: none; }
.fld .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fld.calc .t { color: var(--accent); border-color: var(--accent); }
.canvas-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.canvas-bar .spacer { flex: 1; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fchip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 4px 0 9px; border-radius: 999px; background: var(--accent-soft); color: var(--text); font-size: 12px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.fchip b { font-weight: 600; }
.fchip button { border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--text-2); }
.fchip button:hover { background: var(--surface-3); }
.autosave { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.dash-canvas {
  position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 64px; gap: 10px;
  min-height: 420px; padding: 10px; border-radius: var(--radius);
  background-color: var(--surface-2);
  background-image: radial-gradient(circle, var(--border-strong) 1px, transparent 1.2px);
  background-size: 22px 22px; border: 1px solid var(--border);
}
.dash-canvas.drop-target { box-shadow: inset 0 0 0 2px var(--primary); }
.widget {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; min-width: 0; min-height: 0; box-shadow: var(--shadow);
}
.widget.selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow); }
.widget.dragging { opacity: .85; z-index: 10; box-shadow: var(--shadow-pop); }
.w-head { display: flex; align-items: center; gap: 6px; padding: 8px 8px 0 12px; min-height: 34px; }
.w-title { flex: 1; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-handle { cursor: move; color: var(--muted); display: grid; place-items: center; touch-action: none; }
/* Barra de ações do visual: fica ACIMA do cartão, presa à borda de cima (nunca cobre a alça de mover, o título ou a
   granularidade, mesmo em visuais pequenos); aparece ao passar o mouse ou com o visual selecionado. */
.w-tools { position: absolute; bottom: calc(100% - 1px); right: 10px; z-index: 3; display: flex; align-items: center; gap: 2px; padding: 2px 3px; border-radius: 8px 8px 0 0; background: var(--surface); box-shadow: 0 0 0 1px var(--border), 0 -4px 10px rgba(0,0,0,.06); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
.dash-canvas:not(.free) .widget:hover, .dash-canvas:not(.free) .widget.selected, .dash-canvas:not(.free) .widget:focus-within { z-index: 6; }
.dash-canvas.free .widget:hover { z-index: 9000; }
.widget:hover .w-tools, .widget.selected .w-tools, .widget:focus-within .w-tools { opacity: 1; pointer-events: auto; }
.w-gran { height: 24px; font-size: 11.5px; padding: 0 4px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); }
.w-body { flex: 1; min-height: 0; position: relative; padding: 4px 8px 8px; container-type: size; }
.w-chart { position: absolute; inset: 4px 8px 8px; }
.w-resize { position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; cursor: nwse-resize; touch-action: none; opacity: .5;
  background: linear-gradient(135deg, transparent 50%, var(--border-strong) 50% 58%, transparent 58% 70%, var(--border-strong) 70% 78%, transparent 78%); }
.w-kpi { height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 0 6px; gap: 2px; overflow: hidden; }
.w-kpi .v { font-size: clamp(18px, min(15cqw, 42cqh), 40px); white-space: nowrap; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.w-kpi .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-table { position: absolute; inset: 4px 8px 8px; overflow: auto; }
.w-table .tbl th { position: sticky; top: 0; background: var(--surface); }
.w-slicer { position: absolute; inset: 4px 10px 10px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.w-slicer label { display: flex; align-items: center; gap: 7px; padding: 3px 4px; border-radius: 5px; cursor: pointer; font-size: 13px; }
.w-slicer label:hover { background: var(--surface-2); }
.w-slicer .cnt { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.w-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 12.5px; padding: 10px; }
.viz-types { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.vt { aspect-ratio: 1; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); cursor: pointer; display: grid; place-items: center; color: var(--text-2); padding: 0; }
.vt:hover { border-color: var(--border-strong); color: var(--text); }
.vt.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.vt svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.vt-name { font-size: 12px; color: var(--text-2); margin: 6px 0 2px; }
.zone { margin-top: 12px; }
.zone .zl { font-size: 11.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px; display: flex; justify-content: space-between; }
.zone .zl span { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }
.zone-drop { min-height: 36px; border: 1.5px dashed var(--border-strong); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; gap: 4px; }
.zone-drop.over { border-color: var(--primary); background: var(--primary-soft); }
.zone-drop .ph { font-size: 12px; color: var(--muted); padding: 5px 6px; }
.zchip { display: flex; align-items: center; gap: 4px; padding: 3px 3px 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; flex-wrap: wrap; }
.zchip .n { flex: 1; min-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.zchip select { height: 24px; font-size: 11.5px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface); padding: 0 3px; max-width: 120px; }
.zchip .fvals { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }
.prop-group { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.prop-group > .lbl { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.color-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.color-row input[type="color"] { width: 30px; height: 24px; border: 1px solid var(--border); border-radius: 5px; padding: 1px; background: var(--surface); cursor: pointer; }
.color-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Modo apresentação ---------- */
.present { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: flex; flex-direction: column; padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
.present-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.present-bar h2 { font-size: 18px; font-weight: 600; flex: 1; min-width: 0; }
.present-body { flex: 1; overflow: auto; min-height: 0; }
.present .dash-canvas { background-image: none; border: 0; padding: 0; background: transparent; }
.present-dots { display: flex; gap: 6px; }
.present-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.present-dots i.on { background: var(--primary); }

/* ---------- SLA ---------- */
.sla-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.sla-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.sla-card .top { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.sla-card h3 { font-size: 15px; font-weight: 600; }
.sla-time { font-family: var(--font-mono); font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.sla-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.sla-scale { position: relative; height: 10px; border-radius: 5px; overflow: hidden; display: flex; }
.sla-scale i { display: block; height: 100%; }
.rule-row { display: grid; grid-template-columns: minmax(0, 1.2fr) 120px minmax(0, 1.4fr) 34px; gap: 8px; align-items: center; }
.rule-text { font-size: 12.5px; color: var(--text-2); }
.rule-text code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-3); padding: 0 4px; border-radius: 3px; }

/* ---------- Configurações ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.preset { border: 1px solid var(--border); border-radius: 9px; padding: 8px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 6px; text-align: left; color: var(--text); }
.preset.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.preset .sw { display: flex; height: 22px; border-radius: 5px; overflow: hidden; }
.preset .sw i { flex: 1; }
.preset span { font-size: 12.5px; font-weight: 500; }
.logo-preview { width: 96px; height: 96px; border: 1px dashed var(--border-strong); border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); padding: 10px; }
.logo-preview img, .logo-preview svg { max-width: 100%; max-height: 100%; }
.danger-zone { border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); }
.danger-zone .card-head h2 { color: var(--danger); }
.demo-note { margin-top: 14px; padding: 8px 12px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--muted); }

/* ---------- Modais, paleta de comandos, toasts ---------- */
.modal-back { position: fixed; inset: 0; z-index: 150; background: rgba(15, 20, 28, .45); display: grid; grid-template-columns: minmax(0, 1fr); place-items: start center; padding: 8vh 16px 16px; overflow-y: auto; }
.modal { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.4); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; max-height: 84vh; }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 16px; font-weight: 600; }
.modal-head.drag-handle { cursor: move; touch-action: none; user-select: none; }
.modal-head.drag-handle button { cursor: pointer; }
.modal.dragging { box-shadow: 0 18px 48px rgba(15, 20, 28, .32); }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.cmdk { width: min(620px, 100%); }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cmdk-input input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; min-width: 0; }
.cmdk-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.cmdk-group { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; padding: 8px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.cmdk-item .ic { stroke: var(--muted); }
.cmdk-item.on { background: var(--primary-soft); }
.cmdk-item.on .ic { stroke: var(--primary); }
.cmdk-item .meta { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.cmdk-item .lbl2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toasts { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-pop); font-size: 13.5px; max-width: 420px; animation: toastIn .2s ease-out; }
.toast .ic { flex: none; }
.toast.ok .ic { stroke: var(--st-ok); }
.toast.warn .ic { stroke: var(--st-warn); }
.toast.err .ic { stroke: var(--st-late); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.alert-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.alert-item:hover { background: var(--surface-2); }
.alert-item .ai-main { flex: 1; min-width: 0; }
.alert-item .ai-title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-item .ai-meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.timeline { display: flex; flex-direction: column; gap: 0; margin-top: 14px; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline .tl { position: relative; padding: 0 0 12px 16px; font-size: 13px; }
.timeline .tl::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.timeline .tl.ok::before { border-color: var(--st-ok); background: var(--st-ok); }
.timeline .tl.late::before { border-color: var(--st-late); background: var(--st-late); }
.timeline .tl.warn::before { border-color: var(--st-warn); background: var(--st-warn); }

/* ---------- Responsivo ---------- */
@media (max-width: 1280px) {
  .builder { grid-template-columns: var(--fc) minmax(0, 1fr); }
  .pane-grip.r { display: none; }
  .props-pane { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  :root { --nav-w: 240px; }
  body.nav-rail .sidenav { width: var(--nav-w); }
  body.nav-rail .sidenav a { justify-content: flex-start; padding: 8px 10px; }
  body.nav-rail .sidenav a span { display: inline; }
  .sidenav { position: fixed; left: 0; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); bottom: 0; height: auto; z-index: 60; transform: translateX(-105%); transition: transform .2s; background: var(--surface); box-shadow: var(--shadow-pop); }
  .sidenav.open { transform: none; }
  .view { padding: 16px 16px 40px; }
  .st-label { display: none; }
  .search-trigger kbd { display: none; }
  .builder { grid-template-columns: minmax(0, 1fr); }
  .pane-grip { display: none; }
  .pane { position: static; max-height: 340px; }
  .props-pane { max-height: none; }
  .dash-canvas { display: flex; flex-direction: column; background-image: none; }
  .dash-canvas .widget { height: var(--wh, 300px); }
  .dash-canvas.free { height: auto !important; }
  .dash-canvas.free > .widget { position: relative; left: auto; top: auto; width: auto; z-index: auto; }
  .w-resize { display: none; }
  .rule-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .topbar { padding-inline: 10px; gap: 6px; }
  .user-text { display: none; }
  .brand { padding-left: 8px; }
  .brand-name { display: none; }
  .kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi .k-value { font-size: 24px; }
  .grid-toolbar .input { width: 100%; }
  .page-head h1 { font-size: 18px; }
}

/* ---------- Fase 1.1: período, metas, cadastros ---------- */
.period { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-width: 0; }
.period .select { width: auto; }
.period-custom { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.period-custom .input { height: 28px; font-size: 12.5px; padding: 0 7px; }
.period-chip { font-size: 11.5px; padding: 3px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.page-filter { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.page-filter:empty { display: none; }
.page-filter .lbl { display: inline-flex; align-items: center; gap: 5px; }
.input.invalid, .input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.time-input { width: 84px; }
.date-input { width: 120px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.delta .muted { font-weight: 400; }
.delta.ok { color: var(--st-ok-ink); }
.delta.late { color: var(--st-late-ink); }
.delta.neutral { color: var(--text-2); }
.w-kpi { justify-content: safe center; }
.w-kpi .kx { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 3px; }
.w-kpi .v { font-size: clamp(18px, min(15cqw, 32cqh), 38px); } /* sem !important: o "Tamanho do valor" da aba Formato (estilo em linha) precisa vencer */
.w-kpi.acc-ok { box-shadow: inset 3px 0 0 var(--st-ok); padding-left: 10px; }
.w-kpi.acc-warn { box-shadow: inset 3px 0 0 var(--st-warn); padding-left: 10px; }
.w-kpi.acc-late { box-shadow: inset 3px 0 0 var(--st-late); padding-left: 10px; }
.goal-tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); opacity: .55; }
.metric-box { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px 12px; margin: 0; min-width: 0; }
.metric-box legend { padding: 0 6px; }
.metric-box.off .form-grid { opacity: .45; }
.sla-mt th, .sla-mt td { padding: 5px 6px; }
.week-grid { display: flex; flex-direction: column; }
.wk-day { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.wk-name { font-weight: 600; font-size: 13px; }
.wk-ivs { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.wk-iv { display: inline-flex; align-items: center; gap: 4px; }
.wk-iv .input { height: 30px; }
.nav-foot .portal-link { display: flex; align-items: center; gap: 6px; padding: 4px 0 8px; color: var(--primary); text-decoration: none; font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; letter-spacing: 0; }
.nav-foot .portal-link:hover { text-decoration: underline; }
.dash-canvas.overview { background-image: none; background-color: transparent; border: 0; padding: 0; }
.slicer-period .period { flex-direction: column; align-items: stretch; }
@media (max-width: 560px) { .wk-day { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Rodada 3: grid, status de controle, Radar de SLA ---------- */
.pill.na { background: #efe7dc; color: #7a6248; }
:root[data-theme="dark"] .pill.na { background: rgba(201, 180, 154, .16); color: #e2cdb0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.na { background: rgba(201, 180, 154, .16); color: #e2cdb0; } }
.dg .th-filter { opacity: .45; }
.dg th:hover .th-filter, .dg .th-filter.on { opacity: 1; }
.dg .th-filter.on { color: var(--primary); background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.col-filter { width: 290px; padding: 10px; display: flex; flex-direction: column; gap: 8px; max-height: 70vh; }
.col-filter .cf-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.col-filter .cf-period { display: flex; flex-direction: column; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.col-filter .cf-period .period { flex-direction: column; align-items: stretch; }
.col-filter .cf-list { overflow: auto; max-height: 240px; display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--border); border-radius: 6px; padding: 4px; }
.col-filter .cf-list label { padding: 3px 4px; border-radius: 4px; }
.col-filter .cf-list label:hover { background: var(--surface-2); }
.col-filter .cf-v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-filter .cnt { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.suggest-bar { display: flex; gap: 10px; align-items: flex-start; margin: 8px 12px 0; padding: 10px 12px; border-radius: 10px; background: var(--primary-soft); border: 1px solid var(--border); font-size: 13px; animation: toastIn .2s ease-out; }
.suggest-bar > .ic { stroke: var(--primary); margin-top: 2px; }
.suggest-bar .sg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sg-prev { margin: 0; padding-left: 18px; font-family: var(--font-mono); font-size: 12px; }
.sg-prev s { color: var(--muted); }
.pinned-strip { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.pinned-strip .widget { height: 430px; }
.pinned-strip .w-head { cursor: default; }
.pinned-strip .w-head .tag { margin-left: auto; }
.radar { position: absolute; inset: 4px 8px 8px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.rd-main { flex: 1; min-height: 0; display: flex; gap: 14px; }
.rd-top { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; }
.rd-counts { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: var(--text-2); }
.rd-count i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.rd-count b { font-variant-numeric: tabular-nums; color: var(--text); }
.rd-quick { display: flex; gap: 6px; }
.rd-quick .select { width: auto; max-width: 180px; }
.rd-list tr.done td { color: var(--text-2); }
.seal.done { opacity: .85; }
.radar.animated .seal.done i::after, .radar.animated .seal-warn.done i { animation: none; }
.radar.animated .rd-blip.done .rd-halo { animation: none; }
.rd-left { flex: 0 0 auto; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 48%; min-width: 0; }
.rd-svg { flex: 1; min-height: 0; aspect-ratio: 1; max-width: 100%; height: auto; overflow: visible; }
.rd-lbl { font-size: 0.05px; fill: var(--muted); font-family: var(--font-mono); }
.rd-right { flex: 1; min-width: 0; overflow: auto; }
.rd-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--text-2); justify-content: center; }
.rd-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.rd-list td, .rd-list th { padding: 5px 8px; white-space: nowrap; }
.rd-list tr.hl td { background: var(--primary-soft); }
.rd-blip { cursor: pointer; }
.rd-blip .rd-halo { opacity: 0; }
.rd-blip.hl .rd-halo { opacity: .45; }
.rd-sweep, .rd-orbit, .rd-pulse, .rd-needle, .rd-hexpulse, .rd-spiralrot, .rd-qsweep, .rd-hand { transform-origin: 0 0; transform-box: view-box; }
.rd-pulse { fill: none; stroke: var(--rd-acc, var(--primary)); stroke-width: 0.01; opacity: 0; }
.radar.animated .rd-sweep { animation: rdSpin calc(4s * var(--rd-k, 1)) linear infinite; }
.radar.animated.rd-varredura .rd-halo { animation: rdPing calc(4s * var(--rd-k, 1)) ease-out infinite; }
.radar.animated .rd-pulse { animation: rdPulse calc(3s * var(--rd-k, 1)) ease-out infinite; }
.radar.animated.rd-pulso .rd-halo { animation: rdPing calc(3s * var(--rd-k, 1)) ease-out infinite; }
.radar.animated .rd-needle { animation: rdSwing calc(3.2s * var(--rd-k, 1)) ease-in-out infinite alternate; }
.radar.no-anim .rd-needle { transform: rotate(-30deg); }
.radar.animated.rd-semicirculo .rd-halo { animation: rdPing calc(3.2s * var(--rd-k, 1)) ease-out infinite; }
.radar.animated .rd-hexpulse { animation: rdHex calc(2.4s * var(--rd-k, 1)) ease-in-out infinite; }
.radar.animated.rd-colmeia .rd-blip polygon { animation: rdHex calc(2.4s * var(--rd-k, 1)) ease-in-out infinite; }
.radar.animated .rd-spiralrot { animation: rdSpin calc(30s * var(--rd-k, 1)) linear infinite; }
.radar.animated.rd-espiral .rd-halo { animation: rdPing calc(3s * var(--rd-k, 1)) ease-out infinite; }
.radar.animated .rd-qsweep { animation-name: rdSpin; animation-duration: calc(8s * var(--rd-k, 1)); animation-iteration-count: infinite; }
.radar.animated .rd-hand { animation: rdSpin calc(12s * var(--rd-k, 1)) linear infinite; }
.radar.animated.rd-relogio .rd-halo { animation: rdPing calc(2s * var(--rd-k, 1)) ease-out infinite; }
@keyframes rdSwing { from { transform: rotate(-85deg); } to { transform: rotate(85deg); } }
@keyframes rdHex { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.rd-models { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rd-model { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--text-2); }
.rd-model.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); color: var(--text); }
.rd-model svg { width: 100%; max-width: 54px; height: auto; }
.radar.animated .rd-orbit { animation-name: rdSpin; animation-timing-function: linear; animation-iteration-count: infinite; }
.radar.no-anim .rd-sweep { transform: rotate(35deg); }
@keyframes rdSpin { to { transform: rotate(360deg); } }
@keyframes rdPing { 0%, 6% { opacity: .55; } 40%, 100% { opacity: 0; } }
@keyframes rdPulse { 0% { transform: scale(.05); opacity: .55; } 100% { transform: scale(1.05); opacity: 0; } }
.seal { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.seal i { width: 8px; height: 8px; border-radius: 50%; position: relative; }
.seal-late { background: var(--st-late-soft); color: var(--st-late-ink); } .seal-late i { background: var(--st-late); }
.seal-warn { background: var(--st-warn-soft); color: var(--st-warn-ink); } .seal-warn i { background: var(--st-warn); }
.seal-ok { background: var(--st-ok-soft); color: var(--st-ok-ink); } .seal-ok i { background: var(--st-ok); }
.seal-none { background: var(--surface-3); color: var(--text-2); border-style: dashed; border-color: var(--border-strong); } .seal-none i { background: #b8c0c9; }
.seal-na { background: #efe7dc; color: #7a6248; border-style: dashed; border-color: #c9b49a; } .seal-na i { background: #c9b49a; }
.radar.animated .seal i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: sealRing 2.2s ease-out infinite; }
.radar.animated .seal-late i::after { animation-duration: 1.2s; }
.radar.animated .seal-warn i { animation: sealBlink 1.6s ease-in-out infinite; }
@keyframes sealRing { 0% { transform: scale(.4); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes sealBlink { 50% { opacity: .35; } }
@container (max-width: 560px) { .rd-main { flex-direction: column; } .rd-left { max-width: 100%; height: 55%; } }

/* ================= Estilos visuais (Configurações › Aparência) =================
   "padrao" = visual original (sem regras extras). Os demais crescem em riqueza de detalhes.
   Tokens personalizáveis via inline style: --radius, --radius-sm, --shadow, --font-ui, --grad, --user-*. */
:root { --grad: linear-gradient(135deg, var(--primary), var(--accent)); }
[data-anim="off"] *, [data-anim="off"] *::before, [data-anim="off"] *::after { animation: none !important; transition: none !important; }
/* Densidade */
[data-density="compacta"] .btn { height: 28px; padding: 0 10px; }
[data-density="compacta"] .input, [data-density="compacta"] .select { height: 30px; }
[data-density="compacta"] .card-body { padding: 8px 14px 12px; }
[data-density="compacta"] .card-head { padding: 10px 14px 0; }
[data-density="compacta"] .tbl td, [data-density="compacta"] .tbl th { padding: 5px 8px; }
[data-density="compacta"] .view { padding-top: 8px; }
[data-density="compacta"] .dash-canvas { gap: 6px; }
[data-density="compacta"] .sidenav a { padding: 6px 10px; }
[data-density="confortavel"] .btn { height: 40px; padding: 0 16px; }
[data-density="confortavel"] .input, [data-density="confortavel"] .select { height: 40px; }
[data-density="confortavel"] .card-body { padding: 14px 22px 20px; }
[data-density="confortavel"] .tbl td { padding: 11px 12px; }
[data-density="confortavel"] .sidenav a { padding: 11px 12px; }

/* 1 · Minimal: traço fino, sem sombras */
:root[data-style="minimal"] { --radius: 4px; --radius-sm: 3px; --shadow: none; --font-ui: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif; }
[data-style="minimal"] .card, [data-style="minimal"] .kpi, [data-style="minimal"] .widget, [data-style="minimal"] .pane { box-shadow: none; }
[data-style="minimal"] .btn.primary { background: transparent; color: var(--primary); border-color: var(--primary); }
[data-style="minimal"] .btn.primary:hover { background: var(--primary-soft); filter: none; }
[data-style="minimal"] .kpi::after { display: none; }
[data-style="minimal"] .kpi.st-ok, [data-style="minimal"] .kpi.st-warn, [data-style="minimal"] .kpi.st-late { border-top-width: 1px; }
[data-style="minimal"] .page-head h1 { font-weight: 500; }

/* 2 · Corporativo: sólido, contraste */
:root[data-style="corporativo"] { --radius: 6px; --radius-sm: 4px; --shadow: 0 1px 2px rgba(10, 20, 35, .12); --font-ui: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif; }
[data-style="corporativo"] .topbar { background: var(--primary); border-bottom-color: var(--primary); }
[data-style="corporativo"] .topbar .user-name, [data-style="corporativo"] .topbar .brand b, [data-style="corporativo"] .topbar .brand, [data-style="corporativo"] .topbar .icon-btn, [data-style="corporativo"] .topbar .user-role, [data-style="corporativo"] .topbar .user-btn > .ic { color: var(--primary-ink); }
[data-style="corporativo"] .topbar .icon-btn:hover, [data-style="corporativo"] .topbar .user-btn:hover { background: rgba(255, 255, 255, .14); border-color: transparent; }
[data-style="corporativo"] .topbar .brand { border-left-color: rgba(255, 255, 255, .35); }
[data-style="corporativo"] .topbar .brand-logo { background: #fff; border-radius: 50%; }
[data-style="corporativo"] .sidenav { background: var(--surface); }
[data-style="corporativo"] .sidenav a.active { background: var(--primary); color: var(--primary-ink); box-shadow: none; }
[data-style="corporativo"] .sidenav a.active .ic { stroke: var(--primary-ink); }
[data-style="corporativo"] .card, [data-style="corporativo"] .kpi, [data-style="corporativo"] .widget { border-color: var(--border-strong); }
[data-style="corporativo"] .tbl th { background: var(--surface-2); color: var(--text-2); }
[data-style="corporativo"] .page-head h1 { font-weight: 700; }

/* 3 · Suave: cantos arredondados, tons pastéis */
:root[data-style="suave"] { --radius: 18px; --radius-sm: 12px; --shadow: 0 6px 24px rgba(40, 60, 90, .08); --font-ui: "Manrope", "Segoe UI", system-ui, sans-serif; }
[data-style="suave"] .btn, [data-style="suave"] .input, [data-style="suave"] .select, [data-style="suave"] .search-trigger { border-radius: 999px; }
[data-style="suave"] .card, [data-style="suave"] .kpi, [data-style="suave"] .widget, [data-style="suave"] .pane, [data-style="suave"] .modal { border-radius: var(--radius); border-color: transparent; }
[data-style="suave"] .kpi { background: color-mix(in srgb, var(--surface) 90%, var(--primary)); }
[data-style="suave"] .kpi.st-ok { background: color-mix(in srgb, var(--surface) 82%, var(--st-ok)); border-top: 0; }
[data-style="suave"] .kpi.st-warn { background: color-mix(in srgb, var(--surface) 82%, var(--st-warn)); border-top: 0; }
[data-style="suave"] .kpi.st-late { background: color-mix(in srgb, var(--surface) 82%, var(--st-late)); border-top: 0; }
[data-style="suave"] .sidenav a { border-radius: 999px; }

/* 4 · Gradiente: botões, cabeçalhos e KPIs com gradiente */
:root[data-style="gradiente"] { --radius: 12px; --radius-sm: 8px; --shadow: 0 4px 18px rgba(30, 50, 90, .10); --font-ui: "Manrope", "Segoe UI", system-ui, sans-serif; }
[data-style="gradiente"] .btn.primary { background: var(--grad); border-color: transparent; color: #fff; }
[data-style="gradiente"] .topbar { border-bottom: 0; box-shadow: 0 2px 0 0 transparent; background-image: linear-gradient(var(--surface), var(--surface)), var(--grad); background-origin: border-box; background-clip: padding-box, border-box; border-bottom: 3px solid transparent; }
[data-style="gradiente"] .page-head h1 { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-style="gradiente"] .kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--grad); }
[data-style="gradiente"] .kpi .k-value, [data-style="gradiente"] .w-kpi .v { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-style="gradiente"] .tab.on { border-bottom-color: var(--accent); }
[data-style="gradiente"] .sidenav a.active { background: var(--grad); color: #fff; box-shadow: none; }
[data-style="gradiente"] .sidenav a.active .ic { stroke: #fff; }
[data-style="gradiente"] .w-head { border-bottom: 2px solid transparent; border-image: var(--grad) 1; padding-bottom: 6px; }
[data-grad="off"][data-style="gradiente"] .page-head h1, [data-grad="off"][data-style="gradiente"] .kpi .k-value, [data-grad="off"][data-style="gradiente"] .w-kpi .v { color: var(--primary); }

/* 5 · Vidro: superfícies translúcidas com desfoque */
:root[data-style="vidro"] { --radius: 16px; --radius-sm: 10px; --shadow: 0 8px 32px rgba(20, 30, 60, .14); }
[data-style="vidro"] body { background: radial-gradient(1200px 600px at 10% -10%, var(--primary-soft), transparent 60%), radial-gradient(900px 500px at 100% 0%, var(--accent-soft), transparent 55%), var(--bg); background-attachment: fixed; }
[data-style="vidro"] .card, [data-style="vidro"] .kpi, [data-style="vidro"] .widget, [data-style="vidro"] .pane, [data-style="vidro"] .topbar, [data-style="vidro"] .menu, [data-style="vidro"] .modal, [data-style="vidro"] .page-filter, [data-style="vidro"] .stype {
  background: color-mix(in srgb, var(--surface) 64%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  border-color: color-mix(in srgb, var(--surface) 55%, var(--border)); }
[data-style="vidro"] .sidenav { background: color-mix(in srgb, var(--surface) 35%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
[data-style="vidro"] .dash-canvas { background-color: color-mix(in srgb, var(--surface) 30%, transparent); }
[data-style="vidro"] .btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent); }

/* 6 · Analítico avançado: densidade de informação, cabeçalhos com ícones */
:root[data-style="analitico"] { --radius: 8px; --radius-sm: 5px; --shadow: 0 1px 2px rgba(20, 30, 45, .08), 0 6px 20px rgba(20, 30, 45, .08); --font-ui: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif; }
[data-style="analitico"] .w-head { background: linear-gradient(90deg, var(--primary-soft), transparent 70%); border-radius: var(--radius) var(--radius) 0 0; padding-bottom: 6px; }
[data-style="analitico"] .kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad); }
[data-style="analitico"] .tbl th { font-family: var(--font-mono); font-size: 10.5px; }
.w-ico { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; background: var(--primary-soft); color: var(--primary); flex: none; }
.w-ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.kpi-spark { display: block; width: 100%; height: 26px; margin-top: 2px; }

/* Prévia dos estilos */
.style-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.style-card { border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 6px; text-align: left; color: var(--text); }
.style-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.style-card svg { width: 100%; height: auto; border-radius: 6px; }
.style-card b { font-size: 13px; }
.style-card span { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.color-field { display: flex; gap: 6px; align-items: center; }
.color-field .input[type="text"] { font-family: var(--font-mono); }

.tab-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--st-warn); color: #4a3a05; font-size: 11px; font-weight: 700; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--st-warn); margin-left: auto; flex: none; box-shadow: 0 0 0 2px var(--bg); }
body.nav-rail .nav-dot { position: absolute; margin: -14px 0 0 14px; }
.sidenav a { position: relative; }

/* Impressão / exportação PDF do painel */
@media print {
  .topbar, .sidenav, .canvas-bar, .panel-tabs, .fields-pane, .props-pane, .page-head, .toasts, .w-tools, .w-resize { display: none !important; }
  .builder { display: block; }
  .view { padding: 0; }
  .dash-canvas { background: none; border: 0; }
  body { background: #fff; }
}

/* ---------- Rodada 7 ---------- */
/* Grid: linha da célula selecionada em destaque e coluna de referência */
.dg tr.active-row td { background: color-mix(in srgb, var(--primary) 9%, var(--surface)); }
.dg tr.active-row td.rownum { color: var(--primary); font-weight: 700; box-shadow: inset 3px 0 0 var(--primary); }
.dg tr.active-row .ck { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
.dg tr.active-row.sel td { background: color-mix(in srgb, var(--primary) 16%, var(--surface)); }
.dg tr.active-row td.cell.changed { background: color-mix(in srgb, var(--st-warn-soft) 70%, var(--primary) 12%); }
.dg thead th.active-col { box-shadow: inset 0 -2px 0 var(--primary); }
.dg thead th.active-col .th-name { color: var(--primary); }
.dg .th-add { opacity: .45; }
.dg th:hover .th-add { opacity: 1; }
.menu-item[disabled] { opacity: .45; cursor: not-allowed; }
.menu-item[disabled]:hover { background: transparent; }
.menu-label { padding: 6px 10px 2px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* SLA: conteúdo dos cards sempre dentro das margens */
.sla-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.sla-card { min-width: 0; overflow: hidden; }
.sla-card > * { min-width: 0; max-width: 100%; }
.sla-mt { table-layout: fixed; width: 100%; }
.sla-mt th { white-space: normal; letter-spacing: .02em; font-size: 10.5px; line-height: 1.2; vertical-align: bottom; }
.sla-mt td { overflow-wrap: anywhere; }
.sla-mt th:nth-child(1), .sla-mt td:nth-child(1) { width: 22%; }
.sla-mt th:nth-child(3), .sla-mt td:nth-child(3), .sla-mt th:nth-child(4), .sla-mt td:nth-child(4) { width: 13%; }
.sla-mt th:nth-child(5), .sla-mt td:nth-child(5) { width: 19%; }
.sla-mt th, .sla-mt td { padding-left: 4px; padding-right: 4px; }
.sla-mt .pill { max-width: 100%; padding: 0 5px; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.sla-card .rule-text { overflow-wrap: anywhere; }
.metric-box .form-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.prio-tbl { width: 100%; table-layout: fixed; }
.prio-tbl th { white-space: normal; }
.prio-tbl td { padding: 4px 6px; vertical-align: top; }
.prio-tbl td .input, .prio-tbl td .select { width: 100%; min-width: 0; }
.prio-tbl .prio-when { display: flex; gap: 4px; align-items: center; }
.prio-tbl .prio-when > * { flex: 1; min-width: 0; }
.prio-src { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
@media (max-width: 640px) { .prio-src { grid-template-columns: 1fr; } }

/* Cadastros › Clientes: importação do dataset */
.cli-imp-tbl td { vertical-align: middle; }
.cli-imp-tbl .select { min-width: 140px; }

/* Situação da conexão com o servidor (menu do usuário) */
.mode-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.mode-pill.db { background: var(--primary-soft); color: var(--primary); }

/* ---------- Rodada 8 ---------- */
/* Grid: nº da linha fixo ao rolar na horizontal, junto com a caixa de seleção */
.dg .ck { width: 38px; min-width: 38px; max-width: 38px; }
.dg td.rownum, .dg th.rn { position: sticky; left: var(--ck-w, 38px); z-index: 1; background: var(--surface); min-width: 46px; box-shadow: inset -1px 0 0 var(--border-strong); }
.dg thead th.rn { z-index: 3; background: var(--surface-2); }
.dg tr.sel td.rownum { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.dg tr.active-row td.rownum { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); box-shadow: inset 3px 0 0 var(--primary), inset -1px 0 0 var(--border-strong); }
.db-grid .dg td.rownum, .db-grid .dg th.rn { left: 0; }

/* Menu lateral, estilo Padrão: trilho de ícones; o botão de menu expande a barra sobre o conteúdo
   (a largura no fluxo continua a do trilho); "Fixar" a mantém expandida ao lado do conteúdo */
body.nav-pinned .sidenav { width: var(--nav-w); }
body.nav-open .sidenav { width: var(--nav-w); margin-right: calc(62px - var(--nav-w)); z-index: 65; background: var(--surface); box-shadow: var(--shadow-pop); }
.nav-tools { display: flex; align-items: center; gap: 2px; padding: 0 0 8px; margin-bottom: 6px; border-bottom: 1px dashed var(--border); }
body.nav-rail .nav-tools { display: none; }
.nav-tool { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border: 0; border-radius: 6px; background: none; color: var(--muted); font: 600 11px var(--font-ui); letter-spacing: 0; cursor: pointer; }
.nav-tool .ic { width: 14px; height: 14px; }
.nav-tool:hover { color: var(--primary); background: var(--surface-2); }
.nav-tool[aria-pressed="true"] { color: var(--primary); }
#navToggle[aria-expanded="true"] { background: var(--primary-soft); color: var(--primary); }
body.nav-blocks #navToggle .ic { width: 22px; height: 22px; }

/* Menu lateral, estilo Blocos: sem barra lateral; painel flutuante do tamanho dos blocos (até 4 por linha) */
body.nav-blocks .sidenav { display: none; }
.nav-overlay { position: fixed; inset: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)) 0 0 0; z-index: 70; background: rgba(15, 20, 28, .22); }
.nav-pop { position: absolute; top: 8px; left: 8px; max-width: calc(100vw - 16px); max-height: calc(100% - 16px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-pop); animation: navIn .16s ease-out; }
@keyframes navIn { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.nav-pop-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--border); }
.nav-pop-head .spacer { flex: 1; min-width: 8px; }
.nav-pop-body { overflow-y: auto; padding: 10px; display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, var(--blk, 84px))); gap: 8px; align-content: start; }
.nav-pop-body a { position: relative; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--blk, 84px) * .07); padding: 4px; text-align: center; border: 1px solid var(--border); border-radius: 12px; color: var(--text-2); text-decoration: none; font-weight: 500; font-size: clamp(10px, calc(var(--blk, 84px) * .135), 13.5px); line-height: 1.2; hyphens: manual; overflow-wrap: normal; word-break: normal; }
.nav-pop-body a .ic { width: calc(var(--blk, 84px) * .28); height: calc(var(--blk, 84px) * .28); flex: none; }
.nav-pop-body a:hover, .nav-pop-body a:focus-visible { background: var(--surface-2); color: var(--text); }
.nav-pop-body a.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.nav-pop-body .nav-dot { position: absolute; top: 7px; right: 7px; margin: 0; }
.nav-pop-foot { padding: 8px 14px; border-top: 1px dashed var(--border); font-size: 12.5px; }
.nav-pop-foot a { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); text-decoration: none; font-weight: 600; }
@media (max-width: 860px) {
  body.nav-open .sidenav { margin-right: 0; transform: none; }
  #navPin { display: none; }
}

/* Fontes de dados: armazenamento, selos e ativação */
.pill.acc { background: var(--accent-soft); color: var(--accent); }
.pill.clickable { cursor: pointer; }
.warn-text { color: var(--st-warn-ink); }
.pill.clickable:hover { filter: brightness(.96); text-decoration: underline; }
.src-badges { display: flex; flex-wrap: wrap; gap: 4px; max-width: 520px; }
.src-badges .pill { height: auto; min-height: 22px; white-space: nowrap; }
.src-tbl tr.src-off td:not(:first-child) { opacity: .55; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-strong); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + span { background: var(--st-ok); box-shadow: none; }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.store-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.store-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--surface); }
.store-opt input { margin-top: 3px; }
.store-opt.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.store-opt.dis { opacity: .55; cursor: not-allowed; }
.store-opt .so-ic { color: var(--primary); }
.store-opt .so-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.store-opt .so-txt .small { color: var(--muted); line-height: 1.35; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg-opt { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; cursor: pointer; font-weight: 500; }
.seg-opt input { margin: 0; }
.seg-opt.on, .seg-opt:has(input:checked) { background: var(--primary-soft); color: var(--primary); }
.cb-join { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.cb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 2px 12px; max-height: 240px; overflow: auto; padding: 4px 0; }
.cb-cols summary { cursor: pointer; font-size: 12.5px; color: var(--text-2); font-weight: 600; }

/* Banco de dados (tabelas do PostgreSQL) */
.db-layout { display: grid; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr); gap: 16px; align-items: start; }
.db-tables { position: sticky; top: calc(var(--topbar-h) + 12px); max-height: calc(100vh - var(--topbar-h) - 40px); display: flex; flex-direction: column; overflow: hidden; }
.db-list { overflow-y: auto; padding: 0 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.db-schema { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 6px 4px; display: flex; align-items: center; gap: 4px; }
.db-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 8px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text); text-align: left; cursor: pointer; }
.db-item:hover { background: var(--surface-2); }
.db-item.on { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.db-item .db-name { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12.5px; }
.db-item .db-desc { font-size: 11px; line-height: 1.3; }
.db-view { min-width: 0; }
.db-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.db-head .section-title { display: flex; align-items: center; gap: 6px; }
.db-cols { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 14px 10px; }
.db-col { display: inline-flex; align-items: center; gap: 4px; }
.db-grid.loading { opacity: .55; }
@media (max-width: 960px) { .db-layout { grid-template-columns: minmax(0, 1fr); } .db-tables { position: static; max-height: 320px; } }

/* ---------- Personalização dos visuais (aba Formato, estilo Google Sheets) ---------- */
.widget.selected { outline: 2px solid var(--primary); outline-offset: 1px; }
.w-body { padding: 4px var(--w-pad, 8px) var(--w-pad, 8px); }
.w-chart, .w-table { inset: 4px var(--w-pad, 8px) var(--w-pad, 8px); }
.w-title.off { visibility: hidden; }
.w-head.bare { min-height: 0; padding: 0; height: 6px; }
.w-sub { padding: 0 12px; font-size: 11.5px; color: var(--muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx { gap: 8px; }
.fx-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.fx-sec { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.fx-sec > summary { cursor: pointer; list-style: none; padding: 8px 10px; font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; user-select: none; }
.fx-sec > summary::-webkit-details-marker { display: none; }
.fx-sec > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
.fx-sec[open] > summary::before { transform: rotate(45deg); }
.fx-sec[open] > summary { border-bottom: 1px solid var(--border); }
.fx-sec > summary:hover { color: var(--primary); }
.fx-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 7px; }
.fx-row { display: grid; grid-template-columns: minmax(84px, 40%) minmax(0, 1fr); align-items: center; gap: 6px; font-size: 12px; }
.fx-row .fx-l { color: var(--text-2); line-height: 1.25; }
.fx-row .select, .fx-row .input { width: 100%; min-width: 0; }
.fx-hint { font-size: 11px; color: var(--muted); line-height: 1.35; margin-top: -3px; }
.fx-sub { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.fx-check { font-size: 12px; }
.fx-rc { display: flex; align-items: center; gap: 4px; min-width: 0; }
.fx-rc input[type="range"] { flex: 1; min-width: 0; accent-color: var(--primary); }
.fx-rc output { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); min-width: 40px; text-align: right; }
.fx-reset { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid transparent; border-radius: 5px; background: none; color: var(--muted); cursor: pointer; padding: 0; flex: none; }
.fx-reset:hover:not(:disabled) { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.fx-reset:disabled { opacity: .3; cursor: default; }
.fx-color { display: flex; align-items: center; gap: 6px; min-width: 0; }
.fx-color input[type="color"] { width: 34px; height: 24px; border: 1px solid var(--border); border-radius: 5px; padding: 1px; background: var(--surface); cursor: pointer; flex: none; }
.fx-color.unset input[type="color"] { opacity: .45; }
.fx-color .small { flex: 1; font-family: var(--font-mono); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.fx-tb { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; min-width: 0; }
.fx-tb .fx-size { width: 58px; flex: none; }
.fx-tb .select { flex: 1; min-width: 0; }
.fx-tog { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 5px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 13px; }
.fx-tog:hover { border-color: var(--border-strong); color: var(--text); }
.fx-tog[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.fx-corners { display: flex; flex-wrap: wrap; gap: 3px; }
.fx-corner { display: inline-flex; gap: 4px; font-size: 11px; height: 24px; }
.fx-corner i { width: 12px; height: 10px; border: 1.5px solid currentColor; display: inline-block; }
.fx-order { display: flex; flex-direction: column; gap: 2px; }
.fx-oi { display: flex; align-items: center; gap: 2px; font-size: 12px; padding: 2px 2px 2px 8px; border-radius: 5px; background: var(--surface-2); }
.fx-oi span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zmove { display: inline-flex; gap: 1px; }
.zmv { display: inline-grid; place-items: center; width: 20px; height: 22px; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.zmv:hover:not(:disabled) { background: var(--surface); border-color: var(--border); color: var(--primary); }
.zmv:disabled { opacity: .25; cursor: default; }
.zmv .ic-sm { width: 13px; height: 13px; }
#zSwap { margin-top: 10px; }
/* tabela personalizada */
.w-table .tbl { font-size: var(--t-size, inherit); }
.w-table .tbl th { background: var(--t-head-bg, var(--surface)); color: var(--t-head-color, var(--muted)); }
.w-table.zebra .tbl tbody tr:nth-child(even) td { background: var(--t-zebra, var(--surface-2)); }
.w-table.dense .tbl td, .w-table.dense .tbl th { padding: 4px 8px; }
.w-table.t-center .tbl td, .w-table.t-center .tbl th { text-align: center; }
.w-table.t-grid .tbl td + td, .w-table.t-grid .tbl th + th { border-left: 1px solid var(--border); }
/* segmentador em botões */
.w-slicer.as-chips { flex-direction: row; flex-wrap: wrap; align-content: flex-start; gap: 6px; }
.w-slicer.as-chips label { position: relative; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-size: inherit; background: var(--surface); }
.w-slicer.as-chips label:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.w-slicer.as-chips input { position: absolute; opacity: 0; pointer-events: none; }
.w-slicer.as-chips .cnt { margin-left: 2px; }

/* ---------- Versão na barra superior ---------- */
.brand-ver { font-family: var(--font-sans, 'Instrument Sans', 'Segoe UI', system-ui, sans-serif); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--text-2); line-height: 16px; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
.brand:hover .brand-ver { color: var(--primary); }

/* ---------- Painel externo ---------- */
.ext-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.ext-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.ext-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 12.5px; }
.ext-chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.ext-chip .ext-dot { width: 8px; height: 8px; border-radius: 50%; }
.ext-grid { display: grid; gap: 12px; grid-template-columns: repeat(var(--ext-cols, 1), minmax(0, 1fr)); }
.ext-card { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ext-card.fs { position: fixed; inset: 0; z-index: 150; border-radius: 0; }
.ext-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--border); min-height: 40px; }
.ext-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.ext-head .tag { flex: none; }
.ext-frame-wrap { position: relative; background: var(--surface-2); overflow: hidden; }
.ext-card.fs .ext-frame-wrap { flex: 1; height: auto !important; }
.ext-frame-wrap iframe { position: absolute; top: 0; left: 0; border: 0; background: #fff; transform-origin: 0 0; }
.ext-hint { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 2; }
.ext-hint .notice { box-shadow: var(--shadow-pop); background: var(--surface); }
.ext-tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 6px; }
.ext-tool { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; text-align: left; color: var(--text); }
.ext-tool.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--primary-soft); }
.ext-tool span { font-size: 11px; color: var(--muted); line-height: 1.3; }
@media (max-width: 860px) { .ext-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Sobre ---------- */
.about-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.about-hero .brand-logo { width: 64px; height: 64px; }
.about-hero .brand-logo svg, .about-hero .brand-logo img { width: 64px; height: 64px; }
.about-ver { font-family: var(--font-mono); font-size: 28px; font-weight: 600; color: var(--primary); letter-spacing: -.02em; }
/* Sobre em alvenaria (masonry): linhas de 2px; cada cartão ocupa as linhas da própria altura e o próximo encaixa no espaço livre mais alto */
.about-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); grid-auto-rows: 2px; grid-auto-flow: row dense; column-gap: 14px; row-gap: 0; margin-top: 16px; align-items: start; }
.about-grid > .about-card { margin-bottom: 14px; }
.about-card { min-width: 0; container-type: inline-size; }
.about-card .card-body { min-width: 0; }
.about-table { overflow-x: auto; }
.about-table .tbl td { white-space: normal; }
.about-card .pill { white-space: normal; height: auto; min-height: 22px; max-width: 100%; text-align: left; line-height: 1.3; padding-block: 2px; }
.about-card h2 { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.about-card h2 .ic { color: var(--primary); }
.about-kv { display: grid; grid-template-columns: minmax(110px, 42%) minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 13px; }
.about-kv dt { color: var(--muted); }
.about-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.about-kv dd .pill { margin: 0 4px 4px 0; }
.about-langs { display: flex; flex-direction: column; gap: 10px; }
.about-lang { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 4px 10px; align-items: center; font-size: 13px; }
.about-lang .bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.about-lang .bar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.about-lang .small { grid-column: 2; }

/* ---------- Fonte por código / consulta ---------- */
.code-area { min-height: 200px; font: 12.5px/1.5 var(--font-mono); tab-size: 2; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.code-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.code-tables { display: flex; flex-wrap: wrap; gap: 4px; }
.code-tables button { font-family: var(--font-mono); font-size: 11.5px; height: 24px; padding: 0 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); color: var(--text-2); cursor: pointer; }
.code-tables button:hover { border-color: var(--primary); color: var(--primary); }

/* Sobre: cartão estreito empilha rótulo e valor (um abaixo do outro) */
@container (max-width: 400px) {
  .about-kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .about-kv dt { font-size: 12px; margin-top: 8px; }
  .about-kv dt:first-child { margin-top: 0; }
  .about-lang { grid-template-columns: minmax(0, 1fr); }
  .about-lang .small { grid-column: 1; }
}
@media (max-width: 560px) { .about-hero { flex-direction: column; align-items: flex-start; } }
.src-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px 4px 0; color: var(--text-2); border-top: 1px dashed var(--border); margin-top: 8px; }

/* Comparar os dados atuais entre as bases (reimportação/atualização de fonte) */
.cmp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.cmp-stat { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.cmp-stat b { font-size: 20px; line-height: 1.1; }
.cmp-stat span { font-size: 12px; color: var(--muted); }
.cmp-stat.add { background: var(--st-ok-soft); border-color: color-mix(in srgb, var(--st-ok) 45%, transparent); }
.cmp-stat.del { background: var(--st-late-soft); border-color: color-mix(in srgb, var(--st-late) 45%, transparent); }
.cmp-stat.chg { background: var(--st-warn-soft); border-color: color-mix(in srgb, var(--st-warn) 45%, transparent); }
td.cmp-rule { background: var(--primary-soft); font-weight: 600; }

/* ===================== Apresentações (Estúdio, fase 1) ===================== */
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.deck-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.deck-card-top { background: var(--ds-acc); color: #fff; padding: 18px 16px; display: flex; align-items: center; gap: 10px; min-height: 86px; }
.deck-card-top .ic { stroke: #fff; width: 22px; height: 22px; }
.deck-card-top b { font-size: 16px; line-height: 1.25; }
.deck-card-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.deck-card-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 0 16px 14px; }
.deck-editor { display: grid; grid-template-columns: 230px minmax(0, 1fr) 300px; gap: 12px; align-items: start; margin-top: 10px; }
.dk-center { min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.dk-preview { width: 100%; display: flex; justify-content: center; }
.dk-nav { display: flex; align-items: center; gap: 10px; }
.dk-notes { width: 100%; color: var(--text-2); background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.dk-notes:empty { display: none; }
.dk-item { display: flex; align-items: center; gap: 6px; padding: 6px 6px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; }
.dk-item:hover { background: var(--surface-2); }
.dk-item.on { border-color: var(--primary); background: var(--primary-soft); }
.dk-item.off .dk-t { text-decoration: line-through; color: var(--muted); }
.dk-n { width: 20px; text-align: right; font-size: 11px; color: var(--muted); }
.dk-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.dk-mv { display: flex; gap: 0; opacity: .6; }
.dk-item:hover .dk-mv { opacity: 1; }
.dk-deckcfg summary { cursor: pointer; }
@media (max-width: 1100px) { .deck-editor { grid-template-columns: 1fr; } }

/* Palco do slide: 1280×720 lógicos, escalado para caber; segue o tema (o PowerPoint sai sempre claro) */
.deck-fit { position: relative; overflow: hidden; border-radius: 6px; box-shadow: 0 2px 14px rgba(0,0,0,.16); flex: none; }
.deck-stage {
  position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden;
  background: var(--surface); color: var(--text); font-family: var(--font-ui); display: flex; flex-direction: column; padding: 46px 64px 0 72px;
}
.deck-stage::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 12px; background: var(--ds-acc); }
.deck-stage .ds-head h2 { margin: 0; font-size: 34px; line-height: 1.15; font-weight: 700; color: var(--text); }
.deck-stage .ds-head .ds-sub { margin: 6px 0 0; font-size: 18px; color: var(--muted); }
.deck-stage .ds-body { flex: 1; min-height: 0; display: flex; gap: 22px; padding: 22px 0 14px; }
.deck-stage .ds-body > .widget { flex: 1; box-shadow: none; border-color: var(--border); }
.deck-stage .ds-split > .widget { flex: 2 1 0; }
.deck-stage .ds-side { flex: 1 1 0; font-size: 20px; line-height: 1.45; color: var(--text-2); padding-top: 6px; }
.deck-stage .ds-side ul, .deck-stage .ds-text ul { margin: 0; padding-left: 26px; }
.deck-stage .ds-side li, .deck-stage .ds-text li { margin-bottom: 10px; }
.deck-stage .ds-text { font-size: 26px; line-height: 1.45; color: var(--text-2); padding-top: 10px; }
.deck-stage .ds-kpis { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; }
.deck-stage .ds-kpis.n1 { grid-template-columns: 1fr; } .deck-stage .ds-kpis.n2, .deck-stage .ds-kpis.n4 { grid-template-columns: repeat(2, 1fr); }
.deck-stage .ds-kpis > .widget { box-shadow: none; background: var(--surface-2); }
.deck-stage .ds-kpis .w-kpi { align-items: center; text-align: center; }
.deck-stage .ds-kpis .w-kpi .v { font-size: clamp(28px, min(16cqw, 30cqh), 76px) !important; }
.deck-stage .ds-kpis .w-kpi .s { font-size: 18px; }
.deck-stage .ds-kpis .w-head .w-title { font-size: 17px; }
.deck-stage .ds-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); padding: 10px 0 16px; border-top: 1px solid var(--border); }
.deck-stage .ds-foot span { flex: 1; } .deck-stage .ds-foot span:nth-child(2) { text-align: center; } .deck-stage .ds-foot span:last-child { text-align: right; }
.deck-stage.ds-capa, .deck-stage.ds-secao { background: var(--ds-acc); color: #fff; justify-content: center; padding: 0 110px; }
.deck-stage.ds-capa::before, .deck-stage.ds-secao::before { display: none; }
.deck-stage .ds-cover h1, .deck-stage .ds-section h1 { margin: 0; font-size: 60px; line-height: 1.1; font-weight: 800; color: #fff; }
.deck-stage .ds-cover .ds-sub, .deck-stage .ds-section .ds-sub { margin: 18px 0 0; font-size: 26px; color: rgba(255,255,255,.9); }
.deck-stage .ds-cover .ds-meta { margin: 34px 0 0; font-size: 18px; color: rgba(255,255,255,.85); }
.deck-stage .ds-logo { max-height: 70px; max-width: 260px; margin-bottom: 34px; display: block; background: #fff; padding: 8px 12px; border-radius: 8px; }
.deck-stage.ds-secao h1 { font-size: 54px; }

/* Apresentar: tela cheia escura com o slide centralizado */
.deck-present { position: fixed; inset: 0; z-index: 1000; background: #0b0f17; display: flex; flex-direction: column; align-items: center; justify-content: center; outline: none; }
.deck-present .dp-stage { width: 100vw; height: calc(100vh - 56px); display: flex; align-items: center; justify-content: center; }
.deck-present .dp-bar { height: 56px; display: flex; align-items: center; gap: 10px; color: #e5e7eb; opacity: .35; transition: opacity .2s; }
.deck-present .dp-bar:hover { opacity: 1; }
.deck-present .dp-bar .icon-btn { color: #e5e7eb; } .deck-present .dp-bar .icon-btn .ic { stroke: #e5e7eb; }
.deck-present .dp-pos { font-size: 13px; min-width: 60px; text-align: center; }
/* Área fora da tela usada para desenhar os slides na exportação */
.dp-export { position: fixed; left: -20000px; top: 0; width: 1280px; height: 720px; overflow: hidden; pointer-events: none; }

/* Galeria de modelos de apresentação (fase 2) */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tpl-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.tpl-card:hover, .tpl-card:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); outline: none; }
.tpl-card.off { opacity: .55; cursor: not-allowed; }
.tpl-top { display: flex; align-items: center; gap: 8px; }
.tpl-top b { flex: 1; font-size: 14px; line-height: 1.25; }
.tpl-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.tpl-foot .pill { font-size: 11px; }
.tpl-foot .icon-btn { margin-left: auto; }
.tpl-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.tpl-roles label { display: flex; flex-direction: column; gap: 3px; }

/* Inteligência artificial (fase 3) */
.ia-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-bottom: 12px; }
.ia-card { display: flex; flex-direction: column; gap: 8px; border-top: 3px solid var(--border); }
.ia-card.on { border-top-color: var(--st-ok); }
.ia-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ia-head b { flex: 1; font-size: 15px; }
.ia-precos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ia-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 12px; margin-bottom: 12px; }
.ia-cols h3 { margin: 0 0 10px; }
.ia-resp { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13.5px; line-height: 1.5; max-height: 420px; overflow: auto; }
.ia-pre { max-height: 60vh; overflow: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; font-size: 12px; margin: 0; white-space: pre; }
.ok-text { color: var(--st-ok-ink); }

/* Estúdio com IA (fase 4) */
.studio { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1000px) { .studio { grid-template-columns: 1fr; } }
.studio h3 { margin: 0 0 8px; }
.st-fields { max-height: calc(100vh - 220px); overflow: auto; }
.st-flist { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.st-field { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 6px 8px; cursor: pointer; display: grid; grid-template-columns: auto 1fr; gap: 0 8px; color: var(--text); }
.st-field:hover { border-color: var(--primary); }
.st-field .t { grid-row: span 2; font-size: 10px; font-family: var(--font-mono); color: var(--muted); align-self: center; min-width: 26px; }
.st-field .n { font-size: 13px; font-weight: 600; }
.st-field .m { font-size: 11px; color: var(--muted); }
.st-editor { position: relative; }
.st-editor textarea { width: 100%; resize: vertical; font-size: 14px; line-height: 1.5; min-height: 132px; height: auto; padding-top: 8px; }
.st-ac { position: absolute; left: 8px; right: 8px; top: 100%; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); max-height: 260px; overflow: auto; }
.st-ac-it { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; cursor: pointer; }
.st-ac-it span { font-size: 11.5px; color: var(--muted); }
.st-ac-it.on, .st-ac-it:hover { background: var(--primary-soft); }
.st-sug { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.st-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; text-align: left; }
.st-chip:hover { border-color: var(--primary); color: var(--text); }
.st-opts { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 6px; }
.st-opts label { display: flex; flex-direction: column; gap: 3px; }
.st-steps { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; }
.st-steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.st-steps li.run { color: var(--primary); font-weight: 600; } .st-steps li.ok { color: var(--st-ok-ink); } .st-steps li.err { color: var(--danger); }
.st-steps li.run .ic { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dc-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.dc-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dc-text { white-space: pre-wrap; color: var(--text-2); }
.dk-ai textarea { width: 100%; }

/* Pergunte aos dados (fase 5) */
.qa-ask { margin-bottom: 12px; }
.qa-ask textarea.qa-q { width: 100%; resize: vertical; font-size: 15px; min-height: 64px; height: auto; padding-top: 8px; }
.qa-item { margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.qa-q-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qa-q-line b { font-size: 15px; }
.qa-status { color: var(--primary); }
.qa-status .ic { animation: spin 1s linear infinite; }
.qa-resp { font-size: 14.5px; line-height: 1.55; background: var(--surface-2); border-left: 3px solid var(--primary); border-radius: var(--radius-sm); padding: 10px 12px; white-space: pre-wrap; }
.qa-chart { display: flex; justify-content: center; }
.qa-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.qa-actions input { flex: 1; min-width: 220px; }

/* Agendamentos de apresentações (fase 6) */
.ag-cli { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 10px; max-height: 200px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 8px; margin-top: 4px; }

/* Configuração do menu (engrenagem no topo do menu) */
.nav-tool.nav-prev-btn { margin-left: auto; }
.nav-cfg { position: fixed; z-index: 1200; width: 300px; max-height: calc(100vh - 16px); overflow: auto; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.nav-cfg-head { display: flex; align-items: center; justify-content: space-between; }
.nav-cfg fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.nav-cfg legend { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; padding: 0; }
.nav-cfg .check { align-items: flex-start; }
.nav-cfg .check input { margin-top: 2px; flex: none; }
.nav-cfg fieldset.inline { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
.nav-cfg fieldset.inline legend { width: 100%; }
.nav-cfg fieldset.inline .check { align-items: center; }
.nav-cfg fieldset.inline .check input { margin-top: 0; }
.nav-cfg fieldset.inline > .small.muted { width: 100%; }

/* Pré-visualização automática do menu (miniatura do estilo que o botão aplica) */
.nav-preview { position: fixed; z-index: 1300; width: 300px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); pointer-events: none; animation: navIn .14s ease-out; display: flex; flex-direction: column; gap: 8px; }
.np-head { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.np-head span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.np-foot { font-size: 10.5px; color: var(--muted); text-align: right; }
.np-screen { height: 168px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.np-top { height: 14px; flex: none; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; padding: 0 6px; }
.np-top > i:first-child { width: 8px; height: 8px; border-radius: 2px; background: var(--primary); }
.np-body { flex: 1; display: flex; min-height: 0; position: relative; }
.np-side { width: 92px; flex: none; background: var(--surface); border-right: 1px solid var(--border); padding: 4px 3px; display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.np-side.rail { width: 20px; align-items: center; }
.np-side span { display: flex; align-items: center; gap: 4px; min-height: 12px; color: var(--muted); }
.np-side .ic { width: 9px; height: 9px; flex: none; }
.np-side b { font-size: 7.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-content { flex: 1; min-width: 0; padding: 6px; display: flex; flex-direction: column; gap: 5px; }
.np-cards { display: flex; gap: 4px; }
.np-cards i { flex: 1; height: 18px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border); }
.np-chart { flex: 1; display: flex; align-items: flex-end; gap: 4px; padding: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; min-height: 0; }
.np-chart i { flex: 1; border-radius: 2px 2px 0 0; background: var(--primary); opacity: .7; }
.np-line { display: block; height: 4px; border-radius: 2px; background: var(--border); }
.np-blocks { position: absolute; top: 5px; left: 5px; display: grid; grid-template-columns: repeat(var(--cols), 34px); gap: 3px; padding: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; box-shadow: var(--shadow-pop); }
.np-blocks span { height: 30px; border-radius: 5px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); overflow: hidden; }
.np-blocks .ic { width: 10px; height: 10px; }
.np-blocks b { font-size: 6px; font-weight: 600; max-width: 32px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn[data-nav="previa"][aria-pressed="true"] { color: var(--primary); }

/* Tempos do menu em barra deslizante (engrenagem) */
.nav-cfg fieldset.nav-time { gap: 4px; }
.nav-time-ctl { display: flex; align-items: center; gap: 12px; }
.nav-time-ctl .check { align-items: center; }
.nav-time-ctl .check input { margin-top: 0; }
.nav-time-val { margin-left: auto; min-width: 64px; text-align: center; font: 700 12px var(--font-ui); color: var(--primary); background: var(--primary-soft); border-radius: 999px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.nav-time.off .nav-time-val { color: var(--muted); background: var(--surface-2); }
.nav-range { position: relative; padding: 2px 0 14px; }
.nav-range input[type="range"] { width: 100%; margin: 0; height: 18px; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.nav-range input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--primary) var(--pct), var(--border) var(--pct)); }
.nav-range input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--primary) var(--pct), var(--border) var(--pct)); }
.nav-range input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.nav-range input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }
.nav-range input[type="range"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.nav-range input[type="range"]:disabled { cursor: not-allowed; opacity: .45; }
.nav-range input[type="range"]:disabled::-webkit-slider-thumb { border-color: var(--muted); }
.nav-range input[type="range"]:disabled::-webkit-slider-runnable-track { background: var(--border); }
.nav-range-ticks { position: absolute; left: 8px; right: 8px; bottom: 0; height: 14px; display: flex; justify-content: space-between; pointer-events: none; }
.nav-range-ticks i { position: relative; width: 1px; height: 4px; background: var(--muted); opacity: .5; }
.nav-range-ticks i.lab::after { content: attr(data-l); position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font: 600 9.5px var(--font-ui); color: var(--muted); white-space: nowrap; font-style: normal; }
.nav-time.off .nav-range-ticks { opacity: .45; }
.nav-range-ticks i.lab:first-child::after { left: -4px; transform: none; }
.nav-range-ticks i.lab:last-child::after { left: auto; right: -4px; transform: none; }

/* Pop-up de painel: nova pasta sem sair da janela */
.bd-newf { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; padding: 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.bd-newf .input { flex: 1 1 160px; }
.bd-newf .select { flex: 1 1 150px; width: auto; }

/* Filtros no modo apresentação */
.pf-menu { position: fixed; z-index: 1200; width: 320px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.pf-head { display: flex; flex-direction: column; gap: 1px; }
.pf-menu .check { align-items: flex-start; }
.pf-menu .check input { margin-top: 2px; flex: none; }
#bPresFilters.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.present.pf-noicon .w-fico, #present.pf-noicon .w-fico { display: none; }
.present.pf-nogran .w-gran, #present.pf-nogran .w-gran { display: none; }
#present.pf-noperiod .pr-period { display: none; }
#prFilt.on { color: var(--primary); }

/* Organização dos visuais: movimento livre (posições fracionárias, sobreposição e camadas) */
.lay-bar { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding-left: 10px; border-left: 1px solid var(--border); }
.lay-bar .lbl { margin-right: 2px; }
.lay-bar .btn.on { background: var(--primary-soft); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.dash-canvas.free { display: block; height: var(--free-h, 420px); }
.dash-canvas.free > .widget {
  position: absolute; z-index: var(--lz, 1);
  left: calc(10px + (100% - 10px) * var(--lx) / 12); width: calc((100% - 10px) * var(--lw) / 12 - 10px);
  top: calc(10px + var(--ly) * 74px); height: calc(var(--lh) * 74px - 10px);
}
.dash-canvas.free > .widget.dragging { z-index: 999; }
.dash-canvas.free > .empty { position: absolute; inset: 10px; }
.w-tools .w-free { display: none; }
/* Alfinete: visual fixado na posição (não se move com o fluxo automático nem pode ser arrastado) */
.w-tools .w-pin.on { color: var(--primary); }
.w-pin.on .ic, .w-pinmark .ic, .pp-pin input:checked ~ .ic { fill: currentColor; }
.w-pinmark { flex: none; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: var(--primary-soft); color: var(--primary); cursor: pointer; }
.w-pinmark:hover { filter: brightness(.95); }
.widget.is-pinned .w-handle { cursor: not-allowed; opacity: .45; }
.pp-pin { display: flex; align-items: center; gap: 6px; margin: 0; }
.pp-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 10px; }
.pp-acts { display: flex; gap: 2px; }
.pp-acts .icon-btn.danger:hover { color: var(--danger); }
.pp-pin .ic { color: var(--primary); }
.dash-canvas.free .w-tools .w-free { display: grid; }

/* Filtro do visual (lista, condição, primeiros N, comparação) */
.seg-b { border: 0; background: transparent; padding: 6px 12px; font: 500 13px var(--font-ui); color: var(--text-2); cursor: pointer; }
.seg-b + .seg-b { border-left: 1px solid var(--border); }
.seg-b.on { background: var(--primary-soft); color: var(--primary); }
.fd-list { max-height: 300px; overflow: auto; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; }
.fd-conds { display: flex; flex-direction: column; gap: 6px; }
.fd-cond { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fd-cond .select { width: auto; }
.fd-join .select { width: 70px; }
.fd-prev { padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface-2); }
.z-addf { margin-top: 4px; }
.fx-abbr-prev { font-size: 11.5px; color: var(--text-2); background: var(--surface-2); border-radius: var(--radius-sm); padding: 6px 8px; line-height: 1.5; }

/* Duplo clique para formatar */
.inline-edit { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 3px; background: var(--surface); cursor: text; white-space: nowrap; overflow: visible; text-overflow: clip; visibility: visible !important; }
@keyframes fxFlash { 0% { box-shadow: 0 0 0 3px var(--primary-soft); background: var(--primary-soft); } 100% { box-shadow: 0 0 0 0 transparent; background: transparent; } }
.fx-sec.fx-flash > summary { animation: fxFlash 1.2s ease-out; border-radius: 6px; }
/* Cores de cada barra: uma linha por categoria; a marca à esquerda indica cor própria */
.bc-list { display: flex; flex-direction: column; gap: 3px; max-height: 340px; overflow-y: auto; padding: 2px 2px 2px 0; }
.bc-row { padding: 2px 4px; border-radius: 6px; border-left: 3px solid transparent; }
.bc-row.set { border-left-color: var(--primary); }
.bc-row.fx-flash { animation: fxFlash 1.6s ease-out; }
.builder:not(.preview-mode) .widget .w-title, .builder:not(.preview-mode) .widget .w-sub { cursor: text; }
.fx-pct-off { color: var(--text-2); background: var(--surface-2); border-radius: var(--radius-sm); padding: 5px 7px; display: block; }

/* Total do gráfico: espaço reservado (--tt topo, --tb base, --tl/--tr laterais) para não ficar sobre os dados */
.w-body.tot-sub, .w-body.tot-top, .w-body.tot-bottom, .w-body.tot-left, .w-body.tot-right { padding: calc(4px + var(--tt, 0px)) calc(8px + var(--tr, 0px)) calc(8px + var(--tb, 0px)) calc(8px + var(--tl, 0px)); }
.w-body.tot-sub > .w-chart, .w-body.tot-top > .w-chart, .w-body.tot-bottom > .w-chart, .w-body.tot-left > .w-chart, .w-body.tot-right > .w-chart { inset: calc(4px + var(--tt, 0px)) calc(8px + var(--tr, 0px)) calc(8px + var(--tb, 0px)) calc(8px + var(--tl, 0px)); }
.w-total { position: absolute; z-index: 2; color: var(--text-2); line-height: 1.25; pointer-events: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-total { color: var(--text); font-weight: 400; }
.w-total .tv { font-weight: inherit; font-style: inherit; color: inherit; font-family: inherit; } /* o total segue a formatação do texto personalizado */
.w-total.at-sub { top: 2px; left: 12px; right: 12px; font-size: 13px; }
.w-total.at-top { top: 2px; left: 8px; right: 8px; text-align: center; }
.w-total.at-bottom { bottom: 4px; left: 8px; right: 8px; text-align: center; }
.w-total.at-left, .w-total.at-right { top: 50%; transform: translateY(-50%); width: var(--tl, var(--tr)); white-space: normal; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.w-total.at-left { left: 8px; width: var(--tl); }
.w-total.at-right { right: 8px; width: var(--tr); }
.w-total.at-left .tv, .w-total.at-right .tv { display: block; font-size: 1.15em; }
.w-total.at-center { transform: translate(-50%, -50%); text-align: center; white-space: normal; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.w-total.at-center .tv { display: block; font-size: 1.2em; }
.w-total-foot td { border-top: 2px solid var(--border-strong); background: var(--surface-2); }

/* Caixa de texto */
.w-text { position: absolute; inset: 0; overflow: auto; display: flex; flex-direction: column; border-radius: inherit; word-wrap: break-word; }
.w-text.va-middle { justify-content: center; }
.w-text.va-bottom { justify-content: flex-end; }
.w-text.fit { overflow: hidden; }
.w-text-in { min-width: 0; }
.w-text-in > :first-child { margin-top: 0; } .w-text-in > :last-child { margin-bottom: 0; }
.w-text h1, .tx-ed h1 { font-size: 2em; margin: .2em 0 .3em; line-height: 1.15; }
.w-text h2, .tx-ed h2 { font-size: 1.5em; margin: .2em 0 .3em; line-height: 1.2; }
.w-text h3, .tx-ed h3 { font-size: 1.2em; margin: .2em 0 .3em; }
.w-text p, .tx-ed p { margin: .25em 0; }
.w-text blockquote, .tx-ed blockquote { margin: .4em 0; padding: .2em .8em; border-left: 3px solid var(--primary); color: var(--text-2); }
.w-text ul, .w-text ol, .tx-ed ul, .tx-ed ol { margin: .3em 0; padding-left: 1.4em; }
.w-text a, .tx-ed a { color: var(--primary); }
.tx-ph { color: var(--muted); font-style: italic; }
.tx-var { background: var(--primary-soft); border-radius: 4px; padding: 0 3px; }
.w-text .tx-var { background: none; padding: 0; }
.tx-big { font-size: 2.4em; font-weight: 700; line-height: 1.05; display: inline-block; }
.tx-caption { font-size: .8em; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tx-pill { display: inline-block; padding: .1em .6em; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
/* WordArt (editor avançado) */
.wa-grad { background: linear-gradient(90deg, #2563eb, #9333ea); -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-fill-color: transparent; font-weight: 800; }
.wa-sunset { background: linear-gradient(90deg, #f97316, #e11d48, #9333ea); -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-fill-color: transparent; font-weight: 800; }
.wa-ocean { background: linear-gradient(180deg, #38bdf8, #1e3a8a); -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-fill-color: transparent; font-weight: 800; }
.wa-outline { color: transparent !important; -webkit-text-stroke: 1.5px currentColor; -webkit-text-fill-color: transparent; font-weight: 800; }
.wa-outline { -webkit-text-stroke-color: var(--primary); }
.wa-shadow { text-shadow: 3px 3px 0 rgba(0,0,0,.18), 6px 6px 0 rgba(0,0,0,.08); font-weight: 800; }
.wa-neon { color: #fff !important; text-shadow: 0 0 4px #fff, 0 0 10px #22d3ee, 0 0 20px #22d3ee, 0 0 34px #0891b2; font-weight: 700; }
.wa-relevo { color: #d6dbe2 !important; text-shadow: -1px -1px 0 #fff, 1px 1px 0 #7b838d; font-weight: 800; }
.wa-metal { background: linear-gradient(180deg, #f8fafc 0%, #94a3b8 45%, #475569 55%, #e2e8f0 100%); -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-fill-color: transparent; font-weight: 900; }
.wa-faixa { background: var(--primary); color: #fff !important; padding: 0 .35em; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.wa-marca { background: linear-gradient(transparent 55%, #fde68a 55%); }
.wa-3d { color: var(--primary) !important; text-shadow: 1px 1px 0 color-mix(in srgb, var(--primary) 70%, #000), 2px 2px 0 color-mix(in srgb, var(--primary) 60%, #000), 3px 3px 0 color-mix(in srgb, var(--primary) 50%, #000), 4px 4px 6px rgba(0,0,0,.3); font-weight: 900; }

/* Editor da caixa de texto */
.modal.tx-modal { width: min(1060px, calc(100vw - 32px)); max-width: none; }
.tx-wrap { display: flex; flex-direction: column; gap: 8px; }
.tx-tools { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; background: var(--surface-2); }
.tx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.tx-advbox { display: flex; flex-direction: column; gap: 4px; border-top: 1px dashed var(--border); padding-top: 4px; }
.tx-b { min-width: 30px; height: 28px; padding: 0 7px; border: 1px solid transparent; border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; font: 600 13px var(--font-ui); display: inline-grid; place-items: center; }
.tx-b:hover { border-color: var(--border-strong); background: var(--surface-3, var(--surface)); }
.tx-b[data-wide] { white-space: nowrap; font-weight: 500; }
.tx-sep { width: 1px; height: 22px; background: var(--border); margin: 0 3px; }
.tx-l { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-right: 4px; }
.tx-color { position: relative; min-width: 30px; height: 28px; display: inline-grid; place-items: center; font-weight: 800; border-radius: 6px; background: var(--surface); cursor: pointer; border-bottom: 3px solid currentColor; }
.tx-color.hl { color: #e7b416; }
.tx-color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tx-sw { width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--border-strong); cursor: pointer; padding: 0; }
.tx-wa { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; min-width: 64px; }
.tx-wa span { font-size: 18px; line-height: 1.1; }
.tx-wa small { font-size: 10px; color: var(--muted); }
.tx-wa:hover { border-color: var(--primary); }
.tx-stage { overflow: auto; max-height: 52vh; padding: 14px; border-radius: var(--radius-sm); background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 18px 18px; display: flex; justify-content: center; }
.tx-ed { min-height: 160px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); outline: none; box-shadow: var(--shadow); color: var(--text); line-height: 1.4; overflow-wrap: anywhere; }
.tx-ed:focus { box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow); }
.tx-ed .tx-var { cursor: default; }
.w-total-foot td .tv { font-weight: inherit; font-style: inherit; }

/* Arrastar e soltar campos entre as zonas da aba Dados */
.zchip[draggable="true"] { cursor: grab; }
.zchip.dragging { opacity: .45; }
.zgrip { color: var(--muted); display: inline-grid; place-items: center; margin-left: -4px; cursor: grab; }
.zchip:hover .zgrip { color: var(--primary); }
.zdrop-mark { height: 3px; border-radius: 2px; background: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); margin: -1px 2px; pointer-events: none; }
.chip-dragging .zone-drop { border-color: color-mix(in srgb, var(--primary) 45%, var(--border-strong)); }
.fields-pane .pane-body.chip-remove, #bFields.chip-remove { outline: 2px dashed var(--st-late, #d9534f); outline-offset: -4px; border-radius: 8px; }

/* ===================== Rodada 24: ajuda dos gráficos e Base de conhecimento ===================== */
/* "?" nos tipos de visual, no painel de propriedades e botões ao lado de "Apresentar" */
.vt { position: relative; }
.vt-q { position: absolute; top: 1px; right: 1px; width: 13px; height: 13px; border-radius: 50%; font: 700 9px/13px var(--font-ui); text-align: center; color: var(--text-2); background: var(--surface-2); box-shadow: 0 0 0 1px var(--border); opacity: .75; cursor: help; }
.vt:hover .vt-q, .vt-q:hover { opacity: 1; background: var(--primary); color: var(--primary-ink); box-shadow: none; }
.pane-head h3 { display: flex; align-items: center; gap: 6px; }
.pp-help { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: 700 11px/1 var(--font-ui); cursor: help; padding: 0; }
.pp-help:hover, .pp-help:focus-visible { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.page-actions .b-tipcfg, .page-actions .b-help { width: 36px; height: 36px; border: 1px solid var(--border); background: var(--surface); }
.tips-menu { width: 330px; padding: 10px 12px; display: grid; gap: 8px; }
.tips-menu .tips-opt { align-items: flex-start; padding: 6px; border-radius: var(--radius-sm); }
.tips-menu .tips-opt:hover { background: var(--surface-2); }
.tips-menu .tips-opt input { margin-top: 2px; }
/* Cartão da dica */
.ch-tip { position: fixed; z-index: 140; width: 320px; max-width: calc(100vw - 16px); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 12px 14px; font-size: 12.5px; line-height: 1.45; }
.ch-tip p { margin: 6px 0 0; }
.ch-tip-head { display: flex; align-items: center; gap: 8px; }
.ch-tip-head b { font-size: 13.5px; }
.ch-tip-ico svg, .kb-chart-ico svg, .kb-ico-chart svg, .kb-chart-pick svg { width: 22px; height: 22px; fill: none; stroke: var(--primary); stroke-width: 1.6; stroke-linejoin: round; }
.ch-tip-fam { margin-left: auto; font-size: 10.5px; color: var(--muted); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.ch-tip-demo { height: 150px; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); position: relative; overflow: hidden; }
.ch-tip-ex { color: var(--text-2); }
.ch-tip-more { color: var(--muted); font-size: 11.5px; }
/* exemplo desenhado (cartão e manual) */
.kb-demo-body { display: flex; flex-direction: column; position: relative; } /* a altura vem do lugar do exemplo (.ch-tip-demo, .kb-demo-slot) */
.kb-demo-body .w-chart { flex: 1; min-height: 0; }
.kb-demo-body .w-kpi .v { font-size: 34px; }
.kb-illus { padding: 6px; overflow: auto; height: 100%; }
.kb-illus-radar { display: grid; place-items: center; }
.kb-illus-radar svg { width: 100%; max-width: 220px; height: auto; max-height: 100%; }

/* ---------- Base de conhecimento ---------- */
.kb-search { position: relative; display: inline-flex; align-items: center; }
.kb-search .ic { position: absolute; left: 9px; color: var(--muted); pointer-events: none; }
.kb-search .input { padding-left: 30px; width: 220px; }
.kb-viewseg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.kb-viewseg .seg-btn { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 7px 10px; font: inherit; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.kb-viewseg .seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.kb-viewseg .seg-btn.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.kb-shell { display: grid; grid-template-columns: minmax(220px, 270px) minmax(0, 1fr); gap: 14px; align-items: start; }
.kb-tree { padding: 8px; position: sticky; top: calc(var(--topbar-h) + 12px); max-height: calc(100vh - var(--topbar-h) - 40px); overflow: auto; }
.kb-tree-head { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 4px 6px 6px; }
.kb-tree-hint { margin: 10px 6px 4px; }
.kb-node { display: flex; align-items: center; padding-left: calc(var(--d, 0) * 14px); border-radius: var(--radius-sm); }
.kb-node.on { background: var(--primary-soft); }
.kb-node.on .kb-node-name { color: var(--primary); font-weight: 600; }
.kb-node.kb-drop, .kb-item.kb-drop, .kb-crumb.kb-drop, .kb-items.kb-drop, .kb-table.kb-drop, .kb-empty.kb-drop { outline: 2px dashed var(--primary); outline-offset: -2px; background: var(--primary-soft); }
.kb-caret { width: 20px; height: 26px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; display: grid; place-items: center; flex: none; }
.kb-caret.empty { visibility: hidden; }
.kb-node-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 5px 6px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; text-align: left; border-radius: var(--radius-sm); }
.kb-node-btn:hover { background: var(--surface-2); }
.kb-node-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-count { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.kb-lock { color: var(--muted); display: inline-flex; }
.kb-ico { display: inline-grid; place-items: center; flex: none; color: var(--text-2); }
.kb-ico-folder { color: var(--accent); }
.kb-ico-folder.sys { color: var(--primary); }
.kb-ico-doc { color: var(--primary); }
.kb-main { padding: 14px 16px 18px; min-height: 420px; }
.kb-main-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.kb-main-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.kb-crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-size: 13px; min-width: 0; }
.kb-crumb { border: 0; background: none; color: var(--primary); cursor: pointer; padding: 3px 5px; border-radius: 5px; font: inherit; }
.kb-crumb:hover { background: var(--primary-soft); }
.kb-crumbs b { padding: 3px 5px; }
.kb-sep { color: var(--muted); display: inline-flex; }
.kb-folder-intro { display: flex; gap: 12px; align-items: center; margin: 2px 0 14px; }
.kb-folder-intro .kb-ico .ic, .kb-folder-intro .kb-ico svg { width: 30px; height: 30px; }
.kb-folder-intro h2 { font-size: 19px; margin: 0; }
.kb-folder-intro p { margin: 2px 0 0; }
.kb-items.kb-icones { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.kb-tile { position: relative; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 12px 10px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 132px; transition: border-color .12s, box-shadow .12s; }
.kb-tile:hover, .kb-tile:focus-visible { border-color: var(--border-strong); box-shadow: var(--shadow); outline: none; }
.kb-tile.sel { border-color: var(--primary); }
.kb-tile-ico .kb-ico .ic, .kb-tile-ico .kb-ico svg { width: 30px; height: 30px; }
.kb-tile-name { font-weight: 600; font-size: 13.5px; line-height: 1.3; word-break: break-word; }
.kb-tile-sum { font-size: 12px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kb-tile-tags { margin-top: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.kb-tile .kb-more { position: absolute; top: 6px; right: 6px; opacity: 0; }
.kb-item:hover .kb-more, .kb-item:focus-within .kb-more, .kb-item.sel .kb-more { opacity: 1; }
.kb-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.kb-badge.pes { background: var(--accent-soft); color: var(--text); }
.kb-items.kb-lista { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.kb-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; background: var(--surface); }
.kb-row + .kb-row { border-top: 1px solid var(--border); }
.kb-row:hover, .kb-row:focus-visible { background: var(--surface-2); outline: none; }
.kb-row.sel { background: var(--primary-soft); }
.kb-row-name { font-weight: 600; font-size: 13px; white-space: nowrap; }
.kb-row-sum { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-table { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.kb-table tr.kb-item { cursor: pointer; }
.kb-table tr.kb-item:hover { background: var(--surface-2); }
.kb-table tr.kb-item.sel { background: var(--primary-soft); }
.kb-rowname { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.kb-item.dragging { opacity: .45; }
.kb-empty { padding: 34px 10px; }
/* artigo */
.kb-article { max-width: 880px; }
.kb-art-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 4px; }
.kb-art-head .kb-ico .ic { width: 30px; height: 30px; }
.kb-art-head h1 { font-size: 23px; margin: 0; }
.kb-lead { font-size: 14.5px; color: var(--text-2); margin: 4px 0 0; }
.kb-art-meta { margin: 6px 0 14px; }
.kb-art-body { font-size: 14px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.kb-art-body h2 { font-size: 19px; margin: 20px 0 8px; }
.kb-art-body h3 { font-size: 15.5px; margin: 18px 0 6px; }
.kb-art-body h4 { font-size: 14px; margin: 14px 0 4px; }
.kb-art-body p { margin: 0 0 10px; }
.kb-art-body ul, .kb-art-body ol { margin: 0 0 10px; padding-left: 22px; }
.kb-art-body blockquote { margin: 10px 0; padding: 6px 14px; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-2); }
.kb-art-body pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font: 12.5px/1.5 var(--font-mono); white-space: pre-wrap; }
.kb-art-body img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.kb-art-body table { border-collapse: collapse; margin: 8px 0 12px; }
.kb-art-body th, .kb-art-body td { border: 1px solid var(--border); padding: 5px 9px; text-align: left; }
.kb-art-body th { background: var(--surface-2); }
.kb-art-body a { color: var(--primary); }
.kb-chart-hero { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.kb-chart-ico { width: 52px; height: 52px; border-radius: 12px; background: var(--primary-soft); display: grid; place-items: center; flex: none; }
.kb-chart-ico svg { width: 30px; height: 30px; }
.kb-chart-hero h2 { margin: 0; font-size: 22px; }
.kb-demo { margin: 12px 0 16px; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; background: var(--surface); }
.kb-demo-slot { height: 280px; position: relative; }
.kb-demo figcaption { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.kb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.kb-art-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--border); }
.kb-help-modal .modal-body { max-height: 72vh; overflow: auto; }
/* anexos */
.kb-attach { margin-top: 20px; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; max-width: 880px; }
.kb-attach.drop-on { outline: 2px dashed var(--primary); background: var(--primary-soft); }
.kb-attach-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kb-attach-head h3 { font-size: 14px; margin: 0; display: flex; align-items: center; gap: 6px; }
.kb-att-list { list-style: none; margin: 8px 0 0; padding: 0; }
.kb-att-list li { display: flex; align-items: center; gap: 8px; padding: 6px 2px; border-top: 1px solid var(--border); }
.kb-att-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.kb-att-img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; }
.kb-att-txt { max-height: 70vh; overflow: auto; white-space: pre-wrap; font: 12.5px/1.5 var(--font-mono); }
.kb-att-pdf { width: 100%; height: 70vh; border: 0; }
/* editor */
.kb-editor { max-width: 900px; }
.kb-ed-fields { display: grid; grid-template-columns: 1fr 1fr 180px; gap: 10px; }
.kb-ed-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 6px; border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface-2); position: sticky; top: var(--topbar-h); z-index: 2; }
.kb-ed-btn { min-width: 30px; height: 30px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--text); cursor: pointer; font: 13px var(--font-ui); display: inline-grid; place-items: center; padding: 0 6px; }
.kb-ed-btn:hover, .kb-ed-btn:focus-visible { background: var(--surface); border-color: var(--border); }
.kb-ed-sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 3px; }
.kb-ed-color { width: 30px; height: 28px; padding: 0 2px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; }
.kb-ed-area { min-height: 360px; border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); padding: 14px 16px; background: var(--surface); outline: none; }
.kb-ed-area:focus { border-color: var(--primary); }
.kb-ed-area figure.kb-demo { user-select: none; }
.kb-chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.kb-chart-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; font-size: 12.5px; text-align: center; }
.kb-chart-pick:hover, .kb-chart-pick:focus-visible { border-color: var(--primary); background: var(--primary-soft); }
.kb-pick { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; }
.kb-pick-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px calc(8px + var(--d, 0) * 16px); border-radius: var(--radius-sm); cursor: pointer; }
.kb-pick-row:hover { background: var(--surface-2); }
@media (max-width: 900px) {
  .kb-shell { grid-template-columns: 1fr; }
  .kb-tree { position: static; max-height: 260px; }
  .kb-ed-fields, .kb-cols { grid-template-columns: 1fr; }
  .kb-search .input { width: 100%; }
  .kb-viewseg .seg-btn span { display: none; }
}
@media print {
  .kb-tree, .kb-main-head, .kb-attach, .page-head .page-actions, .kb-art-nav { display: none !important; }
  .kb-shell { display: block; }
}
/* ===================== Rodada 25: desfazer, privilégios, zerar por itens e implementações ===================== */
.undo-bar { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.undo-bar .btn { border: 0; border-radius: 0; }
.undo-bar .btn + .btn { border-left: 1px solid var(--border); }
.undo-bar .undo-more { padding-left: 4px; padding-right: 4px; }
.undo-bar .btn:disabled { opacity: .45; }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary); cursor: pointer; font: inherit; font-size: 12px; }
.link-btn:hover { text-decoration: underline; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; flex: none; }
.tab .tab-n { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-left: 4px; }
/* Privilégios de acesso */
.ac-shell { display: grid; grid-template-columns: minmax(230px, 290px) minmax(0, 1fr); gap: 14px; align-items: start; }
.ac-list { padding: 8px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: calc(var(--topbar-h) + 12px); }
.ac-prof { display: flex; align-items: center; gap: 9px; border: 1px solid transparent; background: none; text-align: left; padding: 8px 9px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; color: var(--text); }
.ac-prof:hover { background: var(--surface-2); }
.ac-prof.on { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.ac-prof.off { opacity: .6; }
.ac-prof-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ac-prof-main b { font-size: 13.5px; }
.ac-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.ac-edit { padding: 14px 16px; min-width: 0; }
.ac-edit-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.ac-edit-fields { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; flex: 1; }
.ac-edit-fields .field { margin: 0; min-width: 180px; }
.ac-edit-fields .ac-color { min-width: 60px; }
.ac-edit-fields .ac-color .input { width: 56px; padding: 2px; height: 36px; }
.ac-edit-acts { display: flex; gap: 6px; }
.ac-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.ac-bulk { display: inline-flex; gap: 2px; align-items: center; margin-left: auto; }
.ac-groups { display: flex; flex-direction: column; gap: 8px; }
.ac-group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ac-group > summary { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.ac-group > summary::-webkit-details-marker { display: none; }
.ac-group[open] > summary { border-bottom: 1px solid var(--border); }
.ac-res { padding: 9px 12px; }
.ac-res + .ac-res { border-top: 1px dashed var(--border); }
.ac-res-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.ac-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-rule { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px 4px 5px; background: var(--surface); cursor: pointer; font: inherit; font-size: 12.5px; color: var(--text-2); position: relative; }
.ac-rule:disabled { cursor: default; }
.ac-rule .ac-ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--surface-2); color: var(--muted); }
.ac-rule.v-permitir { border-color: var(--st-ok); background: var(--st-ok-soft); color: var(--st-ok-ink); }
.ac-rule.v-permitir .ac-ic { background: var(--st-ok); color: #fff; }
.ac-rule.v-negar { border-color: var(--st-late); background: var(--st-late-soft); color: var(--st-late-ink); }
.ac-rule.v-negar .ac-ic { background: var(--st-late); color: #fff; }
.ac-rule:not(:disabled):hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.ac-crit, .ac-crit-inline { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; }
.ac-users td { vertical-align: middle; }
.ac-user { display: inline-flex; align-items: center; gap: 9px; }
.ac-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--c, var(--border)); margin: 1px 3px 1px 0; background: color-mix(in srgb, var(--c, transparent) 12%, transparent); }
.ac-pick { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; margin: 6px 0 10px; }
.ac-pick-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px; border-radius: var(--radius-sm); cursor: pointer; }
.ac-pick-row:hover { background: var(--surface-2); }
.ac-pick-row.off { opacity: .6; }
.ac-pick-row .ac-dot { margin-top: 5px; }
.ac-warn { color: var(--st-warn-ink); display: inline-flex; gap: 4px; align-items: center; }
.ac-conf { margin: 6px 0 0; padding-left: 18px; }
.ac-conf li.novo { font-weight: 600; }
.notice.ok-n { background: var(--st-ok-soft); color: var(--st-ok-ink); }
.ac-conf-user + .ac-conf-user { border-top: 1px solid var(--border); padding-top: 10px; }
.ac-pair { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; }
.ac-matrix { max-height: 70vh; overflow: auto; }
.ac-matrix th { position: sticky; top: 0; background: var(--surface); z-index: 1; white-space: nowrap; }
.ac-matrix .c { text-align: center; }
.ac-m.v-permitir { color: var(--st-ok-ink); font-weight: 700; }
.ac-m.v-negar { color: var(--st-late-ink); font-weight: 700; }
.ac-m.v-nd { color: var(--muted); }
.ac-m.conf { color: var(--st-warn-ink); background: var(--st-warn-soft); font-weight: 700; }
.ac-mgroup td { background: var(--surface-2); }
/* Rodada 27: descrição que cresce, botões dos grupos, operadores do perfil, perfis do operador e matriz recolhível */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ac-edit-fields .ac-desc-f { flex: 1 1 320px; }
.ac-desc { min-height: 38px; resize: vertical; line-height: 1.45; overflow-y: auto; font: inherit; }
.ac-gtog { flex: none; }
.ac-gtog .ic, .ac-utog .ic, .ac-mg-btn .ic { transition: transform .15s ease; }
.ac-gtog[aria-expanded="false"] .ic, .ac-mg-btn[aria-expanded="false"] .ic { transform: rotate(-90deg); }
.ac-utog[aria-expanded="true"] .ic { transform: rotate(180deg); }
.ac-members { border: 1px solid var(--border); border-radius: var(--radius); margin: 10px 0; background: var(--surface); }
.ac-members > summary { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; flex-wrap: wrap; list-style: none; }
.ac-members > summary::-webkit-details-marker { display: none; }
.ac-members > summary::before { content: '▸'; color: var(--muted); transition: transform .15s ease; }
.ac-members[open] > summary::before { transform: rotate(90deg); }
.ac-members[open] > summary { border-bottom: 1px solid var(--border); }
.ac-mem-prev { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-mem-hint { margin-left: auto; }
.ac-mem-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ac-mem-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ac-mem-tools .kb-search { flex: 1 1 240px; }
.ac-mem-tools .select { width: auto; min-width: 200px; max-width: 320px; }
.ac-mem-tools .seg-btn { border: 0; background: none; padding: 6px 11px; font: inherit; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.ac-mem-tools .seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.ac-mem-tools .seg-btn.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.ac-mem-list { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow: auto; }
.ac-mem { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: var(--radius-sm); }
.ac-mem:hover { background: var(--surface-2); }
.ac-mem.off { opacity: .65; }
.ac-mem-name { flex: 1; min-width: 0; line-height: 1.25; }
.ac-mem .pill { flex: none; }
.ac-lock { display: inline-flex; align-items: center; gap: 4px; }
.ac-uexp > td { background: var(--surface-2); padding: 8px 12px 12px; }
.ac-uexp-box { display: flex; flex-direction: column; gap: 6px; }
.ac-uexp .ac-mem:hover { background: var(--surface); }
.ac-mg-btn { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; padding: 2px 0; text-align: left; flex-wrap: wrap; }
.ac-mg-n { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-2); }
.ac-m.v-nd { color: var(--st-late); font-weight: 700; }
.ac-m.v-negar { color: var(--st-late-ink); }
.my-acc { columns: 2 280px; column-gap: 18px; }
.my-acc-g { break-inside: avoid; margin-bottom: 10px; }
.my-acc-g ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
/* Zerar a base por itens */
.reset-all { font-size: 14px; }
.reset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.reset-item { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer; background: var(--surface); }
.reset-item:has(input:checked) { border-color: var(--danger); background: var(--danger-soft); }
.reset-item input { margin-top: 3px; accent-color: var(--danger); }
.reset-n { font-family: var(--font-mono); font-size: 11px; color: var(--muted); font-weight: 400; }
/* Implementações e melhorias */
.nv-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 12px; margin-bottom: 12px; }
.nv-ver-card { margin-bottom: 10px; padding: 0; }
.nv-ver-card > summary { display: flex; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; list-style: none; }
.nv-ver-card > summary::-webkit-details-marker { display: none; }
.nv-ver-card[open] > summary { border-bottom: 1px solid var(--border); }
.nv-vnum { font-family: var(--font-mono); font-weight: 600; font-size: 13px; padding: 4px 9px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); flex: none; }
.nv-vtit { display: flex; flex-direction: column; min-width: 0; }
.nv-vtit b { font-size: 14.5px; }
.nv-new { background: var(--accent-soft); }
.nv-body { padding: 10px 14px 14px; }
.nv-resumo { color: var(--text-2); margin: 0 0 10px; }
.nv-ghead { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.nv-items { list-style: none; margin: 0; padding: 0 14px 6px; }
.nv-body .nv-items { padding: 0; }
.nv-item { padding: 8px 0; border-top: 1px solid var(--border); }
.nv-item:first-child { border-top: 0; }
.nv-items.full .nv-item { padding: 12px 0; }
.nv-item-head { display: flex; gap: 8px; align-items: center; margin-bottom: 3px; }
.nv-area, .nv-ver { font-size: 11.5px; color: var(--muted); }
.nv-ver { font-family: var(--font-mono); }
.nv-title { font-size: 13.5px; }
.nv-short { font-size: 13px; color: var(--text-2); }
.nv-items.full p { margin: 4px 0 8px; font-size: 13.5px; color: var(--text-2); max-width: 900px; }
.nv-img { display: block; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0; background: var(--surface-2); cursor: zoom-in; max-width: min(560px, 100%); overflow: hidden; }
.nv-img img { display: block; width: 100%; height: auto; }
@media (max-width: 900px) {
  .ac-shell { grid-template-columns: 1fr; }
  .ac-list { position: static; }
  .undo-bar .btn span { display: none; }
}.nv-tools .select, .ac-tools .select { width: auto; min-width: 170px; }
.nv-vtit .kb-badge { align-self: flex-start; }
/* ===== Rodada 29: exibição do construtor (escala/resolução, barras recolhíveis, botões) ===== */
/* cabeçalho do construtor: fixo, recolhido numa faixa ou aberto por cima (desafixado) */
.bhead-wrap { position: relative; }
.bhead-wrap .bhead { position: relative; }
.bhead-strip { display: none; align-items: center; gap: 6px; margin: -4px 0 8px; }
.bhead-show { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 3px 12px 3px 8px; cursor: pointer; font: inherit; min-width: 0; max-width: 100%; }
.bhead-show:hover { border-color: var(--primary); color: var(--primary); }
.bhead-show .eyebrow { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bhead-wrap.collapsed .bhead-strip { display: flex; }
.bhead-wrap.collapsed > .bhead { display: none; }
.bhead-wrap.collapsed.peek > .bhead { display: flex; position: absolute; top: -6px; left: -10px; right: -10px; z-index: 46; background: var(--bg); padding: 10px 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.bhead-wrap:not(.unpinned) .bhead-strip [data-dock-pin] { display: none; }
.page-actions.b-top { gap: 6px; }
.dock-ctl { display: inline-flex; align-items: center; gap: 0; flex: none; }
.dock-ctl [aria-pressed="true"] { color: var(--primary); }
.pane-head .dock-ctl { margin-left: auto; }
.page-actions .dock-ctl { margin-left: 2px; padding-left: 4px; border-left: 1px solid var(--border); }
/* colunas laterais: trilho quando recolhidas, abrem por cima ao passar o mouse quando desafixadas */
.pane-rail { display: none; }
.pane.collapsed { overflow: visible; padding: 0; }
.pane.collapsed > :not(.pane-rail) { display: none; }
.pane.collapsed > .pane-rail { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; min-height: 160px; padding: 8px 0; border: 0; background: none; color: var(--text-2); cursor: pointer; font: inherit; font-size: 12px; }
.pane.collapsed > .pane-rail:hover { color: var(--primary); background: var(--surface-2); border-radius: var(--radius); }
.pane.collapsed > .pane-rail span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.props-pane.collapsed > .pane-rail span { transform: none; }
.pane.collapsed.peek { overflow-y: auto; z-index: 40; box-shadow: var(--shadow-pop); }
.pane.collapsed.peek > :not(.pane-rail) { display: revert; }
.pane.collapsed.peek > .pane-rail { display: none; }
.fields-pane.collapsed.peek { width: var(--fields-w, 200px); }
.props-pane.collapsed.peek { width: var(--props-w, 272px); margin-left: calc(26px - var(--props-w, 272px)); }
.pane-ctl { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--border); }
.pane-ctl .dock-ctl { margin-left: auto; }
.builder.fields-collapsed .pane-grip.l, .builder.props-collapsed .pane-grip.r { display: none; }
/* quadro escalado (escala ou resolução de referência) */
.canvas-scale { position: relative; width: 100%; }
.canvas-scale.scaled { overflow-x: clip; }
.canvas-scale.scaled > .dash-canvas { will-change: transform; }
.res-guide { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed color-mix(in srgb, var(--accent, #e0a33a) 80%, transparent); z-index: 2; pointer-events: none; }
.res-guide span { position: absolute; right: 8px; top: 2px; font-size: 11px; padding: 1px 6px; border-radius: 4px; background: color-mix(in srgb, var(--accent, #e0a33a) 18%, var(--surface)); color: var(--text-2); }
.present .canvas-scale { margin: 0 auto; }
/* botões: só ícones / só texto (barra superior .b-top e botões de baixo .b-bot) */
.bv-top-icon .b-top .btn .bl, .bv-bot-icon .b-bot .btn .bl { display: none; }
.bv-top-icon .b-top .btn, .bv-bot-icon .b-bot .btn { padding: 0 7px; gap: 2px; }
.bv-top-text .b-top .btn > .ic:first-child, .bv-bot-text .b-bot .btn > .ic:first-child { display: none; }
.bv-top-text .b-top .btn.lib-toggle > .ic:first-child { display: none; }
/* engrenagem: Configurações do construtor */
.bcfg-menu { width: min(400px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow-y: auto; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.bcfg-menu .pf-head { display: flex; flex-direction: row; align-items: center; justify-content: space-between; text-align: left; gap: 8px; }
.bcfg-tabs { margin: 0; }
.bcfg-tabs .tab { padding: 6px 10px; font-size: 12.5px; }
.bcfg-body { display: flex; flex-direction: column; gap: 10px; }
.bcfg-row { display: flex; flex-direction: column; gap: 4px; }
.bcfg-seg { display: flex; }
.bcfg-seg .seg-opt { flex: 1 1 auto; justify-content: center; padding: 5px 8px; font-size: 12px; }
.bcfg-range { gap: 8px; align-items: center; }
.bcfg-range input[type="range"] { flex: 1; }
.bcfg-range output { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.bcfg-quick { gap: 4px; flex-wrap: wrap; }
.bcfg-quick .btn.on { background: var(--primary-soft); color: var(--primary); }
.bcfg-dock { display: flex; align-items: center; gap: 10px; font-size: 12.5px; padding: 3px 0; }
.bcfg-dock > span { flex: 1; }
.bcfg-menu .tips-opt { align-items: flex-start; padding: 6px; border-radius: var(--radius-sm); }
.bcfg-menu .tips-opt:hover { background: var(--surface-2); }

/* ---------- Rodada 30 ---------- */
/* Barras de rolagem finas e iguais em todo o portal (vertical e horizontal). No Chromium/Edge as regras
   ::-webkit-scrollbar valem enquanto scrollbar-width/scrollbar-color não forem definidos; o Firefox usa "thin". */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--muted) 75%, transparent); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
@supports (-moz-appearance: none) { * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 55%, transparent) transparent; } }

/* Menu lateral em grupos: o cabeçalho expande os submenus; o grupo da tela aberta já vem expandido */
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-gh { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font: 500 inherit; font-family: inherit; font-size: inherit; text-align: left; cursor: pointer; }
.nav-gh > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-gh:hover { background: var(--surface); color: var(--text); }
.nav-gh .nav-caret { width: 13px; height: 13px; flex: none; opacity: .7; transition: transform .15s ease; }
.nav-group.open > .nav-gh .nav-caret { transform: rotate(180deg); }
.nav-group.has-active > .nav-gh { color: var(--primary); }
.nav-group.has-active > .nav-gh .ic { stroke: var(--primary); }
.nav-sub { display: none; flex-direction: column; gap: 2px; margin-left: 14px; padding-left: 8px; border-left: 1px solid var(--border); }
.nav-group.open > .nav-sub { display: flex; }
.nav-sub a { padding: 6px 10px; font-size: 13px; }
.nav-group:not(.open):has(.nav-dot) > .nav-gh::after { content: ''; position: absolute; top: 9px; left: 24px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
body.nav-rail .nav-gh { justify-content: center; padding: 9px 0; }
body.nav-rail .nav-gh > span, body.nav-rail .nav-gh .nav-caret { display: none; }
body.nav-rail .nav-sub { margin-left: 0; padding-left: 0; border-left: 0; border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); padding-block: 2px; }
@media (max-width: 860px) {
  body.nav-rail .nav-gh { justify-content: flex-start; padding: 8px 10px; }
  body.nav-rail .nav-gh > span, body.nav-rail .nav-gh .nav-caret { display: inline; }
  body.nav-rail .nav-sub { margin-left: 14px; padding-left: 8px; border-left: 1px solid var(--border); border-top: 0; border-bottom: 0; }
}

/* Menu do usuário: só nome, cargo e e-mail; servidor e banco só com o privilégio crítico */
.um-info { min-width: 0; flex: 1; }
.um-info .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-srv { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.um-srv:empty { display: none; }
/* Botão de configuração no fim da barra (operador "Desativado" na barra superior) */
.tu-cfg-btn { display: none; }
.topbar[data-tu-show="off"] .tu-cfg-btn { display: inline-grid; }
.topbar[data-tu-show="off"] .user-wrap { align-items: center; }
.tu-cfg-btn[aria-expanded="true"] { background: var(--primary-soft); color: var(--primary); }

/* Painel da engrenagem: opções em linha; se não couberem, uma abaixo da outra (abreviadas, depois menores com "…") */
.tu-compact .tu-prev { padding: 6px; }
.tu-compact .tu-prev-bar { height: 30px; font-size: 11px; gap: 6px; padding: 0 6px; }
.tu-compact .seg { width: 100%; }
.tu-compact .seg-opt { min-width: 0; white-space: nowrap; }
.tu-compact .seg-opt .tu-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tu-compact .tu-seg.stacked { flex-direction: column; flex-wrap: nowrap; }
.tu-compact .tu-seg.stacked .seg-opt { justify-content: flex-start; width: 100%; }
.tu-compact .tu-seg.stacked .seg-opt + .seg-opt { border-top: 1px solid var(--border); }
.tu-compact .seg-opt.tu-small { font-size: 10.5px; }

/* Ver perfil › Meus privilégios */
.pv-priv { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.pv-priv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pv-priv-head h3 { font-size: 15px; flex: 1; }
.pv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.pv-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border: 1px solid var(--border); border-left: 4px solid var(--pc, var(--border)); border-radius: 999px; background: var(--surface); color: var(--text-2); font: 500 12.5px var(--font-ui); cursor: pointer; }
.pv-chip:hover { background: var(--surface-2); color: var(--text); }
.pv-chip[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); border-left-color: var(--pc, var(--primary)); }
.pv-chip .ic { width: 13px; height: 13px; }
.my-acc li.deny { color: var(--danger); }
.my-acc .acc-tag { font-size: 10.5px; font-weight: 600; padding: 0 5px; border-radius: 4px; background: var(--surface-3); color: var(--text-2); margin-left: 4px; }
.my-acc .acc-tag.crit { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.tu-prev-bar .tu-g { display: none; margin-left: 4px; padding: 0 4px; border-radius: 4px; background: var(--primary-soft); }
.tu-prev-bar[data-show="off"] .tu-g { display: inline; }
.tu-compact .tu-seg { flex-wrap: nowrap; }
/* Editor da logo (rodada 30): prévias quadradas nos tamanhos da barra superior, da página Sobre e das apresentações */
.ph-logo { display: inline-block; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 6px; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 8px 8px; background-size: contain; background-repeat: no-repeat; background-position: center; }
.ph-logo.lg { width: 64px; height: 64px; }
.ph-logo.sm { width: 24px; height: 24px; }

/* ---------- Planilha interativa (rodada 30, planilha.js) ---------- */
.pl { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.pl-scroll { flex: 1; min-height: 220px; overflow: auto; outline: none; position: relative; }
.pl-scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--primary); }
.pl-t { border-collapse: separate; border-spacing: 0; font-size: 12.5px; table-layout: fixed; width: max-content; min-width: 100%; }
.pl-t th, .pl-t td { height: 30px; padding: 0 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; box-sizing: border-box; }
.pl-t thead th { position: sticky; z-index: 2; background: var(--surface-2); font-weight: 600; text-align: left; color: var(--text-2); }
.pl-t thead tr:first-child th { top: 0; cursor: pointer; user-select: none; }
.pl-t thead tr.pl-filters th { top: 30px; padding: 2px 4px; background: var(--surface); cursor: default; }
.pl-t thead th.ro { color: var(--muted); font-style: italic; }
.pl-f { width: 100%; height: 24px; border: 1px solid var(--border); border-radius: 4px; padding: 0 6px; font: 12px var(--font-ui); background: var(--surface); color: var(--text); }
.pl-t .pl-n { position: sticky; left: 0; z-index: 1; width: 52px; min-width: 52px; text-align: right; color: var(--muted); background: var(--surface-2); font-family: var(--font-mono); font-size: 11px; }
.pl-t .pl-ck { position: sticky; left: 0; z-index: 1; width: 30px; min-width: 30px; padding: 0 6px; background: var(--surface-2); text-align: center; }
.pl-t .pl-ck + .pl-n { left: 30px; }
.pl-t thead .pl-n, .pl-t thead .pl-ck { z-index: 3; }
.pl-t td.ro { color: var(--text-2); background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.pl-t td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pl-t td.pl-sel { box-shadow: inset 0 0 0 2px var(--primary); }
.pl-t td.pl-pend { background: color-mix(in srgb, #f5c542 30%, var(--surface)); }
.pl-t td.pl-saved { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
.pl-t td.pl-err { box-shadow: inset 0 0 0 2px var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.pl-t tr.pl-new td:not(.pl-n):not(.pl-ck) { background: color-mix(in srgb, #2e9d63 12%, var(--surface)); }
.pl-t tr.pl-new .pl-n { box-shadow: inset 3px 0 0 #2e9d63; }
.pl-t tr.pl-del td:not(.pl-ck) { text-decoration: line-through; color: var(--danger); opacity: .7; }
.pl-t tr.pl-picked td { background-color: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.pl-t tr:hover td:not(.pl-sel) { filter: brightness(.985); }
.pl-t td.pl-editing { padding: 0; box-shadow: inset 0 0 0 2px var(--primary); overflow: visible; }
.pl-in { width: 100%; height: 28px; border: 0; padding: 0 7px; font: 12.5px var(--font-ui); background: var(--surface); color: var(--text); outline: none; }
.pl-mark { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); margin-left: 4px; vertical-align: middle; }
.pl-pad td { padding: 0; border: 0; height: auto; }
.pl-empty { text-align: center; color: var(--muted); padding: 24px !important; height: auto !important; }
.pl-foot { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; padding: 6px 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.pl-pinfo { color: #9a6b00; font-weight: 600; }
[data-theme="dark"] .pl-pinfo { color: #f5c542; }
.pl-einfo { color: var(--danger); font-weight: 600; }

/* ---------- XML e-SUS / CNES (rodada 30, views/cnes.js) ---------- */
.cn-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 14px; align-items: start; }
.cn-files { display: flex; flex-direction: column; gap: 8px; }
.cn-file { text-align: left; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 10px 12px; cursor: pointer; color: var(--text); font: inherit; display: flex; flex-direction: column; gap: 3px; }
.cn-file:hover { border-color: var(--border-strong); }
.cn-file.on { border-color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); background: var(--primary-soft); }
.cn-file b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-file .small { color: var(--text-2); }
.cn-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cn-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.cn-kv { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); }
.cn-kv b { color: var(--text); }
.cn-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cn-tab { border: 0; background: none; padding: 8px 12px; font: 500 13px var(--font-ui); color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 6px; }
.cn-tab:hover { color: var(--text); }
.cn-tab.on { color: var(--primary); border-bottom-color: var(--primary); }
.cn-tab .count { font-size: 11px; }
.cn-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cn-bar .spacer { flex: 1; }
.cn-bar .input.sm { height: 30px; width: 220px; }
.cn-grid { height: calc(100vh - 330px); min-height: 360px; }
.cn-grid .pl { height: 100%; }
.cn-save.has { background: #f5c542; border-color: #d9a400; color: #3d2c00; }
.cn-avisos { max-height: 220px; overflow: auto; font-size: 12.5px; margin: 0; padding-left: 18px; }
.cn-avisos li.erro { color: var(--danger); }
.cn-avisos li.aviso { color: #9a6b00; }
.cn-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.cn-sum div { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface-2); }
.cn-sum b { display: block; font-size: 20px; }
.cn-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); }
.cn-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -2px; border: 1px solid var(--border); }
@media (max-width: 1000px) { .cn-layout { grid-template-columns: minmax(0, 1fr); } .cn-files { flex-direction: row; overflow-x: auto; } .cn-file { min-width: 220px; } }
.pl { min-width: 0; max-width: 100%; }
.nav-sub { margin-left: 10px; padding-left: 6px; }

/* ---------- Rodada 31 ---------- */
/* Fonte de dados: painéis e dados vinculados antes de desativar ou excluir */
.imp-list { margin: 2px 0 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.imp-list li { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; }
.imp-modal .modal-foot { flex-wrap: wrap; }
/* Biblioteca: painéis ativos, inativos e o motivo */
.lib-status { width: 100%; display: flex; }
.lib-status .seg-b { flex: 1; padding: 4px 6px; font-size: 12px; }
.lib-status .count { font-size: 11px; opacity: .75; }
.lib-board.inactive { opacity: .78; border-style: dashed; }
.lib-board.inactive .lib-bname b { color: var(--text-2); }
.lib-off { font-size: 10px; padding: 0 6px; margin-left: 4px; vertical-align: 1px; }
.lib-why { display: block; font-size: 11px; color: #9a6b00; margin-top: 2px; line-height: 1.3; }
[data-theme="dark"] .lib-why { color: #f2d98b; }
.b-inactive { margin-bottom: 10px; align-items: center; }
.b-inactive > div { flex: 1; }

/* ---------- Rodada 31 · estilos temáticos ---------- */
/* Sempre escuros (Universo, Terminal): os tokens escuros valem com qualquer tema */
:root[data-forced-dark="on"][data-style] {
  --bg: var(--user-bg-dark, #0d0f1a); --surface: var(--user-surface-dark, #161a2b); --surface-2: #1c2136; --surface-3: #252b45;
  --border: #2a3150; --border-strong: #3a4369; --text: #eef0ff; --text-2: #b9bfdc; --muted: #8890b5;
  --primary: var(--user-primary-dark, #8b5cf6); --primary-ink: #0b0d18; --accent: var(--user-accent-dark, #22d3ee);
  --st-ok-soft: rgba(124, 196, 154, .16); --st-warn-soft: rgba(240, 207, 107, .15); --st-late-soft: rgba(232, 143, 143, .16);
  --st-ok-ink: #9fdcb6; --st-warn-ink: #f2d98b; --st-late-ink: #f2abab; --danger: #ec7c76; --danger-soft: rgba(236, 124, 118, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .3); --shadow-pop: 0 12px 40px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* macOS: barra e menu translúcidos, semáforo na barra, pílula azul no item ativo, cantos de 12 px */
:root[data-style="macos"] { --radius: 12px; --radius-sm: 7px; --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Instrument Sans", system-ui, sans-serif; --shadow: 0 1px 1px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .07); --user-bg-light: #ececec; --user-bg-dark: #1e1e1e; }
[data-style="macos"] .topbar { background: color-mix(in srgb, var(--surface) 72%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
[data-style="macos"] .tb-left::before { content: ""; flex: none; width: 52px; height: 12px; margin-right: 4px; background: radial-gradient(circle 6px at 6px 6px, #ff5f57 98%, transparent 100%), radial-gradient(circle 6px at 26px 6px, #febc2e 98%, transparent 100%), radial-gradient(circle 6px at 46px 6px, #28c840 98%, transparent 100%); }
[data-style="macos"] .sidenav { background: color-mix(in srgb, var(--surface-3) 55%, transparent); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
[data-style="macos"] .sidenav a.active { background: var(--primary); color: #fff; box-shadow: none; border-radius: 7px; }
[data-style="macos"] .sidenav a.active .ic { stroke: #fff; }
[data-style="macos"] .btn { border-radius: 7px; box-shadow: 0 .5px 1.5px rgba(0, 0, 0, .18); }
[data-style="macos"] .btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 82%, #fff), var(--primary)); }
[data-style="macos"] .card, [data-style="macos"] .kpi, [data-style="macos"] .widget { border-color: color-mix(in srgb, var(--border) 60%, transparent); }

/* Windows 11 (Fluent): fundo Mica, barra de destaque no item ativo, botões com base mais escura */
:root[data-style="windows"] { --radius: 8px; --radius-sm: 4px; --font-ui: "Segoe UI Variable Text", "Segoe UI", "Instrument Sans", system-ui, sans-serif; --user-bg-light: #f3f3f3; --user-bg-dark: #202020; --shadow: 0 2px 4px rgba(0, 0, 0, .04), 0 0 1px rgba(0, 0, 0, .08); }
[data-style="windows"] body { background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 7%, var(--bg)), var(--bg) 45%, color-mix(in srgb, var(--accent) 6%, var(--bg))); background-attachment: fixed; }
[data-style="windows"] .topbar, [data-style="windows"] .sidenav { background: transparent; border-color: transparent; }
[data-style="windows"] .sidenav a { position: relative; }
[data-style="windows"] .sidenav a.active { background: color-mix(in srgb, var(--text) 6%, transparent); box-shadow: none; color: var(--text); }
[data-style="windows"] .sidenav a.active::before { content: ""; position: absolute; left: 0; top: 25%; bottom: 25%; width: 3px; border-radius: 3px; background: var(--primary); }
[data-style="windows"] .btn { border-bottom-color: color-mix(in srgb, var(--border-strong) 80%, #000); border-radius: 4px; }
[data-style="windows"] .card, [data-style="windows"] .kpi, [data-style="windows"] .widget { background: color-mix(in srgb, var(--surface) 88%, transparent); }

/* Linux (GNOME/Ubuntu): barra de cabeçalho berinjela, laranja no ativo, linhas retas */
:root[data-style="linux"] { --radius: 6px; --radius-sm: 4px; --font-ui: Ubuntu, Cantarell, "Source Sans 3", "Segoe UI", system-ui, sans-serif; --user-bg-light: #f6f5f4; --user-bg-dark: #242424; }
[data-style="linux"] .topbar { background: #2c001e; border-bottom-color: #2c001e; }
[data-style="linux"] .topbar :is(.brand, .brand b, .icon-btn, .user-name, .user-role, .user-btn) { color: #f6f5f4; }
[data-style="linux"] .topbar .search-trigger { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: #e8dde4; }
[data-style="linux"] .topbar .icon-btn:hover, [data-style="linux"] .topbar .user-btn:hover { background: rgba(255, 255, 255, .12); border-color: transparent; }
[data-style="linux"] .sidenav a.active { box-shadow: inset 3px 0 0 var(--primary); background: var(--surface); border-radius: 0 6px 6px 0; }
[data-style="linux"] .btn.primary { background: var(--primary); border-color: color-mix(in srgb, var(--primary) 80%, #000); }

/* Natureza: papel claro com folhas, verdes e cantos orgânicos */
:root[data-style="natureza"] { --radius: 16px; --radius-sm: 10px; --font-ui: "Manrope", "Segoe UI", system-ui, sans-serif; --user-bg-light: #f3efe3; --user-bg-dark: #1a201b; --user-surface-light: #fffdf6; --user-surface-dark: #222a23; }
[data-style="natureza"] body { background-color: var(--bg); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='%233c7350' fill-opacity='.07'%3E%3Cpath d='M30 50c18-20 46-18 46-18s-4 30-28 38c-10 3-20 0-18-20z'/%3E%3Cpath d='M118 118c-14 16-38 14-38 14s4-24 24-30c8-2 16 0 14 16z'/%3E%3C/g%3E%3C/svg%3E"); background-attachment: fixed; }
[data-style="natureza"] .sidenav a.active { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); box-shadow: none; border-radius: 999px; }
[data-style="natureza"] .btn { border-radius: 999px; }
[data-style="natureza"] .card-head .section-title, [data-style="natureza"] .page-head h1 { color: color-mix(in srgb, var(--primary) 75%, var(--text)); }

/* Universo: céu estrelado, nebulosas e brilho neon (sempre escuro) */
[data-style="universo"] body { background: radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 51%) 0 0 / 180px 180px, radial-gradient(1px 1px at 70% 80%, #cdd6ff 50%, transparent 51%) 0 0 / 240px 240px, radial-gradient(1.5px 1.5px at 40% 60%, #fff 50%, transparent 51%) 0 0 / 320px 320px, radial-gradient(800px 500px at 85% -10%, rgba(139, 92, 246, .28), transparent 60%), radial-gradient(700px 500px at -10% 110%, rgba(34, 211, 238, .18), transparent 60%), #070814; background-attachment: fixed; }
[data-style="universo"] .topbar, [data-style="universo"] .sidenav { background: rgba(10, 12, 30, .55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-color: rgba(139, 92, 246, .25); }
[data-style="universo"] .card, [data-style="universo"] .kpi, [data-style="universo"] .widget { background: rgba(22, 26, 52, .78); border-color: rgba(139, 92, 246, .28); }
[data-style="universo"] .sidenav a.active { background: rgba(139, 92, 246, .22); color: #fff; box-shadow: 0 0 0 1px rgba(139, 92, 246, .55), 0 0 18px rgba(139, 92, 246, .35); }
[data-style="universo"] .btn.primary { background: linear-gradient(135deg, var(--primary), var(--accent)); border-color: transparent; color: #fff; box-shadow: 0 0 18px color-mix(in srgb, var(--primary) 45%, transparent); }
[data-style="universo"] .page-head h1 { background: linear-gradient(90deg, #fff, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Cores sólidas: menu e barra em blocos de cor, sem sombras */
:root[data-style="solido"] { --radius: 4px; --radius-sm: 2px; --shadow: none; }
[data-style="solido"] .topbar { background: var(--primary); border-bottom-color: var(--primary); }
[data-style="solido"] .topbar :is(.brand, .brand b, .icon-btn, .user-name, .user-role, .user-btn) { color: var(--primary-ink); }
[data-style="solido"] .topbar .icon-btn:hover, [data-style="solido"] .topbar .user-btn:hover { background: rgba(255, 255, 255, .16); border-color: transparent; }
[data-style="solido"] .topbar .search-trigger { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .28); color: var(--primary-ink); }
[data-style="solido"] .sidenav { background: color-mix(in srgb, var(--primary) 58%, #070a0f); border-right-color: transparent; }
[data-style="solido"] .sidenav :is(a, .nav-gh, .nav-tool), [data-style="solido"] .nav-foot { color: rgba(255, 255, 255, .84); }
[data-style="solido"] .sidenav .ic { stroke: currentColor; }
[data-style="solido"] .sidenav a:hover, [data-style="solido"] .sidenav .nav-gh:hover { background: rgba(255, 255, 255, .12); color: #fff; }
[data-style="solido"] .sidenav a.active { background: var(--accent); color: #fff; box-shadow: none; }
[data-style="solido"] .sidenav a.active .ic { stroke: #fff; }
[data-style="solido"] .nav-sub { border-left-color: rgba(255, 255, 255, .25); }
[data-style="solido"] .card, [data-style="solido"] .kpi, [data-style="solido"] .widget { border-color: transparent; }
[data-style="solido"] .card-head { border-bottom: 3px solid var(--primary); padding-bottom: 10px; }

/* Vibrante: gradiente saturado na barra, botões coloridos e cantos redondos */
:root[data-style="vibrante"] { --radius: 16px; --radius-sm: 10px; --font-ui: "Manrope", "Segoe UI", system-ui, sans-serif; }
[data-style="vibrante"] .topbar { background: linear-gradient(100deg, var(--primary), #8a2be2 50%, var(--accent)); border-bottom-color: transparent; }
[data-style="vibrante"] .topbar :is(.brand, .brand b, .icon-btn, .user-name, .user-role, .user-btn) { color: #fff; }
[data-style="vibrante"] .topbar .icon-btn:hover, [data-style="vibrante"] .topbar .user-btn:hover { background: rgba(255, 255, 255, .18); border-color: transparent; }
[data-style="vibrante"] .topbar .search-trigger { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .3); color: #fff; }
[data-style="vibrante"] .sidenav a.active { background: linear-gradient(90deg, var(--primary), var(--accent)); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent); }
[data-style="vibrante"] .sidenav a.active .ic { stroke: #fff; }
[data-style="vibrante"] .btn.primary { background: linear-gradient(135deg, var(--primary), var(--accent)); border-color: transparent; color: #fff; }
[data-style="vibrante"] .kpi { border-top: 4px solid var(--accent); }

/* Neobrutalista: contornos grossos e sombras duras deslocadas */
:root[data-style="brutalista"] { --radius: 6px; --radius-sm: 4px; --shadow: 4px 4px 0 var(--text); --font-ui: "Instrument Sans", system-ui, sans-serif; --user-bg-light: #fff8e6; }
[data-style="brutalista"] :is(.card, .kpi, .widget, .modal, .menu) { border: 2px solid var(--text); }
[data-style="brutalista"] .btn { border: 2px solid var(--text); box-shadow: 2px 2px 0 var(--text); font-weight: 700; }
[data-style="brutalista"] .btn:active { transform: translate(2px, 2px); box-shadow: none; }
[data-style="brutalista"] .btn.primary { background: var(--accent); color: #111; }
[data-style="brutalista"] .topbar { border-bottom: 2px solid var(--text); }
[data-style="brutalista"] .sidenav { border-right: 2px solid var(--text); }
[data-style="brutalista"] .sidenav a.active { background: var(--accent); color: #111; box-shadow: 2px 2px 0 var(--text); outline: 2px solid var(--text); }
[data-style="brutalista"] .page-head h1 { font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }

/* Editorial: jornal com serifa, papel creme e fios finos */
:root[data-style="editorial"] { --radius: 0px; --radius-sm: 0px; --shadow: none; --user-bg-light: #f7f3ea; --user-surface-light: #fffdf7; --user-bg-dark: #1c1a17; --user-surface-dark: #24211d; }
[data-style="editorial"] :is(.page-head h1, .section-title, .w-title, .brand-name) { font-family: Georgia, "Times New Roman", serif; letter-spacing: 0; }
[data-style="editorial"] .page-head { border-bottom: 3px double var(--text); padding-bottom: 8px; }
[data-style="editorial"] :is(.card, .kpi, .widget) { border-color: var(--text-2); border-width: 1px 0 0; }
[data-style="editorial"] .sidenav a.active { background: none; box-shadow: none; color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
[data-style="editorial"] .btn.primary { background: var(--text); border-color: var(--text); color: var(--surface); }

/* Terminal: fósforo verde, letra monoespaçada (sempre escuro) */
:root[data-style="terminal"][data-forced-dark="on"] { --bg: #050805; --surface: #0b120b; --surface-2: #0f190f; --surface-3: #142214; --border: #1d3a22; --border-strong: #2a5a32; --text: #b6ffcc; --text-2: #7fdc9b; --muted: #4f9a66; --font-ui: "IBM Plex Mono", ui-monospace, Consolas, monospace; --radius: 2px; --radius-sm: 2px; --shadow: none; }
[data-style="terminal"] body { background: repeating-linear-gradient(0deg, rgba(57, 255, 136, .035) 0 1px, transparent 1px 3px), var(--bg); }
[data-style="terminal"] .page-head h1::before { content: "> "; color: var(--primary); }
[data-style="terminal"] .sidenav a.active { background: var(--primary); color: #041006; box-shadow: none; }
[data-style="terminal"] .sidenav a.active .ic { stroke: #041006; }
[data-style="terminal"] .btn.primary { background: transparent; color: var(--primary); border-color: var(--primary); }
[data-style="terminal"] .btn.primary:hover { background: var(--primary); color: #041006; }
[data-style="terminal"] :is(.card, .kpi, .widget) { border-style: dashed; }

/* ---------- Rodada 31 · interface do portal (settings.ui → data-ui-*) ---------- */
[data-ui-topbar="cor"] .topbar { background: var(--primary); border-bottom-color: var(--primary); }
[data-ui-topbar="gradiente"] .topbar { background: var(--grad); border-bottom-color: transparent; }
[data-ui-topbar="escura"] .topbar { background: #15181d; border-bottom-color: #15181d; }
:is([data-ui-topbar="cor"], [data-ui-topbar="gradiente"], [data-ui-topbar="escura"]) .topbar :is(.brand, .brand b, .icon-btn, .user-name, .user-role, .user-btn) { color: #fff; }
:is([data-ui-topbar="cor"], [data-ui-topbar="gradiente"], [data-ui-topbar="escura"]) .topbar .search-trigger { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); color: #f2f4f6; }
[data-ui-topbar="vidro"] .topbar { background: color-mix(in srgb, var(--surface) 60%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
[data-ui-navactive="barra"] .sidenav a.active { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); color: var(--primary); border-radius: 0 8px 8px 0; }
[data-ui-navactive="pilula"] .sidenav a.active { background: var(--primary); color: var(--primary-ink); box-shadow: none; border-radius: 999px; }
[data-ui-navactive="pilula"] .sidenav a.active .ic { stroke: var(--primary-ink); }
[data-ui-navactive="sublinhado"] .sidenav a.active { background: none; box-shadow: inset 0 -2px 0 var(--primary); border-radius: 0; color: var(--primary); }
[data-ui-navactive="contorno"] .sidenav a.active { background: none; box-shadow: inset 0 0 0 1.5px var(--primary); color: var(--primary); }
[data-ui-background="liso"] body { background: var(--bg); }
[data-ui-background="pontos"] body { background: radial-gradient(color-mix(in srgb, var(--text) 14%, transparent) 1px, transparent 1.5px) 0 0 / 18px 18px, var(--bg); background-attachment: fixed; }
[data-ui-background="grade"] body { background: linear-gradient(color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px) 0 0 / 24px 24px, var(--bg); background-attachment: fixed; }
[data-ui-background="gradiente"] body { background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 10%, var(--bg)), var(--bg) 40%, color-mix(in srgb, var(--accent) 9%, var(--bg))); background-attachment: fixed; }
[data-ui-background="bolhas"] body { background: radial-gradient(600px 400px at 0% 0%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 70%), radial-gradient(500px 400px at 100% 30%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%), radial-gradient(600px 400px at 30% 100%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }
[data-ui-cards="contorno"] :is(.card, .kpi, .widget) { box-shadow: none; border-color: var(--border-strong); }
[data-ui-cards="elevado"] :is(.card, .kpi, .widget) { box-shadow: 0 4px 10px rgba(20, 30, 45, .1), 0 14px 34px rgba(20, 30, 45, .12); border-color: transparent; }
[data-ui-cards="plano"] :is(.card, .kpi, .widget) { box-shadow: none; border-color: transparent; }
[data-ui-cards="faixa"] :is(.card, .kpi) { border-top: 3px solid var(--primary); }
[data-ui-textsize="menor"] body { font-size: 13px; }
[data-ui-textsize="maior"] body { font-size: 15px; }
[data-ui-textsize="grande"] body { font-size: 16px; }
[data-ui-textsize="maior"] :is(.tbl, .menu-item, .sidenav a, .btn) { font-size: 14px; }
[data-ui-textsize="grande"] :is(.tbl, .menu-item, .sidenav a, .btn) { font-size: 15px; }
:root[data-ui-corners="retos"] { --radius: 0px; --radius-sm: 0px; }
:root[data-ui-corners="suaves"] { --radius: 8px; --radius-sm: 5px; }
:root[data-ui-corners="redondos"] { --radius: 18px; --radius-sm: 12px; }
[data-ui-width="limitada"] .view { max-width: 1440px; margin-inline: auto; width: 100%; }
[data-ui-tables="zebra"] .tbl tbody tr:nth-child(even) td { background: var(--surface-2); }
[data-ui-tables="grade"] .tbl :is(td, th) { border: 1px solid var(--border); }
[data-ui-focus="forte"] :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); }
[data-ui-motion="reduzidas"] *, [data-ui-motion="reduzidas"] *::before, [data-ui-motion="reduzidas"] *::after { transition-duration: .05s !important; animation-duration: .05s !important; }
[data-ui-motion="nenhuma"] *, [data-ui-motion="nenhuma"] *::before, [data-ui-motion="nenhuma"] *::after { transition: none !important; animation: none !important; }

/* ---------- Rodada 31 · tela Personalizações ---------- */
.pz-tabs { margin-bottom: 12px; }
.pz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pz-pal { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.pz-pal:hover { border-color: var(--border-strong); }
.pz-pal.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.pz-sw { display: flex; height: 26px; border-radius: 6px; overflow: hidden; }
.pz-sw i { flex: 1; }
.pz-pal b { font-size: 13px; }
.pz-group { margin: 14px 0 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-family: var(--font-mono); }
.pz-ui { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pz-ui .field { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.pz-ui .seg { display: flex; flex-wrap: wrap; margin-top: 6px; }
.pz-ui .seg-b { flex: 1 1 auto; font-size: 12px; padding: 5px 8px; }
.pz-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.pz-link { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); text-align: left; cursor: pointer; color: var(--text); font: inherit; }
.pz-link:hover { border-color: var(--primary); }
.pz-link .ic { width: 20px; height: 20px; flex: none; color: var(--primary); stroke: var(--primary); }
.pz-link span { display: flex; flex-direction: column; gap: 2px; }
.pz-link small { color: var(--muted); }

/* ---------- Rodada 32 · Base de conhecimento ---------- */
.kb-tree-head { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.kb-tree-acts { display: inline-flex; gap: 2px; }
.kb-tree-acts .icon-btn .ic { width: 16px; height: 16px; }
.kb-tree-acts .icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.kb-main-acts .pill { align-self: center; }

/* ---------- Rodada 33 · Implementações e melhorias ---------- */
.nv-grp:not([open]) > summary.nv-ghead { border-bottom: 0; }
.nv-grp > summary.nv-ghead::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.nv-grp[open] > summary.nv-ghead::after { transform: rotate(-135deg); }
.nv-fold .seg-btn:disabled { opacity: .45; cursor: default; }

/* Rodada 34 · Formato › Transparência e efeitos: "Fundo transparente" tira também o fundo do cabeçalho do visual (estilo Analítico) */
.widget[style*="--w-nobg"] .w-head { background: none; }

/* Auditoria 2026-10 (E2E-1/E2E-2): em telas de celular (390 px) a barra de organização do construtor e os botões do
   cabeçalho das telas quebram linha em vez de criar rolagem horizontal na página */
@media (max-width: 560px) {
  .page-actions .btn { max-width: 100%; white-space: normal; text-align: left; }
  .canvas-bar { flex-wrap: wrap; }
  .lay-bar { flex-wrap: wrap; margin-left: 0; padding-left: 0; border-left: 0; max-width: 100%; }
}

/* Configurações gerais (views/preferencias.js, vindas do Geral 1.0.0): opções em cartão e a ordem do menu lateral */
.gr-modos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.gr-op { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius, 10px); cursor: pointer; position: relative; }
.gr-op input { position: absolute; top: 12px; right: 12px; }
.gr-op.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.gr-op .btn { justify-self: start; margin-top: 4px; }
.gr-ml { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.gr-ml .gr-ml { margin: 4px 0 6px 28px; }
.gr-ml-it { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface, var(--bg)); }
.gr-ml-it[draggable="true"] { cursor: grab; }
.gr-ml-it.arrastando { opacity: .5; border-style: dashed; }
.gr-ml-it.fixo { opacity: .75; }
.gr-ml-alca { color: var(--muted); display: inline-flex; width: 16px; }
.gr-ml-nome { flex: 1; min-width: 0; }
.gr-ml-sub { list-style: none; }

/* Menu em blocos, visão de submenus (18/10/2026): bloco do grupo com o atalho no canto e o painel com as telas do grupo */
.nav-pop-body a.nav-blk-grupo { padding-bottom: 20px; }
.nav-pop-body a.nav-blk-grupo .nav-blk-sub { position: absolute; right: 4px; bottom: 4px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 5px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); cursor: pointer; }
.nav-pop-body a.nav-blk-grupo .nav-blk-sub .ic { width: 11px; height: 11px; }
.nav-pop-body a.nav-blk-grupo .nav-blk-sub:hover, .nav-pop-body a.nav-blk-grupo.sub-aberto .nav-blk-sub { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.nav-pop-body a.nav-blk-grupo.sub-aberto { border-color: var(--primary); background: var(--primary-soft); }
.nav-pop.nav-pop-sub { z-index: 1; box-shadow: var(--shadow-pop); }

/* Cadastros gerais (views/cadastrosGerais.js, Pedido 0003): cargos, países, estados e cidades, no Portal CIMC e no Geral */
.cg-barra .cg-busca { position: relative; flex: 1 1 240px; display: flex; align-items: center; min-width: 0; }
.cg-barra .cg-busca .ic { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.cg-barra .cg-busca .input { padding-left: 32px; width: 100%; }
.cg-filtro { display: inline-flex; align-items: center; gap: 6px; }
.cg-total { margin-left: auto; }
.cg-pag { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border); }
.cg-pag:empty { display: none; }
.cg-acoes { white-space: nowrap; }
.cg-sinc { margin-bottom: 16px; }
.cg-sinc-cab { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.cg-sinc-cab h2 { display: flex; gap: 8px; align-items: center; margin: 0 0 4px; }
.cg-sinc-cfg { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; align-items: end; margin: 12px 0 8px; }
.cg-sinc-cfg > .btn { justify-self: start; }
.cg-int .row { flex-wrap: nowrap; }
.cg-int .input { width: 96px; }
.cg-sinc-sit { margin: 4px 0 0; color: var(--text-2); }
.cg-hist summary { cursor: pointer; margin-top: 8px; color: var(--text-2); }
/* lista de modelos da IA (views/ia.js): mostra todos, sem o filtro do datalist */
.ia-modelos { margin-top: 6px; width: 100%; max-width: 520px; }
.cg-texto { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; }
/* Corretor ortográfico (views/corretor.js, Pedido 0003): motor, dicionário de dados e monitoramento */
.co-tela .tabs { margin-bottom: 14px; }
.co-h2 { font-size: 1.02rem; margin: 0 0 4px; }
.co-motores { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.co-motores .co-motor { align-content: start; }
.co-tela .card .small-title { margin-top: 14px; }
.co-selos { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
.co-alerta { display: flex; gap: 6px; align-items: center; color: var(--st-late-ink, #b42318); }
.co-teste { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; }
.co-modo { display: grid; gap: 10px; }
.co-modos { margin: 0; }
tr.co-grupo td { background: var(--surface-2); font-weight: 600; font-size: 12.5px; color: var(--text-2); }
tr.co-grupo td .ic { margin-right: 6px; vertical-align: -2px; }
.co-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.co-painel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.co-painel .co-larga { grid-column: 1 / -1; }
.co-cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.co-cab .seg { display: inline-flex; gap: 4px; }
.co-graf { width: 100%; height: 260px; }
.co-graf-alto { height: 380px; }
.co-lista { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.co-lista li { display: flex; align-items: center; gap: 8px; }
.co-lista li > b, .co-lista .co-rk-txt { flex: 1; min-width: 0; }
.co-ranking .co-rk-barra { width: 28%; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.co-ranking .co-rk-barra i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
@media (max-width: 1100px) { .co-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .co-painel { grid-template-columns: minmax(0, 1fr); } .co-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .co-ranking .co-rk-barra { display: none; } }
@media (max-width: 560px) { .kpi-grid.cg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cg-kpis .kpi .k-value { font-size: 22px; } }
@media (max-width: 640px) { .cg-total { margin-left: 0; width: 100%; } .cg-filtro { flex: 1 1 140px; } .cg-filtro .select { flex: 1; } }
