:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #66717d;
  --line: #d9e0e6;
  --blue: #2457a6;
  --blue-dark: #183d76;
  --green: #1f7a5a;
  --amber: #b86111;
  --red: #b42318;
  --shadow: 0 12px 32px rgba(23, 32, 42, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef2f5;
}

.login-panel {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 32px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 24px;
  font-size: 1.65rem;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.18rem;
}

h3 {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.stack {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.filter-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.cost-center-filter {
  min-width: 0;
}

.cost-center-picker {
  position: relative;
  min-width: 0;
}

.cost-center-trigger {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
}

.cost-center-trigger:focus,
.cost-center-trigger[aria-expanded="true"] {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 87, 166, 0.12);
}

.cost-center-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cost-center-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 5px);
  right: 0;
  width: min(390px, calc(100vw - 32px));
  border: 1px solid #c6d0d9;
  border-radius: 7px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 14px 32px rgba(23, 32, 42, 0.16);
}

.cost-center-panel input[type="search"] {
  min-height: 36px;
}

.cost-center-panel-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.cost-center-panel-actions button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 3px 2px;
  font-size: 0.74rem;
  font-weight: 800;
}

.cost-center-options {
  max-height: 300px;
  overflow-y: auto;
  padding-top: 4px;
}

.cost-center-option {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 5px;
  padding: 6px 7px;
  color: var(--ink);
  cursor: pointer;
}

.cost-center-option:hover {
  background: #f1f5f8;
}

.cost-center-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--blue);
}

.cost-center-option span {
  min-width: 0;
}

.cost-center-option strong,
.cost-center-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cost-center-option small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
}

.cost-center-empty {
  padding: 16px 8px;
  color: var(--muted);
  text-align: center;
  font-size: 0.74rem;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 87, 166, 0.12);
}

.button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 12px;
  font-weight: 700;
}

.button:hover {
  border-color: #b9c4cd;
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.button.primary:hover {
  background: var(--blue-dark);
}

.button.ghost {
  background: transparent;
}

.button.danger {
  border-color: rgba(180, 35, 24, 0.35);
  color: var(--red);
}

.company-picker {
  min-width: 230px;
  max-width: 320px;
  display: grid;
  gap: 3px;
  margin-right: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.company-picker select {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 0.78rem;
  font-weight: 700;
}

.company-create {
  min-height: 32px;
  padding: 5px 9px;
  white-space: nowrap;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

.app-shell:not(.sidebar-collapsed) {
  grid-template-columns: 236px minmax(0, 1fr);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 62px minmax(0, 1fr);
}

.sidebar {
  background: #111827;
  color: #eef2f7;
  padding: 16px 12px;
  transition: padding 0.18s ease;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #2d6b4f;
  font-weight: 800;
}

.brand-text {
  min-width: 0;
}

.brand small {
  display: block;
  color: #aab4c0;
  font-size: 0.78rem;
}

.sidebar-toggle {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(219, 227, 236, 0.22);
  border-radius: 6px;
  background: #182235;
  color: #eef2f7;
  font-weight: 800;
  line-height: 1;
}

.sidebar-toggle:hover {
  background: #223044;
  border-color: rgba(219, 227, 236, 0.38);
}

.nav {
  display: grid;
  gap: 5px;
}

.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #dbe3ec;
  padding: 9px 10px;
  text-align: left;
  font-size: 0.9rem;
}

.nav button.active,
.nav button:hover {
  background: #223044;
  color: #fff;
}

.nav button.nav-banking {
  margin-bottom: 0;
  background: #183d35;
  color: #fff;
  box-shadow: inset 3px 0 #55b68b, inset 0 0 0 1px rgba(117, 214, 171, 0.2);
}

.nav button.nav-banking:hover,
.nav button.nav-banking.active {
  background: #245447;
  box-shadow: inset 3px 0 #78d2aa, inset 0 0 0 1px rgba(148, 229, 192, 0.3);
}

.nav-banking .nav-icon {
  background: #2d6b4f;
  color: #fff;
}

.nav button.nav-banking-sub {
  margin-bottom: 8px;
  color: #cfe7dc;
}

.nav button.nav-banking-sub::before {
  background: #55b68b;
}

.nav button.nav-banking-sub.active,
.nav button.nav-banking-sub:hover {
  background: #1d3d39;
  color: #fff;
}

.nav-feature-tag {
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid rgba(164, 226, 198, 0.36);
  border-radius: 4px;
  color: #bce9d4;
  font-size: 0.61rem;
  font-weight: 800;
  text-transform: uppercase;
}

.nav button.nav-sub {
  margin-top: -3px;
  padding-left: 28px;
  font-size: 0.84rem;
  color: #cbd6e2;
}

.nav button.nav-sub::before {
  content: "";
  width: 12px;
  height: 1px;
  background: rgba(219, 227, 236, 0.4);
  flex: 0 0 12px;
}

.nav-icon {
  display: none;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  font-weight: 800;
}

.nav-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.nav-group { min-width: 0; margin: 6px 0; }
.nav button.nav-group-heading { font-weight: 700; color: #9bd9c3; }
.nav-group-label { min-width: 0; overflow-wrap: anywhere; }
.nav-group-short { display: none; }
.nav-group-chevron { flex: 0 0 12px; transition: transform .15s; }
.nav-group-heading[aria-expanded="true"] .nav-group-chevron { transform: rotate(90deg); }
.nav button.nav-group-heading.contains-active { background: #1c353b; }
.nav-group-items { display: grid; gap: 5px; padding: 4px 0 4px 10px; margin-left: 9px; border-left: 1px solid #44615b; min-height: 18px; }
.nav-group-items[hidden] { display: none; }
.nav [draggable="true"] { cursor: grab; }
.nav [draggable="true"]:active { cursor: grabbing; }
.nav .menu-dragging { opacity: .45; }
.nav .menu-drop-before { box-shadow: inset 0 3px #79d1b5 !important; }
.nav .menu-drop-after { box-shadow: inset 0 -3px #79d1b5 !important; }
.nav .menu-drop-inside { outline: 2px solid #79d1b5; outline-offset: -2px; background: #1c353b; }
.sidebar-context-menu { position: fixed; z-index: 2500; display: grid; min-width: 220px; max-width: calc(100vw - 16px); padding: 5px; border: 1px solid #cad4dc; border-radius: 6px; background: #fff; box-shadow: 0 6px 20px #17202a30; }
.sidebar-context-menu button { min-height: 34px; padding: 7px 10px; border: 0; border-radius: 3px; background: transparent; color: #17202a; text-align: left; overflow-wrap: anywhere; }
.sidebar-context-menu button:hover, .sidebar-context-menu button:focus-visible { background: #e6f1ef; outline: 2px solid #287b64; outline-offset: -2px; }
.sidebar-context-menu button:disabled { color: #84919b; cursor: default; }
.sidebar-menu-dialog { width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 22px; border: 1px solid #cbd6df; border-radius: 8px; color: var(--ink); }
.sidebar-menu-dialog::backdrop { background: #11182770; }
.sidebar-menu-dialog form { display: grid; gap: 16px; }
.sidebar-menu-dialog input, .sidebar-menu-dialog select { width: 100%; min-width: 0; }
.sidebar-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.sidebar-collapsed .nav-group-label, .sidebar-collapsed .nav-group-chevron { display: none; }
.sidebar-collapsed .nav-group-short { display: inline; }
.sidebar-collapsed .nav-group-items { margin-left: 0; padding-left: 0; border-left: 0; }
@media (max-width: 760px) {
  .nav-group-label, .nav-group-chevron { display: none; }
  .nav-group-short { display: inline; }
  .nav-group-items { margin-left: 0; padding-left: 0; border-left: 0; }
}

.sidebar-collapsed .sidebar {
  padding: 14px 8px;
}

.sidebar-collapsed .sidebar-head {
  flex-direction: column;
  margin-bottom: 16px;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-feature-tag {
  display: none;
}

.sidebar-collapsed .brand {
  justify-content: center;
}

.sidebar-collapsed .sidebar-toggle {
  width: 34px;
}

.sidebar-collapsed .nav button {
  justify-content: center;
  padding: 6px 0;
}

.sidebar-collapsed .nav button.nav-sub {
  margin-top: 0;
  padding-left: 0;
}

.sidebar-collapsed .nav button.nav-sub::before {
  display: none;
}

.sidebar-collapsed .nav-icon {
  display: grid;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 24px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

#page-subtitle {
  margin: 0;
  color: var(--muted);
}

.userbar {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.filters {
  display: grid;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 13px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.filter-actions {
  grid-column: span 4;
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.filter-actions .button {
  min-width: 132px;
}

.check-option {
  min-width: 190px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 7px 10px;
  color: var(--ink);
  font-size: 0.74rem;
  cursor: pointer;
}

.check-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--blue);
}

.check-option small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.comparison-option {
  min-width: 190px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 7px 10px;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 700;
}

.comparison-option select {
  min-height: 24px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  padding: 0;
}

.view {
  min-width: 0;
  padding: 20px 24px 36px;
}

.loading-panel {
  max-width: 860px;
  margin: 6px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px 26px;
  box-shadow: 0 8px 20px rgba(23, 32, 42, 0.05);
}

.loading-head,
.global-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #24384d;
  font-size: 0.86rem;
  font-weight: 800;
}

.loading-track {
  width: 100%;
  height: 10px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf3;
}

.loading-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #1f7a5a);
  transition: width 0.35s ease;
}

.loading-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.global-progress {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 80;
  width: min(420px, calc(100vw - 32px));
  transform: translateY(-140%);
  opacity: 0;
  pointer-events: none;
  border: 1px solid #cbd8e3;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.is-loading .global-progress {
  transform: translateY(0);
  opacity: 1;
}

.section {
  margin-bottom: 18px;
}

.report-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px 14px;
}

.report-actions strong {
  display: block;
  font-size: 0.88rem;
}

.report-actions span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
}

.report-action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.income-export-format {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.income-export-format label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 40px;
  padding: 0 12px;
  margin: 0;
  cursor: pointer;
  background: white;
  color: var(--ink);
}

.income-export-format label + label { border-left: 1px solid var(--line); }
.income-export-format label:has(input:checked) { background: #2457a6; color: white; }
.income-export-format label:has(input:focus-visible) { outline: 2px solid #17202a; outline-offset: -3px; }
.income-export-format input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.account-plan-header,
.account-plan-tools {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.account-plan-tools {
  margin: 12px 0;
}

.account-plan-tools label {
  width: min(560px, 100%);
}

.account-plan-tools label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.account-plan-table-wrap {
  max-height: calc(100vh - 330px);
}

.account-plan-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.account-code-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.account-tree-mark {
  color: #1d5da8;
  line-height: 1;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-card {
  padding: 13px 14px;
}

.metric-card span {
  display: block;
  min-height: 24px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.18rem;
}

.metric-card small,
.metric-card em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 800;
}

.metric-card.good strong {
  color: var(--green);
}

.metric-card.warn strong {
  color: var(--amber);
}

.metric-card.bad strong {
  color: var(--red);
}

.dashboard-treasury { min-width: 0; }
.forecast-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1180px) {
  .forecast-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.workspace:has(.dashboard-treasury, .forecast-report-context) { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 820px) {
  .workspace:has(.dashboard-treasury, .forecast-report-context) .filter-actions { flex-wrap: wrap; }
  .workspace:has(.dashboard-treasury, .forecast-report-context) .filter-actions > * { min-width: 0; width: 100%; }
  .workspace:has(.dashboard-treasury, .forecast-report-context) .filters > label { min-width: 0; }
  .workspace:has(.dashboard-treasury, .forecast-report-context) input,
  .workspace:has(.dashboard-treasury, .forecast-report-context) select { max-width: 100%; }
  .workspace:has(.dashboard-treasury, .forecast-report-context) .metric-card strong { overflow-wrap: anywhere; }
}
.dashboard-treasury .section-header { flex-wrap: wrap; gap: 12px; }
.dashboard-treasury .section-header h3 { margin-bottom: 4px; }
.dashboard-treasury .section-header p { margin: 0; }
.dashboard-treasury-summary { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.dashboard-treasury-summary strong { display: inline-block; margin-left: 8px; }
.dashboard-treasury-table { min-width: 680px; }
.dashboard-cashflow-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dashboard-cashflow-header h3 { margin-bottom: 0; }
.dashboard-cashflow-header .treasury-period-control button { min-height: 34px; padding: 6px 10px; }

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.panel {
  padding: 14px 16px;
}

.panel h3,
.section h3 {
  margin: 0 0 10px;
  color: #10243a;
  font-size: 0.98rem;
}

.warning-panel {
  border-color: #f2c98b;
  background: #fff9ed;
}

.clean-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.clean-list li {
  display: grid;
  gap: 2px;
  color: #17202a;
  font-size: 0.82rem;
}

.clean-list span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.compact-table-wrap {
  margin-bottom: 14px;
}

.compact-table-wrap caption {
  padding: 8px 10px;
  color: #10243a;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: left;
}

.fiscal-actions {
  margin-bottom: 16px;
}

.fiscal-metrics {
  margin-bottom: 14px;
}

.fiscal-next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.fiscal-next span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.fiscal-next strong {
  display: block;
  margin-top: 4px;
  color: #10243a;
  font-size: 0.92rem;
}

.fiscal-next small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.fiscal-windows {
  margin-bottom: 14px;
}

.fiscal-window {
  min-height: 220px;
  padding: 12px;
}

.fiscal-window h3 {
  margin-bottom: 10px;
  color: #21364a;
}

.fiscal-obligation {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  border: 1px solid #d6e1eb;
  border-left-width: 4px;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.fiscal-obligation.alto {
  border-left-color: var(--red);
}

.fiscal-obligation.medio {
  border-left-color: var(--amber);
}

.fiscal-obligation.baixo {
  border-left-color: var(--green);
}

.fiscal-obligation-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.fiscal-obligation strong {
  color: #10243a;
  font-size: 0.82rem;
}

.fiscal-obligation p {
  margin: 0;
  color: #3a4a5d;
  font-size: 0.74rem;
  line-height: 1.35;
}

.fiscal-obligation small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.fiscal-date {
  white-space: nowrap;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
}

.fiscal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.fiscal-tags span {
  border: 1px solid #d6e1eb;
  border-radius: 999px;
  background: #f6f9fb;
  color: #344458;
  padding: 2px 7px;
  font-size: 0.66rem;
  font-weight: 800;
}

.fiscal-source-panel {
  margin-bottom: 14px;
}

.fiscal-notes {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}

.fiscal-notes span {
  color: #405064;
  font-size: 0.76rem;
}

.fiscal-source-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.fiscal-source-list a {
  display: grid;
  gap: 3px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  color: inherit;
  padding: 9px 10px;
  text-decoration: none;
}

.fiscal-source-list strong {
  color: #19334f;
  font-size: 0.74rem;
}

.fiscal-source-list span {
  color: var(--muted);
  font-size: 0.68rem;
}

.fiscal-table-wrap {
  max-height: calc(100vh - 180px);
  overflow: auto;
}

.fiscal-table {
  min-width: 1360px;
}

.fiscal-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.fiscal-table td:nth-child(1) {
  min-width: 126px;
}

.fiscal-table td:nth-child(2) {
  min-width: 320px;
}

.empty.compact {
  min-height: 70px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.76rem;
}

.panel {
  padding: 14px;
  overflow: hidden;
}

.insight-panel {
  min-height: 150px;
}

.insight-list {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.45;
}

.muted-text {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.settings-table input,
.movement-edit-table input {
  width: 100%;
  min-width: 92px;
}

.settings-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #12314d;
  white-space: nowrap;
}

.settings-choice input {
  width: 18px;
  min-width: 18px;
  height: 18px;
}

.movement-edit-table {
  min-width: 1900px;
}

.movement-edit-table td,
.movement-edit-table th {
  vertical-align: top;
}

.movement-edit-table .amount-input {
  min-width: 86px;
  text-align: right;
}

.movement-header {
  align-items: flex-start;
  gap: 16px;
}

.movement-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: min(620px, 100%);
}

.movement-actions input {
  min-width: 260px;
}

.movement-search-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  gap: 10px;
  align-items: end;
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.movement-search-panel label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.manual-movement-panel {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbff;
}

.manual-movement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin-top: 12px;
  align-items: end;
}

.manual-movement-grid label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.movement-edit-table .locked-input {
  color: #64748b;
  background: #f1f5f9;
  border-style: dashed;
  cursor: not-allowed;
}

.movement-edit-table tr.manual-row td {
  background: #fbfffb;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.movement-delete-button {
  width: 100%;
  margin-top: 8px;
  padding: 5px 8px;
  font-size: 0.72rem;
}

.saved-row td {
  background: #ecfdf3;
}

.monthly-analysis-table {
  min-width: 1180px;
}

.forecast-row td {
  background: #f8fbff;
}

.accounting-control-note {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid #d5e0e9;
  border-radius: 8px;
  background: #fff;
}

.accounting-control-table .row-risk-high td {
  background: #fff5f5;
}

.accounting-control-table .row-risk-medium td {
  background: #fffaf0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-table-wrap {
  max-height: calc(100vh - 116px);
  overflow: auto;
  overscroll-behavior: contain;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.financial-table {
  min-width: 1520px;
  border-collapse: separate;
  border-spacing: 0;
}

.financial-table.center-column-table {
  min-width: 5200px;
}

.financial-table.comparison-table {
  min-width: 5200px;
}

.financial-table.center-column-table.comparison-table {
  min-width: 8200px;
}

th,
td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.8rem;
  line-height: 1.2;
}

th {
  background: #f0f4f7;
  color: #44505c;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.report-table-wrap .financial-table thead th,
.report-table-wrap .balance-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 1px 0 var(--line);
}

.official-report-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  border-radius: 0;
  background: #fff;
  padding: 10px 18px 4px;
}

.official-report-head h3 {
  margin-bottom: 6px;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #0b4166;
}

.official-report-head span {
  color: var(--muted);
}

.official-report-year {
  min-width: 92px;
  border-left: 3px solid var(--blue);
  padding-left: 12px;
  text-align: right;
}

.official-report-year strong {
  display: block;
  color: var(--blue);
  font-size: 1.15rem;
}

.official-report-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.official-report-wrap {
  max-width: 940px;
  margin-inline: 0 auto;
  overflow: auto;
  border: 0;
  border-radius: 0;
}

.official-report-table {
  min-width: 760px;
  border-collapse: collapse;
}

.official-report-table th {
  border-bottom: 1px solid #0d2435;
  background: #fff;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: none;
}

.official-report-table th:first-child,
.official-report-table td:first-child {
  width: 58%;
}

.official-report-table td:first-child {
  padding-left: calc(8px + var(--indent, 0px));
}

.official-report-table th.note-col,
.official-report-table td.note-col {
  width: 58px;
  background: #e8f2f9;
  color: #0b80b9;
  text-align: center;
}

.official-report-table th.amount,
.official-report-table td.amount {
  width: 128px;
}

.official-report-table td {
  border-bottom: 0;
  color: #374151;
  font-size: 0.76rem;
  line-height: 1.18;
  padding-top: 3px;
  padding-bottom: 3px;
}

.official-report-table .official-section td {
  border-bottom: 0;
  padding-top: 16px;
  padding-bottom: 4px;
  font-size: 0.83rem;
  font-weight: 500;
  color: #374151;
}

.official-report-table .official-subtotal td,
.official-report-table .official-total td {
  font-weight: 500;
  color: #0584c7;
}

.official-report-table .official-total td {
  border-top: 1px solid #0d2435;
  color: #374151;
}

.official-report-table .official-level-2 td:first-child {
  font-style: italic;
}

.official-equity-head {
  max-width: 1220px;
}

.official-equity-wrap {
  max-width: 1220px;
  margin-inline: 0 auto;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.official-equity-table {
  min-width: 1160px;
  border-collapse: collapse;
}

.official-equity-table th,
.official-equity-table td {
  border-bottom: 0;
  color: #374151;
  font-size: 0.72rem;
  line-height: 1.15;
  padding: 5px 8px;
}

.official-equity-table thead th {
  border-bottom: 1px solid #0d2435;
  background: #fff;
  color: #2f4154;
  font-weight: 500;
  vertical-align: bottom;
}

.official-equity-table .equity-group-heading {
  border-top: 1px solid #0d2435;
  text-align: center;
  font-size: 0.7rem;
}

.official-equity-table th:first-child,
.official-equity-table td:first-child {
  min-width: 360px;
  text-align: left;
}

.official-equity-table .formula-col {
  width: 50px;
  color: #0284c7;
  text-align: right;
}

.official-equity-table .note-col {
  width: 58px;
  background: #e8f2f9;
  color: #0284c7;
  text-align: center;
}

.official-equity-table .amount {
  min-width: 92px;
  text-align: right;
  white-space: nowrap;
}

.official-equity-table .equity-section td {
  padding-top: 12px;
}

.official-equity-table .equity-opening td,
.official-equity-table .equity-line-blue td {
  color: #0284c7;
}

.official-equity-table .equity-closing td {
  border-top: 1px solid #0d2435;
  font-weight: 700;
}

.official-equity-table .equity-subtotal td {
  color: #0284c7;
}

.official-note {
  max-width: 980px;
  text-align: left;
  border: 0;
  background: #fff;
  font-size: 0.72rem;
}

.report-table-wrap .financial-table thead tr:nth-child(2) th {
  top: 29px;
  z-index: 6;
}

tbody tr:hover {
  background: #f8fafb;
}

.financial-table th:first-child,
.financial-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 292px;
  background: #fff;
}

.financial-table th:first-child {
  z-index: 7;
  background: #f0f4f7;
}

.report-table-wrap .financial-table thead th:first-child {
  z-index: 8;
}

.financial-table .summary-row td {
  background: #f8fafb;
}

.financial-table .summary-row td:first-child {
  background: #f8fafb;
}

.financial-table .total-col {
  background: #f4f7f9;
}

.financial-table .month-group {
  text-align: center;
  background: #e8f0f7;
  border-left: 1px solid #cbd7e2;
}

.financial-table .month-group-row th {
  height: 29px;
  padding-top: 3px;
  padding-bottom: 3px;
  line-height: 1.15;
}

.financial-table .comparison-subhead-row th,
.financial-table .center-subhead-row th {
  height: 28px;
  padding-top: 3px;
  padding-bottom: 3px;
  line-height: 1.1;
}

.financial-table .center-subcol {
  min-width: 78px;
  padding-right: 7px;
  padding-left: 7px;
  text-align: right;
  background: #f5f8fb;
  font-size: 0.66rem;
}

.financial-table .center-value {
  color: #263747;
}

.financial-table .period-total {
  background: #f1f5f8;
  font-weight: 700;
}

.comparison-col {
  background: #f7fafc;
  min-width: 94px;
}

.comparison-current {
  background: #fff;
  min-width: 104px;
}

.borrowing-reclass-section {
  padding-top: 14px;
  padding-bottom: 14px;
}

.borrowing-reclass-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
}

.borrowing-reclass-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  border: 1px solid #d5e0e9;
  border-radius: 7px;
  padding: 12px;
  background: #fff;
}

.borrowing-reclass-card-head,
.borrowing-reclass-total,
.borrowing-reclass-actions,
.settings-warning {
  grid-column: 1 / -1;
}

.borrowing-reclass-card-head,
.borrowing-reclass-total,
.borrowing-reclass-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.borrowing-reclass-card-head span,
.borrowing-reclass-total span {
  color: var(--muted);
  font-size: 0.76rem;
}

.borrowing-reclass-total {
  padding: 8px 10px;
  border-radius: 6px;
  background: #f4f7fa;
}

.borrowing-reclass-card label {
  display: grid;
  gap: 5px;
  color: #2e4154;
  font-size: 0.75rem;
  font-weight: 700;
}

.borrowing-reclass-card input {
  width: 100%;
  min-width: 0;
  text-align: right;
}

.settings-warning {
  color: var(--red);
  font-size: 0.74rem;
}

@media (max-width: 760px) {
  .borrowing-reclass-grid {
    grid-template-columns: 1fr;
  }
}

.balance-table {
  width: auto;
  min-width: 780px;
}

.balance-table th:first-child,
.balance-table td:first-child {
  width: 560px;
  min-width: 420px;
  max-width: 620px;
}

.balance-table th.amount,
.balance-table td.amount {
  width: 170px;
  min-width: 150px;
  text-align: right;
  white-space: nowrap;
}

.comparison-subhead-row th {
  font-size: 0.66rem;
}

.delta-positive {
  color: var(--green);
}

.delta-negative {
  color: var(--red);
}

.balance-table .balance-model-row td:first-child {
  padding-left: calc(10px + var(--indent, 0px));
}

.balance-table .balance-expandable-row td:first-child {
  white-space: normal;
}

.balance-table .balance-drill-button {
  margin-left: -2px;
}

.balance-row-label {
  vertical-align: middle;
}

.balance-account-detail-row td {
  background: #fbfcfe;
  color: #435268;
  font-size: 0.76rem;
}

.balance-account-detail-row td:first-child {
  padding-left: calc(34px + var(--indent, 0px));
}

.balance-detail-name {
  display: inline-block;
  margin-left: 8px;
  max-width: 360px;
  vertical-align: middle;
  white-space: normal;
}

.balance-detail-meta {
  display: inline-block;
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.balance-table .balance-section td {
  background: #eef3f7;
  color: #21364a;
  font-weight: 800;
}

.balance-table .balance-subtotal td {
  background: #f7fafc;
  font-weight: 800;
  border-top: 1px solid #cbd7e2;
}

.balance-table .balance-total td,
.balance-table .balance-control td {
  background: #eaf1f7;
  color: #0c2238;
  font-weight: 900;
  border-top: 2px solid #9fb2c3;
}

.center-summary-section {
  padding-top: 0;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.section-title strong {
  font-size: 0.9rem;
}

.section-title span {
  color: var(--muted);
  font-size: 0.78rem;
}

.compact-wrap {
  border-radius: 7px;
}

.center-summary-table {
  min-width: 1320px;
}

.center-summary-table th:first-child,
.center-summary-table td:first-child {
  min-width: 260px;
}

.center-summary-group td {
  background: #eef3f7;
  color: #2d3f50;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.center-summary-row td:first-child {
  background: #fff;
}

.center-code {
  min-width: 62px;
}

.hidden-row {
  display: none;
}

.drill-button {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  margin-right: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--blue);
  font-weight: 800;
  font-size: 0.96rem;
  line-height: 1;
  cursor: pointer;
}

.drill-button:hover {
  border-color: var(--blue);
  background: #eef4fb;
}

.drill-spacer {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  vertical-align: middle;
}

.drill-row:has(.drill-button) {
  cursor: pointer;
}

.hierarchy-row td:first-child {
  padding-left: var(--indent, 8px);
}

.hierarchy-root td {
  background: #f4f8fc;
  font-weight: 800;
}

.hierarchy-configured td:first-child {
  font-weight: 700;
}

.hierarchy-imported td:first-child {
  background: #fbfcfd;
}

.hierarchy-center td {
  background: #f8fbff;
  color: #334155;
}

.hierarchy-center td:first-child {
  font-weight: 600;
}

.section-row td:first-child {
  font-weight: 700;
}

.account-row td:first-child {
  padding-left: 18px;
  background: #fbfcfd;
}

.supplier-row td {
  background: #fbfcfd;
}

.supplier-row td:first-child {
  padding-left: var(--indent, 36px);
  font-weight: 700;
}

.supplier-badge {
  display: inline-flex;
  margin-right: 8px;
  border: 1px solid #d2dde7;
  border-radius: 6px;
  padding: 2px 6px;
  background: #fff;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.movement-row td {
  background: #fff;
  color: #44505c;
  font-size: 0.76rem;
}

.movement-row td:first-child {
  padding-left: var(--indent, 46px);
}

.row-label {
  display: inline-block;
  max-width: 184px;
  line-height: 1.12;
  vertical-align: middle;
  white-space: normal;
}

.snc-list {
  display: inline-flex;
  margin-left: 10px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
}

.snc-code {
  display: inline-flex;
  min-width: 42px;
  justify-content: center;
  margin-right: 6px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  padding: 1px 6px;
  background: #f5f9ff;
  color: #1f4e8c;
  font-size: 0.7rem;
  font-weight: 800;
}

.movement-meta,
.movement-tags {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}

.movement-count {
  display: inline-flex;
  margin-top: 0;
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
}

.supplier-row .movement-count {
  margin-left: 6px;
}

.section-row .movement-count,
.center-summary-row .movement-count {
  display: inline-flex;
  margin-top: 0;
  margin-left: 8px;
}

.movement-text {
  display: block;
  margin: 2px 0;
  color: var(--ink);
}

.amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.76rem;
  font-weight: 800;
}

.pill.ok {
  background: rgba(31, 122, 90, 0.12);
  color: var(--green);
}

.pill.low {
  background: rgba(36, 87, 166, 0.12);
  color: var(--blue);
}

.pill.medium {
  background: rgba(184, 97, 17, 0.14);
  color: var(--amber);
}

.pill.high,
.pill.error {
  background: rgba(180, 35, 24, 0.12);
  color: var(--red);
}

.pill.neutral {
  background: #eef4fb;
  color: #294661;
}

.fiscal-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #d9a441;
  border-radius: 8px;
  background: #fff7e6;
  color: #553c0a;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.modelo22-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.modelo22-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.check-option.compact {
  min-height: 44px;
  padding: 9px 12px;
}

.modelo22-details {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.modelo22-details summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 12px;
}

.modelo22-table-wrap {
  max-height: 620px;
}

.modelo22-replica-shell {
  border-color: #c8d8e8;
  background: #f8fbfe;
}

.modelo22-replica-shell .section-header {
  align-items: flex-start;
}

.modelo22-search {
  width: min(340px, 100%);
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.86rem;
  background: #fff;
}

.modelo22-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0 16px;
  padding-bottom: 8px;
  overflow-x: auto;
}

.modelo22-tabs a {
  flex: 0 0 auto;
  border: 1px solid #c8d8e8;
  border-radius: 999px;
  background: #fff;
  color: #1f4e8c;
  padding: 7px 11px;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.modelo22-tabs a:hover {
  border-color: var(--blue);
  background: #eef5ff;
}

.modelo22-replica {
  display: grid;
  gap: 18px;
}

.modelo22-page {
  border: 1px solid #c8d8e8;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.modelo22-page.hidden {
  display: none;
}

.modelo22-page-head {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: #0f2742;
  color: #fff;
}

.modelo22-page-head span,
.modelo22-page-head small {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.76rem;
  font-weight: 700;
}

.modelo22-page-head strong {
  font-size: 0.92rem;
}

.modelo22-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  padding: 14px;
}

.modelo22-import-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px auto;
  gap: 12px;
  align-items: end;
}

.modelo22-import-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.modelo22-import-row input[type="file"] {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 8px;
  color: var(--ink);
}

.check-card.compact {
  min-height: 42px;
  align-items: center;
}

.muted-small {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 8px 0 0;
}

.modelo22-field {
  display: grid;
  gap: 7px;
  min-height: 152px;
  border: 1px solid #d5e2ef;
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
}

.modelo22-field.hidden {
  display: none;
}

.modelo22-field.is-overridden {
  border-color: var(--blue);
  background: #f2f7ff;
}

.modelo22-field.is-dirty {
  border-color: var(--amber);
  background: #fff8ed;
}

.modelo22-field-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.modelo22-field-top strong {
  color: #184985;
  font-size: 0.82rem;
}

.modelo22-field-top em {
  border-radius: 999px;
  background: rgba(184, 97, 17, 0.14);
  color: var(--amber);
  padding: 3px 7px;
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.modelo22-field-top em.ok {
  background: rgba(31, 122, 90, 0.12);
  color: var(--green);
}

.modelo22-field-top em.na {
  background: rgba(76, 99, 122, 0.12);
  color: #526476;
}

.modelo22-field-label {
  min-height: 34px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.35;
}

.modelo22-field input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  background: #fff;
}

.modelo22-field input.is-dirty {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(184, 97, 17, 0.1);
}

.modelo22-field-reason {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.field-meta {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 4px 10px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.field-meta dt {
  font-weight: 700;
  color: var(--ink);
}

.field-meta dd {
  margin: 0;
}

.audit-list,
.opportunity-grid {
  display: grid;
  gap: 12px;
}

.opportunity-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.opportunity-card,
.audit-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.opportunity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.source-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.upload-box {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px dashed #9daab6;
  border-radius: 8px;
  background: #fbfcfd;
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.officegest-import-section {
  border-top: 3px solid #28745c;
}

.workspace:has(.officegest-import-section) {
  grid-template-columns: minmax(0, 1fr);
}

.officegest-import-section .section-header {
  flex-wrap: wrap;
}

.view:has(.officegest-import-section) input {
  max-width: 100%;
}

.view:has(.officegest-import-section) .upload-box {
  grid-template-columns: minmax(0, 1fr);
}

.officegest-import-controls {
  display: grid;
  grid-template-columns: 110px minmax(160px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.officegest-import-controls label,
.import-comparison-filters label {
  min-width: 0;
}

.import-comparison-filters label {
  max-width: 100%;
}

.import-comparison-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  margin-bottom: 14px;
}

.import-comparison-filters .import-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
}

.import-check input {
  width: 16px;
  height: 16px;
}

.import-comparison-table {
  max-height: 420px;
}

.import-comparison-table table {
  min-width: 1050px;
}

.import-comparison-table thead th[colspan],
.import-comparison-table thead th.amount,
.import-comparison-summary thead th.amount {
  text-align: center;
}

.import-comparison-table th,
.import-comparison-table td,
.import-comparison-summary th,
.import-comparison-summary td,
.officegest-source-tables th,
.officegest-source-tables td {
  border-right: 1px solid #c8d4e0;
}

.import-comparison-summary {
  margin-top: 12px;
}

.import-comparison-summary table {
  min-width: 650px;
}

.import-comparison-summary tbody th {
  background: #fff;
  text-transform: none;
}

.import-comparison-summary .import-result-total > * {
  background: #eaf1f7;
  border-top: 2px solid #b9c9d8;
  border-bottom: 2px solid #b9c9d8;
  font-weight: 800;
}

.import-comparison-table thead tr:first-child th:nth-child(n+3):nth-child(-n+6),
.import-comparison-table thead tr:nth-child(2) th:nth-child(2n),
.import-comparison-table tbody td:nth-child(3),
.import-comparison-table tbody td:nth-child(5),
.import-comparison-table tbody td:nth-child(7),
.import-comparison-table tbody td:nth-child(9) {
  border-right-width: 2px;
}

.import-comparison-table td:first-child {
  min-width: 76px;
  white-space: nowrap;
}

.import-comparison .section-header {
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .officegest-import-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .officegest-import-controls .button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .workspace:has(.officegest-import-section) .filters {
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace:has(.officegest-import-section) .filter-actions {
    flex-wrap: wrap;
    min-width: 0;
  }
  .workspace:has(.officegest-import-section) .filter-actions > * {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 100%;
  }
}

@media (max-width: 560px) {
  .officegest-import-controls {
    grid-template-columns: minmax(0, 1fr);
  }
  .import-comparison-filters label {
    width: 100%;
  }
  .view:has(.officegest-import-section) .panel,
  .view:has(.officegest-import-section) .issue-list {
    overflow-wrap: anywhere;
  }
}

.issue-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.issue-list li {
  border-left: 4px solid var(--amber);
  background: #fff;
  border-radius: 6px;
  padding: 10px 12px;
}

.issue-list li.error {
  border-left-color: var(--red);
}

.chart {
  display: grid;
  gap: 9px;
}

.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 110px;
  gap: 10px;
  align-items: center;
}

.bar-track {
  height: 12px;
  background: #e6ebef;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--blue);
}

.bar-fill.green {
  background: var(--green);
}

.bar-fill.amber {
  background: var(--amber);
}

.empty {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  display: none;
  max-width: min(420px, calc(100vw - 40px));
  border-radius: 8px;
  background: #17202a;
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.toast.show {
  display: block;
}

.account24-report {
  color: #081f49;
}

.account24-report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.account24-report-header h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
  color: #0a2c66;
  letter-spacing: 0;
}

.account24-report-header h2 span {
  font-size: 22px;
}

.account24-report-meta {
  min-width: 155px;
  text-align: right;
  font-size: 10px;
  color: #0a2c66;
}

.account24-filter-strip,
.account24-kpi-strip {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.account24-filter-strip {
  grid-template-columns: 1.25fr 0.7fr 0.75fr 1.1fr 1.1fr;
}

.account24-kpi-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.account24-filter-card,
.account24-kpi,
.account24-panel {
  border: 1px solid #c6d5e7;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 4px rgb(16 42 86 / 8%);
}

.account24-filter-card {
  padding: 8px 10px;
}

.account24-filter-card span,
.account24-kpi span {
  display: block;
  color: #29446f;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.account24-filter-card strong {
  display: block;
  margin-top: 5px;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}

.account24-kpi {
  min-height: 74px;
  padding: 12px 14px;
  border-top-width: 4px;
}

.account24-kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  color: #0e7a4f;
}

.account24-kpi em {
  display: block;
  margin-top: 4px;
  color: #46566e;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.account24-kpi-blue {
  border-top-color: #0b5cad;
}

.account24-kpi-green {
  border-top-color: #2f7d44;
}

.account24-kpi-red {
  border-top-color: #c62828;
}

.account24-kpi-red strong {
  color: #b42318;
}

.account24-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 10px;
  margin-bottom: 10px;
}

.account24-panel {
  overflow: hidden;
}

.account24-panel h3 {
  margin: 0;
  padding: 8px 10px;
  background: linear-gradient(180deg, #0d3978, #082b5f);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.account24-table-wrap {
  overflow: auto;
}

.account24-summary-table,
.account24-mini-table {
  width: 100%;
  border-collapse: collapse;
}

.account24-summary-table th,
.account24-summary-table td,
.account24-mini-table th,
.account24-mini-table td {
  border: 1px solid #cdd9e8;
  padding: 5px 7px;
  font-size: 11px;
  line-height: 1.15;
}

.account24-summary-table th,
.account24-mini-table th {
  background: #eef4fb;
  color: #0b2c63;
  font-weight: 800;
}

.account24-summary-table td:nth-child(2) {
  padding-left: calc(7px + var(--indent, 0px));
}

.account24-parent-row td {
  font-weight: 800;
  background: #f6f9fd;
}

.account24-child-row td:nth-child(2) {
  color: #202f47;
}

.account24-total-row td,
.account24-total-mini td {
  background: #08316d;
  color: #fff;
  font-weight: 800;
}

.account24-dc {
  text-align: center;
  font-weight: 800;
  color: #0b5cad;
}

.account24-blue {
  color: #073b83;
  font-weight: 800;
}

.account24-positive {
  color: #0e7a4f;
  font-weight: 800;
}

.account24-negative {
  color: #b42318;
  font-weight: 800;
}

.account24-alert-panel {
  align-self: start;
}

.account24-indicators {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.account24-indicator {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid #d9e3ef;
  border-radius: 8px;
  background: #fbfdff;
}

.account24-indicator-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.account24-indicator strong,
.account24-indicator em,
.account24-indicator small {
  display: block;
}

.account24-indicator strong {
  font-size: 11px;
  color: #17202a;
}

.account24-indicator em {
  margin-top: 2px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.account24-indicator small {
  margin-top: 1px;
  font-size: 10px;
  font-weight: 700;
}

.account24-risk-baixo {
  color: #0e7a4f;
}

.account24-risk-medio {
  color: #b86b00;
}

.account24-risk-alto {
  color: #c62828;
}

.account24-alert-box {
  margin: 0 10px 10px;
  padding: 10px;
  border: 1px solid #dc4c3f;
  border-radius: 8px;
  background: #fff8f7;
}

.account24-alert-box > strong {
  display: block;
  margin-bottom: 8px;
  color: #8b1e16;
  text-align: center;
  font-size: 12px;
}

.account24-alert {
  display: grid;
  gap: 2px;
  padding: 7px 0;
  border-top: 1px solid #f1c3be;
  font-size: 11px;
}

.account24-alert span {
  color: #3c4658;
}

.account24-bottom-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.85fr 1fr 0.95fr 1.1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.account24-footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr 270px;
  gap: 10px;
}

.account24-bars {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  min-height: 160px;
  padding: 14px 10px 8px;
  gap: 5px;
}

.account24-chart-legend {
  display: flex;
  gap: 12px;
  padding: 10px 12px 0;
  color: #0b2c63;
  font-size: 10px;
  font-weight: 800;
}

.account24-chart-legend span::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-radius: 2px;
  vertical-align: -1px;
  background: #0b5cad;
}

.account24-chart-legend .credit::before {
  background: #2f7d44;
}

.account24-chart-legend .saldo::before {
  background: #f4a62a;
}

.account24-bar-month {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.account24-bar-stack {
  display: flex;
  align-items: end;
  height: 120px;
  gap: 2px;
  border-bottom: 1px solid #ccd8e6;
}

.account24-bar-stack i {
  display: block;
  width: 5px;
  min-height: 3px;
  border-radius: 2px 2px 0 0;
  background: #0b5cad;
}

.account24-bar-stack .credit {
  background: #2f7d44;
}

.account24-bar-stack .saldo {
  background: #f4a62a;
}

.account24-bar-month span {
  font-size: 9px;
  color: #0b2c63;
  font-weight: 700;
}

.account24-iva-layout {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.account24-donut {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  position: relative;
}

.account24-donut::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: inherit;
  background: #fff;
}

.account24-mini-list {
  display: grid;
  gap: 7px;
}

.account24-mini-list div {
  display: grid;
  gap: 2px;
}

.account24-mini-list span,
.account24-mini-table span {
  color: #5c6a7e;
  font-size: 10px;
}

.account24-mini-list strong {
  font-size: 10px;
}

.account24-mini-list i {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3f8;
}

.account24-mini-list b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0b5cad;
}

.account24-two-mini-tables {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.account24-mini-table td {
  font-size: 10px;
}

.empty-cell {
  color: #6b7280;
  text-align: center;
}

.account24-check-list,
.account24-legend-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px 16px 12px 24px;
  font-size: 11px;
  color: #17202a;
}

.account24-check-list li::marker {
  color: #0e7a4f;
}

.account24-approval-panel dl {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 14px 8px;
  margin: 0;
  padding: 18px 16px;
  font-size: 12px;
}

.account24-approval-panel dd {
  min-height: 18px;
  margin: 0;
  border-bottom: 1px solid #6f7f96;
}

.account24-status {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 800;
}

.account24-status.ok {
  background: #dcefe5;
  color: #0e7a4f;
}

.account24-status.review {
  background: #f6e8d7;
  color: #a25500;
}

@media (max-width: 1320px) {
  .filters {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }

  .filter-actions {
    grid-column: span 4;
  }
}

@media (max-width: 1180px) {
  .filters {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }

  .filter-actions {
    grid-column: span 4;
  }

  .metric-grid,
  .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account24-main-grid,
  .account24-bottom-grid,
  .account24-footer-grid {
    grid-template-columns: 1fr;
  }

  .account24-filter-strip,
  .account24-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .app-shell:not(.sidebar-collapsed) {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .sidebar {
    position: static;
  }

  .nav {
    grid-template-columns: 1fr;
  }

  .topbar,
  .filters,
  .view {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters,
  .metric-grid,
  .split-grid,
  .grid.two,
  .grid.three,
  .movement-search-panel,
  .mapping-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    grid-column: auto;
  }
}

.treasury-page {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #17283d;
  font-variant-numeric: tabular-nums;
}

.treasury-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #d5dee8;
  border-radius: 7px;
}

.treasury-toolbar-main,
.treasury-actions,
.treasury-event-filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
}

.treasury-toolbar label,
.treasury-event-filters label {
  display: grid;
  gap: 5px;
  color: #536377;
  font-size: 12px;
  font-weight: 700;
}

.treasury-toolbar input,
.treasury-toolbar select,
.treasury-event-filters select {
  min-width: 150px;
  height: 39px;
}

.treasury-period-control {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: max-content;
  height: 39px;
  border: 1px solid #cbd6e2;
  border-radius: 6px;
  overflow: hidden;
}

.treasury-period-control button,
.treasury-tabs button {
  border: 0;
  background: #fff;
  color: #40536a;
  font-weight: 700;
}

.treasury-period-control button {
  padding: 0 13px;
  white-space: nowrap;
  border-right: 1px solid #d8e0e9;
}

.treasury-period-control button:last-child {
  border-right: 0;
}

.treasury-period-control button.active {
  background: #173f70;
  color: #fff;
}

.treasury-coverage-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 16px;
  border: 1px solid #e4bb72;
  border-left: 4px solid #c67a00;
  border-radius: 6px;
  background: #fff8e9;
  color: #694819;
}

.treasury-coverage-warning div {
  display: grid;
  gap: 3px;
}

.treasury-coverage-warning button,
.treasury-panel header button,
.treasury-scenario-grid button {
  border: 0;
  background: transparent;
  color: #145da0;
  font-weight: 700;
}

.treasury-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  border-bottom: 1px solid #cbd6e2;
}

.treasury-tabs button {
  flex: 0 0 auto;
  padding: 11px 14px;
  border-bottom: 3px solid transparent;
}

.treasury-tabs button.active {
  border-bottom-color: #1e68ad;
  color: #134f87;
}

.treasury-content {
  display: grid;
  gap: 14px;
}

.treasury-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.treasury-kpi,
.treasury-panel,
.treasury-calendar article {
  background: #fff;
  border: 1px solid #d5dee8;
  border-radius: 7px;
}

.treasury-kpi {
  min-width: 0;
  padding: 15px 16px;
  border-top: 3px solid #7890a9;
}

.treasury-kpi > span,
.treasury-kpi > small,
.treasury-kpi > em {
  display: block;
  color: #627186;
  font-size: 12px;
  font-style: normal;
}

.treasury-kpi > small {
  margin-top: 2px;
  color: #2f4258;
  font-weight: 700;
}

.treasury-kpi > strong {
  display: block;
  margin: 9px 0 5px;
  color: #163a63;
  font-size: 23px;
  overflow-wrap: anywhere;
}

.treasury-tone-in { border-top-color: #18845d; }
.treasury-tone-out,
.treasury-tone-danger { border-top-color: #bd3838; }
.treasury-tone-warning { border-top-color: #c67a00; }
.treasury-tone-ok { border-top-color: #2476b8; }
.treasury-tone-in > strong { color: #087654; }
.treasury-tone-out > strong,
.treasury-tone-danger > strong { color: #a92c2c; }

.treasury-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, .85fr);
  gap: 14px;
}

.treasury-panel {
  min-width: 0;
  padding: 17px;
}

.treasury-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.treasury-source-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.treasury-source-actions small {
  color: #68778a;
  white-space: nowrap;
}

.treasury-plan-options {
  display: flex;
  align-items: center;
  gap: 9px;
}

.treasury-plan-options > span,
.treasury-plan-options > small {
  color: #68778a;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.treasury-panel h3 {
  margin: 0 0 3px;
  color: #142a43;
  font-size: 17px;
}

.treasury-panel p {
  margin: 0;
  color: #68778a;
  font-size: 13px;
}

.treasury-chart-wrap {
  min-height: 270px;
}

.treasury-chart {
  display: block;
  width: 100%;
  height: 250px;
  overflow: visible;
}

.treasury-chart path,
.treasury-chart line {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.treasury-chart .balance { stroke: #1768ac; stroke-width: 2.5; }
.treasury-chart .minimum { stroke: #c67a00; stroke-width: 1.5; stroke-dasharray: 6 4; }
.treasury-chart .zero { stroke: #cbd6e2; stroke-width: 1; }

.treasury-chart-legend,
.treasury-chart-axis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #67768a;
  font-size: 11px;
}

.treasury-chart-legend {
  justify-content: flex-start;
  gap: 18px;
}

.treasury-chart-legend span::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 3px;
  margin-right: 6px;
  vertical-align: middle;
  background: #1768ac;
}

.treasury-chart-legend span.minimum::before { background: #c67a00; }

.treasury-alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.treasury-alerts > header { margin-bottom: 4px; }

.treasury-alert {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 11px;
  text-align: left;
  border: 1px solid #d9e1e9;
  border-left: 4px solid #c67a00;
  border-radius: 5px;
  background: #fff;
  color: #263a50;
}

.treasury-alert-high { border-left-color: #bb3030; }
.treasury-alert > span { color: #a26a10; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.treasury-alert-high > span { color: #ad2929; }
.treasury-alert > em,
.treasury-alert > small { color: #68778a; font-size: 11px; font-style: normal; }

.treasury-map-wrap {
  max-height: calc(100vh - 330px);
  overflow: auto;
  border: 1px solid #d7e0e9;
}

.treasury-map {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.treasury-map th,
.treasury-map td {
  min-width: 132px;
  padding: 8px 9px;
  border-right: 1px solid #e0e6ed;
  border-bottom: 1px solid #d7e0e9;
  background: #fff;
  white-space: nowrap;
}

.treasury-map th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eaf0f6;
  color: #34485f;
  text-align: right;
}

.treasury-map th:first-child,
.treasury-map td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 310px;
  text-align: left;
  box-shadow: 1px 0 #d2dce6;
}

.treasury-map th:first-child { z-index: 4; background: #eaf0f6; }
.treasury-map-month th:first-child,
.treasury-map-month td:first-child {
  width: 310px;
  min-width: 310px;
  max-width: 310px;
  white-space: normal;
}
.treasury-map-month td:first-child button { max-width: 100%; white-space: normal; text-align: left; }

.treasury-map-month th:not(:first-child),
.treasury-map-month td:not(:first-child) {
  width: 170px;
  min-width: 170px;
}

@media (max-width: 750px) {
  .treasury-map-month th:first-child,
  .treasury-map-month td:first-child {
    position: static;
    width: 240px;
    min-width: 240px;
    max-width: 240px;
  }
}

.treasury-map th small { display: block; color: #708095; font-weight: 400; }
.treasury-map td.amount { text-align: right; }
.treasury-map td.negative { color: #af2d2d; }
.treasury-map-section td { background: #eef3f8; font-weight: 800; }
.treasury-map-category td:first-child { padding-left: 28px; }
.treasury-map-category button { border: 0; background: transparent; color: #243a52; }
.treasury-map-total td { background: #f4f7fa; font-weight: 800; }
.treasury-map-grand td { background: #dce8f4; color: #0f355d; font-weight: 900; border-top: 2px solid #356a9c; }
.treasury-map-control td { background: #fff9e9; font-weight: 700; }
.treasury-map-budget td { background: #edf7f3; font-weight: 700; }
.treasury-budget { margin-bottom: 18px; padding: 14px 0; border-top: 1px solid #d7e0e8; border-bottom: 1px solid #d7e0e8; }
.treasury-budget-heading, .treasury-budget-base { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 28px; }
.treasury-budget-heading h4 { margin: 0; font-size: 16px; }
.treasury-budget-heading > span, .treasury-budget p { color: #627387; font-size: 13px; }
.treasury-budget p { margin: 8px 0 0; overflow-wrap: anywhere; }
.treasury-budget-base { margin-top: 10px; }
.treasury-budget-base strong { margin-left: 10px; font-size: 18px; color: #167a60; white-space: nowrap; }
.treasury-budget-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 14px; }
.treasury-budget-controls label { display: grid; gap: 5px; color: #627387; font-size: 13px; min-width: 0; }
.treasury-budget-controls input[type="number"] { width: 150px; max-width: 100%; }
.treasury-budget-controls .treasury-budget-toggle { display: flex; align-items: center; align-self: center; color: #243a52; }
.treasury-budget-toggle input { width: 18px; height: 18px; margin: 0 4px 0 0; }
.treasury-budget-shortcut { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; margin-bottom: 16px; border-bottom: 1px solid #d7e0e8; }
.treasury-budget-shortcut h3 { margin: 0; font-size: 18px; }
.treasury-budget-shortcut p { margin: 6px 0 0; color: #627387; }
.treasury-budget-table { width: 100%; min-width: 930px; border-collapse: collapse; }
.treasury-budget-table th, .treasury-budget-table td { padding: 10px; border: 1px solid #d7e0e8; }
.treasury-budget-table th { background: #edf3f8; }
.treasury-budget-table th:not(:first-child), .treasury-budget-table .amount { text-align: right; white-space: nowrap; }
.treasury-budget-table small { display: block; margin-top: 4px; color: #627387; font-size: 12px; white-space: nowrap; }
.treasury-budget-table tfoot { font-weight: 700; background: #edf3f8; }

.treasury-event-filters {
  margin-bottom: 12px;
}

.treasury-event-table td small,
.treasury-event-table td strong {
  display: block;
}

.officegest-startup-warning { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; color: #6e4300; background: #fff5df; border-left: 4px solid #c98000; line-height: 1.45; overflow-wrap: anywhere; }
.officegest-startup-warning > div { flex: 1 1 240px; min-width: 0; }
.officegest-startup-warning small { display: block; margin-top: 4px; }
.officegest-startup-warning button { flex: 0 0 auto; max-width: 100%; }
.officegest-startup-warning.hidden { display: none; }
.treasury-event-table td small { margin-top: 2px; color: #78879a; }
.treasury-event-table tr.overdue td:first-child { color: #b32e2e; font-weight: 800; }
.treasury-event-table .positive { color: #087654; font-weight: 800; }
.treasury-event-table .negative { color: #a92c2c; font-weight: 800; }
.treasury-event-table { min-width: 1200px; }
.treasury-event-table td:nth-child(-n+4) { white-space: nowrap; }
.treasury-entity-table { width: 100%; min-width: 1000px; }
.treasury-entity-table td, .treasury-entity-table th { border-right: 1px solid #e0e6ed; }
.treasury-entity-summary-row > td:not(:first-child) { white-space: nowrap; }
.treasury-entity-table .treasury-entity-name { position: sticky; left: 0; min-width: 220px; max-width: 280px; white-space: normal; z-index: 1; background: #fff; border-right: 1px solid #cbd6e2; }
.treasury-entity-table .treasury-entity-summary-row > .treasury-entity-name { white-space: normal; overflow-wrap: anywhere; }
.treasury-entity-table.has-selection .treasury-entity-name { left: 36px; }
.treasury-entity-table > thead .treasury-entity-name,
.treasury-entity-table > tfoot .treasury-entity-name { background: #eef3f8; }
.treasury-entity-table .treasury-doc-count { width: 72px; min-width: 72px; max-width: 72px; white-space: normal; }
.treasury-select { width: 36px; min-width: 36px; max-width: 36px; padding: 8px !important; text-align: center; }
.treasury-select input { width: 16px; height: 16px; margin: 0; accent-color: #2459a7; cursor: pointer; }
.treasury-entity-table .treasury-select { position: sticky; left: 0; background: #fff; z-index: 2; }
.treasury-entity-table thead .treasury-select { background: #eef3f8; }
.treasury-exclusion-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.treasury-exclusion-actions > span { margin-right: 8px; font-size: 13px; color: #596a7e; }
.treasury-event-table td .treasury-excluded-label,
.treasury-entity-table td .treasury-excluded-label { color: #8a5808; white-space: normal; }
.treasury-exclusion-dialog { width: min(680px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); box-sizing: border-box; padding: 24px; border: 1px solid #cbd6e2; border-radius: 6px; color: #18344f; }
.treasury-exclusion-dialog::backdrop { background: #16233080; }
.treasury-exclusion-dialog h3 { margin: 0 0 12px; font-size: 20px; }
.treasury-exclusion-dialog label { display: grid; gap: 6px; margin: 14px 0; }
.treasury-exclusion-dialog select, .treasury-exclusion-dialog textarea { width: 100%; box-sizing: border-box; }
.treasury-exclusion-dialog ul { max-height: 40vh; overflow: auto; padding-left: 22px; overflow-wrap: anywhere; }
.treasury-exclusion-dialog footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.treasury-exclusion-dialog [role="alert"] { color: #a92c2c; }
.treasury-exclusion-dialog .treasury-exclusion-list { padding: 0; list-style: none; }
.treasury-exclusion-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e0e6ed; }
.treasury-exclusion-list li > div { display: grid; gap: 4px; min-width: 0; }
.treasury-exclusion-list button { flex-shrink: 0; }
.treasury-entity-table td small { display: block; color: #78879a; margin-top: 2px; }
.treasury-credit-details { margin-top: 6px; max-width: 360px; white-space: normal; font-size: 12px; }
.treasury-credit-details summary { cursor: pointer; color: #385e7c; }
.treasury-credit-details ul { padding-left: 18px; max-height: 220px; overflow: auto; }
.treasury-exclusion-dialog[data-view="credits"] { width: min(1000px, calc(100vw - 32px)); }
.treasury-exclusion-dialog[data-view="credits"] .table-wrap { max-height: 55vh; overflow: auto; margin-bottom: 16px; }
.treasury-exclusion-dialog[data-view="credits"] table { min-width: 800px; }
.treasury-exclusion-dialog[data-view="credits"] td small { display: block; }
.treasury-entity-table .positive { color: #087654; font-weight: 800; }
.treasury-entity-table .negative { color: #a92c2c; font-weight: 800; }
.treasury-entity-table tfoot { background: #eef3f8; font-weight: 800; }
.treasury-payment-section { margin-top: 20px; }
.treasury-payment-section > h4 { margin: 0 0 12px; font-size: 16px; }
.treasury-entity-table .treasury-summary-total > * { border-top: 2px solid #cbd6e2; background: #f0f5f7; font-weight: 700; }
.treasury-entity-table .treasury-summary-total small { font-weight: 400; color: #65758a; display: block; margin-top: 3px; }
.treasury-payment-total { margin-top: 20px; }
.treasury-payment-total table { width: 100%; min-width: 640px; background: #eef3f8; }
.treasury-payment-total td { font-weight: 700; }
.treasury-payment-total td small { display: block; margin-top: 3px; font-weight: 400; color: #65758a; }

.fixed-contracts-page { display: grid; gap: 18px; min-width: 0; }
.fixed-contracts-page > * { min-width: 0; }
.fixed-contract-filters { display: grid; grid-template-columns: repeat(3,minmax(145px,1fr)) auto; align-items: end; gap: 14px; }
.fixed-contract-filters label, .fixed-contract-search label { display: grid; gap: 7px; min-width: 0; color: #65758a; font-size: 14px; }
.fixed-contract-filters select, .fixed-contract-search select, .fixed-contract-search input { width: 100%; min-width: 0; }
.fixed-contract-scope { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; padding-bottom: 16px; border-bottom: 1px solid #d4dee7; }
.fixed-contract-scope small { flex-basis: 100%; color: #65758a; }
.fixed-contract-search { display: grid; grid-template-columns: minmax(180px,1.5fr) minmax(160px,1fr) minmax(180px,1fr) minmax(210px,1.2fr); gap: 14px; }
.fixed-contract-selection { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin: 12px 0; }
.fixed-contract-selection-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fixed-contract-selection small { color: #65758a; }
.fixed-contract-select-all, .fixed-contract-supplier-content { display: flex; align-items: start; gap: 8px; }
.fixed-contract-supplier-content > div { min-width: 0; }
.fixed-contract-select-all input, .fixed-contract-supplier-content input { width: 16px; height: 16px; min-width: 16px; margin: 2px 0 0; padding: 0; flex-shrink: 0; accent-color: #2459a7; cursor: pointer; }
.fixed-contract-save-status { margin: 8px 0; color: #087654; }
.fixed-contract-save-status.is-error { color: #9d2b25; }
.fixed-contract-excluded-label { display: inline-block; padding: 2px 5px; margin: 4px 0 0; background: #e2e7eb; color: #536170; font-size: 11px; font-weight: 700; }
.fixed-contract-matrix .fixed-row-excluded > td { background: #f2f4f6; color: #647384; }
.fixed-contract-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 20px; margin-bottom: 18px; padding: 0 0 18px; border-bottom: 1px solid #d4dee7; }
.fixed-contract-metrics span { display: block; color: #65758a; font-size: 13px; }
.fixed-contract-metrics strong { display: block; margin-top: 6px; font-size: 22px; overflow-wrap: anywhere; }
.fixed-contract-warning { margin: 0 0 16px; padding: 10px 14px; border-left: 4px solid #b87915; background: #fff7e7; color: #765319; }
.fixed-contract-warning p { margin: 4px 0; }
.fixed-contract-table { width: 100%; min-width: 1000px; table-layout: fixed; }
.fixed-contract-table td, .fixed-contract-table th { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.fixed-contract-table small, .fixed-contract-evidence small { display: block; margin-top: 4px; color: #65758a; }
.fixed-contract-table tfoot, .fixed-contract-evidence tfoot { background: #eef3f8; font-weight: 700; }
.fixed-contract-matrix { --fixed-supplier-width: 240px; min-width: calc(var(--fixed-supplier-width) + var(--fixed-matrix-extra)); }
.fixed-matrix-supplier-col { width: var(--fixed-supplier-width); }
.fixed-contract-matrix .fixed-matrix-supplier { position: sticky; left: 0; z-index: 1; background: #fff; border-right: 1px solid #ccd7e1; }
.fixed-contract-matrix thead .fixed-matrix-supplier, .fixed-contract-matrix tfoot .fixed-matrix-supplier { background: #eef3f8; z-index: 2; }
.fixed-contract-matrix th, .fixed-contract-matrix td { border-right: 1px solid #e0e6ed; }
.fixed-matrix-month-heading { text-align: center; }
.fixed-matrix-month-heading small { display: block; margin-top: 3px; color: #65758a; font-weight: 400; }
.fixed-contract-matrix td.fixed-matrix-cell { padding: 0; vertical-align: middle; }
.fixed-matrix-cell > button { display: flex; flex-direction: column; justify-content: center; gap: 3px; width: 100%; min-height: 60px; padding: 8px 6px; border: 0; background: transparent; color: inherit; font: inherit; text-align: right; cursor: pointer; }
.fixed-matrix-cell > button:hover { box-shadow: inset 0 0 0 2px #8aa5bd; }
.fixed-matrix-cell > button:focus-visible { outline: 2px solid #2459a7; outline-offset: -2px; }
.fixed-matrix-cell strong { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12px; }
.fixed-matrix-cell small { margin-top: 0; font-size: 11px; color: inherit; }
.fixed-matrix-cell .fixed-accrual-label { color: #765319; font-weight: 400; }
.fixed-accrual-note { padding: 8px 12px; border-left: 3px solid #b87915; background: #fff7e7; color: #765319; }
.fixed-contract-evidence .fixed-association-evidence { color: #765319; }
.fixed-matrix-empty { display: block; width: 100%; text-align: center; font-size: 11px; }
.fixed-matrix-ok { color: #087654; }
.fixed-matrix-missing, .fixed-matrix-pending { background: #fff0ee; color: #9d2b25; font-weight: 700; }
.fixed-matrix-different, .fixed-matrix-cancelled, .fixed-matrix-credit_only { background: #fff5df; color: #80560a; }
.fixed-matrix-unavailable, .fixed-matrix-not_expected, .fixed-matrix-future { background: #f0f3f6; color: #647384; }
.fixed-matrix-legend { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0 0 12px; font-size: 12px; }
.fixed-matrix-legend span { border-left: 3px solid currentColor; padding-left: 7px; }
.fixed-legend-ok { color: #087654; }
.fixed-legend-missing { color: #9d2b25; }
.fixed-legend-different { color: #80560a; }
.fixed-legend-unavailable { color: #647384; }
.fixed-contract-action { padding: 0; border: 0; background: transparent; color: #1a5f9c; font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.fixed-contract-action:hover { text-decoration: underline; }
.fixed-account-list > div + div { margin-top: 5px; }
.fixed-contract-detail-heading .fixed-account-list { margin: 8px 0; color: #65758a; font-size: 14px; }
.fixed-contract-action:focus-visible { outline: 2px solid #2459a7; outline-offset: 3px; }
.fixed-contract-source { margin: 14px 0 0; font-size: 13px; }
.fixed-contract-dialog { width: min(1180px,calc(100% - 32px)); max-height: calc(100vh - 40px); padding: 24px; border: 1px solid #cbd6e2; border-radius: 8px; overflow: auto; }
.fixed-contract-dialog::backdrop { background: #14253566; }
.fixed-contract-detail-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.fixed-contract-detail-heading h3 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.fixed-contract-detail-heading p { margin: 8px 0; color: #65758a; }
.fixed-contract-detail-summary { display: flex; gap: 12px 24px; flex-wrap: wrap; padding: 16px 0; border-bottom: 1px solid #d4dee7; }
.fixed-contract-month { border-bottom: 1px solid #d4dee7; padding: 12px 0; }
.fixed-contract-month summary { cursor: pointer; display: list-item; }
.fixed-contract-month summary > * { display: inline-block; margin: 3px 20px 3px 0; }
.fixed-contract-month summary strong { min-width: 160px; }
.fixed-contract-month summary small { color: #65758a; }
.fixed-contract-month .table-wrap { margin-top: 12px; }
.fixed-contract-evidence { width: 100%; min-width: 850px; }
.fixed-contract-evidence td { vertical-align: top; white-space: normal; max-width: 300px; overflow-wrap: anywhere; }
.fixed-contract-evidence .amount { white-space: nowrap; }
@media (max-width: 1100px) {
  .fixed-contract-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .fixed-contract-filters button { justify-self: start; }
  .fixed-contract-search { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .fixed-contract-search label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .fixed-contract-matrix { --fixed-supplier-width: 180px; }
  .fixed-contract-filters { grid-template-columns: minmax(0,1fr); }
  .fixed-contract-search { grid-template-columns: minmax(0,1fr); }
  .fixed-contract-metrics { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .fixed-contract-dialog { padding: 16px; }
  .fixed-contract-detail-heading { flex-wrap: wrap; }
}
.treasury-entity-detail > td { padding: 12px; background: #f4f7fa; }
.treasury-entity-detail[hidden] { display: none; }
.treasury-entity-detail > td { white-space: normal; }
.treasury-term-summary { margin: 0 0 12px; justify-content: space-between; }
.treasury-terms-panel { margin-bottom: 20px; }
.treasury-terms-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 14px; }
.treasury-terms-controls label { display: grid; gap: 5px; min-width: 170px; color: #596a7e; font-size: 12px; font-weight: 700; }
.treasury-terms-controls input, .treasury-terms-controls select { height: 42px; }
.treasury-terms-controls small { padding-bottom: 12px; color: #67768a; }
.treasury-terms-table { max-height: 420px; overflow: auto; }
.treasury-terms-table table { min-width: 800px; }
.treasury-terms-table th { position: sticky; top: 0; background: #eef3f8; z-index: 1; }
.treasury-terms-table th, .treasury-terms-table td { border-right: 1px solid #d7e0e9; }

.treasury-status {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e9eef4;
  color: #43566c;
  font-size: 11px;
  font-weight: 800;
}

.treasury-status-confirmed,
.treasury-status-realized { background: #ddf1e8; color: #087654; }
.treasury-status-scheduled { background: #e2eef9; color: #175d97; }
.treasury-status-cancelled { background: #f2e5e5; color: #8f3030; }
.treasury-row-action { border: 0; background: transparent; color: #1d62a1; font-weight: 700; }

.treasury-calendar {
  display: grid;
  gap: 8px;
}

.treasury-calendar article {
  display: grid;
  grid-template-columns: 72px 1fr;
  min-height: 78px;
  overflow: hidden;
}

.treasury-calendar time {
  display: grid;
  place-content: center;
  text-align: center;
  background: #edf3f8;
  color: #173f68;
}

.treasury-calendar time strong { font-size: 25px; }
.treasury-calendar time span { text-transform: capitalize; font-size: 11px; }
.treasury-calendar article > div { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; }
.treasury-calendar-event { display: grid; gap: 2px; min-width: 220px; padding: 8px 10px; text-align: left; border: 1px solid #d7e0e8; border-left: 4px solid #16815d; border-radius: 5px; background: #fff; }
.treasury-calendar-event.out { border-left-color: #b93636; }
.treasury-calendar-event small { color: #738196; }

.treasury-account-list {
  display: grid;
  gap: 8px;
}

.treasury-account-row {
  display: grid;
  grid-template-columns: minmax(250px, 1.4fr) repeat(3, minmax(150px, .7fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d8e0e8;
  border-radius: 6px;
  background: #fafcfd;
}

.treasury-account-row > div { display: grid; gap: 3px; }
.treasury-account-row > div span,
.treasury-account-row > div em { color: #67768a; font-size: 12px; font-style: normal; }
.treasury-account-row label { display: grid; gap: 4px; color: #596a7e; font-size: 11px; font-weight: 700; }
.treasury-account-row input,
.treasury-account-row select { width: 100%; height: 38px; }

.treasury-scenario-grid,
.treasury-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.treasury-scenario-grid .active { border-color: #2c72ae; box-shadow: inset 0 3px #2c72ae; }
.treasury-category-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.treasury-category-list span { display: grid; padding: 8px; border-bottom: 1px solid #e1e7ed; }
.treasury-category-list small { color: #778699; }
.treasury-limitations { margin: 0; padding-left: 20px; color: #526479; }
.treasury-limitations li { margin-bottom: 8px; }
.treasury-help { line-height: 1.55; }
.treasury-empty { min-height: 100px; display: grid; place-content: center; color: #728196; text-align: center; }

.treasury-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgb(15 29 46 / 58%);
}

.treasury-event-form {
  width: min(900px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(0 0 0 / 25%);
}

.treasury-event-form > header,
.treasury-event-form > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid #d9e1e9;
}

.treasury-event-form > footer { justify-content: flex-end; border-top: 1px solid #d9e1e9; border-bottom: 0; }
.treasury-event-form h3 { margin: 2px 0 0; }
.treasury-event-form header span { color: #1e67a7; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.treasury-event-form header > button { width: 36px; height: 36px; border: 0; background: transparent; font-size: 26px; }

.treasury-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  padding: 20px;
}

.treasury-form-grid label { display: grid; gap: 6px; color: #4c5e73; font-size: 12px; font-weight: 700; }
.treasury-form-grid .full { grid-column: 1 / -1; }
.treasury-form-grid input,
.treasury-form-grid select,
.treasury-form-grid textarea { width: 100%; }

@media (max-width: 1180px) {
  .treasury-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .treasury-overview-grid,
  .treasury-settings-grid { grid-template-columns: 1fr; }
  .treasury-account-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .treasury-account-row > div { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .app-shell,
  .app-shell:not(.sidebar-collapsed) {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .sidebar {
    padding: 14px 8px;
  }

  .sidebar-head {
    flex-direction: column;
    margin-bottom: 16px;
  }

  .brand-text,
  .nav-label,
  .nav-feature-tag {
    display: none;
  }

  .brand,
  .nav button {
    justify-content: center;
  }

  .sidebar-toggle {
    width: 34px;
  }

  .nav button {
    padding: 6px 0;
  }

  .nav button.nav-sub {
    margin-top: 0;
    padding-left: 0;
  }

  .nav button.nav-sub::before {
    display: none;
  }

  .nav-icon {
    display: grid;
  }

  .userbar {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .company-picker {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-right: 0;
  }

  .treasury-toolbar,
  .treasury-coverage-warning { align-items: stretch; flex-direction: column; }
  .treasury-kpis,
  .treasury-scenario-grid,
  .treasury-form-grid,
  .treasury-account-row { grid-template-columns: 1fr; }
  .treasury-form-grid .full { grid-column: auto; }
  .treasury-calendar article { grid-template-columns: 58px 1fr; }
  .treasury-period-control { width: 100%; min-width: 0; }
  .treasury-period-control button { flex: 1 1 0; padding: 0 5px; }
  .treasury-panel > header,
  .treasury-plan-options { align-items: stretch; flex-direction: column; }
  .treasury-source-actions { flex-wrap: wrap; min-width: 0; }
  .treasury-source-actions small { white-space: normal; }
  .treasury-plan-options { width: 100%; }
}

.fixed-map-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid #cbd5df;
}
.fixed-map-tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #4c5967;
  font: inherit;
  font-weight: 600;
  padding: 11px 16px;
  cursor: pointer;
}
.fixed-map-tabs button[aria-selected="true"] { color: #155c9a; border-bottom-color: #2169a7; }
.fixed-map-tabs button:focus-visible { outline: 2px solid #2169a7; outline-offset: -3px; }
.insurance-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
.insurance-page > *, .insurance-toolbar > *, .insurance-filters > * { min-width: 0; }
.insurance-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.insurance-toolbar label, .insurance-filters label, .insurance-edit-fields label, #insurance-edit-form > label { display: grid; gap: 6px; }
.insurance-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.insurance-filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 12px; }
.insurance-page input, .insurance-page select, .insurance-page textarea { min-width: 0; max-width: 100%; }
.insurance-subtabs button { padding: 9px 14px; }
.insurance-basis { margin: 16px 0; font-size: 13px; }
.insurance-page small, .insurance-dialog small { display: block; font-size: 12px; color: #627386; font-weight: 400; margin-top: 4px; }
.insurance-matrix-wrap { max-height: 72vh; overflow: auto; }
.insurance-matrix { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.insurance-matrix th, .insurance-matrix td { min-width: 110px; max-width: 260px; border-right: 1px solid #d8e0e8; vertical-align: top; }
.insurance-matrix th:first-child, .insurance-matrix td:first-child { position: sticky; left: 0; min-width: 245px; width: 245px; background: #fff; z-index: 1; }
.insurance-matrix thead th { position: sticky; top: 0; background: #edf2f6; z-index: 2; }
.insurance-matrix thead th:first-child { z-index: 3; background: #edf2f6; }
.insurance-matrix tfoot th, .insurance-matrix tfoot td { position: sticky; bottom: 0; background: #edf2f6; font-weight: 700; z-index: 2; }
.insurance-matrix tfoot th:first-child { z-index: 3; background: #edf2f6; }
.insurance-month-head { text-transform: capitalize; text-align: right; }
.insurance-matrix td > button:not(.fixed-contract-action) { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; width: 100%; text-align: right; padding: 3px 0; min-height: 35px; }
.insurance-matrix td > button:focus-visible { outline: 2px solid #2169a7; }
.insurance-planned { background: #f1f7fb; }
.insurance-check-ok { background: #edf8f2; color: #076548; }
.insurance-check-different, .insurance-check-unmapped { background: #fff6e1; color: #845000; }
.insurance-check-missing { background: #fff0f0; color: #9e2727; }
.insurance-check-unavailable { background: #f1f3f5; color: #66717e; }
.insurance-receipts-table { min-width: 1200px; }
.insurance-postings-table { min-width: 1080px; table-layout: fixed; }
.insurance-postings-table th, .insurance-postings-table td { overflow-wrap: anywhere; vertical-align: top; }
.insurance-postings-table th:nth-child(2) { width: 23%; }
.insurance-postings-table th:last-child { width: 94px; }
.insurance-ledger-sheet { min-width: 1340px; }
.insurance-ledger-sheet thead th { white-space: normal; overflow-wrap: normal; }
.insurance-sort-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; min-height: 30px; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; text-align: inherit; text-transform: inherit; cursor: pointer; }
.insurance-sort-header > span:first-child { min-width: 0; }
.insurance-sort-header:hover { color: #155c9a; }
.insurance-sort-header:focus-visible { outline: 2px solid #2169a7; outline-offset: 3px; }
.insurance-ledger-sheet th.amount .insurance-sort-header { justify-content: flex-end; }
.insurance-ledger-sheet th[aria-sort="ascending"], .insurance-ledger-sheet th[aria-sort="descending"] { color: #155c9a; }
.insurance-sort-icon { flex: 0 0 12px; width: 12px; height: 12px; background: currentColor; mask: url('/assets/icons/lucide/arrow-up-down.svg') center / contain no-repeat; opacity: .55; }
.insurance-sort-icon[data-direction="ascending"] { mask-image: url('/assets/icons/lucide/arrow-up.svg'); opacity: 1; }
.insurance-sort-icon[data-direction="descending"] { mask-image: url('/assets/icons/lucide/arrow-down.svg'); opacity: 1; }
.insurance-ledger-sheet th:nth-child(1) { width: 11%; }
.insurance-ledger-sheet th:nth-child(2) { width: 12%; }
.insurance-ledger-sheet th:nth-child(3) { width: 16%; }
.insurance-ledger-sheet th:nth-child(4) { width: 10%; }
.insurance-ledger-sheet th:nth-child(5), .insurance-ledger-sheet th:nth-child(6) { width: 9%; }
.insurance-ledger-sheet th:nth-child(7) { width: 12%; }
.insurance-ledger-sheet th:nth-child(8) { width: 12%; }
.insurance-ledger-sheet th:last-child { width: 116px; position: sticky; right: 0; background: #edf2f6; }
.insurance-ledger-actions { position: sticky; right: 0; background: #fff; box-shadow: -1px 0 #d8e0e8; }
.insurance-ledger-actions .button { display: block; margin-bottom: 6px; text-align: center; }
.insurance-ledger-actions .button { white-space: nowrap; }
@media (max-width: 640px) {
  .insurance-ledger-sheet th:last-child, .insurance-ledger-actions { position: static; box-shadow: none; }
}
.insurance-source-verified { color: #076548; }
.fixed-contract-matrix .fixed-reference-value, .fixed-contract-matrix .fixed-reference-total { white-space: normal; }
.accrual-page { display: grid; gap: 18px; min-width: 0; }
.import-operation { border-top: 1px solid #cdd8e2; padding: 16px 0; margin: 12px 0; }
.import-operation-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.import-operation-heading > div { min-width: 0; overflow-wrap: anywhere; }
.import-operation-heading p { margin: 8px 0; }
.import-operation-heading .button { flex: 0 0 150px; }
.import-operation-progress { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.import-operation progress { width: 100%; height: 12px; accent-color: #227c68; }
@media (max-width: 640px) { .import-operation-heading { flex-wrap: wrap; } }
.accrual-page > *, .accrual-filters > * { min-width: 0; }
.accrual-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.accrual-toolbar label, .accrual-filters label { display: grid; gap: 6px; }
.accrual-toolbar select { min-width: 220px; }
.accrual-registration { margin-left: auto; }
.accrual-page small { display: block; margin-top: 5px; color: #627386; font-size: 12px; white-space: normal; }
.accrual-filters { display: grid; grid-template-columns: minmax(0,2fr) minmax(240px,1fr); gap: 16px; }
.accrual-table { min-width: 1250px; }
.accrual-table td { vertical-align: top; }
.accrual-table th:first-child { min-width: 235px; }
.accrual-table td:nth-child(2) { min-width: 145px; }
.accrual-table td:nth-child(8) { min-width: 160px; }
.accrual-table .button { white-space: nowrap; }
.accrual-difference-accrual { color: #076548; font-weight: 700; }
.accrual-difference-reduction, .accrual-difference-rounding { color: #845000; font-weight: 700; }
.accrual-icon { display: inline-block; width: 18px; height: 18px; flex: 0 0 18px; vertical-align: middle; margin-right: 6px; background: currentColor; mask: var(--accrual-icon) center / contain no-repeat; }
.accrual-refresh { --accrual-icon: url('../icons/lucide/rotate-ccw.svg'); }
.accrual-save { --accrual-icon: url('../icons/lucide/check.svg'); }
.accrual-export { --accrual-icon: url('../icons/lucide/arrow-down.svg'); }
.accrual-toolbar [data-accrual-export] { width: 310px; max-width: 100%; white-space: normal; }
.accrual-toolbar [data-accrual-format] { width: 150px; min-width: 0; max-width: 100%; }
.accrual-menu-icon { --accrual-icon: url('../icons/lucide/arrow-up-down.svg'); }
[data-accrual-error] { color: #a12424; }
@media (max-width: 640px) {
  .accrual-filters { grid-template-columns: minmax(0,1fr); }
  .accrual-registration { margin-left: 0; flex-basis: 100%; }
  .accrual-toolbar select { min-width: 0; }
}
.insurance-manual-record { padding: 12px 16px; border-left: 3px solid #178066; background: #eff8f5; overflow-wrap: anywhere; }
.insurance-action-icon { display: inline-block; width: 18px; height: 18px; flex: 0 0 18px; vertical-align: middle; margin-right: 6px; background: currentColor; mask: var(--insurance-action-icon) center / contain no-repeat; }
.insurance-confirm-icon { --insurance-action-icon: url('../icons/lucide/check.svg'); }
.insurance-revoke-icon { --insurance-action-icon: url('../icons/lucide/rotate-ccw.svg'); }
[data-insurance-manual-form] { margin-top: 20px; }
[data-insurance-manual-form] textarea { min-height: 90px; width: 100%; }
[data-insurance-manual-form] label.insurance-checkbox { display: flex; gap: 8px; margin-top: 16px; align-items: start; font-size: 14px; line-height: 1.5; color: #23313d; }
[data-insurance-manual-form] .insurance-checkbox input { flex: 0 0 16px; width: 16px; height: 16px; margin: 3px 0 0; }
[data-insurance-manual-form] input[readonly] { background: #f2f5f7; }
.insurance-source-review, .insurance-source-stale { color: #845000; }
.insurance-source-unread { color: #627386; }
.insurance-job { border-block: 1px solid #d8e0e8; padding: 16px 0; display: grid; grid-template-columns: minmax(0,1fr) minmax(180px,250px); gap: 18px; }
.insurance-job p { margin: 8px 0 0; }
.insurance-job progress { width: 100%; margin: 14px 0; accent-color: #2169a7; }
.insurance-job-error { color: #9e2727; }
.insurance-ledger-sheet tfoot th { text-align: right; }
.insurance-ledger-sheet tfoot tr:last-child { background: #edf2f6; font-weight: 700; }
.insurance-deferrals-table { min-width: 1800px; }
.insurance-deferrals-table th:first-child, .insurance-deferrals-table td:first-child { min-width: 260px; max-width: 320px; }
.insurance-deferrals-table th:nth-child(2), .insurance-deferrals-table td:nth-child(2) { min-width: 110px; }
.insurance-deferrals-table th:nth-child(3), .insurance-deferrals-table td:nth-child(3) { min-width: 125px; }
.insurance-deferrals-table th:nth-child(4), .insurance-deferrals-table td:nth-child(4) { min-width: 65px; }
.insurance-deferrals-table th.insurance-year-total, .insurance-deferrals-table td.insurance-year-total { min-width: 140px; background: #e4edf4; border-inline-start: 2px solid #b7c9d8; font-weight: 700; }
@media (max-width: 640px) {
  .insurance-deferrals-table th:first-child, .insurance-deferrals-table td:first-child { position: static; }
}
.insurance-deferrals-table tfoot { position: sticky; bottom: 0; z-index: 4; }
.insurance-deferrals-table tfoot th, .insurance-deferrals-table tfoot td { position: static; }
.insurance-deferral-years { min-width: 0; width: 100%; table-layout: fixed; }
.insurance-deferral-years th:first-child { width: 30%; }
.insurance-year-totals { display: flex; flex-wrap: wrap; gap: 20px 40px; padding: 12px 0 18px; }
.insurance-year-totals > div { display: grid; gap: 4px; }
.insurance-year-totals span { color: #64748b; }
.insurance-posting-summary { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin: 16px 0; }
.insurance-posting-summary label { display: grid; gap: 6px; min-width: 230px; }
.insurance-posting-state { font-size: 13px; font-weight: 700; }
.insurance-posting-linked { color: #076548; }
.insurance-posting-candidate, .insurance-posting-different { color: #845000; }
.insurance-posting-unmapped { color: #9e2727; }
.insurance-adjustment-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; border-bottom: 1px solid #d8e0e8; }
.insurance-adjustment-values strong { display: block; margin-top: 8px; }
.insurance-evidence-table { min-width: 780px; }
.insurance-dialog { width: min(1320px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 40px); overflow: auto; padding: 24px; border: 1px solid #cbd5df; border-radius: 8px; }
.insurance-dialog::backdrop { background: #17212b66; }
.insurance-dialog-heading, .insurance-dialog-actions { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.insurance-dialog-heading h3 { margin: 0 0 8px; font-size: 19px; }
.insurance-dialog-actions { justify-content: end; margin-top: 20px; flex-wrap: wrap; }
.insurance-dialog .table-wrap { max-width: 100%; }
[data-insurance-prefill-evidence] { overflow-wrap: anywhere; }
.insurance-edit-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.insurance-edit-fields label.insurance-checkbox { display: flex; align-items: center; gap: 8px; }
.insurance-checkbox input { width: auto; }
#insurance-edit-form textarea { min-height: 80px; width: 100%; }
[data-insurance-error] { color: #a12424; }
.insurance-original { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr); gap: 6px 18px; }
.insurance-original dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .insurance-filters, .insurance-edit-fields { grid-template-columns: minmax(0, 1fr); }
  .insurance-adjustment-values { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .insurance-job { grid-template-columns: minmax(0,1fr); }
  .insurance-toolbar label { flex: 1 1 130px; }
  .insurance-toolbar-actions { margin-left: 0; }
  .insurance-toolbar-actions .button { flex: 1 1 auto; }
  .insurance-dialog { padding: 16px; }
  .insurance-dialog-heading h3 { font-size: 17px; overflow-wrap: anywhere; }
  .insurance-matrix th:first-child, .insurance-matrix td:first-child { min-width: 165px; width: 165px; max-width: 165px; }
}

.banking-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
}

.banking-page > *,
.banking-layout > * {
  min-width: 0;
}

.banking-toolbar,
.banking-main,
.banking-config,
.banking-history {
  background: #fff;
  border: 1px solid #d5dee8;
  border-radius: 8px;
}

.banking-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px;
}

.banking-toolbar h3,
.banking-section-heading h3,
.banking-config h3 {
  margin: 2px 0 4px;
  color: #12263f;
  font-size: 18px;
}

.banking-toolbar p,
.banking-section-heading p,
.banking-config > p {
  margin: 0;
  color: #637083;
}

.banking-eyebrow {
  color: #1f5fae;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.banking-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.banking-summary article {
  min-width: 0;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #d5dee8;
  border-radius: 8px;
}

.banking-summary span,
.banking-summary small {
  display: block;
  color: #637083;
}

.banking-summary strong {
  display: block;
  margin: 8px 0 5px;
  color: #087a5b;
  font-size: 24px;
  overflow-wrap: anywhere;
}

.banking-summary .banking-date,
.banking-summary .banking-state {
  color: #12263f;
  font-size: 17px;
}

.banking-summary .banking-state-pending {
  color: #a15c00;
}

.banking-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(290px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.banking-main,
.banking-config,
.banking-history {
  padding: 20px;
}

.banking-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.banking-account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.banking-account {
  padding: 16px;
  border: 1px solid #d8e1eb;
  border-radius: 7px;
  background: #f9fbfd;
}

.banking-account-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.banking-account-head span {
  color: #637083;
  font-size: 12px;
}

.banking-account h4 {
  margin: 3px 0 0;
  color: #12263f;
  font-size: 15px;
}

.banking-account .banking-currency {
  color: #174f8b;
  font-weight: 700;
}

.banking-account-balance {
  display: block;
  margin: 20px 0 16px;
  color: #087a5b;
  font-size: 25px;
}

.banking-account dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  margin: 0;
  font-size: 13px;
}

.banking-account dt {
  color: #637083;
}

.banking-account dd {
  margin: 0;
  color: #24354a;
  font-weight: 600;
}

.banking-config form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.banking-config label {
  display: grid;
  gap: 7px;
  color: #44546a;
  font-weight: 600;
}

.banking-config input {
  width: 100%;
}

.banking-security-note {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding: 12px;
  border-left: 3px solid #1f5fae;
  background: #eef5fc;
  color: #40536a;
  font-size: 12px;
}

.banking-empty {
  display: grid;
  gap: 5px;
  min-height: 120px;
  place-content: center;
  text-align: center;
  color: #637083;
}

.banking-alert {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 16px;
  padding: 13px 16px;
  border: 1px solid #e0b66a;
  border-radius: 6px;
  background: #fff8e9;
  color: #674717;
}

.banking-alert-error {
  border-color: #e2a5a5;
  background: #fff2f2;
  color: #8a2525;
}

.banking-run {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e9eef4;
  color: #40536a;
  font-size: 12px;
  font-weight: 700;
}

.banking-run-completed {
  background: #dff3ea;
  color: #087a5b;
}

.banking-run-failed {
  background: #fde5e5;
  color: #a62929;
}

.banking-history-table td:last-child {
  min-width: 260px;
}

@media (max-width: 980px) {
  .banking-summary,
  .banking-layout,
  .banking-account-grid {
    grid-template-columns: 1fr;
  }

  .banking-toolbar,
  .banking-alert {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  body {
    background: #fff;
    font-size: 9px;
  }

  .login-screen,
  .sidebar,
  .userbar,
  .filters,
  .report-actions,
  .toast {
    display: none !important;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    display: block;
  }

  .workspace {
    display: block;
  }

  .topbar {
    padding: 0 0 8px;
    border-bottom: 2px solid #0f2742;
  }

  h2 {
    font-size: 15px;
  }

  #page-subtitle {
    font-size: 10px;
  }

  .view {
    padding: 10px 0 0;
  }

  .section {
    margin-bottom: 8px;
  }

  .metric-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .metric-card {
    break-inside: avoid;
    padding: 6px 8px;
    box-shadow: none;
  }

  .metric-card span {
    min-height: 0;
    font-size: 8px;
  }

  .metric-card strong {
    font-size: 12px;
  }

  .table-wrap {
    overflow: visible;
    border-radius: 0;
  }

  table,
  .financial-table {
    min-width: 0;
    width: 100%;
  }

  th,
  td {
    padding: 4px 5px;
    font-size: 7.5px;
  }

  th {
    background: #e9eef4 !important;
    color: #17202a;
  }

  .financial-table th:first-child,
  .financial-table td:first-child {
    position: static;
    min-width: 0;
    width: 28%;
  }

  .drill-button,
  .drill-spacer {
    display: none;
  }

  .snc-code,
  .supplier-badge {
    padding: 0;
    border: 0;
    min-width: 0;
    margin-right: 4px;
  }

  .movement-row {
    display: none;
  }
}
.users-page { display: grid; gap: 16px; }
.supplier-settings-page { min-width: 0; }
.supplier-settings-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.supplier-settings-toolbar label { display: grid; gap: 6px; min-width: 160px; }
.supplier-settings-toolbar label:first-child { flex: 1; }
.supplier-settings-toolbar .button { margin-left: auto; }
.supplier-update-form .supplier-form-error { margin-top: 12px; }
.supplier-settings-table { min-width: 880px; width: 100%; }
.supplier-settings-table td { vertical-align: middle; }
.supplier-settings-table td:first-child { min-width: 210px; max-width: 330px; overflow-wrap: anywhere; }
.supplier-settings-table small { display: block; color: var(--muted); margin-top: 4px; }
.supplier-settings-table td:nth-child(3) { min-width: 160px; max-width: 250px; overflow-wrap: anywhere; }
.supplier-settings-table td:nth-child(6) { font-size: 12px; }
.supplier-row-actions { display: flex; gap: 6px; white-space: nowrap; }
.supplier-row-actions .button { padding: 6px 10px; }
.supplier-editor { width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); }
.supplier-editor::backdrop { background: rgb(0 0 0 / 35%); }
.supplier-editor form { display: grid; gap: 20px; }
.supplier-editor h3 { margin: 0; font-size: 20px; }
.supplier-editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.supplier-editor-fields label { display: grid; gap: 6px; min-width: 0; }
.supplier-editor-fields input, .supplier-editor-fields select { width: 100%; min-width: 0; }
.supplier-editor-fields small { min-height: 18px; overflow-wrap: anywhere; }
.supplier-tax-flags { display: flex; flex-wrap: wrap; gap: 24px; }
.supplier-tax-flags label { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.supplier-tax-flags input { width: 18px; height: 18px; }
.supplier-editor footer { display: flex; flex-wrap: wrap; justify-content: end; gap: 10px; }
.supplier-form-error { color: #ad263d; margin: 0; }
.supplier-editor [hidden], .supplier-settings-page [hidden] { display: none; }
.supplier-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.supplier-name-link { padding: 0; border: 0; background: transparent; color: var(--blue-dark); font-weight: 700; text-align: left; line-height: inherit; max-width: 100%; overflow-wrap: anywhere; }
.supplier-name-link:hover { text-decoration: underline; }
.supplier-name-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.supplier-invoices-dialog { width: min(1120px, calc(100vw - 32px)); }
.supplier-invoices-dialog h3 { overflow-wrap: anywhere; }
.supplier-invoices-toolbar { display: flex; align-items: end; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 18px; }
.supplier-invoices-toolbar label { display: grid; gap: 6px; width: min(340px, 100%); }
.supplier-invoices-toolbar select { min-width: 0; width: 100%; }
.supplier-invoices-table { min-width: 820px; width: 100%; }
.supplier-invoices-table td { vertical-align: top; }
.supplier-invoices-table td:nth-child(2), .supplier-invoices-table td:nth-child(4) { max-width: 260px; overflow-wrap: anywhere; }
.supplier-invoices-table small, .supplier-invoices-table a { display: block; margin-top: 4px; }
.supplier-invoices-table small { color: var(--muted); }
.supplier-invoices-table td:nth-child(4) > div + div { margin-top: 6px; }
.supplier-invoices-dialog .table-wrap { max-height: 55dvh; overflow: auto; }
.supplier-invoices-dialog footer { margin-top: 20px; }
.supplier-update-progress { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 0; margin-top: 12px; border-block: 1px solid var(--line); }
.supplier-update-progress p { margin: 6px 0; overflow-wrap: anywhere; }
.supplier-update-progress small { color: var(--muted); }
.supplier-update-controls { display: grid; justify-items: end; flex: 0 0 210px; gap: 12px; }
.supplier-update-controls progress { width: 200px; max-width: 100%; }
@media (max-width:640px) {
  .supplier-update-progress { flex-direction: column; align-items: stretch; }
  .supplier-update-controls { flex-basis: auto; justify-items: start; }
}
@media (max-width: 640px) {
  .supplier-editor { padding: 16px; }
  .supplier-editor-fields { grid-template-columns: minmax(0, 1fr); }
  .supplier-settings-toolbar label { flex: 1 1 180px; min-width: 0; }
  .supplier-settings-toolbar label:first-child { flex: 1 1 100%; }
  .supplier-settings-toolbar .button { margin-left: 0; }
}
.users-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.users-toolbar label { display: grid; gap: 6px; min-width: 180px; }
.users-toolbar label:first-child { flex: 1; max-width: 440px; }
.users-toolbar .button { margin-left: auto; }
.users-table { width: 100%; }
.users-table td { vertical-align: middle; }
.users-table td:first-child { min-width: 200px; }
.users-table td small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.user-status { display: inline-block; padding: 3px 8px; border-radius: 4px; font-weight: 600; }
.user-status.is-active { color: #146b4b; background: #e5f3ed; }
.user-status.is-inactive { color: #6b4650; background: #f5e9ed; }
.user-editor { width: min(1000px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; }
.user-editor::backdrop { background: rgb(0 0 0 / 35%); }
.user-editor form { display: grid; gap: 18px; }
.user-editor h3 { margin: 0; font-size: 20px; }
.user-editor-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.user-editor-fields > label { display: grid; gap: 6px; min-width: 0; }
.user-editor input:not([type="checkbox"]), .user-editor select { width: 100%; min-width: 0; }
.user-editor fieldset { margin: 0; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 4px; }
.user-editor legend { padding: 0 6px; font-weight: 700; }
.user-company-options, .user-menu-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; }
.user-editor .user-check { display: flex; align-items: center; gap: 9px; min-height: 36px; overflow-wrap: anywhere; font-weight: 400; }
.user-check input[type="checkbox"] { flex: 0 0 18px; width: 18px; height: 18px; }
.user-select-all { margin-bottom: 10px; }
.user-editor footer { display: flex; flex-wrap: wrap; justify-content: end; gap: 10px; }
.user-editor-error { margin: 0; color: #ad263d; }
@media (max-width: 760px) {
  .user-editor-fields, .user-company-options, .user-menu-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-editor { padding: 16px; }
}
@media (max-width: 480px) {
  .user-editor-fields, .user-company-options, .user-menu-options { grid-template-columns: minmax(0, 1fr); }
  .users-toolbar .button { margin-left: 0; }
}
.officegest-import-error { margin-top: 16px; padding: 16px; border: 1px solid #e2b9b9; border-left: 4px solid #b42318; border-radius: 4px; background: #fff6f6; overflow-wrap: anywhere; }
.officegest-import-error h4 { margin: 0 0 10px; font-size: 16px; }
.officegest-import-error p { margin: 8px 0; }
.officegest-import-error small { display: block; color: var(--muted); }
.officegest-source-audit { margin: 20px 0; }
.officegest-source-file { overflow-wrap: anywhere; }
.officegest-source-account { padding: 14px 0; border-top: 1px solid var(--line); }
.officegest-source-account summary { cursor: pointer; font-weight: 700; overflow-wrap: anywhere; }
.officegest-source-account p { margin: 10px 0; overflow-wrap: anywhere; }
.officegest-source-account table { min-width: 550px; width: 100%; }
.officegest-source-account th:first-child { width: 46%; white-space: normal; }
.officegest-source-account a { color: var(--blue-dark); text-decoration: underline; }
.entry-verification-page { min-width: 0; }
.entry-pdf-progress { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.entry-pdf-progress-body { flex: 1; min-width: 0; }
.entry-pdf-progress-heading { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.entry-pdf-progress p { margin: 8px 0; }
.entry-pdf-stage { display: flex; align-items: baseline; gap: 8px; }
.entry-activity-indicator { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: var(--primary, #2457a7); animation: entry-activity 1.5s ease-in-out infinite; }
@keyframes entry-activity { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .entry-activity-indicator { animation: none; } }
.entry-pdf-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 18px; margin: 14px 0 10px; }
.entry-pdf-metrics dt { color: var(--muted); font-size: 12px; }
.entry-pdf-metrics dd { margin: 3px 0 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.entry-pdf-progress-controls { display: flex; flex-direction: column; gap: 12px; align-items: stretch; flex: 0 0 190px; }
.entry-pdf-progress progress { width: 100%; height: 8px; }
.entry-pdf-wait { color: #875300; border-left: 3px solid #c18100; padding-left: 10px; }
.entry-pdf-different, .entry-pdf-different small { color: #b42318 !important; font-weight: 700; }
.entry-row-actions { display: grid; grid-template-columns: repeat(3, max-content); grid-template-rows: repeat(2, 30px); gap: 4px 2px; width: max-content; }
.entry-row-actions .button { padding: 4px; min-height: 30px; font-size: 12px; line-height: 20px; white-space: nowrap; }
.entry-accounting-values { display: grid; gap: 3px; margin: 0; font-size: 12px; }
.entry-accounting-values > div { display: grid; grid-template-columns: max-content minmax(90px,1fr); gap: 8px; align-items: baseline; }
.entry-accounting-values dt { color: var(--muted); text-align: left; }
.entry-accounting-values dd { margin: 0; white-space: nowrap; }
.entry-accounting-values > div:last-child { font-weight: 700; }
.entry-verification-table td > .button { margin-top: 5px; display: block; white-space: nowrap; }
@media (max-width: 1000px) { .entry-pdf-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .entry-pdf-progress { align-items: start; flex-wrap: wrap; } .entry-pdf-progress-body, .entry-pdf-progress-controls { flex-basis: 100%; } .entry-pdf-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.entry-verification-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.entry-verification-toolbar label { display: grid; gap: 6px; min-width: 150px; }
.entry-verification-toolbar label:first-child { flex: 1 1 240px; }
.entry-import-preview-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.entry-import-preview-toolbar label { display: grid; gap: 6px; min-width: 190px; }
.entry-import-pages { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.entry-import-pages button { width: 34px; height: 34px; padding: 0; }
.entry-verification-table { width: 100%; min-width: 1050px; }
.entry-verification-table th, .entry-verification-table td { vertical-align: top; }
.entry-verification-table th:nth-child(3) { width: 32%; }
.entry-verification-table td:nth-child(3) { min-width: 240px; white-space: normal; overflow-wrap: anywhere; }
.entry-verification-table th:nth-child(5), .entry-verification-table td:nth-child(5) { width: 120px; max-width: 120px; white-space: normal; overflow-wrap: anywhere; }
.entry-verification-table th:nth-child(5) { white-space: nowrap; }
.entry-verification-table small { display: block; margin-top: 4px; color: var(--muted); }
.entry-verification-table .pill { white-space: nowrap; }
.entry-verification-table td:nth-child(9) .pill { white-space: normal; }
.entry-verification-links { display: flex; gap: 14px; margin: 8px 0; }
.entry-verification-links a { color: var(--blue-dark); }
.entry-verification-table details { max-width: 380px; }
.entry-verification-table details p { white-space: normal; }
.entry-verification-dialog { width: min(820px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 6px; }
.entry-verification-dialog::backdrop { background: #10182770; }
.entry-verification-dialog h3 { margin: 0 0 18px; font-size: 20px; }
.entry-detail-dialog { width: min(980px, calc(100vw - 32px)); }
.entry-accounting-detail { margin: 18px 0; }
.entry-supplier-detail { margin: 20px 0; }
.entry-supplier-detail h4 { margin: 0 0 8px; font-size: 16px; }
.entry-supplier-detail td { white-space: normal; overflow-wrap: anywhere; }
.entry-accounting-detail > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.entry-accounting-detail h4 { margin: 0; font-size: 16px; }
.entry-accounting-detail td:nth-child(2) { white-space: normal; overflow-wrap: anywhere; min-width: 180px; }
.entry-accounting-detail td:nth-child(3) { white-space: normal; overflow-wrap: anywhere; }
.entry-accounting-detail > small { display: block; margin-top: 6px; }
.entry-detail-dialog > p, .entry-detail-dialog dd, .entry-detail-dialog h3 { overflow-wrap: anywhere; }
.entry-detail-dialog .table-wrap { margin: 14px 0; }
.entry-attachment-readings td:first-child { max-width: 280px; white-space: normal; overflow-wrap: anywhere; }
.entry-detail-dialog table { width: 100%; min-width: 540px; }
.entry-detail-metadata { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.entry-detail-metadata dt { color: var(--muted); font-size: 13px; }
.entry-detail-metadata dd { margin: 4px 0 0; }
.entry-verification-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.entry-verification-dialog label { display: grid; gap: 6px; min-width: 0; }
.entry-verification-dialog input, .entry-verification-dialog select, .entry-verification-dialog textarea { width: 100%; min-width: 0; }
.entry-verification-dialog footer { display: flex; justify-content: end; gap: 10px; }
.entry-import-results { max-height: 320px; overflow: auto; margin-bottom: 16px; }
.entry-import-results table { min-width: 650px; }
.entry-import-results td { white-space: normal; overflow-wrap: anywhere; }
#entry-import-error { color: var(--danger, #b42318); }
.entry-verification-page .button:disabled, .entry-verification-dialog .button:disabled { cursor: not-allowed; }
.entry-verification-dialog[aria-busy="true"] .button:disabled { cursor: progress; }
.entry-verification-dialog [hidden] { display: none; }
.entry-import-progress { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.entry-import-progress progress { width: 110px; flex: 0 0 110px; }
.entry-import-progress span { min-width: 0; }
#entry-editor-error { color: #b42318; }
.contract-settings-page { min-width: 0; }
.contract-toolbar,.contract-view-bar,.contract-toolbar-actions,.contract-period-form,.contract-monitor-summary { display:flex; gap:16px; align-items:end; flex-wrap:wrap; }
.contract-toolbar { justify-content:space-between; margin-bottom:20px; }
.contract-period-form label { width:190px; }
.contract-period-form[hidden] { display:none; }
.contract-period-form input { width:100%; min-width:0; }
.contract-toolbar-actions { gap:10px; margin-left:auto; }
.contract-view-bar { align-items:center; justify-content:space-between; border-bottom:1px solid var(--border,#d1dce6); padding-bottom:12px; }
.contract-view-bar label { width:360px; max-width:100%; }
.contract-view-bar [role="tablist"] { display:flex; gap:0; align-self:end; }
.contract-view-bar [role="tab"] { border:0; border-bottom:3px solid transparent; border-radius:0; padding:12px 18px; background:transparent; color:var(--muted); font:inherit; cursor:pointer; }
.contract-view-bar [aria-selected="true"] { border-bottom-color:#285ca7; color:#12385c; font-weight:700; }
.contract-monitor-summary { justify-content:space-between; margin:18px 0; font-size:14px; }
.contract-monitor-summary span,.contract-source-note { color:#64768a; }
.contract-monitor-wrap { max-width:100%; }
.contract-monitor-table { width:max-content; min-width:100%; table-layout:fixed; }
.contract-monitor-table th:first-child { width:280px; min-width:280px; max-width:280px; white-space:normal; overflow-wrap:anywhere; }
.contract-monitor-table th:not(:first-child),.contract-monitor-table td { width:160px; min-width:160px; text-align:center; white-space:normal; }
.contract-monitor-table td { padding:0; }
.contract-monitor-table tbody th { text-transform:none; }
.contract-monitor-table .contract-supplier-detail { display:block; text-align:left; font-weight:700; }
.contract-monitor-table th:first-child>.fixed-contract-action:last-child { margin-top:8px; font-size:12px; }
.contract-monitor-table small,.contract-registry small,.contract-dialog small { display:block; font-size:12px; color:#657b95; font-weight:400; margin-top:4px; }
.contract-check button { background:transparent; border:0; color:inherit; width:100%; min-height:120px; padding:12px 8px; font:inherit; cursor:pointer; }
.contract-check button strong,.contract-check button span { display:block; }
.contract-check button span { margin-top:6px; font-size:12px; font-weight:700; }
.contract-check-ok { background:#f2faf6; color:#007d58; }
.contract-check-different,.contract-check-missing,.contract-check-ambiguous { background:#fff0ef; color:#ad3028; }
.contract-check-pending,.contract-check-partial_term { background:#fff8e7; color:#85600e; }
.contract-check-unavailable,.contract-check-outside_term,.contract-check-future { background:#f2f5f7; color:#6b7887; }
.contract-check .contract-difference { color:inherit; font-weight:700; }
.contract-registry { width:100%; min-width:890px; }
.contract-registry td { white-space:normal; overflow-wrap:anywhere; }
.contract-registry td:first-child { width:34%; }
.contract-inactive { opacity:.65; }
.contract-dialog { width:min(1120px,calc(100vw - 32px)); max-width:calc(100vw - 32px); max-height:90vh; border:1px solid #c9d6e1; border-radius:8px; padding:24px; color:inherit; overflow:auto; }
.contract-dialog::backdrop { background:rgba(18,31,43,.4); }
.contract-dialog-header { display:flex; gap:16px; justify-content:space-between; align-items:start; margin-bottom:20px; }
.contract-dialog-header h3 { font-size:20px; margin:4px 0; overflow-wrap:anywhere; }
.contract-dialog-header button { flex-shrink:0; }
.contract-fields { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.contract-field-wide { grid-column:span 2; }
.contract-dialog label { min-width:0; }
.contract-dialog fieldset { border:0; min-width:0; margin:0; padding:0; }
.contract-dialog h4 { font-size:16px; margin:20px 0 12px; }
.contract-dialog input,.contract-dialog textarea { max-width:100%; min-width:0; }
.contract-dialog textarea { width:100%; }
.contract-file { display:block; margin-top:18px; }
.contract-import-options { margin-top:16px; }
.contract-import-options [hidden] { display:none; }
.contract-source-observation { color:#846013!important; }
.contract-checkbox { display:flex; gap:10px; align-items:center; margin:16px 0; color:#29445a; }
.contract-checkbox input { width:18px; height:18px; flex-shrink:0; }
.contract-form-actions { display:flex; gap:12px; justify-content:end; flex-wrap:wrap; margin-top:16px; }
.contract-items-table { min-width:740px; width:100%; table-layout:fixed; }
.contract-items-table th:first-child { width:19%; }
.contract-items-table th:nth-child(2) { width:38%; }
.contract-items-table th:nth-child(3) { width:20%; }
.contract-items-table th:nth-child(4) { width:18%; }
.contract-items-table th:last-child { width:50px; }
.contract-items-table td { padding:5px; }
.contract-items-table input { width:100%; padding:8px; }
.contract-remove-item { padding:4px; width:32px; height:32px; font-size:21px; }
.contract-item-total { text-align:right; margin:14px 0; }
.contract-original-details { border-top:1px solid #d1dce6; margin-top:22px; padding-top:14px; }
.contract-original-details summary { cursor:pointer; font-weight:700; }
.contract-agreement { border-top:1px solid #d1dce6; padding:16px 0; }
.contract-agreement>summary { display:grid; grid-template-columns:minmax(0,2fr) repeat(3,minmax(0,1fr)); gap:16px; cursor:pointer; font-size:13px; color:#61758a; }
.contract-agreement>summary strong { display:block; margin-top:4px; font-size:15px; color:#18374e; overflow-wrap:anywhere; }
.contract-agreement>summary>span:first-child>strong::before { content:'+'; display:inline-block; width:16px; }
.contract-agreement[open]>summary>span:first-child>strong::before { content:'-'; }
.contract-agreement-toolbar { display:flex; gap:16px; justify-content:space-between; align-items:center; flex-wrap:wrap; margin:16px 0 8px; }
.contract-agreement-notes { white-space:pre-wrap; }
.contract-agreement p { overflow-wrap:anywhere; }
.contract-equipment-detail { min-width:900px!important; table-layout:fixed; }
.contract-equipment-detail th,.contract-equipment-detail td { white-space:normal; }
.contract-equipment-detail th:first-child { width:29%; }
.contract-equipment-detail th:nth-child(2) { width:19%; }
.contract-equipment-detail th:nth-child(3) { width:14%; }
.contract-equipment-detail th:nth-child(4) { width:12%; }
.contract-equipment-detail th:nth-child(5),.contract-equipment-detail th:nth-child(6) { width:13%; }
.contract-dialog [data-contract-back] { margin-bottom:14px; }
.contract-dialog table { width:100%; min-width:600px; margin:12px 0; }
.contract-dialog td { white-space:normal; overflow-wrap:anywhere; }
.contract-dialog td.amount { white-space:nowrap; }
.contract-detail-summary { display:flex; gap:32px; flex-wrap:wrap; margin:18px 0; }
.contract-detail-summary strong { display:block; margin-top:4px; font-size:22px; }
.contract-state-label { padding:10px; font-weight:700; }
.contract-cost-different { color:#ad3028; background:#fff2ef; }
.contract-evidence td:nth-child(2) { min-width:200px; }
.contract-dialog [role="alert"],.fixed-explicit-check.is-attention,.is-attention { color:#b32924; }
.fixed-explicit-check { border-top:1px solid #d1dce6; padding-top:4px; margin-top:5px; color:#007d58; }
@media(max-width:700px) {
  .contract-toolbar,.contract-period-form { align-items:stretch; }
  .contract-period-form { width:100%; }
  .contract-period-form label { width:calc(50% - 8px); }
  .contract-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .contract-dialog { padding:16px; }
  .contract-view-bar label { width:100%; }
  .contract-view-bar [role="tab"] { padding:10px; }
  .contract-monitor-table th:first-child { width:210px; min-width:210px; max-width:210px; }
  .contract-toolbar-actions .button { flex:1; }
  .contract-agreement>summary { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .contract-agreement>summary .amount { text-align:left; }
  .contract-view-bar [role="tablist"] { width:100%; }
  .contract-view-bar [role="tab"] { min-width:0; }
}
@media (max-width: 600px) { .entry-verification-fields { grid-template-columns: minmax(0, 1fr); } }
.income-outlook-summary, .income-outlook-forecast { margin: 0 0 24px; min-width: 0; }
.financial-report-page { min-width: 0; }
.financial-report-page .positive { color: #087654; }
.financial-report-page .negative { color: #b32626; }
.ff-tabs { margin-top: 16px; }
.ff-table { min-width: 1100px; }
.ff-table td { vertical-align: top; }
.ff-table td.amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ff-table small { display: block; white-space: normal; margin-top: 5px; color: var(--muted); }
.ff-heading { margin-top: 26px !important; }
.ff-editor { min-width: 1050px; table-layout: fixed; }
.ff-editor td { vertical-align: top; min-width: 170px; }
.ff-editor td:last-child { width: 56px; }
.ff-editor label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 12px; }
.ff-editor label.fr-toggle { flex-direction: row; align-items: center; }
.ff-editor input, .ff-editor select { min-width: 0; width: 100%; }
.ff-editor input[type="checkbox"] { width: 18px; }
.ff-remove { width: 36px; height: 36px; padding: 4px; font-size: 21px; }
.ff-excluded { color: var(--muted); background: #f2f4f6; }
.financial-report-page .table-wrap:has(.ff-table), #fr-detail-dialog .table-wrap { max-height: 66vh; overflow: auto; overscroll-behavior: contain; }
.ff-table thead th { position: sticky; top: 0; z-index: 1; background: #edf2f6; }
#fr-detail-dialog { max-width: calc(100vw - 32px); }
.fr-diagnostic-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; }
.fr-diagnostic-heading p { margin: 0; font-weight: 600; font-size: 14px; }
.fr-diagnostic-filters { display: flex; flex-wrap: wrap; gap: 14px; margin: 18px 0; align-items: end; }
.fr-diagnostic-filters > label { flex: 1 1 170px; min-width: 0; }
.fr-diagnostic-filters > label:has(input[type="search"]) { flex-basis: 300px; }
.fr-diagnostic-table { min-width: 1050px; }
.fr-diagnostic-table td:first-child { min-width: 230px; max-width: 330px; }
.fr-diagnostic-table td { vertical-align: top; }
.fr-diagnostic-table td.amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fr-diagnostic-table .fr-value { min-height: 28px; padding: 4px 0; }
.financial-report-page .table-wrap:has(.fr-diagnostic-table) { max-height: 66vh; overflow: auto; overscroll-behavior: contain; }
.fr-diagnostic-table thead th { position: sticky; top: 0; z-index: 2; background: #edf2f6; }
.fr-diagnostic-table small, #fr-detail-dialog table small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; white-space: normal; }
#fr-detail-dialog [data-fr-diagnostic-settings-form] select { min-width: 230px; }
#fr-detail-dialog textarea { width: 100%; max-width: 100%; font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 5px; }
.fr-context { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.fr-context h2 { margin: 0 0 6px; font-size: 20px; }
.fr-context p, .fr-metric p { margin: 5px 0; font-size: 13px; }
.fr-state { font-size: 11px; font-weight: 700; color: #176449; background: #e6f3ed; padding: 4px 7px; white-space: nowrap; }
.fr-state.fr-estimated { color: #875900; background: #fff4d6; }
.fr-filters { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; padding-bottom: 20px; }
.fr-filters > label { min-width: 150px; flex: 1 1 150px; }
.fr-filters > label:has([name="center"]) { flex-basis: 230px; }
.fr-filters .fr-toggle { display: flex; flex-direction: row; align-items: center; gap: 8px; min-height: 42px; font-size: 13px; }
.fr-toggle input { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--blue); }
.fr-export-actions { display: flex; gap: 8px; margin-left: auto; }
.fr-export-actions .button { display: inline-flex; align-items: center; gap: 7px; }
.fr-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.fr-metric { border: 1px solid var(--line); border-radius: 6px; padding: 16px; background: white; min-width: 0; }
.fr-metric header { display: flex; gap: 8px; justify-content: space-between; align-items: start; flex-wrap: wrap; }
.fr-metric h3 { margin: 0; font-size: 14px; font-weight: 600; }
.fr-primary-value { margin: 12px 0 8px; font-size: 23px; font-weight: 700; }
.fr-value { border: 0; background: none; color: var(--blue); padding: 0; font: inherit; cursor: pointer; text-align: inherit; }
.fr-value:hover, .fr-value:focus-visible { text-decoration: underline; }
.fr-metric-row { display: flex; justify-content: space-between; align-items: end; gap: 10px; padding-top: 12px; margin-top: 10px; border-top: 1px solid var(--line); font-size: 12px; }
.fr-projection { text-align: right; color: #875900; font-size: 10px; }
.fr-projection strong { display: block; font-size: 14px; padding-top: 4px; }
.fr-summary-band { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.fr-summary-band span { font-size: 13px; }
.fr-section { margin: 24px 0; min-width: 0; }
.fr-section h3 { font-size: 16px; margin: 0 0 12px; }
.fr-section p { margin: 0 0 12px; }
.fr-section summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.fr-section table { min-width: 680px; }
.fr-section .fr-results-table { min-width: 1320px; }
.fr-section td.amount, .fr-detail-table td.amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fr-section td:first-child { min-width: 230px; }
.fr-definitions { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 12px; font-size: 13px; }
.fr-definitions dt { font-weight: 600; }
.fr-definitions dd { margin: 0; }
.fr-footnote { color: var(--muted); border-top: 1px solid var(--line); margin-top: 22px; padding-top: 12px; font-size: 12px; }
.fr-detail-account { max-width: 360px; margin-bottom: 15px; }
.fr-detail-table { min-width: 1080px; }
.fr-detail-table small { display: block; max-width: 390px; white-space: normal; color: var(--muted); margin-top: 5px; }
.fr-detail-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; font-size: 13px; }
.fr-detail-footer > div { display: flex; gap: 10px; align-items: center; }
@media(max-width:1050px) { .fr-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) {
  .fr-metrics { grid-template-columns: minmax(0,1fr); }
  .fr-context { align-items: start; flex-direction: column; }
  .fr-context h2 { font-size: 18px; }
  .fr-filters > label { flex-basis: 100%; }
  .fr-export-actions { margin: 0; }
  .fr-definitions { grid-template-columns: minmax(0,1fr); gap: 6px; }
  .fr-definitions dd { margin-bottom: 12px; }
  .fr-detail-footer > div { flex-wrap: wrap; }
}
.income-sales-trend { margin: 18px 0 24px; }
.income-sales-trend h4 { margin: 0 0 10px; font-size: 15px; }
.income-sales-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.income-sales-legend span { display: inline-flex; align-items: center; gap: 8px; }
.income-sales-legend span::before { content: ''; width: 24px; border-top: 2px solid; }
.sales-previous { color: #677580; stroke: #677580; fill: #677580; }
.sales-actual { color: #2457a6; stroke: #2457a6; fill: #2457a6; }
.sales-projected { color: #15775b; stroke: #15775b; fill: #15775b; }
.income-sales-legend .sales-projected::before { border-top-style: dashed; }
.income-sales-chart { display: grid; grid-template-columns: 100px minmax(0, 1fr); grid-template-rows: 240px 28px; min-width: 640px; padding: 8px 4px 4px 0; }
.income-sales-axis { position: relative; font-size: 12px; }
.income-sales-axis span { position: absolute; right: 12px; transform: translateY(-50%); white-space: nowrap; }
.income-sales-plot { display: block; width: 100%; height: 240px; }
.income-sales-plot path { stroke-width: 2; }
.income-sales-plot .sales-projected path { stroke-dasharray: 6 5; }
.income-sales-grid { stroke: var(--line); stroke-width: 1; }
.income-sales-months { grid-column: 2; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: center; text-align: center; font-size: 12px; }
.filters .toggle-field { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 12px; }
.filters .toggle-field input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 18px; padding: 0; margin: 0; accent-color: var(--blue); }
.filters .toggle-field span { min-width: 0; line-height: 1.4; }
.income-outlook-summary caption { text-align: left; font-weight: 700; padding: 0 0 12px; }
.income-outlook-totals { min-width: 780px; }
.income-outlook-totals th, .income-outlook-totals td { padding: 10px 12px; }
.income-outlook-totals tbody th { text-align: left; }
.income-outlook-forecast h3 { margin: 0 0 8px; font-size: 18px; }
.income-outlook-forecast p { margin: 0 0 14px; }
.income-estimate-table { width: max-content; min-width: 100%; table-layout: fixed; }
.income-estimate-table th:first-child { min-width: 290px; max-width: 340px; text-align: left; white-space: normal; }
.income-estimate-table th:not(:first-child), .income-estimate-table td { min-width: 132px; }
.income-estimate-table th small { display: block; margin-top: 4px; font-size: 11px; font-weight: 400; }
.income-estimated { background: #fff5d8 !important; }
.income-estimate-table tfoot { font-weight: 700; }
.income-outlook-totals .amount, .income-estimate-table .amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
