:root {
  --forest: #173c37;
  --deep: #102c28;
  --green: #256457;
  --mint: #d8ebe3;
  --paper: #f5f5f0;
  --white: #fff;
  --ink: #1f302c;
  --muted: #626f69;
  --line: #dce2da;
  --amber: #8a570b;
  --amber-bg: #fbefd8;
  --red: #a73530;
  --red-bg: #f9e7e3;
  --radius: 12px;
  --space: 24px;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
button,
input,
select,
textarea {
  accent-color: var(--green);
  caret-color: var(--green);
}
::selection {
  background: var(--mint);
  color: var(--deep);
}
:focus-visible {
  outline: 3px solid #bd7f27;
  outline-offset: 3px;
}
a {
  color: var(--green);
  text-underline-offset: 3px;
}
button {
  border: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.2;
}
h2 {
  font-size: 18px;
  letter-spacing: -0.02em;
  font-weight: 650;
}
h3 {
  font-size: 15px;
  font-weight: 650;
}
p {
  line-height: 1.6;
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 12px;
}
svg {
  flex: none;
}
button svg {
  width: 18px;
  height: 18px;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.skip {
  position: fixed;
  top: -80px;
  z-index: 20;
  background: white;
  padding: 12px;
}
.skip:focus {
  top: 8px;
}
.boot {
  padding: 60px;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}
.sidebar {
  background: var(--forest);
  color: #e6efe9;
  padding: 34px 18px 24px;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  width: 230px;
  z-index: 3;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 38px;
  color: #fff;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.04em;
}
.brand svg {
  width: 31px;
  height: 36px;
  color: #d7e6b3;
}
.brand-dot {
  color: #d7e6b3;
}
.sidebar nav {
  display: grid;
  gap: 5px;
}
.nav-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #b1c9be;
  padding: 24px 16px 11px;
}
.nav-button {
  width: 100%;
  justify-content: flex-start;
  padding: 12px 15px;
  border-radius: 7px;
  background: transparent;
  color: #d5e3db;
  font-weight: 500;
}
.nav-button svg {
  width: 18px;
  height: 18px;
  color: #aac8b7;
}
.nav-button:hover {
  background: #214c43;
  color: #fff;
}
.nav-button.active {
  background: #dce9c8;
  color: var(--deep);
  font-weight: 650;
}
.nav-button.active svg {
  color: var(--deep);
}
.sidebar-bottom {
  margin-top: auto;
  padding: 32px 14px 0;
}
.local-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #b9d995;
  border-radius: 50%;
  margin-right: 7px;
}
.sidebar-bottom p {
  font-size: 12px;
  color: #c0d4c7;
}
.sidebar-bottom small {
  color: #a6c2b4;
  display: block;
  margin-top: 6px;
}
.workspace {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  min-height: 78px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 17px 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.company-picker {
  max-width: 350px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.company-mark {
  background: #eff3e9;
  padding: 10px;
  display: flex;
  border-radius: 8px;
  color: var(--green);
}
select,
input,
textarea {
  background: #fff;
  color: var(--ink);
  border: 1px solid #cbd5cc;
  border-radius: 6px;
  padding: 10px 12px;
  min-width: 0;
  max-width: 100%;
}
select {
  cursor: pointer;
}
.company-picker select {
  border: 0;
  font-weight: 600;
  max-width: 290px;
  padding-left: 0;
}
.top-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: #ebeede;
  border-radius: 50%;
  font-weight: 650;
  color: var(--forest);
}
.mobile-menu {
  display: none;
  background: transparent;
}
.content {
  padding: 34px 38px 28px;
  max-width: 1700px;
  margin: auto;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
.page-head p {
  color: var(--muted);
  margin-top: 8px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  padding: 11px 16px;
  border-radius: 7px;
  background: var(--forest);
  color: white;
  font-weight: 600;
  white-space: nowrap;
  min-height: 40px;
}
.btn:hover {
  background: #285c50;
}
.btn.secondary {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.secondary:hover {
  background: #f0f4ee;
}
.btn.danger {
  background: var(--red);
}
.btn.small {
  padding: 7px 10px;
  min-height: 32px;
  font-size: 12px;
}
.text-button {
  color: var(--green);
  background: transparent;
  padding: 7px 0;
  font-weight: 600;
  font-size: 13px;
}
.text-button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.month-input {
  font-size: 13px;
  padding: 10px;
  min-height: 40px;
}
.demo-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #e9eddf;
  color: #4c5f42;
  padding: 11px 15px;
  border-radius: 6px;
  margin-bottom: 24px;
  font-size: 12px;
  line-height: 1.5;
}
.demo-banner svg {
  width: 16px;
  height: 16px;
}
.metrics {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 25px 0;
  margin-bottom: 30px;
  gap: 0;
}
.metric {
  padding: 0 23px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.metric:first-child {
  padding-left: 0;
}
.metric:last-child {
  border: 0;
  padding-right: 0;
}
.metric-label {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}
.metric-value {
  font-size: clamp(22px, 2.05vw, 34px);
  letter-spacing: -0.035em;
  white-space: nowrap;
  font-weight: 600;
  margin: 11px 0 8px;
  font-variant-numeric: tabular-nums;
}
.metric:first-child .metric-value {
  color: var(--green);
}
.metric-note {
  font-size: 11px;
  color: var(--muted);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 1fr);
  gap: 24px;
  align-items: start;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-head {
  padding: 23px 24px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-head p {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}
.panel-body {
  padding: 0 24px 24px;
}
.chart {
  width: 100%;
  height: auto;
  min-height: 180px;
  display: block;
}
.chart text {
  font-family: inherit;
  fill: var(--muted);
  font-size: 11px;
}
.chart .grid {
  stroke: #e7ece5;
  stroke-dasharray: 3 5;
}
.chart .area {
  fill: #e6efe5;
}
.chart .line {
  stroke: var(--green);
  stroke-width: 2.5;
  fill: none;
}
.chart .point {
  fill: white;
  stroke: var(--green);
  stroke-width: 2;
}
.chart-foot {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.chart-foot strong {
  color: var(--ink);
  font-weight: 600;
}
.legend {
  display: flex;
  align-items: center;
  gap: 7px;
}
.legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.farol-panel {
  background: #e9efe2;
  border: 1px solid #d6dfc9;
  border-radius: var(--radius);
  padding: 23px;
}
.farol-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}
.farol-heading svg {
  color: var(--green);
}
.farol-panel > p {
  font-size: 13px;
  color: #52634c;
}
.signal-list {
  margin-top: 19px;
}
.signal {
  padding: 17px 0;
  border-top: 1px solid #cdd9c4;
}
.signal h3 {
  font-size: 13px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.signal h3 svg {
  color: var(--amber);
  width: 15px;
  height: 15px;
}
.signal p {
  font-size: 12px;
  color: #52634c;
}
.signal .amount {
  font-size: 20px;
  display: block;
  margin: 8px 0 3px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.signal small {
  font-size: 10px;
  line-height: 1.5;
  display: block;
  color: #52634c;
}
.signal .text-button {
  font-size: 12px;
}
.farol-foot {
  border-top: 1px solid #cdd9c4;
  padding-top: 13px;
  font-size: 11px;
  color: #52634c;
}
.wide-panel {
  margin-top: 24px;
}
.table-wrap {
  overflow-x: auto;
  position: relative;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  text-align: left;
}
th {
  background: #f8f9f5;
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 15px 20px;
  border-bottom: 1px solid #edf0e9;
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
td small {
  display: block;
  margin-top: 4px;
}
tbody tr:hover {
  background: #fafbf8;
}
.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.income {
  color: #24614e;
}
.expense {
  color: #9e4534;
}
.tag {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
}
.tag.green {
  background: #e7f0e4;
  color: #38603c;
}
.tag.amber {
  background: var(--amber-bg);
  color: var(--amber);
}
.tag.red {
  background: var(--red-bg);
  color: var(--red);
}
.tag.neutral {
  background: #eef0eb;
  color: #59665d;
}
.table-action {
  background: transparent;
  color: var(--green);
  font-weight: 600;
  font-size: 12px;
  padding: 7px;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  flex-wrap: wrap;
}
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.tab {
  background: transparent;
  color: var(--muted);
  padding: 8px 13px;
  border-radius: 6px;
  font-size: 12px;
}
.tab.active {
  background: var(--forest);
  color: #fff;
}
.search {
  min-width: 240px;
  font-size: 13px;
}
.empty {
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
}
.empty h3 {
  color: var(--ink);
  font-size: 17px;
  margin-bottom: 8px;
}
.empty p {
  max-width: 480px;
  margin: 0 auto 16px;
}
.section-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin: 18px 0;
}
.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr);
  gap: 24px;
}
.report-line {
  padding: 17px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.report-line strong {
  font-variant-numeric: tabular-nums;
}
.report-line.total {
  background: #e8eee0;
  font-size: 18px;
}
.report-line.sub {
  padding-left: 38px;
  font-size: 12px;
  color: var(--muted);
}
.report-line:last-child {
  border-bottom: 0;
}
.note-panel {
  background: #e9eddf;
  border-radius: var(--radius);
  padding: 24px;
  align-self: start;
}
.note-panel h2 {
  margin-bottom: 14px;
}
.note-panel p {
  font-size: 13px;
  margin-bottom: 12px;
}
.note-panel p:last-child {
  margin-bottom: 0;
}
.section-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.master-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px;
}
.account-item {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}
.account-item strong {
  font-size: 24px;
  display: block;
  margin-top: 13px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.account-item p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.footer {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
dialog {
  padding: 0;
  border: 0;
  border-radius: 14px;
  width: min(620px, calc(100% - 28px));
  max-height: 90vh;
  color: var(--ink);
  background: white;
  box-shadow: 0 20px 80px #112d2833;
}
dialog::backdrop {
  background: #112d2866;
}
dialog header {
  padding: 23px 26px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
dialog h2 {
  font-size: 20px;
}
.close {
  padding: 6px;
  background: transparent;
  color: var(--muted);
}
.form-body {
  padding: 24px 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 19px;
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}
.field.full,
.form-note,
.form-error {
  grid-column: 1/-1;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font-size: 14px;
  font-weight: 400;
  min-height: 42px;
}
.field textarea {
  min-height: 160px;
  resize: vertical;
  font-family: Consolas, monospace;
  font-size: 12px;
}
.field small {
  font-weight: 400;
}
.form-note {
  background: #f2f5ed;
  border-radius: 6px;
  padding: 13px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.form-error {
  color: var(--red);
  background: var(--red-bg);
  padding: 12px;
  border-radius: 6px;
  display: none;
}
.form-error:not(:empty) {
  display: block;
}
.dialog-actions {
  padding: 17px 26px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--forest);
  color: #fff;
  border-radius: 8px;
  padding: 14px 22px;
  box-shadow: 0 8px 28px #102c2826;
  z-index: 12;
  max-width: calc(100% - 32px);
  font-size: 13px;
}
#toast:empty {
  display: none;
}
.detail-list {
  grid-column: 1/-1;
  display: grid;
  gap: 12px;
}
.detail-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.detail-line span {
  color: var(--muted);
}
.audit-detail {
  max-width: 360px;
  overflow-wrap: anywhere;
  font-size: 12px;
  color: var(--muted);
}
.loading {
  opacity: 0.65;
  pointer-events: none;
}
.error-screen {
  padding: 60px;
  max-width: 700px;
}
.error-screen p {
  margin: 20px 0;
}
.screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
* {
  scrollbar-width: thin;
  scrollbar-color: #a4b5a7 #f0f3eb;
}
@media (min-width: 1500px) {
  .content {
    padding-top: 44px;
  }
  .metric-value {
    font-size: 34px;
  }
  .chart {
    min-height: 230px;
  }
}
@media (max-width: 1200px) {
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .sidebar {
    width: 200px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .content {
    padding: 28px 24px;
  }
  .topbar {
    padding: 16px 24px;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr);
    gap: 18px;
  }
  .metric {
    padding: 0 15px;
  }
  .metric-value {
    font-size: 24px;
  }
  .top-meta > span:first-child {
    display: none;
  }
  .page-head {
    align-items: flex-start;
  }
  .page-head .actions {
    justify-content: flex-end;
  }
  .panel-head {
    padding: 20px;
  }
  .panel-body {
    padding: 0 20px 20px;
  }
}
@media (max-width: 960px) {
  .dashboard-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
    row-gap: 24px;
  }
  .metric:nth-child(2) {
    border: 0;
  }
  .metric:nth-child(3) {
    padding-left: 0;
  }
  .metric-value {
    font-size: 29px;
  }
  .signal-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .page-head {
    flex-wrap: wrap;
  }
  .company-picker select {
    max-width: 230px;
  }
  .topbar {
    gap: 8px;
  }
  .top-meta {
    gap: 8px;
  }
}
@media (max-width: 680px) {
  .shell {
    display: block;
  }
  .sidebar {
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform 0.2s ease-out;
    width: 230px;
    box-shadow: 10px 0 40px #102c2826;
  }
  .sidebar.open {
    visibility: visible;
    transform: translateX(0);
  }
  .mobile-menu {
    display: flex;
    padding: 5px;
  }
  .topbar {
    padding: 13px 16px;
    min-height: 66px;
  }
  .company-mark {
    display: none;
  }
  .company-picker {
    min-width: 0;
    gap: 4px;
  }
  .company-picker select {
    max-width: 215px;
    font-size: 12px;
  }
  .top-meta {
    display: none;
  }
  .content {
    padding: 24px 16px;
  }
  .page-head {
    gap: 16px;
    margin-bottom: 20px;
  }
  h1 {
    font-size: 26px;
  }
  .page-head p {
    font-size: 12px;
  }
  .page-head .actions {
    justify-content: flex-start;
    width: 100%;
  }
  .metrics {
    padding: 20px 0;
    margin-bottom: 24px;
  }
  .metric {
    padding: 0 12px;
  }
  .metric-value {
    font-size: 25px;
  }
  .metric-label {
    font-size: 12px;
  }
  .metric-note {
    font-size: 10px;
  }
  .signal-list {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .panel-head {
    padding: 18px 16px;
  }
  .panel-body {
    padding: 0 12px 18px;
  }
  .panel-head h2 {
    font-size: 16px;
  }
  .chart {
    min-height: 150px;
  }
  .chart-foot {
    flex-direction: column;
    margin: 0 4px;
  }
  .farol-panel {
    padding: 20px;
  }
  .demo-banner {
    font-size: 11px;
    padding: 10px;
  }
  .toolbar {
    padding: 14px;
  }
  .search {
    width: 100%;
    min-width: 0;
  }
  .tab {
    padding: 8px 10px;
  }
  td,
  th {
    padding: 13px 15px;
  }
  .footer {
    flex-direction: column;
    gap: 7px;
  }
  .form-body {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .field {
    grid-column: 1/-1;
  }
  dialog header {
    padding: 20px;
  }
  .dialog-actions {
    padding: 16px 20px;
  }
  .btn {
    padding: 10px 13px;
  }
  .section-tabs {
    overflow-x: auto;
  }
  .detail-line {
    font-size: 12px;
  }
  .metric-value {
    overflow-wrap: normal;
  }
  .report-line {
    padding: 15px 18px;
  }
  .report-line.total {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

[hidden] {
  display: none !important;
}
.user-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.user-actions .text-button {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--white);
}
.auth-story {
  background: var(--forest);
  color: #edf3e5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 52px 64px;
  gap: 50px;
}
.auth-story .brand {
  padding: 0;
}
.auth-story h2 {
  font-size: clamp(32px, 3.5vw, 54px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.035em;
  max-width: 540px;
}
.auth-story p {
  color: #c2d5c8;
  max-width: 380px;
  margin-top: 26px;
  font-size: 16px;
  line-height: 1.7;
}
.auth-story small {
  color: #b5cdbf;
}
.auth-trust {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d8e6c7;
  font-size: 13px;
  margin-top: 40px;
}
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 48px;
}
.auth-form-wrap {
  max-width: 420px;
  width: 100%;
}
.auth-form-wrap h1 {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}
.auth-subtitle {
  color: var(--muted);
  margin: 16px 0 30px;
}
.auth-form-wrap form {
  display: grid;
  gap: 20px;
}
.auth-submit {
  width: 100%;
  margin-top: 5px;
  padding: 13px;
}
.auth-help {
  color: var(--muted);
  font-size: 12px;
  margin-top: 28px;
  line-height: 1.7;
}
.auth-hint {
  font-size: 12px;
  color: var(--muted);
}
.password-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.access-empty {
  max-width: 620px;
  margin: 70px auto;
  padding: 32px;
}
.access-empty .brand {
  color: var(--forest);
  padding: 0 0 32px;
}
.access-empty p {
  margin: 20px 0 28px;
}
.sidebar {
  overflow-y: auto;
}
.assistant-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1/-1;
}
.evidence {
  border-bottom: 1px solid var(--border, #dce3dc);
  padding: 18px 0;
  grid-column: 1/-1;
  overflow-wrap: anywhere;
}
.evidence h3 {
  margin: 10px 0;
}
.evidence p {
  line-height: 1.6;
  margin: 8px 0;
}
.evidence small {
  display: block;
  line-height: 1.6;
}
.evidence .actions {
  margin-top: 12px;
  flex-wrap: wrap;
}
.quality-warning {
  padding: 14px;
  background: #f4ecd7;
  color: #534521;
  line-height: 1.6;
}
.preview-scroll {
  max-height: 280px;
  overflow: auto;
  border: 1px solid #dce3dc;
  padding: 12px;
}
.field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}
dialog.report-dialog {
  width: min(1000px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
}
dialog.report-dialog .form-body {
  display: block;
  min-width: 0;
}
dialog.report-dialog .form-body > h3 {
  margin: 28px 0 12px;
}
dialog.report-dialog .form-body > p {
  margin: 12px 0;
}
dialog.report-dialog .table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
dialog.report-dialog .actions {
  margin: 16px 0;
  flex-wrap: wrap;
}
dialog.assistant-dialog {
  margin: 0 0 0 auto;
  height: 100dvh;
  max-height: 100dvh;
  width: min(620px, 100vw);
  border-radius: 0;
}
dialog.assistant-dialog .form-body {
  overflow: auto;
}
.section-tabs {
  flex-wrap: wrap;
}
.form-body > .full {
  grid-column: 1/-1;
  min-width: 0;
}
.form-body > button {
  align-self: start;
  justify-self: start;
}
@media (max-width: 960px) {
  .top-meta {
    display: none;
  }
  .auth-story {
    padding: 40px;
  }
  .auth-main {
    padding: 40px 30px;
  }
}
@media (max-width: 680px) {
  .auth-layout {
    display: block;
  }
  .auth-story {
    padding: 24px;
    gap: 0;
  }
  .auth-story > div:not(.brand),
  .auth-story > small {
    display: none;
  }
  .auth-story .brand {
    font-size: 28px;
  }
  .auth-main {
    padding: 35px 24px;
  }
  .auth-form-wrap h1 {
    font-size: 25px;
  }
  .user-actions {
    gap: 8px;
  }
  .user-actions .text-button {
    max-width: 75px;
    font-size: 11px;
  }
  .company-picker select {
    max-width: 155px;
  }
  .topbar {
    flex-wrap: wrap;
  }
  .user-actions {
    margin-left: auto;
  }
}

/* Shared operational layout: keep actions visible while long forms scroll. */
dialog {
  max-height: min(90dvh, 1000px);
  overflow: hidden;
}
dialog[open] > form {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  min-height: 0;
}
dialog header,
.dialog-actions {
  flex: none;
  background: var(--white);
}
dialog .form-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
dialog.assistant-dialog > form {
  height: 100%;
}
.field {
  min-width: 0;
}
.field select[multiple] {
  min-height: 112px;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.sidebar,
.form-body,
.table-wrap,
.table-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--green) var(--paper);
}
.sidebar {
  scrollbar-color: var(--mint) var(--forest);
  overscroll-behavior: contain;
}
.close {
  min-width: 44px;
  min-height: 44px;
}
.table-action {
  min-height: 40px;
}
.table-action:hover,
.close:hover {
  background: var(--paper);
  border-radius: 6px;
}
.table-wrap td {
  overflow-wrap: normal;
  word-break: normal;
}
.table-wrap td.number {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.report-dialog .form-body > h3 {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.dialog-actions {
  flex-wrap: wrap;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
@media (max-width: 680px) {
  .topbar {
    gap: 12px;
  }
  .user-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }
  .user-actions .text-button {
    max-width: 170px;
    font-size: 12px;
    min-height: 44px;
  }
  .company-picker {
    flex: 1;
  }
  .company-picker select {
    max-width: 100%;
    width: 100%;
  }
  .mobile-menu,
  .tab,
  .table-action,
  .text-button {
    min-height: 44px;
  }
  .mobile-menu {
    min-width: 44px;
  }
  .metric-note {
    font-size: 12px;
    line-height: 1.5;
  }
  .metric-value {
    font-size: clamp(20px, 5.6vw, 25px);
    overflow-wrap: anywhere;
  }
  .field input,
  .field select,
  .field textarea,
  .search {
    font-size: 16px;
  }
  dialog {
    max-height: calc(100dvh - 24px);
  }
  dialog header {
    padding: 12px 16px;
    gap: 12px;
  }
  dialog h2 {
    font-size: 18px;
  }
  dialog .form-body {
    padding: 20px 16px;
  }
  .dialog-actions {
    padding: 12px 16px;
  }
  .dialog-actions .btn {
    min-height: 44px;
    flex: 1;
  }
  .toolbar .actions {
    flex-wrap: wrap;
  }
}
dialog.assistant-dialog {
  max-width: 100vw;
}
dialog.assistant-dialog > form {
  height: 100dvh;
  max-height: 100dvh;
}
dialog.assistant-dialog .form-body {
  flex: 1;
  align-content: start;
}
.bi-section {
  margin: 28px 0;
}
.bi-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}
.bi-heading p,
.bi-foot {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.bi-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 24px;
}
.bi-aging {
  grid-column: 1/-1;
}
.bi-columns {
  display: flex;
  gap: 8px;
  padding: 0 24px;
}
.bi-month {
  flex: 1;
  min-width: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  padding: 4px;
  color: var(--ink);
  font-size: 12px;
}
.bi-month svg {
  width: 100%;
  max-height: 180px;
}
.bi-month:hover,
.bi-bar:hover {
  background: var(--paper);
}
.bi-legend {
  display: flex;
  gap: 20px;
  padding: 0 24px 12px;
  font-size: 12px;
}
.bi-legend span:first-child {
  color: var(--green);
}
.bi-legend span:last-child {
  color: var(--expense, #9e4534);
}
.bi-bars {
  padding: 0 24px 24px;
  display: grid;
  gap: 12px;
}
.bi-bar {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(60px, 1fr) auto;
  gap: 12px;
  text-align: left;
  background: transparent;
  color: var(--ink);
  padding: 8px 0;
  min-height: 44px;
  font-size: 12px;
}
.bi-bar svg {
  width: 100%;
  height: 14px;
}
.bi-bar strong {
  font-variant-numeric: tabular-nums;
}
.bi-table {
  margin: 16px 24px;
}
.bi-table summary {
  cursor: pointer;
  color: var(--green);
  padding: 12px 0;
}
.bi-foot {
  padding: 12px 24px;
}
.bi-empty {
  color: var(--muted);
  padding: 16px 0;
}
@media (max-width: 960px) {
  .bi-grid {
    grid-template-columns: 1fr;
  }
  .bi-heading {
    align-items: start;
    flex-direction: column;
  }
}
@media (max-width: 680px) {
  .bi-columns {
    padding: 0 12px;
    gap: 2px;
  }
  .bi-bars {
    padding: 0 16px 16px;
  }
  .bi-bar {
    grid-template-columns: minmax(100px, 1fr) auto;
  }
  .bi-bar svg {
    grid-column: 1/-1;
    grid-row: 2;
  }
  .bi-foot {
    padding: 12px 16px;
  }
}
.bi-month svg {
  height: auto;
}
/* Commercial workspace: shared financial typography, visible filters and tabular fallbacks. */
.co-workspace {
  min-width: 0;
}
.co-actions {
  margin-bottom: 20px;
}
.co-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  align-items: end;
  padding: 18px 0;
}
.co-filters .field {
  margin: 0;
}
.co-more,
.co-filters > .actions {
  grid-column: 1 / -1;
}
.co-more summary,
.co-quality summary {
  cursor: pointer;
  padding: 10px 0;
  font-weight: 600;
}
.co-quality {
  border-block: 1px solid var(--line, #dce2da);
  margin-bottom: 20px;
}
.co-quality p {
  max-width: 78ch;
  margin: 8px 0 16px;
}
.co-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 24px 0;
}
.co-tabs .tab {
  min-height: 44px;
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 14px;
  color: #46574d;
  cursor: pointer;
  border-radius: 6px;
}
.co-tabs .tab.active {
  color: #174c3e;
  background: #e5eee7;
  border-color: #b4c9ba;
  font-weight: 650;
}
.co-panels > .panel {
  margin-bottom: 24px;
}
.co-plot {
  padding: 12px 20px 20px;
}
.co-plot svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.co-plot text {
  font-size: 12px;
  fill: #46574d;
  font-variant-numeric: tabular-nums;
}
.co-composition {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 20px;
}
.co-composition > svg {
  width: 150px;
  flex-shrink: 0;
}
.co-composition p {
  margin: 0 0 14px;
}
.co-item {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  border-bottom: 1px solid #dce2da;
  padding: 12px 0;
}
.co-item .field {
  min-width: 0;
}
.co-json {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.co-panels .evidence {
  margin: 20px;
}
.co-panels .panel-body {
  padding: 20px;
}
.co-panels .table-wrap {
  max-height: 580px;
  overflow: auto;
}
.co-panels .bi-bar {
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.co-workspace table {
  font-variant-numeric: tabular-nums;
}
.co-workspace .metric-value {
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  .co-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .co-composition {
    flex-direction: column;
    align-items: start;
  }
  .co-item {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .co-actions {
    gap: 8px;
  }
  .co-actions .btn {
    flex: 1 1 145px;
  }
  .co-tabs .tab {
    flex: 1 1 110px;
  }
}
@media print {
  .sidebar,
  .topbar,
  .page-head .actions,
  .co-actions,
  .co-filters,
  .co-tabs,
  .footer,
  .co-panels .toolbar {
    display: none !important;
  }
  .shell,
  .workspace,
  .content {
    display: block !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .co-panels .table-wrap {
    max-height: none;
    overflow: visible;
  }
  .panel {
    break-inside: avoid;
  }
  .bi-grid {
    display: block;
  }
  .co-quality {
    display: block;
  }
}
.co-tools summary,
.co-filter-drawer > summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 600;
}
.co-tools > .actions {
  padding: 12px;
}
.co-filter-drawer {
  border: 1px solid #cdd8ce;
  border-radius: 6px;
  margin: 14px 0;
}
.co-filter-drawer .co-filters {
  padding: 14px;
}
.co-custom[hidden] {
  display: none;
}
.co-filter-drawer summary {
  color: #245245;
}
.co-tools[open] {
  flex-basis: 100%;
}
@media (max-width: 700px) {
  .co-actions .btn,
  .co-tools summary {
    min-height: 44px;
  }
  .co-filter-drawer > summary {
    line-height: 1.6;
  }
}
@media print {
  .co-tools,
  .co-filter-drawer {
    display: none !important;
  }
}
.co-heat-0 {
  background: #f3f5ef;
  color: #44564b;
}
.co-heat-1 {
  background: #e1ebdc;
  color: #254c3c;
}
.co-heat-2 {
  background: #bdcfba;
  color: #163e2f;
}
.co-heat-3 {
  background: #49745c;
  color: #fff;
}
.co-heat-4 {
  background: #214e3b;
  color: #fff;
}
.co-heat-unknown {
  color: #657168;
  background: #f9faf7;
}
/* Lines must not intercept clicks on their data points. */
.co-plot polyline, .co-plot path { pointer-events: none; }
.co-plot a { cursor: pointer; }
.co-plot a:focus-visible circle { stroke: #9b6010; stroke-width: 3; }

/* Analytical measure selectors preserve keyboard focus and visible selection. */
.co-workspace .toolbar [aria-pressed="true"] { background: #e4eee8; color: #18493d; text-decoration: underline; text-underline-offset: 4px; }
.co-workspace .toolbar { flex-wrap: wrap; }
.co-workspace caption { text-align: left; padding: 12px 0; color: #4a5951; font-size: .85rem; }
.co-plot a:focus-visible rect { stroke: #18493d; stroke-width: 3; }

input[type="date"], input[type="month"], input[type="datetime-local"] { cursor: pointer; }
.fin-receivable { color: #155e48; background: #edf7f1; }
.fin-payable { color: #943d20; background: #fff1e8; }
.metric.fin-receivable, .metric.fin-payable { padding: 16px; border-radius: 12px; }
.fin-receivable .metric-value, .fin-receivable .metric-label { color: #155e48; }
.fin-payable .metric-value, .fin-payable .metric-label { color: #943d20; }
.fin-nature { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: .8rem; font-weight: 600; }

/* Keep alert names readable while the table scrolls on narrow screens. */
.co-alert-list table { min-width: 700px; }
.co-alert-list td:first-child { min-width: 260px; overflow-wrap: normal; word-break: normal; }

/* Paginated evidence keeps money and dates readable on narrow screens. */
.co-evidence-table table { min-width: 580px; }
.co-evidence-table td:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Import review retains readable names, dates and monetary amounts. */
#co-import-preview table { min-width: 820px; }
#co-import-preview td:nth-child(3), #co-import-preview td:nth-child(6) { white-space: nowrap; }

/* Long import headers must wrap instead of widening mobile forms. */
.form-body > * { min-width: 0; }
.form-note { overflow-wrap: anywhere; }

/* Keep each measure selector inside the panel whose data it changes. */
.co-measure-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px 16px;
}
.co-measure-button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-weight: 600;
}
.co-measure-button:hover {
  background: var(--paper);
}
.co-measure-button[aria-pressed="true"] {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--white);
}

/* Shared operational layouts: retain readable columns instead of splitting words. */
.table-wrap,
.table-scroll {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
:is(.table-wrap, .table-scroll) table:has(thead tr > :nth-child(3)) {
  min-width: 480px;
}
:is(.table-wrap, .table-scroll) table:has(thead tr > :nth-child(4)) {
  min-width: 640px;
}
:is(.table-wrap, .table-scroll) table:has(thead tr > :nth-child(6)) {
  min-width: 800px;
}
:is(.table-wrap, .table-scroll) table:has(thead tr > :nth-child(8)) {
  min-width: 1040px;
}
:is(.table-wrap, .table-scroll) td > button {
  white-space: nowrap;
}
.panel-head {
  flex-wrap: wrap;
}
.panel-head > div:first-child {
  flex: 1 1 240px;
  min-width: 0;
}
.panel-head > .actions {
  flex: 0 1 auto;
}
.report-line > strong:last-child {
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 680px) {
  .btn,
  .btn.small,
  .field input:not([type="checkbox"]):not([type="radio"]),
  .field select,
  .month-input {
    min-height: 44px;
  }
  .month-input {
    min-width: 170px;
    flex-shrink: 0;
    font-size: 16px;
  }
  .panel-head > div:first-child,
  .panel-head > .actions {
    flex-basis: 100%;
  }
  .panel-head > h2 {
    flex: 1 1 200px;
  }
  .panel-head {
    align-items: flex-start;
  }
  .report-line {
    flex-wrap: wrap;
  }
  .report-line > strong:last-child {
    margin-left: auto;
  }
}
@media print {
  :is(.table-wrap, .table-scroll) table:has(thead tr > :nth-child(3)) {
    min-width: 0;
  }
}
