:root {
  color-scheme: light;
  --nav: #20382f;
  --nav-deep: #192d26;
  --nav-text: #d8e4db;
  --ink: #1f3029;
  --text: #304139;
  --muted: #596b61;
  --green: #285741;
  --green-hover: #1d4935;
  --soft-green: #e8f1e9;
  --canvas: #f5f7f4;
  --surface: #fff;
  --line: #dce5dd;
  --radius: 12px;
  --rail-width: 232px;
  font-family: "Inter", "Aptos", "Segoe UI", sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--canvas);
}
*,*::before,*::after { box-sizing: border-box; }
body { margin: 0; min-width: 290px; }
button,input,select,textarea { font: inherit; }
button,a,input,select,textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible,[tabindex="0"]:focus-visible { outline: 3px solid #739e7f; outline-offset: 2px; }
button:focus:not(:focus-visible),main:focus { outline: none; }
p { margin: 0; }
svg { flex: 0 0 auto; }
[hidden] { display:none !important; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 20; transform: translateY(-150%); background: white; color: var(--ink); padding: 12px; border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--rail-width) minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; min-height: 0; padding: 25px 14px 14px; background: linear-gradient(155deg,var(--nav) 34%,var(--nav-deep)); color: var(--nav-text); overflow: auto; scrollbar-width: thin; }
.brand { display: flex; align-items: center; gap: 11px; text-align: left; margin: 0 4px 25px; padding: 0 6px; border: 0; background: transparent; color: #fff; }
.logo-mark { display: inline-grid; place-items: center; width: 39px; height: 39px; border-radius: 11px; background: #dbeade; color: #274836; font-weight: 700; }
.logo-mark .icon { width:24px; height:24px; }
.brand strong { display: block; font-size: 1.12rem; letter-spacing: -.035em; }
.brand small { display: block; color: #b9cdc0; font-size: .625rem; letter-spacing: .13em; margin-top: 4px; }
.nav-group { margin-bottom: 15px; }
.nav-caption { color: #b7cbbd; font-size: .7rem; letter-spacing: .085em; text-transform: uppercase; font-weight: 650; margin: 0 0 6px 11px; }
.nav-link { display: flex; align-items: center; gap: 11px; width:100%; color: var(--nav-text); background: transparent; border: 0; border-radius: 7px; padding: 8px 10px; margin: 1px 0; text-align: left; font-size: .875rem; min-height: 38px; }
.nav-link .icon { width: 17px; height: 17px; color: #b8cdbf; }
.nav-link:hover,.nav-link.active { color: #fff; background: #365647; }
.nav-link.active { font-weight: 660; }
.nav-link.active .icon { color: #dcecdf; }
.rail-foot { margin: auto 8px 0; display: flex; align-items:center; gap: 8px; padding: 15px 3px 3px; color: #c1d1c6; border-top: 1px solid #456056; font-size: .79rem; }
.rail-dot { width: 7px; height: 7px; border-radius: 50%; background: #9dbfa7; }
.work { min-width: 0; }
.topbar { height: 64px; display:flex; justify-content:space-between; align-items:center; gap: 14px; background: #fff; border-bottom:1px solid var(--line); padding: 0 clamp(19px,3.15vw,44px); }
.top-leading,.top-trailing { display:flex; align-items:center; gap: 11px; font-size: .875rem; }
.crumb-parent,.crumb-slash { color: var(--muted); }
.top-leading strong { color: var(--ink); font-weight: 650; }
.workspace-picker { display: flex; align-items:center; gap: 8px; position: relative; min-width: 0; }
.workspace-picker select { appearance: none; background: transparent; border: 0; min-width: 0; width: clamp(100px,16vw,228px); padding: 8px 26px 8px 1px; font-size: .875rem; color: var(--ink); text-overflow: ellipsis; }
.workspace-picker > .icon { position:absolute; right: 2px; width: 15px; height: 15px; color: var(--muted); pointer-events:none; }
.avatar { display:grid; place-items:center; width:32px; height:32px; border-radius: 50%; background: #e6efe7; color: #315d45; font-size:.71rem; font-weight:700; }
.demo-chip { color:#674e28; background:#f9efdc; padding: 5px 9px; border-radius: 6px; white-space: nowrap; font-size:.75rem; font-weight:650; }
.menu-button { display:none !important; }
main { padding: clamp(24px,3vw,42px) clamp(18px,3.15vw,44px) 48px; width:100%; max-width: 1700px; margin: auto; min-width:0; }
h1,h2,h3 { color: var(--ink); margin:0; }
h1 { font-weight: 720; font-size: clamp(1.85rem,3vw,2.55rem); letter-spacing:-.051em; line-height:1.12; }
h2 { font-size:1.11rem; font-weight:700; letter-spacing:-.02em; line-height:1.25; }
h3 { font-size:1rem; font-weight: 690; }
.page-header { display:flex; align-items:flex-start; justify-content:space-between; gap: 18px; margin-bottom: 25px; }
.page-header p { color:var(--muted); margin-top: 9px; line-height: 1.52; font-size:.95rem; }
.actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:9px; padding-top: 3px; }
.button { min-height: 40px; border: 1px solid var(--line); border-radius: 7px; padding: 8px 13px; background: var(--surface); color: var(--green); font-weight: 650; font-size: .86rem; display:inline-flex; align-items:center; justify-content:center; gap:7px; white-space:nowrap; text-decoration:none; line-height:1.2; }
.button .icon { width:16px; height:16px; }
.button:hover:not(:disabled),.icon-button:hover:not(:disabled) { background: var(--soft-green); border-color: #b2c8b7; }
.button.primary { color: #fff; background: #285741; border-color: #285741; }
.button.primary:hover:not(:disabled) { color: #fff; background: var(--green-hover); border-color: var(--green-hover); }
.button.compact { min-height: 32px; padding: 5px 9px; background: transparent; border-color: transparent; font-size:.855rem; }
.icon-button { display: inline-grid; place-items:center; width:36px; height:36px; padding:0; border:1px solid transparent; border-radius:8px; color:var(--muted); background: transparent; }
.icon-button .icon { width:19px; height:19px; }
.overview .page-header { margin-bottom: 12px; }
.overview-date { display:flex; align-items:center; gap:7px; color: var(--muted); font-size:.84rem; margin:0 0 21px; }
.overview-date .icon { width:15px; height:15px; }
.kpis { display:grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap:15px; margin-bottom:17px; }
.kpi { min-width: 0; border-radius: var(--radius); background: var(--surface); border:1px solid var(--line); padding: 16px 17px; min-height: 123px; display:flex; flex-direction:column; align-items:flex-start; gap:8px; }
.kpi-title { display:flex; align-items:center; gap:8px; font-size:.865rem; color: var(--muted); font-weight:650; min-height:31px; }
.kpi-icon,.list-icon,.welcome-icon,.hero-icon { display:inline-grid; place-items:center; flex:0 0 auto; color: #34644a; background: var(--soft-green); border-radius:8px; }
.kpi-icon { width:31px; height:31px; }
.kpi-icon .icon { width:17px; height:17px; }
.kpi:last-child .kpi-icon { color: #96513d; background: #f8ebe7; }
.kpi > strong { font-size: clamp(1.37rem,2.25vw,1.95rem); font-weight: 725; line-height:1.13; letter-spacing:-.045em; color: var(--ink); font-variant-numeric: tabular-nums; max-width: 100%; overflow-wrap: anywhere; }
.kpi > small { font-size:.76rem; line-height:1.35; color:var(--muted); }
.welcome { display:flex; align-items:center; gap: 13px; margin-bottom:17px; padding:15px 17px; background:#eaf2eb; border: 1px solid #d3e2d6; border-radius:var(--radius); }
.welcome-icon { width:40px; height:40px; background:#d9e9dd; }
.welcome h2 { font-size:1rem; }
.welcome p { color:var(--muted); font-size:.85rem; margin-top:4px; line-height:1.4; }
.welcome .button { margin-left:auto; }
.dashboard-grid { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(0,1fr); gap:16px; align-items:stretch; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background:var(--surface); min-width:0; overflow:hidden; }
main > .panel + .panel { margin-top: 16px; }
.panel-head { min-height: 69px; display:flex; align-items:flex-start; justify-content:space-between; gap:9px; padding: 15px 16px 12px; }
.panel-head p { color:var(--muted); font-size:.8rem; line-height:1.4; margin-top:5px; }
.panel-head .button { margin-top: -1px; }
.chart { padding: 8px 18px 17px; }
.chart-area { display:flex; gap:10px; height: 151px; }
.axis { flex: 0 0 45px; color:var(--muted); font-variant-numeric:tabular-nums; font-size:.7rem; display:flex; flex-direction:column; justify-content:space-between; align-items:flex-end; height: 125px; transform:translateY(-5px); }
.plot { flex: 1; min-width:0; display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); height: 120px; background: repeating-linear-gradient(to top,#e2e9e3 0,#e2e9e3 1px,transparent 1px,transparent 25%); border-top:1px solid #e2e9e3; }
.month { position:relative; display:flex; flex-direction:column; align-items:center; min-width:0; height: 145px; }
.month > small { margin-top: 5px; color:var(--muted); font-size:.76rem; }
.bars { height:120px; position:relative; width:min(100%,60px); }
.bar { position:absolute; border-radius:4px 4px 0 0; width: 36%; max-width:20px; display:block; }
.bar.billed { right:52%; background:#9db8a4; }
.bar.collected { left:52%; background:#48785b; }
.legend { display:flex; align-items:center; justify-content:center; gap:16px; color:var(--muted); font-size:.78rem; }
.legend span { display:flex; align-items:center; gap:5px; }
.legend i { width:9px; height:9px; border-radius:2px; background:#9db8a4; }
.legend span:last-child i { background:#48785b; }
.activity-row { width:calc(100% - 28px); display:flex; align-items:center; margin: 0 14px; gap:9px; background:transparent; padding: 9px 0; text-align:left; border:0; color:var(--text); }
.activity-row + .activity-row { border-top:1px solid var(--line); }
.activity-row:hover { color:var(--green); }
.list-icon { width:33px; height:33px; }
.list-icon .icon { width:16px; height:16px; }
.event-text { flex:1; min-width:0; }
.event-text > strong,.event-text > small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.event-text > strong { font-size:.86rem; }
.event-text > small,.event-date { font-size:.76rem; color:var(--muted); }
.event-text > small { margin-top: 4px; }
.event-date { white-space: nowrap; }
.meter-list { padding: 7px 16px 18px; }
.property-meter + .property-meter { margin-top:16px; }
.property-meter > div:first-child { display:flex; gap:8px; align-items:baseline; justify-content:space-between; margin-bottom:7px; font-size:.83rem; }
.property-meter small { color:var(--muted); white-space:nowrap; }
.meter { height:7px; background: #edf2ed; overflow:hidden; border-radius:6px; }
.meter span { height:100%; display:block; border-radius:6px; background:#729d7e; }
.table-wrap { overflow:auto; width:100%; scrollbar-width:thin; }
table { border-collapse:collapse; width:100%; text-align:left; font-size:.88rem; }
th { color: #42594a; background: #f1f5f0; font-size:.78rem; font-weight:680; white-space:nowrap; }
td,th { padding: 11px 13px; border-top: 1px solid #e6ece6; line-height:1.35; }
td:first-child,th:first-child { padding-left:16px; }
td:last-child,th:last-child { padding-right:16px; }
td > strong,td > small { display:block; }
td > small { font-size:.74rem; color:var(--muted); margin-top:4px; }
tbody tr:hover { background:#fcfdfb; }
td:has(> .compact) { padding-top: 3px; padding-bottom: 3px; }
.numeric { font-variant-numeric: tabular-nums; white-space:nowrap; }
.subtle { color:var(--muted); }
.badge { display:inline-block; padding:4px 7px; border-radius:5px; font-size:.73rem; font-weight:650; white-space:nowrap; }
.badge.green { background:#e7f2e8; color:#305f42; }
.badge.rose { background:#f9eae7; color:#884534; }
.badge.amber { background:#fbf0df; color:#77521c; }
.badge.blue { background:#e8eff5; color:#355b70; }
.badge.neutral { background:#eef1ee; color:#53655a; }
.empty { padding: 29px 14px 33px; text-align:center; color:var(--muted); display:grid; justify-items:center; gap:7px; font-size:.86rem; }
.empty .icon { margin-bottom:3px; color:#648875; width:24px; height:24px; }
.empty strong { color:#4d6456; font-weight:620; }
.list-toolbar { min-height:63px; display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 15px; color:var(--muted); font-size:.875rem; }
.search { display:flex; align-items:center; gap:7px; border:1px solid var(--line); border-radius:7px; padding:0 8px; color:var(--muted); min-width:0; }
.search .icon { width:15px; height:15px; }
.search input { padding:7px 2px; min-width:0; width:clamp(110px,19vw,245px); border:0; color:var(--ink); background:transparent; font-size:.87rem; }
.tabs { display:flex; gap:8px; padding: 12px 14px 0; overflow:auto; }
.tab { background:none; color:var(--muted); border:0; border-bottom:2px solid transparent; font-size:.88rem; padding:9px 6px 11px; white-space:nowrap; }
.tab.current { color:var(--green); border-color:#48785b; font-weight:720; }
.settings-row { display:flex; align-items:center; gap:11px; padding: 18px 16px; }
.settings-row .button { margin-left:auto; }
.settings-row p { font-size:.85rem; color:var(--muted); margin-top:4px; }
.hero-icon { width:37px; height:37px; }
.report-controls { display:flex; flex-wrap:wrap; gap:12px; padding:14px; align-items:end; }
.report-controls label { display:grid; gap:6px; color:var(--muted); font-size:.83rem; }
select:not(#company-picker),.field input,.field textarea,.report-controls input { border:1px solid #cfdbd1; border-radius:7px; padding:9px 10px; min-height:42px; color:var(--ink); background:#fff; width:100%; }
select:not(#company-picker) { appearance:none; padding-right:29px; background-image: linear-gradient(45deg,transparent 50%,#597266 50%),linear-gradient(135deg,#597266 50%,transparent 50%); background-position: calc(100% - 14px) 52%,calc(100% - 9px) 52%; background-size:5px 5px; background-repeat:no-repeat; }
.initial { min-height:80vh; display:grid; place-content:center; text-align:center; justify-items:center; gap:13px; padding:24px; }
.initial h1 { font-size:1.8rem; }
.initial p { color:var(--muted); }
dialog { padding:0; width:min(760px,calc(100vw - 28px)); max-height:calc(100dvh - 34px); border:1px solid #d0ded3; border-radius:14px; box-shadow:0 20px 55px #15291e33; color:var(--text); background:var(--surface); overflow:auto; }
dialog::backdrop { background:#172b23a2; }
.dialog-head { position:sticky; z-index:1; top:0; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 16px 12px 20px; background:var(--surface); border-bottom:1px solid var(--line); }
.dialog-body { padding: 17px 20px 20px; }
.dialog-foot { position:sticky; z-index:1; bottom:0; background:white; display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; border-top:1px solid var(--line); padding:12px 16px; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px 12px; }
.field { display:grid; align-content:start; gap:5px; color:var(--text); font-size:.9rem; font-weight:620; min-width:0; }
.field input,.field select,.field textarea { font-weight:400; line-height:1.32; }
.field textarea { resize:vertical; }
.wide { grid-column: 1 / -1; }
.form-note,.billing-preview { padding:10px 12px; border-radius:8px; background:#eef5ef; color:#355642; font-size:.88rem; line-height:1.45; margin-bottom:13px; }
.billing-preview { margin:0; }
.error { padding:9px 11px; margin-bottom:12px; border-radius:8px; background:#faedea; color:#873c2d; font-size:.88rem; }
.line-editor { border-top:1px solid var(--line); margin-top:2px; padding-top:12px; }
.line-editor h3 { margin-bottom:8px; }
.line-editor p { margin:0 0 10px; font-size:.84rem; color:var(--muted); }
.line-row { display:grid; grid-template-columns:minmax(105px,1.05fr) minmax(75px,1fr) minmax(85px,.6fr) 34px; gap:8px; align-items:end; margin-bottom:8px; }
.line-row.journal-line { grid-template-columns:minmax(105px,1.1fr) minmax(75px,1fr) minmax(70px,.48fr) minmax(70px,.48fr) 34px; }
.line-remove { margin-bottom:2px; }
.check-field { display:flex; gap:6px; align-items:center; font-size:.9rem; }
.check-field input { accent-color:var(--green); }
.facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px 12px; margin:0 0 14px; }
.facts > div { padding:8px 0; border-bottom:1px solid var(--line); min-width:0; }
.facts dt { color:var(--muted); margin-bottom:4px; font-size:.78rem; }
.facts dd { margin:0; font-weight:610; overflow-wrap:anywhere; font-size:.89rem; white-space:pre-wrap; }
.detail-badge { margin-bottom:8px; }
.detail-subheading { margin:17px 0 8px; }
.detail-dialog .table-wrap { border:1px solid var(--line); border-radius:7px; }
.print-company { display:none; }
.toast { position:fixed; z-index:8; bottom:18px; right:20px; max-width:min(380px,calc(100vw - 34px)); padding:11px 15px; border-radius:9px; background:var(--nav-deep); color:white; box-shadow:0 8px 25px #233e3036; font-size:.89rem; line-height:1.4; }
@media(max-width: 1140px) {
  :root { --rail-width: 198px; }
  .kpis { gap:10px; }
  .kpi { padding: 12px 11px; }
  .dashboard-grid { grid-template-columns: minmax(0,1.45fr) minmax(0,1fr); gap:12px; }
  .dashboard-grid td,.dashboard-grid th { padding-right:8px; padding-left:8px; }
}
@media(max-width: 850px) {
  :root { --rail-width:174px; }
  .sidebar { padding-inline: 9px; }
  .kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .page-header { align-items:flex-start; }
}
@media(max-width: 640px) {
  .shell { display:block; }
  .topbar { height:56px; padding-inline:11px; }
  .top-leading,.top-trailing { gap:6px; }
  .crumb-parent,.crumb-slash { display:none; }
  .workspace-picker select { width:119px; }
  .menu-button { display:inline-grid !important; }
  .sidebar { display:none; position:fixed; z-index:4; top:56px; bottom:0; height:auto; width:min(250px,82vw); box-shadow: 6px 8px 27px #233d302e; }
  .sidebar.expanded { display:flex; }
  .brand { margin-bottom:18px; }
  .page-header { flex-direction:column; gap:9px; margin-bottom:16px; }
  .actions { justify-content:flex-start; }
  main { padding-top:20px; }
  .kpi { min-height:111px; }
  .welcome { flex-wrap:wrap; }
  .welcome .button { margin-left:0; }
  .settings-row { flex-wrap:wrap; }
  .facts { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width: 500px) {
  .demo-chip { display:none; }
  .form-grid { gap:10px; }
  .line-row,.line-row.journal-line { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 7px 0; border-bottom:1px solid var(--line); }
  .line-remove { justify-self:end; }
  .dialog-body { padding:12px; }
  .dialog-foot { padding:8px; }
}
@media print {
  @page { size: 8.5in 13in; margin: .55in; }
  body,html { background:white; overflow:visible; color:black; }
  #app,.skip-link,.toast,dialog::backdrop,.dialog-foot,.dialog-head .icon-button,.document button { display:none !important; }
  dialog[open] { display:block; position:static; width:100%; margin:0; max-height:none; border:0; box-shadow:none; overflow:visible; }
  .dialog-head { position:static; padding:0 0 12px; }
  .dialog-body { padding:10px 0; }
  .print-company { display:flex; align-items:baseline; gap:12px; margin-bottom:10px; }
  .print-company span { color:var(--muted); font-size:.82rem; }
  .table-wrap { overflow:visible; }
  tr,.facts > div { break-inside:avoid; }
}
