/* HG FISCAL — mesmo design system do HG CORE (DESIGN_SYSTEM.md) + grade densa para os analistas fiscais. */
: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; }

/* ===== HG FISCAL: densidade operacional (§35) ===== */
.sidebar .navitem { padding: 6px 11px; font-size: 12px; }
.sidebar .navitem.plan { opacity: .62; }
.sidebar .navitem .fase { margin-left: auto; font-size: 9.5px; color: #7886ac; }
.navgroup { margin: 14px 10px 4px; cursor: pointer; display: flex; justify-content: space-between; }
.navgroup::after { content: "▾"; }
.navgroup.fechado::after { content: "▸"; }
.ctx { display: flex; align-items: center; gap: 6px; }
.ctx .comp { display: flex; align-items: center; border: 1px solid var(--field); border-radius: 8px; overflow: hidden; }
.ctx .comp button { border: 0; background: var(--surface); color: var(--muted); padding: 8px 9px; }
.ctx .comp button:hover { color: var(--accent); }
.ctx .comp input { border: 0; width: 92px; text-align: center; background: var(--surface); color: var(--text); padding: 8px 0; }
table.densa th { padding: 8px 10px; position: sticky; top: 0; z-index: 1; }
table.densa td { padding: 6px 10px; font-size: 12.5px; vertical-align: middle; white-space: nowrap; }
table.densa td.num, table.densa th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.densa tr.sel td { background: var(--soft) !important; }
table.densa tr.cancelada td { color: var(--muted); text-decoration: line-through; }
.tablewrap.alta { max-height: calc(100vh - 290px); }
.tablefoot .tot { display: flex; gap: 18px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.tablefoot .tot b { color: var(--text); }
.abas { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 12px; flex-wrap: wrap; }
.abas button { border: 0; background: transparent; padding: 9px 13px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.abas button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.modalbox.largo { max-width: 1100px; }
.kbd { font-family: ui-monospace, Consolas, monospace; font-size: 10.5px; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--muted); }
.etapas { list-style: none; margin: 0; padding: 0; }
.etapas li { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--line); font-size: 13px; }
.etapas li small { color: var(--muted); margin-left: auto; }
.barra { height: 6px; background: var(--line); border-radius: 9px; overflow: hidden; min-width: 80px; }
.barra i { display: block; height: 100%; background: linear-gradient(90deg, #156cec, #7838e8); }
.drop { border: 2px dashed var(--field); border-radius: 12px; padding: 34px; text-align: center; color: var(--muted); background: var(--surface); }
.drop.sobre { border-color: var(--accent); background: var(--soft); }
.colmenu { position: absolute; right: 18px; top: 56px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; z-index: 6; box-shadow: 0 8px 30px #0002; }
.colmenu label { display: flex; gap: 7px; align-items: center; font-size: 12.5px; padding: 3px 0; }
.planejado { max-width: 720px; }
.panel.rel { position: relative; } .search.cfop { width: 84px; flex: none; min-width: 0; } .detail h2.mt { margin-top: 18px; }
.barra i { width: 0; }

/* ---- HG CONTÁBIL 0.2.0 */
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.grid3{display:grid;grid-template-columns:150px minmax(0,1fr) 180px;gap:12px;margin-bottom:12px}
.grid2 .full,.grid3 .full{grid-column:1/-1}
.grid2 label,.grid3 label{display:flex;flex-direction:column;gap:4px;font-size:12.5px;font-weight:600}
.grid2 input,.grid2 select,.grid3 input,.partidas input,.partidas select,#f-reab textarea,.toolbar select{font:inherit;padding:7px 9px;border:1px solid var(--line,#d5d9e2);border-radius:8px;background:transparent;color:inherit}
.partidas{width:100%;margin:6px 0}
.partidas td{padding:4px 6px;vertical-align:top}
.partidas .c-conta{width:100%}.partidas .c-valor{width:130px;text-align:right}.partidas .c-cc{width:110px}
.partidas .c-nome{display:block;font-size:11.5px;opacity:.7;margin-top:2px}
table.lancs tr.cabl td{border-top:1px solid var(--line,#d5d9e2);padding-top:8px}
table.lancs tr.part td{padding-top:2px;padding-bottom:2px;opacity:.92}
tr.invertido td{background:rgba(229,72,77,.06)}
b.ok{color:#1f9d63}b.bad{color:#d33}
#soma{margin-right:auto}

/* 0.2.1 — recuo da hierarquia por classe (a CSP bloqueia style= inline) */
td.niv-1 { padding-left: 8px !important; } td.niv-2 { padding-left: 22px !important; } td.niv-3 { padding-left: 36px !important; }
td.niv-4 { padding-left: 50px !important; } td.niv-5 { padding-left: 64px !important; } td.niv-6 { padding-left: 78px !important; }
td.niv-7 { padding-left: 92px !important; } td.niv-8 { padding-left: 106px !important; }
.navitem .fase { white-space: nowrap; }
#t-emp { min-width: 300px; max-width: 420px; }
@media (max-width: 760px) {
  #t-emp { min-width: 0; max-width: none; flex: 1 1 0; width: 0; }
  .top { display: flex; flex-wrap: wrap; row-gap: 8px; padding: 8px 10px; } .top .spacer { display: block; } .top .ctx { order: 10; flex: 1 1 100%; display: flex; gap: 8px; min-width: 0; }
  .top .comp { flex: 0 0 auto; } .tablewrap { -webkit-overflow-scrolling: touch; }
}
