/* Oggi Produção — linguagem visual Microsoft 365 / Fluent: superfícies planas, bordas finas, cantos de 2px, sem sombras decorativas */
:root {
  --fonte: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;

  --topo: #0f6cbd;
  --brand: #0f6cbd; --brand-hover: #115ea3; --brand-press: #0f548c; --brand-fraco: #ebf3fc; --brand-borda: #b4d6fa;
  --oggi: #f07f00;
  --fg: #242424; --fg2: #424242; --fg3: #616161; --fg-off: #a0a0a0;
  --bg: #f5f5f5; --bg2: #faf9f8; --surface: #ffffff; --hover: #f3f2f1; --press: #e1dfdd;
  --borda: #e1dfdd; --borda2: #c8c6c4; --borda-forte: #8a8886;
  --ok: #107c10; --ok-bg: #dff6dd; --aviso: #8a5a00; --aviso-bg: #fff4ce; --erro: #a4262c; --erro-bg: #fdf3f4; --erro-forte: #c50f1f;
  --info: #0f548c; --info-bg: #ebf3fc;
  --sombra-menu: 0 0 2px rgba(0,0,0,.12), 0 8px 16px rgba(0,0,0,.14);
  --sombra-dlg: 0 0 8px rgba(0,0,0,.12), 0 32px 64px rgba(0,0,0,.24);
  --raio: 6px; --raio-g: 10px; --raio-p: 4px;
  --nav-w: 220px; --topo-h: 48px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 400 14px/20px var(--fonte); color: var(--fg); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.icon { flex: none; }
[hidden] { display: none !important; }
.sec { color: var(--fg3); font-size: 12px; }
.neg { color: var(--erro-forte); }
kbd { font: 600 11px var(--fonte); border: 1px solid var(--borda2); border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; background: var(--surface); color: var(--fg2); }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 14px; border: 1px solid var(--borda-forte); border-radius: var(--raio); background: var(--surface); color: var(--fg); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--hover); }
.btn:active:not(:disabled) { background: var(--press); }
.btn:disabled { color: var(--fg-off); cursor: default; background: var(--bg2); border-color: var(--borda); }
.btn.primario { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primario:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.primario:active:not(:disabled) { background: var(--brand-press); }
.btn.primario:disabled { background: #c8c6c4; border-color: #c8c6c4; color: #fff; }
.btn.perigo { background: var(--erro-forte); border-color: var(--erro-forte); color: #fff; }
.btn.perigo:hover:not(:disabled) { background: #a10d19; border-color: #a10d19; }
.btn.sutil { border-color: transparent; background: transparent; font-weight: 400; }
.btn.sutil:hover:not(:disabled) { background: var(--hover); }
.btn.icone { padding: 0; width: 32px; }
.btn.pq { min-height: 24px; padding: 0 8px; font-size: 12px; }
.btn.excel .icon { color: #107c41; }

/* ---------- campos ---------- */
.campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.campo-rotulo { font-weight: 600; font-size: 13px; color: var(--fg2); }
.campo-dica { font-size: 12px; color: var(--fg3); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=number], select, textarea {
  width: 100%; min-height: 32px; padding: 4px 10px; background: var(--surface); border: 1px solid var(--borda-forte); border-radius: var(--raio);
}
textarea { min-height: 72px; resize: vertical; line-height: 20px; padding: 6px 10px; }
input:hover:not(:disabled):not(:focus), select:hover:not(:disabled):not(:focus), textarea:hover:not(:focus) { border-color: var(--fg2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg2); color: var(--fg3); border-color: var(--borda); }
input.invalido, select.invalido { border-color: var(--erro-forte); background: var(--erro-bg); }
input[type=checkbox] { width: 16px; height: 16px; min-height: 0; accent-color: var(--brand); margin: 0; }
.linha-campos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.linha-campos.c2 { grid-template-columns: 1fr 1fr; } .linha-campos.c3 { grid-template-columns: 1fr 1fr 1fr; }
.erro-campo { color: var(--erro); font-size: 12px; }
.check-linha { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check-linha input { margin-top: 2px; }

/* ---------- login (padrão Microsoft) ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f3f2f1; gap: 16px; padding: 24px; }
.login-caixa { width: min(440px, 100%); background: var(--surface); padding: 44px 44px 36px; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.login-caixa img.logo { width: 112px; display: block; margin: -10px 0 8px -12px; }
.login-caixa h1 { font-size: 24px; line-height: 32px; margin-bottom: 4px; }
.login-caixa p.sub { color: var(--fg3); margin: 0 0 20px; }
.login-caixa form { display: grid; gap: 14px; }
.login-caixa input { min-height: 36px; border-width: 0 0 1px 0; border-radius: 0; padding-left: 2px; border-bottom-color: var(--fg3); box-shadow: none; background: transparent; }
.login-caixa input:focus { border-bottom: 2px solid var(--brand); box-shadow: none; padding-bottom: 3px; }
.login-caixa .btn { min-height: 36px; justify-self: end; min-width: 108px; margin-top: 8px; }
.login-erro { background: var(--erro-bg); border: 1px solid #eeacb2; color: var(--erro); padding: 8px 12px; display: flex; gap: 8px; }
.login-rodape { color: var(--fg3); font-size: 12px; }

/* ---------- casca ---------- */
.app { display: grid; grid-template-rows: var(--topo-h) 1fr; height: 100vh; }
.topbar { background: var(--topo); color: #fff; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 8px; position: relative; z-index: 40; }
.app-tile { width: 32px; height: 32px; background: #fff; border-radius: var(--raio); display: grid; place-items: center; overflow: hidden; flex: none; }
.app-tile img { width: 32px; height: 32px; object-fit: contain; }
.app-nome { color: #fff; font-weight: 600; font-size: 15px; letter-spacing: .01em; }
.app-nome:hover { text-decoration: none; }
.busca-topo { flex: 0 1 560px; margin: 0 auto; height: 32px; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: rgba(255,255,255,.18); color: rgba(255,255,255,.92); border: 1px solid transparent; border-radius: var(--raio); cursor: text; text-align: left; }
.busca-topo span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.busca-topo:hover { background: rgba(255,255,255,.26); }
.busca-topo kbd { background: transparent; color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.45); }
.conta { position: relative; margin-left: auto; }
.busca-topo + .conta { margin-left: 0; }
.conta-btn { border: 0; background: transparent; padding: 2px; cursor: pointer; border-radius: 50%; display: block; }
.conta-btn:hover { background: rgba(255,255,255,.2); }
.avatar { border-radius: 50%; background: #fff; color: var(--brand); border: 1px solid rgba(255,255,255,.5); display: inline-grid; place-items: center; font-weight: 600; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.menu-flutuante { position: absolute; top: 40px; right: 0; width: 240px; background: var(--surface); color: var(--fg); border: 1px solid var(--borda); border-radius: var(--raio-g); box-shadow: var(--sombra-menu); padding: 4px; z-index: 60; }
.menu-flutuante button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: var(--raio); cursor: pointer; text-align: left; }
.menu-flutuante button:hover { background: var(--hover); }
.menu-cab { padding: 8px 10px 10px; border-bottom: 1px solid var(--borda); margin-bottom: 4px; }

.corpo { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 0; }
.nav { background: var(--bg2); border-right: 1px solid var(--borda); min-height: 0; overflow: auto; }
.nav-lista { padding: 8px; display: grid; gap: 1px; align-content: start; }
.nav-item { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 10px; border-radius: var(--raio); color: var(--fg2); position: relative; cursor: pointer; }
.nav-item:hover { background: var(--hover); text-decoration: none; }
.nav-item.ativo { background: #e9e7e5; font-weight: 600; color: var(--fg); }
.nav-item.ativo::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--brand); }
.nav-item span:first-of-type { flex: 1; }
.nav-badge { background: var(--erro-forte); color: #fff; border-radius: 9px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.nav-sep { font-size: 12px; font-weight: 600; color: var(--fg3); padding: 16px 10px 4px; }
.principal { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.pagina { flex: 1; overflow: auto; padding: 20px 28px 40px; min-height: 0; }
.pagina.cheia { padding: 0; overflow: hidden; display: flex; flex-direction: column; background: var(--surface); }
.pg-cab { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.pg-cab h1 { font-size: 20px; line-height: 28px; }
.pg-cab h2 { font-size: 16px; }
.pg-cab .sub { color: var(--fg3); }
.acoes { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.carregando { flex: 1; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--press); border-top-color: var(--brand); border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- painéis e métricas (planos) ---------- */
.painel { background: var(--surface); border: 1px solid var(--borda); }
.painel > header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--borda); min-height: 44px; }
.painel > header h2 { font-size: 14px; line-height: 20px; }
.painel > header a { font-size: 13px; }
.painel > .painel-corpo { padding: 16px; }
.painel-corpo.form { display: grid; gap: 14px; }
.painel table.dados th { background: var(--surface); }
.painel table.dados tr:last-child td { border-bottom: 0; }
.metricas { display: flex; background: var(--surface); border: 1px solid var(--borda); margin-bottom: 16px; overflow-x: auto; }
.metrica { flex: 1 1 0; min-width: 190px; padding: 14px 20px; border-left: 1px solid var(--borda); }
.metrica:first-child { border-left: 0; }
.m-t { font-size: 12px; color: var(--fg3); }
.m-v { font-size: 22px; line-height: 30px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }
.m-v.neg { color: var(--erro-forte); }
.m-d { font-size: 12px; color: var(--fg3); }
.duas-colunas { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.duas-colunas > * { min-width: 0; }
.painel { overflow: hidden; } .painel > table.dados, .painel > div > table.dados { display: table; }
.coluna { display: grid; gap: 16px; }
@media (max-width: 1100px) { .duas-colunas { grid-template-columns: 1fr; } }
.alerta-fila { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 16px; background: var(--aviso-bg); border: 1px solid #f3d98b; color: #5c3d00; }
.alerta-fila span { flex: 1; } .alerta-fila:hover { text-decoration: none; background: #ffefb5; }
.barra-seg { display: flex; height: 6px; overflow: hidden; background: var(--press); margin: 4px 0 12px; }
.barra-seg span { display: block; height: 100%; }
.legenda { display: grid; gap: 6px; }
.legenda div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.legenda i { width: 10px; height: 10px; display: inline-block; margin-right: 8px; }

/* ---------- tabelas ---------- */
.tabela-wrap { background: var(--surface); border: 1px solid var(--borda); overflow: auto; }
.painel .tabela-wrap { border: 0; }
table.dados { width: 100%; border-collapse: collapse; }
table.dados th { text-align: left; font-weight: 600; font-size: 12px; color: var(--fg2); padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--borda2); white-space: nowrap; position: sticky; top: 0; z-index: 1; user-select: none; }
table.dados th.ord { cursor: pointer; } table.dados th.ord:hover { background: var(--hover); }
table.dados th .seta { font-size: 8px; margin-left: 6px; color: var(--fg3); }
table.dados td { padding: 8px 12px; border-bottom: 1px solid var(--linha); vertical-align: middle; }
table.dados tr:last-child td { border-bottom: 0; }
table.dados tbody tr.clicavel { cursor: pointer; }
table.dados tbody tr:hover td { background: var(--hover); }
table.dados tbody tr:focus-visible { outline-offset: -2px; }
table.dados .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.dados .acoes-cel { text-align: right; white-space: nowrap; }
.pessoa { display: flex; align-items: center; gap: 10px; }
.pessoa .avatar { background: #e1dfdd; color: var(--fg2); border: 0; }
.vazio { padding: 40px 16px; text-align: center; color: var(--fg3); }
.vazio .icon { color: var(--fg-off); margin-bottom: 8px; }
.vazio strong { display: block; color: var(--fg); font-size: 15px; margin-bottom: 4px; }
.barra-filtros { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.busca { position: relative; width: 320px; max-width: 100%; }
.busca .icon { position: absolute; left: 9px; top: 6px; color: var(--fg3); }
.busca input { padding-left: 34px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--borda2); background: var(--surface); border-radius: var(--raio); padding: 3px 12px; cursor: pointer; font-size: 13px; }
.chip:hover { background: var(--hover); } .chip.ativo { background: var(--brand-fraco); border-color: var(--brand); color: var(--brand-press); font-weight: 600; }
.filtro-ativo { display: inline-flex; align-items: center; gap: 8px; padding: 2px 4px 2px 10px; background: var(--brand-fraco); border: 1px solid var(--brand-borda); margin-bottom: 12px; }

.badge { display: inline-flex; align-items: center; padding: 0 8px; border-radius: var(--raio-p); font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap; }
.badge.neutro { background: #edebe9; color: var(--fg2); } .badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.aviso { background: var(--aviso-bg); color: var(--aviso); }
.badge.erro { background: #fdd8db; color: var(--erro); } .badge.info { background: var(--info-bg); color: var(--info); }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 300; }
.toast { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--borda); border-left: 4px solid var(--brand); box-shadow: var(--sombra-menu); padding: 10px 14px; min-width: 260px; max-width: 420px; animation: entra .16s ease-out; }
.toast.erro { border-left-color: var(--erro-forte); } .toast.erro .icon { color: var(--erro-forte); }
.toast.ok { border-left-color: var(--ok); } .toast.ok .icon { color: var(--ok); }
.toast.saindo { opacity: 0; transition: opacity .2s; }
@keyframes entra { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- diálogos ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: grid; place-items: center; z-index: 100; padding: 16px; }
.overlay.lateral { place-items: stretch end; padding: 0; }
.dlg { background: var(--surface); border-radius: 12px; box-shadow: var(--sombra-dlg); display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.dlg.lateral { height: 100vh; max-height: none; border-radius: 0; animation: lateral .18s ease-out; }
@keyframes lateral { from { transform: translateX(32px); opacity: .4; } to { transform: none; opacity: 1; } }
.dlg-cab { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 24px; }
.dlg-cab h2 { font-size: 18px; line-height: 24px; }
.dlg-corpo { padding: 8px 24px 16px; overflow: auto; flex: 1; display: grid; gap: 14px; align-content: start; grid-auto-rows: max-content; }
.dlg-rod { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px 20px; }
.dlg.lateral .dlg-rod { border-top: 1px solid var(--borda); background: var(--bg2); padding-bottom: 12px; }
.dlg-texto { margin: 0; color: var(--fg2); }
.aviso-caixa { display: flex; gap: 10px; padding: 10px 12px; background: var(--aviso-bg); color: #5c3d00; border: 1px solid #f3d98b; }
.aviso-caixa.info { background: var(--info-bg); border-color: var(--brand-borda); color: var(--info); }
.aviso-caixa.erro { background: var(--erro-bg); border-color: #eeacb2; color: var(--erro); }
.aviso-caixa .icon { margin-top: 1px; }
.secao-titulo { font-size: 12px; font-weight: 600; color: var(--fg3); text-transform: uppercase; letter-spacing: .05em; margin-top: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--borda); }

.seg { display: inline-flex; border: 1px solid var(--borda-forte); border-radius: var(--raio); overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 5px 14px; cursor: pointer; border-right: 1px solid var(--borda2); }
.seg button:last-child { border-right: 0; } .seg button:hover { background: var(--hover); }
.seg button.ativo { background: var(--brand-fraco); color: var(--brand-press); font-weight: 600; box-shadow: inset 0 -2px 0 var(--brand); }
.dropzone { border: 1.5px dashed var(--borda-forte); padding: 28px 16px; text-align: center; color: var(--fg3); cursor: pointer; background: var(--bg2); }
.dropzone:hover, .dropzone.sobre { border-color: var(--brand); background: var(--brand-fraco); color: var(--brand-press); }
.dropzone strong { display: block; color: var(--fg); }
.dropzone .icon { margin-bottom: 6px; }
.tabela-mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabela-mini td, .tabela-mini th { padding: 5px 8px; border-bottom: 1px solid var(--borda); text-align: left; }
.tabela-mini .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- perfil, acessos, perfis ---------- */
.perfil-foto { display: flex; gap: 20px; align-items: center; }
.perfil-foto .avatar { background: var(--brand-fraco); border: 1px solid var(--brand-borda); }
.perfil-foto-acoes { display: grid; gap: 6px; justify-items: start; }
.acessos-lista { border: 1px solid var(--borda); max-height: 340px; overflow: auto; }
.acesso-linha { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--linha); cursor: pointer; }
.acesso-linha:hover { background: var(--hover); }
.acesso-linha.nivel { padding-left: 38px; background: var(--bg2); }
.acesso-linha.herdado { opacity: .6; }
.acesso-t { font-weight: 600; }
.perfis-legenda { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--borda); }
.perfil-card { padding: 10px 14px; border-left: 1px solid var(--borda); display: grid; gap: 2px; align-content: start; }
.perfil-card:first-child { border-left: 0; }
.perfil-card span { font-size: 12px; color: var(--fg3); }

/* ---------- paleta de pesquisa (Ctrl+K) ---------- */
.overlay.paleta-ov { place-items: start center; padding-top: 12vh; background: rgba(0,0,0,.25); z-index: 150; }
.paleta { width: min(640px, 100%); background: var(--surface); box-shadow: var(--sombra-dlg); border-radius: 12px; overflow: hidden; }
.paleta-campo { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--borda); color: var(--fg3); }
.paleta-campo input { border: 0; box-shadow: none; min-height: 48px; font-size: 15px; padding: 0; }
.paleta-campo input:focus { border: 0; box-shadow: none; }
.paleta-lista { max-height: 52vh; overflow: auto; padding: 4px 0 8px; }
.paleta-grupo { font-size: 12px; font-weight: 600; color: var(--fg3); padding: 8px 16px 4px; }
.paleta-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; border: 0; background: none; cursor: pointer; text-align: left; }
.paleta-item.sel { background: var(--brand-fraco); box-shadow: inset 3px 0 0 var(--brand); }
.paleta-item .icon { color: var(--fg3); }
.pal-t { font-weight: 600; } .pal-s { color: var(--fg3); font-size: 12px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paleta-item .pal-t + .badge { margin-left: auto; }

/* ---------- menu de contexto ---------- */
.ctx { position: fixed; z-index: 250; min-width: 240px; background: var(--surface); border: 1px solid var(--borda); border-radius: var(--raio-g); box-shadow: var(--sombra-menu); padding: 4px; }
.ctx-titulo { padding: 6px 10px 4px; font-size: 12px; font-weight: 600; color: var(--fg3); border-bottom: 1px solid var(--borda); margin-bottom: 4px; }
.ctx-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: var(--raio); cursor: pointer; text-align: left; }
.ctx-item:hover:not(:disabled), .ctx-item:focus-visible { background: var(--hover); outline: none; }
.ctx-item:disabled { color: var(--fg-off); cursor: default; }
.ctx-item span:not(.ctx-vazio) { flex: 1; }
.ctx-item.perigo { color: var(--erro-forte); }
.ctx-vazio { width: 16px; }
.ctx-sep { height: 1px; background: var(--borda); margin: 4px 0; }

/* ---------- editor de orçamento ---------- */
.ed-topo { background: var(--surface); border-bottom: 1px solid var(--borda); padding: 12px 24px 0; }
.ed-titulo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ed-titulo h1 { font-size: 20px; line-height: 28px; }
.ed-titulo .meta { color: var(--fg3); }
.ed-kpis { display: flex; gap: 0; margin: 10px 0 0; overflow-x: auto; }
.ed-kpi { padding: 4px 24px 8px 0; margin-right: 24px; border-right: 1px solid var(--borda); white-space: nowrap; }
.ed-kpi:last-child { border-right: 0; }
.ed-kpi .t { font-size: 12px; color: var(--fg3); } .ed-kpi .v { font-size: 18px; line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ed-kpi .v.pos { color: var(--ok); } .ed-kpi .v.neg { color: var(--erro-forte); }
.abas { display: flex; gap: 4px; margin-top: 6px; }
.aba { border: 0; background: none; padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--fg2); display: inline-flex; gap: 6px; align-items: center; }
.aba:hover { background: var(--hover); } .aba.ativa { border-bottom-color: var(--brand); font-weight: 600; color: var(--fg); }
.ed-cmd { display: flex; align-items: center; gap: 4px; padding: 6px 24px; background: var(--surface); border-bottom: 1px solid var(--borda); flex-wrap: wrap; }
.ed-cmd .sep { width: 1px; height: 22px; background: var(--borda); margin: 0 6px; }
.ed-corpo { flex: 1; min-height: 0; overflow: auto; position: relative; background: var(--surface); }
.ed-rodape { padding: 4px 24px; font-size: 12px; color: var(--fg3); background: var(--bg2); border-top: 1px solid var(--borda); display: flex; justify-content: space-between; }

table.grade { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
table.grade th { position: sticky; top: 0; z-index: 3; background: #f3f2f1; color: var(--fg2); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--borda2); border-right: 1px solid var(--borda); text-align: center; white-space: nowrap; height: 34px; }
table.grade th.g-venda { background: #e6eef7; } table.grade th.g-custo { background: #f5ebdc; } table.grade th.g-pag { background: #e5f1e6; }
table.grade td { border-bottom: 1px solid var(--borda); border-right: 1px solid #efefef; padding: 0; height: 30px; background: var(--surface); }
table.grade td.c { padding: 0 8px; white-space: nowrap; } table.grade td.n { text-align: right; font-variant-numeric: tabular-nums; padding: 0 8px; white-space: nowrap; }
table.grade .st-1 { position: sticky; left: 0; z-index: 2; } table.grade .st-2 { position: sticky; left: 64px; z-index: 2; box-shadow: 1px 0 0 var(--borda2); }
table.grade th.st-1, table.grade th.st-2 { z-index: 4; }
table.grade input, table.grade select { border: 0; border-radius: 0; background: transparent; min-height: 29px; height: 29px; padding: 0 8px; width: 100%; font-size: 13px; }
table.grade input:focus, table.grade select:focus { outline: 2px solid var(--brand); outline-offset: -2px; background: #fff; border: 0; padding-bottom: 0; position: relative; z-index: 1; }
table.grade input.n { text-align: right; font-variant-numeric: tabular-nums; }
table.grade input.invalido { background: #fdd8db; }
table.grade select { appearance: none; -webkit-appearance: none; cursor: pointer; font-size: 12px; }
table.grade tr.sel td { background: #e9f2fb !important; }
table.grade tr.sel td.st-1 { box-shadow: inset 3px 0 0 var(--brand); }
table.grade tr.grupo td { background: #323130; color: #fff; font-weight: 600; }
table.grade tr.grupo input { color: #fff; font-weight: 600; } table.grade tr.grupo input:focus { color: var(--fg); }
table.grade tr.subgrupo td { background: #edebe9; font-weight: 600; }
table.grade tr.subgrupo input { font-weight: 600; }
table.grade tr.sub-sg td { background: #deecf9; font-weight: 600; border-top: 1px solid var(--brand-borda); }
table.grade tr.sub-g td { background: #c7e0f4; font-weight: 600; }
table.grade tr.total td { background: var(--brand); color: #fff; font-weight: 600; font-size: 14px; height: 36px; }
table.grade td.idx { font-family: var(--mono); font-size: 12px; color: var(--fg3); text-align: center; cursor: pointer; user-select: none; }
table.grade tr.grupo td.idx { color: #d2d0ce; } table.grade tr.total td.idx { color: #fff; }
table.grade td.cus { background: #fffdf5; } table.grade tr.item:hover td { background-color: #faf9f8; }
table.grade td.cus.in { background: #fffbe6; }
table.grade td.neg, table.grade .neg { color: var(--erro-forte); }
table.grade td.pagbtn { text-align: center; width: 36px; }
.gbtn { border: 0; background: none; cursor: pointer; color: var(--brand); padding: 3px; border-radius: var(--raio); display: inline-grid; place-items: center; }
.gbtn:hover { background: var(--brand-fraco); } .gbtn:disabled { color: var(--fg-off); cursor: default; background: none; }
.so-leitura table.grade input, .so-leitura table.grade select { pointer-events: none; }
.param { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg2); }
.param input { width: 74px; text-align: right; min-height: 26px; padding: 0 6px; }

.info-job { padding: 24px; max-width: 980px; display: grid; gap: 16px; }
.resumo-wrap { padding: 24px; max-width: 1080px; }

/* ---------- ficha de solicitação (impressão) ---------- */
.ficha { background: #fff; color: #000; width: 100%; max-width: 780px; margin: 0 auto; font-size: 13px; }
.ficha h2 { text-align: center; font-size: 18px; letter-spacing: .06em; margin: 4px 0 2px; }
.ficha .sub { text-align: center; color: #555; margin-bottom: 12px; }
.ficha .bloco { border: 1px solid #000; margin-bottom: 10px; }
.ficha .bloco > .tit { background: #323130; color: #fff; font-weight: 700; padding: 4px 8px; letter-spacing: .04em; }
.ficha .linha { display: grid; grid-template-columns: repeat(12, 1fr); border-top: 1px solid #bbb; }
.ficha .linha:first-of-type { border-top: 0; }
.ficha .cel { padding: 5px 8px; border-left: 1px solid #bbb; min-height: 28px; min-width: 0; overflow-wrap: anywhere; }
.ficha .cel.nw { white-space: nowrap; overflow-wrap: normal; }
.ficha .s1 { grid-column: span 1; } .ficha .s5 { grid-column: span 5; }
.ficha .cel:first-child { border-left: 0; }
.ficha .cel b { font-weight: 600; color: #444; margin-right: 4px; }
.ficha .s12 { grid-column: span 12; } .ficha .s8 { grid-column: span 8; } .ficha .s6 { grid-column: span 6; } .ficha .s4 { grid-column: span 4; } .ficha .s3 { grid-column: span 3; } .ficha .s2 { grid-column: span 2; }
.ficha .assin { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 48px 24px 12px; }
.ficha .assin div { border-top: 1px solid #000; text-align: center; padding-top: 4px; }
.ficha .assin small { display: block; color: #555; }
@media print {
  body { background: #fff; }
  body > *:not(.overlay):not(script), .overlay > .dlg > .dlg-cab, .overlay > .dlg > .dlg-rod { display: none !important; }
  .overlay { position: static; background: none; padding: 0; display: block; }
  .dlg { box-shadow: none; max-height: none; width: auto !important; }
  .dlg-corpo { overflow: visible; padding: 0; }
  @page { margin: 14mm; }
}


.ed-topo { background: var(--surface); }
/* ---------- responsivo ---------- */
@media (max-width: 900px) {
  .corpo { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .nav { border-right: 0; border-bottom: 1px solid var(--borda); overflow-x: auto; }
  .nav-lista { display: flex; padding: 4px 8px; } .nav-sep { display: none; } .nav-item { flex: none; }
  .busca-topo span, .busca-topo kbd { display: none; } .busca-topo { flex: 0 0 36px; justify-content: center; margin-left: auto; padding: 0; }
  .app-nome { display: none; }
  .pagina { padding: 16px; }
  .login-caixa { padding: 32px 24px; }
  .linha-campos.c2, .linha-campos.c3 { grid-template-columns: 1fr; }
}

/* ---------- anexos e resumo do item ---------- */
.resumo-item { padding: 12px 16px; background: var(--bg2); border: 1px solid var(--borda); }
.anexos { display: grid; gap: 4px; }
.anexo { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--borda); background: var(--surface); }
.anexo .icon { color: var(--fg3); }
.anexo-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.clipe { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; color: var(--fg3); font-size: 12px; vertical-align: middle; }
@media print { .nao-imprime { display: none !important; } }

/* ======================================================================
   v4 — login Microsoft, notificações, gráficos, permissões, colar, tema
   ====================================================================== */
:root { --link: #0f6cbd; --serie: #0f6cbd; --st-ok: #107c10; --st-aviso: #c19c00; --st-info: #0f6cbd; --st-erro: #c50f1f;
  --grade-cab: #f3f2f1; --grade-venda: #e6eef7; --grade-custo: #f5ebdc; --grade-pag: #e5f1e6; --grade-sel: #e9f2fb;
  --grade-grupo: #323130; --grade-grupo-fg: #ffffff; --grade-sub: #edebe9; --grade-subt: #deecf9; --grade-subtg: #c7e0f4;
  --grade-cus: #fffdf5; --grade-cus-in: #fffbe6; --grade-hover: #faf9f8; --nav-ativo: #e9e7e5; }
a { color: var(--link); }

/* entrada da página e esqueleto de carregamento */
.entra { animation: entraPg .14s ease-out; }
@keyframes entraPg { from { transform: translateY(3px); } to { transform: none; } }
.esq { background: linear-gradient(90deg, var(--hover) 25%, var(--press) 37%, var(--hover) 63%); background-size: 400% 100%; animation: brilho 1.3s ease infinite; border-radius: var(--raio); margin-bottom: 14px; }
.esq-titulo { height: 28px; width: 260px; } .esq-faixa { height: 84px; } .esq-bloco { height: 220px; } .esq-bloco.curto { height: 120px; width: 60%; }
@keyframes brilho { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .esq, .entra, .toast, .dlg.lateral { animation: none; } }

/* login Microsoft (botão no padrão oficial de entrada com conta Microsoft) */
.btn-ms { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 41px; margin: 4px 0 6px; background: #fff; color: #5e5e5e; border: 1px solid #8c8c8c; border-radius: var(--raio); font: 600 15px var(--fonte); cursor: pointer; }
.btn-ms:hover:not(:disabled) { background: #f3f3f3; }
.btn-ms:disabled { opacity: .6; cursor: progress; }
.login-dominios { font-size: 12px; color: var(--fg3); margin: 4px 0 0; }
.login-ou { display: flex; align-items: center; gap: 10px; color: var(--fg3); font-size: 12px; margin: 18px 0 10px; }
.login-ou::before, .login-ou::after { content: ""; flex: 1; height: 1px; background: var(--borda); }
.login-erro.info { background: var(--info-bg); border-color: var(--brand-borda); color: var(--info); }
.login-caixa .login-erro { margin-bottom: 12px; }

/* barra superior: ações à direita, sino */
.topo-acoes { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.busca-topo + .topo-acoes { margin-left: 0; }
.topo-acoes .conta { margin-left: 0; }
.topo-icone { position: relative; width: 40px; height: 40px; border: 0; background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer; border-radius: var(--raio); }
.topo-icone:hover { background: rgba(255,255,255,.16); }
.sino { position: relative; }
.sino-badge { position: absolute; top: 5px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #d13438; color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.sino-painel { position: absolute; right: 0; top: 44px; width: 380px; max-width: calc(100vw - 16px); background: var(--surface); color: var(--fg); border: 1px solid var(--borda); border-radius: var(--raio-g); box-shadow: var(--sombra-menu); z-index: 60; }
.sino-cab { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--borda); min-height: 44px; }
.sino-lista { max-height: 60vh; overflow: auto; }
.sino-item { display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--borda); background: none; cursor: pointer; color: inherit; }
.sino-item:hover { background: var(--hover); }
.sino-ponto { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: transparent; }
.sino-item.nova .sino-ponto { background: var(--link); }
.sino-txt { display: grid; gap: 2px; min-width: 0; }
.sino-t { font-weight: 600; } .sino-item:not(.nova) .sino-t { font-weight: 400; }
.sino-d { font-size: 12px; color: var(--fg2); } .sino-q { font-size: 11px; color: var(--fg3); }
.carregando-mini { display: grid; place-items: center; padding: 24px; }

/* gráficos (série única; cor validada para claro e escuro) */
.barras-h { display: grid; gap: 8px; }
.barra-linha { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; align-items: center; gap: 10px; padding: 2px 0; border-radius: 2px; cursor: default; }
.barra-linha:hover .barra, .barra-linha:focus .barra { filter: brightness(1.12); }
.barra-rot { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg2); font-size: 13px; }
.barra-trilho { height: 10px; position: relative; }
.barra { display: block; height: 10px; background: var(--serie); border-radius: 0 4px 4px 0; min-width: 2px; }
.barra-val { font-size: 12px; color: var(--fg2); font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.colunas { display: grid; gap: 6px; }
.colunas-area { height: 168px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; align-items: end; border-bottom: 1px solid var(--borda2); padding: 18px 4px 0;
  background-image: linear-gradient(var(--borda) 1px, transparent 1px); background-size: 100% 25%; background-position: 0 18px; }
.coluna-slot { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; cursor: default; }
.col-barra { display: block; width: min(26px, 70%); background: var(--serie); border-radius: 4px 4px 0 0; }
.coluna-slot:hover .col-barra, .coluna-slot:focus .col-barra { filter: brightness(1.12); }
.coluna-val { font-size: 12px; color: var(--fg2); margin-bottom: 4px; white-space: nowrap; }
.colunas-eixo { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; padding: 0 4px; text-align: center; font-size: 12px; color: var(--fg3); }
.grafico-dica { position: fixed; z-index: 400; pointer-events: none; background: var(--surface); color: var(--fg); border: 1px solid var(--borda); box-shadow: var(--sombra-menu); padding: 8px 10px; font-size: 12px; display: grid; gap: 2px; border-radius: var(--raio); }
.duas-colunas + .duas-colunas { margin-top: 16px; }

/* matriz de permissões */
table.matriz td.centro, table.matriz th.centro { text-align: center; width: 120px; }
table.matriz tr.grupo-linha td { background: var(--bg2); font-size: 12px; font-weight: 600; color: var(--fg3); text-transform: uppercase; letter-spacing: .05em; padding: 6px 12px; }
table.matriz td.mudou { background: var(--aviso-bg) !important; }
table.matriz input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; }
table.matriz input:disabled { cursor: not-allowed; }
.ajustado { color: var(--link); font-weight: 700; margin-left: 4px; }
.perfil-card.link { color: var(--link); text-decoration: none; }
.perfil-card.link:hover { background: var(--hover); }

/* colar do Excel */
.colar-area { min-height: 130px; font-family: var(--mono); font-size: 12px; white-space: pre; }
.colar-resumo { padding: 8px 12px; background: var(--info-bg); color: var(--info); border: 1px solid var(--brand-borda); }
.colar-tab { max-height: 280px; }
.colar-tab select.mapa { min-height: 28px; font-size: 12px; padding: 2px 6px; min-width: 120px; }
.colar-tab td { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
tr.cab-ignorada td { color: var(--fg-off); text-decoration: line-through; }

/* escolha de tema */
.tema-ops { display: grid; gap: 8px; }
.tema-op { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--borda2); cursor: pointer; border-radius: var(--raio); }
.tema-op.sel { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.tema-op > span:last-child { display: grid; }
.tema-amostra { width: 64px; height: 40px; border: 1px solid var(--borda2); display: grid; grid-template-columns: 14px 1fr; grid-template-rows: 10px 1fr; flex: none; }
.tema-amostra span:nth-child(1) { grid-column: 1 / 3; } .tema-amostra.claro { background: #fff; } .tema-amostra.claro span:nth-child(1) { background: #0f6cbd; } .tema-amostra.claro span:nth-child(2) { background: #faf9f8; }
.tema-amostra.escuro { background: #292929; } .tema-amostra.escuro span:nth-child(1) { background: #0c3b5e; } .tema-amostra.escuro span:nth-child(2) { background: #1f1f1f; }
.tema-amostra.sistema { background: linear-gradient(135deg, #fff 50%, #292929 50%); } .tema-amostra.sistema span:nth-child(1) { background: #0f6cbd; }

/* grade: cores via variáveis (para o tema escuro) */
table.grade th { background: var(--grade-cab); }
table.grade th.g-venda { background: var(--grade-venda); } table.grade th.g-custo { background: var(--grade-custo); } table.grade th.g-pag { background: var(--grade-pag); }
table.grade tr.sel td { background: var(--grade-sel) !important; }
table.grade tr.grupo td { background: var(--grade-grupo); color: var(--grade-grupo-fg); }
table.grade tr.grupo input { color: var(--grade-grupo-fg); }
table.grade tr.subgrupo td { background: var(--grade-sub); }
table.grade tr.sub-sg td { background: var(--grade-subt); }
table.grade tr.sub-g td { background: var(--grade-subtg); }
table.grade td.cus { background: var(--grade-cus); } table.grade td.cus.in { background: var(--grade-cus-in); }
table.grade tr.item:hover td { background-color: var(--grade-hover); }
table.grade td { border-right-color: var(--borda); }
.nav-item.ativo { background: var(--nav-ativo); }

/* ======================================================================
   Tema escuro (tons do Fluent / Microsoft 365 escuro)
   ====================================================================== */
:root[data-theme="dark"] {
  color-scheme: dark;
  --topo: #0c3b5e;
  --brand: #115ea3; --brand-hover: #0f6cbd; --brand-press: #0f548c; --brand-fraco: #082338; --brand-borda: #0e4775;
  --link: #479ef5; --serie: #3a8ee6;
  --fg: #ffffff; --fg2: #d6d6d6; --fg3: #adadad; --fg-off: #707070;
  --bg: #1f1f1f; --bg2: #242424; --surface: #292929; --hover: #333333; --press: #3d3d3d;
  --borda: #3d3d3d; --borda2: #525252; --borda-forte: #757575;
  --ok: #54b054; --ok-bg: #052505; --aviso: #f9e2ae; --aviso-bg: #3d2e00; --erro: #f1707b; --erro-bg: #3b0509; --erro-forte: #dc626d;
  --info: #96c6fa; --info-bg: #082338;
  --st-ok: #54b054; --st-aviso: #d2b100; --st-info: #3a8ee6; --st-erro: #dc626d;
  --sombra-menu: 0 0 2px rgba(0,0,0,.5), 0 8px 16px rgba(0,0,0,.6);
  --sombra-dlg: 0 0 8px rgba(0,0,0,.5), 0 32px 64px rgba(0,0,0,.7);
  --grade-cab: #2e2e2e; --grade-venda: #1b2a3a; --grade-custo: #33291b; --grade-pag: #1c2e1f; --grade-sel: #0e2c47;
  --grade-grupo: #141414; --grade-grupo-fg: #ffffff; --grade-sub: #333333; --grade-subt: #15324d; --grade-subtg: #0e2c47;
  --grade-cus: #2b2920; --grade-cus-in: #302c1c; --grade-hover: #303030; --nav-ativo: #383838;
}
:root[data-theme="dark"] .btn.primario:disabled { background: #3d3d3d; border-color: #3d3d3d; color: #8a8a8a; }
:root[data-theme="dark"] .badge.neutro { background: #3d3d3d; color: #d6d6d6; }
:root[data-theme="dark"] .badge.erro { background: #3b0509; color: #f1707b; }
:root[data-theme="dark"] .aviso-caixa { color: var(--aviso); border-color: #6b5200; }
:root[data-theme="dark"] .aviso-caixa.erro { border-color: #6e0811; color: var(--erro); }
:root[data-theme="dark"] .alerta-fila { color: var(--aviso); border-color: #6b5200; }
:root[data-theme="dark"] .alerta-fila:hover { background: #4a3800; }
:root[data-theme="dark"] .login { background: #1f1f1f; }
:root[data-theme="dark"] .login-caixa { box-shadow: 0 2px 6px rgba(0,0,0,.6); }
:root[data-theme="dark"] .app-tile { background: #fff; }
:root[data-theme="dark"] .avatar { background: #292929; color: #479ef5; border-color: rgba(255,255,255,.3); }
:root[data-theme="dark"] .pessoa .avatar { background: #3d3d3d; color: #d6d6d6; }
:root[data-theme="dark"] table.grade tr.total td { background: #0f548c; }
:root[data-theme="dark"] table.grade input:focus, :root[data-theme="dark"] table.grade select:focus { background: #1f1f1f; }
:root[data-theme="dark"] table.grade td.idx { color: #9e9e9e; }
:root[data-theme="dark"] .btn.excel .icon { color: #54b054; }
:root[data-theme="dark"] .dlg { border: 1px solid #3d3d3d; }
:root[data-theme="dark"] .overlay { background: rgba(0,0,0,.6); }

/* ======================================================================
   v5 — período do painel, coautoria, versões, extração
   ====================================================================== */
.pq { min-height: 28px !important; padding-top: 2px; padding-bottom: 2px; font-size: 13px; }
select.pq { width: auto; padding-right: 26px; }
input.pq { width: 150px; }
.seg.pq button { padding: 3px 10px; font-size: 13px; }
.filtro-periodo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 14px; }
.filtro-periodo .intervalo { display: inline-flex; align-items: center; gap: 6px; }
.sep-v { width: 1px; height: 22px; background: var(--borda2); margin: 0 4px; }
.coluna-slot.destaque .col-barra { background: var(--serie); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--serie); }
.coluna-slot:not(.destaque) .col-barra { opacity: .78; }
.painel > header .acoes { gap: 6px; }

/* coautoria: quem mais está no documento e onde */
.co-presenca { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.co-pessoa { display: inline-flex; }
.co-pessoa .avatar { background: var(--surface); }
table.grade tr.co-linha td.st-1 { box-shadow: inset 3px 0 0 var(--co); }
table.grade td.co-cel { position: relative; outline: 2px solid var(--co); outline-offset: -2px; z-index: 1; }
.co-tag { position: absolute; left: -2px; top: -16px; z-index: 5; color: #fff; font-size: 11px; font-weight: 600; line-height: 16px; padding: 0 6px; border-radius: 2px 2px 2px 0;
  white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; pointer-events: none; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
table.grade tbody tr:first-child .co-tag { top: auto; bottom: -16px; border-radius: 0 2px 2px 2px; }
table.grade td.conflito { outline: 2px solid var(--erro-forte) !important; outline-offset: -2px; }

/* versões: comparação */
.comp-tot td, .comp-tot th { padding: 6px 10px; }
.comp-tot .pos { color: var(--ok); font-weight: 600; } .comp-tot .neg { color: var(--erro-forte); font-weight: 600; }
.comp-lista { display: grid; gap: 0; border: 1px solid var(--borda); max-height: 46vh; overflow: auto; }
.comp-item { padding: 8px 12px; border-bottom: 1px solid var(--borda); border-left: 3px solid transparent; }
.comp-item:last-child { border-bottom: 0; }
.comp-item.novo { border-left-color: var(--st-ok); } .comp-item.removido { border-left-color: var(--st-erro); } .comp-item.alterado { border-left-color: var(--st-aviso); }
.comp-cab { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comp-val { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--fg2); font-size: 13px; }
.comp-campos { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; font-size: 13px; }
.comp-campos del { color: var(--erro); text-decoration: line-through; } .comp-campos ins { color: var(--ok); text-decoration: none; font-weight: 600; }

/* extrair dados */
.extrair-grade { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .extrair-grade { grid-template-columns: 1fr; } }
.extrair-conjuntos { display: grid; gap: 8px; }
.ext-op { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--borda2); cursor: pointer; border-radius: var(--raio); }
.ext-op:hover { background: var(--hover); }
.ext-op.sel { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-fraco); }
.ext-op input { margin-top: 3px; }
.ext-op .icon { color: var(--link); margin-top: 1px; }
.ext-op > span { display: grid; gap: 2px; }

/* ======================================================================
   v6 — login com marca, menu recolhível, navegação inferior, rolagem
   ====================================================================== */
.login { position: relative; overflow: hidden; }
.login-marca { position: absolute; right: -6vw; bottom: -8vh; width: min(62vw, 720px); height: auto; pointer-events: none; }
.login-marca .c-o { fill: var(--oggi); fill-opacity: .14; } .login-marca .c-n { fill: var(--fg); fill-opacity: .05; }
.login-caixa { position: relative; z-index: 1; border-radius: var(--raio-g); }
.login-caixa img.logo { width: 168px; margin: -14px 0 0 -45px; }
.login-app { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg3); margin: -4px 0 18px; }
.login-rodape { position: relative; z-index: 1; }
.btn-ms { border-radius: var(--raio); transition: background-color .12s; }
.btn-ms.ocupado { cursor: progress; }
.btn-ms.ocupado span::after { content: "…"; }
:root[data-theme="dark"] .btn-ms { background: #fff; color: #5e5e5e; }
/* movimento do login: bolhas sobem em sequência (como as da logo) e flutuam; o cartão entra em cascata */
.login-marca circle { transform-box: fill-box; transform-origin: center; opacity: 0; animation: bolhaSobe .9s cubic-bezier(.2,.8,.2,1) forwards, bolhaFlutua 9s ease-in-out 1s infinite alternate; }
.login-marca circle:nth-child(2) { animation-delay: .12s, 1.4s; animation-duration: .9s, 11s; }
.login-marca circle:nth-child(3) { animation-delay: .24s, 1.8s; animation-duration: .9s, 13s; }
.login-marca circle:nth-child(4) { animation-delay: .36s, 2.2s; animation-duration: .9s, 15s; }
@keyframes bolhaSobe { from { opacity: 0; transform: translateY(40px) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes bolhaFlutua { from { transform: none; } to { transform: translate(-6px, -14px); } }
.login-caixa { animation: entra .5s cubic-bezier(.2,.8,.2,1) both; }
.login-caixa > * { animation: entra .45s cubic-bezier(.2,.8,.2,1) both; }
.login-caixa > :nth-child(2) { animation-delay: .06s; } .login-caixa > :nth-child(3) { animation-delay: .12s; }
.login-caixa > :nth-child(4) { animation-delay: .18s; } .login-caixa > :nth-child(5) { animation-delay: .24s; }
.login-caixa > :nth-child(n+6) { animation-delay: .3s; }
.btn-ms { transition: transform .15s, box-shadow .15s; }
.btn-ms:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.btn-ms:active:not(:disabled) { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .login-marca circle { animation: none; opacity: 1; }
  .login-caixa, .login-caixa > * { animation: none; }
  .btn-ms:hover:not(:disabled) { transform: none; }
}
.login-rodape a { color: inherit; }
/* página da política de uso (estática) */
.politica { min-height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 32px 16px; background: var(--bg); }
.politica-caixa { width: min(720px, 100%); background: var(--surface); padding: 32px 40px 36px; border-radius: var(--raio-g); box-shadow: 0 2px 6px rgba(0,0,0,.12); line-height: 1.6; animation: entra .45s cubic-bezier(.2,.8,.2,1) both; }
.politica-caixa img.logo { width: 120px; margin: 12px 0 4px -32px; }
.politica-caixa h1 { font-size: 26px; line-height: 34px; margin: 0; }
.politica-caixa h2 { font-size: 16px; margin: 24px 0 6px; }
.politica-caixa p, .politica-caixa ul { margin: 0 0 8px; color: var(--fg2); }
.politica-caixa ul { padding-left: 20px; } .politica-caixa li { margin-bottom: 4px; }
.politica-versao { font-size: 12.5px; color: var(--fg3) !important; margin-bottom: 20px !important; }
.politica-caixa > .politica-versao:last-child { margin: 28px 0 0 !important; padding-top: 12px; border-top: 1px solid var(--borda); }
.politica-voltar { font-size: 13px; color: var(--link); text-decoration: none; } .politica-voltar:hover { text-decoration: underline; }
@media (max-width: 600px) { .politica-caixa { padding: 24px 20px; } }
@media (prefers-reduced-motion: reduce) { .politica-caixa { animation: none; } }
.login-cadastro { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--fg3); padding-top: 12px; border-top: 1px solid var(--borda); }
.login-cadastro strong { color: var(--fg2); font-weight: 600; }
.login-senha { position: relative; }
.login-senha input { padding-right: 40px; }
.login-olho { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 36px; height: 32px; border: 0; background: none; color: var(--fg3); cursor: pointer; display: grid; place-items: center; border-radius: var(--raio); }
.login-olho:hover { color: var(--fg); background: var(--hover); } .login-olho.ativo { color: var(--brand); }
.login-caixa .login-olho { min-height: 0; margin: 0; min-width: 0; }
.login-caps { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--aviso); margin-top: -8px; }

/* menu lateral recolhível */
.nav { display: flex; flex-direction: column; }
.nav-lista { flex: 1; }
.nav-pe { padding: 8px; border-top: 1px solid var(--borda); }
.nav-recolher { display: flex; align-items: center; gap: 12px; width: 100%; height: 36px; padding: 0 10px; border: 0; background: none; color: var(--fg3); cursor: pointer; border-radius: var(--raio); text-align: left; }
.nav-recolher:hover { background: var(--hover); color: var(--fg); }
.nav-item .nav-rot { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.corpo { transition: grid-template-columns .16s ease; }
.app.nav-recolhida { --nav-w: 56px; }
.app.nav-recolhida .nav-rot { display: none; }
.app.nav-recolhida .nav-item, .app.nav-recolhida .nav-recolher { justify-content: center; padding: 0; }
.app.nav-recolhida .nav-sep { height: 1px; background: var(--borda); padding: 0; margin: 10px 6px; }
.app.nav-recolhida .nav-item .nav-badge { position: absolute; top: 2px; right: 4px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
.app.nav-recolhida .nav-recolher .icon { transform: scaleX(-1); }

/* navegação inferior (celular) */
.nav-inferior { display: none; }
@media (max-width: 900px) {
  .app { grid-template-rows: var(--topo-h) 1fr auto; }
  .corpo { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .nav { display: none; }
  .nav-inferior { display: grid; grid-template-columns: repeat(5, 1fr); position: relative; z-index: 45; background: var(--surface); border-top: 1px solid var(--borda); padding-bottom: env(safe-area-inset-bottom); }
  .nav-inf-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 56px; border: 0; background: none; color: var(--fg3); font-size: 11px; cursor: pointer; position: relative; }
  .nav-inf-item:hover { text-decoration: none; background: var(--hover); }
  .nav-inf-item.ativo { color: var(--brand); font-weight: 600; }
  .nav-inf-item.ativo::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 2px 2px; background: var(--brand); }
  :root[data-theme="dark"] .nav-inf-item.ativo { color: var(--link); }
  .nav-inf-ic { position: relative; display: grid; }
  .nav-inf-ic .nav-badge { position: absolute; top: -6px; left: 14px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
  .folha-mais { position: absolute; right: 8px; bottom: calc(100% + 8px); width: min(280px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--borda); border-radius: var(--raio-g); box-shadow: var(--sombra-menu); padding: 4px; display: grid; }
  .folha-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: none; color: var(--fg); border-radius: var(--raio); cursor: pointer; text-align: left; font-size: 14px; }
  .folha-item:hover { background: var(--hover); text-decoration: none; }
  .folha-item.ativo { background: var(--brand-fraco); color: var(--brand-press); font-weight: 600; }
  .toasts { bottom: 72px; }
  .login-marca { width: 120vw; right: -40vw; bottom: -20vh; }
}

/* barras de rolagem finas (Fluent) */
/* Chrome/Edge ignoram ::-webkit-scrollbar quando scrollbar-width existe: a regra padrão fica só para o Firefox */
/* azul da marca com brilho em degradê (cilindro), mais vivo ao passar o mouse — não se confunde com as faixas pretas da planilha */
:root { --sb-a: #5aa2e6; --sb-b: #0f6cbd; --sb-c: #0c4f8a; --sb-brilho: rgba(15,108,189,.35); --sb-trilho: rgba(15,108,189,.06); }
:root[data-theme="dark"] { --sb-a: #8cc2fa; --sb-b: #479ef5; --sb-c: #1f6fc0; --sb-brilho: rgba(71,158,245,.45); --sb-trilho: rgba(71,158,245,.08); }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: auto; scrollbar-color: var(--sb-b) var(--sb-trilho); } }
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: var(--sb-trilho); border-radius: 999px; }
::-webkit-scrollbar-thumb { border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; min-height: 40px; min-width: 40px; }
::-webkit-scrollbar-thumb:vertical { background-image: linear-gradient(90deg, var(--sb-a), var(--sb-b) 55%, var(--sb-c)); }
::-webkit-scrollbar-thumb:horizontal { background-image: linear-gradient(180deg, var(--sb-a), var(--sb-b) 55%, var(--sb-c)); }
::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { border-width: 2px; box-shadow: 0 0 6px 1px var(--sb-brilho), inset 0 0 0 1px rgba(255,255,255,.35); }
::-webkit-scrollbar-thumb:vertical:hover, ::-webkit-scrollbar-thumb:vertical:active { background-image: linear-gradient(90deg, #8cc2fa, var(--sb-b) 50%, var(--sb-c)); }
::-webkit-scrollbar-thumb:horizontal:hover, ::-webkit-scrollbar-thumb:horizontal:active { background-image: linear-gradient(180deg, #8cc2fa, var(--sb-b) 50%, var(--sb-c)); }
::-webkit-scrollbar-corner { background: transparent; }

/* contraste no escuro */
:root[data-theme="dark"] .chip.ativo, :root[data-theme="dark"] .seg button.ativo { background: #0e2c47; border-color: var(--link); color: #cfe4fa; }
:root[data-theme="dark"] .seg button.ativo { box-shadow: inset 0 -2px 0 var(--link); }
:root[data-theme="dark"] .paleta-item.sel { background: #0e2c47; box-shadow: inset 3px 0 0 var(--link); }
:root[data-theme="dark"] .nav-item.ativo::before { background: var(--link); }

/* painel: indicadores em grade (quebram em 2×2 no celular), gráfico com rótulo dentro da barra */
.metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--borda); overflow: visible; }
.metrica { background: var(--surface); border-left: 0; min-width: 0; }
.m-v { overflow: hidden; text-overflow: ellipsis; }
.col-barra { position: relative; }
.col-barra .coluna-val { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); margin: 0; font-weight: 600; color: var(--fg); }
.colunas-area { padding-top: 24px; background-position: 0 24px; }
.painel > header { flex-wrap: wrap; gap: 8px; }
td.duas-linhas { max-width: 0; width: 100%; }
td.duas-linhas .l1, td.duas-linhas .l2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.recentes td { padding-top: 7px; padding-bottom: 7px; }
@media (max-width: 900px) {
  .metricas { grid-template-columns: 1fr 1fr; }
  .metrica { padding: 12px 14px; } .metrica:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .m-v { font-size: 18px; line-height: 26px; }
  .filtro-periodo .sep-v { display: none; }
  .pg-cab .acoes .btn { flex: 1 1 auto; }
}

/* editor: indicadores quebram em vez de rolar; ação de pagamento só na linha em foco */
.ed-kpis { flex-wrap: wrap; overflow: visible; row-gap: 6px; }
.ed-param { font-size: 12px; color: var(--fg3); padding: 0 8px; border-left: 1px solid var(--borda2); white-space: nowrap; }
table.grade td.pagbtn .gbtn { opacity: 0; transition: opacity .1s; }
table.grade tr:hover td.pagbtn .gbtn, table.grade tr.sel td.pagbtn .gbtn, table.grade td.pagbtn .gbtn:focus-visible { opacity: 1; }
@media (hover: none) { table.grade td.pagbtn .gbtn { opacity: 1; } }
table.grade select:not(:disabled) { padding-right: 22px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%23707070' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; background-size: 12px; }
:root[data-theme="dark"] table.grade select:not(:disabled) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%23adadad' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ed-cmd { row-gap: 4px; }
.ed-cmd .chip { padding: 2px 10px; }
@media (max-width: 900px) {
  .ed-topo { padding: 10px 16px 0; }
  .ed-cmd { padding: 6px 12px; }
  .ed-kpi { padding-right: 14px; margin-right: 14px; }
  .ed-kpi .v { font-size: 15px; }
  .abas { overflow-x: auto; }
  .aba { flex: none; }
  .ed-param { display: none; }
}
.ed-kpi { padding-right: 18px; margin-right: 18px; }
.ed-cmd { gap: 2px; }
.ed-cmd .btn.sutil { padding: 0 8px; }
.ed-cmd .sep { margin: 0 4px; }
.ed-cmd .chip + .chip { margin-left: 4px; }
@media (max-width: 1600px) { .ed-cmd .cmd-rot { display: none; } }
.resumo-wrap { max-width: 1240px; }
td.resumo-nome { white-space: nowrap; }

/* listas: contagem nos filtros, linhas canceladas esmaecidas, células sem quebra */
.chip { display: inline-flex; align-items: center; gap: 6px; }
.chip-n { font-size: 11px; font-weight: 600; color: var(--fg3); background: var(--hover); border-radius: 8px; padding: 0 6px; line-height: 16px; min-width: 18px; text-align: center; }
.chip-n:empty { display: none; }
.chip.ativo .chip-n { background: var(--surface); color: var(--brand-press); }
:root[data-theme="dark"] .chip.ativo .chip-n { background: #082338; color: #cfe4fa; }
table.dados tr.esmaecida td { color: var(--fg3); }
table.dados tr.esmaecida td strong, table.dados tr.esmaecida .badge { opacity: .75; }
td.nw, .nw { white-space: nowrap; }
.relativo { white-space: nowrap; }
.busca { width: 300px; }

/* pagamentos: faixa de resumo por situação */
.faixa-status { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--borda); border: 1px solid var(--borda); margin-bottom: 14px; }
.faixa-item { display: grid; gap: 2px; text-align: left; padding: 12px 16px; background: var(--surface); border: 0; cursor: pointer; position: relative; color: var(--fg); }
.faixa-item::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--cor); }
.faixa-item:hover { background: var(--hover); }
.faixa-item.ativo { background: var(--brand-fraco); box-shadow: inset 0 0 0 1px var(--brand); }
:root[data-theme="dark"] .faixa-item.ativo { background: #0e2c47; box-shadow: inset 0 0 0 1px var(--link); }
.faixa-rot { font-size: 12px; color: var(--fg3); }
.faixa-val { font-size: 18px; line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.faixa-n { font-size: 12px; color: var(--fg3); }
.acoes-linha { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; white-space: nowrap; }
.motivo { color: var(--erro); max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) { .faixa-status { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .faixa-status { grid-template-columns: 1fr 1fr; } .faixa-item:first-child { grid-column: 1 / -1; } }

/* usuários: regra de cadastro Microsoft e legenda de perfis recolhível */
.cfg-cadastro { margin-bottom: 12px; }
.cfg-linha { display: flex; align-items: center; gap: 14px; padding: 12px 16px; flex-wrap: wrap; }
.cfg-linha > .icon { color: var(--link); flex: none; }
.cfg-texto { flex: 1 1 360px; display: grid; gap: 2px; min-width: 0; }
.cfg-op { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.perfis-det { margin-bottom: 14px; }
.perfis-det > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--link); font-weight: 600; font-size: 13px; padding: 4px 0; list-style: none; user-select: none; }
.perfis-det > summary::-webkit-details-marker { display: none; }
.perfis-det > summary .icon { transition: transform .12s; }
.perfis-det[open] > summary .icon { transform: rotate(90deg); }
.perfis-det .perfis-legenda { margin: 8px 0 0; }
.perfis-legenda { gap: 1px; background: var(--borda); } .perfil-card { background: var(--surface); border-left: 0; }

/* ======================================================================
   v7 — cantos arredondados (Fluent 2: controles 6px, cartões 10px, diálogos 12px)
   ====================================================================== */
.painel, .tabela-wrap, .metricas, .faixa-status, .perfis-legenda, .login-caixa, .acessos-lista, .comp-lista,
.resumo-item, .dropzone, .aviso-caixa, .alerta-fila, .colar-resumo, .login-erro { border-radius: var(--raio-g); }
.painel, .metricas, .faixa-status, .perfis-legenda, .acessos-lista, .comp-lista { overflow: hidden; }
.painel .tabela-wrap, .painel > .tabela-wrap { border-radius: 0; }
.anexo, .filtro-ativo, .tema-amostra, .seg, .chip-n { border-radius: var(--raio); }
.seg button:first-child { border-radius: calc(var(--raio) - 1px) 0 0 calc(var(--raio) - 1px); }
.seg button:last-child { border-radius: 0 calc(var(--raio) - 1px) calc(var(--raio) - 1px) 0; }
.chip { border-radius: 999px; padding-left: 12px; padding-right: 12px; }
.chip-n { border-radius: 999px; }
.faixa-item:first-child::before { border-top-left-radius: var(--raio-g); }
.faixa-item:last-child::before { border-top-right-radius: var(--raio-g); }
.menu-flutuante, .sino-painel, .ctx, .folha-mais, .grafico-dica { border-radius: var(--raio-g); }
.toast { border-radius: var(--raio-g); }
.nav-item, .nav-recolher, .menu-flutuante button, .ctx-item, .paleta-item, .sino-item, .folha-item { border-radius: var(--raio); }
.paleta-lista { padding: 4px 6px 8px; }
.barra-seg { border-radius: 999px; }
.barra { border-radius: 0 999px 999px 0; }
.col-barra { border-radius: 6px 6px 0 0; }
.avatar { border-radius: 50%; }
/* login: campos com borda inteira e cantos, no lugar do sublinhado */
.login-caixa { padding: 40px 40px 32px; box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 12px 32px rgba(0,0,0,.10); border: 1px solid var(--borda); }
.login-caixa input { min-height: 40px; border: 1px solid var(--borda-forte); border-radius: var(--raio); padding: 6px 12px; background: var(--surface); }
.login-caixa input:focus { border: 1px solid var(--brand); box-shadow: inset 0 0 0 1px var(--brand); padding-bottom: 6px; }
.login-caixa .btn, .login-caixa .btn-ms { min-height: 40px; }
.login-olho { right: 2px; }
.btn, input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=number], select, textarea { border-radius: var(--raio); }
table.grade input, table.grade select { border-radius: 0; }

/* logos: versão clara e versão para o tema escuro (círculos pretos viram brancos) */
.so-escuro { display: none !important; }
:root[data-theme="dark"] .so-claro { display: none !important; }
:root[data-theme="dark"] .so-escuro { display: block !important; }
.app-tile { border-radius: var(--raio); }
.app-tile img { width: 28px; height: 28px; }
:root[data-theme="dark"] .app-tile { background: rgba(255,255,255,.08); }
:root { --linha: #edebe9; }
:root[data-theme="dark"] { --linha: #333333; }
.barra-filtros select.pq { min-height: 32px !important; }
@media (max-width: 900px) {
  .ed-titulo { gap: 6px 10px; }
  .ed-titulo h1 { font-size: 18px; line-height: 24px; }
  .ed-titulo .meta { font-size: 13px; flex-basis: 100%; order: 5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ed-kpis, .ed-cmd { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ed-kpis::-webkit-scrollbar, .ed-cmd::-webkit-scrollbar { display: none; }
  .ed-kpi { flex: none; }
  .ed-cmd > * { flex: none; }
  .ed-cmd .btn.sutil { font-size: 13px; }
}

/* ======================================================================
   v8 — varredura: cores sem ambiguidade, animações, notificações
   ====================================================================== */
:root[data-theme="light"] { color-scheme: light; }

/* Status dos jobs (ciclo de vida) — cada cor tem um só significado no sistema:
   cinza = rascunho · azul = aprovado · roxo = em produção · verde = concluído · contorno = cancelado.
   Amarelo = precisa de ação (aguardando aprovação) · vermelho = problema (rejeitado, negativo, conflito). */
.badge.producao { background: #efe8f7; color: #5c2e91; }
.badge.cancelado { background: transparent; color: var(--fg3); box-shadow: inset 0 0 0 1px var(--borda2); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
:root[data-theme="dark"] .badge.producao { background: #2c1f45; color: #c9b0ef; }
:root[data-theme="dark"] .badge.cancelado { color: var(--fg3); box-shadow: inset 0 0 0 1px var(--borda2); text-decoration-color: rgba(255,255,255,.3); }
.badge { gap: 6px; }

/* Planilha: seleção bem visível e subtotais neutros (antes eram dois azuis quase iguais) */
:root { --grade-subt: #f3f4f6; --grade-subtg: #e6e9ee; --grade-sel: #cfe4fa; }
:root[data-theme="dark"] { --grade-grupo: #3b3b3b; --grade-sub: #2f2f2f; --grade-subt: #262a30; --grade-subtg: #2e343c; --grade-sel: #123c63; }
table.grade tr.sub-sg td { border-top: 1px solid var(--borda2); }
table.grade tr.sub-g td { border-top: 1px solid var(--borda-forte); }
table.grade tr.sel td.st-1 { box-shadow: inset 4px 0 0 var(--brand); }
:root[data-theme="dark"] table.grade tr.sel td.st-1 { box-shadow: inset 4px 0 0 var(--link); }
:root[data-theme="dark"] table.grade tr.grupo td { border-bottom-color: #4a4a4a; }

/* Animações curtas e discretas (padrão Fluent: 100–200 ms, sem exagero) */
@keyframes surge { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes surgeMenu { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes surgeBaixo { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes esmaece { from { opacity: 0; } to { opacity: 1; } }
.overlay { animation: esmaece .14s ease-out; }
.overlay:not(.lateral):not(.paleta-ov) > .dlg { animation: surge .16s cubic-bezier(.1,.9,.2,1); }
.paleta { animation: surge .14s cubic-bezier(.1,.9,.2,1); }
.menu-flutuante:not([hidden]), .sino-painel:not([hidden]), .ctx { animation: surgeMenu .12s ease-out; }
.folha-mais:not([hidden]) { animation: surgeBaixo .14s ease-out; }
.toast { animation: surgeBaixo .18s cubic-bezier(.1,.9,.2,1); }
.toast.saindo { opacity: 0; transform: translateX(12px); transition: opacity .18s, transform .18s; }
.btn, .chip, .nav-item, .faixa-item, .aba, .seg button { transition: background-color .1s, border-color .1s, color .1s, box-shadow .1s; }
.btn:active:not(:disabled) { transform: translateY(1px); }

/* Notificações */
@keyframes pulsa { 0% { box-shadow: 0 0 0 0 rgba(209,52,56,.55); } 70% { box-shadow: 0 0 0 8px rgba(209,52,56,0); } 100% { box-shadow: 0 0 0 0 rgba(209,52,56,0); } }
.sino-badge.pulsa { animation: pulsa 1.4s ease-out 2; }
.toast { align-items: flex-start; padding: 10px 8px 10px 14px; }
.toast > .icon { margin-top: 1px; }
.toast-txt { flex: 1; display: grid; gap: 2px; min-width: 0; }
.toast-txt strong { font-weight: 600; }
.toast-txt span:empty { display: none; }
.toast.clicavel { cursor: pointer; }
.toast.clicavel:hover { background: var(--hover); }
.toast.info > .icon { color: var(--link); }
.toast-x { border: 0; background: none; color: var(--fg3); cursor: pointer; padding: 2px; border-radius: var(--raio-p); display: grid; place-items: center; }
.toast-x:hover { background: var(--press); color: var(--fg); }
.sino-item.nova { background: var(--brand-fraco); }
.sino-item.nova:hover { background: var(--hover); }
:root[data-theme="dark"] .sino-item.nova { background: #0b2033; }

@media (prefers-reduced-motion: reduce) {
  .overlay, .overlay > .dlg, .paleta, .menu-flutuante, .sino-painel, .ctx, .folha-mais, .toast, .sino-badge.pulsa { animation: none !important; }
  .toast.saindo, .corpo { transition: none; }
  .btn:active:not(:disabled) { transform: none; }
}

/* logo do cliente */
.logo-cli { display: inline-grid; place-items: center; flex: none; border-radius: var(--raio); background: color-mix(in srgb, var(--cor) 14%, var(--surface)); color: var(--cor); font-weight: 700; letter-spacing: .02em; overflow: hidden; border: 1px solid var(--borda); }
.logo-cli.com-logo { background: #fff; border-color: var(--borda); padding: 2px; }
.logo-cli img { width: 100%; height: 100%; object-fit: contain; display: block; }
:root[data-theme="dark"] .logo-cli:not(.com-logo) { background: color-mix(in srgb, var(--cor) 26%, var(--surface)); color: #fff; }
.cli-nome { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cli-txt { min-width: 0; }
.cli-txt .l1, .cli-txt .l2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-rot { display: flex; align-items: center; gap: 8px; }
.barra-rot > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.ed-titulo .logo-cli { margin-left: 2px; }
.logo-campo { display: flex; gap: 16px; align-items: center; padding: 12px; border: 1px solid var(--borda); border-radius: var(--raio-g); background: var(--bg2); }
.logo-previa { width: 96px; height: 96px; flex: none; display: grid; place-items: center; background: #fff; border: 1.5px dashed var(--borda-forte); border-radius: var(--raio-g); cursor: pointer; overflow: hidden; padding: 6px; }
.logo-previa:hover, .logo-previa.sobre { border-color: var(--brand); background: var(--brand-fraco); }
.logo-previa img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-vazio { display: grid; justify-items: center; gap: 4px; font-size: 12px; color: var(--fg3); }
.logo-acoes { display: grid; gap: 4px; min-width: 0; }
.logo-acoes .acoes { margin-top: 4px; }
