:root {
  color-scheme: dark;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: #172521;
  font-synthesis: none;
  --text: #f0f4ef;
  --muted: #b9c9c1;
  --line: #3c5149;
  --accent-text: #c8dfb2;
  --red: #f0a39d;
  --amber: #efc692;
  --nav: #15231f;
  --accent: #b9d3a3;
  --display-font: "Cormorant Garamond", Georgia, serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(ellipse at top left, #91a87122, transparent 38%),
    radial-gradient(ellipse at top right, #749ca126, transparent 46%),
    #172521;
}
button, input, select { font: inherit; }
button, a, select { touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--accent-text); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid #d9ebcd; outline-offset: 3px; }
[hidden] { display: none !important; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: auto 1fr; }
.sidebar { background: var(--nav); color: #f0f4ef; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 20px; overflow: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 9px; margin-bottom: 37px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border: 1px solid #78946c; border-radius: 12px; color: #c7deb5; font-family: var(--display-font); font-size: 27px; }
.brand strong, .brand span { display: block; }
.brand strong { font-family: var(--display-font); font-weight: 700; font-size: 27px; letter-spacing: -.02em; line-height: 1.1; }
.brand span { color: #b9c9c1; margin-top: 4px; font-size: 11px; letter-spacing: .22em; }
.side-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 9px 10px; color: #b9c9c1; font-size: 12px; letter-spacing: .11em; }
.side-heading strong { color: #e1e9d7; letter-spacing: .01em; font-size: 13px; }
#periods { display: grid; gap: 2px; }
.period { color: #e2ebe5; width: 100%; border: 1px solid transparent; border-radius: 8px; padding: 7px 10px; display: flex; justify-content: space-between; align-items: center; min-height: 33px; background: transparent; text-align: left; text-decoration: none; font-size: 14px; }
.period:hover { background: #263c34; color: white; }
.period[aria-current] { background: #2d4538; color: #f1f8eb; border-color: #8da983; font-weight: 650; }
.period:first-child { margin-bottom: 7px; }
.period small { font-size: 11px; color: #b9c9c1; font-variant-numeric: tabular-nums; }
.sidebar-footer { margin-top: auto; border-top: 1px solid #3c5149; padding: 15px 9px 0; display: grid; gap: 5px; }
.sidebar-footer span { color: #b9c9c1; font-size: 11px; letter-spacing: .12em; }
.sidebar-footer strong { font-size: 14px; }
.sidebar-footer small { color: #b9c9c1; font-weight: 400; }
main { min-width: 0; width: 100%; max-width: 1620px; margin: 0 auto; padding: 0 clamp(18px, 3.1vw, 50px); }
.page-top { padding: 25px 0 19px; border-bottom: 1px solid #3c5149; display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.page-path span { margin: 0 7px; color: #91aa9b; }
.page-path strong { color: #d9ebcd; font-weight: 650; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 28px 0 22px; }
h1 { font-family: var(--display-font); margin: 0; font-size: clamp(36px, 4.8vw, 61px); letter-spacing: -.025em; font-weight: 600; line-height: 1.03; }
.hero p { color: var(--muted); margin: 10px 0 0; }
.bank-filter { display: flex; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); background: #22352f; padding: 3px; border-radius: 9px; gap: 2px; width: fit-content; }
.bank-filter button { border: 1px solid transparent; border-radius: 6px; padding: 8px 9px; background: transparent; color: #c1d2c8; font-size: 14px; white-space: nowrap; }
.bank-filter button[aria-pressed="true"] { background: #c7deb5; color: #15241b; border-color: var(--accent); font-weight: 650; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { background: #22352f; border: 1px solid var(--line); padding: 17px 15px 15px; min-height: 122px; border-radius: 12px; display: flex; flex-direction: column; gap: 7px; }
.metric:first-child { background: #30483c; border-color: #30483c; color: white; }
.metric:first-child .metric-label, .metric:first-child small { color: #d8e8d9; }
.metric-label { font-size: 14px; color: #d1dfd6; }
.metric strong { display: block; font-size: clamp(19px, 2.15vw, 30px); font-variant-numeric: tabular-nums; letter-spacing: -.045em; white-space: nowrap; }
.metric small { color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: auto; }
.metric-note, .notice { font-size: 13px; line-height: 1.55; }
.metric-note { margin: 11px 0 21px; color: var(--muted); }
.notice { padding: 13px 15px; background: #35271c; border: 1px solid #7c5730; border-radius: 8px; color: #f6d4a5; margin: 0 0 15px; }
.panel { background: #1b2c28; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; box-shadow: 0 12px 36px #0000002e; }
.panel-nav { display: flex; gap: 22px; padding: 0 21px; border-bottom: 1px solid var(--line); overflow: auto; }
.panel-nav button { padding: 15px 1px 13px; background: none; border: 0; border-bottom: 2px solid transparent; white-space: nowrap; color: #b9c9c1; font-size: 14px; }
.panel-nav button[aria-pressed="true"] { border-color: var(--accent); font-weight: 700; color: #d9ebcd; }
.view-header { padding: 18px 21px 14px; display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; }
h2 { font-family: var(--display-font); font-weight: 700; letter-spacing: -.01em; font-size: 25px; margin: 0; }
.view-header p, .secondary { color: var(--muted); font-size: 13px; margin: 6px 0 0; line-height: 1.5; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters input, .filters select, .file-action { border: 1px solid #50685d; border-radius: 7px; background: #1b2c27; padding: 8px 10px; color: #f0f4ef; font-size: 14px; min-height: 39px; }
.filters input { width: min(220px, 65vw); }
.file-action { font-weight: 600; }
.delete-file { background: none; border: 0; color: var(--red); padding: 5px; text-decoration: underline; }
.scroll-table { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
thead { background: #2a3e37; }
th { color: #dbe9df; white-space: nowrap; font-weight: 650; }
td, th { padding: 10px 12px; border-bottom: 1px solid #3d514a; }
td:first-child, th:first-child { padding-left: 21px; }
td:last-child, th:last-child { padding-right: 21px; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #293e36; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.positive { color: #afe2c5; }
.negative { color: var(--red); }
.subdued { color: var(--muted); }
.nowrap { white-space: nowrap; }
.chip { background: #223a36; color: #afe2c5; border-radius: 5px; padding: 3px 6px; display: inline-block; font-size: 12px; white-space: nowrap; }
.chip.pending { background: #44311e; color: #f7d39d; }
.description { min-width: 230px; }
.description small { display: block; margin-top: 4px; line-height: 1.4; color: var(--muted); }
.documents { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); gap: 12px; padding: 0 21px 21px; }
.doc-bank { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #233631; }
.doc-bank h3 { font-size: 16px; margin: 0; }
.doc-bank ul { list-style: none; padding: 0; margin: 12px 0 0; }
.doc-bank li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }
.doc-bank li small { display: block; color: var(--muted); margin-top: 3px; }
.doc-bank .file-action { margin-top: 11px; }
.empty { padding: 22px; color: var(--muted); font-size: 14px; margin: 0; }
.footer { display: flex; justify-content: space-between; gap: 10px; padding: 19px 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 2; background: var(--nav); color: white; border-radius: 8px; padding: 12px 16px; max-width: min(420px, 90vw); }
@media (max-width: 1080px) {
  .layout { grid-template-columns: 184px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .metric { padding-inline: 11px; }
}
@media (max-width: 800px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; padding: 13px 15px 10px; overflow: visible; }
  .brand { margin-bottom: 11px; }
  .brand-mark { width: 33px; height: 33px; flex-basis: 33px; font-size: 21px; border-radius: 8px; }
  .brand strong { font-size: 23px; }
  .brand span { font-size: 9px; }
  .side-heading, .sidebar-footer, .period small { display: none; }
  #periods { display: flex; gap: 5px; overflow: auto; padding: 4px; }
  .period { white-space: nowrap; width: auto; border-color: #3c5149; }
  .period:first-child { margin: 0; }
}
@media (max-width: 600px) {
  .hero { align-items: flex-start; flex-direction: column; padding-top: 22px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { min-height: 109px; }
  .metric strong { font-size: clamp(19px, 5vw, 26px); }
  .page-top { padding-top: 16px; font-size: 12px; }
  .panel-nav { gap: 17px; padding: 0 15px; }
  .view-header, .documents { padding-inline: 15px; }
  .footer { flex-direction: column; }
}

#sidebar-menu { display: grid; gap: 8px; padding-bottom: 18px; }
#sidebar-menu .nav-link { margin: 0; width: 100%; min-height: 40px; border-color: #3c5149; font-weight: 650; }
#sidebar-menu .nav-link[aria-current] { border-color: #91ad86; }
.nav-group { border: 1px solid #3c5149; border-radius: 9px; }
.nav-group summary { padding: 9px 10px; min-height: 38px; color: #e5efe8; font-weight: 650; font-size: 14px; cursor: pointer; }
.nav-group summary::marker { color: #b9d3a3; }
.nav-items, #periods { display: grid; gap: 2px; padding: 0 5px 5px; }
.nav-items .period { margin-bottom: 0; }
.doc-controls { margin-top: 12px; }
.doc-controls .file-action { margin: 0; }
.doc-link { border: 0; background: none; color: var(--accent-text); padding: 0; text-align: left; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
#pdf-dialog { background: #1b2c28; width: min(1050px, calc(100% - 24px)); height: min(880px, calc(100% - 24px)); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line); border-radius: 12px; color: inherit; overflow: hidden; }
#pdf-dialog[open] { display: flex; flex-direction: column; }
#pdf-dialog::backdrop { background: #101e19e0; }
.pdf-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pdf-header h2 { overflow-wrap: anywhere; font-size: 17px; }
.pdf-actions { display: flex; align-items: stretch; gap: 8px; }
.pdf-actions a { text-decoration: none; }
#pdf-frame { width: 100%; flex: 1; min-height: 0; border: 0; background: #1b2b25; }
@media (max-width: 800px) {
  #sidebar-menu { padding-bottom: 0; }
  .nav-items .period { width: 100%; white-space: normal; }
  #periods { grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); }
}

.metric-action {
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  align-items: flex-start;
}
.metric-action:hover { box-shadow: inset 0 0 0 1px #91ad86; }
.metric-action[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #b9d3a3; }
.metric-action:first-child[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #d9ebcd; }

@media (min-width: 950px) {
  .metrics:has([data-metric-view="pending"]) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1320px) {
  .metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .metric strong { font-size: clamp(20px, 1.95vw, 30px); }
}
@media (min-width: 601px) and (max-width: 1319px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.calculation-table td:last-child { font-weight: 650; }
.calculation-table tfoot { background: #2b443b; font-weight: 700; }

.calculation-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 21px 21px 0;
}
.calculation-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 156px;
  padding: clamp(16px, 2vw, 25px);
  border: 1px solid #40594e;
  border-radius: 12px;
  background: #263b34;
  color: #f0f4ef;
}
.calculation-card h2 { margin: 0; font-size: 1.25rem; }
.calculation-card strong { font-size: clamp(1.5rem, 2.1vw, 2.4rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.calculation-card strong span { font-size: .45em; white-space: nowrap; }
.calculation-card p { margin: auto 0 0; color: #bacdc2; font-size: .875rem; }
.calculation-result { border-color: #89a180; background: #30483c; color: var(--text); }
.calculation-result p { color: #d8e8d9; }
.hero-calculations { align-items: center; }
.calculation-due {
  width: min(100%, 280px);
  min-height: 0;
  flex-shrink: 0;
  border-color: #a7c7a8;
  background: #d7f1d6;
  box-shadow: 0 8px 22px #00000050;
  color: #183828;
}
.calculation-due strong #calculation-due-value { font-size: inherit; }
.calculation-due p { margin: 0; color: #355740; }
@media (max-width: 1100px) {
  .calculation-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .calculation-cards { grid-template-columns: 1fr; gap: 10px; padding: 15px 15px 0; }
  .calculation-card { min-height: 0; }
  .hero-calculations { align-items: flex-start; }
  .calculation-due { align-self: flex-end; }
}

.cost-table tfoot, .cost-month-selected { background: #2b443b; }
.cost-table td:nth-child(2), .cost-table tfoot { font-weight: 700; }
.cost-detail { border-top: 1px solid var(--line); margin-top: 10px; }

.calculation-otc { border-top: 1px solid var(--line); }
.calculation-otc summary { padding: 15px 21px; cursor: pointer; font-weight: 650; }

.calculation-payouts { margin: 21px 21px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.calculation-payouts .view-header { padding-block: 13px; }
@media (max-width: 600px) {
  .calculation-payouts { margin: 15px 15px 0; }
}

.settlement-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 21px; }
.settlement-payout { width: 100%; font: inherit; text-align: left; }
.settlement-payout:hover, .settlement-payout[aria-expanded="true"] { border-color: #a4bd93; background: #344d42; }
.settlement-payout-label { font-size: 1rem; font-weight: 700; }
.settlement-payout-caption { margin-top: auto; color: #bacdc2; font-size: .875rem; }
.settlement-due { border-color: #a7c7a8; background: #d7f1d6; color: #183828; }
.settlement-due p { color: #355740; }
#settlement-transfers { border-top: 1px solid var(--line); }
@media (max-width: 600px) {
  .settlement-summary { grid-template-columns: 1fr; padding: 15px; }
}

/* Portal header */
.portal-banner {
  --banner-height: clamp(136px, 23.5vw, 590px);
  grid-column: 1 / -1;
  height: var(--banner-height);
  border-bottom: 1px solid var(--line);
  background: #172521;
  position: relative;
}
.portal-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .84;
  background:
    linear-gradient(180deg, transparent 58%, #17252142),
    url("brand/bear-and-forest.png") center bottom / max(100%, calc(var(--banner-height) * 2.83)) auto no-repeat;
}
.portal-logo {
  display: block;
  width: min(100%, 206px);
  height: auto;
  margin: 2px 0 22px;
  filter: grayscale(1) invert(1);
  mix-blend-mode: screen;
}
.page-top { align-items: center; padding-block: 16px; }
@media (max-width: 800px) {
  .portal-logo { width: min(56vw, 185px); margin-bottom: 14px; }
}
