@font-face {
  font-family: Inter;
  src: url('/assets/inter.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --canvas: #f6f4f8;
  --paper: #fff;
  --ink: #241e31;
  --muted: #675e75;
  --border: #e4ddeb;
  --accent: #652bdf;
  --accent-hover: #541fc6;
  --focus: #7948db;
  --quiet: #f0eafb;
  --sidebar: #211735;
  --sidebar-light: #dfd6ee;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  color-scheme: light;
  background: var(--canvas);
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 2.6vw, 2.125rem); line-height: 1.22; letter-spacing: -.043em; }
h2 { font-size: 1rem; line-height: 1.35; letter-spacing: -.014em; }
button, input { font: inherit; color: inherit; }
a { color: var(--accent-hover); }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .62; cursor: wait; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
svg { flex: 0 0 auto; display: block; }

.skip {
  position: fixed; z-index: 3; top: 10px; left: 10px;
  transform: translateY(-200%); padding: 8px 12px; background: var(--paper);
  border-radius: 7px;
}
.skip:focus { transform: none; }

.workspace { display: grid; min-height: 100dvh; grid-template-columns: 232px minmax(0,1fr); }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  background: var(--sidebar); color: white; padding: 26px 14px 16px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.sidebar .brand { padding: 0 8px; }
.brand strong { display: block; font-size: 1.25rem; line-height: 1.12; letter-spacing: -.05em; }
.brand small { display: block; color: var(--muted); margin-top: 5px; font-size: .65rem; font-weight: 650; letter-spacing: .03em; }
.sidebar .brand small { color: var(--sidebar-light); }
.brand-mark {
  display: grid; position: relative; place-items: center; width: 41px; height: 41px;
  flex: 0 0 41px; border-radius: 10px; background: var(--accent); color: white;
}
.brand-mark span { position: absolute; width: 11px; height: 17px; border: 2px solid currentColor; border-radius: 6px; transform: rotate(32deg); }
.brand-mark span:first-child { margin: 3px 9px 0 0; }
.brand-mark span:last-child { margin: -3px 0 0 9px; }

.sidebar nav { display: grid; gap: 5px; margin-top: 34px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 8px 12px; border-radius: 8px; color: var(--sidebar-light);
  text-decoration: none; font-size: .9rem; font-weight: 550;
}
.sidebar nav a:hover,.sidebar nav a[aria-current="page"] { background: #3e2a5c; color: #fff; }
.sidebar nav a[aria-current="page"] { font-weight: 690; box-shadow: inset 0 0 0 1px #7650a4; }
.sidebar-footer { display: grid; gap: 8px; margin-top: auto; padding: 16px 8px 0; border-top: 1px solid #47365c; }
.sidebar-footer span { color: var(--sidebar-light); overflow-wrap: anywhere; font-size: .8rem; }
.quiet { display: flex; align-items: center; gap: 8px; padding: 0; min-height: 38px; border: 0; background: none; color: #fff; font-size: .82rem; }
.quiet:hover { text-decoration: underline; text-underline-offset: 4px; }

#main-content { width: 100%; max-width: 1470px; min-width: 0; margin-inline: auto; padding: clamp(18px, 4vw, 48px); }
#main-content:focus { outline: none; }
.page-header,.card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-header { margin-bottom: 21px; }
.period { color: var(--muted); font-size: .88rem; margin-top: 6px; }
.tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.button,.primary {
  min-height: 41px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; white-space: nowrap;
  font-size: .84rem; font-weight: 650; color: var(--ink); background: var(--paper);
}
.button:hover { border-color: #c4afd9; background: var(--quiet); }
.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.currency { display: flex; gap: 1px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: var(--paper); }
.currency button { min-height: 33px; padding: 3px 10px; border: 0; border-radius: 5px; background: transparent; font-size: .78rem; font-weight: 650; }
.currency button:hover { background: var(--canvas); }
.currency button[aria-pressed="true"] { background: var(--quiet); color: var(--accent-hover); }

.card { background: var(--paper); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 2px rgb(35 21 53 / .04); }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.metric { display: grid; align-content: start; gap: 9px; padding: clamp(13px, 2vw, 22px); min-width: 0; }
.metric > span,.treasury-total > span { color: var(--muted); font-size: .8rem; font-weight: 630; }
.metric strong { font-size: clamp(1rem,1.65vw,1.31rem); line-height: 1.3; letter-spacing: -.024em; overflow-wrap: anywhere; }
.metric strong,.treasury-total strong,td:not(:first-child) { font-variant-numeric: tabular-nums; }
.report-card { margin-top: 18px; overflow: hidden; }
.report-card > h2,.card-header { padding: 16px 18px; }
.card-header small { color: var(--muted); display: block; margin-top: 4px; font-size: .75rem; }
.treasury-total { display: grid; text-align: end; }
.treasury-total strong { font-size: 1.04rem; }
.table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
table { width: 100%; border-collapse: collapse; text-align: start; font-size: .84rem; }
table th,table td { border-top: 1px solid var(--border); padding: 11px 18px; text-align: end; white-space: nowrap; }
table th:first-child,table td:first-child { text-align: start; }
thead { background: #faf8fc; color: var(--muted); }
thead th { font-size: .76rem; font-weight: 620; }
tbody th { font-weight: 620; }
tbody a { text-decoration: none; }
tbody a:hover { text-decoration: underline; }
.status { margin: 12px 0 0; color: var(--muted); font-size: .8rem; }
.report-card .status { padding: 0 18px 16px; }
.error { margin-bottom: 12px; color: #8b1f28; font-size: .85rem; }
.muted { color: var(--muted); }
.single-stat { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 16px 18px; }
.single-stat strong { color: var(--accent-hover); font-size: 1.15rem; }

.entry { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.entry-card { width: min(100%, 405px); padding: clamp(19px, 5vw, 34px); }
.entry-card h1 { margin: 24px 0 16px; font-size: 1.35rem; }
.entry-card form { display: grid; gap: 13px; }
.entry-card label { display: grid; gap: 5px; font-size: .85rem; font-weight: 570; }
.entry-card input { min-height: 43px; width: 100%; padding: 7px 10px; border: 1px solid #bdafcf; border-radius: 8px; background: var(--paper); }
.entry-card .error { margin: 0; }
.entry-card button { margin-top: 2px; }

@media (width <= 850px) {
  .workspace { grid-template-columns: 185px minmax(0,1fr); }
  .sidebar { padding-inline: 10px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (width <= 640px) {
  .workspace { display: block; }
  .sidebar {
    position: static; height: auto; display: grid; grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas: "brand logout" "nav nav"; gap: 13px 8px; padding: 12px;
  }
  .sidebar .brand { grid-area: brand; padding: 0; }
  .sidebar .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .sidebar nav { grid-area: nav; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; margin: 0; }
  .sidebar nav a { justify-content: center; gap: 5px; padding: 6px 3px; font-size: .76rem; }
  .sidebar nav svg { width: 15px; height: 15px; }
  .sidebar-footer { grid-area: logout; align-items: center; margin: 0; padding: 0; border: 0; }
  .sidebar-footer span { display: none; }
  .quiet { font-size: .72rem; }
  .quiet svg { width: 15px; height: 15px; }
  #main-content { padding: 16px 12px 31px; }
  table th,table td { padding: 9px 12px; }
}

@media (width <= 335px) {
  .sidebar nav svg { display: none; }
  .sidebar .brand small { font-size: .56rem; }
}
