/* ==========================================================================
   THEME: dark elegant, majority white.
   One look for every page: ivory canvas, white cards, a deep graphite sidebar and page
   header band with a brass rule, steel-blue actions, deep green / muted red for gain / loss.
   Loaded after style.css on every page (see views/partials/head.ejs).
   ========================================================================== */

:root {
  --bg: #f4f4f1;
  --surface: #ffffff;
  --surface-2: #efefeb;
  --surface-3: #e4e4de;
  --border: #e1e1da;
  --border-strong: #c9c9bf;
  --text: #0f141b;
  --text-muted: #5b6471;
  --accent: #1f4e7d;
  --accent-2: #2b6791;
  --accent-weak: #e4ecf4;
  --green: #0d7a59;
  --green-weak: #dff0e9;
  --red: #a9342d;
  --red-weak: #f7e4e1;
  --amber: #93671e;
  --amber-weak: #f3e9d3;
  --brass: #a8772a;
  --brass-hi: #d6a54a;
  --ink: #0e1319;
  --ink-2: #161d27;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(15, 20, 27, 0.05), 0 8px 22px -14px rgba(15, 20, 27, 0.18);
  --shadow-lg: 0 22px 44px -24px rgba(15, 20, 27, 0.45);
  --ring: 0 0 0 3px rgba(31, 78, 125, 0.25);
  --display: "Barlow Condensed", "Arial Narrow", "Inter", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0d12;
    --surface: #11161d;
    --surface-2: #171e27;
    --surface-3: #202a36;
    --border: #212a36;
    --border-strong: #324054;
    --text: #e6e9ef;
    --text-muted: #92a0b4;
    --accent: #7fb0e3;
    --accent-2: #5fa8c8;
    --accent-weak: #13253a;
    --green: #3ccf9f;
    --green-weak: #0f2f27;
    --red: #f0857c;
    --red-weak: #36191a;
    --amber: #dbb05a;
    --amber-weak: #33290f;
    --brass: #d6a54a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 26px -14px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 24px 50px -22px rgba(0, 0, 0, 0.8);
    --ring: 0 0 0 3px rgba(127, 176, 227, 0.3);
  }
}

body { background: var(--bg); color: var(--text); }
a { color: var(--accent); }

/* ---------- sidebar: deep graphite ---------- */
.sidebar { background: linear-gradient(180deg, #141b25 0%, #0b0f14 100%) !important; border-right: 1px solid #1d2632 !important; color: #b3bdcb; scrollbar-width: thin; scrollbar-color: #2a3644 transparent; }
.brand, .brand .full { color: #fff !important; }
.brand-mark { background: linear-gradient(135deg, #e0b25a, #8a5f1c) !important; box-shadow: 0 2px 12px rgba(214, 165, 74, 0.4) !important; border-radius: 6px !important; }
.brand-mark::after { border-color: rgba(24, 16, 4, 0.85) !important; border-radius: 50% !important; }
.nav-group { color: #6e7b8e !important; opacity: 1 !important; letter-spacing: 0.14em !important; }
.nav-link { color: #aeb9c8 !important; border-radius: 4px !important; }
.nav-link:hover { background: rgba(255, 255, 255, 0.06) !important; color: #fff !important; }
.nav-link.active { background: rgba(255, 255, 255, 0.09) !important; color: #fff !important; font-weight: 600; }
.nav-link.active::before { background: var(--brass-hi) !important; border-radius: 0 2px 2px 0 !important; width: 3px !important; }
.nav-link.active .nav-icon { color: var(--brass-hi); opacity: 1; }

/* ---------- page header: dark band with a brass rule ---------- */
.page-header {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 26px 30px 24px !important; margin: 6px 0 26px !important;
  background: linear-gradient(135deg, #18212c 0%, #0d1218 72%);
  border-radius: var(--radius); border-bottom: 3px solid var(--brass-hi);
  color: #eef1f6;
  --text: #eef1f6; --text-muted: #9aa6b8; --surface: #1a2330; --surface-2: #202b3a; --border: #2b3645; --border-strong: #3b485b;
  box-shadow: 0 24px 44px -28px rgba(10, 15, 22, 0.7);
}
.page-header::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(520px 240px at 92% -20%, rgba(52, 104, 158, 0.45), transparent 70%), radial-gradient(380px 200px at -4% 120%, rgba(168, 119, 42, 0.28), transparent 70%); }
.page-header h1 { font-family: var(--display) !important; text-transform: uppercase; font-weight: 800 !important; font-size: 42px !important; letter-spacing: 0.02em !important; line-height: 1; color: #fff; }
.page-header .subtitle { color: #a4afc0 !important; font-size: 13.5px !important; max-width: 780px; }
.page-header .btn.secondary, .page-header .btn.sm.secondary { background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.22); color: #fff; box-shadow: none; }
.page-header .btn.secondary:hover { background: rgba(255, 255, 255, 0.16); }
.page-header .btn:not(.secondary) { background: linear-gradient(180deg, #e0b25a, #b5822c); color: #1a1206; border: none; }
.page-header select, .page-header input { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.2); color: #fff; }
.page-header .sync-note { color: #8f9bad; }

/* ---------- headings and titles ---------- */
.section-title { position: relative; font-family: var(--display) !important; font-weight: 700 !important; font-size: 22px !important; letter-spacing: 0.07em !important; text-transform: uppercase; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin: 36px 0 16px !important; }
.section-title::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 56px; height: 3px; background: var(--brass); }
.section-title .sync-note { font-family: "Inter", sans-serif; text-transform: none; letter-spacing: 0; font-size: 12px; }
h1, h2 { letter-spacing: -0.01em; }

/* ---------- surfaces ---------- */
.card { border-radius: var(--radius) !important; box-shadow: var(--shadow); border-color: var(--border); }
.card.hoverable:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.stat-tile::before { background: linear-gradient(180deg, var(--brass), var(--accent)) !important; width: 3px !important; }
.stat-tile .stat-value { font-family: var(--display) !important; font-weight: 700 !important; font-size: 38px !important; letter-spacing: 0.005em !important; }
.stat-tile .stat-label { letter-spacing: 0.12em !important; }
.eco-tile { border-radius: var(--radius) !important; }

/* ---------- tables ---------- */
table { font-size: 13px; }
thead th { background: var(--surface-2); border-bottom: 2px solid var(--border-strong) !important; color: var(--text-muted); font-weight: 700; letter-spacing: 0.1em !important; }
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
td { border-bottom-color: var(--border); }

/* ---------- controls ---------- */
.btn { border-radius: var(--radius-sm) !important; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent)) !important; color: #fff; font-weight: 600; letter-spacing: 0.02em; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 16px -10px var(--accent) !important; }
.btn.secondary { background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border-strong) !important; box-shadow: none !important; }
.btn.secondary:hover { background: var(--surface-2) !important; border-color: var(--text) !important; }
input, select, textarea { border-radius: var(--radius-sm) !important; background: var(--surface); color: var(--text); border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--accent) !important; box-shadow: var(--ring) !important; }
.tabs { border-bottom: 1px solid var(--border-strong); }
.tabs button { font-weight: 600; letter-spacing: 0.02em; }
.tabs button.on { color: var(--text) !important; border-bottom: 3px solid var(--brass) !important; }
.seg { border-radius: var(--radius-sm) !important; background: var(--surface-2); }
.seg button { border-radius: 3px !important; }
.seg button.on { background: var(--ink) !important; color: #fff !important; box-shadow: none !important; }
@media (prefers-color-scheme: dark) { .seg button.on { background: #e6e9ef !important; color: #0e1319 !important; } }
.badge { border-radius: 3px !important; letter-spacing: 0.04em !important; font-weight: 700; }
.news-tabs .btn { border-radius: var(--radius-sm) !important; }
.banner { border-radius: var(--radius-sm); }

/* ---------- top bar ---------- */
.topbar { background: color-mix(in srgb, var(--bg) 90%, transparent) !important; }
.omni { border-radius: var(--radius-sm) !important; }
.auto-pill { border-radius: var(--radius-sm) !important; }

/* ---------- dark hero bands used by Home, Investors and Books ---------- */
.au-stage, .bk-hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: linear-gradient(135deg, #18212c 0%, #0d1218 72%) !important;
  border-radius: var(--radius) !important; border-bottom: 3px solid var(--brass-hi); color: #eef1f6 !important;
  box-shadow: 0 24px 44px -28px rgba(10, 15, 22, 0.7) !important;
  --text: #eef1f6; --text-muted: #a4afc0; --surface: #1a2330; --surface-2: #202b3a; --border: #2b3645; --border-strong: #3b485b;
}

/* Log out control at the bottom of the sidebar */
.nav-logout { margin: 14px 0 6px; padding-top: 10px; border-top: 1px solid #1d2632; }
.nav-logout button { width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
