:root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1b3031;
  background: #f5f7f4;
  font-synthesis: none;
  --ink: #193235;
  --muted: #526865;
  --line: #dce5de;
  --teal: #14634f;
  --pale: #e4f3eb;
  --sidebar: #152d32;
  --surface: #fff;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  outline: 3px solid #438b76;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 237px minmax(0, 1fr);
}
.sidebar {
  background: var(--sidebar);
  color: #d9e6e1;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 29px 19px 22px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 45px 7px;
  text-decoration: none;
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #fff;
}
.brand small {
  display: block;
  font-size: 12px;
  color: #a7c4bf;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-top: 6px;
}
.mark {
  display: grid;
  place-items: center;
  background: #b2e6c8;
  color: #173932;
  border-radius: 12px;
  width: 40px;
  height: 40px;
  font-size: 24px;
  line-height: 1;
}
nav {
  display: grid;
  gap: 6px;
}
nav a {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 8px;
  text-decoration: none;
  min-height: 43px;
}
nav a span {
  width: 19px;
  text-align: center;
  font-weight: 650;
  font-size: 18px;
  color: #a9d0c1;
}
nav a:hover,
nav a[aria-current='page'] {
  background: #29464a;
  color: #fff;
}
nav a[aria-current='page'] {
  font-weight: 650;
}
.local {
  margin: auto 4px 0 7px;
  color: #acc6bf;
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.local > [aria-hidden] {
  width: 7px;
  height: 7px;
  background: #90d3ad;
  border-radius: 50%;
}
main {
  width: 100%;
  max-width: 1480px;
  padding: 35px clamp(22px, 4vw, 57px) 60px;
  margin: 0 auto;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 26px;
}
.context {
  font-size: 13px;
  color: var(--teal);
  font-weight: 650;
  margin-bottom: 7px;
}
h1 {
  font-size: clamp(34px, 4.3vw, 51px);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1.03;
  margin: 0;
  color: var(--ink);
}
h2 {
  font-size: 20px;
  letter-spacing: -0.025em;
  margin: 0;
}
h3 {
  margin: 0;
  font-size: 16px;
}
p {
  line-height: 1.5;
}
.top-actions,
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.top-actions label {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
  gap: 5px;
  padding: 8px 13px;
  border: 1px solid #cbd9d2;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.button:hover {
  background: #edf4ee;
}
.button.primary {
  background: #165946;
  border-color: #165946;
  color: #fff;
}
.button.primary:hover {
  background: #104b3a;
}
.button:disabled {
  opacity: 0.65;
  cursor: wait;
}
.button.small {
  min-height: 33px;
  font-size: 12px;
  padding: 5px 9px;
}
.subtle {
  font-size: 13px;
  color: var(--muted);
}
input,
select,
textarea {
  min-width: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd9d2;
  border-radius: 7px;
  padding: 7px 9px;
}
input[type='month'] {
  min-height: 38px;
}
textarea {
  resize: vertical;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.metric,
.panel,
.invoice-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.metric {
  min-height: 136px;
  padding: 17px 16px;
}
.metric:first-child {
  background: #e4f4e9;
  border-color: #d1e9d8;
}
.metric-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #39534f;
  font-weight: 650;
  font-size: 13px;
}
.metric-label span {
  min-width: 20px;
  color: var(--teal);
  font-size: 16px;
}
.metric strong {
  display: block;
  font-size: clamp(19px, 2.25vw, 31px);
  margin: 12px 0 2px;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
.metric small {
  color: var(--muted);
  font-size: 12px;
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
}
.stack {
  display: grid;
  gap: 16px;
  align-content: start;
}
.columns + .stack {
  margin-top: 16px;
}
.panel {
  padding: 18px;
  min-width: 0;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
.panel-head .subtle {
  margin: 4px 0 0;
}
.empty {
  color: var(--muted);
  background: #f5f8f5;
  border: 1px dashed #d4e0d8;
  padding: 16px;
  border-radius: 9px;
  font-size: 14px;
}
.empty p {
  margin: 0 0 10px;
}
.empty p:last-child {
  margin-bottom: 0;
}
.rows {
  list-style: none;
  padding: 0;
  margin: 0;
}
.rows li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #e9eeea;
  padding: 11px 0;
}
.rows li:last-child {
  padding-bottom: 0;
}
.details {
  min-width: 0;
  overflow-wrap: anywhere;
}
.details strong {
  display: block;
  font-size: 14px;
}
.details small {
  color: var(--muted);
  font-size: 12px;
}
.amount {
  white-space: nowrap;
  font-weight: 660;
  font-variant-numeric: tabular-nums;
}
.positive {
  color: #165946;
}
.bars {
  display: grid;
  gap: 12px;
}
.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 4px;
}
meter {
  width: 100%;
  height: 11px;
  display: block;
  appearance: none;
}
meter::-webkit-meter-bar {
  background: #eaf0ea;
  border: 0;
  border-radius: 7px;
}
meter::-webkit-meter-optimum-value {
  background: #31846a;
  border-radius: 7px;
}
meter.out::-webkit-meter-optimum-value {
  background: #ba7b53;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
td,
th {
  border-bottom: 1px solid #e9eeea;
  padding: 10px 8px;
  vertical-align: middle;
}
tr:last-child td {
  border: 0;
}
td:last-child,
th:last-child {
  text-align: right;
}
td:first-child,
th:first-child {
  padding-left: 0;
}
td:last-child,
th:last-child {
  padding-right: 0;
}
.badge {
  font-size: 12px;
  border-radius: 20px;
  padding: 3px 8px;
  background: #eef2ef;
  color: #3d5650;
  display: inline-block;
}
.badge.good {
  background: #e0f3e7;
  color: #13523e;
}
.badge.warn {
  background: #f9eadc;
  color: #754522;
}
.invoice-list {
  display: grid;
  gap: 11px;
}
.invoice-card {
  padding: 15px;
}
.invoice-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.invoice-head p {
  margin: 3px 0;
}
.invoice-card .actions {
  margin-top: 11px;
}
.attachments {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 9px;
}
.connect-url {
  font-size: 13px;
  font-weight: 650;
  color: var(--teal);
  text-underline-offset: 3px;
}
.notice {
  border: 1px solid #bcdac7;
  background: #e7f5eb;
  padding: 10px 13px;
  border-radius: 8px;
  font-size: 14px;
  margin: -7px 0 17px;
}
.notice.error,
.form-error {
  color: #7c2b22;
  background: #fdf0e9;
  border-color: #f2d5cc;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  max-height: 92vh;
  width: min(520px, calc(100% - 22px));
  padding: 19px;
  color: var(--ink);
  box-shadow: 0 20px 90px #17313044;
}
dialog::backdrop {
  background: #10282580;
}
.dialog-header,
dialog footer {
  display: flex;
  justify-content: space-between;
  gap: 9px;
  align-items: center;
}
.close {
  border: 0;
  background: transparent;
  font-size: 27px;
  cursor: pointer;
  color: var(--ink);
}
dialog footer {
  justify-content: flex-end;
  margin-top: 16px;
}
.fields {
  display: grid;
  gap: 11px;
  margin-top: 12px;
}
.fields label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 620;
}
.fields .checkbox {
  display: flex;
  align-items: center;
  font-weight: 500;
}
.fields input:not([type='checkbox']),
.fields select,
.fields textarea {
  width: 100%;
}
.fields p {
  margin: 0;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}
.form-error {
  padding: 9px;
  border-radius: 6px;
  font-size: 13px;
}
@media (max-width: 1050px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .shell {
    grid-template-columns: 194px minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 13px 12px 9px;
  }
  .brand {
    font-size: 20px;
    margin: 0 0 10px 4px;
  }
  .mark {
    width: 31px;
    height: 31px;
  }
  .brand small {
    display: none;
  }
  nav {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
  }
  nav a {
    flex: none;
    font-size: 12px;
    gap: 4px;
    padding: 4px 8px;
    min-height: 31px;
  }
  nav a span {
    font-size: 13px;
    width: 14px;
  }
  .local {
    display: none;
  }
  main {
    padding: 20px 12px 36px;
  }
  .columns {
    grid-template-columns: minmax(0, 1fr);
  }
  .top {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 15px;
  }
  .top-actions {
    width: 100%;
    justify-content: space-between;
  }
  .metrics {
    gap: 8px;
    margin-bottom: 12px;
  }
  .metric {
    min-height: 113px;
    padding: 11px;
  }
  .panel {
    padding: 12px;
  }
}

.linked-connections,
.connection-help {
  margin-top: 18px;
}
.connection-help summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--teal);
}
#connection-dialog {
  width: min(610px, calc(100% - 22px));
}
#connection-frame {
  display: block;
  width: 100%;
  height: min(590px, 68vh);
  border: 0;
}

.autonf-review {
  display: grid;
  grid-template-columns: minmax(95px, 1fr) 2fr;
  gap: 4px 12px;
  margin: 0;
  font-size: 14px;
}
.autonf-review dt {
  font-weight: 650;
}
.autonf-review dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.autonf-operation-fields {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
}
.autonf-operation-fields summary {
  cursor: pointer;
  font-weight: 650;
}
.autonf-operation-fields label {
  margin-top: 7px;
}

.access-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 22px;
  background: radial-gradient(circle at 40% 15%, #204952, #14272d 65%);
}
.access-card {
  width: min(100%, 430px);
  padding: clamp(24px, 6vw, 38px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 55px #080f1245;
}
.access-card .brand {
  color: #173b41;
  width: max-content;
  margin-bottom: 28px;
}
.access-card .brand small {
  color: #4d6869;
}
.access-card h1 {
  font-size: 34px;
  line-height: 1.1;
}
.access-card p {
  color: #405959;
  line-height: 1.55;
}
.access-card #sign-in {
  width: 100%;
  min-height: 46px;
}
.access-setup {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.access-setup summary {
  cursor: pointer;
  color: #28545d;
}
.access-setup form {
  margin-top: 12px;
  display: grid;
  gap: 9px;
}
.access-setup label {
  font-size: 14px;
}
.access-status {
  background: #edf5f4;
  margin-block: 12px 0;
  border-radius: 8px;
  padding: 9px 12px;
}
.sidebar .session-action {
  align-self: flex-start;
  margin-top: 8px;
}
