/* HG CORE — design system (DESIGN_SYSTEM.md): tokens claro/escuro, menu #11162A, Inter, raio 7–14 px. */
:root {
  --bg: #f4f6fb; --surface: #fff; --text: #17213a; --muted: #5d6981; --line: #e1e6f0; --field: #7a869b; --accent: #7139df;
  --blue: #007bff; --purple: #7838e8; --violet: #a78bfa; --silver: #e2e8f0; --soft: #f0ebff;
  --nav: #11162a; --navtext: #abb5d2; --navactive: #38256e; --shadow: 0 3px 16px #18234508;
  --ok: #16834e; --warn: #a6630a; --err: #c0263d; --info: #1d5fd1;
}
body.dark {
  --bg: #0b0e19; --surface: #161a2e; --text: #f1f4ff; --muted: #a6afca; --line: #2a314a; --accent: #a78bfa;
  --soft: #292147; --shadow: none; --field: #6b779c; --ok: #6ee7aa; --warn: #f9c971; --err: #ff8597; --info: #8ab4ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); font-family: Inter, "Segoe UI", Arial, sans-serif; color: var(--text); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button, a { cursor: pointer; }
a { color: inherit; text-decoration: none; }
a.link { color: var(--accent); }
a.link:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden], .oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ico { width: 17px; height: 17px; display: inline-block; flex: none; vertical-align: middle; stroke: currentColor; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }

/* estrutura */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--nav); color: #fff; padding: 24px 14px 18px; display: flex; flex-direction: column; position: sticky;
  top: 0; height: 100vh; overflow: auto; scrollbar-width: thin; scrollbar-color: #343b59 transparent; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 10px 24px; }
.mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: #fff; flex: none;
  background: linear-gradient(135deg, #007bff, #7838e8); font-weight: 800; letter-spacing: -1px; font-size: 20px; box-shadow: 0 4px 16px #7346ef50; }
.brand strong { font-size: 21px; letter-spacing: -.5px; }
.brand small { display: block; color: #aab4d0; font-size: 10px; letter-spacing: 1.1px; margin-top: 2px; }
.navgroup { color: #7886ac; font-size: 10px; font-weight: 700; letter-spacing: 1.25px; margin: 18px 10px 7px; }
.navitem { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 7px; color: var(--navtext); font-size: 12.5px; margin: 2px 0; }
.navitem:hover, .navitem.active { background: var(--navactive); color: #fff; }
.navitem.active { box-shadow: inset 3px 0 #a78bfa; }
.sidefoot { margin-top: auto; padding: 16px 10px 4px; color: #8794b6; font-size: 11px; line-height: 1.6; }
.top { height: 70px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px;
  padding: 0 30px; position: sticky; top: 0; z-index: 3; }
.top .search { flex: 1; max-width: 390px; position: relative; }
.search { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px;
  padding: 9px 12px; color: var(--muted); }
.search input { width: 100%; border: 0; background: transparent; outline: none; color: var(--text); min-width: 0; }
.top select, .toolbar select, .campo select { color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px; }
.top select { max-width: 200px; }
.spacer { flex: 1; }
.iconbtn { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--muted); position: relative; padding: 0; }
.iconbtn:hover { color: var(--accent); border-color: var(--accent); }
.badgecount { position: absolute; top: -5px; right: -5px; background: var(--err); color: #fff; border-radius: 999px; font-size: 10px;
  padding: 1px 5px; font-weight: 700; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--accent); font-weight: 700; }
.content { padding: 27px 30px 24px; max-width: 1650px; margin: auto; width: 100%; }
.crumb { font-size: 12px; color: var(--muted); display: flex; gap: 8px; margin-bottom: 17px; flex-wrap: wrap; }
.crumb b { color: var(--text); font-weight: 600; }
.header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.header h1 { font-size: 29px; letter-spacing: -.8px; margin: 0 0 7px; line-height: 1.14; }
.header p { margin: 0; color: var(--muted); line-height: 1.6; }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* botões e selos */
.primary, .secondary, .danger { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 15px;
  border-radius: 8px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.primary { border: 0; background: linear-gradient(115deg, #156cec, #7838e8); color: #fff; }
.secondary { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.secondary:hover { border-color: var(--accent); }
.danger { background: var(--surface); border: 1px solid var(--err); color: var(--err); }
.primary:disabled, .secondary:disabled, .danger:disabled { opacity: .55; cursor: default; }
.small { padding: 6px 10px; font-size: 12px; }
.status { display: inline-flex; gap: 5px; align-items: center; color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.status::before { content: "●"; }
.status.good { color: var(--ok); } .status.warn { color: var(--warn); } .status.bad { color: var(--err); } .status.info { color: var(--info); }
.pill { display: inline-flex; padding: 4px 8px; border-radius: 5px; background: var(--soft); color: var(--accent); font-size: 11px; font-weight: 600; }

/* avisos e estados */
.notice { display: flex; align-items: flex-start; gap: 9px; border: 1px solid var(--line); border-radius: 9px; padding: 11px 14px;
  background: var(--surface); font-size: 12.5px; color: var(--muted); margin-bottom: 19px; line-height: 1.55; }
.notice .dot { background: #9c7cf5; width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 5px; }
.notice.warn .dot { background: #e59a1a; } .notice.bad .dot { background: var(--err); } .notice.good .dot { background: #19a05c; }
.notice b { color: var(--text); }
.estado { padding: 42px 20px; text-align: center; color: var(--muted); }
.estado h3 { color: var(--text); margin: 8px 0 6px; font-size: 16px; }
.estado .secondary { margin-top: 12px; }
.carregando::after { content: ""; display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: gira .8s linear infinite; vertical-align: -2px; margin-left: 8px; }
@keyframes gira { to { transform: rotate(360deg); } }

/* home */
.hero { padding: 24px 26px; background: linear-gradient(105deg, #142754, #35206b 75%, #5127a0); color: #fff; border-radius: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; position: relative; overflow: hidden; margin-bottom: 20px; min-height: 142px; }
.hero::after { content: ""; position: absolute; right: -60px; top: -120px; width: 390px; height: 390px; border: 1px solid #ffffff2b;
  border-radius: 50%; box-shadow: 0 0 0 28px #ffffff07, 0 0 0 58px #ffffff08, 0 0 0 90px #ffffff06; pointer-events: none; }
.hero .tag { font-size: 11px; color: #c5c6ff; letter-spacing: 1.8px; font-weight: 600; }
.hero h2 { font-size: 28px; margin: 9px 0; letter-spacing: -.6px; }
.hero p { color: #d4d9f5; margin: 0; max-width: 620px; line-height: 1.6; }
.hero .emblem { font-size: 49px; font-weight: 800; letter-spacing: -3px; color: #d7d6ff; border: 1px solid #ffffff33; border-radius: 20px;
  padding: 18px; z-index: 1; margin-right: 20px; background: #ffffff10; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 23px; }
.metric, .panel, .tile { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow); }
.metric { padding: 17px; }
.metric small { color: var(--muted); font-size: 12px; }
.metric strong { display: block; font-size: 25px; letter-spacing: -.8px; margin-top: 8px; }
.metric .fonte { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.metric.nd strong { font-size: 16px; color: var(--muted); font-weight: 600; }
.sectiontitle { display: flex; justify-content: space-between; align-items: center; margin: 23px 0 12px; gap: 12px; }
.sectiontitle h2 { font-size: 17px; letter-spacing: -.2px; margin: 0; }
.sectiontitle span { font-size: 12px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { padding: 15px; display: flex; gap: 10px; align-items: center; min-height: 91px; transition: transform .15s, border-color .15s; position: relative; }
.tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.tile .modulemark { width: 40px; height: 40px; border-radius: 9px; background: var(--soft); color: var(--accent); display: grid; place-items: center;
  font-size: 12px; font-weight: 800; flex: none; }
.tile b { display: block; font-size: 12px; margin-bottom: 5px; line-height: 1.3; }
.tile small { color: var(--muted); font-size: 11px; line-height: 1.3; display: block; }
.tile .status { font-size: 10px; margin-top: 6px; }
.tile .fav { position: absolute; top: 8px; right: 8px; border: 0; background: transparent; color: var(--muted); font-size: 15px; padding: 2px 4px; }
.tile .fav.on { color: #e5a50a; }
.tile.bloqueado { opacity: .62; }

/* tabelas */
.panel { padding: 0; overflow: hidden; }
.toolbar { padding: 15px 18px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .search { max-width: 320px; flex: 1; min-width: 180px; }
.tablewrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th { background: var(--bg); color: var(--muted); font-size: 11px; letter-spacing: .35px; font-weight: 700; text-align: left; padding: 13px 17px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 17px; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.5; vertical-align: top; }
td.forte { font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--bg); }
tr.clicavel { cursor: pointer; }
td small { display: block; color: var(--muted); }
.tablefoot { padding: 13px 18px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); display: flex; justify-content: space-between;
  align-items: center; gap: 10px; }

/* ficha e formulários */
.detailgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.detail { padding: 21px; }
.detail h2 { margin: 0 0 14px; font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; padding: 11px 0; border-top: 1px solid var(--line); }
.field label { font-size: 12px; color: var(--muted); }
.field b { font-size: 14px; font-weight: 600; word-break: break-word; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.campo { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.campo label { font-size: 12.5px; font-weight: 600; }
.campo input, .campo textarea, .campo select { border: 1px solid var(--line); border-radius: 7px; background: var(--bg); padding: 10px; color: var(--text); width: 100%; }
.campo .ajuda { font-size: 11.5px; color: var(--muted); }
.campo.erro input, .campo.erro select { border-color: var(--err); }
.campo .msgerro { color: var(--err); font-size: 12px; }
.campo.check { flex-direction: row; align-items: center; }
.campo.check input { width: auto; }
.formerro { color: var(--err); font-size: 13px; margin: 8px 0; min-height: 1em; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.lista li:first-child { border-top: 0; }
.lista small { color: var(--muted); display: block; }
.permgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 16px; max-height: 50vh; overflow: auto; }
.permgrid label { display: flex; gap: 8px; align-items: center; font-size: 12.5px; padding: 4px 0; }

/* modal, toast, dropdown */
.modal { position: fixed; inset: 0; background: #0b0e19a6; display: grid; place-items: center; z-index: 20; padding: 20px; }
.modalbox { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; width: 100%; max-width: 680px;
  max-height: 90vh; overflow: auto; position: relative; }
.modalbox h2 { margin: 0 0 6px; font-size: 19px; }
.modalbox > p { color: var(--muted); margin: 0 0 14px; line-height: 1.55; }
.modalbox .fechar { position: absolute; top: 12px; right: 12px; }
.modalbox .rodape { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.toast { position: fixed; bottom: 20px; right: 20px; background: #202746; color: #fff; border-radius: 9px; padding: 14px 18px; z-index: 30;
  box-shadow: 0 5px 20px #0003; max-width: 440px; }
.toast.erro { background: #8c1d2f; }
.dropdown { position: absolute; top: 46px; left: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 30px #0002; padding: 8px; max-height: 380px; overflow: auto; width: 380px; z-index: 10; }
.dropdown h6 { margin: 8px 8px 4px; color: var(--muted); font-size: 10px; letter-spacing: 1px; }
.dropdown a { display: block; padding: 9px 10px; border-radius: 5px; font-size: 13px; color: var(--text); }
.dropdown a:hover, .dropdown a:focus { background: var(--soft); }
.dropdown small { color: var(--muted); }
.footer { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; margin-top: 28px; padding-top: 15px;
  border-top: 1px solid var(--line); flex-wrap: wrap; }

/* autenticação */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.authbrand { background: linear-gradient(150deg, #101b3a, #2c2261 70%, #572da8); color: #fff; padding: 60px; display: flex; flex-direction: column;
  justify-content: space-between; position: relative; overflow: hidden; }
.authbrand::before { content: ""; position: absolute; width: 630px; height: 630px; border: 1px solid #ffffff20; border-radius: 50%; right: -250px;
  top: 150px; box-shadow: 0 0 0 45px #ffffff08, 0 0 0 90px #ffffff07; }
.authbrand .brand { padding: 0; }
.authbrand h1 { font-size: 58px; letter-spacing: -2px; line-height: 1.08; max-width: 550px; margin: 20px 0; }
.authbrand p { color: #c8cce9; font-size: 18px; line-height: 1.6; max-width: 420px; }
.authbrand .biglogo { width: 130px; height: 130px; font-size: 58px; border-radius: 30px; }
.authbrand .lema { color: #b5b9db; font-size: 12px; letter-spacing: 1.5px; }
.authform { display: flex; justify-content: center; align-items: center; padding: 50px; background: var(--surface); }
.authform form, .authform .caixa { width: 100%; max-width: 380px; }
.authform h2 { font-size: 30px; letter-spacing: -.6px; margin: 20px 0 8px; }
.authform p { color: var(--muted); line-height: 1.6; margin: 0 0 18px; }
.authform label { display: block; font-weight: 600; font-size: 13px; margin: 16px 0 7px; }
.authform input { width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.authform .primary { width: 100%; margin-top: 20px; padding: 14px; }
.authlinks { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 17px; font-size: 13px; color: var(--accent); }
.authnote { font-size: 11px; color: var(--muted); margin-top: 30px; line-height: 1.6; }
.authmsg { color: var(--err); font-size: 13px; min-height: 1.3em; margin-top: 12px; }
.authmsg.ok { color: var(--ok); }

/* módulos */
.modulehero { padding: 28px; display: flex; align-items: center; gap: 20px; }
.modulehero .modulemark { width: 72px; height: 72px; background: var(--soft); border-radius: 16px; color: var(--accent); font-size: 24px;
  font-weight: 800; display: grid; place-items: center; flex: none; }
.modulehero h2 { margin: 0 0 8px; font-size: 25px; }
.modulehero p { margin: 0 0 10px; color: var(--muted); line-height: 1.5; }

/* menu recolhido e responsivo (1100 / 760) */
.collapsed .app { grid-template-columns: 76px 1fr; }
.collapsed .sidebar .brand div:last-child, .collapsed .sidebar .navgroup, .collapsed .sidebar .navitem span, .collapsed .sidebar .sidefoot { display: none; }
.collapsed .sidebar .brand { padding: 0 1px 15px; }
.collapsed .sidebar .navitem { justify-content: center; padding: 11px; }
@media (max-width: 1100px) {
  .app { grid-template-columns: 200px 1fr; } .tiles { grid-template-columns: repeat(3, 1fr); }
  .top { gap: 8px; padding: 0 18px; } .content { padding: 23px 18px; } .top select { max-width: 130px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 62px 1fr; } .sidebar { padding: 15px 7px; }
  .sidebar .brand div:last-child, .navgroup, .navitem span, .sidefoot { display: none; }
  .sidebar .brand { padding: 0 1px 15px; } .navitem { justify-content: center; padding: 10px; }
  .top { padding: 0 9px; flex-wrap: wrap; height: auto; min-height: 68px; gap: 6px; } .top .search { display: none; }
  .top select { max-width: 110px; } .content { padding: 16px 10px; } .header { flex-wrap: wrap; } .header h1 { font-size: 24px; }
  .tiles { grid-template-columns: 1fr 1fr; } .tile { padding: 10px; gap: 6px; } .tile .modulemark { width: 30px; height: 30px; }
  .hero { padding: 18px; } .hero .emblem { display: none; } .hero h2 { font-size: 22px; }
  .detailgrid, .formgrid { grid-template-columns: 1fr; } .auth { grid-template-columns: 1fr; } .authbrand { padding: 30px; }
  .authbrand h1 { font-size: 36px; } .authbrand .biglogo { width: 70px; height: 70px; font-size: 30px; } .authform { padding: 30px; }
  .modulehero { flex-wrap: wrap; } .metrics { gap: 8px; }
}
/* evita estouro horizontal: colunas da grade podem encolher */
.app > main { min-width: 0; }
.metrics, .tiles, .detailgrid, .formgrid { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.detailgrid, .formgrid { --cols: 2; }
@media (max-width: 1100px) { .tiles { --cols: 3; } .metrics { --cols: 2; } }
@media (max-width: 760px) { .tiles, .metrics { --cols: 2; } .detailgrid, .formgrid { --cols: 1; } .top select { min-width: 0; flex: 1 1 90px; } }
.tile > div { min-width: 0; } .tile .status { white-space: normal; } .tile b, .tile small { overflow-wrap: break-word; hyphens: auto; }

/* revisão BEZALEL: contorno de campos com contraste ≥ 3:1 (WCAG 1.4.11) */
.search, .top select, .toolbar select, .campo input, .campo select, .campo textarea, .authform input { border-color: var(--field); }
.search:focus-within { border-color: var(--blue); }
/* celular: menu vira gaveta com rótulos, aberta pelo botão ☰ */
.veu { display: none; }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 25; width: 264px; padding: 20px 12px; transform: translateX(-105%); transition: transform .18s; }
  body.menu-aberto .sidebar { transform: none; box-shadow: 0 0 40px #0008; }
  body.menu-aberto .veu { display: block; position: fixed; inset: 0; background: #0b0e1999; z-index: 24; }
  .sidebar .brand div:last-child, .navgroup, .navitem span, .sidefoot { display: revert; }
  .sidebar .brand { padding: 0 10px 20px; } .navitem { justify-content: flex-start; padding: 10px 11px; }
  .collapsed .app { grid-template-columns: 1fr; }
  .top { display: grid; grid-template-columns: auto 1fr 1fr auto auto auto; }
  .top .spacer { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 1100px) and (min-width: 761px) { .top .search { min-width: 170px; } }
.top .iconbtn, .top .avatar { flex: none; } .top select { min-width: 0; }
/* XML HUB dentro do CORE (0.5.0) */
.linha-fonte { display: flex; flex-direction: column; gap: 2px; padding: 3px 0; }
.linha-fonte + .linha-fonte { border-top: 1px dashed var(--line, #e2e8f0); }
.linha-fonte small.erro { color: var(--err); }

/* painel inicial no padrão do HG XML HUB (0.5.6) */
.banner-core { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 30px 32px; margin-bottom: 18px; border-radius: 22px; color: #fff; box-shadow: 0 10px 30px rgba(60, 30, 160, .18);
  background: radial-gradient(120% 160% at 0% 0%, #5b2fe0 0%, #2a1a9a 45%, #101a7a 100%); }
.banner-core::after { content: ""; position: absolute; right: -80px; top: -140px; width: 420px; height: 420px; border-radius: 50%;
  border: 1px solid #ffffff2b; box-shadow: 0 0 0 60px #ffffff08, 0 0 0 120px #ffffff05; }
.banner-core .tag { font-size: 11px; letter-spacing: 1.4px; font-weight: 700; color: #c9b8ff; }
.banner-core h2 { margin: 6px 0 6px; font-size: clamp(22px, 2.2vw, 32px); letter-spacing: -.5px; }
.banner-core p { margin: 0; color: #dcd4ff; max-width: 560px; line-height: 1.55; }
.banner-core .emblem { position: relative; z-index: 1; width: 86px; height: 86px; border-radius: 22px; display: grid; place-items: center; flex: none;
  font-size: 34px; font-weight: 800; letter-spacing: -1px; background: linear-gradient(135deg, #007bff, #7838e8); box-shadow: 0 8px 30px #7346ef70; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { position: relative; display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; min-height: 104px; box-shadow: 0 6px 24px rgba(40, 20, 120, .06); overflow: hidden; color: var(--text); }
a.kpi:hover { border-color: var(--violet); }
.kpi-ico { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; }
.kpi-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kpi.roxo .kpi-ico { background: #efe7ff; color: #7c3aed; } .kpi.verde .kpi-ico { background: #e3f6ea; color: #1f9d55; }
.kpi.lilas .kpi-ico { background: #e6f0ff; color: #2563eb; } .kpi.laranja .kpi-ico { background: #fff1e4; color: #f08a24; }
body.dark .kpi.roxo .kpi-ico, body.dark .kpi.lilas .kpi-ico { background: #2a2350; } body.dark .kpi.verde .kpi-ico { background: #12332a; } body.dark .kpi.laranja .kpi-ico { background: #3a2a18; }
.kpi-txt { position: relative; z-index: 1; min-width: 0; display: grid; }
.kpi-txt b { font-size: clamp(17px, 1.5vw, 25px); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-txt span { font-size: 13.5px; } .kpi-txt small { font-size: 12.5px; font-weight: 600; color: var(--accent); margin-top: 2px; }
.kpi-txt small.ok-txt, .ok-txt { color: var(--ok); } .kpi-txt small.err-txt, .err-txt { color: var(--err); }
.kpi .spark { position: absolute; right: 10px; top: 12px; width: 76px; height: 30px; opacity: .55; z-index: 0; }
@media (max-width: 1500px) { .kpi .spark { display: none; } }
.dash-grade { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1.1fr) minmax(0, .8fr);
  grid-template-areas: "graf int status" "ev acoes acoes"; gap: 16px; align-items: stretch; margin-bottom: 26px; }
.card-d { margin: 0; padding: 18px; border-radius: 16px; }
.painel-graf { grid-area: graf; display: flex; flex-direction: column; } .painel-int { grid-area: int; } .painel-status { grid-area: status; }
.painel-ev { grid-area: ev; } .painel-acoes { grid-area: acoes; }
.card-tit { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-tit h2 { display: flex; align-items: center; gap: 9px; font-size: 16px; margin: 0; }
.card-tit h2 .ico { width: 20px; height: 20px; color: var(--accent); }
.card-tit a { color: var(--accent); font-weight: 600; font-size: 13px; }
.grafico { width: 100%; flex: 1; min-height: 210px; display: block; }
.g-linha { stroke: var(--line); } .g-eixo { font-size: 11.5px; fill: var(--muted); } .g-area { fill: rgba(124, 58, 237, .16); }
.g-traco { fill: none; stroke: #7c3aed; stroke-width: 3; stroke-linejoin: round; }
.g-ponto { fill: #7c3aed; stroke: var(--surface); stroke-width: 2; } .g-ponto.vazio { fill: var(--surface); stroke: #a78bfa; } .g-vazio { font-size: 14px; fill: var(--muted); }
.hint-d { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
.int-linha { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); color: var(--text); }
.int-linha:hover b { color: var(--accent); } .int-linha:last-of-type { border-bottom: 0; }
.int-linha b { font-size: 14px; line-height: 1.2; } .int-linha small { grid-column: 2 / 4; color: var(--muted); font-size: 11.5px; }
.modulemark.mini { width: 30px; height: 30px; border-radius: 8px; background: var(--soft); color: var(--accent); display: grid; place-items: center;
  font-size: 11px; font-weight: 800; grid-row: span 2; }
.pill.ok { background: #e3f6ea; color: #1b7a43; } .pill.err { background: #fde8ea; color: #a8202a; } .pill.warn { background: #fff3dc; color: #8a5a00; }
body.dark .pill.ok { background: #12332a; color: var(--ok); } body.dark .pill.err { background: #3a1820; color: var(--err); } body.dark .pill.warn { background: #3a2a18; color: var(--warn); }
.fontes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.fontes small { width: 100%; color: var(--muted); font-size: 11.5px; }
.fonte-chip { font-size: 11.5px; padding: 4px 8px; border-radius: 999px; background: var(--soft); color: var(--text); }
.fonte-chip.err { background: #fde8ea; color: #a8202a; } body.dark .fonte-chip.err { background: #3a1820; color: var(--err); }
.anel { width: 100%; max-width: 200px; display: block; margin: 0 auto; }
.anel-fundo { fill: none; stroke: var(--soft); stroke-width: 16; } .anel-valor { fill: none; stroke: url(#gAnel); stroke-width: 16; stroke-linecap: round; }
.anel-num { font-size: 30px; font-weight: 800; fill: var(--text); } .anel-txt { font-size: 13px; fill: var(--muted); }
.anel-rodape { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.anel-rodape b { color: var(--text); }
.ev { display: grid; grid-template-columns: 12px 112px 1fr; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ev:last-child { border: 0; } .ev i { width: 10px; height: 10px; border-radius: 50%; align-self: center; }
.ev i.ok { background: #22a35a; } .ev i.err { background: #e11d48; } .ev i.warn { background: #e59a1a; } .ev-data { color: var(--muted); font-size: 12px; }
.painel-acoes { border-radius: 18px; padding: 16px 18px; color: #fff; background: radial-gradient(100% 140% at 0% 0%, #5b2fe0 0%, #2a1a9a 45%, #101a7a 100%);
  box-shadow: 0 10px 30px rgba(60, 30, 160, .25); }
.painel-acoes h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; margin: 0 0 12px; color: #fff; }
.painel-acoes h2 svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round; }
.acoes-grade { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.acoes-grade a { display: grid; justify-items: center; gap: 8px; padding: 16px 8px; border-radius: 14px; background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(190, 170, 255, .45); color: #fff; font-size: 14px; line-height: 1.2; text-align: center; }
.acoes-grade a:hover { background: rgba(255, 255, 255, .16); }
.acoes-grade svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 1350px) { .dash-grade { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); grid-template-areas: "graf graf" "int status" "ev ev" "acoes acoes"; } }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpis { grid-template-columns: minmax(0, 1fr); } .banner-core .emblem { display: none; }
  .dash-grade { grid-template-columns: minmax(0, 1fr); grid-template-areas: "graf" "int" "status" "ev" "acoes"; }
  .acoes-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ev { grid-template-columns: 12px minmax(0, 1fr); } .ev > :not(i) { grid-column: 2; } }

/* 0.5.7 — Importar XML (porta única) */
.imp-panel { padding: 20px; }
.imp-zona { display: grid; justify-items: center; gap: 6px; padding: 40px 20px; border: 2px dashed var(--line); border-radius: 14px;
  background: var(--bg); cursor: pointer; text-align: center; color: var(--text); }
.imp-zona:hover, .imp-zona.sobre { border-color: var(--accent); background: var(--soft); }
.imp-zona small { color: var(--muted); }
.imp-ico { width: 40px; height: 40px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#imp-res { margin-top: 14px; }
