:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1d2330;
  --muted: #5b6475;
  --line: #e3e6eb;
  --accent: #2457c5;
  --pos: #1a7f45;
  --neg: #c0392b;
  --soon: #9aa1ad;
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.sidebar {
  width: 14rem;
  flex-shrink: 0;
  background: #1d2330;
  color: #fff;
  padding: 1rem 0.75rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand { color: #fff; font-weight: 700; font-size: 1.15rem; display: block; margin: 0 0.5rem 1rem; }
.sidebar nav a {
  display: block;
  color: #d5dae3;
  padding: 0.35rem 0.5rem;
  border-radius: 0.3rem;
  font-size: 0.92rem;
}
.sidebar nav a.active { background: var(--accent); color: #fff; }
.sidebar nav a.soon { color: #7f8899; }
.sidebar nav a.soon::after { content: " ·"; }
.sidebar .muted { color: #8a93a3; margin: 1rem 0.5rem 0; }
.sidebar .muted a { color: #b9c3d6; }

main { flex: 1; min-width: 0; padding: 1.25rem 1.75rem 2rem; }

.page-head { display: flex; align-items: baseline; gap: 1.5rem; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 0.75rem; font-size: 1.6rem; }
/* Data source label under the page title (T42): blue myfund, yellow mockup, violet mixed. */
.source { display: inline-block; margin: -0.25rem 0 1rem; padding: 0.3rem 0.8rem; border-radius: 0.4rem; font-size: 0.85rem; border: 1px solid transparent; }
.source-myfund { background: #e8f0fd; color: #1d4296; border-color: #c9d9f7; }
.source-mockup { background: #fff4d6; color: #8a5a00; border-color: #f2dc9e; }
.source-mixed { background: #f1ebfb; color: #5b3a96; border-color: #ddd0f3; }
.source-app { background: #eef1f5; color: var(--muted); border-color: var(--line); }

h2 { font-size: 1.1rem; margin: 1.75rem 0 0.6rem; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono { font-family: ui-monospace, monospace; font-size: 0.85rem; }
.nowrap { white-space: nowrap; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 0.75rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.8rem 1rem; }
.card span { display: block; color: var(--muted); font-size: 0.85rem; }
.card strong { display: block; font-size: 1.25rem; margin-top: 0.2rem; }
.card em { display: block; font-style: normal; font-size: 0.85rem; margin-top: 0.15rem; }
.card.soon strong, .card.soon em { color: var(--soon); }

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.charts figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.75rem; }
.charts figcaption { font-weight: 600; margin-bottom: 0.5rem; }
.charts canvas { max-height: 17rem; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); font-size: 0.86rem; width: 100%; }
th, td { padding: 0.4rem 0.55rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #eef1f5; font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tfoot td { font-weight: 600; background: #f3f5f8; }
tr.cash td, tr.receivable td { color: var(--muted); }
th.soon, td.soon { color: var(--soon); background: #f7f8fa; }

.filters { display: flex; gap: 1rem; flex-wrap: wrap; }
.filters label { font-size: 0.9rem; color: var(--muted); }
.filters select { margin-left: 0.35rem; padding: 0.2rem; }

.pager { display: flex; gap: 1.5rem; margin: 0.75rem 0; }

.placeholder { background: var(--panel); border: 1px dashed var(--line); border-radius: 0.5rem; padding: 1.25rem 1.5rem; max-width: 46rem; }
.badge { display: inline-block; background: #eef1f5; color: var(--muted); border-radius: 1rem; padding: 0.15rem 0.7rem; font-size: 0.85rem; margin: 0 0 0.75rem; }
pre { background: #1d2330; color: #e8ecf2; padding: 0.6rem 0.8rem; border-radius: 0.35rem; overflow-x: auto; }

footer { margin-top: 2rem; }

@media (max-width: 52rem) {
  body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 0.2rem; }
}

/* Mockup (T32): example data from the prototype workbook. */
.badge.mock { background: #fff4d6; color: #8a5a00; margin: 0; }
.card.mock { border-style: dashed; border-color: #e0b34a; }
.card.mock em a { color: #8a5a00; }
th.mockcol, td.mockcol { background: #fffaf0; border-left: 1px dashed #e0b34a; border-right: 1px dashed #e0b34a; }
.legend span { display: inline-block; padding: 0 0.45rem; border-radius: 0.25rem; margin-right: 0.25rem; }
th.src-myfund, .legend .src-myfund { background: #ddebf7; }
th.src-prices, .legend .src-prices { background: #e2efda; }
th.src-market, .legend .src-market { background: #d0efea; }
th.src-calc, .legend .src-calc { background: #e7e6e6; }
th.src-manual, .legend .src-manual { background: #fff2cc; }
th.src-ai, .legend .src-ai { background: #e8ddf3; }
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr)); gap: 0.75rem; }
table.params th { background: #eef1f5; }
.placeholder h3 { margin: 0 0 0.3rem; font-size: 1rem; }

/* Login pages (T34). */
body.public { display: block; }
main.auth { max-width: 26rem; margin: 3rem auto; padding: 0 1rem; }
.brand-public { font-weight: 700; font-size: 1.3rem; margin: 0 0 1rem; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: 0.6rem; padding: 1.25rem 1.5rem; }
.auth-card h1 { font-size: 1.3rem; margin: 0 0 0.75rem; }
.auth-card form { display: grid; gap: 0.75rem; margin: 0.75rem 0; }
.auth-card label { display: grid; gap: 0.3rem; font-size: 0.9rem; color: var(--muted); }
.auth-card input { padding: 0.5rem 0.6rem; border: 1px solid #c8ced8; border-radius: 0.35rem; font-size: 1rem; }
.auth-card button, a.button { background: var(--accent); color: #fff; border: 0; border-radius: 0.35rem; padding: 0.55rem 0.9rem; font-size: 1rem; cursor: pointer; display: inline-block; }
.error { background: #fdecea; color: #8a1f11; border-radius: 0.35rem; padding: 0.5rem 0.7rem; }
.qr { text-align: center; margin: 0.75rem 0; }
.codes { columns: 2; padding-left: 1.2rem; }
.steps { padding-left: 1.2rem; }
.userbox { margin: 1rem 0.5rem 0; color: #d5dae3; }
.userbox .muted { color: #8a93a3; }
button.link { background: none; border: 0; color: #b9c3d6; padding: 0; cursor: pointer; font-size: 0.85rem; margin-top: 0.3rem; }
button.link:hover { text-decoration: underline; }
/* myfund connection status in the sidebar and on /myfund (T20). */
.myfundbox { margin: 0.6rem 0.5rem 0; }
.myfundbox a { color: #b9c3d6; }
.myfundbox .ok { color: #7fd6a4; }
.myfundbox .warn { color: #f2c46b; }
.myfundbox .syncform { margin: 0.2rem 0 0; }
.myfundbox button[disabled] { opacity: 0.5; cursor: default; }
.notice { padding: 0.6rem 0.9rem; border-radius: 0.4rem; margin: 0 0 1rem; max-width: 46rem; }
.notice.ok { background: #e7f6ed; color: #1a5c35; }
.notice.error { background: #fdecea; color: #8a2a1f; }
.notice.warn { background: #fff4d6; color: #8a5a00; }
.changes { margin: 0.5rem 0 1rem; }
.changes h4 { margin: 0.8rem 0 0.2rem; font-size: 0.95rem; }
.changes ul { margin: 0.2rem 0 0.4rem; }
.myfund-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 0.5rem; padding: 1.25rem 1.5rem; max-width: 46rem; }
.myfund-panel form { display: inline-block; margin-right: 0.75rem; }
.myfund-panel button { background: var(--accent); color: #fff; border: 0; border-radius: 0.35rem; padding: 0.55rem 0.9rem; font-size: 1rem; cursor: pointer; }
.myfund-panel button.secondary { background: #eef1f5; color: var(--text); border: 1px solid var(--line); }
.myfund-panel ul { margin: 0.3rem 0 0.8rem; }
