/* ── Wealth Ledger — enterprise custody / back-office styling ────────── */
:root {
  --navy: #1f2a44;
  --navy-2: #2b3a5c;
  --ink: #1a1d23;
  --muted: #5b6472;
  --muted-2: #8a93a3;
  --line: #d4d9e0;
  --line-2: #e6e9ee;
  --bg: #f4f6f9;
  --panel: #ffffff;
  --accent: #2f5fb3;
  --debit: #b3261e;
  --debit-bg: #fbe9e8;
  --warn: #8a5a00;
  --warn-bg: #fdf3e2;
  --ok: #1f6b3b;
  --ok-bg: #e9f3ec;
  --pending: #5b6472;
  --pending-bg: #eef0f3;
  --row-hover: #f0f4fa;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

.tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; text-align: right; white-space: nowrap; }
.mono { font-family: var(--mono); }

/* ── Top nav ─────────────────────────────────────────────────────────── */
.topnav {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  border-bottom: 3px solid var(--navy-2);
}
.topnav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 15px;
}
.topnav .brand .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
  font-size: 13px;
}
.topnav .brand .sub {
  color: #aeb8cc;
  font-weight: 400;
  font-size: 12px;
  border-left: 1px solid #455173;
  padding-left: 10px;
  margin-left: 2px;
}
.topnav .right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
}
.topnav .right .advisor { color: #d4dbe8; }
.topnav .right .advisor b { color: #fff; font-weight: 600; }
.topnav .right button {
  background: transparent;
  border: 1px solid #4a5778;
  color: #d4dbe8;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.topnav .right button:hover { background: var(--navy-2); color: #fff; }

/* ── Layout ──────────────────────────────────────────────────────────── */
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; }

.page-head { margin: 4px 0 18px; }
.page-head h1 {
  font-size: 20px;
  margin: 0 0 4px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.page-head .meta { color: var(--muted); font-size: 12.5px; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs .sep { margin: 0 6px; color: var(--muted-2); }

/* ── Summary chips on index ──────────────────────────────────────────── */
.summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 16px;
  min-width: 150px;
}
.stat .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-2); }
.stat .value { font-size: 18px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* ── Panels / sections ───────────────────────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 18px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}
.panel-head h2 {
  font-size: 13.5px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.01em;
  color: var(--navy);
}
.panel-head .hint { font-size: 11.5px; color: var(--muted-2); }
.panel-body { padding: 0; }
.panel-body.pad { padding: 14px 16px; }
.empty { padding: 16px; color: var(--muted-2); font-size: 12.5px; font-style: italic; }

/* ── Tables ──────────────────────────────────────────────────────────── */
table.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.grid thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7f8fa;
  white-space: nowrap;
}
table.grid thead th.num { text-align: right; }
table.grid tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: top;
}
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tbody tr:hover { background: var(--row-hover); }
table.grid tbody tr.linkable { cursor: pointer; }
table.grid td .acct { font-family: var(--mono); font-size: 12px; color: var(--muted); }
table.grid td .ticker { font-family: var(--mono); font-weight: 600; }
.subtle { color: var(--muted); font-size: 12px; }

.amt-neg { color: var(--debit); }
.amt-pos { color: var(--ink); }

/* ── Chips / tags ────────────────────────────────────────────────────── */
.chip {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip.debit { color: var(--debit); background: var(--debit-bg); border-color: #f0c9c6; }
.chip.action { color: var(--warn); background: var(--warn-bg); border-color: #f0dcb4; }
.chip.muted { color: var(--muted); background: var(--pending-bg); border-color: var(--line); }

.status { font-size: 11.5px; font-weight: 500; }
.status.settled { color: var(--ok); }
.status.pending { color: var(--pending); }
.status.unsettled { color: var(--warn); }
.status.working { color: var(--accent); }
.status.due { color: var(--debit); }
.status.ontrack { color: var(--ok); }
.status .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}
.status.settled .dot { background: var(--ok); }
.status.pending .dot { background: var(--muted-2); }
.status.unsettled .dot { background: var(--warn); }
.status.working .dot { background: var(--accent); }
.status.due .dot { background: var(--debit); }
.status.ontrack .dot { background: var(--ok); }

.member-list { color: var(--muted); font-size: 12.5px; }

/* ── Login ───────────────────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1f2a44 0%, #2b3a5c 100%);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.35);
  overflow: hidden;
}
.login-card .head {
  padding: 26px 28px 18px;
  border-bottom: 1px solid var(--line-2);
}
.login-card .head .brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; color: var(--navy); letter-spacing: 0.01em;
}
.login-card .head .brand .mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 5px; background: var(--navy); color: #fff;
  font-weight: 800; font-size: 14px;
}
.login-card .head .tag { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.login-card form { padding: 22px 28px 26px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,95,179,0.15); }
.btn-primary {
  width: 100%;
  padding: 11px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary:hover { background: var(--navy-2); }
.login-error {
  background: var(--debit-bg);
  border: 1px solid #f0c9c6;
  color: var(--debit);
  padding: 9px 12px;
  border-radius: 5px;
  font-size: 12.5px;
  margin-bottom: 16px;
}
.login-hint {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.6;
}
.login-hint code { font-family: var(--mono); color: var(--muted); }

.notfound { padding: 40px 0; text-align: center; }
.notfound h1 { font-size: 20px; margin: 0 0 8px; }
.notfound p { color: var(--muted); }

.footer-note {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted-2);
}
