.finance-report {
  --report-total: #eeeeed;
  --report-main: #eff6f0;
  --report-tint: #f8faf8;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}
.night-mode .finance-report {
  --report-total: #294566;
  --report-main: #203956;
  --report-tint: #102039;
}
.report-scroll,
.pulse-margin-scroll {
  overflow: auto;
  max-width: 100%;
  min-width: 0;
  overscroll-behavior-x: contain;
}
.report-scroll {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.pl-report {
  --pl-header: #e9eeec;
  --pl-group: #f3f6f4;
  --pl-total: #e9eae9;
  --pl-rule: #d8dfdc;
  --pl-subtle: #63746d;
  --pl-text: #23282e;
  gap: 12px;
}
.night-mode .pl-report {
  --pl-header: #233b55;
  --pl-group: #142b43;
  --pl-total: #26394e;
  --pl-rule: #334a60;
  --pl-subtle: #adbdce;
  --pl-text: #e8edf2;
}
.pl-grid {
  --account-width: 352px;
  --amount-width: 144px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-color: var(--pl-subtle) transparent;
}
.pl-grid:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.pl-statement { min-width:0; }
.pl-grid.pl-heading { position:sticky; top:0; z-index:5; overflow:hidden; }
.pl-grid.pl-data thead th { height:0; padding-block:0; line-height:0; font-size:0; border-block:0; }
.pl-grid.pl-data thead small { height:0; margin:0; line-height:0; font-size:0; }
.pl-grid tbody tr td.pl-increase { color:var(--green-dark); }
.pl-grid tbody tr td.pl-decrease { color:var(--red); }
@media(max-width:760px), (hover:none) and (pointer:coarse) {
  .pl-grid.pl-heading { top:48px; }
}
.pl-grid table {
  table-layout: fixed;
  width: max(100%, calc(var(--account-width) + var(--amount-columns) * var(--amount-width)));
  border-spacing: 0;
  border-collapse: separate;
  font-variant-numeric: tabular-nums;
  letter-spacing: normal;
}
.pl-grid :is(th, td) {
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
  height: 46px;
  padding: 0 16px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}
.pl-grid thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 54px;
  background: var(--pl-header);
  border-bottom-color: var(--pl-rule);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .045em;
  font-size: 13px;
}
.pl-grid thead small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .055em;
  color: var(--pl-subtle);
}
.pl-grid thead th:first-child, .pl-grid tbody th {
  position: sticky;
  left: 0;
  width: var(--account-width);
  text-align: left;
  box-shadow: inset -1px 0 var(--pl-rule);
}
.pl-grid thead th:first-child { z-index: 4; }
.pl-grid tbody th {
  top: auto;
  z-index: 1;
  background: var(--surface);
  font-weight: 450;
  text-transform: none;
  letter-spacing: 0;
}
.pl-grid tr.pl-main > * {
  background: var(--pl-group);
  border-bottom-color: var(--pl-rule);
  font-weight: 650;
}
.pl-grid tr.pl-group th { font-weight: 600; }
.pl-grid tr.pl-subtotal > * {
  color: var(--pl-text);
  font-weight: 650;
  border-bottom-color: var(--pl-rule);
}
.pl-grid tr[data-row="143"] > * { border-top: 2px solid var(--pl-rule); }
.pl-grid tr > .pl-total {
  border-right: 1px solid var(--pl-rule);
  font-weight: 650;
  box-shadow: inset -1px 0 var(--pl-rule);
}
.pl-grid td.pl-empty { color: var(--pl-subtle); font-weight: 400; }
.pl-grid td.pl-negative { color: var(--red); }
.pl-grid tbody tr:hover > :is(td, th) {
  background-image: linear-gradient(color-mix(in srgb, var(--green) 5%, transparent), color-mix(in srgb, var(--green) 5%, transparent));
}
.pl-grid .pl-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  min-height: 42px;
  font: inherit;
  text-align: left;
}
.pl-chevron {
  display: inline-block;
  height: 7px;
  width: 7px;
  border: solid var(--pl-subtle);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg);
}
.pl-label[aria-expanded="true"] .pl-chevron { transform: translateY(-2px) rotate(45deg); }
.pl-account-line { overflow-x: auto; scrollbar-width: none; }
.pl-account-line::-webkit-scrollbar { display: none; }
.pl-grid .pl-leaf { padding-left: 17px; }
.pl-grid .pl-unit-cost .pl-leaf { padding-left: 33px; }
.pl-grid .pl-unit-cost > :is(th, td) { font-size: 12px; font-style: italic; }
.pl-grid tbody th,
.pl-grid tr.pl-detail > :is(th, td) { color: var(--pl-text); }
.pl-grid tr.pl-detail th { padding-left: 36px; }
#app[data-page="pl"] .global-filters {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding-inline: 0;
}
.report-info {
  display: inline-grid;
  place-items: center;
  position: relative;
  border: 0;
  color: var(--muted);
  min-height: 28px;
  width: 28px;
  padding: 0;
  margin-left: 2px;
  line-height: 13px;
  text-align: center;
  font:
    bold 11px Georgia,
    serif;
  vertical-align: middle;
  background: transparent;
}
.report-info::before {
  content: "";
  grid-area: 1 / 1;
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid;
  border-radius: 50%;
}
@media (pointer: coarse) {
  .report-info { min-height: 44px; width: 44px; }
}
.pl-grid .source-ref {
  font-size: 13px;
  color: var(--pl-text);
  padding: 2px 4px;
  margin-left: 4px;
  opacity: 0;
  text-decoration: none;
}
.pl-grid tr:focus-within .source-ref,
.pl-grid tr:hover .source-ref {
  opacity: 1;
}
@media (hover: none) { .pl-grid .source-ref { opacity: 1; } }
.report-secondary,
.report-disclosure {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.report-secondary {
  margin: 6px 0 12px;
}
.report-disclosure {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.report-disclosure summary {
  cursor: pointer;
  font-weight: 600;
}
.report-disclosure[open] summary {
  margin-bottom: 12px;
}
.report-switch {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  display: inline-flex;
  background: var(--surface);
}
.report-switch button {
  min-height: 38px;
  padding: 5px 16px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}
.report-switch .chosen {
  color: var(--green-dark);
  background: var(--green-soft);
}
dialog:has(.report-prepayment) {
  height: 100dvh;
  max-height: 100dvh;
  width: min(490px, 100vw);
  max-width: 100vw;
  margin: 0 0 0 auto;
  border-radius: 14px 0 0 14px;
  overflow-y: auto;
}
.pl-allocation {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.pl-allocation .primary {
  justify-self: start;
}
.pl-alloc-history {
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 18px;
}
.pl-alloc-history small {
  display: block;
  color: var(--muted);
}
.pl-alloc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.financial-pulse {
  gap: 14px;
}
.pulse-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.room-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.pulse-card,
.pulse-panel,
.pulse-margin {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  min-width: 0;
}
.pulse-card h3,
.pulse-panel h3 {
  font:
    650 15px/1.25 system-ui,
    sans-serif;
  margin: 0 0 12px;
}
.pulse-card > strong {
  font:
    650 clamp(15px, 1.35vw, 25px) / 1.2 system-ui,
    sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.pulse-card small,
.pulse-chart-meta,
.pulse-metrics small {
  color: var(--muted);
  font-size: 11px;
  display: block;
  margin-top: 8px;
}
.pulse-cards:not(.room-cards) > .pulse-card:nth-child(4) {
  background: var(--report-main);
}
.pulse-health > div {
  display: flex;
  gap: 10px;
}
.pulse-health > div span {
  flex: 1;
}
.pulse-health > div span + span {
  border-left: 1px solid var(--line);
  padding-left: 12px;
}
.pulse-health small {
  margin-top: 0;
}
.pulse-health strong {
  font-size: 18px;
}
.pulse-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.pulse-chart-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.pulse-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pulse-legend span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #95dba7;
  margin-right: 4px;
}
.pulse-legend .cost::before {
  background: #eda7a0;
}
.pulse-legend .beds::before {
  background: #659e86;
}
.pulse-bar.revenue {
  fill: #a3dfab;
}
.pulse-bar.cost {
  fill: #eeaba3;
}
.pulse-bar.beds {
  fill: #659e86;
}
.pulse-panel { container-type: inline-size; }
.pulse-plot {
  margin-top: 8px;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px;
}
.pulse-axis { display: grid; }
.pulse-axis span {
  grid-area: 1 / 1;
  position: relative;
  align-self: start;
  justify-self: end;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.pulse-plot svg {
  width: 100%;
  height: 215px;
  display: block;
}
.pulse-panel svg text {
  fill: var(--muted);
  font-size: 12px;
}
@container (max-width: 450px) {
  .pulse-month:nth-of-type(even):not(:last-child),
  .pulse-month:nth-of-type(11) { display: none; }
  .pulse-month { font-size: 11px; }
}
.pulse-gridline {
  stroke: var(--line);
  stroke-width: 0.7;
}
.pulse-baseline {
  stroke: var(--muted);
  stroke-width: 1;
}
.pulse-no-chart {
  min-height: 145px;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--muted);
}
.pulse-margin {
  display: grid;
  grid-template-columns: minmax(148px, 1.8fr) repeat(13, minmax(max-content, 1fr));
  align-items: center;
  padding: 8px;
  min-width: 845px;
  text-align: center;
}
.pulse-margin-scroll {
  display: grid;
  gap: 8px;
}
.pulse-margin strong {
  position: sticky;
  left: 0;
  background: var(--surface);
  text-align: left;
  font-size: 13px;
  padding: 2px 8px;
}
.pulse-margin > div {
  border-left: 1px solid var(--line);
  padding: 5px 2px;
}
.pulse-margin small,
.pulse-margin b {
  display: block;
}
.pulse-margin small {
  color: var(--muted);
  margin-bottom: 3px;
}
.pulse-margin .negative {
  color: var(--red);
}
.pulse-margin .annual {
  background: var(--report-main);
  border-radius: 6px;
}
.pulse-ranking,
.pulse-metrics {
  font-variant-numeric: tabular-nums;
}
.pulse-ranking th,
.pulse-ranking td,
.pulse-metrics td,
.pulse-metrics th {
  text-align: right;
  white-space: nowrap;
}
.pulse-ranking td:not(:first-child) { white-space: nowrap; }
.pulse-ranking td:first-child { overflow-wrap: anywhere; }
.pulse-metrics th:first-child {
  position: sticky;
  left: 0;
  background: var(--surface);
  box-shadow: inset -1px 0 var(--line);
}
.pulse-ranking th:first-child,
.pulse-ranking td:first-child,
.pulse-metrics th:first-child {
  text-align: left;
}
.pulse-ranking {
  min-width: 0;
  width: 100%;
}
.pulse-ranking th,
.pulse-ranking td {
  padding: 9px 4px;
  font-size: 12px;
  white-space: normal;
}
.pulse-metrics small {
  margin: 3px 0 0;
  font-size: 10px;
  font-weight: 400;
}
@media (max-width: 1100px) {
  .pulse-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pulse-health { grid-column: span 2; }
}
#app:is([data-page="pl"],[data-page="kpi"]) .global-filters label:first-child { flex-basis: 20rem; }
#app:is([data-page="pl"],[data-page="kpi"]) .global-filters select {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 500;
}
@media (min-width: 1001px) {
  .global-filters :is(#basis-control,#kpi-basis-control) { min-width: 12rem; }
}
@media (min-width: 761px) and (max-width: 1000px) {
  #app:is([data-page="pl"],[data-page="kpi"]) .global-filters {
    display: grid; grid-template-columns: minmax(6rem,1fr) minmax(8rem,1fr) minmax(12rem,2fr) auto;
  }
  #app:is([data-page="pl"],[data-page="kpi"]) .global-filters label { min-width: 0; }
  #app:is([data-page="pl"],[data-page="kpi"]) .global-filters label:first-child { grid-column: 1/-1; }
}
@media (max-width: 760px) {
  .pulse-two {
    grid-template-columns: minmax(0, 1fr);
  }
  .pulse-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pulse-health {
    grid-column: 1/-1;
  }
  .pl-grid {
    --account-width: 332px;
    --amount-width: 132px;
  }
  .pl-grid :is(td, th) { padding-right: 12px; }
  .report-switch button { min-height: 44px; }
  .pl-grid .pl-label { min-height: 44px; }
  #app:is([data-page="pl"],[data-page="kpi"]) .global-filters {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    align-items: end;
    gap: 10px;
  }
  #app:is([data-page="pl"],[data-page="kpi"]) .global-filters label { min-width: 0; grid-column: span 2; }
  #app:is([data-page="pl"],[data-page="kpi"]) .global-filters label:first-child { grid-column: 1 / -1; }
  #app:is([data-page="pl"],[data-page="kpi"]) .global-filters :is(select,button) { min-height: 44px; }
  #app:is([data-page="pl"],[data-page="kpi"]) .global-filters :is(#basis-control,#kpi-basis-control) { grid-column: span 3; }
  #app:is([data-page="pl"],[data-page="kpi"]) #refresh { padding-inline: 4px; }
  .pulse-metrics th:first-child { min-width: 128px; max-width: 146px; white-space: normal; }
}
@media (max-width: 520px) {
  .pl-grid { --account-width: clamp(190px, calc(100vw - 134px), 250px); --amount-width: 108px; }
  .pl-grid :is(th, td) { padding-inline: 10px; }
  .pl-grid tr.pl-detail th { padding-left: 22px; }
  .pulse-cards { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pulse-card:not(.pulse-health) {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 10px;
    padding: 12px 14px;
  }
  .pulse-card:not(.pulse-health) h3 { margin: 0; }
  .pulse-card:not(.pulse-health) small { width: 100%; margin: 0; }
  .pulse-card:not(.pulse-health) > strong { font-size: 17px; overflow-wrap: normal; }
  .pulse-panel { padding: 12px; }
  .pulse-panel h3 { margin-bottom: 8px; }
}

#app[data-page="kpi"] #page-title {
  font-family: system-ui, sans-serif;
  font-weight: 650;
  letter-spacing: -0.035em;
}
.pulse-annual {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
}
.pulse-annual span {
  color: var(--muted);
}
.pulse-annual b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 520px) {
  .pulse-annual { display: grid; gap: 8px; }
  .pulse-annual span { display: flex; justify-content: space-between; gap: 8px; }
}
.pulse-ranking progress {
  display: block;
  height: 4px;
  width: 80%;
  margin-top: 7px;
  border: 0;
  appearance: none;
  background: transparent;
  color: #a3dfab;
}
.pulse-ranking progress::-webkit-progress-bar {
  background: transparent;
}
.pulse-ranking progress::-webkit-progress-value {
  background: #a3dfab;
  border-radius: 3px;
}
.pulse-ranking progress::-moz-progress-bar {
  background: #a3dfab;
  border-radius: 3px;
}

.review-fee { display:block; color:var(--muted); white-space:nowrap; }

.pl-grid tr.pl-cash-result > :is(th, td) { color: var(--green-dark); }

.pl-grid tr:is([data-row="33"],[data-row="128"],[data-row="141"]) > * { border-top:12px solid var(--surface); }

.upsales-margins { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; }
.upsales-margins :is(th,td) { padding:8px; text-align:right; white-space:nowrap; }
.upsales-margins th:first-child { text-align:left; }
