:root {
  --bg: #f7f4ee;
  --surface: #fffdfa;
  --surface-2: #f2eee6;
  --line: #ded8cc;
  --line-soft: #ebe6dd;
  --text: #20231f;
  --muted: #77786f;
  --accent: #2f6f5b;
  --accent-soft: #e7f0eb;
  --positive: #2f6f5b;
  --negative: #a34f4f;
  --shadow: 0 10px 28px rgba(54, 47, 36, .06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app { display: grid; grid-template-columns: 190px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 26px 18px; background: rgba(255,253,250,.82); position: sticky; top: 0; height: 100vh; }
.brand { padding: 2px 10px 34px; }
.brand b { display: block; font-size: 17px; letter-spacing: .2em; font-weight: 750; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; }
.brand-tagline { margin-top: 15px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.nav a { display: block; color: var(--muted); text-decoration: none; padding: 9px 10px; border-radius: 12px; margin: 2px 0; font-size: 13px; }
.nav a.active { color: var(--text); background: var(--surface-2); font-weight: 650; }
.nav a:hover { color: var(--text); background: #f5f1e9; }
.side-foot { position: absolute; left: 28px; right: 18px; bottom: 24px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.main { padding: 36px clamp(22px, 4vw, 62px); max-width: 1380px; width: 100%; }
.top { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 30px; }
.eyebrow { font-size: 10px; letter-spacing: .17em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
h1 { font-size: clamp(30px, 3.4vw, 43px); line-height: 1.05; margin: 8px 0 7px; letter-spacing: -.045em; font-weight: 650; }
h2 { margin: 0 0 14px; font-size: 16px; letter-spacing: -.01em; font-weight: 650; }
.muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 28px; }
.card { background: transparent; border: 0; border-radius: 12px; padding: 22px 0; box-shadow: none; border-top: 1px solid var(--line); }
.span3 { grid-column: span 3; }
.span4 { grid-column: span 4; }
.span5 { grid-column: span 5; }
.span6 { grid-column: span 6; }
.span7 { grid-column: span 7; }
.span8 { grid-column: span 8; }
.span12 { grid-column: span 12; }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.metric-item { padding: 18px 20px 18px 0; border-right: 1px solid var(--line-soft); }
.metric-item:not(:first-child) { padding-left: 20px; }
.metric-item:last-child { border-right: 0; }
.metric { font-size: 27px; font-weight: 650; letter-spacing: -.045em; margin-top: 6px; }
.metric-label { font-size: 10px; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
.positive { color: var(--positive); }
.negative { color: var(--negative); }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; margin-bottom: 2px; }
.list { display: grid; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.row:last-child { border-bottom: 0; }
.click { cursor: pointer; }
.click:hover { background: linear-gradient(90deg, rgba(47,111,91,.035), transparent); }
.pill { padding: 4px 8px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 10px; text-transform: capitalize; }
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; padding: 9px 13px; font-size: 12px; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--text); color: #fffdfa; border-color: var(--text); font-weight: 650; }
.btn.primary:hover { opacity: .9; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tablehead { display: grid; grid-template-columns: 1.7fr 1fr 1fr .7fr; gap: 10px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 0 0 9px; border-bottom: 1px solid var(--line); }
.tx { display: grid; grid-template-columns: 1.7fr 1fr 1fr .7fr; gap: 10px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.tx:last-child { border-bottom: 0; }
.amount { text-align: right; font-weight: 650; }
.form { display: grid; gap: 10px; }
.form label { font-size: 10px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.form input, .form select { width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); outline: none; }
.form input:focus, .form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,111,91,.08); }
.modal { position: fixed; inset: 0; background: rgba(32,35,31,.28); display: grid; place-items: center; padding: 20px; z-index: 5; }
.modalbox { width: min(500px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; box-shadow: var(--shadow); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.loginbox { width: min(410px, 100%); padding: 42px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); }
.loginbrand { font-size: 24px; letter-spacing: .2em; font-weight: 750; }
.login-tagline { margin: 7px 0 28px; font-size: 15px; line-height: 1.5; }
.signature { color: var(--muted); font-size: 11px; margin-top: 24px; line-height: 1.5; }
.mobilebar { display: none; }
.insight { border-left: 2px solid var(--accent); padding: 3px 0 3px 14px; }
.empty { text-align: center; padding: 32px 0; color: var(--muted); }
.bar { height: 5px; background: var(--surface-2); border-radius: 12px; overflow: hidden; margin: 10px 0; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

@media (max-width: 900px) {
  .app { display: block; }
  .side { display: none; }
  .main { padding: 24px 18px 88px; }
  .span3, .span4, .span5, .span6, .span7, .span8 { grid-column: span 12; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric-item { padding: 15px 14px 15px 0; }
  .metric-item:nth-child(2n) { border-right: 0; padding-left: 14px; }
  .top { align-items: flex-start; }
  .top .btn { white-space: nowrap; }
  .tablehead { display: none; }
  .tx { grid-template-columns: 1fr auto; }
  .tx .hide-m { display: none; }
  .mobilebar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 62px; background: rgba(255,253,250,.96); border-top: 1px solid var(--line); z-index: 4; justify-content: space-around; align-items: center; }
  .mobilebar a { color: var(--muted); text-decoration: none; font-size: 10px; }
  .mobilebar a.active { color: var(--accent); font-weight: 700; }
}
