:root {
  color-scheme: light;
  --page: #f7f9fc;
  --nav: #edf3fa;
  --surface: #fff;
  --ink: #142442;
  --muted: #53647e;
  --line: #dfe7f1;
  --accent: #1c53a6;
  --accent-dark: #123f83;
  --accent-soft: #e0edff;
  --number: #11233e;
  --danger: #9f2936;
  --danger-bg: #fbe8eb;
  --review: #81500d;
  --review-bg: #fff0d5;
  --success: #126656;
  --success-bg: #dcf4ec;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: progress; }
a { color: var(--accent-dark); text-underline-offset: 3px; overflow-wrap: anywhere; }
a .icon { width: 13px; height: 13px; margin-left: 2px; vertical-align: -2px; }
a:hover, .link-button:hover { color: #0e2b58; }
:focus-visible { outline: 3px solid #477cce; outline-offset: 3px; }
.icon { flex: none; width: 19px; height: 19px; vertical-align: -4px; }
.screen-reader { position: absolute; height: 1px; width: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 36px; background: var(--nav); border-right: 1px solid var(--line); padding: 25px 17px 19px; }
.wordmark { display: block; width: fit-content; color: #101f3b; font-weight: 820; font-size: 27px; letter-spacing: -.075em; line-height: 1; margin: 4px 8px; }
.sidebar nav { min-width: 0; }
.nav-label { color: var(--muted); margin: 24px 10px 7px; font-size: 12px; }
.nav-link { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; border: 1px solid transparent; background: transparent; color: var(--ink); border-radius: 8px; padding: 10px; margin-bottom: 4px; font-weight: 590; font-size: 14px; }
.nav-link .icon { color: #496485; }
.nav-link:hover { background: #e6effa; }
.nav-link.active { background: var(--accent-soft); color: var(--accent-dark); border-color: #d5e4fa; }
.nav-link.active .icon { color: var(--accent-dark); }
.account { margin-top: auto; border-top: 1px solid #d6e2f0; padding: 17px 4px 0; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.account strong { overflow-wrap: anywhere; }
.account p { font-size: 12px; margin: 3px 0 0; color: var(--muted); }
.content { width: 100%; max-width: 1510px; margin: 0 auto; padding: 27px 35px 65px; }
.content:focus { outline: none; }
.top, .top-actions, .page-head, .crumb { display: flex; align-items: center; }
.top, .page-head { justify-content: space-between; gap: 20px; }
.crumb { gap: 7px; color: var(--muted); font-size: 13px; }
.crumb .icon { width: 14px; height: 14px; }
.top-actions { gap: 10px; }
.period, .button { display: inline-flex; gap: 8px; align-items: center; justify-content: center; border: 1px solid var(--line); padding: 8px 13px; border-radius: 7px; min-height: 40px; white-space: nowrap; font-size: 14px; }
.period { background: #fff; color: #273d5c; padding-block: 0; padding-right: 6px; }
.period .icon { color: var(--accent); }
.period select { border: 0; padding-inline: 0 5px; }
.button { background: white; color: var(--ink); font-weight: 650; }
.button.primary { background: var(--accent); color: white; border-color: transparent; }
.button.primary:hover { background: var(--accent-dark); }
.page-head { align-items: flex-end; margin: 21px 0 22px; }
h1 { font-size: clamp(27px, 3vw, 39px); letter-spacing: -.047em; line-height: 1.1; margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.source-time { flex: none; display: flex; flex-direction: column; font-size: 12px; text-align: right; color: var(--muted); }
.source-time strong { color: #334969; }
.source-time .sync-warning { color: var(--review); max-width: 290px; }
.notice { background: #e9f4ff; color: var(--accent-dark); border: 1px solid #d8e9fc; border-radius: 7px; padding: 10px 13px; margin: 15px 0 0; }
.notice-error { background: var(--review-bg); color: var(--review); border-color: #ecd8b3; }
.object-notice { margin: 0 0 16px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 22px; }
.metric { padding: 15px 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; min-width: 0; }
.metric span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.metric strong { display: block; color: var(--number); font-size: clamp(18px, 2vw, 29px); font-weight: 750; letter-spacing: -.04em; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric.attention-metric strong { color: var(--review); }
.metric-link { text-align: left; }
.metric-link:hover { border-color: #a4c1ea; background: #f5f9ff; }
.metric-link small { display: inline-block; font-size: 12px; color: var(--accent-dark); margin-top: 8px; }
.metric-link small .icon { width: 13px; height: 13px; vertical-align: -2px; }
.attention-metric { background: var(--review-bg); border-color: #ebd5ad; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; margin-bottom: 18px; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
h2, h3 { font-size: 17px; line-height: 1.3; margin: 0; }
.panel-head h2 .icon { margin-right: 4px; color: #a96312; }
.panel-head > a { font-size: 13px; }
.panel-body { padding: 16px 17px; }
.panel-body p { margin: 8px 0 0; color: var(--muted); }
.panel-note { margin: 0; padding: 13px 17px; color: var(--muted); font-size: 13px; }
.breakdown-panel, .financial-review { scroll-margin-top: 15px; }
.breakdown-panel > summary { cursor: pointer; list-style: none; }
.breakdown-panel > summary::-webkit-details-marker { display: none; }
.breakdown-panel > summary > span { color: var(--accent-dark); font-size: 13px; }
.breakdown-panel[open] > summary .icon { transform: rotate(90deg); }
.breakdown-panel:not([open]) > summary { border-bottom: 0; }
.money-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 15px 17px 0; }
.money-grid h3 { font-size: 15px; margin: 0 0 6px; }
.money-lines { margin: 0; }
.money-lines > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.money-lines .money-total { border-color: #bfd4ef; color: var(--accent-dark); font-weight: 700; }
.money-lines dd { white-space: nowrap; font-variant-numeric: tabular-nums; margin: 0; }
.deposit-note { padding: 10px 13px; border: 1px solid #c9e7e0; border-radius: 7px; background: #edf8f5; color: var(--success); margin: 0 0 12px; }
.deposit-note strong { margin-left: 5px; }
.deposit-note button { margin-left: 9px; font-size: 13px; }
.financial-review { border-color: #ecd5ad; }
.financial-review > .panel-head { background: #fff9ef; }
.table-scroll { overflow-x: auto; }
.history-scroll { max-height: 390px; }
.history-scroll thead th { position: sticky; top: 0; }
.history-panel { --series-charged: #2456a6; --series-received: #12786b; }
.history-body { padding: 14px 17px 11px; }
.history-modes, .history-legend, .history-values { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px 15px; }
.history-modes { gap: 6px; margin-bottom: 13px; }
.history-modes .button { min-height: 34px; padding: 5px 10px; font-size: 13px; }
.history-modes .button[aria-pressed="true"] { background: var(--accent-soft); border-color: #b7cfee; color: var(--accent-dark); }
.history-context { margin-bottom: 10px; }
.history-legend { padding: 0; margin: 0 0 11px; list-style: none; font-size: 13px; }
.history-legend li { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.history-legend li > span:last-child { color: var(--muted); }
.history-swatch { display: inline-block; flex: none; width: 18px; border-top: 3px solid var(--series-color); }
.history-swatch.received { border-top-style: dashed; }
.history-panel .charged { --series-color: var(--series-charged); }
.history-panel .received { --series-color: var(--series-received); }
.history-values { padding: 8px 11px; background: var(--page); border-radius: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.history-values > span { color: var(--muted); }
.history-values strong { color: var(--ink); }
.history-scroll-area { overflow-x: auto; }
.history-plots.separate { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 0 20px; }
.history-plots.history-long.separate { grid-template-columns: minmax(0, 1fr); }
.history-unit { grid-column: 1 / -1; margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.history-plot h3 { margin: 0 0 9px; font-size: 14px; }
.history-plot-grid { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 6px; margin: 3px 4px 0 0; }
.history-plot-area, .history-y-axis { position: relative; height: 224px; }
.history-plots.separate :is(.history-plot-area, .history-y-axis) { height: 152px; }
.history-y-axis, .history-x-axis { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.history-y-axis > div { position: absolute; inset: -.75em 3px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; white-space: nowrap; }
.history-svg, .history-months { position: absolute; inset: 0; width: 100%; height: 100%; }
.history-svg { overflow: visible; pointer-events: none; }
.history-svg line { stroke: var(--line); stroke-width: 1; }
.history-svg .history-zero { stroke: #8da1bc; }
.history-line { stroke: var(--series-color); stroke-width: 2.7; stroke-linejoin: round; }
.history-line.received { stroke-dasharray: 6 3; }
.history-svg .history-point-mark { stroke: var(--series-color); stroke-width: 6; stroke-linecap: round; }
.history-bar { fill: var(--series-color); }
.history-months, .history-x-axis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.history-x-axis { text-align: center; padding-top: 7px; }
.history-x-axis span { white-space: nowrap; }
.history-column { border: 0; padding: 0; background: transparent; min-width: 0; }
.history-column.is-partial { background: repeating-linear-gradient(135deg, transparent 0 5px, rgb(36 86 166 / .06) 5px 7px); }
.history-column[aria-current="date"] { box-shadow: inset 0 -2px var(--accent); }
.history-column.is-highlighted { background-color: rgb(36 86 166 / .09); }
.history-column:focus-visible { outline-offset: -3px; }
.history-hint { margin: 9px 0 0; font-size: 12px; color: var(--muted); }
.history-details { border-top: 1px solid var(--line); }
.history-details summary { padding: 10px 17px; color: var(--accent-dark); font-size: 13px; cursor: pointer; }
.history-details summary:focus-visible { outline-offset: -3px; }
.events-panel { scroll-margin-top: 15px; }
.events-panel .event-empty { padding-top: 0; }
.contract-event.event-active.indexation { background: var(--review-bg); }
.contract-event.event-active.renewal { background: var(--danger-bg); }
.event-status, .event-action { display: block; color: var(--muted); font-size: 13px; }
.contract-event.event-active.indexation .event-status { color: var(--review); }
.contract-event.event-active.renewal .event-status { color: var(--danger); }
.event-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.contract-event [data-indexation-draft] { margin-top: 4px; }
.indexation-dialog { width: min(660px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); }
.indexation-dialog::backdrop { background: rgb(20 36 66 / 42%); }
.indexation-form { display: grid; gap: 12px; padding: 16px 17px; }
.indexation-form label { display: grid; gap: 4px; }
.indexation-form textarea { width: 100%; padding: 8px 10px; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; resize: vertical; }
.indexation-form p { margin: 0; color: var(--muted); font-size: 13px; }
#indexation-copy-status:empty { display: none; }
.indexation-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.indexation-actions form { margin: 0; }
.selected-period { background: #eef5ff; }
.overdue-amount { color: var(--danger); font-weight: 700; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 10px 16px; border-bottom: 1px solid #e9eef5; }
th { color: #375174; background: #f0f5fb; font-size: 12px; font-weight: 680; white-space: nowrap; }
td { font-size: 14px; }
.number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.object-link { background: transparent; border: 0; padding: 0; color: var(--ink); text-align: left; }
.object-link:hover strong { text-decoration: underline; }
.object-link span { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.icon-button { display: inline-flex; padding: 5px; color: var(--accent-dark); border: 1px solid #d8e4f3; border-radius: 5px; background: #f4f8ff; }
.icon-button:hover { background: var(--accent-soft); }
.count { display: inline-block; color: #5b6e8a; font-weight: 570; margin-left: 4px; font-size: 14px; }
.filter-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
select, input { color: var(--ink); border: 1px solid #cdd9e9; border-radius: 6px; background: #fff; padding: 7px 10px; max-width: 100%; }
.issue-list, .docs { list-style: none; margin: 0; padding: 0; }
.issue-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.issue-list li { padding: 14px 17px; border-bottom: 1px solid var(--line); min-width: 0; }
.issue-list li:nth-child(odd) { border-right: 1px solid var(--line); }
.issue-title, .issue-links { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.issue-detail { color: var(--muted); font-size: 13px; margin: 5px 0; }
.issue-owner { color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.issue-amount { font-size: 13px; color: var(--review); font-variant-numeric: tabular-nums; font-weight: 700; }
.issue-links { font-size: 13px; }
.link-button { border: 0; background: transparent; padding: 0; color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; text-align: left; }
.pill { display: inline-flex; width: fit-content; align-items: center; border-radius: 5px; padding: 4px 7px; line-height: 1.2; font-weight: 650; font-size: 11px; white-space: nowrap; }
.pill.found { background: var(--success-bg); color: var(--success); }
.pill.missing { background: var(--danger-bg); color: var(--danger); }
.pill.review { background: var(--review-bg); color: var(--review); }
.muted { color: var(--muted); }
.review-shortcut { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 18px; }
#portfolio-review td { min-width: 130px; }
#portfolio-review .issue-links { margin-top: 5px; }
.tenant-bar { display: flex; gap: 11px; flex-wrap: wrap; align-items: center; margin: 0 0 19px; }
.tenant-bar label { font-weight: 650; }
.tenant-bar a { font-size: 13px; }
.object-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.property-accounts-table tbody th { background: transparent; color: var(--ink); font-size: 14px; white-space: normal; }
.property-accounts-table tbody th button { min-width: 150px; }
.property-accounts-table tfoot { background: #f0f5fb; color: var(--ink); font-weight: 700; }
.property-accounts-table tfoot th { font-size: 14px; }
.cards, .ledger { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 13px; }
.cards .panel { margin-bottom: 0; }
.cards { margin-bottom: 18px; }
.service-list { list-style: none; margin: 10px 0 0; padding: 0; }
.service-list li { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.service-list a { color: inherit; }
.review-row { background: #fff8ec; }
.row-note { color: var(--review); font-size: 11px; display: block; margin-top: 3px; }
.facts { margin: 0; display: grid; gap: 6px; }
.facts div { display: grid; grid-template-columns: minmax(100px, 36%) 1fr; gap: 7px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.docs { margin-top: 13px; }
.docs li { padding: 10px 0 0; margin-top: 9px; border-top: 1px solid var(--line); }
.docs li div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.docs li p, .docs li a { font-size: 13px; margin: 4px 0 0; }
.docs li a { display: block; }
.ledger { gap: 1px; background: var(--line); }
.ledger-side { background: var(--surface); min-width: 0; }
.ledger-side h3 { padding: 10px 16px; font-size: 13px; }
.ledger-side h3.charge { background: var(--accent-soft); color: var(--accent-dark); }
.ledger-side h3.receipt { background: var(--success-bg); color: var(--success); }
.ledger-side td:first-child { white-space: nowrap; }
.auth { width: min(420px, calc(100% - 32px)); margin: 12vh auto 30px; padding: 28px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.auth .wordmark { margin: 0 0 22px; }
.auth h1 { font-size: 28px; margin-bottom: 16px; }
.auth label { display: grid; gap: 3px; margin-bottom: 13px; }
.error { color: var(--danger); font-size: 13px; }
@media (max-width: 1000px) {
  .layout { grid-template-columns: 185px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .content { padding-inline: 19px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  td, th { padding-inline: 11px; }
}
@media (max-width: 680px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; padding: 12px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: flex; overflow: auto; gap: 5px; }
  .sidebar .nav-label { display: none; }
  .nav-link { white-space: nowrap; margin: 0; width: auto; font-size: 12px; padding: 6px 7px; }
  .nav-link .icon { width: 15px; height: 15px; }
  .content { padding: 15px 12px 32px; }
  .top, .page-head { flex-wrap: wrap; gap: 8px; }
  .top-actions { margin-left: auto; }
  .source-time { text-align: left; }
  .metrics { gap: 7px; }
  .object-metrics { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
  .metric { padding: 10px; }
  .metric span { font-size: 12px; }
  .issue-list, .cards, .ledger, .money-grid { grid-template-columns: minmax(0, 1fr); }
  .issue-list li:nth-child(odd) { border-right: 0; }
  .account { padding: 8px 4px 0; }
  .history-body { padding-inline: 12px; }
  .history-plot-grid { grid-template-columns: 49px minmax(0, 1fr); }
  .history-plot-area, .history-y-axis { height: 178px; }
}
