/* Vision — tema claro com identidade azul e contraste para leitura contábil. */
[hidden] { display: none !important; }
:root {
  --bg: #f4f7fc;
  --bg-2: #edf3fb;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-solid: #ffffff;
  --panel-2: #f0f5fc;
  --row: rgba(238, 244, 252, 1);
  --row-hi: rgba(224, 236, 252, 1);
  --line: rgba(41, 78, 125, 0.16);
  --line-2: rgba(41, 78, 125, 0.30);
  --text: #172b49;
  --text-2: #465b78;
  --muted: #526681;
  --blue: #1964d1;
  --blue-2: #1455b7;
  --cyan: #145caa;
  --green: #10683f;
  --green-2: #10683f;
  --red: #b0233c;
  --amber: #8a5600;
  --purple: #7040c0;
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar: 220px;
  --topbar: 92px;
  --shadow: 0 10px 30px rgba(25, 57, 99, 0.10);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 75% -10%, rgba(25, 80, 180, 0.03), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(20, 90, 220, 0.02), transparent 60%),
    var(--bg);
  color: var(--text);
  font-size: 13.5px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
svg { display: block; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  grid-template-rows: var(--topbar) 1fr;
  grid-template-areas: 'side top' 'side main';
  min-height: 100vh;
}
.sidebar {
  grid-area: side;
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 60%, #edf4ff 100%);
  overflow: hidden;
  z-index: 20;
}
.brand { display: flex; justify-content: center; padding: 14px 18px 22px 12px; }
.brand img { width: 132px; height: auto; filter: drop-shadow(0 4px 10px rgba(25, 57, 99, 0.08)); }
.nav { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 0 12px; position: relative; z-index: 2; }
.nav a {
  display: flex; align-items: center; gap: 15px;
  height: 46px; padding: 0 10px 0 18px;
  border-radius: 10px 0 0 10px;
  color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap; letter-spacing: -0.1px;
  transition: background 0.15s, color 0.15s;
}
.nav a .ico { width: 22px; height: 22px; color: var(--text-2); }
.nav a:hover { background: rgba(47, 140, 255, 0.08); }
.nav a.active {
  background: linear-gradient(90deg, rgba(215, 232, 255, 1), rgba(233, 242, 255, 1));
  box-shadow: inset 0 0 0 1px rgba(80, 150, 255, 0.45), 0 0 18px rgba(47, 140, 255, 0.25);
  color: var(--text); font-weight: 700;
}
.nav a.active .ico { color: var(--text); }
.tagline {
  margin: auto 0 0; padding: 0 18px 70px 36px;
  font-size: 11px; letter-spacing: 3.6px; line-height: 1.75;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
  position: relative; z-index: 2;
}
.waves { position: absolute; left: 0; bottom: 120px; width: 100%; height: 420px; z-index: 1; pointer-events: none; }

.topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 22px;
  padding: 0 28px 0 0;
  position: sticky; top: 0; z-index: 15;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.94));
  backdrop-filter: blur(6px);
}
.topbar .menu-toggle { display: none; }
.powered { display: flex; align-items: center; gap: 14px; margin-right: auto; }
.powered .sep { width: 1px; height: 22px; background: var(--muted); opacity: 0.6; }
.powered-by { color: var(--text-2); font-size: 14px; }
.innexo { display: inline-flex; align-items: center; font-weight: 800; font-size: 21px; letter-spacing: 1px; color: var(--text); }
.innexo svg { width: 19px; height: 19px; margin: 0 2px 0 1px; }
.filters { display: flex; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 12.5px; color: var(--text-2); }
.company-control { display: flex; align-items: center; gap: 7px; }
.company-control .select { flex: 1; }
.add-company-btn { width: 38px; height: 38px; flex: 0 0 38px; display: inline-flex; align-items: center; justify-content: center; gap: 0; color: #fff; border: 1px solid var(--blue); border-radius: 9px; background: linear-gradient(145deg, var(--blue), var(--blue-2)); box-shadow: 0 5px 12px rgba(31, 102, 218, .28), inset 0 1px 0 rgba(255,255,255,.22); }
.add-company-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.add-company-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.add-company-btn [data-icon] { width: 17px; height: 17px; }
.add-company-btn strong { font: 800 18px/1 Inter, sans-serif; margin: 7px 0 0 -5px; text-shadow: 0 1px 2px rgba(0,0,0,.22); }
.select { position: relative; }
.select select {
  appearance: none; -webkit-appearance: none;
  height: 38px; min-width: 188px; padding: 0 40px 0 42px;
  background: rgba(255, 255, 255, 1); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 8px;
  font: 500 13.5px/1 'Inter', sans-serif; cursor: pointer;
}
.select select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.select::before, .select::after { content: ''; position: absolute; top: 50%; pointer-events: none; }
.select::after {
  right: 15px; width: 7px; height: 7px; margin-top: -6px;
  border-right: 1.8px solid var(--text-2); border-bottom: 1.8px solid var(--text-2); transform: rotate(45deg);
}
.select .lead { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text); pointer-events: none; }
#companySelect { min-width: 230px; }
.topbar #companySelect { min-width: 230px; }
.vsep { width: 1px; height: 38px; background: var(--line-2); }

.btn-export {
  display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 14px 0 16px;
  border: 1.5px solid #2f7bff; border-radius: 8px;
  background: linear-gradient(180deg, rgba(232, 242, 255, 1), rgba(223, 236, 255, 1));
  box-shadow: 0 0 16px rgba(47, 140, 255, 0.3), inset 0 0 12px rgba(47, 140, 255, 0.15);
  font-weight: 600; font-size: 14px;
}
.btn-export [data-icon] { width: 18px; height: 18px; }
.btn-export [data-icon='chevron'] { width: 14px; height: 14px; }
.signing-note { display:block; color:var(--text-2); line-height:1.45; margin-top:-4px; }
.signing-actions { justify-content:flex-start; margin-top:14px; }
.cert-upload { display:inline-flex; align-items:center; gap:8px; cursor:pointer; }
.certificate-line { display:flex; justify-content:space-between; gap:16px; align-items:center; padding:12px 0; border-bottom:1px solid var(--line-2); }
.certificate-line small { display:block; color:var(--text-2); margin-top:3px; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--text); }
.icon-btn:hover { background: rgba(47, 140, 255, 0.1); }
.icon-btn [data-icon] { width: 24px; height: 24px; }
.theme-toggle { border: 1px solid var(--line-2); background: var(--panel-2); }
.theme-toggle:hover { border-color: var(--blue); background: var(--row-hi); }
.icon-btn.square { border: 1px solid var(--line-2); width: 38px; height: 38px; background: rgba(239, 245, 253, 1); }
.icon-btn.square [data-icon] { width: 20px; height: 20px; color: var(--cyan); }
.icon-btn.spinning [data-icon] { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bell { position: relative; }
.bell [data-icon] { width: 26px; height: 26px; }
.badge {
  position: absolute; top: 4px; right: 6px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 8px; background: #ff3b5c; color: var(--text); font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg);
}
.user { display: flex; align-items: center; gap: 12px; padding: 4px 6px; border-radius: 12px; }
.user:hover { background: rgba(47, 140, 255, 0.08); }
.avatar { width: 46px; height: 46px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(47, 140, 255, 0.55); }
.user-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.35; }
.user-text strong { font-size: 14px; font-weight: 600; }
.user-text small { font-size: 12.5px; color: var(--text-2); }
.user [data-icon='chevron'] { width: 14px; height: 14px; margin-left: 8px; }

.dropdown { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; z-index: 40;
  background: #ffffff; border: 1px solid var(--line-2); border-radius: 12px; padding: 6px;
  box-shadow: var(--shadow); display: none;
}
.dropdown.open .menu { display: block; animation: pop 0.14s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.menu > a, .menu > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; text-align: left; }
.menu > a:hover, .menu > button:hover { background: rgba(47, 140, 255, 0.14); }
.menu [data-icon] { width: 16px; height: 16px; color: var(--cyan); }
.menu-wide { width: 360px; padding: 0; }
.menu-user { width: 300px; }
.menu-section { padding: 8px 12px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.menu-divider { height: 1px; background: var(--line); margin: 6px 4px; }
.role-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; text-align: left; }
.role-opt:hover { background: rgba(47, 140, 255, 0.14); }
.role-opt.current { background: rgba(47, 140, 255, 0.2); box-shadow: inset 0 0 0 1px rgba(47, 140, 255, 0.45); }
.role-txt { display: flex; flex-direction: column; flex: 1; line-height: 1.3; }
.role-txt strong { font-size: 13.5px; font-weight: 600; }
.role-txt small { font-size: 11.5px; color: var(--muted); }
.role-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.role-admin { background: #a970ff; box-shadow: 0 0 8px #a970ff88; }
.role-contador { background: var(--blue); box-shadow: 0 0 8px #2f8cff88; }
.role-cliente { background: #22c55e; box-shadow: 0 0 8px #22c55e88; }
.role-auditor { background: #8a5600; box-shadow: 0 0 8px #f5a52488; }
.role-check { width: 16px; height: 16px; color: var(--cyan); flex: none; }
#userDropdown .avatar { transition: box-shadow .2s; }
#userDropdown[data-type='empresa'] .avatar { box-shadow: 0 0 0 2px #22c55e; }
.menu-section strong { color: var(--text); text-transform: none; letter-spacing: 0; font-size: 12px; }
.select:has(select:disabled) { opacity: .7; cursor: not-allowed; }
.select select:disabled { cursor: not-allowed; }
.cfg-locked { opacity: .55; }
.cfg-locked input, .cfg-locked select { cursor: not-allowed; }
.lock-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #8a5600; margin-left: auto; }
.lock-note [data-icon], .lock-note svg { width: 14px; height: 14px; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
.notif-head button { color: var(--cyan); font-size: 12.5px; font-weight: 500; }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notif-item:hover { background: rgba(47, 140, 255, 0.07); }
.notif-item.unread { background: rgba(47, 140, 255, 0.06); }
.notif-item .t { font-weight: 600; font-size: 13px; }
.notif-item .s { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.notif-item .d { color: var(--muted); font-size: 11px; margin-top: 4px; }
.notif-empty { padding: 22px; color: var(--muted); text-align: center; }

.main {
  grid-area: main;
  margin: 0 0 0 0;
  padding: 16px 22px 24px 26px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-top-left-radius: 22px;
  background: linear-gradient(180deg, rgba(244, 247, 252, 1), rgba(244, 247, 252, 1));
  min-width: 0;
  outline: none;
}
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 14px; }
.page-head h1 { margin: 0 0 4px; font-size: 30px; font-weight: 700; letter-spacing: -0.5px; }
.page-head h1 .accent { color: var(--cyan); }
.page-head p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.updated { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; white-space: nowrap; padding-top: 8px; }
.updated .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.updated .icon-btn { margin-left: 12px; }

/* ---------- Componentes ---------- */
.view { display: flex; flex-direction: column; gap: 13px; animation: fade 0.25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.grid { display: grid; gap: 14px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(120, 170, 255, 0.04);
}
.card.glow {
  border-color: rgba(60, 140, 255, 0.75);
  box-shadow: 0 0 22px rgba(47, 140, 255, 0.28), inset 0 0 30px rgba(47, 140, 255, 0.08);
  background: linear-gradient(180deg, rgba(248, 251, 255, 1), rgba(235, 243, 255, 1));
}
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card-head .titles { flex: 1; min-width: 0; }
.card-head h2, .card-head h3 { margin: 0; font-size: 16.5px; font-weight: 600; }
.card-head p { margin: 3px 0 0; color: var(--text-2); font-size: 12.5px; }
.card-head .hicon { width: 30px; height: 30px; color: var(--blue); flex: none; }
.mini-select { position: relative; }
.mini-select select {
  appearance: none; height: 32px; padding: 0 32px 0 12px; border-radius: 7px;
  background: rgba(255, 255, 255, 1); border: 1px solid var(--line-2); color: var(--text);
  font: 500 12px 'Inter', sans-serif; cursor: pointer;
}
.mini-select::after { content: ''; position: absolute; right: 13px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border-right: 1.6px solid var(--text-2); border-bottom: 1.6px solid var(--text-2); transform: rotate(45deg); pointer-events: none; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.kpis.k5 { grid-template-columns: repeat(5, 1fr); }
.kpis.k4 { grid-template-columns: repeat(4, 1fr); }
.kpi { padding: 14px 18px 12px; min-height: 0; display: flex; flex-direction: column; }
.kpi-top { display: flex; align-items: center; gap: 14px; }
.kpi-icon { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.kpi-icon [data-icon] { width: 26px; height: 26px; }
.tone-green .kpi-icon, .kpi-icon.tone-green { background: linear-gradient(160deg, #1fa868, #0d6a41); color: #c9ffe2; }
.tone-red .kpi-icon, .kpi-icon.tone-red { background: linear-gradient(160deg, #a72c43, #5f1426); color: #ff8b9c; }
.tone-blue .kpi-icon, .kpi-icon.tone-blue { background: linear-gradient(160deg, #1b5fc8, #0e3478); color: #d7e8ff; }
.tone-purple .kpi-icon, .kpi-icon.tone-purple { background: linear-gradient(160deg, #5b3fd0, #2e1f7a); color: #d9ccff; }
.tone-amber .kpi-icon, .kpi-icon.tone-amber { background: linear-gradient(160deg, #c27a12, #7a4806); color: #ffe0a6; }
.kpi-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.kpi-value { font-size: 24px; font-weight: 600; margin: 12px 0 8px; letter-spacing: -0.4px; white-space: nowrap; }
.kpi-foot { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-2); margin-top: auto; white-space: nowrap; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.delta [data-icon] { width: 15px; height: 15px; }
.up { color: var(--green); }
.down { color: var(--red); }
.kpi.side { flex-direction: row; gap: 14px; align-items: flex-start; min-height: 0; padding: 12px 14px; }
.kpi.side > div:last-child { min-width: 0; flex: 1; }
.kpi.side .kpi-icon { width: 58px; height: 58px; border-radius: 12px; }
.kpi.side .kpi-icon [data-icon] { width: 32px; height: 32px; }
.kpi.side .kpi-value { margin: 6px 0 8px; font-size: 21px; }

/* Barras horizontais */
.hbars { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 6px 12px; font-size: 12.5px; }
.hbars .lbl { color: var(--text); white-space: nowrap; }
.hbars .track { display: block; height: 15px; border-radius: 3px; background: rgba(223, 232, 245, 1); overflow: hidden; }
.hbars .fill { display: block; height: 100%; border-radius: 3px; transition: width 0.6s cubic-bezier(.2,.8,.2,1); }
.hbars .val { text-align: right; white-space: nowrap; color: var(--text); }
.hbars .shr { text-align: right; color: var(--text-2); min-width: 42px; }

/* Listas de alertas/insights */
.list { display: flex; flex-direction: column; gap: 7px; }
.alert-row {
  display: grid; grid-template-columns: 34px 1fr auto 20px; align-items: center; gap: 12px;
  padding: 7px 12px; border-radius: 9px; background: var(--row); cursor: pointer;
  border: 1px solid transparent; transition: border-color 0.15s, background 0.15s;
}
.alert-row:hover { border-color: var(--line-2); background: rgba(227, 238, 253, 1); }
.alert-row.resolved { opacity: 0.55; }
.alert-row .t { font-weight: 600; font-size: 13px; }
.alert-row .s { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.alert-row .dt { color: var(--text-2); font-size: 12px; }
.alert-row .chev { width: 16px; height: 16px; color: var(--text-2); }
.lvl { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 17px; color: var(--text); }
.lvl-danger { background: #ff3b52; box-shadow: 0 0 12px rgba(255, 59, 82, 0.4); }
.lvl-warning { background: #8a5600; box-shadow: 0 0 12px rgba(245, 165, 36, 0.35); }
.lvl-info { background: var(--blue); box-shadow: 0 0 12px rgba(47, 140, 255, 0.4); }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 22px; border-radius: 11px; background: #ff3b52; font-size: 12.5px; font-weight: 700; margin-left: 8px; padding: 0 7px; box-shadow: 0 0 12px rgba(255,59,82,.45); }
.link-btn { display: inline-flex; align-items: center; gap: 8px; color: var(--cyan); font-size: 13px; font-weight: 500; }
.link-btn [data-icon] { width: 15px; height: 15px; }

.ia-badge { width: 34px; height: 34px; border: 1.8px solid var(--cyan); border-radius: 7px; display: grid; place-items: center; color: var(--cyan); font-weight: 800; font-size: 14px; flex: none; position: relative; }
.ia-badge::after { content: ''; position: absolute; top: -4px; right: -4px; width: 7px; height: 7px; background: var(--cyan); transform: rotate(45deg); box-shadow: 0 0 6px var(--cyan); }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(239, 245, 253, 1); font-size: 12px; color: var(--text); white-space: nowrap; }
.chip [data-icon] { width: 14px; height: 14px; color: var(--text); }
.insight {
  display: grid; grid-template-columns: 38px 34px 1fr auto 18px; gap: 14px; align-items: center;
  padding: 5px 4px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.insight:last-child { border-bottom: 0; }
.insight:hover .t { color: var(--text); text-decoration: underline; text-decoration-color: rgba(55,181,255,.5); }
.insight .num { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(239, 245, 253, 1); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.insight .ic { width: 28px; height: 28px; }
.insight .t { font-weight: 600; font-size: 12.8px; }
.insight .s { color: var(--text-2); font-size: 11.5px; line-height: 1.3; margin-top: 1px; }
.insight .chev { width: 16px; height: 16px; color: var(--text-2); }
.tag { display: inline-grid; place-items: center; height: 24px; padding: 0 14px; border-radius: 7px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tag-blue { background: rgba(47, 140, 255, 0.16); color: #145caa; border: 1px solid rgba(47, 140, 255, 0.4); }
.tag-amber { background: rgba(245, 165, 36, 0.14); color: #805000; border: 1px solid rgba(245, 165, 36, 0.4); }
.tag-green { background: rgba(34, 211, 126, 0.13); color: var(--green); border: 1px solid rgba(34, 211, 126, 0.38); }
.tag-red { background: rgba(255, 77, 99, 0.14); color: var(--red); border: 1px solid rgba(255, 77, 99, 0.4); }
.ic-blue { color: #145caa; } .ic-green { color: var(--green); } .ic-red { color: var(--red); } .ic-amber { color: var(--amber); } .ic-purple { color: #7040c0; }

/* Tabelas */
.table-wrap { overflow: auto; border-radius: 8px; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--text); background: rgba(234, 241, 251, 1); padding: 9px 10px; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl td { padding: 4px 10px; border-bottom: 1px solid rgba(70, 110, 180, 0.1); white-space: nowrap; }
.tbl tr.l0 td { color: var(--cyan); font-weight: 700; font-size: 13px; background: rgba(235, 243, 254, 1); }
.tbl tr.l0 td.num { color: #145caa; }
.tbl tr.l1 td { font-weight: 600; color: var(--text); }
.tbl tr.l2 td { color: var(--text); }
.tbl tr.l3 td { color: var(--text-2); font-size: 12px; }
.tbl td.neg { color: var(--red); }
.tbl tr.hidden { display: none; }
.tbl tr.match td { background: rgba(47, 140, 255, 0.16); }
.toggle { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px; vertical-align: -4px; color: var(--text-2); border-radius: 4px; }
.toggle:hover { background: rgba(47, 140, 255, 0.2); }
.toggle [data-icon] { width: 13px; height: 13px; transition: transform 0.15s; }
.collapsed .toggle [data-icon] { transform: rotate(-90deg); }
.toggle-spacer { display: inline-block; width: 24px; }

.search { position: relative; }
.search input {
  height: 34px; width: 238px; padding: 0 12px 0 36px; border-radius: 8px;
  background: rgba(255, 255, 255, 1); border: 1px solid var(--line-2); color: var(--text); font: 12px 'Inter', sans-serif;
}
.search input::placeholder { color: var(--muted); }
.search [data-icon] { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-2); }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 26px;
  border-radius: 8px; font-weight: 600; font-size: 15px;
  background: linear-gradient(180deg, var(--blue), var(--blue-2)); color: #fff;
  box-shadow: 0 0 18px rgba(47, 140, 255, 0.45), inset 0 1px 0 rgba(255,255,255,.2);
  border: 1px solid #4a95ff;
}
.btn-primary [data-icon] { width: 20px; height: 20px; }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(239, 245, 253, 1); font-weight: 500; }
.btn-ghost:hover { border-color: var(--blue); }
.btn-ghost [data-icon] { width: 16px; height: 16px; flex: none; }

/* Legenda */
.legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 26px; font-size: 12.5px; color: var(--text); margin-top: 4px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }

/* Gráficos */
.chart { width: 100%; position: relative; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart text { fill: var(--text-2); font-size: 11px; font-family: 'Inter', sans-serif; }
.chart .grid-line { stroke: rgba(120, 150, 210, 0.13); }
.chart .axis { stroke: rgba(150, 180, 230, 0.3); }
.chart .pt { transition: r 0.12s; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: rgba(255, 255, 255, 0.98); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 8px 12px; font-size: 11.5px; min-width: 186px; box-shadow: var(--shadow);
}
.chart-tip .h { font-weight: 600; margin-bottom: 6px; }
.chart-tip .r { display: flex; justify-content: space-between; gap: 18px; margin: 3px 0; }
.chart-tip .r span { display: inline-flex; align-items: center; gap: 7px; }
.chart-tip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.donut-legend { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 11px 12px; align-items: center; font-size: 12.5px; }
.donut-legend i { width: 12px; height: 12px; border-radius: 50%; }
.donut-legend .v { text-align: right; white-space: nowrap; }
.donut-legend .p { text-align: right; }

/* Página: Painel */
.dash-mid { grid-template-columns: 1.39fr 1fr; }
.dash-bottom { grid-template-columns: 1fr 1.24fr; }

/* Página: Balancete */
.bal-filters { display: grid; grid-template-columns: 1fr 1fr 1.05fr auto; gap: 22px; align-items: end; padding: 12px 16px 14px; }
.bal-filters .select select { width: 100%; height: 38px; }
.bal-filters .btn-primary { min-width: 196px; }
.bal-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; align-items: start; }
.bal-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bal-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Página: DRE */
.dre-grid { display: grid; grid-template-columns: 1fr 1.02fr; gap: 14px; align-items: start; }
.dre-table td, .dre-table th { padding: 7px 14px; font-size: 13.5px; }
.dre-table th { font-size: 14px; background: rgba(234, 241, 251, 1); }
.dre-table tr.group td { color: var(--cyan); font-weight: 600; font-size: 14.5px; }
.dre-table tr.child td:first-child { padding-left: 44px; color: var(--text); }
.dre-table tr.total td { background: linear-gradient(90deg, rgba(218, 233, 255, 1), rgba(232, 242, 255, 1)); color: var(--text); font-weight: 700; font-size: 14.5px; border-top: 1px solid rgba(70,140,255,.35); border-bottom: 1px solid rgba(70,140,255,.35); }
.dre-table tr.subtotal td { background: rgba(237, 244, 254, 1); font-weight: 600; color: var(--text); }
.dre-table tr.plain td { color: var(--text); }
.dre-table td.pos { color: var(--green); }
.dre-table td.neg { color: var(--red); }
.dre-table td.var { color: var(--text-2); }
.dre-table tr.total td.var, .dre-table tr.group td.var { color: var(--green); }
.margins { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Página: Balanço */
.bp-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 14px; }
.bp-bottom { display: grid; grid-template-columns: 1.04fr 0.83fr 0.97fr; gap: 14px; }
.bp-table td, .bp-table th { padding: 6px 10px; font-size: 13.5px; background: transparent; }
.bp-table th { background: transparent; color: var(--text); font-weight: 500; font-size: 12.5px; text-align: right; line-height: 1.35; }
.bp-table tr.group td { background: rgba(228, 239, 255, 1); color: var(--cyan); font-weight: 600; }
.bp-table.red tr.group td { background: rgba(255, 234, 239, 1); color: var(--red); }
.bp-table.red tr.group.purple td { background: rgba(241, 235, 255, 1); color: #7040c0; }
.bp-table tr.child td:first-child { padding-left: 42px; color: var(--text); position: relative; }
.bp-table tr.child td:first-child::before { content: ''; position: absolute; left: 24px; top: 0; bottom: 0; border-left: 1px solid rgba(140,170,220,.35); }
.bp-table tr.totalrow td { color: var(--cyan); font-weight: 700; font-size: 14px; background: rgba(225, 237, 255, 1); border-top: 1px solid rgba(70,140,255,.3); }
.bp-table .vpos { color: var(--green); } .bp-table .vneg { color: var(--red); }
.bp-head { display: flex; align-items: center; gap: 12px; }
.bp-head h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: .3px; }

/* Indicadores / Config */
.fx-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ind-score { display: flex; align-items: center; gap: 22px; }
.ind-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ind-card { display: flex; flex-direction: column; gap: 6px; min-height: 150px; cursor: help; }
.ind-card .lbl { font-size: 13px; color: var(--text); font-weight: 600; }
.ind-card .val { font-size: 26px; font-weight: 700; }
.ind-card .meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-2); }
.ind-card .spark { height: 38px; margin-top: auto; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px; }
.status-bom { background: rgba(34,211,126,.13); color: var(--green); }
.status-atencao { background: rgba(245,165,36,.14); color: #805000; }
.status-critico { background: rgba(255,77,99,.14); color: var(--red); }
.section-title { margin: 6px 0 -4px; font-size: 13px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.form .full { grid-column: 1 / -1; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.form input, .form select {
  height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 1); color: var(--text); font: 13.5px 'Inter', sans-serif;
}
.form input:focus, .form select:focus { outline: 2px solid var(--blue); outline-offset: 0; }
.switch-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }
.switch-row small { display: block; color: var(--muted); margin-top: 2px; }
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #22314f; border-radius: 12px; transition: background 0.2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(20px); }
.cfg-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; align-items: start; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

.pill { display: inline-flex; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.pill-vencido { background: rgba(255,77,99,.15); color: var(--red); }
.pill-aberto { background: rgba(47,140,255,.15); color: #145caa; }
.pill-recebido, .pill-pago { background: rgba(34,211,126,.13); color: var(--green); }

/* Modal / toast */
.modal { position: fixed; inset: 0; background: rgba(2, 6, 16, 0.7); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal-card { width: min(640px, 100%); max-height: 86vh; overflow: auto; background: #ffffff; border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); }
.modal-card header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #ffffff; }
.modal-card h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 10px; line-height: 1.55; color: var(--text-2); }
.toast { position: fixed; bottom: 22px; right: 22px; z-index: 120; background: #ffffff; border: 1px solid var(--blue); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13.5px; animation: pop 0.2s; }
.skeleton { height: 320px; border-radius: var(--radius); background: linear-gradient(90deg, rgba(222,233,248,.5), rgba(235,242,252,.9), rgba(222,233,248,.5)); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }
.empty { padding: 26px; text-align: center; color: var(--muted); }

/* ---------- Responsivo ---------- */
@media (min-width: 1281px) and (max-width: 1600px) {
  .topbar { gap: 8px; padding-right: 16px; }
  .topbar .filters { gap: 10px; }
  .powered-by, .powered .sep { display: none; }
}
@media (max-width: 1440px) {
  .kpi-value { font-size: 22px; }
  .select select { min-width: 160px; }
  #companySelect { min-width: 200px; }
}
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpis.k5 { grid-template-columns: repeat(3, 1fr); }
  .dash-mid, .dash-bottom, .bal-grid, .dre-grid, .bp-grid, .cfg-grid { grid-template-columns: 1fr; }
  .bp-bottom { grid-template-columns: 1fr 1fr; }
  .ind-grid { grid-template-columns: repeat(2, 1fr); }
  .powered-by, .powered .sep { display: none; }
}
@media (max-width: 1280px) {
  :root { --topbar: auto; }
  .app { grid-template-columns: 1fr; grid-template-areas: 'top' 'main'; }
  .sidebar { position: fixed; left: 0; top: 0; width: 250px; transform: translateX(-100%); transition: transform 0.2s; box-shadow: var(--shadow); }
  .app.menu-open .sidebar { transform: none; }
  .topbar .menu-toggle { display: grid; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .powered { margin-right: auto; }
  .filters { order: 10; width: 100%; }
  .filters .field { flex: 1; min-width: 0; }
  .select select, #companySelect { min-width: 0; width: 100%; }
  .vsep, .user-text, .user [data-icon='chevron'] { display: none; }
  .btn-export span:nth-child(2) { display: none; }
  .main { border-radius: 0; border-left: 0; padding: 16px; }
  .page-head { flex-direction: column; gap: 8px; }
  .page-head h1 { font-size: 24px; }
  .updated { padding-top: 0; white-space: normal; }
  .bal-filters { grid-template-columns: 1fr; }
  .bp-bottom, .fx-cols, .form, .margins { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .app > * { min-width: 0; } /* o conteúdo não alarga a coluna além da tela */
  .menu-user { width: min(300px, calc(100vw - 32px)); }
  .topbar .dropdown { position: static; }
  .topbar .menu { right: 16px; left: auto; max-width: calc(100vw - 32px); }
}
@media (max-width: 360px) {
  .kpis, .kpis.k5, .kpis.k4, .sim-kpis { grid-template-columns: 1fr; }
  .topbar { gap: 8px; padding: 10px 12px; }
}
@media (max-width: 620px) {
  .kpis, .kpis.k5, .kpis.k4, .ind-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { min-height: 0; padding: 12px; }
  .kpi-icon { width: 38px; height: 38px; }
  .kpi-value { font-size: 18px; margin: 10px 0 6px; }
  .kpi-foot { flex-wrap: wrap; gap: 4px; }
  .insight { grid-template-columns: 32px 1fr 18px; }
  .insight .ic, .insight .tag { display: none !important; } /* !important: hydrateIcons põe display inline no ícone */
  .alert-row { grid-template-columns: 30px 1fr 16px; }
  .alert-row .dt { display: none; }
  .hbars { grid-template-columns: auto 1fr auto; }
  .hbars .shr { display: none; }
  .search input { width: 100%; }
  .menu-wide { width: calc(100vw - 32px); right: -60px; }
}

/* ---------- Impressão (Exportar → PDF) ---------- */
@media print {
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .updated .icon-btn, .toast, .modal { display: none !important; }
  .app { display: block; }
  .main { border: 0; background: #fff; padding: 0; }
  .card { background: #fff; border-color: #ccd; box-shadow: none; break-inside: avoid; color: #000; }
  .page-head p, .card-head p, .kpi-foot, .insight .s { color: #333; }
  .tbl td, .tbl th { color: #000 !important; background: #fff !important; }
}

/* Ajuste fino da barra superior (medidas da referência 1600×900) */
@media (min-width: 961px) {
  .topbar #companySelect { width: 230px; min-width: 0; }
  .topbar #periodSelect { width: 188px; min-width: 0; }
  .topbar .filters { gap: 20px; margin-right: 2px; }
}

/* Balancete — densidade da referência */
.bal-grid { grid-template-columns: 1.6fr 1fr; gap: 13px; }
.bal-filters { padding: 10px 16px 12px; }
.bal-filters .btn-primary { height: 42px; }
#accTable td { padding: 1.5px 10px; font-size: 11.8px; line-height: 1.28; }
#accTable tr.l0 td { font-size: 12.5px; padding: 3px 10px; }
#accTable th { padding: 7px 10px; font-size: 12.5px; }
.bal-left .kpi.side .kpi-value, .bal-left .kpi.side .kpi-value { font-size: 20.5px; }
.bal-left .kpi.side .kpi-label { font-size: 13.5px; }
.bal-left .kpi.side .kpi-foot { gap: 8px; font-size: 11.5px; }
.bal-left .kpi.side .delta { font-size: 13.5px; }
.bal-right .donut-legend { font-size: 12px; gap: 10px 10px; }
.bal-right .donut-legend span:nth-child(4n+2) { white-space: nowrap; }
.bal-right .hbars { font-size: 12px; gap: 5px 12px; }
.bal-right .ia .insight { grid-template-columns: 34px 26px 1fr 18px; gap: 10px; padding: 4px 2px; }
.bal-right .ia .insight > :nth-child(4) { display: none; }
.bal-right .ia .insight .num { width: 32px; height: 32px; font-size: 13px; }
.bal-right .ia .insight .t { font-size: 11.8px; }
.bal-right .ia .insight .s { font-size: 10.4px; line-height: 1.25; }
.bal-right .ia .card-head h2 { font-size: 15.5px; }
.bal-right .ia .card-head p { font-size: 11.5px; }
.bal-right .ia .chip { height: 26px; font-size: 11px; padding: 0 10px; }
.bal-right .card { padding: 12px 14px; }

/* Balanço — densidade da referência */
.kpis.k5 .kpi.side .kpi-icon { width: 50px; height: 50px; }
.kpis.k5 .kpi.side .kpi-icon [data-icon] { width: 28px; height: 28px; }
.kpis.k5 .kpi.side { padding: 14px 14px 12px; }
.kpis.k5 .kpi.side .kpi-label { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis.k5 .kpi.side .kpi-value { font-size: 23px; margin: 10px 0 10px; }
.kpis.k5 .kpi.side .kpi-foot { gap: 8px; font-size: 11.5px; }
.kpis.k5 .kpi.side .delta { font-size: 13.5px; }
.bp-table.red td { padding: 3px 10px; font-size: 12.5px; }
.bp-table.red tr.group td { padding: 4px 10px; }
.bp-table td { font-size: 13px; }
.bp-bottom .card-head h2 { font-size: 15.5px; white-space: nowrap; }
.bp-bottom .donut-legend { font-size: 11.5px; gap: 9px 10px; }
.bp-bottom .donut-legend span { white-space: nowrap; }
.bp-bottom .ia .card-head h2 { font-size: 15px; }
.bp-bottom .ia .card-head p { font-size: 10.5px; }
.bp-bottom .ia .chip { height: 24px; font-size: 10.5px; padding: 0 8px; gap: 5px; }
.bp-bottom .ia .insight { grid-template-columns: 30px 26px 1fr auto 12px; gap: 8px; padding: 3px 0; }
.bp-bottom .ia .insight .num { width: 30px; height: 30px; font-size: 12.5px; }
.bp-bottom .ia .insight .t { font-size: 11px; }
.bp-bottom .ia .insight .s { font-size: 9.6px; line-height: 1.22; }
.bp-bottom .ia .insight .tag { height: 22px; padding: 0 8px; font-size: 10px; }
.bp-bottom .card { padding: 12px 14px; }
.bp-head > [data-icon] { flex: none; }
.bp-bottom .card-head { gap: 8px; }
.bp-bottom .card-head .hicon { width: 26px; height: 26px; }
.bp-bottom .mini-select select { height: 30px; font-size: 11.5px; padding: 0 28px 0 10px; }
.bp-bottom [data-card="comparativo"] .card-head h2 { font-size: 15px; }
.bp-bottom [data-card="composicao"] .donut-legend { min-width: 0 !important; }
.dre-table tr.group td.r { color: var(--text); }
.dre-table tr.group td.r.pos { color: var(--green); }
.dre-table tr.group td.r.neg { color: var(--red); }
.dre-table tr.group td.var { color: var(--green); }
.dre-table tr.group td.r { font-weight: 600; }
[data-card="passivo"] .bp-head > span:last-child { grid-template-columns: repeat(3, 104px) !important; }
[data-card="passivo"] .bp-head h2 { font-size: 15.5px !important; }

/* Mobile: barra superior compacta, sem rolagem horizontal */
@media (max-width: 1280px) {
  .topbar { gap: 8px; }
  .filters { gap: 10px; }
  .filters .field { flex: 1 1 0; min-width: 0; }
  .filters .select, .filters .select select, .topbar #companySelect { min-width: 0; width: 100%; }
  .avatar { width: 36px; height: 36px; }
  .user { padding: 0; gap: 0; }
  .innexo { font-size: 18px; }
  .innexo svg { width: 16px; height: 16px; }
  .main { overflow-x: hidden; }
}
@media (max-width: 620px) {
  .bp-head > span:last-child { display: none !important; }
  .bp-table td { font-size: 12px !important; padding: 4px 8px !important; }
  .bp-table tr.child td:first-child { padding-left: 26px !important; }
  .bp-table tr.child td:first-child::before { left: 14px; }
  #distDonut, #compDonut { margin: 0 auto; }
  .donut-legend { min-width: 0 !important; width: 100%; }
  .bal-right > *, .bal-left > *, .bp-bottom > *, .dre-grid > * { min-width: 0; }
}
@media (max-width: 620px) {
  .bp-bottom [data-card="composicao"] > div:last-child { flex-direction: column; }
  .bp-bottom .donut-legend span { white-space: normal; }
}
@media (max-width: 1280px) {
  .bal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .bal-left .kpis { grid-template-columns: 1fr !important; }
  .kpis.k5 .kpi.side { flex-direction: column; gap: 8px; }
  .kpis.k5 .kpi.side .kpi-value { font-size: 17px; margin: 4px 0 6px; }
  .kpis.k5 .kpi.side .kpi-foot { flex-wrap: wrap; white-space: normal; gap: 2px 6px; }
  .kpis.k5 .kpi.side .kpi-icon { width: 40px; height: 40px; }
  .bal-left .kpi.side .kpi-value { font-size: 19px; }
  .bal-filters .btn-primary { width: 100%; }
}

/* Configurações › Seu acesso */
.perm-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 13px; }
.perm-list li { display: flex; align-items: center; gap: 8px; }
.perm-list li [data-icon], .perm-list li svg { width: 15px; height: 15px; flex: none; }
.perm-list li.ok { color: var(--text); } .perm-list li.ok [data-icon] { color: #22c55e; }
.perm-list li.no { color: var(--muted); } .perm-list li.no [data-icon] { color: var(--muted); }
@media (max-width: 760px) { .perm-list { grid-template-columns: 1fr; } }

/* Abas dentro de uma tela (DRE | Simulação) */
.tabs { display: flex; gap: 6px; margin: 0 0 14px; padding: 4px; width: fit-content; max-width: 100%; overflow-x: auto; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(239, 245, 253, 1); }
.tabs a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.tabs a [data-icon], .tabs a svg { width: 16px; height: 16px; }
.tabs a:hover { color: var(--text); background: rgba(47, 140, 255, 0.12); }
.tabs a.active { color: #fff; background: var(--blue); box-shadow: 0 2px 6px rgba(25, 100, 209, .16); }

/* DRE › Simulação */
.sim-grid { display: grid; grid-template-columns: 380px 1fr; gap: 14px; align-items: start; }
.sim-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sim-panel { position: sticky; top: calc(var(--topbar) + 12px); max-height: calc(100vh - var(--topbar) - 24px); overflow-y: auto; }
.sim-field.sim-derived { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; }
.sim-presets { display: flex; gap: 8px; margin: 2px 0 12px; flex-wrap: wrap; }
.sim-preset { cursor: pointer; }
.sim-preset:hover { border-color: var(--blue); }
.sim-preset.active { background: rgba(47, 140, 255, 0.25); border-color: #4b9bff; color: var(--text); }
.sim-group { border: 0; margin: 0 0 10px; padding: 0; }
.sim-group legend { display: flex; align-items: center; gap: 8px; padding: 0; margin-bottom: 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #145caa; }
.sim-group legend [data-icon], .sim-group legend svg { width: 15px; height: 15px; }
.sim-field { padding: 8px 0 10px; border-bottom: 1px solid var(--line); }
.sim-field:last-child { border-bottom: 0; }
.sim-lbl { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13.5px; }
.sim-lbl small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.sim-num { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px; background: rgba(255, 255, 255, 1); flex: none; }
.sim-num:focus-within { border-color: var(--blue); }
.sim-num input { width: 58px; background: none; border: 0; color: var(--text); font: inherit; font-weight: 600; text-align: right; outline: none; -moz-appearance: textfield; }
.sim-num input::-webkit-inner-spin-button { opacity: .4; }
.sim-num em { font-style: normal; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.sim-field input[type='range'] { width: 100%; margin: 8px 0 0; accent-color: var(--blue); height: 4px; cursor: pointer; }
.sim-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.sim-table tr td.up, .sim-table tr.total td.up, .sim-table tr.total td.var.up, .sim-table tr.subtotal td.var.up { color: var(--green); }
.sim-table tr td.down, .sim-table tr.total td.down, .sim-table tr.total td.var.down, .sim-table tr.subtotal td.var.down { color: var(--red); }
.sim-table tr.total td.var:not(.up):not(.down) { color: var(--text); }
.sim-bottom { display: grid; grid-template-columns: 1fr 1.5fr; gap: 14px; }
.be-value { font-size: 28px; font-weight: 700; margin: 4px 0 12px; }
.be-bar { position: relative; height: 10px; border-radius: 6px; background: rgba(34, 211, 126, 0.25); overflow: visible; }
.be-bar span { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: linear-gradient(90deg, #c52e46, #8a5600); }
.be-bar i { position: absolute; top: -4px; width: 2px; height: 18px; background: #fff; box-shadow: 0 0 6px #fff; transform: translateX(-1px); }
.be-list { margin: 14px 0 6px; display: grid; gap: 8px; }
.be-list div { display: flex; justify-content: space-between; font-size: 13px; }
.be-list dt { color: var(--muted); } .be-list dd { margin: 0; font-weight: 600; }
.be-list dd.up, .proj-totals b.up { color: var(--green); } .be-list dd.down, .proj-totals b.down { color: var(--red); }
.be-note { font-size: 12.5px; color: var(--text-2); margin: 8px 0 0; }
.sim-alert { color: #8a5600; font-size: 13px; }
.proj-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.proj-totals div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(244, 248, 254, 1); }
.proj-totals span { font-size: 11.5px; color: var(--muted); } .proj-totals b { font-size: 15px; }
@media (max-width: 1280px) { .sim-grid { grid-template-columns: 340px 1fr; } .sim-kpis { grid-template-columns: repeat(2, 1fr); } .sim-bottom { grid-template-columns: 1fr; } }
@media (max-width: 980px) { .sim-grid { grid-template-columns: 1fr; } .sim-panel { position: static; } }
@media (max-width: 560px) { .sim-kpis, .proj-totals { grid-template-columns: 1fr; } .tabs a { padding: 0 12px; font-size: 13px; } }
@media (max-width: 560px) {
  /* No celular a simulação mostra o que importa: Conta | Simulado | Diferença, sem rolagem lateral. */
  .sim-table th:nth-child(2), .sim-table td:nth-child(2), .sim-table th:nth-child(5), .sim-table td:nth-child(5) { display: none; }
  .sim-table td, .sim-table th { padding: 7px 8px; font-size: 12.5px; }
  .sim-table td:first-child { white-space: normal; }
  .sim-table td.r, .sim-table th.r { white-space: nowrap; }
}

/* DRE › Simulação v1.1: cascata + equilíbrio, meta de lucro, link, impressão.
   A DRE simulada (5 colunas) ocupa a largura toda; cascata e equilíbrio ficam lado a lado embaixo.
   Só em telas largas (≥ 1700px) a dupla cascata+equilíbrio vai para a direita da tabela. */
.sim-mid { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; min-width: 0; }
.sim-side { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-width: 0; align-items: start; }
@media (min-width: 1700px) { .sim-mid { grid-template-columns: 1.25fr 1fr; } .sim-side { grid-template-columns: 1fr; } }
.sim-actions { justify-content: space-between; }
.sim-actions .btn-ghost { height: 36px; padding: 0 12px; font-size: 13px; }
.sim-actions .btn-ghost [data-icon], .sim-actions .btn-ghost svg { width: 15px; height: 15px; }
.sim-field.changed .sim-lbl > span { color: var(--cyan); }
.sim-field.changed .sim-num { border-color: rgba(55, 181, 255, 0.55); }
.be-value small { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.be-target { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.be-target label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #145caa; margin-bottom: 6px; }
.be-target .sim-num { width: 100%; height: 36px; }
.be-target .sim-num em { order: -1; }
.be-target .sim-num input { width: 100%; text-align: left; }
.be-target .be-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.be-target .be-note .up { color: var(--green); } .be-target .be-note .down { color: var(--red); }
.be-target .be-note small { color: var(--muted); }
#simBreak .card-head .icon-btn { margin-left: auto; width: 28px; height: 28px; }
.ia-list .insight .t { color: var(--text); }
@media (max-width: 980px) { .sim-side { grid-template-columns: 1fr; } }
@media print {
  .tabs, .sim-presets, .sim-actions, .sim-field input[type='range'], #simBreak .icon-btn, .be-target { display: none !important; }
  .sim-grid, .sim-mid { display: block; }
  .sim-panel { position: static; margin-bottom: 14px; }
  .sim-field { border-color: #ccd; } .sim-lbl, .sim-lbl small, .sim-num em, .sim-group legend { color: #000; }
  .sim-num { background: #fff; border-color: #ccd; } .sim-num input { color: #000; }
  .sim-kpis { grid-template-columns: repeat(4, 1fr); } .proj-totals { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Login ---------- */
body:not(.authed) #app { display: none !important; }
body:not(.anon) #login { display: none !important; }
.login { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 20% -10%, rgba(47, 140, 255, 0.18), transparent 60%), radial-gradient(900px 500px at 100% 100%, rgba(124, 196, 255, 0.12), transparent 60%); }
.login-theme { position: absolute; top: 14px; right: 14px; z-index: 2; }
.login-card { width: 100%; max-width: 420px; padding: 32px 32px 26px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.login-logo { margin: 0 auto 4px; }
.login-card h1 { font-size: 24px; font-weight: 700; margin: 0; }
.login-sub { color: var(--text-2); font-size: 13.5px; margin: -6px 0 6px; }
.login-field { display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: 12.5px; color: var(--text-2); }
.login-field input, .pw-form input { height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 1); color: var(--text); font: inherit; font-size: 15px; }
.login-field input:focus, .pw-form input:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.login-btn { width: 100%; margin-top: 4px; }
.login-foot { margin: 10px 0 0; font-size: 12px; color: var(--muted); display: flex; justify-content: center; align-items: center; gap: 6px; }
.login-demo { margin-top: 2px; padding-top: 14px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.login-demo-title { margin: 0; font-size: 12px; color: var(--muted); }
.login-demo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.login-demo-btn { justify-content: center; height: 40px; padding: 0 10px; font-size: 13.5px; white-space: nowrap; }
.login-demo-btn:disabled { opacity: 0.6; cursor: default; }
@media (max-width: 400px) { .login-demo-btns { grid-template-columns: 1fr; } }
.form-error { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 13px; text-align: left; color: var(--red); background: rgba(255, 77, 99, 0.12); border: 1px solid rgba(255, 77, 99, 0.35); }
.pw-form { display: flex; flex-direction: column; gap: 12px; }
.pw-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.pw-form small { color: var(--muted); font-size: 11.5px; }
.pw-form .actions { margin-top: 4px; }
@media (max-width: 480px) { .login-card { padding: 24px 18px 20px; } }

/* ---------- Carteira: seleção de empresas, grupo econômico, cadastro de clientes, cenários ---------- */
.page-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.page-actions .btn-primary { height: 40px; padding: 0 18px; font-size: 14px; }
.page-actions .btn-ghost { height: 40px; }
.page-actions [data-icon] { width: 18px; height: 18px; }
.group-btn { height: 38px; gap: 8px; padding: 0 14px; }
.group-btn [data-icon] { width: 16px; height: 16px; color: var(--cyan); }
.group-btn [data-icon='chevron'] { width: 13px; height: 13px; color: var(--text-2); }
.group-btn.active { border-color: var(--blue); background: rgba(47, 140, 255, 0.18); }
.badge-soft:empty { display: none; }
.badge-soft { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--blue); font-size: 11.5px; font-weight: 700; }
.menu-group { width: 360px; padding: 0; }
.group-list { max-height: 320px; overflow: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.group-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.group-item:hover { background: rgba(47, 140, 255, 0.12); }
.group-item input { width: 16px; height: 16px; accent-color: var(--blue); flex: none; }
.group-item span { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.group-item strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-item small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); }
.group-foot small { color: var(--muted); }

/* Tela Empresas (seleção com filtros dinâmicos) */
.emp-filters { display: grid; grid-template-columns: minmax(260px, 1.6fr) repeat(5, minmax(120px, 1fr)); gap: 10px; align-items: end; }
.emp-filters .search input { width: 100%; height: 40px; font-size: 13.5px; }
.emp-filters label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); min-width: 0; }
.emp-filters select { width: 100%; min-width: 0; height: 40px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-solid); color: var(--text); font: 13px 'Inter', sans-serif; }
.emp-filters select:focus { outline: 2px solid var(--blue); outline-offset: 0; }
.emp-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 0; color: var(--text-2); font-size: 12.5px; }
.emp-summary .chip { cursor: pointer; }
.emp-summary .chip:hover { border-color: var(--blue); }
.emp-table td, .emp-table th { white-space: nowrap; }
.emp-table td { padding: 8px 10px; }
.emp-table tr[data-id] { cursor: pointer; }
.emp-table tr[data-id]:hover td { background: rgba(47, 140, 255, 0.1); }
.emp-table tr.sel td { background: rgba(47, 140, 255, 0.16); }
.emp-table tr.inactive td { opacity: 0.55; }
.emp-table input[type='checkbox'] { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
.emp-table .name { display: flex; flex-direction: column; line-height: 1.3; }
.emp-table .name strong { font-size: 13px; font-weight: 600; }
.emp-table .name small { color: var(--muted); font-size: 11.5px; }
.emp-table mark { background: rgba(55, 181, 255, 0.28); color: inherit; border-radius: 3px; padding: 0 1px; }
.emp-table .open-btn { opacity: 0; }
.emp-table tr:hover .open-btn, .emp-table tr.sel .open-btn, .emp-table tr:focus-within .open-btn, .emp-table .open-btn:focus-visible { opacity: 1; }
.emp-bar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-solid); box-shadow: var(--shadow); z-index: 5; }
.emp-bar .btn-primary { height: 40px; padding: 0 18px; font-size: 14px; }
.emp-bar .spacer { flex: 1; }
.emp-bar .names { color: var(--text-2); font-size: 12.5px; max-width: 60ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1280px) { .emp-filters { grid-template-columns: 1fr 1fr 1fr; } .emp-filters .search { grid-column: 1 / -1; } }
@media (max-width: 620px) {
  #groupDropdown { flex: 0 0 auto; }
  .group-btn { padding: 0 10px; }
  .group-btn > span:nth-child(2), .group-btn [data-icon='chevron'] { display: none; } /* só ícone + contador */
}
@media (max-width: 620px) { .emp-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .emp-kpis { grid-template-columns: 1fr 1fr; } .emp-table .hide-sm { display: none; } .page-tools { width: 100%; justify-content: flex-start; } }

/* Formulário de cliente (modal) e cadastro de empresas em Configurações */
.modal-card.wide { width: min(860px, 100%); }
.balance-edit-accounts { max-height: 40vh; }
#balanceEditForm input { padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-solid); color: var(--text); font: inherit; }
#balanceEditForm input[name^="name-"] { width: 230px; }
@media (max-width: 600px) {
  .balance-edit-accounts { max-height: 26vh; }
}
.cli-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.cli-form .full { grid-column: 1 / -1; }
.cli-form .half { grid-column: span 2; }
.cli-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); }
.cli-form input, .cli-form select { height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-solid); color: var(--text); font: 13.5px 'Inter', sans-serif; }
.cli-form input:focus, .cli-form select:focus { outline: 2px solid var(--blue); outline-offset: 0; }
.cli-form input:invalid:not(:placeholder-shown) { border-color: rgba(255, 77, 99, 0.6); }
.cli-form small { color: var(--muted); font-size: 11px; }
.cli-form fieldset { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 14px; margin: 2px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.cli-form legend { padding: 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8fb6ff; }
.cli-form .form-error { grid-column: 1 / -1; }
.cli-form .actions { grid-column: 1 / -1; }
.cad-table td { padding: 7px 10px; vertical-align: middle; white-space: nowrap; }
.cad-table .name { display: flex; flex-direction: column; line-height: 1.3; }
.cad-table .name strong { font-size: 13px; font-weight: 600; }
.cad-table .name small { color: var(--muted); font-size: 11.5px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.cad-table .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.cad-table .row-actions button { height: 30px; padding: 0 8px; font-size: 12px; }
.cad-table .row-actions button [data-icon], .cad-table .row-actions button svg { width: 14px; height: 14px; }
.cad-table tr.inactive td { opacity: 0.55; }
.cad-groups { display: flex; flex-direction: column; gap: 8px; }
.cad-group { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--row); }
.cad-group .members { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.cad-group .members .chip { height: 24px; font-size: 11.5px; padding: 0 9px; }
.cad-group input { height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-solid); color: var(--text); font: 13px 'Inter', sans-serif; min-width: 0; }
.cad-group .row-actions { display: flex; gap: 6px; }
.cad-group .row-actions button { height: 30px; padding: 0 10px; font-size: 12px; }
@media (max-width: 760px) { .cli-form, .cli-form fieldset { grid-template-columns: 1fr; } .cli-form .half { grid-column: auto; } }

/* DRE › Cenários econômicos */
.cen-scope { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cen-scope .chip { cursor: pointer; }
.cen-scope .chip.active { background: rgba(47, 140, 255, 0.18); border-color: var(--blue); color: var(--text); }
.cen-scope .chip:hover { border-color: var(--blue); }
.cen-table td { white-space: nowrap; } .cen-table tr[data-metric] { cursor: pointer; } .cen-table tr[data-metric]:hover td { background: rgba(47, 140, 255, 0.08); }
.cen-table td.r.up { color: #36e08e; } .cen-table td.r.down { color: #ff6b7f; }
.cen-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .cen-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  [data-card='escopo'] .card-head { flex-wrap: wrap; }
  .cen-scope { flex-basis: 100%; }
  .cen-grid .card-head, .cen-rank .card-head { flex-wrap: wrap; }
  .cen-grid .card-head .titles { flex-basis: 100%; }
  .cen-grid .card-head .chip, .cen-grid .card-head .mini-select { margin-left: auto; }
}
.cen-table td .status { margin-left: 6px; }
.cen-scen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cen-scen .card { padding: 14px 16px; }
.cen-scen .lbl { font-size: 12px; color: var(--text-2); min-height: 32px; }
.cen-scen .val { font-size: 22px; font-weight: 700; margin: 8px 0 4px; }
.cen-scen .sub { font-size: 12px; color: var(--muted); }
.cen-scen .card.me { border-color: rgba(80, 150, 255, 0.55); box-shadow: 0 0 18px rgba(47, 140, 255, 0.2); }
.cen-rank .hbars { grid-template-columns: auto 1fr auto; }
.cen-rank .hbars .lbl.me { color: var(--cyan); font-weight: 600; }
@media (max-width: 1280px) { .cen-scen { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .cen-scen { grid-template-columns: 1fr; } }
@media print { .page-actions, .group-btn, .emp-bar { display: none !important; } }

/* Aviso de contexto (aba por CNPJ com várias empresas selecionadas) */
.notice { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; font-size: 13px; color: #dfe8f6; background: rgba(47, 140, 255, 0.12); border: 1px solid rgba(47, 140, 255, 0.35); }
.notice [data-icon], .notice svg { width: 16px; height: 16px; flex: none; color: #7cb8ff; }
.cen-table tr[data-metric]:focus-visible { outline: 2px solid #7cb8ff; outline-offset: -2px; }

/* Contraste e interação do tema claro. */
.nav a.active, .nav a.active .ico { color: #124c97; }
.nav a.active { box-shadow: inset 3px 0 0 var(--blue); }
.brand img { filter: none; }
.waves { opacity: .28; }
.innexo { color: var(--text); }
.btn-export { color: var(--blue-2); box-shadow: none; }
.card.glow { box-shadow: 0 4px 16px rgba(25, 57, 99, .06); border-color: #8bb3eb; }
.btn-primary { box-shadow: 0 3px 8px rgba(25, 100, 209, .16); border-color: var(--blue-2); }
.badge, .count, .lvl { color: #fff; box-shadow: none; }
.badge, .count, .lvl-danger { background: #c52e46; }
.lvl-warning { background: #8a5600; }
.lvl-info { background: var(--blue); }
.sim-preset.active { color: #124c97; background: #deebff; }
.be-bar i { background: var(--text); box-shadow: none; }
.switch span { background: #687c97; }
.switch span::after { background: #fff; }
:where(a, button, input, select):focus-visible { outline: 2px solid var(--blue-2); outline-offset: 3px; }
input::placeholder { color: var(--muted); opacity: 1; }
.switch input:focus-visible + span { outline: 2px solid var(--blue-2); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Telas estreitas preservam o tamanho dos rótulos, sem comprimir os gráficos. */
@media (max-width: 620px) {
  .card-head { flex-wrap: wrap; }
  .card-head .titles { min-width: 150px; }
  .card-head .chip { flex-basis: 100%; white-space: normal; height: auto; min-height: 28px; padding: 6px 10px; }
  #lineChart, #projChart, #waterfall, #simWaterfall { overflow-x: auto; }
  #lineChart > svg, #projChart > svg { min-width: 760px; }
  #waterfall > svg, #simWaterfall > svg { min-width: 620px; }
}
@media (max-width: 480px) {
  .filters { display: grid; grid-template-columns: 1fr; }
}

/* ---------- Tema escuro ---------- */
:root[data-theme='dark'] {
  --bg: #0c1526;
  --bg-2: #111e33;
  --panel: rgba(19, 32, 53, 0.98);
  --panel-solid: #132035;
  --panel-2: #182943;
  --row: #182943;
  --row-hi: #203654;
  --line: rgba(157, 188, 231, 0.18);
  --line-2: rgba(157, 188, 231, 0.34);
  --text: #edf5ff;
  --text-2: #b3c5dc;
  --muted: #9aafca;
  --blue: #67adff;
  --blue-2: #4799f5;
  --cyan: #85c2ff;
  --green: #62d29b;
  --green-2: #62d29b;
  --red: #ff8999;
  --amber: #ffd083;
  --purple: #c5a7ff;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}
:root[data-theme='dark'] body {
  background: radial-gradient(1100px 560px at 80% -10%, rgba(62, 132, 246, .13), transparent 62%), var(--bg);
}
:root[data-theme='dark'] .sidebar { background: linear-gradient(180deg, #101d31, #0d182a); }
:root[data-theme='dark'] .topbar { background: linear-gradient(180deg, rgba(15, 27, 46, .98), rgba(15, 27, 46, .94)); }
:root[data-theme='dark'] .main { background: var(--bg); }
:root[data-theme='dark'] .powered .sep { background: var(--muted); }
:root[data-theme='dark'] .powered-by, :root[data-theme='dark'] .field-label,
:root[data-theme='dark'] .user-text small, :root[data-theme='dark'] .page-head p,
:root[data-theme='dark'] .updated, :root[data-theme='dark'] .login-foot,
:root[data-theme='dark'] .login-demo-title, :root[data-theme='dark'] .be-value small,
:root[data-theme='dark'] .be-target .be-note small { color: var(--text-2); }
:root[data-theme='dark'] .innexo, :root[data-theme='dark'] .nav a,
:root[data-theme='dark'] .nav a .ico, :root[data-theme='dark'] .icon-btn,
:root[data-theme='dark'] .select .lead, :root[data-theme='dark'] .menu-section strong,
:root[data-theme='dark'] .kpi-label, :root[data-theme='dark'] .hbars .lbl,
:root[data-theme='dark'] .hbars .val, :root[data-theme='dark'] .chip,
:root[data-theme='dark'] .chip [data-icon], :root[data-theme='dark'] .tbl th,
:root[data-theme='dark'] .tbl tr.l1 td, :root[data-theme='dark'] .tbl tr.l2 td,
:root[data-theme='dark'] .legend, :root[data-theme='dark'] .bp-table th,
:root[data-theme='dark'] .bp-table tr.child td:first-child, :root[data-theme='dark'] .ind-card .lbl,
:root[data-theme='dark'] .ia-list .insight .t { color: var(--text); }
:root[data-theme='dark'] .nav a.active, :root[data-theme='dark'] .nav a.active .ico { color: #d9ecff; }
:root[data-theme='dark'] .nav a.active { background: linear-gradient(90deg, rgba(68, 137, 230, .28), rgba(33, 70, 122, .22)); }
:root[data-theme='dark'] .btn-export { color: #d7ebff; border-color: #4b94e7; background: linear-gradient(180deg, #1c426e, #17375e); }
:root[data-theme='dark'] .theme-toggle { background: #182e4c; color: #ffd272; }
:root[data-theme='dark'] .theme-toggle:hover { background: #24466f; }
:root[data-theme='dark'] .select select, :root[data-theme='dark'] .mini-select select,
:root[data-theme='dark'] .search input, :root[data-theme='dark'] .form input,
:root[data-theme='dark'] .form select, :root[data-theme='dark'] .login-field input,
:root[data-theme='dark'] .pw-form input, :root[data-theme='dark'] .sim-num { background: #101f34; }
:root[data-theme='dark'] .menu, :root[data-theme='dark'] .modal-card,
:root[data-theme='dark'] .modal-card header, :root[data-theme='dark'] .toast { background: var(--panel-solid); }
:root[data-theme='dark'] .card.glow { background: linear-gradient(180deg, #152c4a, #11233c); border-color: #4e90d8; }
:root[data-theme='dark'] .btn-ghost, :root[data-theme='dark'] .chip,
:root[data-theme='dark'] .insight .num, :root[data-theme='dark'] .icon-btn.square { background: var(--panel-2); }
:root[data-theme='dark'] .alert-row:hover { background: var(--row-hi); }
:root[data-theme='dark'] .hbars .track { background: #263b59; }
:root[data-theme='dark'] .tbl th, :root[data-theme='dark'] .dre-table th { background: #1a304e; }
:root[data-theme='dark'] .tbl tr.l0 td, :root[data-theme='dark'] .dre-table tr.subtotal td,
:root[data-theme='dark'] .bp-table tr.group td, :root[data-theme='dark'] .bp-table tr.totalrow td { background: #1a3457; }
:root[data-theme='dark'] .dre-table tr.total td { background: linear-gradient(90deg, #1d426d, #19365a); }
:root[data-theme='dark'] .bp-table.red tr.group td { background: #43263a; }
:root[data-theme='dark'] .bp-table.red tr.group.purple td { background: #30264b; }
:root[data-theme='dark'] .chart text { fill: var(--text-2); }
:root[data-theme='dark'] .chart-tip { background: #132641; }
:root[data-theme='dark'] .switch span { background: #445874; }
:root[data-theme='dark'] input::placeholder, :root[data-theme='dark'] .search input::placeholder { color: #9aafca; }
:root[data-theme='dark'] .login { background: radial-gradient(1100px 560px at 20% -10%, rgba(64, 137, 245, .28), transparent 62%), var(--bg); }

/* Novo Cliente › grupo econômico e matriz */
.nc-group h3 { margin: 6px 0 2px; font-size: 14px; }
.nc-group .nc-help { margin: 0 0 4px; }

/* Multi-tenant: escolha do escritório no login e Configurações › Escritório (marca). */
.login-tenant-name { color: var(--text); font-size: 15px; }
.login-tenant select { height: 42px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-solid); color: var(--text); padding: 0 12px; font: inherit; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type='color'] { width: 46px; height: 36px; padding: 2px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel-solid); cursor: pointer; }
.color-field code { font-size: 12.5px; color: var(--text-2); }
.brand-logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand-logo-row small { color: var(--muted); }
.brand-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 18px; border-radius: 12px; border: 1px solid var(--line); border-top: 4px solid var(--brand-accent, #2fd49a); background: var(--panel-2); text-align: center; }
.brand-preview img { max-width: 160px; max-height: 96px; object-fit: contain; }
.brand-preview strong { font-size: 16px; color: var(--text); }
.brand-preview span { font-size: 11px; letter-spacing: 2.4px; text-transform: uppercase; color: var(--muted); }
.brand-preview .btn-primary { margin-top: 8px; pointer-events: none; }

/* Competência: mês, ano, intervalo ou meses avulsos (public/js/period-picker.js) */
.pp-btn { display: inline-flex; align-items: center; gap: 10px; height: 38px; min-width: 188px; padding: 0 14px 0 13px; background: #fff; color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; font: 500 13.5px/1 'Inter', sans-serif; cursor: pointer; white-space: nowrap; }
.pp-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.pp-btn [data-icon] { width: 17px; height: 17px; flex: none; }
.pp-btn [data-icon='chevron'] { width: 13px; height: 13px; margin-left: auto; color: var(--text-2); }
.pp-btn .pp-label { overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.pp-inline { width: 100%; }
.menu-period { width: 320px; padding: 12px; left: 0; right: auto; }
.pp-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 3px; border-radius: 9px; background: rgba(47, 140, 255, .08); margin-bottom: 10px; }
.pp-tabs button { height: 30px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.pp-tabs button.on { background: var(--blue); color: #fff; }
.pp-year { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.pp-year button { width: 30px; height: 30px; border-radius: 8px; font-size: 18px; }
.pp-year button:hover { background: rgba(47, 140, 255, .14); }
.pp-hint { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.pp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pp-grid button { position: relative; height: 34px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 13px; }
.pp-grid button:hover { border-color: var(--blue); }
.pp-grid button.in { background: rgba(47, 140, 255, .14); border-color: rgba(47, 140, 255, .35); }
.pp-grid button.on { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.pp-grid button.has::after { content: ''; position: absolute; right: 5px; top: 5px; width: 5px; height: 5px; border-radius: 50%; background: #22c55e; }
.pp-years { grid-template-columns: repeat(3, 1fr); max-height: 190px; overflow: auto; }
.pp-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.pp-actions button { height: 32px; padding: 0 14px; font-size: 13px; }
.pp-actions button[disabled] { opacity: .45; cursor: not-allowed; }
.pp-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.pp-quick span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; width: 100%; }
.pp-quick button { padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; }
.pp-quick button:hover { border-color: var(--blue); }
.pp-legend { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pp-legend i { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }
:root[data-theme='dark'] .pp-btn { background: #101f34; }
@media (max-width: 760px) { .pp-btn { min-width: 0; width: 100%; } .menu-period { width: min(320px, calc(100vw - 32px)); } }

/* Revisão do envio (leitura automática do balancete/balanço) */
.preview-doc .kpis { margin: 12px 0; }
.preview-doc .stat { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.preview-doc .stat small { font-size: 11.5px; color: var(--muted); }
.preview-doc .stat strong { font-size: 16px; }
.preview-doc h3 { margin: 6px 0 8px; font-size: 14px; }
.preview-doc .neg { color: var(--red, #e5484d); }
.preview-doc details { margin: 10px 0 14px; }

/* Aviso "números dos demonstrativos enviados" (legível nos dois temas) */
.notice[data-ledger='imported'] { color: var(--text); background: rgba(34, 197, 94, 0.10); border-color: rgba(34, 197, 94, 0.40); }
.notice[data-ledger='imported'] [data-icon], .notice[data-ledger='imported'] svg { width: 16px; height: 16px; color: #16a34a; flex: none; }

/* Campo de arquivo em português (public/js/br-inputs.js) */
.br-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.br-file { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.br-file .btn-ghost { height: 34px; padding: 0 14px; font-size: 13px; flex: none; }
.br-file-name { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A entrada pertence à Vision; a identidade do escritório começa na área logada. */
body.anon { --blue: #1964d1; --blue-2: #1455b7; --brand: #1964d1; --brand-accent: #7cc4ff; }
:root[data-theme='dark'] body.anon { --blue: #67adff; --blue-2: #4799f5; }
.login-logo { width: 240px; max-width: 100%; height: 80px; }
:root[data-theme='dark'] .login-logo { filter: brightness(1.65); }
.login-card h1 { font-size: 23px; letter-spacing: -.6px; }
.login-sub { line-height: 1.65; }

.dashboard-custom { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dashboard-custom .kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.dashboard-custom .grid { margin-top: 0; }
.dashboard-custom .grid:not(:has(> :not([hidden]))), .dashboard-custom .kpis:not(:has(> :not([hidden]))) { display: none; }
.dashboard-custom .grid:has(> [hidden]) { grid-template-columns: minmax(0, 1fr); }
.dashboard-custom[data-layout='stacked'] .grid { grid-template-columns: minmax(0, 1fr); }
.dashboard-custom[data-density='compact'] { gap: 8px; }
.dashboard-custom[data-density='compact'] .card { padding: 12px; }
.dashboard-custom[data-density='compact'] .kpis, .dashboard-custom[data-density='compact'] .grid { gap: 8px; }
.dashboard-custom [data-card='resultado'], .dashboard-custom [data-card='grupos'] { min-width: 0; }
.chart-expand { margin: 0 0 12px auto; display: flex; font-size: 12px; height: 30px; }
.vision-dialog { color: var(--text); background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 16px; padding: 0; width: min(660px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-shadow: var(--shadow); }
.vision-dialog::backdrop { background: rgba(2, 6, 16, .72); backdrop-filter: blur(3px); }
.vision-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; position: sticky; top: 0; z-index: 2; background: var(--panel-solid); border-bottom: 1px solid var(--line); }
.vision-dialog h2 { font-size: 20px; margin: 0; }
.vision-dialog h3 { font-size: 16px; margin: 24px 0 12px; }
.vision-dialog .btn-ghost, .vision-dialog .btn-primary { min-height: 38px; }
.vision-dialog-body { padding: 20px 24px 24px; }
.vision-dialog-body > p { margin-top: 0; color: var(--text-2); line-height: 1.7; }
.vision-dialog fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin: 16px 0; }
.vision-dialog legend { font-weight: 600; padding: 0 6px; }
.dashboard-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dashboard-option { display: flex; align-items: center; gap: 8px; line-height: 1.5; cursor: pointer; }
.dashboard-option input { width: 17px; height: 17px; accent-color: var(--blue); flex-shrink: 0; }
.vision-dialog form > .dashboard-option { margin: 18px 0; }
.vision-dialog .actions { flex-wrap: wrap; }
.chart-dialog { width: calc(100vw - 40px); height: calc(100dvh - 40px); max-width: 1500px; }
:root:fullscreen .chart-dialog { max-width: none; width: 100vw; height: 100dvh; max-height: none; border-radius: 0; overflow: auto; }
.expanded-plot { padding: 20px 0; min-width: 0; }
.expanded-plot .hbars { padding: 20px 0; }
.chart-data-table { overflow-x: auto; }
.chart-data-table table { width: 100%; border-collapse: collapse; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-data-table th, .chart-data-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: right; }
.chart-data-table th:first-child { text-align: left; }
.chart-data-table thead { background: var(--panel-2); }
.chart-data-table tbody th { font-weight: 500; }
.chart-data-table tbody tr:hover { background: var(--row); }
html:has(.vision-dialog[open]) { overflow: hidden; }
button:focus-visible, .vision-dialog input:focus-visible, .vision-dialog select:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
@media (max-width: 600px) {
  .dashboard-custom .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vision-dialog > header { padding: 12px; align-items: flex-start; flex-wrap: wrap; }
  .vision-dialog-body { padding: 16px 12px; }
  .chart-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); }
  .dashboard-options { grid-template-columns: 1fr; }
  .expanded-plot { overflow-x: auto; }
  .expanded-plot .chart { min-width: 660px; }
  .expanded-plot .hbars { min-width: 430px; }
}
@media print { .chart-expand, .vision-dialog { display: none !important; } }

/* Edição do envio selecionado no inventário de balancetes. */
#documentForm { scroll-margin-top: 100px; }
.notice.balance-editing-notice { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 18px; color: var(--text); }
.balance-editing-notice p { margin: 6px 0 0; }
.balance-editing-notice button { flex-shrink: 0; }
@media (max-width: 600px) { .notice.balance-editing-notice { flex-direction: column; } }

/* Comparativo de empresas */
.compare-intro { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:16px; }
.compare-intro > div { display:flex; flex-direction:column; gap:3px; }
.compare-intro span, .compare-note { color:var(--text-2); font-size:13px; }
.compare-intro nav { display:flex; flex-wrap:wrap; gap:8px; }
.compare-intro nav a { color:var(--blue); border:1px solid var(--line-2); border-radius:8px; padding:7px 12px; text-decoration:none; font-size:13px; }
.compare-section { margin-bottom:16px; scroll-margin-top:20px; }
.compare-scroll { overflow-x:auto; }
.comparison-table { min-width:560px; }
.comparison-table th:not(:first-child), .comparison-table td { min-width:160px; text-align:right; white-space:nowrap; }
.comparison-table th:first-child { min-width:180px; text-align:left; }
.comparison-table thead small { display:block; font-weight:400; color:var(--muted); margin-top:3px; }
.comparison-table tbody th { font-weight:500; }
.compare-status { display:block; color:var(--text-2); font-size:11px; margin-top:3px; }
.compare-chart { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); gap:22px; }
.compare-chart-group h3 { margin:0 0 14px; font-size:15px; }
.compare-bar-row { display:grid; grid-template-columns:minmax(80px,1fr) minmax(45px,1.2fr) auto; align-items:center; gap:8px; margin:10px 0; font-size:12px; }
.compare-bar-row > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.compare-bar-row strong { font-size:12px; white-space:nowrap; }
.compare-bar-track { height:8px; background:var(--line-2); border-radius:8px; overflow:hidden; }
.compare-bar-track i { display:block; height:100%; background:var(--blue); border-radius:inherit; }
.compare-bar-track i.negative { background:var(--red); }
.compare-note { margin:14px 0 0; }
.compare-notice { color:var(--text); display:block; }
.compare-select { display:flex; align-items:center; gap:10px; margin:0 0 12px; font-size:13px; color:var(--text-2); }
.compare-select select { padding:6px 9px; border:1px solid var(--line-2); border-radius:7px; background:var(--panel-solid); color:var(--text); }

/* VIS-000024: operações financeiras no simulador. */
.sim-capital-label { display:block; font-weight:600; font-size:12px; margin-bottom:7px; }
.sim-capital-label small { display:block; color:var(--text-2); font-weight:400; line-height:1.5; }
.sim-capital .sim-num { width:100%; box-sizing:border-box; }
.sim-capital .sim-num input { width:100%; min-width:0; }
.sim-finance-mode { display:grid; gap:6px; font-size:12px; font-weight:600; }
.sim-finance-mode select { width:100%; min-width:0; padding:8px; color:var(--text); background:var(--panel-solid); border:1px solid var(--line-2); border-radius:8px; }
.sim-financing { min-width:0; }
.sim-financing small { display:block; font-size:11px; color:var(--text-2); margin-top:4px; }
.sim-financing .table-wrap { overflow-x:auto; }
.sim-financing table { min-width:650px; }
.sim-finance-totals { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:14px 0; }
.sim-finance-totals span, .sim-finance-totals strong { display:block; }
.sim-finance-totals span { color:var(--text-2); font-size:12px; margin-bottom:4px; }
.sim-finance-totals strong { font-size:18px; overflow-wrap:anywhere; }
.sim-inactive { opacity:.6; }
@media(max-width:600px) { .sim-finance-totals { grid-template-columns:1fr; } }

.sim-financing caption { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
@media(max-width:600px) {
  .sim-financing table { min-width:0; width:100%; }
  .sim-financing thead { display:none; }
  .sim-financing tbody, .sim-financing tbody tr { display:block; }
  .sim-financing tbody tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding-bottom:12px; }
  .sim-financing td { display:block; padding:6px 0; white-space:normal; text-align:left; border:0; }
  .sim-financing td:first-child { grid-column:1/-1; font-weight:600; }
  .sim-financing td[data-label]::before { content:attr(data-label); display:block; font-size:11px; color:var(--text-2); margin-bottom:4px; }
}

/* VIS-000026: resultados legíveis e consulta ampliada da simulação. */
.sim-grid { grid-template-columns: minmax(280px,340px) minmax(0,1fr); }
.sim-right { container-type:inline-size; container-name:sim-results; }
.sim-mid { grid-template-columns:minmax(0,1fr); }
.sim-side { grid-template-columns:repeat(2,minmax(0,1fr)); }
.sim-right .card, .sim-kpis .kpi { min-width:0; }
.sim-kpis { grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr)); }
.sim-kpis .kpi-value { font-size:clamp(18px,3cqi,26px); overflow-wrap:anywhere; }
.sim-kpis .kpi-foot { flex-wrap:wrap; }
.sim-mid .table-wrap { max-width:100%; }
.sim-table { min-width:740px; }
.sim-side .card-head, .sim-financing .card-head, [data-card="dre-simulada"] .card-head, [data-card="projecao"] .card-head { flex-wrap:wrap; gap:10px; }
.sim-expand { margin-left:auto; flex:none; height:32px; padding:0 10px; font-size:12px; white-space:nowrap; }
.be-value { overflow-wrap:anywhere; }
.be-list div { flex-wrap:wrap; gap:4px 10px; }
.be-list dd { max-width:100%; overflow-wrap:anywhere; }
.proj-totals { grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); }
.proj-totals b { overflow-wrap:anywhere; }
.sim-expanded-content .table-wrap { overflow:auto; max-width:100%; }
.sim-expanded-content .sim-expanded-table { min-width:740px; width:100%; }
.sim-expanded-content .sim-expanded-table th, .sim-expanded-content .sim-expanded-table td { display:table-cell !important; }
.sim-expanded-content .sim-expanded-table td:first-child { min-width:180px; }
.sim-expanded-plot { overflow-x:auto; }
.sim-expanded-plot svg { min-width:620px; }
@container sim-results (max-width:850px) { .sim-side { grid-template-columns:minmax(0,1fr); } }
@media(max-width:980px) { .sim-grid { grid-template-columns:minmax(0,1fr); } .sim-panel { max-height:none; overflow:visible; } }
@media(max-width:560px) {
  .sim-table { min-width:0; width:100%; table-layout:auto; }
  .sim-table td:first-child, .sim-table th:first-child { width:36%; }
  .sim-mid .sim-table td.r, .sim-mid .sim-table th.r { white-space:nowrap; overflow-wrap:normal; font-size:12px; padding:7px 6px; }
  .sim-expanded-content .sim-expanded-table { table-layout:auto; }
  .sim-kpis { grid-template-columns:1fr; }
}
@media print { .sim-expand { display:none !important; } }

.sim-table-hint { font-size:12px; color:var(--text-2); }
.sim-expanded-content .sim-expanded-table td:first-child, .sim-expanded-content .sim-expanded-table th:first-child { width:180px; min-width:180px; white-space:normal; }
.sim-expanded-content .sim-expanded-table td.r, .sim-expanded-content .sim-expanded-table th.r { white-space:nowrap; overflow-wrap:normal; }

/* VIS-000027: atalhos de envio visíveis na ausência de demonstrativo. */
.balance-empty-actions .actions { justify-content:center; flex-wrap:wrap; gap:12px; }
.balance-empty-actions .btn-ghost { white-space:normal; height:auto; min-height:38px; padding:10px 14px; }
[data-balance-upload-context] { display:block; margin-bottom:14px; text-align:left; color:var(--text); background:rgba(47,140,255,.1); border-color:var(--blue); }
[data-balance-upload-context] p { margin:8px 0 0; }
#documentForm:focus { outline:2px solid var(--blue); outline-offset:6px; }
@media(max-width:560px) { #pageActions [data-balance-upload] { white-space:normal; height:auto; min-height:38px; padding:8px 12px; } }
