/* ============================================================
   nwif.css — NWIF Dashboard design system
   Scope discipline: every rule is class-namespaced (.nw-*).
   No bare element selectors, so the locked sponsor-report pages
   (inline styles, no classNames) render exactly as before.
   ============================================================ */

:root {
  --ink: #1C2A38;
  --navy: #1E3A5F;
  --blue: #2C5F8A;
  --sky: #4A90C4;
  --paper: #FAF7F0;          /* warm cream paper */
  --surface: #FFFFFF;
  --surface-warm: #FFFEFB;
  --line: #E9E1D2;           /* warm hairline */
  --gold: #C2A15F;           /* academic trim */
  --text: #37424E;
  --muted: #6B7280;
  --green: #2E7D5B;
  --green-tint: #EBF3EC;
  --rust: #A85536;
  --rust-tint: #F8EEE6;
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --shadow-1: 0 1px 2px rgba(74,60,34,.05), 0 4px 14px rgba(74,60,34,.06);
  --shadow-2: 0 2px 4px rgba(74,60,34,.06), 0 10px 26px rgba(74,60,34,.09);
  --ease: cubic-bezier(.25,.46,.45,.94);

  /* Type scale — 1.24 ratio on a 15px base:
     11 · 12 · 13.5 · 15 · 18.5 · 23 · 28.5 · 35 */
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13.5px;
  --fs-base: 15px;
  --fs-lg: 18.5px;
  --fs-xl: 23px;
  --fs-2xl: 28.5px;
  --fs-3xl: 35px;
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('/assets/fonts/SourceSerif4-Variable.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('/assets/fonts/SourceSerif4-Italic-Variable.woff2') format('woff2');
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

/* EKG pulse trace — the one overt clinical wink, used sparingly */
:root {
  --pulse: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14' fill='none' stroke='%231E3A5F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M1 8h30l4-4 5 9 6-12 5 7h16l3-3 4 6 3-3h42'/></svg>");
}

/* ---------- Base (opt-in wrapper only) ---------- */
.nw-scope {
  font-family: var(--sans);
  color: var(--text);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
.nw-scope :focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Typography ---------- */
.nw-h1 {
  font-family: var(--serif);
  font-weight: 590;
  font-size: var(--fs-3xl);
  line-height: 1.12;
  letter-spacing: -.005em;
  color: var(--ink);
  margin: 0;
}
.nw-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 420;
  font-size: 16px;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.5;
}
.nw-eyebrow {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

/* ---------- Page header (replaces gradient slab) ---------- */
.nw-pagehead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  padding: 30px 0 20px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.nw-pagehead::after {
  /* a quiet pulse trace that briefly interrupts the baseline rule */
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 120px;
  height: 14px;
  background-color: var(--paper);
  background-image: var(--pulse);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.nw-pagehead__meta {
  font-size: var(--fs-md);
  color: var(--muted);
  padding-bottom: 5px;
}

/* ---------- Buttons ---------- */
.nw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 11px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease),
              color .15s var(--ease), transform .1s var(--ease);
}
.nw-btn:active { transform: translateY(1px); }
.nw-btn--primary { background: var(--navy); color: #fff; }
.nw-btn--primary:hover { background: #17304F; }
.nw-btn--ghost {
  background: transparent;
  color: rgba(255,255,255,.85);
  border-color: rgba(255,255,255,.3);
}
.nw-btn--ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.nw-btn--sm { padding: 7px 14px; font-size: 12.5px; }
.nw-btn--block { width: 100%; }
.nw-btn[disabled] { opacity: .55; cursor: default; }

/* ---------- Cards ---------- */
.nw-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-1);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease),
              background-color .15s var(--ease);
}
.nw-card:hover {
  border-color: #D9CFBC;
  background: var(--surface-warm);
  box-shadow: var(--shadow-2);
}

/* KPI cards */
.nw-kpi { padding: 20px 22px; position: relative; }
.nw-kpi__value {
  font-size: var(--fs-2xl);
  font-weight: 640;
  letter-spacing: -.012em;
  color: var(--ink);
  line-height: 1.1;
  padding-right: 26px;   /* keep long values clear of the corner icon */
}
.nw-kpi__value--long { font-size: var(--fs-xl); padding-top: 5px; }
.nw-kpi__label {
  font-size: var(--fs-xs);
  font-weight: 620;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 7px;
}

/* Thin-stroke topic icons, top-right, deliberately quiet */
.nw-kpi__icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 22px;
  height: 22px;
  background-color: #B3AA97;
  -webkit-mask: var(--icon) no-repeat center / contain;
  mask: var(--icon) no-repeat center / contain;
}
.nw-kpi__icon--people   { --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='8' r='3.2'/><path d='M3.5 19c0-3 2.5-5.5 5.5-5.5s5.5 2.5 5.5 5.5'/><path d='M15.5 5.2a3.2 3.2 0 0 1 0 5.6'/><path d='M17 13.7c2 .8 3.5 2.9 3.5 5.3'/></svg>"); }
.nw-kpi__icon--cap      { --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M12 4 2.5 8.8 12 13.6l9.5-4.8L12 4z'/><path d='M6.5 11v4.4c0 1.5 2.5 2.8 5.5 2.8s5.5-1.3 5.5-2.8V11'/><path d='M21.5 9v5'/></svg>"); }
.nw-kpi__icon--mic      { --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><rect x='9' y='3' width='6' height='11' rx='3'/><path d='M5.5 11.5a6.5 6.5 0 0 0 13 0'/><path d='M12 18v3'/></svg>"); }
.nw-kpi__icon--bag      { --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M5.5 8.5h13l-1.2 11H6.7l-1.2-11z'/><path d='M9 8.5V7a3 3 0 0 1 6 0v1.5'/></svg>"); }
.nw-kpi__icon--dollar   { --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='8.5'/><path d='M12 7.5v9'/><path d='M14.5 9.2c-.5-.8-1.4-1.2-2.5-1.2-1.5 0-2.6.8-2.6 2s1.1 1.7 2.6 2 2.8.8 2.8 2.1-1.2 2-2.8 2c-1.2 0-2.2-.5-2.7-1.3'/></svg>"); }
.nw-kpi__icon--calendar { --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='5.5' width='16' height='15' rx='2'/><path d='M4 10.5h16'/><path d='M8.5 3v4M15.5 3v4'/><path d='M9 15l2 2 4-4'/></svg>"); }
.nw-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 10px;
}
.nw-delta--up { color: var(--green); background: var(--green-tint); }
.nw-delta--down { color: var(--rust); background: var(--rust-tint); }

.nw-kpi-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  margin-bottom: 20px;
}

/* Chart / content cards */
.nw-chart-row { display: flex; gap: 16px; flex-wrap: wrap; }
.nw-chartcard { flex: 1; min-width: 320px; padding: 10px 8px; margin-bottom: 15px; }

/* Big single-stat card (Events summary) */
.nw-stat { text-align: center; padding: 28px 20px; margin-bottom: 20px; }
.nw-stat__value {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 560;
  letter-spacing: -.01em;
  color: var(--ink);
}
.nw-stat__label {
  font-size: var(--fs-xs);
  font-weight: 620;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 7px;
}

/* Section heading + caption (Events insight) */
.nw-section-title {
  font-family: var(--serif);
  font-weight: 590;
  font-size: var(--fs-xl);
  color: var(--ink);
  margin: 32px 0 4px;
}
.nw-caption { font-size: var(--fs-md); color: var(--muted); margin-bottom: 14px; line-height: 1.55; }
.nw-caption--fine {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--fs-md);
  margin: -6px 0 20px;
}

/* ---------- Navigation ---------- */
.nw-nav { background: var(--navy); border-bottom: 2px solid var(--gold); }
.nw-nav__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 20px;
  position: relative;
}
.nw-nav__brand { text-decoration: none; flex-shrink: 0; line-height: 1.15; }
.nw-nav__brand span {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  color: #fff;
  letter-spacing: .02em;
}
.nw-nav__brand small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}
.nw-nav__menu { display: flex; align-items: center; gap: 0; }
.nw-nav__group {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(194,161,95,.85);   /* gold echo of the nav trim */
  padding: 0 8px 0 12px;
  border-left: 1px solid rgba(255,255,255,.15);
  margin-left: 10px;
  white-space: nowrap;
}
.nw-nav__link {
  position: relative;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 19px 8px;
  white-space: nowrap;
  transition: color .15s var(--ease);
}
.nw-nav__link::after {
  content: '';
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 0;
  height: 2px;
  background: var(--sky);
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform .18s var(--ease);
}
.nw-nav__link:hover { color: #fff; }
.nw-nav__link:hover::after { transform: scaleX(1); }
.nw-nav__link--active { color: #fff; }
.nw-nav__link--active::after { transform: scaleX(1); }
.nw-nav__logout {
  color: rgba(255,255,255,.6);
  font-size: 13px;
  text-decoration: none;
  padding: 8px 0 8px 10px;
  white-space: nowrap;
  transition: color .15s var(--ease);
}
.nw-nav__logout:hover { color: #fff; }
/* Change-password link: icon-only on desktop (nav is full at 1280px), labelled in the mobile menu */
.nw-nav__account {
  flex-shrink: 0;
  width: 28px; height: 34px;
  margin-left: 6px;
  border-radius: 6px;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z'/><circle cx='16.5' cy='7.5' r='.5' fill='white'/></svg>") center / 17px no-repeat;
  opacity: .6;
  transition: opacity .15s var(--ease);
}
.nw-nav__account:hover { opacity: 1; }
.nw-nav__account-label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.nw-nav__menu .nw-btn--ghost { margin-left: 14px; }

/* Sync status strip */
.nw-syncbar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 5px 24px;
  font-size: 12px;
  color: var(--muted);
  min-height: 22px;
}

/* Mobile nav (toggle button flips .nw-nav--open) */
.nw-nav__toggle {
  display: none;
  background: none;
  border: 0;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 8px 4px;
  user-select: none;
}
@media (max-width: 960px) {
  .nw-nav__toggle { display: block; }
  .nw-nav__menu { display: none; }
  .nw-nav--open .nw-nav__menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--navy);
    padding: 6px 20px 18px;
    border-top: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 12px 24px rgba(22,40,60,.25);
  }
  .nw-nav--open .nw-nav__link { padding: 13px 6px; }
  .nw-nav--open .nw-nav__link::after { display: none; }
  .nw-nav__group { border-left: 0; margin: 10px 0 0; padding: 6px; }
  .nw-nav__menu .nw-btn--ghost { margin: 12px 0 0; }
  .nw-nav__logout { padding: 12px 6px; }
  .nw-nav__account {
    width: auto; height: auto; margin: 0; background: none; opacity: 1;
    color: rgba(255,255,255,.6); font-size: 13px; text-decoration: none; padding: 12px 6px;
  }
  .nw-nav__account-label { position: static; width: auto; height: auto; clip: auto; }
}

/* ---------- Forms / Login ---------- */
.nw-login {
  min-height: 100vh;
  background: var(--paper);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 16px 40px;
}
.nw-login__card { width: 100%; max-width: 384px; padding: 38px 32px 30px; }
.nw-login__card:hover {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.nw-login__head { text-align: center; margin-bottom: 26px; }
.nw-login__head::after {
  /* pulse trace as a divider — the welcome handshake */
  content: '';
  display: block;
  width: 110px;
  height: 14px;
  margin: 14px auto 0;
  background: var(--pulse) no-repeat center / contain;
  opacity: .7;
}
.nw-login__brand {
  font-family: var(--serif);
  font-weight: 590;
  font-size: 32px;
  color: var(--navy);
  letter-spacing: .035em;
}
.nw-login__sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
  color: var(--muted);
  margin-top: 3px;
}
.nw-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
}
.nw-input {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--text);
  padding: 11px 14px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.nw-input:hover { border-color: #D5CEC2; }
.nw-input:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(74,144,196,.18);
}
.nw-error {
  font-size: 13px;
  color: var(--rust);
  text-align: center;
  margin-top: 12px;
}
/* Wide tables (sponsor portal + admin) scroll inside their card on narrow screens */
.nw-scope .nw-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nw-login__hint { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 18px; line-height: 1.5; }

/* Filter row (Events year picker) */
.nw-filter-row { display: flex; align-items: center; margin-bottom: 20px; }
.nw-filter-row .nw-field-label { margin: 0 10px 0 0; }

@media (prefers-reduced-motion: reduce) {
  .nw-scope *, .nw-nav *, .nw-login * { transition: none !important; }
}
