/* NRI Landing: styles shared by every page (colours, light/dark themes, page basics, top bar, buttons, tables, toast). */
:root {
  --ink: #14213D;
  --ink-2: #3B4A63;
  --muted: #52607A;
  --ground: #F4F6F8;
  --surface: #FFFFFF;
  --line: #DDE3EA;
  --field-line: #C9D2DD;
  --accent: #0B5E57;
  --accent-ink: #FFFFFF;
  --accent-soft: #E8F3F1;
  --accent-deep: #0B3F3A;
  --warn: #C2410C;
  --warn-soft: #FDF0E7;
  --warn-line: #F3C9A9;
  --warn-ink: #7C2D12;
  --ok-soft: #E6F4EA;
  --ok-line: #A8D5B5;
  --ok: #15803D;
  --ok-ink: #14532D;
  --chart-2: #B7791F;
  --chart-2-ink: #FFFFFF;
  --radius-lg: 16px;
  --radius: 10px;
  color-scheme: light;
}
/* Dark theme: follows the computer's setting, unless the visitor picks one with the theme button (data-theme). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #E6EAF2; --ink-2: #C3CBD9; --muted: #9AA6BA; --ground: #0F1622; --surface: #172131;
    --line: #2A3649; --field-line: #3A475C; --accent: #2BA597; --accent-ink: #06201D; --accent-soft: #15302E; --accent-deep: #BFE7E1;
    --warn: #F08A4B; --warn-soft: #3A2316; --warn-line: #6B3A1F; --warn-ink: #FFD7BF;
    --ok: #4ADE80; --ok-soft: #12301F; --ok-line: #2D5E40; --ok-ink: #BDEBCB;
    --chart-2: #E0B04B; --chart-2-ink: #2A1D05;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #E6EAF2; --ink-2: #C3CBD9; --muted: #9AA6BA; --ground: #0F1622; --surface: #172131;
  --line: #2A3649; --field-line: #3A475C; --accent: #2BA597; --accent-ink: #06201D; --accent-soft: #15302E; --accent-deep: #BFE7E1;
  --warn: #F08A4B; --warn-soft: #3A2316; --warn-line: #6B3A1F; --warn-ink: #FFD7BF;
  --ok: #4ADE80; --ok-soft: #12301F; --ok-line: #2D5E40; --ok-ink: #BDEBCB;
  --chart-2: #E0B04B; --chart-2-ink: #2A1D05;
  color-scheme: dark;
}
.theme-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--field-line);
  border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; }
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-btn .ic { width: 20px; height: 20px; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif; font-size: 15px; line-height: 1.5;
  font-variant-numeric: tabular-nums;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.4px; }
h2 { font-size: 17px; font-weight: 750; }
h3 { font-size: 14px; font-weight: 750; color: var(--ink-2); }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-size: 14px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.wrap { max-width: 1360px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.topbar-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 12px; }
a.brand { color: inherit; text-decoration: none; }
.brand > div { display: flex; flex-direction: column; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.2px; }
.brand-sub { font-size: 12px; color: var(--muted); }
.top-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* buttons */
.btn { min-height: 44px; padding: 0 16px; border-radius: var(--radius); font-weight: 700; cursor: pointer; border: 1px solid var(--field-line); background: var(--surface); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.lg { min-height: 48px; padding: 0 20px; }
.icon-btn { flex: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { color: var(--warn); border-color: var(--warn-line); }
.ic { width: 18px; height: 18px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.table-wrap.tall { max-height: 480px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th { position: sticky; top: 0; background: var(--surface); font-size: 12px; color: var(--muted); font-weight: 700; }
.num { text-align: right; }
tr.neg td { color: var(--warn-ink); background: var(--warn-soft); }
tr.move td { font-weight: 750; }
tfoot th, tfoot td { border-bottom: 0; }

.foot { padding-bottom: 32px; color: var(--muted); font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--ground); padding: 12px 18px; border-radius: 10px; font-weight: 650; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

@media (max-width: 600px) {
  .wrap { padding-left: 14px; padding-right: 14px; }
  h1 { font-size: 23px; }
  .brand-sub { display: none; }
}
