:root {
  --brand-primary: #142845;
  --brand-secondary: #9dc0e8;
  --brand-menu-text: #ffffff;
  --brand-muted-text: #b6ccdd;
  --navy: #142845;
  --navy-dark: #0d1c33;
  --gold: #9dc0e8;
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #262626;
  --grey: #6b7280;
  --border: #d6dee8;
  --green: #1a7f37;
  --red: #b3261e;
}

* { box-sizing: border-box; }

body {
  --navy: var(--brand-primary);
  --gold: var(--brand-secondary);
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  flex-wrap: wrap;
  gap: 10px;
}

.brand { color: white; text-decoration: none; display: flex; align-items: baseline; gap: 8px; }
.brand-tag { color: var(--gold); font-weight: 700; letter-spacing: 1px; font-size: 13px; }
.brand-name { font-weight: 600; font-size: 18px; }

.topbar nav { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.topbar nav a { color: #d7e0f2; text-decoration: none; }
.topbar nav a:hover { color: white; text-decoration: underline; }
.topbar .sep { color: #6a80ab; }
.current-empresa { color: var(--gold); font-weight: 600; }
.topbar-page-title { display: none; }

main { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }

footer {
  text-align: center;
  color: var(--grey);
  font-size: 12px;
  padding: 24px;
}

h1 { font-size: 24px; margin: 0 0 6px; color: var(--navy); }
h2 { font-size: 18px; color: var(--navy); margin: 28px 0 10px; }
p.subtitle { color: var(--grey); margin: 0 0 24px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(20, 37, 68, 0.04);
}

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

.empresa-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  transition: box-shadow .15s, transform .15s;
}
.empresa-card:hover { box-shadow: 0 4px 14px rgba(20,37,68,.12); transform: translateY(-1px); }
.grupo-card { margin-bottom: 16px; border-color: #b8c2d6; background: #f9fbff; }
.empresa-card .fantasia { font-weight: 700; color: var(--navy); font-size: 16px; }
.empresa-card .razao { color: var(--grey); font-size: 12px; margin-top: 2px; }
.empresa-card .meta { margin-top: 12px; font-size: 12px; color: var(--grey); display: flex; justify-content: space-between; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-pendente { background: #fdecea; color: var(--red); }
.badge-ok { background: #e9f7ee; color: var(--green); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--grey); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

tr.n1-row td { font-weight: 700; }
tr.n1-row.subtotal td { background: #f0f3f9; color: var(--navy); }
tr.n2-row td { color: var(--grey); font-weight: 500; }
tr.n2-row td.label { padding-left: 28px; }
tr.n3-row td { color: #617087; font-weight: 500; }
tr.n3-row td.label { padding-left: 54px; }
tr.conta-row td { color: var(--grey); font-size: 11px; }
tr.conta-row td.label { padding-left: 54px; }
tr.conta-row[data-level="4"] td.label { padding-left: 80px; }
.conta-codigo { color: #8a94a6; font-variant-numeric: tabular-nums; margin-right: 5px; }
.drill-hidden { display: none; }
.drill-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; margin-right: 5px;
  border: 0; background: transparent; color: #25364d; font-size: 10px;
  vertical-align: middle;
}
.drill-toggle:hover { background: #e6ebf4; }
.drill-spacer { display: inline-block; width: 27px; }
.drill-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; color: #25364d; font-weight: 600;
}
button.drill-action {
  padding: 7px 12px; border: 0; border-radius: 999px;
  background: #edf2f7; color: #31445d; font-size: 11px;
}
button.drill-action:hover { background: #102947; color: #fff; }

form.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.dashboard-filtros { margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--grey); font-weight: 600; }
input, select, button {
  font-family: inherit; font-size: 14px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: 7px; background: white; color: var(--text);
}
select { min-width: 220px; }
button {
  background: var(--navy); color: var(--brand-menu-text);
  border: 1px solid color-mix(in srgb, var(--brand-menu-text) 35%, transparent);
  cursor: pointer; font-weight: 600;
  padding: 10px 18px;
}
button:hover { background: var(--navy-dark); }
button.secondary { background: white; color: var(--navy); border: 1px solid var(--navy); }
button.secondary:hover { background: #f0f3f9; }

.flash-wrap { margin-bottom: 18px; }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.flash-ok { background: #e9f7ee; color: var(--green); border: 1px solid #bfe6cc; }
.flash-erro { background: #fdecea; color: var(--red); border: 1px solid #f3c6c2; }

.pendencia-row { border-bottom: 1px solid var(--border); padding: 14px 0; }
.pendencia-row .conta-info { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.pendencia-row .nome { font-weight: 600; }
.pendencia-row .codic { color: var(--grey); font-size: 12px; }
.pendencia-row .valor { font-variant-numeric: tabular-nums; font-weight: 600; }
.pendencia-row .valor.neg { color: var(--red); }
.pendencia-row .valor.pos { color: var(--green); }
.nova-conta-fields { display: none; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.nova-conta-fields.show { display: flex; }

.pill-alert {
  background: #fff4e5; border: 1px solid #f4d9a8; color: #8a5a12;
  padding: 10px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 18px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.pill-alert a { color: #8a5a12; font-weight: 700; }
.pill-alert .pill-alert-action {
  padding: 8px 12px; flex: 0 0 auto; color: #6f460c; background: #fff;
  border: 1px solid #d8ad65; border-radius: 7px; text-decoration: none;
  box-shadow: 0 3px 8px rgba(138,90,18,.09); transition: background .15s, border-color .15s, transform .15s;
}
.pill-alert .pill-alert-action:hover,
.pill-alert .pill-alert-action:focus-visible { outline: none; background: #fffbf4; border-color: #b7791f; transform: translateY(-1px); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.kpi .label { font-size: 12px; color: var(--grey); text-transform: uppercase; letter-spacing: .03em; }
.kpi .value { font-size: 22px; font-weight: 700; color: var(--navy); margin-top: 4px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--grey); }
.empty-state a { color: var(--navy); font-weight: 600; }

.table-scroll { overflow-x: auto; }
canvas { max-width: 100%; }

/* Dashboard inspirado na pagina "DRE Mes" do Power BI original. */
.bi-dashboard {
  min-width: 320px; min-height: 100vh; overflow: hidden;
  background: #eef1f4; font-family: Tahoma, "Segoe UI", sans-serif;
}
.bi-dashboard .topbar {
  position: relative; height: 68px; min-height: 68px; padding: 9px 24px;
  background: #102947;
}
.bi-dashboard .brand { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1; }
.bi-dashboard .brand-tag { color: #fff; font-size: 25px; letter-spacing: 0; }
.bi-dashboard .brand-name { color: #fff; font-size: 10px; text-transform: uppercase; margin-top: 5px; }
.bi-dashboard .topbar-page-title {
  display: block; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  color: #fff; font: 22px Tahoma, sans-serif; white-space: nowrap;
}
.bi-dashboard .topbar nav { z-index: 1; font-size: 12px; }
.bi-dashboard .topbar nav .current-empresa,
.bi-dashboard .topbar nav .sep { display: none; }
.bi-dashboard main {
  width: 100vw; max-width: none; height: calc(100vh - 68px); min-height: 520px;
  margin: 0; padding: 10px 12px 12px; overflow: hidden;
}
.bi-dashboard footer { display: none; }
.powerbi-frame {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px;
  width: 100%; height: 100%;
}
.powerbi-sidebar {
  position: relative; z-index: 5; padding: 58px 12px 14px 86px; overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid #dbe1e8; border-radius: 12px; background: #fff;
  box-shadow: 0 2px 8px rgba(16, 41, 71, .06);
}
.powerbi-nav-icons {
  position: absolute; left: 10px; top: 10px; bottom: 10px; width: 62px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding-top: 16px; border-radius: 10px; background: #102947;
}
.powerbi-nav-icons a {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 8px; color: #c3c8cc; text-decoration: none; font-size: 28px;
}
.powerbi-nav-icons a:hover, .powerbi-nav-icons a.active { color: #1ec804; background: rgba(255,255,255,.08); }
.filter-panel-title {
  position: absolute; top: 20px; left: 86px; color: #102947;
  font-size: 16px; font-weight: 700;
}
.visible-filter { min-height: 0; margin-bottom: 13px; display: flex; flex-direction: column; }
.visible-filter-title {
  min-height: 27px; display: flex; align-items: center; justify-content: space-between;
  color: #102947;
}
.visible-filter-title strong { font-size: 12px; }
.visible-filter-title span { color: #5f6b7a; font-size: 9px; }
.visible-filter-list {
  overflow-y: auto; border: 0; border-radius: 8px;
  background: transparent; scrollbar-width: thin; scrollbar-color: #c1cad4 transparent;
}
.company-list {
  flex: 0 1 auto;
  max-height: 248px;
}
.company-list label { min-height: 24px; margin: 0; padding-block: 2px; }
.visible-filter-list label.master-option {
  position: sticky; top: 0; z-index: 3; min-height: 30px; margin: 0 0 4px;
  border-bottom: 1px solid #e2e7ed; border-radius: 0; background: #fff;
  color: #102947; font-weight: 700; isolation: isolate;
  box-shadow: 0 5px 7px -7px rgba(16,41,71,.45);
}
.visible-filter-list label.master-option:hover { background: #f5f7fa; }
.visible-filter-list label.master-option:has(input:checked) { background: #e9edf2; }
.visible-filter-list label {
  min-height: 28px; margin: 1px 0; padding: 4px 7px; display: flex; align-items: center; gap: 8px;
  border-radius: 6px; color: #34445a; font-size: 11px; font-weight: 600; cursor: pointer;
  transition: color .15s, background .15s;
}
.visible-filter-list label:hover { background: rgba(20,40,69,.06); color: #25364d; }
.visible-filter-list label:has(input:checked) { background: rgba(20,40,69,.11); color: #25364d; }
.visible-filter-list input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; min-width: 16px; margin: 0; padding: 0;
  display: grid; place-items: center; border: 1.5px solid #9ba8b7; border-radius: 5px;
  background: #fff; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.visible-filter-list input[type="checkbox"]::after {
  content: ""; width: 8px; height: 4px; margin-top: -2px;
  border: solid transparent; border-width: 0 0 2px 2px; transform: rotate(-45deg) scale(0);
  transition: transform .12s;
}
.visible-filter-list input[type="checkbox"]:checked { border-color: var(--brand-menu-text); background: var(--navy); }
.visible-filter-list input[type="checkbox"]:checked::after { border-color: var(--brand-menu-text); transform: rotate(-45deg) scale(1); }
.visible-filter-list input[type="checkbox"]:indeterminate { border-color: var(--brand-menu-text); background: var(--navy); }
.visible-filter-list input[type="checkbox"]:indeterminate::after {
  width: 8px; height: 0; margin: 0; border-width: 0 0 2px; border-color: var(--brand-menu-text);
  transform: none;
}
.visible-filter-list input[type="checkbox"]:focus-visible { outline: 3px solid rgba(20,40,69,.20); outline-offset: 2px; }
.period-filter { flex: 1 1 300px; }
.period-tree { flex: 1; padding: 0 2px 4px; background: #fff; }
.year-group summary {
  min-height: 32px; margin: 1px 0; padding: 4px 7px; display: flex; align-items: center; gap: 8px;
  border-radius: 6px; color: #25364d; list-style: none; cursor: pointer;
  transition: background .15s;
}
.year-group summary::-webkit-details-marker { display: none; }
.year-group summary:hover { background: #f0f4f8; }
.year-group summary strong { font-size: 12px; }
.year-chevron { color: #5f6b7a; font-size: 18px; line-height: 1; transition: transform .15s; }
.year-group[open] .year-chevron { transform: rotate(90deg); }
.month-list { padding-left: 25px; }
.month-list label { color: #425167; font-size: 11px; }
.powerbi-sidebar .field { margin-bottom: 16px; }
.powerbi-sidebar .field label { color: #657184; font: 700 10px Tahoma, sans-serif; text-transform: uppercase; letter-spacing: .05em; }
.powerbi-sidebar select {
  min-width: 0; width: 100%; padding: 9px 7px; border-color: #b9c4d1;
  border-radius: 7px; background: #fff; color: #102947; font-size: 11px;
}
.powerbi-sidebar select:focus { outline: 2px solid rgba(16,41,71,.18); border-color: #102947; }
.multi-filter { position: relative; width: 100%; }
.multi-filter summary {
  height: 36px; padding: 0 8px; display: flex; align-items: center; justify-content: space-between;
  border: 1px solid #b9c4d1; border-radius: 7px; background: #fff; color: #102947;
  font-size: 10px; cursor: pointer; list-style: none; user-select: none;
}
.multi-filter summary::-webkit-details-marker { display: none; }
.multi-filter summary:hover { border-color: #102947; }
.multi-filter summary b { color: #102947; font-size: 16px; }
.multi-filter-menu {
  position: absolute; z-index: 20; top: 41px; left: 0; width: 230px; max-height: 320px;
  padding: 8px; overflow-y: auto; border: 1px solid #b9c4d1; border-radius: 8px;
  background: #fff; box-shadow: 0 10px 28px rgba(16,41,71,.18);
}
.multi-filter-menu > label {
  min-height: 30px; padding: 5px 6px; display: flex; align-items: center; gap: 7px;
  border-radius: 5px; color: #26364b; font-size: 11px; cursor: pointer;
}
.multi-filter-menu > label:hover { background: #eef3f8; }
.multi-filter-menu input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: #102947; }
.multi-filter-actions { position: sticky; top: -8px; z-index: 1; padding: 4px 0 7px; display: flex; gap: 5px; background: #fff; }
.multi-filter-actions button {
  flex: 1; padding: 5px; border: 1px solid #c5ced8; background: #f6f8fa;
  color: #102947; font-size: 9px;
}
.filter-search {
  position: sticky; top: -8px; z-index: 2; width: 100%; margin-bottom: 5px;
  padding: 7px 8px; border-color: #c5ced8; font-size: 10px;
}
.competencias-menu .multi-filter-actions { top: 31px; }
.apply-filters {
  width: 100%; margin-top: 2px; padding: 8px 5px; border-radius: 7px;
  background: #102947; color: #fff; font-size: 10px;
}
.apply-filters:hover { background: #193b62; }
.variation-switch {
  margin: 2px 0 10px; display: flex; align-items: center; gap: 7px;
  color: #526176; font-size: 10px; cursor: pointer; user-select: none;
}
.variation-switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  position: relative; width: 30px; height: 17px; flex: none;
  border-radius: 999px; background: #b9c4d1; transition: background .15s;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 11px; height: 11px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s;
}
.variation-switch input:checked + .switch-track { background: #334155; }
.variation-switch input:checked + .switch-track::after { transform: translateX(13px); }
.variation-switch input:focus-visible + .switch-track { outline: 2px solid #d9b300; outline-offset: 2px; }
.powerbi-contexto {
  margin-top: 22px; padding-top: 14px; border-top: 1px solid #e5e9ee;
  color: #7b8798; font-size: 9px; text-transform: uppercase;
}
.powerbi-contexto strong { display: block; margin-top: 5px; color: #102947; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.sidebar-actions { display: none; }
.sidebar-actions a { color: #526176; font-size: 10px; text-decoration: none; }
.sidebar-actions a:hover { color: #102947; text-decoration: underline; }
.powerbi-content { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dashboard-heading {
  min-height: 64px; margin-bottom: 10px; padding: 10px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border-radius: 10px; background: #102947; color: #fff;
}
.dashboard-heading > div:first-child { display: grid; gap: 3px; }
.dashboard-heading strong { font-size: 17px; }
.dashboard-eyebrow { color: #b9c7d7; font-size: 9px; text-transform: uppercase; letter-spacing: .09em; }
.dashboard-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.dashboard-report-switch {
  display: flex; gap: 2px; padding: 3px;
  border: 1px solid rgba(255,255,255,.28); border-radius: 9px;
  background: rgba(0,0,0,.16);
}
.dashboard-report-switch button {
  min-height: 31px; padding: 6px 12px; border: 0; border-radius: 6px;
  color: #d4dde7; background: transparent; box-shadow: none;
  font-size: 10px; font-weight: 700;
}
.dashboard-report-switch button:hover { color: #fff; background: rgba(255,255,255,.1); }
.dashboard-report-switch button.active { color: #102947; background: #fff; }
.dashboard-view-switch {
  display: flex; gap: 2px; padding: 3px;
  border: 1px solid rgba(255,255,255,.2); border-radius: 9px;
  background: rgba(255,255,255,.08);
}
.dashboard-view-switch button {
  min-height: 31px; padding: 6px 10px; border: 0; border-radius: 6px;
  background: transparent; box-shadow: none; color: #d4dde7;
  font-size: 10px; font-weight: 600; white-space: nowrap;
}
.dashboard-view-switch button:hover { background: rgba(255,255,255,.1); color: #fff; }
.dashboard-view-switch button.active { background: #fff; color: #102947; }
.dashboard-view-switch button:focus-visible { outline: 2px solid #ede296; outline-offset: 1px; }
.periodo-card { color: #ede296; font-size: 20px; font-weight: 700; text-align: right; }
.periodo-card span { display: block; margin-top: 2px; color: #d4dde7; font-size: 10px; font-weight: 400; }
.bi-dashboard .pill-alert { margin: 0 0 8px; }
.bi-dashboard .card { box-shadow: none; }
.dre-matrix-card {
  display: flex; flex: 1; flex-direction: column; min-height: 0;
  margin: 0; padding: 0; border: 1px solid #cbd4df; border-radius: 10px;
  overflow: hidden; background: #fff;
}
.dre-matrix-card .drill-toolbar {
  flex: none; margin: 0; min-height: 52px; padding: 8px 14px;
  border-bottom: 1px solid #dfe5eb; background: #fff;
}
.drill-toolbar button.drill-action {
  padding: 7px 13px; border: 0; border-radius: 999px;
  background: #edf2f7; color: #31445d; box-shadow: none;
}
.drill-toolbar button.drill-action:hover { background: #102947; color: #fff; }
.drill-toolbar > div:first-child { display: grid; gap: 2px; }
.drill-hint { color: #5f6b7a; font-size: 10px; font-weight: 400; }
.dre-matrix-card .table-scroll { flex: 1; min-height: 0; max-height: none; overflow: auto; }
.dre-matrix-card table { table-layout: fixed; font-size: 12px; }
.dre-matrix-card col.dre-label-col { width: 390px; }
.dre-matrix-card col.value-col { width: 125px; }
.dre-matrix-card col.analysis-col-width { width: 72px; }
.dre-matrix-card col.variation-col-width { width: 88px; }
.dre-matrix-card th {
  position: sticky; top: 0; z-index: 3; padding: 7px 8px;
  border: 1px solid #09124f; background: #102947; color: #ede296;
  font: 700 12px Tahoma, sans-serif; text-align: center;
}
.dre-matrix-card th:first-child { left: 0; z-index: 5; min-width: 390px; text-align: left; }
.dre-matrix-card th:not(:first-child) { min-width: 125px; }
.dre-matrix-card thead tr.metric-head th { top: 30px; z-index: 3; }
.dre-matrix-card thead tr.comparison-head th { height: 30px; }
.dre-matrix-card thead tr.monthly-head th { height: 42px; }
.dre-matrix-card thead tr.comparison-head th:not(:first-child) { color: #fff; text-transform: none; }
.dre-matrix-card td { height: 36px; padding: 7px 10px; border: 1px solid #d2d9e1; }
.dre-matrix-card tbody td:first-child {
  position: sticky; left: 0; z-index: 2; background: #fff;
  box-shadow: 2px 0 4px rgba(16,41,71,.08);
}
.dre-matrix-card td.num { min-width: 118px; }
.dre-matrix-card td.num a,
.dre-matrix-card td.num [title*="3CX" i] {
  color: inherit !important;
  text-decoration: none !important;
  cursor: default !important;
  pointer-events: none !important;
}
.dre-matrix-card tr.n1-row td { font-weight: 600; }
.dre-matrix-card th.analysis-col:not(:first-child),
.dre-matrix-card td.analysis-col { min-width: 72px; width: 72px; }
.dre-matrix-card tr:nth-child(odd):not(.subtotal) td { background: #f6f7f8; }
.dre-matrix-card tr:nth-child(odd):not(.subtotal) td:first-child { background: #f6f7f8; }
.dre-matrix-card tr.n1-row.subtotal td { background: #e6e9ec; color: #102947; }
.dre-matrix-card tr.n1-row.subtotal td:first-child { background: #e6e9ec; }
.dre-matrix-card tr.dre-final-row td { font-weight: 900; }
.patrimonial-table tr.patr-level-1 td { background: #dfe4e9; font-weight: 800; }
.patrimonial-table tr.patr-level-1 td:first-child { background: #dfe4e9; }
.patrimonial-table tr.patr-level-2 td { font-weight: 700; }
.patrimonial-table tr.patr-level-2 td.label { padding-left: 30px; }
.patrimonial-table tr.patr-level-3 td.label { padding-left: 48px; }
.patrimonial-table tr.patr-level-4 td.label { padding-left: 66px; }
.patrimonial-table tr.patr-account-row td.label { padding-left: 86px; }
.dre-matrix-card .variacao-col, .dre-matrix-card td.variacao { min-width: 88px; }
.dre-matrix-card td.variacao { color: #5f6b7a; font-weight: 600; }
.dre-matrix-card td.variacao.negativa { color: #b42318; font-weight: 700; }
.dre-matrix-card td.variacao.positiva { color: #175cd3; font-weight: 700; }

@media (max-width: 850px) {
  .bi-dashboard { overflow: auto; }
  .bi-dashboard .topbar-page-title { display: none; }
  .bi-dashboard .topbar nav { width: 100%; overflow-x: auto; }
  .bi-dashboard main { width: 100%; height: auto; min-height: calc(100vh - 68px); overflow: visible; }
  .powerbi-frame { grid-template-columns: 1fr; }
  .powerbi-sidebar { padding: 14px; display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
  .powerbi-nav-icons { display: none; }
  .filter-panel-title, .sidebar-actions { display: none; }
  .powerbi-sidebar select { width: 180px; }
  .powerbi-contexto { margin: 0 0 14px; }
  .powerbi-content { padding-left: 0; }
  .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .dashboard-heading-actions { width: 100%; align-items: flex-start; flex-direction: column; }
  .dashboard-view-switch { width: 100%; }
  .dashboard-view-switch button { flex: 1; }
  .periodo-card { text-align: left; }
  .dre-matrix-card { min-height: 540px; }
}

/* Estrutura visual compartilhada com o Conferência Balancete. */
.app-shell {
  --menu-width: 252px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--menu-width) minmax(0, 1fr);
  background: #f6f8fb;
  transition: grid-template-columns .22s ease;
}
.app-menu {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 100vh;
  padding: 28px 18px 22px;
  display: flex;
  flex-direction: column;
  color: var(--brand-menu-text);
  background:
    radial-gradient(340px 240px at 0 100%, color-mix(in srgb, var(--brand-secondary) 20%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--brand-primary) 82%, #000), var(--brand-primary) 64%, color-mix(in srgb, var(--brand-primary) 88%, #fff));
  border-right: 1px solid rgba(157,192,232,.15);
  box-shadow: 10px 0 32px rgba(20,40,69,.08);
}
.app-brand {
  min-height: 91px;
  padding: 0 8px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  color: var(--brand-menu-text);
  border-bottom: 1px solid rgba(157,192,232,.18);
  text-decoration: none;
}
.app-brand img { display: block; width: 132px; height: auto; object-fit: contain; }
.app-brand .tenant-logo {
  width: 148px; height: 48px; padding: 0; display: flex; align-items: center;
  background: transparent;
}
.app-brand .tenant-logo img { width: 100%; max-height: 48px; object-fit: contain; }
.app-brand .tenant-name-logo {
  justify-content: flex-start; color: var(--brand-menu-text); font-size: 25px;
  font-weight: 800; letter-spacing: .4px; line-height: 1;
}
.app-brand > span { display: flex; align-items: center; gap: 7px; font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.app-brand i { width: 1px; height: 15px; background: var(--brand-muted-text); opacity: .55; }
.app-brand small { color: var(--brand-muted-text); font-size: 10.5px; font-weight: 400; }
.menu-toggle {
  position: absolute; top: 30px; right: -14px; z-index: 3;
  width: 29px; height: 29px; padding: 0; display: grid; place-items: center;
  color: #315c8a; background: #fff; border: 1px solid #cbd7e4; border-radius: 50%;
  box-shadow: 0 4px 12px rgba(13,28,51,.16); transition: color .15s, transform .22s, box-shadow .15s;
}
.menu-toggle:hover { color: #142845; background: #f4f8fc; box-shadow: 0 6px 15px rgba(13,28,51,.22); }
.menu-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app-menu-nav { margin-top: 27px; display: flex; flex-direction: column; gap: 7px; }
.app-menu-label { padding: 0 10px 7px; color: var(--brand-muted-text); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.1px; }
.app-menu-label:not(:first-child) { margin-top: 16px; }
.app-menu-nav a {
  width: 100%;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--brand-menu-text);
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: color .15s, background .15s, border-color .15s;
}
.app-menu-nav a:hover { color: var(--brand-menu-text); background: color-mix(in srgb, var(--brand-secondary) 13%, transparent); }
.app-menu-nav a.active {
  color: var(--brand-menu-text);
  background: rgba(157,192,232,.16);
  border-color: rgba(157,192,232,.22);
  box-shadow: inset 3px 0 0 var(--brand-secondary);
}
.app-menu-icon {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: grid;
  place-items: center;
  color: var(--brand-menu-text);
  background: color-mix(in srgb, var(--brand-menu-text) 9%, transparent);
  border-radius: 7px;
  font-size: 17px;
}
.app-menu-nav a.active .app-menu-icon {
  color: var(--brand-menu-text);
  background: color-mix(in srgb, var(--brand-secondary) 72%, transparent);
  outline: 1px solid color-mix(in srgb, var(--brand-menu-text) 15%, transparent);
}
.app-menu-footer {
  margin-top: auto;
  padding: 14px;
  display: grid;
  gap: 3px;
  border: 1px solid rgba(157,192,232,.16);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
}
.app-menu-footer strong { color: var(--brand-menu-text); font-size: 12px; }
.app-menu-footer small { color: var(--brand-muted-text); font-size: 11px; }
.user-footer { gap: 10px; }
.user-footer > div:first-child { min-width: 0; display: grid; gap: 3px; }
.user-footer-actions { padding-top: 9px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(157,192,232,.16); }
.user-footer-actions a, .user-footer-actions button { padding: 0; color: var(--brand-muted-text); background: none; border: 0; box-shadow: none; font-size: 10px; font-weight: 700; text-decoration: none; }
.user-footer-actions a:hover, .user-footer-actions button:hover { color: var(--brand-menu-text); background: none; transform: none; }
.user-footer-actions form { margin: 0; }
.app-workspace { min-width: 0; min-height: 100vh; }
.app-workspace > .topbar {
  position: relative;
  z-index: 50;
  min-height: 64px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #142845;
  background: #fff;
  border-bottom: 1px solid #d6dee8;
  box-shadow: 0 4px 18px rgba(20,40,69,.035);
}
.app-workspace .topbar-page-title { display: block; color: #142845; font-size: 17px; font-weight: 700; }
.app-workspace .topbar nav { font-size: 12px; }
.app-workspace .current-empresa { color: #5a6675; font-weight: 600; }
.company-context { position: relative; }
.current-empresa { display: grid; gap: 1px; text-align: right; }
.current-empresa small, .company-switcher-copy small { color: #7b8798; font-size: 9px; font-weight: 700; letter-spacing: .65px; text-transform: uppercase; }
.current-empresa strong, .company-switcher-copy strong { color: #142845; font-size: 12px; }
.company-switcher { position: relative; }
.company-switcher summary {
  min-width: 190px; padding: 7px 10px 7px 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 1px solid #d6dee8; border-radius: 9px; background: #fff; cursor: pointer; list-style: none;
}
.company-switcher-static {
  min-width: 190px; padding: 7px 10px 7px 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 1px solid #d6dee8; border-radius: 9px; background: #fff;
}
.company-switcher summary::-webkit-details-marker { display: none; }
.company-switcher summary:hover { border-color: #9aa9bb; background: #f8fafc; }
.company-switcher-copy { min-width: 0; display: grid; gap: 1px; text-align: left; }
.company-switcher-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-switcher-chevron { color: #7b8798; font-size: 15px; transition: transform .15s; }
.company-switcher[open] .company-switcher-chevron { transform: rotate(180deg); }
.company-switcher-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 150;
  width: min(340px, calc(100vw - 32px)); padding: 8px;
  border: 1px solid #d6dee8; border-radius: 12px; background: #fff;
  box-shadow: 0 18px 48px rgba(13,28,51,.18);
}
.company-switcher-label { padding: 7px 9px 9px; display: block; color: #7b8798; font-size: 9px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; }
.company-switcher-menu form { margin: 0; }
.company-switcher .company-switcher-menu button[type="submit"] {
  width: 100%; padding: 9px; display: grid; grid-template-columns: 52px minmax(0,1fr) 18px; align-items: center; gap: 10px;
  color: #142845; border: 0; border-radius: 8px; background: #fff; box-shadow: none; text-align: left;
}
.company-switcher .company-switcher-menu button[type="submit"]:hover,
.company-switcher .company-switcher-menu button[type="submit"].active { color: #142845; background: #eef2f6; }
.company-switcher-menu button > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.company-switcher-menu button strong, .company-switcher-menu button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-switcher-menu button strong { color: #142845; font-size: 12px; }
.company-switcher-menu button small { color: #7b8798; font-size: 10px; font-weight: 400; }
.company-switcher-menu button b { color: #142845; }
.company-avatar { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: #142845; border: 1px solid #142845; border-radius: 8px; font-weight: 800; }
.company-avatar.company-avatar-logo { width: 52px; height: 36px; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.company-avatar-logo img { display: block; width: 100%; max-height: 36px; object-fit: contain; }
.company-avatar.company-avatar-name {
  width: 52px; height: 36px; color: #142845; background: transparent; border: 0;
  border-radius: 0; font-size: 10px; letter-spacing: .1px;
}
.app-workspace > main { width: 100%; max-width: 1500px; margin: 0 auto; padding: 32px 32px 60px; }

@media (min-width: 761px) {
  .menu-collapsed .app-shell { --menu-width: 82px; }
  .menu-collapsed .app-menu { padding-inline: 12px; }
  .menu-collapsed .menu-toggle { transform: rotate(180deg); }
  .menu-collapsed .app-brand { padding-inline: 0; align-items: center; }
  .menu-collapsed .app-brand img { width: 50px; }
  .menu-collapsed .app-brand .tenant-logo { width: 50px; padding-inline: 6px; }
  .menu-collapsed .app-brand .tenant-name-logo { width: 58px; padding-inline: 0; font-size: 11px; }
  .menu-collapsed .app-brand > span:not(.tenant-logo),
  .menu-collapsed .app-menu-label,
  .menu-collapsed .menu-text,
  .menu-collapsed .app-menu-footer { display: none; }
  .menu-collapsed .app-menu-nav { margin-top: 27px; align-items: center; }
  .menu-collapsed .app-menu-nav a { width: 46px; padding: 9px; justify-content: center; gap: 0; }
  .menu-collapsed .app-menu-nav a.active { box-shadow: none; }
}

/* Telas administrativas. */
.admin-page { min-height: 100vh; background: #f6f8fb; color: #11161f; }
.page-heading {
  margin-bottom: 22px;
  padding: 25px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: #fff;
  border: 1px solid #d6dee8;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(20,40,69,.07);
}
.page-heading h1 { margin: 0 0 5px; color: #142845; font-size: 29px; line-height: 1.1; }
.page-heading p { margin: 0; color: #5a6675; font-size: 14px; }
.page-heading button,
.admin-page button[type="submit"] {
  padding: 11px 20px;
  color: #fff;
  background: #222f6c;
  border-radius: 8px;
  box-shadow: 0 9px 22px rgba(34,47,108,.18);
}
.page-heading button:hover,
.admin-page button[type="submit"]:hover { background: #1d3a63; transform: translateY(-1px); }
.admin-page .card {
  margin-bottom: 22px;
  border-color: #d6dee8;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(20,40,69,.07);
}
.admin-table-card { padding: 0; overflow: hidden; }
.admin-table-card th { padding: 14px 18px; color: #526176; background: #f8fafd; border-bottom-color: #d6dee8; }
.admin-table-card td { padding: 14px 18px; border-bottom-color: #e4e8ee; }
.admin-table-card tbody tr:hover td { background: #fbfdff; }
.row-actions { display: flex; align-items: center; gap: 13px; white-space: nowrap; }
.row-actions a { color: #222f6c; font-size: 12px; font-weight: 700; text-decoration: none; }
.row-actions a:hover { text-decoration: underline; }
.form-card { padding: 26px 28px; }
.form-card > h2 { margin: 0 0 22px; color: #142845; font-size: 21px; }
.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(8,19,35,.66);
  backdrop-filter: blur(3px);
  animation: modalFade .16s ease-out;
}
.modal-backdrop[hidden] { display: none; }
.admin-page .modal-card {
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  margin: 0;
  overflow-y: auto;
  box-shadow: 0 28px 80px rgba(0,0,0,.28);
  animation: modalRise .2s ease-out;
}
.form-card-heading { margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.form-card-heading h2 { margin: 0; color: #142845; font-size: 21px; }
.form-card-heading p { margin: 5px 0 0; color: #5a6675; font-size: 13px; }
.form-card-heading .eyebrow { margin-bottom: 3px; }
.form-close {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #5a6675;
  background: #f1f4f8;
  border: 1px solid #d6dee8;
  border-radius: 8px;
  box-shadow: none;
  font-size: 22px;
  line-height: 1;
}
.form-close:hover { color: #142845; background: #e4e8ee; transform: none; }
.admin-page .secondary-action { color: #5a6675; background: #fff; border: 1px solid #d6dee8; box-shadow: none; }
.admin-page .secondary-action:hover { color: #142845; background: #e4e8ee; transform: none; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalRise { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 5px 18px; }
.form-grid .field-wide { grid-column: 1 / -1; }
.form-grid .field label { color: #526176; font-size: 11px; text-transform: uppercase; letter-spacing: .55px; }
.form-grid input, .page-heading select, .classification-card select, .table-toolbar input {
  min-height: 40px;
  border-color: #c8d4e2;
  border-radius: 7px;
}
.form-grid select { width: 100%; min-width: 0; }
.field > small { color: #7b8798; font-size: 10.5px; line-height: 1.35; }
.brand-settings-card { border-top: 4px solid var(--brand-primary); }
.company-system-card { border-top: 4px solid var(--brand-secondary); }
.system-settings-form { display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: end; gap: 18px; }
.system-settings-form .field { margin: 0; }
.system-settings-form select { width: 100%; }
.system-settings-form button { min-height: 42px; }
.brand-preview {
  width: 230px; min-height: 76px; padding: 12px; display: flex; align-items: center; gap: 14px;
  border: 0; border-radius: 11px; background: var(--preview-primary);
}
.brand-preview img { width: 96px; max-height: 48px; padding: 0; border: 0; background: transparent; object-fit: contain; }
.brand-preview-name { color: var(--preview-menu-text); font-size: 16px; letter-spacing: .2px; }
.brand-preview > span { min-width: 0; display: grid; gap: 4px; }
.brand-preview strong { color: var(--preview-menu-text); font-size: 13px; }
.brand-preview small { color: var(--preview-muted-text); font-size: 10px; }
.color-field > div { display: flex; align-items: center; gap: 10px; }
.form-grid .color-field input[type="color"] { width: 58px; min-height: 42px; padding: 3px; cursor: pointer; }
.color-field code { color: #526176; font-size: 12px; text-transform: uppercase; }
.brand-remove { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: #5a6675; font-size: 12px; }
.brand-remove input { width: auto; min-height: 0; }
.contrast-status { padding: 10px 12px; border-radius: 7px; font-size: 11px; font-weight: 600; }
.contrast-status.contrast-ok { color: #21643e; background: #e5f4ea; }
.contrast-status.contrast-warning { color: #8a4b08; background: #fff0d6; }
.optional-label { margin-left: 4px; padding: 2px 6px; color: #2f5d8a; background: #e6eef6; border-radius: 999px; font-size: 9px; letter-spacing: 0; text-transform: none; }
.system-chip { width: max-content; margin-top: 6px; padding: 4px 8px; color: #2f5d8a; background: #e6eef6; border-radius: 999px; font-size: 10px; font-weight: 700; }
.plan-file { max-width: 450px; overflow: hidden; color: #2e7d52; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.form-grid input:focus, .page-heading select:focus, .classification-card select:focus, .table-toolbar input:focus {
  outline: 3px solid rgba(157,192,232,.28);
  border-color: #2f5d8a;
}
.form-actions { grid-column: 1 / -1; margin-top: 9px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.button-link { padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 700; text-decoration: none; }
.button-link.secondary { color: #5a6675; border: 1px solid #d6dee8; }
.button-link.secondary:hover { color: #142845; background: #e4e8ee; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.choice-card {
  min-height: 96px;
  padding: 19px;
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) auto;
  align-items: center;
  gap: 14px;
  color: #142845;
  background: #fff;
  border: 1px solid #d6dee8;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(20,40,69,.07);
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.choice-card:hover { transform: translateY(-2px); border-color: #9dc0e8; box-shadow: 0 16px 34px rgba(20,40,69,.12); }
.choice-icon { width: 44px; height: 44px; display: grid; place-items: center; color: #222f6c; background: #edf3fa; border-radius: 11px; font-size: 22px; }
.choice-card div { min-width: 0; display: grid; gap: 4px; }
.choice-card strong { font-size: 15px; }
.choice-card small { overflow: hidden; color: #5a6675; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.choice-card > b { color: #9dc0e8; font-size: 18px; }
.classification-card { overflow: visible; }
.classification-card .table-scroll { max-height: calc(100vh - 285px); overflow: auto; }
.classification-card table { min-width: 900px; }
.classification-card thead th { position: sticky; top: 0; z-index: 2; }
.classification-card td small { margin-top: 3px; display: block; color: #7b8798; font-size: 10px; }
.classification-card select { width: 100%; min-width: 300px; }
.table-toolbar { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #d6dee8; }
.table-toolbar input { width: min(340px, 45%); }
.sticky-actions { position: sticky; bottom: 18px; z-index: 8; display: flex; justify-content: flex-end; pointer-events: none; }
.sticky-actions button { pointer-events: auto; }
.eyebrow { display: block; margin-bottom: 5px; color: #222f6c; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.breadcrumb { margin: -8px 0 15px; display: flex; align-items: center; gap: 8px; color: #7b8798; font-size: 12px; }
.breadcrumb a { color: #2f5d8a; font-weight: 700; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.organization-grid { margin-bottom: 22px; display: grid; gap: 16px; }
.organization-card {
  min-height: 152px;
  padding: 24px 26px;
  display: grid;
  grid-template-columns: 170px minmax(260px,1fr) auto 26px;
  align-items: center;
  gap: 24px;
  color: #142845;
  background: #fff;
  border: 1px solid #d6dee8;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(20,40,69,.07);
  text-decoration: none;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.organization-card:hover { transform: translateY(-2px); border-color: #9dc0e8; box-shadow: 0 16px 38px rgba(20,40,69,.12); }
.organization-logo { height: 78px; padding: 18px; display: grid; place-items: center; background: #f6f8fb; border: 1px solid #e4e8ee; border-radius: 11px; }
.organization-logo img { display: block; width: 125px; max-height: 45px; object-fit: contain; }
.organization-name-logo { color: #142845; font-size: 23px; font-weight: 800; letter-spacing: .3px; }
.organization-info { min-width: 0; display: grid; gap: 4px; }
.organization-info strong { font-size: 25px; }
.organization-info small { color: #5a6675; font-size: 13px; }
.organization-meta { padding-left: 30px; display: grid; min-width: 180px; border-left: 1px solid #e4e8ee; }
.organization-meta b { color: #222f6c; font-size: 30px; font-weight: 400; }
.organization-meta span { color: #526176; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .55px; }
.organization-meta small { margin-top: 9px; color: #7b8798; font-size: 11px; }
.organization-arrow { color: #9dc0e8; font-size: 25px; }
.establishment-grid { margin-bottom: 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(275px,1fr)); gap: 16px; }
.establishment-card {
  min-height: 160px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  color: #142845;
  background: #fff;
  border: 1px solid #d6dee8;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(20,40,69,.055);
}
.establishment-card > div:first-child { min-width: 0; display: grid; gap: 4px; }
.establishment-card > div:first-child strong { font-size: 17px; }
.establishment-card > div:first-child small { overflow: hidden; color: #5a6675; font-size: 11px; text-transform: uppercase; text-overflow: ellipsis; white-space: nowrap; }
.establishment-status { margin-top: 15px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #5a6675; font-size: 11px; }
.establishment-actions { margin-top: auto; padding-top: 15px; display: flex; gap: 15px; border-top: 1px solid #edf0f4; }
.establishment-actions a { color: #222f6c; font-size: 11px; font-weight: 700; text-decoration: none; }
.establishment-actions a:hover { text-decoration: underline; }
.systems-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px,1fr)); gap: 16px; }
.system-card {
  min-height: 116px;
  padding: 20px;
  display: grid;
  grid-template-columns: 48px minmax(0,1fr) auto 20px;
  align-items: center;
  gap: 14px;
  color: #142845;
  background: #fff;
  border: 1px solid #d6dee8;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(20,40,69,.055);
  text-decoration: none;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.system-card:hover { transform: translateY(-2px); border-color: #9dc0e8; box-shadow: 0 16px 34px rgba(20,40,69,.11); }
.system-card-icon { width: 48px; height: 48px; display: grid; place-items: center; color: #222f6c; background: #edf3fa; border-radius: 12px; font-size: 21px; }
.system-card > div:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.system-card strong { font-size: 17px; }
.system-card small { overflow: hidden; color: #5a6675; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.system-card-meta { padding-left: 17px; display: grid; border-left: 1px solid #e4e8ee; }
.system-card-meta b { color: #222f6c; font-size: 23px; font-weight: 400; }
.system-card-meta span { color: #526176; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.modal-card-compact { max-width: 540px; }
.delete-confirm-card {
  width: min(440px, 100%);
  margin: 0;
  padding: 30px;
  display: flex;
  align-items: center;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 16px;
  box-shadow: 0 30px 90px rgba(0,0,0,.32);
  animation: modalRise .2s ease-out;
}
.delete-confirm-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #a33a2b;
  background: #fcebe8;
  border-radius: 50%;
}
.delete-confirm-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.delete-confirm-copy { width: 100%; margin-top: 15px; text-align: center; }
.delete-confirm-copy .eyebrow { display: block; margin-bottom: 6px; }
.delete-confirm-copy h2 { margin: 0 0 8px; color: #142845; font-size: 21px; }
.delete-confirm-copy > p { margin: 0 auto; color: #526176; font-size: 13px; line-height: 1.5; }
.delete-warning { width: 100%; margin-top: 19px; padding: 12px 14px; display: grid; gap: 3px; color: #7d2f25; background: #fff6f4; border: 1px solid #f6ddd8; border-radius: 8px; text-align: center; }
.delete-warning strong { font-size: 12px; }
.delete-warning span { color: #7b625f; font-size: 10.5px; line-height: 1.4; }
.delete-confirm-actions { width: 100%; margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-page .delete-confirm-actions button { width: 100%; min-width: 0; }
.admin-page .danger-action { color: #fff; background: #a33a2b; border: 1px solid #a33a2b; box-shadow: 0 6px 14px rgba(163,58,43,.2); }
.admin-page .danger-action:hover { background: #8e3024; border-color: #8e3024; transform: translateY(-1px); }
@media (max-width: 520px) {
  .delete-confirm-card { padding: 24px 20px 20px; }
  .delete-confirm-icon { width: 46px; height: 46px; }
}
.field textarea { width: 100%; padding: 10px 11px; resize: vertical; color: #11161f; background: #fff; border: 1px solid #c8d4e2; border-radius: 7px; font: inherit; }
.system-config-form { padding-bottom: 12px; }
.system-general-card { padding: 21px 24px; display: grid; grid-template-columns: minmax(220px,.65fr) minmax(320px,1.35fr); gap: 18px; }
.system-general-card .field { margin: 0; }
.layout-tabs { margin: 0 0 14px; padding: 5px; display: flex; gap: 5px; width: max-content; background: #e9eef5; border-radius: 10px; }
.layout-tab { padding: 9px 18px; color: #526176; background: transparent; border: 0; box-shadow: none; font-size: 12px; }
.layout-tab:hover { color: #142845; background: rgba(255,255,255,.55); }
.layout-tab.active { color: #fff; background: #222f6c; box-shadow: 0 5px 14px rgba(34,47,108,.18); }
.layout-panel { display: none; padding: 0; overflow: hidden; }
.layout-panel.active { display: block; animation: modalFade .16s ease; }
.layout-panel-head { padding: 21px 24px; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid #d6dee8; background: #fafdff; }
.layout-panel-head h2 { margin: 0 0 4px; color: #142845; font-size: 20px; }
.layout-panel-head p { margin: 0; color: #5a6675; font-size: 12px; }
.layout-status { height: max-content; padding: 5px 9px; color: #2e7d52; background: #e7f2ea; border-radius: 999px; font-size: 10px; font-weight: 700; }
.layout-grid { padding: 24px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px 18px; }
.layout-grid .field-wide { grid-column: 1/-1; }
.layout-grid input, .layout-grid select { width: 100%; min-width: 0; }
.layout-example-field { margin-top: 5px; padding: 16px; background: #f6f8fb; border: 1px dashed #b9cadd; border-radius: 10px; }
.layout-example-field input[type="file"] { background: #fff; }
.system-config-form .sticky-actions { gap: 9px; align-items: center; }
.narrow-card { width: min(620px,100%); margin-inline: auto; }
.empty-access { min-height: 360px; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-access > span { width: 52px; height: 52px; display: grid; place-items: center; color: #b7791f; background: #fbf1dd; border-radius: 50%; font-size: 25px; font-weight: 700; }
.empty-access h1 { margin: 17px 0 7px; }
.empty-access p { margin: 0; color: #5a6675; }
.access-summary { margin-bottom: 18px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.access-summary > div { padding: 18px 20px; display: grid; background: #fff; border: 1px solid #d6dee8; border-radius: 12px; box-shadow: 0 8px 22px rgba(20,40,69,.05); }
.access-summary b { color: #222f6c; font-size: 28px; font-weight: 400; }
.access-summary span { color: #5a6675; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.table-subline { margin-top: 3px; display: block; color: #7b8798; font-size: 10px; }
.role-badge { padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.role-adm { color: #222f6c; background: #e6eef6; }
.role-operador { color: #b7791f; background: #fbf1dd; }
.role-cliente { color: #2e7d52; background: #e7f2ea; }
.status-dot { width: 7px; height: 7px; margin-right: 6px; display: inline-block; background: #a8b2bf; border-radius: 50%; }
.status-dot.active { background: #2e7d52; box-shadow: 0 0 0 3px #e7f2ea; }
.table-action { color: #222f6c; font-size: 11px; font-weight: 700; text-decoration: none; }
.company-access-field { margin: 5px 0 12px; padding: 15px; border: 1px solid #d6dee8; border-radius: 10px; }
.company-access-field[hidden] { display: none; }
.company-access-field legend { padding: 0 6px; color: #142845; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .55px; }
.company-access-field p { margin: 0 0 10px; color: #5a6675; font-size: 11px; }
.company-check-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 8px; }
.company-check-grid label, .inline-check { padding: 9px 10px; display: flex; align-items: center; gap: 8px; color: #142845; background: #f6f8fb; border-radius: 7px; font-size: 12px; font-weight: 700; cursor: pointer; }
.company-check-grid input, .inline-check input { width: 16px; height: 16px; margin: 0; accent-color: #222f6c; }

/* Plano de contas gerencial individual por empresa. */
.plan-scope-notice { margin-bottom: 18px; padding: 15px 18px; display: flex; align-items: center; gap: 13px; color: #274f7a; background: #edf5fd; border: 1px solid #bed3e8; border-radius: 11px; }
.plan-scope-notice > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px; color: #fff; background: #315c8a; border-radius: 9px; font-size: 19px; }
.plan-scope-notice > div { display: grid; gap: 3px; }
.plan-scope-notice strong { font-size: 15px; }
.plan-scope-notice small { color: #60758d; font-size: 13px; }
.dre-structure-card { padding: 0; overflow: hidden; }
.dre-structure-heading { padding: 19px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #d6dee8; background: #fafdff; }
.dre-structure-heading h2 { margin: 0 0 3px; font-size: 19px; }
.dre-structure-heading p { margin: 0; color: #6b7889; font-size: 13px; }
.dre-structure-heading form { display: flex; align-items: flex-end; flex-direction: column; gap: 6px; }
.dre-structure-heading form > span { padding: 5px 8px; color: #7a4709; background: #fff0d6; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.dre-structure-heading form button { padding: 8px 11px; font-size: 12px; white-space: nowrap; }
.dre-structure-heading form [hidden] { display: none; }
.order-form-actions { display: flex; align-items: center; gap: 6px; }
.drag-hint { padding: 7px 10px; display: flex; align-items: center; gap: 8px; color: #315c8a; background: #edf5fd; border: 1px dashed #a9c2da; border-radius: 9px; }
.drag-hint > span { font-size: 20px; line-height: 1; }
.drag-hint > div { display: grid; }
.drag-hint strong { font-size: 11.5px; }
.drag-hint small { color: #73869a; font-size: 10.5px; }
.dre-structure-list { padding: 8px 12px 12px; display: grid; gap: 5px; }
.dre-structure-group { position: relative; overflow: hidden; border: 1px solid #e0e6ed; border-radius: 9px; }
.dre-structure-group.sortable { transition: opacity .14s, border-color .14s, box-shadow .14s, transform .14s; }
.dre-structure-group.sortable:hover { border-color: #b8cadc; box-shadow: 0 5px 15px rgba(20,40,69,.07); transform: translateY(-1px); }
.dre-structure-group.is-dragging { opacity: .42; border-color: #315c8a; box-shadow: 0 7px 20px rgba(49,92,138,.16); }
.dre-drop-placeholder { min-height: 52px; display: grid; place-items: center; color: #315c8a; background: #eaf3fc; border: 2px dashed #6f96bd; border-radius: 9px; }
.dre-drop-placeholder span { padding: 5px 9px; background: #fff; border-radius: 999px; font-size: 9.5px; font-weight: 800; box-shadow: 0 3px 10px rgba(49,92,138,.12); }
.dre-structure-group.subtotal { border-color: #c5d5e5; background: #f4f8fc; }
.dre-group-main { min-height: 58px; padding: 9px 12px; display: grid; grid-template-columns: 40px minmax(0,1fr) auto auto; align-items: center; gap: 11px; }
.dre-structure-group.sortable .dre-group-main { padding-left: 50px; grid-template-columns: 28px minmax(0,1fr) auto auto; gap: 9px; }
.dre-drag-handle { position: absolute; left: 0; top: 0; bottom: 0; z-index: 2; width: 38px; display: grid; place-items: center; color: #6f849d; background: transparent; border: 0; border-right: 1px solid transparent; cursor: grab; user-select: none; transition: color .15s, background .15s, border-color .15s; }
.dre-drag-handle:hover, .dre-drag-handle:focus-visible { outline: none; color: #315c8a; background: #edf4fb; border-right-color: #d4e0eb; }
.dre-drag-handle:active { cursor: grabbing; }
.dre-drag-handle svg { width: 8px; height: 22px; fill: currentColor; }
.dre-order { min-width: 28px; height: 28px; padding: 0 5px; display: grid; place-items: center; color: #526176; background: #eef1f4; border-radius: 50%; font-size: 11px; font-weight: 800; }
.dre-group-copy { min-width: 0; display: grid; gap: 2px; }
.dre-group-main strong { color: #142845; font-size: 14px; }
.dre-group-title { display: flex; align-items: center; gap: 7px; }
.dre-group-sign { min-width: 30px; padding: 3px 5px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 5px; font-size: 11px; font-weight: 800; }
.dre-group-sign.sign-positive { color: #21643e; background: #e5f4ea; }
.dre-group-sign.sign-negative { color: #9a3c32; background: #fbe9e7; }
.dre-group-sign.sign-result { color: #274f7a; background: #dce9f5; }
.dre-group-main small { color: #7b8798; font-size: 11.5px; }
.dre-kind { padding: 4px 7px; color: #42617e; background: #edf2f7; border-radius: 999px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
.dre-structure-group.subtotal .dre-kind { color: #274f7a; background: #dce9f5; }
.dre-group-actions { display: flex; align-items: center; gap: 5px; }
.dre-group-actions button, .dre-subgroup-list button { padding: 5px 7px; color: #315c8a; background: transparent; border: 0; font-size: 11px; }
.dre-group-actions button:hover, .dre-subgroup-list button:hover { background: #e7eff7; }
.dre-subgroup-list { padding: 0 12px 8px 87px; display: grid; gap: 3px; }
.dre-structure-group:not(.sortable) .dre-subgroup-list { padding-left: 63px; }
.dre-subgroup-item { overflow: hidden; color: #526176; background: #f7f9fb; border-radius: 6px; }
.dre-subgroup-main { min-height: 38px; padding: 5px 8px; display: grid; grid-template-columns: 15px minmax(0,1fr) auto auto; align-items: center; gap: 7px; }
.dre-subgroup-actions { display: flex; align-items: center; gap: 3px; }
.dre-group-actions form, .dre-subgroup-actions form, .dre-level3-list form { margin: 0; }
.dre-structure-card button.dre-delete-action { padding: 5px 7px; color: #8a95a4; background: transparent; border: 0; border-radius: 0; box-shadow: none; font-size: 10px; font-weight: 500; }
.dre-structure-card button.dre-delete-action:hover,
.dre-structure-card button.dre-delete-action:focus-visible { color: #a33a2b; background: transparent; box-shadow: none; text-decoration: underline; }
.dre-subgroup-list strong { font-size: 12.5px; font-weight: 600; }
.dre-subgroup-list small { color: #8a95a4; font-size: 10.5px; }
.dre-level3-list { display: grid; gap: 3px; }
.dre-level3-list strong { font-size: 12px; }
.plan-summary { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.plan-summary > div, .plan-summary > a { min-height: 92px; padding: 17px 19px; display: grid; align-content: center; gap: 3px; background: #fff; border: 1px solid #d6dee8; border-radius: 11px; box-shadow: 0 7px 20px rgba(20,40,69,.045); }
.plan-summary b { color: #222f6c; font-size: 25px; font-weight: 500; }
.plan-summary span { color: #687789; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.summary-card-action { position: relative; color: inherit; text-decoration: none; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.summary-card-action:hover, .summary-card-action:focus-visible { outline: none; border-color: #6f96bd; box-shadow: 0 10px 24px rgba(20,40,69,.12); transform: translateY(-2px); }
.summary-card-action small { margin-top: 5px; color: #315c8a; font-size: 10.5px; font-weight: 700; }
.summary-card-action small span { color: inherit; font-size: 13px; }
.pending-account-focus td { animation: pendingAccountFocus 1.8s ease; }
@keyframes pendingAccountFocus { 0%,45% { background: #fff0c7; } 100% { background: inherit; } }
.plan-card table { min-width: 980px; }
.plan-toolbar > div { display: flex; gap: 8px; }
.plan-toolbar input { width: 290px; }
.plan-toolbar select { min-width: 115px; min-height: 40px; }
.plan-code { color: #222f6c; font-variant-numeric: tabular-nums; }
.plan-path { color: #34455c; font-size: 11px; font-weight: 700; }
.plan-status { padding: 5px 9px; color: #6b7280; background: #edf0f3; border-radius: 999px; font-size: 11px; font-weight: 700; }
.plan-status.active { color: #21643e; background: #e5f4ea; }
.plan-actions { width: 145px; }
.plan-actions, .plan-actions form { display: flex; align-items: center; gap: 8px; }
.table-action-button { padding: 0; color: #222f6c; background: none; border: 0; box-shadow: none; font-size: 12px; }
.table-action-button:hover { color: #142845; background: none; text-decoration: underline; }
.table-action-button.muted { color: #7b8798; }
.empty-state.compact { padding: 28px 20px; }
.subtotal-config { padding: 15px; display: grid; gap: 12px; background: #f7faff; border: 1px solid #cbd9e8; border-radius: 10px; }
.subtotal-config[hidden], .subtotal-components[hidden], .subtotal-legacy-note[hidden] { display: none; }
.subtotal-config .field { margin: 0; }
.subtotal-components { min-width: 0; margin: 0; padding: 0; border: 0; }
.subtotal-components legend { margin-bottom: 7px; color: #526176; font-size: 11px; font-weight: 700; letter-spacing: .55px; text-transform: uppercase; }
.subtotal-component-grid { max-height: 190px; padding-right: 4px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; overflow-y: auto; }
.subtotal-component-grid > label { min-width: 0; padding: 9px 10px; display: flex; align-items: center; gap: 9px; color: #142845; background: #fff; border: 1px solid #d6e0eb; border-radius: 8px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.subtotal-component-grid > label:hover { border-color: #91aecb; }
.subtotal-component-grid > label:has(input:checked) { background: #edf5fd; border-color: #6f96bd; box-shadow: inset 0 0 0 1px #6f96bd; }
.subtotal-component-grid input { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; accent-color: #315c8a; }
.subtotal-component-grid label > span { min-width: 0; display: grid; gap: 2px; }
.subtotal-component-grid strong { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.subtotal-component-grid small { color: #7b8798; font-size: 9.5px; }
.subtotal-component-grid > p { grid-column: 1/-1; margin: 0; padding: 12px; color: #7b8798; background: #fff; border-radius: 7px; font-size: 11px; text-align: center; }
.subtotal-legacy-note { padding: 10px 12px; display: grid; gap: 2px; color: #6b5428; background: #fff7e8; border: 1px solid #eed49e; border-radius: 7px; }
.subtotal-legacy-note strong { font-size: 11px; }
.subtotal-legacy-note span { font-size: 10px; }
.plan-impact-note { padding: 12px 14px; display: grid; gap: 3px; color: #7a4709; background: #fff6e8; border: 1px solid #efca8d; border-radius: 8px; }
.plan-impact-note strong { font-size: 11px; }
.plan-impact-note span { font-size: 10.5px; }
.plan-history { padding: 0; overflow: hidden; }
.plan-history summary { padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.plan-history summary::-webkit-details-marker { display: none; }
.plan-history summary:hover { background: #f8fafd; }
.plan-history summary > span { display: grid; gap: 3px; }
.plan-history summary strong { color: #142845; font-size: 13px; }
.plan-history summary small { color: #7b8798; font-size: 10px; }
.plan-history summary b { color: #315c8a; }
.plan-history[open] summary b { transform: rotate(180deg); }
.plan-history .table-scroll { border-top: 1px solid #d6dee8; }

/* Importacao com identificacao automatica. */
.import-card { padding: 26px; }
.import-file-row { display: flex; align-items: flex-end; gap: 18px; }
.import-file-row > button { min-width: 155px; min-height: 48px; }
.import-file-row > button:disabled { cursor: not-allowed; opacity: .48; }
.upload-zone {
  flex: 1; min-height: 126px; padding: 22px 24px;
  display: grid; grid-template-columns: 54px minmax(0,1fr) auto; align-items: center; gap: 18px;
  color: #526176; background: linear-gradient(135deg,#fbfdff,#f4f8fc);
  border: 1.5px dashed #a9bdd3; border-radius: 13px; cursor: pointer;
  transition: border-color .18s, background .18s, box-shadow .18s, transform .18s;
}
.upload-zone:hover, .upload-zone:focus-visible, .upload-zone.is-dragging {
  outline: none; border-color: #315c8a; background: #eef5fc;
  box-shadow: 0 0 0 4px rgba(49,92,138,.09);
}
.upload-zone.is-dragging { transform: translateY(-2px); }
.upload-icon { width: 54px; height: 54px; display: grid; place-items: center; color: #315c8a; background: #e4eef8; border-radius: 13px; }
.upload-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.upload-copy { min-width: 0; display: grid; gap: 4px; }
.upload-copy strong { overflow: hidden; color: #142845; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.upload-copy > span { color: #607086; font-size: 12px; }
.upload-copy small { color: #8290a2; font-size: 10.5px; }
.upload-select { padding: 9px 13px; color: #274f7a; background: #fff; border: 1px solid #b8c9db; border-radius: 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.upload-zone.has-file { border-style: solid; border-color: #84af95; background: linear-gradient(135deg,#fbfffc,#f0f8f3); }
.upload-zone.has-file .upload-icon { color: #287348; background: #dff0e5; }
.upload-zone.has-file .upload-select { color: #526176; border-color: #cbd6d0; }
.selected-files { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 7px; }
.selected-files[hidden] { display: none; }
.selected-files span { max-width: 100%; padding: 6px 9px; overflow: hidden; color: #526176; background: #edf2f7; border-radius: 7px; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.import-card .flash { margin: 18px 0 0; }
.import-preview { margin-top: 24px; padding-top: 22px; border-top: 1px solid #d6dee8; }
.competency-status { margin: 10px 0 16px; padding: 16px 18px; display: flex; align-items: center; gap: 13px; border: 1px solid; border-radius: 10px; }
.competency-status-icon { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-size: 18px; font-weight: 800; }
.competency-status > div { display: grid; gap: 3px; }
.competency-status strong { font-size: 14px; }
.competency-status p { margin: 0; font-size: 12px; line-height: 1.45; }
.competency-status.is-new { color: #21643e; background: #edf8f1; border-color: #abd5ba; }
.competency-status.is-new .competency-status-icon { color: #fff; background: #2e7d52; }
.competency-status.already-exists { color: #7a4709; background: #fff6e8; border-color: #efca8d; }
.competency-status.already-exists .competency-status-icon { color: #fff; background: #c47a17; }
.batch-preview-list { display: grid; gap: 8px; }
.batch-preview-item { min-height: 72px; padding: 13px 15px; display: grid; grid-template-columns: minmax(180px,1.5fr) minmax(170px,1fr) 80px 125px; align-items: center; gap: 15px; background: #fff; border: 1px solid #d6dee8; border-left: 4px solid #2e7d52; border-radius: 9px; }
.batch-preview-item.already-exists { border-left-color: #c47a17; }
.batch-file-name, .batch-destination { min-width: 0; display: grid; gap: 3px; }
.batch-file-name strong, .batch-destination strong { overflow: hidden; color: #142845; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.batch-file-name small, .batch-destination small { color: #7b8798; font-size: 10px; }
.batch-period { color: #142845; font-size: 13px; font-variant-numeric: tabular-nums; }
.batch-status { padding: 5px 8px; color: #21643e; background: #e5f4ea; border-radius: 999px; font-size: 9.5px; font-weight: 700; text-align: center; white-space: nowrap; }
.batch-preview-item.already-exists .batch-status { color: #7a4709; background: #fff0d6; }
.import-preview-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.import-preview-grid > div { min-height: 76px; padding: 14px; display: grid; align-content: center; gap: 5px; background: #f6f8fb; border-radius: 9px; }
.import-preview-grid small { color: #7b8798; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .45px; }
.import-preview-grid strong { color: #142845; font-size: 14px; }
.replacement-warning { margin-top: 16px; padding: 14px 16px; color: #8a4b08; background: #fff4e5; border: 1px solid #f1cf96; border-radius: 9px; font-size: 13px; line-height: 1.5; }
.replacement-warning strong, .replacement-warning span { display: block; }
.import-actions { margin-top: 18px; }
button.danger-action { background: #a33a2b; }
button.danger-action:hover { background: #812b20; }
.import-help h2 { margin: 0 0 8px; }
.import-help p { margin: 0; color: #5a6675; font-size: 13px; line-height: 1.6; }
.import-help code { color: #142845; background: #edf3fa; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.import-history-card { padding: 0; overflow: hidden; }
.import-history-heading {
  padding: 21px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: #f8fafd; border-bottom: 1px solid #d6dee8;
}
.import-history-heading h2 { margin: 0 0 5px; color: #142845; font-size: 20px; }
.import-history-heading p { margin: 0; color: #5a6675; font-size: 12px; line-height: 1.45; }
.import-history-count { padding: 6px 10px; color: #526176; background: #e8edf3; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.import-history-table { min-width: 1050px; }
.import-history-table th { padding: 11px 14px; color: #5a6675; background: #f4f6f9; font-size: 10px; }
.import-history-table td { padding: 13px 14px; vertical-align: middle; }
.import-history-table td > strong,
.import-history-table td > small { display: block; }
.import-history-table td > small { margin-top: 3px; color: #7b8798; font-size: 10px; }
.import-period { color: #142845; font-size: 14px; font-variant-numeric: tabular-nums; }
.import-file-name { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-history-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.import-history-actions { width: 82px; text-align: right; }
.import-delete-action {
  padding: 6px 8px; color: #9b3327; background: transparent; border: 0;
  box-shadow: none; font-size: 10px; font-weight: 700;
}
.import-delete-action:hover { color: #7e271e; background: #fcebe8; transform: none; }
.import-history-empty { padding: 34px 24px; color: #687789; font-size: 13px; text-align: center; }

/* Autenticação */
.auth-page { min-height: 100vh; background: #0d1c33; }
.auth-shell { width: 100%; max-width: none; min-height: 100vh; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(360px,.8fr) minmax(520px,1.2fr); }
.auth-brand { padding: clamp(42px,7vw,100px); display: flex; flex-direction: column; justify-content: center; color: #fff; background: radial-gradient(600px 420px at 0 100%,rgba(157,192,232,.17),transparent 70%),linear-gradient(145deg,#0d1c33,#142845 62%,#1d3a63); }
.auth-brand img { width: 185px; height: auto; }
.auth-brand > div { margin-top: 22px; display: flex; align-items: center; gap: 9px; }
.auth-brand > div strong { font-size: 24px; }
.auth-brand > div i { width: 1px; height: 20px; background: rgba(157,192,232,.5); }
.auth-brand > div span { color: #b6ccdd; font-size: 13px; }
.auth-brand p { width: min(390px,100%); margin: 45px 0 0; color: #b6ccdd; font-size: 21px; line-height: 1.5; }
.auth-panel { padding: clamp(35px,8vw,125px); display: flex; flex-direction: column; justify-content: center; background: #f6f8fb; }
.auth-panel > .flash-wrap { width: min(480px,100%); }
.auth-copy { width: min(480px,100%); margin-bottom: 28px; }
.auth-copy h1 { margin: 0 0 8px; color: #142845; font-size: 34px; }
.auth-copy p { margin: 0; color: #5a6675; font-size: 14px; line-height: 1.5; }
.auth-form { width: min(480px,100%); }
.auth-form .field { margin-bottom: 16px; }
.auth-form .field label { color: #526176; font-size: 11px; text-transform: uppercase; letter-spacing: .55px; }
.auth-form input { min-height: 46px; border-color: #c8d4e2; }
.auth-form input:focus { outline: 3px solid rgba(157,192,232,.3); border-color: #2f5d8a; }
.auth-form > button { width: 100%; min-height: 47px; margin-top: 8px; background: #222f6c; box-shadow: 0 10px 24px rgba(34,47,108,.2); }

/* O dashboard ocupa toda a área útil ao lado do menu principal. */
.bi-dashboard { background: #eef1f4; }
.bi-dashboard .app-workspace > .topbar {
  position: relative;
  height: 64px;
  min-height: 64px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid #d6dee8;
}
.bi-dashboard .topbar-page-title {
  position: static;
  display: block;
  transform: none;
  color: #142845;
  font: 700 17px "Segoe UI", sans-serif;
}
.bi-dashboard .topbar nav .current-empresa { display: inline; color: #5a6675; }
.bi-dashboard main {
  width: 100%;
  max-width: none;
  height: calc(100vh - 64px);
  min-height: 540px;
  margin: 0;
  padding: 10px 12px 12px;
}
.powerbi-frame { grid-template-columns: 170px minmax(0, 1fr); }
.powerbi-sidebar { padding: 58px 13px 14px; }
.filter-panel-title { left: 15px; }
.powerbi-nav-icons { display: none; }
.dashboard-heading { background: var(--navy); color: var(--brand-menu-text); }
.dashboard-eyebrow, .periodo-card span { color: var(--brand-muted-text); }
.periodo-card { color: var(--brand-menu-text); }
.dashboard-view-switch { border-color: color-mix(in srgb, var(--brand-menu-text) 30%, transparent); }
.dashboard-view-switch button { color: var(--brand-muted-text); }
.dashboard-view-switch button:hover { color: var(--brand-menu-text); background: color-mix(in srgb, var(--brand-menu-text) 10%, transparent); }
.dashboard-view-switch button.active { color: var(--brand-primary); background: var(--brand-menu-text); }
.dre-matrix-card th { color: var(--brand-menu-text); background: var(--brand-primary); }
.dre-matrix-card thead tr.comparison-head th:not(:first-child) { color: var(--brand-menu-text); }
.variation-switch input:checked + .switch-track { background: #334155; outline: 1px solid #0f172a; }
.page-heading button, .admin-page button[type="submit"] {
  color: var(--brand-menu-text); background: var(--brand-primary);
  border: 1px solid color-mix(in srgb, var(--brand-menu-text) 45%, transparent);
}
.page-heading button:hover, .admin-page button[type="submit"]:hover { color: var(--brand-menu-text); background: color-mix(in srgb, var(--brand-primary) 88%, var(--brand-menu-text)); }
.drill-toolbar button.drill-action:hover { color: var(--brand-menu-text); background: var(--brand-primary); border-color: var(--brand-menu-text); }
.eyebrow, .row-actions a, .establishment-actions a { color: #222f6c; }

/* Plastcromo: tema monocromatico com mais profundidade e hierarquia visual. */
.tenant-plastcromo .app-shell { background: #e4e5e7; }
.tenant-plastcromo .app-menu {
  color: #f5f5f5;
  background:
    radial-gradient(360px 260px at 0 100%, rgba(255,255,255,.08), transparent 68%),
    linear-gradient(180deg, #111113 0%, #202023 58%, #171719 100%);
  border-right-color: #3a3a3f;
  box-shadow: 10px 0 34px rgba(0,0,0,.16);
}
.tenant-plastcromo .app-brand { color: #fff; border-bottom-color: rgba(255,255,255,.15); }
.tenant-plastcromo .app-brand .tenant-logo img {
  filter: grayscale(1) brightness(0) invert(1);
  opacity: .96;
}
.tenant-plastcromo .app-brand i { background: #8f8f96; }
.tenant-plastcromo .app-brand small,
.tenant-plastcromo .app-menu-label { color: #b7b7bd; }
.tenant-plastcromo .app-menu-nav a { color: #e7e7ea; }
.tenant-plastcromo .app-menu-nav a:hover {
  color: #fff; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.09);
}
.tenant-plastcromo .app-menu-nav a.active {
  color: #fff; background: linear-gradient(135deg, #3a3a3f, #2d2d31);
  border-color: #55555c; box-shadow: 0 7px 18px rgba(0,0,0,.22), inset 3px 0 0 #d4d4d8;
}
.tenant-plastcromo .app-menu-icon { color: #dedee2; background: rgba(255,255,255,.08); }
.tenant-plastcromo .app-menu-footer { color: #f4f4f5; border-top-color: rgba(255,255,255,.14); }
.tenant-plastcromo .app-menu-footer strong { color: #fff; }
.tenant-plastcromo .app-menu-footer small,
.tenant-plastcromo .app-menu-footer a,
.tenant-plastcromo .app-menu-footer button { color: #b7b7bd; }
.tenant-plastcromo .menu-toggle { color: #27272a; background: #f4f4f5; border-color: #a1a1aa; }

.tenant-plastcromo.bi-dashboard { background: #dedfe2; }
.tenant-plastcromo.bi-dashboard .app-workspace > .topbar {
  background: #f2f2f3; border-bottom-color: #c5c6ca;
  box-shadow: 0 2px 10px rgba(24,24,27,.06);
}
.tenant-plastcromo.bi-dashboard .topbar-page-title { color: #18181b; }
.tenant-plastcromo.bi-dashboard .topbar nav .current-empresa { color: #52525b; }
.tenant-plastcromo.bi-dashboard main { background: linear-gradient(145deg, #e5e6e8, #d9dade); }
.tenant-plastcromo .powerbi-frame { gap: 14px; }
.tenant-plastcromo .powerbi-sidebar {
  background: #f3f3f4; border-color: #c3c4c8;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 8px 24px rgba(24,24,27,.11);
}
.tenant-plastcromo .filter-panel-title,
.tenant-plastcromo .visible-filter-title { color: #18181b; }
.tenant-plastcromo .visible-filter-title span { color: #62626b; }
.tenant-plastcromo .visible-filter-list,
.tenant-plastcromo .period-tree { background: transparent; }
.tenant-plastcromo .visible-filter-list label { color: #3f3f46; }
.tenant-plastcromo .visible-filter-list label:hover,
.tenant-plastcromo .year-group summary:hover { color: #18181b; background: #e3e3e5; }
.tenant-plastcromo .visible-filter-list label:has(input:checked) { color: #18181b; background: #d7d7da; }
.tenant-plastcromo .visible-filter-list label.master-option {
  color: #18181b; background: #f3f3f4; border-bottom-color: #c9c9ce;
  box-shadow: 0 6px 8px -8px rgba(0,0,0,.55);
}
.tenant-plastcromo .visible-filter-list label.master-option:has(input:checked) { background: #d7d7da; }
.tenant-plastcromo .visible-filter-list input[type="checkbox"] { border-color: #777780; background: #fafafa; }
.tenant-plastcromo .visible-filter-list input[type="checkbox"]:checked,
.tenant-plastcromo .visible-filter-list input[type="checkbox"]:indeterminate {
  border-color: #18181b; background: #18181b;
}
.tenant-plastcromo .visible-filter-list input[type="checkbox"]:checked::after,
.tenant-plastcromo .visible-filter-list input[type="checkbox"]:indeterminate::after { border-color: #fff; }
.tenant-plastcromo .year-group summary { color: #27272a; }
.tenant-plastcromo .variation-switch { color: #3f3f46; }

.tenant-plastcromo .dashboard-heading {
  background: linear-gradient(120deg, #18181b, #29292d 68%, #333338);
  color: #fff; border: 1px solid #3f3f46;
  box-shadow: 0 1px 0 rgba(255,255,255,.09) inset, 0 8px 22px rgba(24,24,27,.19);
}
.tenant-plastcromo .dashboard-eyebrow,
.tenant-plastcromo .periodo-card span { color: #c4c4c9; }
.tenant-plastcromo .periodo-card { color: #fff; }
.tenant-plastcromo .dashboard-view-switch { border-color: #55555c; background: rgba(255,255,255,.06); }
.tenant-plastcromo .dashboard-view-switch button { color: #d4d4d8; }
.tenant-plastcromo .dashboard-view-switch button:hover { color: #fff; background: rgba(255,255,255,.1); }
.tenant-plastcromo .dashboard-view-switch button.active {
  color: #18181b; background: #f4f4f5; box-shadow: 0 2px 7px rgba(0,0,0,.25);
}
.tenant-plastcromo .dashboard-report-switch { border-color: #66666d; background: rgba(0,0,0,.24); }
.tenant-plastcromo .dashboard-report-switch button { color: #d4d4d8; }
.tenant-plastcromo .dashboard-report-switch button.active {
  color: #18181b; background: #f4f4f5; box-shadow: 0 2px 7px rgba(0,0,0,.25);
}
.tenant-plastcromo .dre-matrix-card {
  background: #f8f8f8; border-color: #b9bac0;
  box-shadow: 0 1px 0 rgba(255,255,255,.95) inset, 0 10px 28px rgba(24,24,27,.13);
}
.tenant-plastcromo .dre-matrix-card .drill-toolbar { background: #ededee; border-bottom-color: #c7c8cc; }
.tenant-plastcromo .drill-toolbar button.drill-action { color: #27272a; background: #d9dade; border: 1px solid #c1c2c7; }
.tenant-plastcromo .drill-toolbar button.drill-action:hover { color: #fff; background: #27272a; border-color: #27272a; }
.tenant-plastcromo .drill-hint { color: #5d5d65; }
.tenant-plastcromo .dre-matrix-card th {
  color: #fff; background: #242427; border-color: #48484e;
}
.tenant-plastcromo .dre-matrix-card thead tr.comparison-head th:not(:first-child) { color: #fff; }
.tenant-plastcromo .dre-matrix-card td { color: #202024; border-color: #d0d1d4; }
.tenant-plastcromo .dre-matrix-card tbody td:first-child { background: #fafafa; box-shadow: 2px 0 5px rgba(0,0,0,.09); }
.tenant-plastcromo .dre-matrix-card tr:nth-child(odd):not(.subtotal) td,
.tenant-plastcromo .dre-matrix-card tr:nth-child(odd):not(.subtotal) td:first-child { background: #eeeeef; }
.tenant-plastcromo .dre-matrix-card tr.n1-row.subtotal td,
.tenant-plastcromo .dre-matrix-card tr.n1-row.subtotal td:first-child { color: #18181b; background: #d9dadd; }
.tenant-plastcromo .dre-matrix-card tr.dre-final-row td,
.tenant-plastcromo .dre-matrix-card tr.dre-final-row td:first-child {
  color: #111113; background: #c9cacf;
  border-top: 2px solid #3f3f46; border-bottom: 2px solid #3f3f46;
}
.tenant-plastcromo .patrimonial-table tr.patr-level-1 td,
.tenant-plastcromo .patrimonial-table tr.patr-level-1 td:first-child { background: #cfd0d4; }

/* A mesma linguagem visual nas telas administrativas da Plastcromo. */
.tenant-plastcromo.admin-page { color: #202024; background: #e4e5e7; }
.tenant-plastcromo:not(.bi-dashboard) .app-workspace {
  background: linear-gradient(145deg, #e8e9eb 0%, #dedfe2 100%);
}
.tenant-plastcromo:not(.bi-dashboard) .app-workspace > .topbar {
  background: rgba(245,245,246,.96); border-bottom-color: #c6c7cb;
  box-shadow: 0 4px 16px rgba(24,24,27,.07);
}
.tenant-plastcromo .app-workspace .topbar-page-title,
.tenant-plastcromo .current-empresa strong,
.tenant-plastcromo .company-switcher-copy strong { color: #18181b; }
.tenant-plastcromo .current-empresa small,
.tenant-plastcromo .company-switcher-copy small { color: #65656e; }
.tenant-plastcromo .company-switcher summary {
  color: #142845; background: #fff; border-color: #d6dee8;
  box-shadow: none;
}
.tenant-plastcromo .company-switcher summary:hover { background: #f8fafc; border-color: #9aa9bb; }
.tenant-plastcromo .company-switcher-menu {
  background: #fff; border-color: #d6dee8; box-shadow: 0 18px 48px rgba(13,28,51,.18);
}
.tenant-plastcromo .company-switcher-menu button[type="submit"]:hover,
.tenant-plastcromo .company-switcher-menu button[type="submit"].active { color: #142845; background: #eef2f6; }
.tenant-plastcromo .company-switcher-menu button strong { color: #18181b; }
.tenant-plastcromo .company-switcher-menu button b { color: #27272a; }

.tenant-plastcromo .page-heading {
  position: relative; overflow: hidden; background: linear-gradient(125deg, #f8f8f8 0%, #ededee 100%);
  border-color: #bfc0c5; box-shadow: 0 1px 0 #fff inset, 0 12px 30px rgba(24,24,27,.11);
}
.tenant-plastcromo .page-heading::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: #27272a;
}
.tenant-plastcromo .page-heading h1,
.tenant-plastcromo .form-card > h2,
.tenant-plastcromo .form-card-heading h2 { color: #18181b; }
.tenant-plastcromo .page-heading p,
.tenant-plastcromo .form-card-heading p { color: #5c5c65; }
.tenant-plastcromo.admin-page .card {
  background: #f7f7f8; border-color: #bfc0c5;
  box-shadow: 0 1px 0 #fff inset, 0 11px 28px rgba(24,24,27,.1);
}
.tenant-plastcromo.admin-page .page-heading button,
.tenant-plastcromo.admin-page button[type="submit"] {
  color: #fff; background: #27272a; border-color: #27272a;
  box-shadow: 0 8px 18px rgba(24,24,27,.18);
}
.tenant-plastcromo.admin-page .page-heading button:hover,
.tenant-plastcromo.admin-page button[type="submit"]:hover {
  color: #fff; background: #111113; border-color: #111113;
}
.tenant-plastcromo.admin-page .secondary-action,
.tenant-plastcromo .button-link.secondary {
  color: #3f3f46; background: #e5e5e7; border-color: #bfc0c5; box-shadow: none;
}
.tenant-plastcromo.admin-page .secondary-action:hover,
.tenant-plastcromo .button-link.secondary:hover { color: #18181b; background: #d7d7da; }
.tenant-plastcromo .form-grid .field label { color: #52525b; }
.tenant-plastcromo .form-grid input,
.tenant-plastcromo .form-grid select,
.tenant-plastcromo .page-heading select,
.tenant-plastcromo .classification-card select,
.tenant-plastcromo .table-toolbar input {
  color: #18181b; background: #fff; border-color: #aaaab1;
}
.tenant-plastcromo .form-grid input:focus,
.tenant-plastcromo .form-grid select:focus,
.tenant-plastcromo .page-heading select:focus,
.tenant-plastcromo .classification-card select:focus,
.tenant-plastcromo .table-toolbar input:focus {
  outline: 3px solid rgba(39,39,42,.15); border-color: #27272a;
}
.tenant-plastcromo .eyebrow,
.tenant-plastcromo .row-actions a,
.tenant-plastcromo .establishment-actions a,
.tenant-plastcromo .table-action,
.tenant-plastcromo .table-action-button,
.tenant-plastcromo .breadcrumb a { color: #35353a; }
.tenant-plastcromo .optional-label,
.tenant-plastcromo .system-chip { color: #27272a; background: #dedee1; }

.tenant-plastcromo .admin-table-card th {
  color: #3f3f46; background: #dedee1; border-bottom-color: #bfc0c5;
}
.tenant-plastcromo .admin-table-card td { border-bottom-color: #d2d2d6; }
.tenant-plastcromo .admin-table-card tbody tr:nth-child(even) td { background: #f0f0f1; }
.tenant-plastcromo .admin-table-card tbody tr:hover td { background: #e4e4e6; }
.tenant-plastcromo .table-toolbar,
.tenant-plastcromo .dre-structure-heading { background: #eeeeef; border-bottom-color: #c7c8cc; }
.tenant-plastcromo .dre-structure-heading h2 { color: #18181b; }
.tenant-plastcromo.admin-page .dre-structure-card button.dre-delete-action {
  padding: 5px 7px;
  color: #a33a2b; background: transparent; border: 0;
  border-radius: 0; box-shadow: none; font-size: 10px; font-weight: 500; transform: none;
}
.tenant-plastcromo.admin-page .dre-structure-card button.dre-delete-action:hover,
.tenant-plastcromo.admin-page .dre-structure-card button.dre-delete-action:focus-visible {
  color: #812b20; background: transparent; border: 0;
  box-shadow: none; transform: none; text-decoration: underline;
}
.tenant-plastcromo .import-history-heading { background: #e9e9eb; border-bottom-color: #c1c2c7; }
.tenant-plastcromo .import-history-heading h2,
.tenant-plastcromo .import-period { color: #18181b; }
.tenant-plastcromo .import-history-count { color: #27272a; background: #d2d2d6; }
.tenant-plastcromo .import-history-table th { color: #3f3f46; background: #dedee1; }
.tenant-plastcromo .import-actions button.secondary {
  color: #27272a; background: #e4e4e7; border: 1px solid #a9a9b0;
  box-shadow: none;
}
.tenant-plastcromo .import-actions button.secondary:hover {
  color: #18181b; background: #d4d4d8; border-color: #71717a;
}
.tenant-plastcromo .import-actions #confirmar-importacao {
  color: #fff; background: #27272a; border: 1px solid #27272a;
  box-shadow: 0 7px 16px rgba(24,24,27,.2);
}
.tenant-plastcromo .import-actions #confirmar-importacao:hover {
  color: #fff; background: #111113; border-color: #111113;
}
.tenant-plastcromo .import-actions #confirmar-importacao.danger-action {
  color: #fff; background: #a33a2b; border-color: #a33a2b;
  box-shadow: 0 7px 16px rgba(163,58,43,.2);
}
.tenant-plastcromo .import-actions #confirmar-importacao.danger-action:hover {
  background: #812b20; border-color: #812b20;
}
.tenant-plastcromo.admin-page .delete-confirm-actions .danger-action {
  color: #fff; background: #a33a2b; border-color: #a33a2b;
  box-shadow: 0 6px 14px rgba(163,58,43,.22);
}
.tenant-plastcromo.admin-page .delete-confirm-actions .danger-action:hover {
  color: #fff; background: #812b20; border-color: #812b20;
}
.tenant-plastcromo .choice-card,
.tenant-plastcromo .organization-card,
.tenant-plastcromo .establishment-card,
.tenant-plastcromo .system-card {
  color: #18181b; background: #f7f7f8; border-color: #bfc0c5;
  box-shadow: 0 10px 26px rgba(24,24,27,.08);
}
.tenant-plastcromo .choice-card:hover,
.tenant-plastcromo .organization-card:hover,
.tenant-plastcromo .system-card:hover {
  border-color: #71717a; box-shadow: 0 16px 34px rgba(24,24,27,.14);
}
.tenant-plastcromo .choice-icon,
.tenant-plastcromo .system-card-icon { color: #f4f4f5; background: #35353a; }
.tenant-plastcromo .choice-card > b,
.tenant-plastcromo .organization-arrow { color: #71717a; }
.tenant-plastcromo .organization-logo { background: #e8e8ea; border-color: #c6c7cb; }
.tenant-plastcromo .organization-meta,
.tenant-plastcromo .system-card-meta { border-left-color: #cacacf; }
.tenant-plastcromo .organization-meta b,
.tenant-plastcromo .system-card-meta b { color: #27272a; }
.tenant-plastcromo .establishment-actions { border-top-color: #d6d6da; }
.tenant-plastcromo .access-summary > div,
.tenant-plastcromo .plan-summary > div,
.tenant-plastcromo .plan-summary > a {
  background: linear-gradient(135deg, #f8f8f8, #e9e9eb); border-color: #bfc0c5;
  box-shadow: 0 8px 22px rgba(24,24,27,.07);
}
.tenant-plastcromo .summary-card-action:hover,
.tenant-plastcromo .summary-card-action:focus-visible { border-color: #71717a; box-shadow: 0 10px 24px rgba(24,24,27,.15); }
.tenant-plastcromo .summary-card-action small { color: #35353a; }
.tenant-plastcromo .access-summary b,
.tenant-plastcromo .plan-summary b { color: #27272a; }
.tenant-plastcromo .plan-scope-notice {
  color: #35353a; background: #e1e1e4; border-color: #b8b9be;
}
.tenant-plastcromo .plan-scope-notice > span { color: #fff; background: #35353a; }
.tenant-plastcromo .dre-structure-group { background: #fafafa; border-color: #cfcfd3; }
.tenant-plastcromo .dre-structure-group.sortable:hover { border-color: #8c8c94; box-shadow: 0 5px 15px rgba(0,0,0,.09); }
.tenant-plastcromo .dre-structure-group.subtotal { background: #e2e2e4; border-color: #b9bac0; }
.tenant-plastcromo .dre-structure-group.subtotal .dre-kind { color: #27272a; background: #cacacf; }
.tenant-plastcromo .brand-settings-card { border-top-color: #27272a; }
.tenant-plastcromo .company-system-card { border-top-color: #8d8d95; }

/* Base visual compartilhada pelas estruturas DRE e Patrimonial. */
.structure-summary { margin-bottom: 18px; }
.structure-hierarchy-card { margin-bottom: 18px; }
.structure-classification-card { padding: 0; overflow: hidden; }
.structure-classification-card .table-toolbar > div { display: flex; align-items: center; gap: 8px; }
.structure-classification-card .table-toolbar select { min-width: 185px; }
.structure-classification-card .table-scroll { max-height: 560px; }
.structure-classification-card td > strong,
.structure-classification-card td > small { display: block; }
.structure-classification-card td > small { margin-top: 4px; color: #718096; }

/* Estrutura e classificacao independentes do Balanco Patrimonial. */
.patr-structure-card { margin-bottom: 18px; padding: 0; overflow: hidden; }
.patr-structure-card > summary {
  min-height: 68px; padding: 15px 20px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; cursor: pointer; list-style: none;
  border-bottom: 1px solid transparent; color: #102947;
}
.patr-structure-card[open] > summary { border-bottom-color: #dce3eb; }
.patr-structure-card > summary::-webkit-details-marker { display: none; }
.patr-structure-card > summary span { display: grid; gap: 4px; }
.patr-structure-card > summary strong { font-size: 15px; }
.patr-structure-card > summary small { color: #68788c; font-weight: 500; }
.patr-structure-card > summary > b { font-size: 20px; transition: transform .15s; }
.patr-structure-card[open] > summary > b { transform: rotate(180deg); }
.patr-structure-scroll { max-height: 520px; padding: 16px 20px 22px; overflow: auto; }
.patr-structure-tree,
.patr-structure-tree ul { margin: 0; padding: 0; list-style: none; }
.patr-structure-tree ul { margin: 5px 0 5px 18px; padding-left: 17px; border-left: 1px solid #d8e0e9; }
.patr-structure-tree li > div {
  min-height: 38px; padding: 7px 10px; display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px;
  border-radius: 7px; color: #26394f;
}
.patr-structure-tree li > div:hover { background: #f1f5f9; }
.patr-structure-tree li > div > span {
  padding: 3px 5px; border-radius: 5px; background: #e9eff6;
  color: #50657d; font-size: 9px; font-weight: 800; text-align: center;
}
.patr-structure-tree li > div > small { color: #77869a; font-variant-numeric: tabular-nums; }
.patr-structure-level-1 > div { background: #edf2f7; color: #102947; }
.patr-structure-level-1 > div > strong { font-size: 14px; }
.patr-classify-action { min-width: 86px; }
.patr-classification-card table { min-width: 1080px; }
.patr-classification-card td:nth-child(3) { min-width: 390px; }
.patr-classification-card td:nth-child(3) select { width: 100%; }

.patrimonial-table .patr-level-1 td { background: #e6ebf1; font-weight: 800; }
.patrimonial-table .patr-level-2 .label { padding-left: 32px; }
.patrimonial-table .patr-level-3 .label { padding-left: 48px; }
.patrimonial-table .patr-level-4 .label { padding-left: 64px; }
.patrimonial-table .patr-account-row .label { padding-left: 82px; font-weight: 500; }
.patrimonial-table .conta-codigo { margin-right: 7px; color: #6a7a8d; font-size: 10px; }

.tenant-plastcromo .patr-structure-card > summary { color: #202024; }
.tenant-plastcromo .patr-structure-card[open] > summary { border-bottom-color: #c8c9cd; }
.tenant-plastcromo .patr-structure-card > summary small,
.tenant-plastcromo .patr-classification-card td small { color: #5e5e66; }
.tenant-plastcromo .patr-structure-tree ul { border-left-color: #c9cacf; }
.tenant-plastcromo .patr-structure-tree li > div { color: #303035; }
.tenant-plastcromo .patr-structure-tree li > div:hover { background: #e6e6e8; }
.tenant-plastcromo .patr-structure-tree li > div > span { color: #3f3f46; background: #dedee1; }
.tenant-plastcromo .patr-structure-level-1 > div { color: #18181b; background: #d8d8db; }
.tenant-plastcromo .patrimonial-table .patr-level-1 td,
.tenant-plastcromo .patrimonial-table .patr-level-1 td:first-child { background: #d9dadd; }

.patr-admin-structure-card { margin-bottom: 18px; }
.patr-admin-tree { padding: 0 12px 9px 87px; display: grid; gap: 4px; }
.dre-structure-group:not(.sortable) .patr-admin-tree { padding-left: 63px; }
.patr-admin-level {
  min-height: 38px; padding: 5px 8px; display: grid;
  grid-template-columns: 15px minmax(0, 1fr) auto auto; align-items: center; gap: 7px;
  color: #526176; background: #f7f9fb; border-radius: 6px;
}
.patr-admin-level > strong { color: #34455c; font-size: 12.5px; font-weight: 650; }
.patr-admin-level > small { color: #8190a2; font-size: 10.5px; white-space: nowrap; }
.patr-admin-children {
  grid-column: 2 / -1; margin: 2px 0 1px 8px; padding-left: 15px;
  display: grid; gap: 3px; border-left: 2px solid #d5e0eb;
}
.patr-admin-level-3 { background: #eef3f7; }
.patr-admin-level-4 { background: #e8eef4; border-left: 3px solid #b8c9db; }
.patr-admin-branch { color: #8393a5; }
.patr-admin-level .dre-subgroup-actions { justify-self: end; }
.patr-admin-level .dre-subgroup-actions form { margin: 0; }
.patr-admin-level button { padding: 5px 7px; color: #315c8a; background: transparent; border: 0; box-shadow: none; font-size: 11px; }
.patr-admin-level button:hover { color: #142845; background: #dfe9f2; }
.patr-admin-level button.dre-delete-action { color: #8a95a4; }
.patr-admin-level button.dre-delete-action:hover { color: #a33a2b; background: transparent; }

.tenant-plastcromo .patr-admin-level { color: #4b4b52; background: #ededee; }
.tenant-plastcromo .patr-admin-level > strong { color: #27272a; }
.tenant-plastcromo .patr-admin-level-3 { background: #e4e4e6; }
.tenant-plastcromo .patr-admin-level-4 { background: #dadadd; border-left-color: #9d9da5; }
.tenant-plastcromo .patr-admin-children { border-left-color: #bdbdc2; }
.tenant-plastcromo .patr-admin-level button { color: #3f3f46; }
.tenant-plastcromo .patr-admin-level button:hover { color: #18181b; background: #d4d4d7; }

/* Estrutura DRE e classificacao no mesmo contexto de trabalho. */
.dre-integrated-summary { margin-top: 0; }
.dre-integrated-classification { padding: 0; overflow: hidden; }
.dre-integrated-classification .table-toolbar { border-bottom: 1px solid #e0e6ed; }
.dre-integrated-classification table { min-width: 960px; }
.dre-integrated-classification td > small { font-size: 10px; }
.integrated-classification-actions {
  min-height: 67px; padding: 12px 18px; display: flex; align-items: center;
  justify-content: flex-end; gap: 16px; border-top: 1px solid #d6dee8; background: #f7f9fb;
}
.integrated-classification-actions span { color: #6b7889; font-size: 11px; }

.tenant-plastcromo .integrated-classification-actions { background: #ededee; border-color: #c8c9cd; }
.tenant-plastcromo .integrated-classification-actions span,
.tenant-plastcromo .dre-integrated-classification td > small { color: #5e5e66; }

@media (max-width: 850px) {
  .structure-classification-card .table-toolbar,
  .structure-classification-card .table-toolbar > div { align-items: stretch; flex-direction: column; }
  .structure-classification-card .table-toolbar input,
  .structure-classification-card .table-toolbar select { width: 100%; }
}

/* Acabamento adicional do dashboard: separacao entre leitura e controles. */
.tenant-plastcromo.bi-dashboard .powerbi-content { border-radius: 12px; }
.tenant-plastcromo .dashboard-heading::after {
  content: ""; align-self: stretch; width: 1px; order: 1; background: rgba(255,255,255,.15);
}
.tenant-plastcromo .dashboard-heading > div:first-child { flex: 1; }
.tenant-plastcromo .dashboard-heading-actions { order: 2; }
.tenant-plastcromo .dre-matrix-card .drill-toolbar strong { color: #202024; letter-spacing: .01em; }
.tenant-plastcromo .dre-matrix-card tbody tr { transition: filter .12s, background .12s; }
.tenant-plastcromo .dre-matrix-card tbody tr:hover td { filter: brightness(.96); }

@media (max-width: 1050px) {
  .app-shell { --menu-width: 210px; }
  .app-brand img { width: 120px; }
  .powerbi-frame { grid-template-columns: 160px minmax(0,1fr); }
}
@media (max-width: 850px) {
  .powerbi-frame { grid-template-columns: 1fr; }
  .tenant-plastcromo .dashboard-heading::after { width: 100%; height: 1px; align-self: auto; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .app-menu { position: relative; width: 100%; height: auto; padding: 14px 16px; }
  .menu-toggle { display: none; }
  .app-brand { min-height: 0; padding: 0 0 13px; }
  .app-brand > span:not(.tenant-logo), .app-menu-label, .app-menu-footer { display: none; }
  .app-brand .tenant-logo { width: 105px; height: 42px; }
  .app-brand img { width: 105px; }
  .app-menu-nav { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(105px,1fr)); gap: 5px; }
  .app-menu-nav a { padding: 8px; justify-content: center; font-size: 11px; text-align: center; }
  .app-menu-icon { display: none; }
  .app-workspace > main { padding: 18px 14px 40px; }
  .page-heading { padding: 20px; align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .system-settings-form { grid-template-columns: 1fr; }
  .form-grid .field-wide { grid-column: auto; }
  .brand-remove { grid-column: auto; }
  .form-actions { grid-column: auto; }
  .subtotal-component-grid { grid-template-columns: 1fr; }
  .organization-card { grid-template-columns: 1fr; gap: 14px; }
  .organization-logo { width: 170px; }
  .organization-meta { padding: 12px 0 0; border: 0; border-top: 1px solid #e4e8ee; }
  .organization-arrow { display: none; }
  .heading-actions { align-items: stretch; flex-direction: column; }
  .systems-grid { grid-template-columns: 1fr; }
  .access-summary { grid-template-columns: 1fr; }
  .plan-summary { grid-template-columns: repeat(2,1fr); }
  .plan-toolbar, .plan-toolbar > div { align-items: stretch; flex-direction: column; }
  .plan-toolbar input { width: 100%; }
  .dre-group-main { grid-template-columns: 40px minmax(0,1fr) auto; }
  .dre-structure-group.sortable .dre-group-main { padding-left: 43px; grid-template-columns: 28px minmax(0,1fr) auto; gap: 7px; }
  .dre-drag-handle { width: 32px; }
  .dre-structure-group.sortable .dre-group-actions { grid-column: 2 / -1; }
  .dre-structure-heading { align-items: flex-start; flex-direction: column; }
  .dre-group-actions { grid-column: 2 / -1; }
  .dre-subgroup-list { padding-left: 77px; }
  .system-general-card, .layout-grid { grid-template-columns: 1fr; }
  .layout-grid .field-wide { grid-column: auto; }
  .layout-tabs { width: 100%; }
  .layout-tab { flex: 1; padding-inline: 8px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 245px; padding: 38px; }
  .auth-brand p { margin-top: 22px; font-size: 16px; }
  .auth-panel { padding: 38px 24px 60px; }
  .import-file-row { align-items: stretch; flex-direction: column; }
  .upload-zone { grid-template-columns: 46px minmax(0,1fr); padding: 18px; }
  .upload-icon { width: 46px; height: 46px; }
  .upload-select { display: none; }
  .import-preview-grid { grid-template-columns: 1fr; }
  .batch-preview-item { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .batch-destination { grid-column: 1; }
  .batch-period { grid-column: 2; grid-row: 1; }
  .batch-status { grid-column: 2; grid-row: 2; }
  .bi-dashboard main { height: auto; }
}

/* Visão Executiva: dashboard gráfico independente da matriz DRE. */
.executive-page {
  --executive-ink: #10233d;
  --executive-muted: #67768a;
  --executive-accent: var(--brand-primary);
  --executive-soft: color-mix(in srgb, var(--brand-secondary) 22%, #fff);
  --executive-green: #23815a;
  --executive-red: #b44a3c;
  --executive-amber: #b7791f;
  background: #eef2f6;
}
.executive-page .app-workspace > main { max-width: 1540px; padding-top: 24px; }
.executive-shell { display: grid; gap: 16px; }
.executive-hero {
  min-height: 174px; padding: 30px 34px; position: relative; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 28px;
  color: #fff; background: linear-gradient(125deg, #0d1c33 0%, var(--executive-accent) 64%, color-mix(in srgb, var(--executive-accent) 78%, #fff) 140%);
  border-radius: 16px; box-shadow: 0 18px 40px rgba(13,28,51,.16);
}
.executive-hero::before {
  content: ""; position: absolute; width: 330px; height: 330px; right: 12%; top: -220px;
  border: 1px solid rgba(255,255,255,.13); border-radius: 50%; box-shadow: 0 0 0 48px rgba(255,255,255,.035), 0 0 0 98px rgba(255,255,255,.025);
}
.executive-hero > * { position: relative; z-index: 1; }
.executive-eyebrow { color: color-mix(in srgb, var(--brand-secondary) 75%, #fff); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.executive-hero h1 { margin: 8px 0 7px; color: #fff; font-size: clamp(29px,3vw,42px); line-height: 1; letter-spacing: -.025em; }
.executive-hero p { max-width: 670px; margin: 0; color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.5; }
.executive-table-link { padding: 11px 14px; color: #fff; border: 1px solid rgba(255,255,255,.34); border-radius: 9px; font-size: 11px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.executive-table-link:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.65); }
.executive-filters {
  min-height: 78px; padding: 13px 18px; display: grid; grid-template-columns: minmax(220px,1fr) minmax(210px,310px) minmax(155px,210px); align-items: center; gap: 14px;
  background: #fff; border: 1px solid #d3dce7; border-radius: 12px; box-shadow: 0 7px 20px rgba(20,40,69,.05);
}
.executive-filter-copy { display: grid; gap: 3px; }
.executive-filter-copy strong { color: var(--executive-ink); font-size: 13px; }
.executive-filter-copy small { color: var(--executive-muted); font-size: 10.5px; }
.executive-filters label { display: grid; gap: 5px; color: #5c6b7f; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.executive-filters select { width: 100%; min-height: 39px; padding: 8px 34px 8px 10px; color: var(--executive-ink); background: #f6f8fb; border: 1px solid #cbd6e2; border-radius: 8px; font: inherit; font-size: 12px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.executive-data-alert { padding: 11px 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #795115; background: #fff6e7; border: 1px solid #efd19d; border-radius: 9px; font-size: 11.5px; }
.executive-data-alert a { padding: 7px 10px; color: #6f460c; background: #fff; border: 1px solid #d8ad65; border-radius: 7px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.executive-context { display: flex; align-items: baseline; gap: 9px; color: var(--executive-muted); font-size: 11px; }
.executive-context span { padding-right: 9px; border-right: 1px solid #bdc8d5; font-weight: 750; }
.executive-context strong { color: var(--executive-ink); font-size: 15px; }
.executive-kpis { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }
.executive-kpi {
  min-height: 148px; padding: 18px 20px; position: relative; overflow: hidden; display: grid; align-content: space-between; gap: 10px;
  background: #fff; border: 1px solid #d3dce7; border-radius: 12px; box-shadow: 0 8px 22px rgba(20,40,69,.055);
}
.executive-kpi::after { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--executive-accent); opacity: .72; }
.executive-kpi-result::after { background: var(--executive-green); }
.executive-kpi-net-revenue::after { background: color-mix(in srgb, var(--executive-accent) 58%, var(--executive-green)); }
.executive-kpi-expense::after { background: var(--executive-red); }
.executive-kpi > div { display: grid; gap: 2px; }
.executive-kpi > div span { overflow: hidden; color: #47586d; font-size: 10px; font-weight: 800; letter-spacing: .055em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.executive-kpi > div small { color: #8491a1; font-size: 9.5px; }
.executive-kpi > strong { color: var(--executive-ink); font-size: clamp(19px,2vw,28px); font-weight: 650; letter-spacing: -.025em; }
.executive-kpi > strong a { color: inherit; text-decoration: none; pointer-events: none; }
.executive-kpi em { width: max-content; padding: 4px 7px; border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 800; }
.executive-kpi em small { font-weight: 550; }
.executive-kpi em.positive { color: #1f6849; background: #e4f2eb; }
.executive-kpi em.negative { color: #973c32; background: #f9e8e5; }
.executive-grid { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 14px; }
.executive-chart-card, .executive-insights { min-width: 0; padding: 0; overflow: hidden; background: #fff; border: 1px solid #d3dce7; border-radius: 13px; box-shadow: 0 9px 24px rgba(20,40,69,.055); }
.executive-chart-card { grid-column: span 6; }
.executive-trend-card { grid-column: 1/-1; }
.executive-insights { grid-column: span 4; }
.executive-waterfall-card, .executive-establishment-card { grid-column: 1/-1; }
.executive-card-heading { min-height: 84px; padding: 17px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid #e1e6ed; background: #fbfcfd; }
.executive-card-heading > div:first-child { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr); column-gap: 9px; }
.executive-card-index { grid-row: span 2; min-width: 28px; height: 24px; display: grid; place-items: center; color: #fff; background: var(--executive-accent); border-radius: 6px; font-size: 8.5px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.executive-card-heading h2 { margin: 0; color: var(--executive-ink); font-size: 16px; letter-spacing: -.01em; }
.executive-card-heading p { grid-column: 2; margin: 3px 0 0; color: var(--executive-muted); font-size: 10.5px; line-height: 1.35; }
.executive-legend { display: flex; align-items: center; gap: 12px; color: #67768a; font-size: 9px; font-weight: 700; white-space: nowrap; }
.executive-chart-controls { display: flex; align-items: center; gap: 14px; }
.executive-chart-mode { padding: 3px; display: flex; gap: 2px; background: #e8edf3; border-radius: 8px; }
.executive-chart-mode button { padding: 6px 9px; color: #687789; background: transparent; border: 0; border-radius: 6px; box-shadow: none; font-size: 9px; font-weight: 750; white-space: nowrap; }
.executive-chart-mode button:hover { color: var(--executive-ink); background: rgba(255,255,255,.5); }
.executive-chart-mode button.active { color: #fff; background: var(--executive-ink); }
.executive-legend span::before { content: ""; width: 8px; height: 8px; margin-right: 5px; display: inline-block; border-radius: 50%; }
.executive-legend .revenue::before { background: var(--executive-accent); }
.executive-legend .expense::before { background: var(--executive-red); }
.executive-legend .result::before { background: var(--executive-green); }
.executive-legend .forecast::before { background: #b9e5cb; border: 1px solid #83c9a1; }
.executive-legend .previous::before { background: #8a98aa; }
.executive-forecast-help { position: relative; cursor: help; }
.executive-forecast-help > b { width: 14px; height: 14px; margin-left: 3px; display: inline-grid; place-items: center; color: #417659; border: 1px solid #83b99a; border-radius: 50%; font-size: 8px; }
.executive-forecast-help::after {
  content: attr(data-tooltip); width: 320px; padding: 11px 12px; position: absolute; right: 0; top: calc(100% + 10px); z-index: 20;
  color: #fff; background: #172a22; border-radius: 8px; box-shadow: 0 10px 28px rgba(12,30,21,.24);
  font-size: 10px; font-weight: 550; line-height: 1.5; white-space: normal;
  opacity: 0; visibility: hidden; transform: translateY(-3px); transition: opacity .14s, transform .14s, visibility .14s;
}
.executive-forecast-help:hover::after, .executive-forecast-help:focus-visible::after { opacity: 1; visibility: visible; transform: translateY(0); }
.executive-forecast-help:focus-visible { outline: 2px solid #83b99a; outline-offset: 3px; border-radius: 3px; }
.executive-period-chip { padding: 5px 8px; color: #506176; background: #eef2f6; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.executive-chart-stage { min-height: 330px; padding: 15px 14px 8px; overflow-x: auto; }
.executive-chart-stage svg { width: 100%; min-width: 620px; height: 305px; display: block; overflow: visible; }
.executive-trend-card .executive-chart-stage { min-height: 490px; padding: 20px 18px 12px; }
.waterfall-stage { min-height: 385px; }
.waterfall-stage svg { min-width: 900px; height: 360px; }
.chart-grid-line { stroke: #e2e8ef; stroke-width: 1; stroke-dasharray: 3 4; }
.chart-axis-label { fill: #7c8999; font-size: 10px; font-weight: 600; }
.trend-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.trend-point { stroke: #fff; stroke-width: 2; }
.trend-revenue { stroke: var(--executive-accent); fill: var(--executive-accent); }
.trend-expense { stroke: var(--executive-red); fill: var(--executive-red); }
.trend-result { stroke: var(--executive-green); fill: var(--executive-green); }
.trend-previous { stroke: #8a98aa; fill: #8a98aa; }
#executive-trend-chart { min-width: 980px; height: 450px; }
.accumulated-zero { stroke: #9eabb9; stroke-width: 1.2; }
.accumulated-bar-current { fill: var(--executive-green); }
.accumulated-bar-current-negative { fill: var(--executive-red); }
.accumulated-bar-previous { fill: #aeb8c4; }
.accumulated-bar-forecast { fill: #b9e5cb; stroke: #83c9a1; stroke-width: 1; stroke-dasharray: 4 2; }
.accumulated-bar-forecast-negative { fill: #f9e8e5; stroke: #d9aaa4; stroke-width: 1; stroke-dasharray: 4 2; }
.accumulated-bar-current:hover, .accumulated-bar-current-negative:hover, .accumulated-bar-previous:hover, .accumulated-bar-forecast:hover, .accumulated-bar-forecast-negative:hover { filter: brightness(.92); }
.accumulated-value { fill: #526176; font-size: 8.5px; font-weight: 800; }
.accumulated-month { font-weight: 750; }
.waterfall-zero { stroke: #aebac8; stroke-width: 1; }
.waterfall-connector { stroke: #9eabb9; stroke-width: 1; stroke-dasharray: 3 2; }
.waterfall-positive { fill: var(--executive-green); }
.waterfall-negative { fill: var(--executive-red); }
.waterfall-total { fill: var(--executive-accent); }
.waterfall-value { fill: #536277; font-size: 9px; font-weight: 800; }
.waterfall-label { fill: #5d6b7d; font-size: 9.5px; font-weight: 650; }
.executive-insight-list { padding: 12px; display: grid; gap: 8px; }
.executive-insight-list article { min-height: 68px; padding: 11px 12px; display: grid; grid-template-columns: 27px minmax(0,1fr); align-items: start; gap: 9px; background: #f6f8fa; border-left: 3px solid #aeb9c6; border-radius: 7px; }
.executive-insight-list article > span { width: 25px; height: 25px; display: grid; place-items: center; color: #fff; background: #8290a0; border-radius: 50%; font-size: 11px; font-weight: 850; }
.executive-insight-list article.positiva { border-left-color: var(--executive-green); }
.executive-insight-list article.positiva > span { background: var(--executive-green); }
.executive-insight-list article.negativa { border-left-color: var(--executive-red); }
.executive-insight-list article.negativa > span { background: var(--executive-red); }
.executive-insight-list article.atencao { border-left-color: var(--executive-amber); }
.executive-insight-list article.atencao > span { background: var(--executive-amber); }
.executive-insight-list strong { color: var(--executive-ink); font-size: 11px; }
.executive-insight-list p { margin: 3px 0 0; color: #687789; font-size: 10px; line-height: 1.42; }
.executive-horizontal-chart, .executive-variation-chart { min-height: 360px; padding: 18px 20px 20px; display: grid; align-content: start; gap: 13px; }
.horizontal-chart-row { display: grid; gap: 6px; }
.horizontal-chart-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; }
.horizontal-chart-row strong { overflow: hidden; color: #3c4e64; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.horizontal-chart-row span { color: #77869a; font-size: 9.5px; white-space: nowrap; }
.horizontal-chart-track { height: 9px; overflow: hidden; background: #edf1f5; border-radius: 999px; }
.horizontal-chart-track i { height: 100%; display: block; background: color-mix(in srgb, var(--executive-accent) calc(88% - var(--bar-index) * 5%), #9eb4cb); border-radius: inherit; }
.variation-chart-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 12px; align-items: center; }
.variation-chart-row > strong { overflow: hidden; color: #3c4e64; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.variation-chart-row > span { font-size: 10px; font-weight: 800; }
.variation-chart-row > span.positive { color: var(--executive-green); }
.variation-chart-row > span.negative { color: var(--executive-red); }
.variation-chart-axis { grid-column: 1/-1; height: 10px; position: relative; background: linear-gradient(to right, #f0f2f5 0 49.7%, #aeb8c4 49.7% 50.3%, #f0f2f5 50.3%); border-radius: 3px; }
.variation-chart-axis i { height: 100%; position: absolute; top: 0; border-radius: 3px; }
.variation-chart-axis i.positive { left: 50%; background: var(--executive-green); }
.variation-chart-axis i.negative { right: 50%; background: var(--executive-red); }
.executive-establishment-chart { padding: 12px 18px 18px; display: grid; gap: 5px; }
.establishment-performance { min-height: 67px; padding: 10px 8px; display: grid; grid-template-columns: 34px minmax(180px,1fr) minmax(140px,.6fr); align-items: center; gap: 10px 14px; border-bottom: 1px solid #e5e9ef; }
.establishment-rank { color: #9aa6b4; font-size: 10px; font-weight: 850; }
.establishment-performance > div:nth-child(2), .establishment-result { display: grid; gap: 3px; }
.establishment-performance > div:nth-child(2) strong { color: var(--executive-ink); font-size: 11.5px; }
.establishment-performance small { color: #7a8797; font-size: 9.5px; }
.establishment-result { justify-items: end; }
.establishment-result strong { font-size: 12px; }
.establishment-result strong.positive { color: var(--executive-green); }
.establishment-result strong.negative { color: var(--executive-red); }
.establishment-track { grid-column: 2/-1; height: 6px; overflow: hidden; background: #edf1f5; border-radius: 999px; }
.establishment-track i { height: 100%; display: block; border-radius: inherit; }
.establishment-track i.positive { background: var(--executive-green); }
.establishment-track i.negative { background: var(--executive-red); }
.executive-chart-empty { margin: auto; padding: 38px 20px; color: #7b8798; font-size: 11px; text-align: center; }
.executive-empty { min-height: 360px; padding: 40px; display: grid; place-content: center; justify-items: center; text-align: center; background: #fff; border: 1px solid #d3dce7; border-radius: 13px; }
.executive-empty > span { width: 52px; height: 52px; display: grid; place-items: center; color: var(--executive-accent); background: var(--executive-soft); border-radius: 50%; font-size: 26px; }
.executive-empty h2 { margin: 16px 0 6px; color: var(--executive-ink); }
.executive-empty p { margin: 0; color: var(--executive-muted); font-size: 12px; }
.tenant-plastcromo.executive-page { --executive-ink: #202024; --executive-muted: #686870; --executive-green: #39715a; --executive-red: #a33a2b; background: #dedfe2; }
.tenant-plastcromo .executive-hero { background: linear-gradient(125deg,#111113,#35353a 68%,#626269 140%); }
.tenant-plastcromo .executive-card-index { background: #35353a; }
.tenant-plastcromo .executive-filters,
.tenant-plastcromo .executive-kpi,
.tenant-plastcromo .executive-chart-card,
.tenant-plastcromo .executive-insights { background: #f7f7f8; border-color: #bfc0c5; }
.tenant-plastcromo .executive-card-heading { background: #ededee; border-color: #c8c9cd; }

@media (max-width: 1100px) {
  .executive-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .executive-trend-card, .executive-insights { grid-column: 1/-1; }
}
@media (max-width: 760px) {
  .executive-page .app-workspace > main { padding-top: 14px; }
  .executive-hero { min-height: 210px; padding: 24px 21px; align-items: flex-start; flex-direction: column; }
  .executive-filters { grid-template-columns: 1fr; padding: 16px; }
  .executive-filter-copy { margin-bottom: 3px; }
  .executive-kpis { grid-template-columns: 1fr; }
  .executive-chart-card, .executive-insights { grid-column: 1/-1; }
  .executive-card-heading { align-items: flex-start; flex-direction: column; }
  .executive-chart-controls { width: 100%; align-items: flex-start; flex-direction: column; }
  .executive-chart-mode { width: 100%; }
  .executive-chart-mode button { flex: 1; }
  .executive-legend { flex-wrap: wrap; }
  .executive-data-alert { align-items: flex-start; flex-direction: column; }
  .establishment-performance { grid-template-columns: 28px minmax(0,1fr); }
  .establishment-result { grid-column: 2; justify-items: start; }
  .establishment-track { grid-column: 2; }
}

/* Razão aberto: consulta de movimentos no padrão da página Razão do PBIX. */
.ledger-page { background: #eef2f6; }
.ledger-page .app-workspace > main { max-width: 1540px; padding-top: 24px; }
.ledger-shell { display: grid; gap: 16px; }
.ledger-heading {
  min-height: 132px; padding: 26px 30px; display: flex; align-items: flex-end;
  justify-content: space-between; gap: 24px; color: #fff;
  background: linear-gradient(125deg,#0d1c33,var(--brand-primary) 72%,color-mix(in srgb,var(--brand-primary) 72%,#fff));
  border-radius: 15px; box-shadow: 0 15px 35px rgba(13,28,51,.14);
}
.ledger-eyebrow { color: color-mix(in srgb,var(--brand-secondary) 76%,#fff); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.ledger-heading h1 { margin: 7px 0 6px; color: #fff; font-size: clamp(26px,3vw,38px); line-height: 1; letter-spacing: -.025em; }
.ledger-heading p { max-width: 720px; margin: 0; color: rgba(255,255,255,.72); font-size: 12px; }
.ledger-period { min-width: 190px; padding: 12px 15px; display: grid; gap: 3px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); border-radius: 9px; }
.ledger-period small { color: rgba(255,255,255,.66); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ledger-period strong { font-size: 14px; }
.ledger-filters {
  padding: 15px 18px; display: grid; grid-template-columns: minmax(170px,.8fr) minmax(160px,.65fr) minmax(270px,1.4fr) minmax(150px,.6fr) minmax(260px,1fr);
  align-items: end; gap: 13px; background: #fff; border: 1px solid #d3dce7; border-radius: 12px; box-shadow: 0 7px 20px rgba(20,40,69,.05);
}
.ledger-filters label, .ledger-filter-field { min-width: 0; display: grid; gap: 5px; color: #5c6b7f; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.ledger-filters select, .ledger-filters input { width: 100%; min-width: 0; min-height: 39px; padding: 8px 10px; color: #10233d; background: #f6f8fb; border: 1px solid #cbd6e2; border-radius: 8px; font: inherit; font-size: 11px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.ledger-filters select:focus, .ledger-filters input:focus { outline: 2px solid color-mix(in srgb,var(--brand-primary) 28%,transparent); border-color: var(--brand-primary); }
.ledger-account-combobox { position: relative; }
.ledger-account-combobox #ledger-account-search { padding-right: 38px; }
.ledger-account-toggle { width: 36px; min-height: 37px; padding: 0; position: absolute; top: 1px; right: 1px; z-index: 2; color: #607086; background: transparent; border: 0; border-left: 1px solid #d7dfe8; border-radius: 0 7px 7px 0; box-shadow: none; font-size: 15px; }
.ledger-account-toggle:hover { color: #10233d; background: #edf1f5; box-shadow: none; transform: none; }
.ledger-account-options { max-height: 280px; position: absolute; top: calc(100% + 5px); right: 0; left: 0; z-index: 120; overflow-y: auto; padding: 5px; background: #fff; border: 1px solid #cbd6e2; border-radius: 9px; box-shadow: 0 14px 34px rgba(16,35,61,.16); }
.ledger-account-options button { width: 100%; padding: 8px 9px; display: grid; grid-template-columns: minmax(70px,auto) minmax(0,1fr); gap: 8px; color: #10233d; background: transparent; border: 0; border-radius: 6px; box-shadow: none; text-align: left; text-transform: none; }
.ledger-account-options button:hover { color: #10233d; background: #edf2f7; box-shadow: none; transform: none; }
.ledger-account-options button strong { font-size: 10px; }
.ledger-account-options button span { overflow: hidden; font-size: 10px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.ledger-account-no-results { padding: 10px; display: block; color: #7b8798; font-size: 10px; text-align: center; text-transform: none; }
.ledger-account-no-results[hidden], .ledger-account-options[hidden], .ledger-account-options button[hidden] { display: none; }
.ledger-search-control { display: grid; grid-template-columns: minmax(0,1fr) auto; }
.ledger-search-control input { border-radius: 8px 0 0 8px; }
.ledger-search-control button { min-height: 39px; padding: 0 13px; border-radius: 0 8px 8px 0; box-shadow: none; font-size: 10px; }
.ledger-summary { display: grid; grid-template-columns: minmax(260px,1.5fr) repeat(4,minmax(115px,.55fr)); background: #fff; border: 1px solid #d3dce7; border-radius: 12px; box-shadow: 0 7px 20px rgba(20,40,69,.045); }
.ledger-summary > div { min-height: 74px; padding: 14px 18px; display: grid; align-content: center; gap: 4px; border-left: 1px solid #e1e6ed; }
.ledger-summary > div:first-child { border-left: 0; }
.ledger-summary span { color: #77869a; font-size: 8.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.ledger-summary strong { overflow: hidden; color: #10233d; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.ledger-summary .ledger-account-title strong { font-size: 13px; }
.ledger-summary .ledger-net { background: color-mix(in srgb,var(--brand-secondary) 13%,#fff); border-radius: 0 11px 11px 0; }
.ledger-card { min-height: 380px; overflow: hidden; background: #fff; border: 1px solid #d3dce7; border-radius: 13px; box-shadow: 0 9px 24px rgba(20,40,69,.055); }
.ledger-table-head { min-height: 64px; padding: 15px 19px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: #fbfcfd; border-bottom: 1px solid #e1e6ed; }
.ledger-table-head strong { color: #10233d; font-size: 14px; }
.ledger-table-head span { color: #77869a; font-size: 10px; }
.ledger-table-scroll { overflow: auto; }
.ledger-table { width: 100%; min-width: 840px; border-collapse: collapse; }
.ledger-table th { padding: 11px 14px; color: #69788b; background: #f5f7fa; border-bottom: 1px solid #d9e0e8; font-size: 8.5px; font-weight: 850; letter-spacing: .065em; text-align: left; text-transform: uppercase; }
.ledger-table td { padding: 12px 14px; color: #34465c; border-bottom: 1px solid #e6eaf0; font-size: 11px; vertical-align: middle; }
.ledger-table tbody tr:hover { background: #f8fafc; }
.ledger-table .num { text-align: right; white-space: nowrap; }
.ledger-date { width: 135px; color: #596a7e !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-company { width: 130px; font-weight: 700; }
.ledger-history { min-width: 340px; }
.ledger-history strong { display: block; color: #24374e; font-size: 11px; font-weight: 650; }
.ledger-history small { margin-top: 3px; display: block; color: #8a96a5; font-size: 9px; }
.ledger-type { padding: 4px 7px; color: #52667d; background: #eef2f6; border-radius: 999px; font-size: 9px; font-weight: 800; }
.ledger-value { width: 140px; color: #24374e !important; font-weight: 800; font-variant-numeric: tabular-nums; }
.ledger-value.positive { color: #227252 !important; }
.ledger-value.negative { color: #a24137 !important; }
.ledger-empty { min-height: 378px; padding: 42px 20px; display: grid; place-content: center; justify-items: center; text-align: center; }
.ledger-empty > span { width: 52px; height: 52px; display: grid; place-items: center; color: var(--brand-primary); background: color-mix(in srgb,var(--brand-secondary) 24%,#fff); border-radius: 50%; font-size: 23px; font-weight: 800; }
.ledger-empty h2 { margin: 15px 0 6px; color: #10233d; font-size: 19px; }
.ledger-empty p { max-width: 570px; margin: 0; color: #748295; font-size: 11.5px; line-height: 1.5; }
.ledger-empty-warning > span { color: #8b5c13; background: #fff2d8; }
.ledger-pagination { min-height: 58px; padding: 11px 18px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-top: 1px solid #e1e6ed; }
.ledger-pagination a { width: max-content; padding: 7px 10px; color: var(--brand-primary); border: 1px solid #ccd7e3; border-radius: 7px; font-size: 10px; font-weight: 800; text-decoration: none; }
.ledger-pagination a:last-child { justify-self: end; }
.ledger-pagination strong { color: #6a798c; font-size: 9.5px; }

@media (max-width: 1200px) {
  .ledger-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ledger-account-filter, .ledger-search-filter { grid-column: span 2; }
  .ledger-summary { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .ledger-summary .ledger-account-title { grid-column: 1/-1; border-left: 0; border-bottom: 1px solid #e1e6ed; }
}
@media (max-width: 700px) {
  .ledger-page .app-workspace > main { padding-top: 14px; }
  .ledger-heading { min-height: 210px; padding: 23px 20px; align-items: flex-start; flex-direction: column; }
  .ledger-period { width: 100%; }
  .ledger-filters { grid-template-columns: 1fr; }
  .ledger-account-filter, .ledger-search-filter { grid-column: auto; }
  .ledger-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ledger-summary > div { border-bottom: 1px solid #e1e6ed; }
  .ledger-summary .ledger-account-title { grid-column: 1/-1; }
  .ledger-summary .ledger-net { border-radius: 0; }
  .ledger-table-head { align-items: flex-start; flex-direction: column; }
}
