/* ============================================================
   NIStructE Member Portal — Theme CSS
   Loaded instead of Tailwind for the new design system
============================================================ */

/* ============================================================
   §1 — DESIGN TOKENS
============================================================ */
:root {
  --maroon:        #892559;
  --maroon-deep:   #5C1A3E;
  --maroon-darker: #3D0E22;
  --maroon-ink:    #2A1922;
  --maroon-tint:   #FAF2F6;
  --maroon-tint-2: #F3E5EC;
  --gold:          #C8941E;
  --gold-2:        #D4A017;
  --gold-soft:     #F6EAD0;
  --bg:            #F6F4F1;
  --bg-member:     #F8F7F4;
  --surface:       #FFFFFF;
  --line:          #ECE7E2;
  --line-2:        #E2DCD5;
  --ink:           #1B1418;
  --ink-2:         #3A2F36;
  --muted:         #6E6470;
  --muted-2:       #9A8F98;
  --green:         #1F7A4D;
  --green-2:       #2F9A5F;
  --green-soft:    #E3F0E9;
  --amber:         #B7791F;
  --amber-soft:    #FAEFD7;
  --red:           #B42318;
  --red-soft:      #FBE6E3;
  --blue:          #1E5FAD;
  --blue-soft:     #E1ECF8;
  --shadow-card:            0 1px 0 rgba(27,20,24,0.04), 0 2px 12px rgba(43,25,34,0.05);
  --shadow-card-lg:         0 1px 0 rgba(27,20,24,0.04), 0 2px 14px rgba(43,25,34,0.06);
  --shadow-pop:             0 12px 32px rgba(43,25,34,0.12);
  --shadow-card-banner:     0 8px 24px rgba(89,26,62,0.18);
  --shadow-card-membership: 0 8px 28px rgba(89,26,62,0.22);
}

/* ============================================================
   §2 — BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', sans-serif;
  font-size: 14px; line-height: 1.5;
  color: var(--ink); background: var(--bg-member);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }
img { display: block; }

/* ============================================================
   §3 — ANIMATIONS
============================================================ */
@keyframes ni-spin {
  to { transform: rotate(360deg); }
}
@keyframes ni-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@media (prefers-reduced-motion: reduce) {
  .ni-step-ring, .ni-banner-dot { animation: none !important; }
}

/* ============================================================
   §4 — MEMBER SHELL GRID
============================================================ */
.ni-app {
  min-height: 100vh;
}
.ni-main {
  display: flex; flex-direction: column; min-height: 100vh; overflow: hidden;
}

/* ============================================================
   §5 — MEMBER SIDEBAR (white)
============================================================ */
.ni-sidebar {
  width: 280px;
  position: fixed; top: 0; left: 0; height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
  z-index: 100;
}

/* brand */
.ni-sidebar-brand {
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  text-decoration: none;
}
.ni-brand-mark {
  width: 46px; height: 46px;
  background: var(--maroon-tint);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.ni-brand-mark img { width: 30px; height: 30px; object-fit: contain; }
.ni-brand-text .bt1 {
  font-size: 10.5px; font-weight: 600;
  color: var(--maroon); letter-spacing: 0.1em;
  text-transform: uppercase; line-height: 1;
}
.ni-brand-text .bt2 {
  font-size: 14px; font-weight: 600; color: var(--ink);
  line-height: 1.3; margin-top: 2px;
}
.ni-brand-text .bt3 {
  font-size: 11.5px; color: var(--muted); margin-top: 1px;
}

/* nav scroll area */
.ni-sidebar-nav {
  flex: 1; overflow-y: auto;
  padding: 14px 14px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.ni-sidebar-nav::-webkit-scrollbar { width: 3px; }
.ni-sidebar-nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }
.ni-nav-group { margin-bottom: 4px; }
.ni-nav-group-title {
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--muted-2); padding: 12px 14px 5px;
}

/* nav items */
.ni-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
  color: var(--ink-2); cursor: pointer;
  position: relative; margin-bottom: 1px;
  transition: background 80ms, color 80ms;
  text-decoration: none;
}
.ni-nav-item:hover { background: var(--maroon-tint); color: var(--maroon); }
.ni-nav-item.active {
  background: var(--maroon-tint); color: var(--maroon); font-weight: 600;
}
.ni-nav-item.active::before {
  content: ''; position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px; background: var(--maroon); border-radius: 0 2px 2px 0;
}
.ni-nav-item .ni-ico {
  width: 17px; height: 17px; flex-shrink: 0; color: var(--muted);
}
.ni-nav-item:hover .ni-ico, .ni-nav-item.active .ni-ico { color: var(--maroon); }
.ni-nav-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
}
.ni-badge-amber { background: var(--amber-soft); color: var(--amber); }
.ni-badge-green { background: var(--green-soft); color: var(--green); }

/* sidebar footer with user info */
.ni-sidebar-footer {
  padding: 14px 18px; border-top: 1px solid var(--line); flex-shrink: 0;
}
.ni-footer-user {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.ni-footer-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--maroon), var(--maroon-deep));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0;
  overflow: hidden;
}
.ni-footer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ni-footer-name { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.ni-footer-email { font-size: 11px; color: var(--muted); }
.ni-status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; width: 100%;
  justify-content: center;
}
.ni-status-pill .ni-sp-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.ni-pill-amber { background: var(--amber-soft); color: var(--amber); }
.ni-pill-amber .ni-sp-dot {
  background: var(--amber); box-shadow: 0 0 0 3px rgba(183,121,31,0.18);
  animation: ni-pulse 1.6s ease-in-out infinite;
}
.ni-pill-green { background: var(--green-soft); color: var(--green); }
.ni-pill-green .ni-sp-dot { background: var(--green-2); }

/* logout nav item */
.ni-nav-logout {
  color: var(--red) !important;
}
.ni-nav-logout:hover { background: var(--red-soft) !important; color: var(--red) !important; }
.ni-nav-logout .ni-ico { color: var(--red) !important; }

/* ============================================================
   §6 — TOPBAR (MEMBER)
============================================================ */
.ni-topbar {
  height: 68px; background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 32px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 50; flex-shrink: 0;
}
.ni-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* breadcrumb */
.ni-breadcrumb {
  display: flex; align-items: center; gap: 3px;
  font-size: 13px; min-width: 0; flex: 1;
}
.ni-bc-link {
  color: var(--muted); font-weight: 500; white-space: nowrap;
  text-decoration: none; transition: color .1s; flex-shrink: 0;
}
.ni-bc-link:hover { color: var(--maroon); }
.ni-bc-sep {
  display: flex; align-items: center; flex-shrink: 0;
  color: var(--line-2);
}
.ni-bc-sep svg { width: 14px; height: 14px; }
.ni-bc-current {
  color: var(--ink); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ni-icon-btn {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--bg-member); border: 1px solid var(--line);
  color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer; transition: background 80ms;
  text-decoration: none;
}
.ni-icon-btn:hover { background: var(--maroon-tint); color: var(--maroon); }
.ni-icon-btn svg { width: 18px; height: 18px; }
.ni-icon-btn .ni-pip {
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber); border: 2px solid var(--surface);
}
.ni-avatar-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line); border-radius: 24px;
  cursor: pointer; transition: background 80ms;
  text-decoration: none; background: none;
  position: relative;
}
.ni-avatar-chip:hover { background: var(--maroon-tint); }
.ni-topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--maroon), var(--maroon-deep));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0;
  overflow: hidden;
}
.ni-topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ni-av-name { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.ni-av-role { font-size: 11px; color: var(--muted); line-height: 1.2; }

/* user dropdown */
.ni-user-dropdown-wrap { position: relative; }
.ni-user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 220px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-pop);
  z-index: 200; display: none; overflow: hidden;
}
.ni-user-dropdown.open { display: block; }
.ni-user-dropdown-head {
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
}
.ni-user-dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 16px;
  font-size: 13px; color: var(--ink-2); font-weight: 500;
  text-decoration: none; transition: background 80ms;
}
.ni-user-dropdown-item:hover {
  background: var(--maroon-tint); color: var(--maroon);
}
.ni-user-dropdown-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.ni-user-dropdown-item.ni-logout { color: var(--red); }
.ni-user-dropdown-item.ni-logout:hover { background: var(--red-soft); color: var(--red); }
.ni-user-dropdown-divider { height: 1px; background: var(--line); margin: 2px 0; }

/* overlay */
.ni-overlay {
  position: fixed; inset: 0; z-index: 190; display: none;
}
.ni-overlay.active { display: block; }

/* ============================================================
   §7 — CONTENT AREA
============================================================ */
.ni-content {
  padding: 28px 32px 80px;
  max-width: 1320px;
  flex: 1;
}

/* ============================================================
   §8 — CHIPS / BADGES
============================================================ */
.ni-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; font-size: 11.5px; font-weight: 600;
  border-radius: 999px; line-height: 1; white-space: nowrap;
}
.ni-chip::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.ni-chip-green   { background: var(--green-soft);  color: var(--green); }
.ni-chip-amber   { background: var(--amber-soft);  color: var(--amber); }
.ni-chip-red     { background: var(--red-soft);    color: var(--red); }
.ni-chip-blue    { background: var(--blue-soft);   color: var(--blue); }
.ni-chip-gold    { background: var(--gold-soft);   color: var(--gold); }
.ni-chip-neutral { background: #F4F0EB; color: var(--ink-2); }
.ni-chip-neutral::before { display: none; }

/* ============================================================
   §9 — BUTTONS
============================================================ */
.ni-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500;
  border-radius: 7px; padding: 8px 14px;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background 80ms, color 80ms, border-color 80ms;
  text-decoration: none;
}
.ni-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.ni-btn-primary   { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.ni-btn-primary:hover { background: var(--maroon-deep); border-color: var(--maroon-deep); color: #fff; }
.ni-btn-secondary { background: #FBF8F4; color: var(--ink-2); border-color: var(--line); }
.ni-btn-secondary:hover { background: var(--maroon-tint); color: var(--maroon); border-color: var(--maroon-tint-2); }
.ni-btn-ghost     { background: transparent; color: var(--maroon); border-color: var(--maroon-tint-2); }
.ni-btn-ghost:hover { background: var(--maroon-tint); color: var(--maroon); }
.ni-btn-sm { font-size: 12px; padding: 6px 10px; }

/* ============================================================
   §10 — CARDS
============================================================ */
.ni-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-card); overflow: hidden;
}
.ni-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.ni-card-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.ni-card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ni-card-body { padding: 22px; }
.ni-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px; background: #FBF8F4;
  border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted);
}
.ni-ghost-link {
  color: var(--maroon); font-size: 12.5px; font-weight: 600;
  text-decoration: none;
}
.ni-ghost-link:hover { text-decoration: underline; }

/* ============================================================
   §11 — STAT CARDS (MEMBER)
============================================================ */
.ni-stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 20px;
}
.ni-stat-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px 22px 18px;
  box-shadow: var(--shadow-card);
}
.ni-sc-top { display: flex; align-items: flex-start; justify-content: space-between; }
.ni-sc-label {
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);
}
.ni-sc-ico {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ni-sc-ico svg { width: 16px; height: 16px; }
.ni-ico-default { background: var(--maroon-tint); color: var(--maroon); }
.ni-ico-amber   { background: var(--amber-soft);  color: var(--amber); }
.ni-ico-green   { background: var(--green-soft);  color: var(--green); }
.ni-ico-gold    { background: var(--gold-soft);   color: var(--gold); }
.ni-ico-blue    { background: var(--blue-soft);   color: var(--blue); }
.ni-sc-value {
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1; margin-top: 10px; font-variant-numeric: tabular-nums; color: var(--ink);
}
.ni-sc-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; font-size: 12px; color: var(--muted);
}

/* ============================================================
   §12 — WELCOME BANNER (APPLICANT)
============================================================ */
.ni-welcome-banner {
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-deep) 55%, var(--maroon-darker) 100%);
  border-radius: 16px;
  padding: 28px 32px;
  color: #fff;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-card-banner);
  margin-bottom: 20px;
}
.ni-banner-radial-1 {
  position: absolute; top: -60px; right: -60px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.ni-banner-radial-2 {
  position: absolute; bottom: -80px; left: 30%;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
  pointer-events: none;
}
.ni-banner-inner {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
}
.ni-banner-greeting { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.ni-banner-sub { font-size: 14px; opacity: 0.85; margin-top: 6px; }
.ni-banner-right { text-align: right; flex-shrink: 0; }
.ni-banner-appno-label { font-size: 11px; opacity: 0.7; font-weight: 500; letter-spacing: 0.06em; }
.ni-banner-appno {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px; font-weight: 700; margin-top: 3px;
}
.ni-banner-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px; padding: 5px 12px;
  font-size: 12px; font-weight: 600; margin-top: 8px;
}
.ni-banner-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.9);
  animation: ni-pulse 1.6s ease-in-out infinite;
}

/* ============================================================
   §13 — PROGRESS STEPPER
============================================================ */
.ni-stepper-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px;
  box-shadow: var(--shadow-card); margin-bottom: 20px;
}
.ni-stepper-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 20px; }
.ni-stepper {
  display: flex; align-items: flex-start; gap: 0;
  position: relative;
}
.ni-step {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  position: relative;
}
.ni-step:not(:last-child)::after {
  content: '';
  position: absolute; top: 19px; left: 50%; right: -50%;
  height: 2px; background: var(--line-2); z-index: 0;
}
.ni-step.done:not(:last-child)::after { background: var(--green-2); }
.ni-step.active:not(:last-child)::after { background: var(--line-2); }
.ni-step-circle {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  position: relative; z-index: 1;
  background: #F4F0EB; color: var(--muted-2);
  border: 2px solid var(--line-2);
}
.ni-step.done .ni-step-circle {
  background: var(--green-soft); color: var(--green-2);
  border-color: var(--green-soft);
}
.ni-step.active .ni-step-circle {
  background: var(--maroon); color: #fff; border-color: var(--maroon);
}
.ni-step.active .ni-step-circle::before {
  content: '';
  position: absolute; inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--maroon);
  opacity: 0.35;
  animation: ni-spin 1.4s linear infinite;
  clip-path: inset(0 50% 0 0);
}
.ni-step-label {
  font-size: 11.5px; font-weight: 500; color: var(--muted);
  margin-top: 8px; text-align: center;
}
.ni-step.active .ni-step-label { color: var(--maroon); font-weight: 600; }
.ni-step.done .ni-step-label { color: var(--green); }

/* ============================================================
   §14 — DOCUMENT LIST
============================================================ */
.ni-doc-list { margin-top: 4px; }
.ni-doc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.ni-doc-item:last-child { border-bottom: none; }
.ni-doc-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ni-doc-icon svg { width: 18px; height: 18px; }
.ni-doc-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.ni-doc-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ============================================================
   §15 — QUICK LINKS (APPLICANT)
============================================================ */
.ni-quick-links {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin-bottom: 20px;
}
.ni-ql-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px;
  box-shadow: var(--shadow-card);
  text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 12px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.ni-ql-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-lg);
  color: var(--ink);
  text-decoration: none;
}
.ni-ql-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ni-ql-icon svg { width: 20px; height: 20px; }
.ni-ql-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.ni-ql-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ni-ql-arrow {
  margin-top: auto; display: flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: var(--maroon);
}
.ni-ql-arrow svg { width: 14px; height: 14px; }

/* ============================================================
   §16 — GREETING BAR (MEMBER)
============================================================ */
.ni-greeting-bar {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px 24px;
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-bottom: 20px;
}
.ni-greeting-left { display: flex; align-items: center; gap: 16px; }
.ni-greeting-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--maroon), var(--maroon-deep));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 700; overflow: hidden;
}
.ni-greeting-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ni-greeting-name { font-size: 18px; font-weight: 700; color: var(--ink); }
.ni-greeting-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.ni-gold-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold-soft); color: var(--gold);
  border-radius: 999px; padding: 5px 12px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.ni-gold-pill svg { width: 13px; height: 13px; }

/* ============================================================
   §17 — TABLES
============================================================ */
.ni-tbl { width: 100%; border-collapse: collapse; }
.ni-tbl thead th {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted); background: #FBF8F4;
  padding: 10px 22px; text-align: left;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.ni-tbl tbody td {
  font-size: 13px; padding: 13px 22px;
  border-bottom: 1px solid var(--line); color: var(--ink-2);
}
.ni-tbl tbody tr:last-child td { border-bottom: none; }
.ni-tbl tbody tr:hover td { background: var(--maroon-tint); }
.ni-amt-val {
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink);
}
.ni-ref-id { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.ni-td-right { text-align: right; }
.ni-ibtn {
  width: 28px; height: 28px; border-radius: 6px;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 80ms, color 80ms;
  text-decoration: none;
}
.ni-ibtn:hover { background: var(--maroon-tint); color: var(--maroon); }
.ni-ibtn svg { width: 14px; height: 14px; }

/* ============================================================
   §18 — LAYOUT UTILITIES
============================================================ */
.ni-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.ni-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.ni-row-full { margin-bottom: 20px; }

/* ============================================================
   §19 — FOOTER
============================================================ */
.ni-footer {
  margin-top: auto;
  padding: 14px 32px;
  font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

/* ============================================================
   §20 — PAGE HEADER
============================================================ */
.ni-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.ni-page-title { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.ni-page-sub   { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ============================================================
   §21 — STAT CARD INTERNALS (dashboard)
============================================================ */
.ni-stat-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 13px; padding: 20px 22px;
  box-shadow: var(--shadow-card);
  display: flex; align-items: flex-start; gap: 16px;
}
.ni-stat-icon {
  width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ni-stat-icon svg { width: 20px; height: 20px; }
.ni-stat-body { min-width: 0; }
.ni-stat-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted); }
.ni-stat-value { font-size: 24px; font-weight: 700; color: var(--ink);
  letter-spacing: -0.02em; margin-top: 4px; line-height: 1; }
.ni-stat-sub   { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; }

/* ============================================================
   §22 — GRID HELPERS
============================================================ */
.ni-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
@media (max-width: 900px) {
  .ni-stats-row { grid-template-columns: repeat(2,1fr); }
  .ni-grid-2    { grid-template-columns: 1fr; }
}

/* ============================================================
   §23 — CARD HEADER (alias + action link)
============================================================ */
.ni-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--line);
}
.ni-card-header .ni-card-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.ni-card-action { font-size: 12.5px; font-weight: 600; color: var(--maroon); text-decoration: none; }
.ni-card-action:hover { text-decoration: underline; }

/* card body padding (used without .ni-card-body when omitted) */
.ni-card-body { padding: 20px 22px; }

/* ============================================================
   §24 — EMPTY STATE
============================================================ */
.ni-empty {
  padding: 40px 22px; text-align: center;
  font-size: 13.5px; color: var(--muted);
}

/* ============================================================
   §25 — UTILITY: MONO, MUTED
============================================================ */
.ni-mono  { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.ni-muted { color: var(--muted); }

/* ============================================================
   §26 — ALERT BANNERS
============================================================ */
.ni-alert {
  border-radius: 9px; padding: 12px 16px; font-size: 13px; font-weight: 500;
  margin-bottom: 20px; border: 1px solid transparent;
}
.ni-alert-green { background: var(--green-soft);  color: var(--green); border-color: rgba(31,122,77,0.2); }
.ni-alert-red   { background: var(--red-soft);    color: var(--red);   border-color: rgba(180,35,24,0.2); }
.ni-alert-amber { background: var(--amber-soft);  color: var(--amber); border-color: rgba(183,121,31,0.2); }

/* ============================================================
   §27 — FORMS (member portal)
============================================================ */
.ni-form-group { margin-bottom: 18px; }
.ni-form-group label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 6px;
}
.ni-form-group input,
.ni-form-group select,
.ni-form-group textarea {
  width: 100%; box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  font-family: 'Inter', sans-serif; font-size: 13.5px;
  color: var(--ink); background: var(--bg); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ni-form-group input:focus,
.ni-form-group select:focus,
.ni-form-group textarea:focus {
  border-color: var(--maroon); box-shadow: 0 0 0 3px rgba(137,37,89,0.1);
}
.ni-form-group input:disabled,
.ni-form-group select:disabled {
  background: #F4F0EB; color: var(--muted); cursor: not-allowed;
}
.ni-form-hint { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ============================================================
   §28 — DETAIL TABLE (membership page)
============================================================ */
.ni-tbl-detail tbody th {
  width: 160px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 12px 22px; text-align: left; border-bottom: 1px solid var(--line);
  background: #FBF8F4; white-space: nowrap;
}
.ni-tbl-detail tbody td {
  font-size: 13px; padding: 12px 22px;
  border-bottom: 1px solid var(--line); color: var(--ink);
}
.ni-tbl-detail tbody tr:last-child th,
.ni-tbl-detail tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   §29 — EVENT LIST (dashboard)
============================================================ */
.ni-event-list { padding: 6px 0; }
.ni-event-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 13px 22px; border-bottom: 1px solid var(--line);
}
.ni-event-item:last-child { border-bottom: none; }
.ni-event-date-block {
  width: 44px; flex-shrink: 0; text-align: center;
  background: var(--maroon-tint); border-radius: 9px; padding: 6px 4px;
}
.ni-event-day { display: block; font-size: 18px; font-weight: 800; color: var(--maroon); line-height: 1; }
.ni-event-mon { display: block; font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin-top: 1px; }
.ni-event-info { min-width: 0; }
.ni-event-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ni-event-time { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ============================================================
   §30 — EVENT GRID (events page)
============================================================ */
.ni-event-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.ni-event-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 13px; box-shadow: var(--shadow-card);
  display: flex; gap: 0; overflow: hidden;
}
.ni-event-card-date {
  flex-shrink: 0; width: 72px;
  background: linear-gradient(160deg, var(--maroon) 0%, var(--maroon-deep) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px 8px;
}
.ni-ec-day { font-size: 26px; font-weight: 800; color: #fff; line-height: 1; }
.ni-ec-mon { font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: rgba(255,255,255,0.8); margin-top: 2px; }
.ni-ec-yr  { font-size: 10.5px; color: rgba(255,255,255,0.6); margin-top: 1px; }
.ni-event-card-body { flex: 1; padding: 16px 18px; min-width: 0; }
.ni-event-card-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.ni-event-card-desc  { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.ni-event-card-meta  {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px;
  font-size: 12px; color: var(--muted);
}
.ni-event-card-meta span { display: inline-flex; align-items: center; gap: 4px; }

/* ============================================================
   §31 — DIGITAL MEMBERSHIP CARD
============================================================ */
.ni-membership-card-wrap { perspective: 1000px; }
.ni-membership-card {
  max-width: 440px;
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-deep) 50%, var(--maroon-darker) 100%);
  border-radius: 18px; padding: 26px 28px 24px;
  color: #fff; box-shadow: var(--shadow-card-membership);
  position: relative; overflow: hidden;
}
.ni-membership-card::before {
  content: '';
  position: absolute; top: -80px; right: -80px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.ni-mc-top {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.ni-mc-logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.ni-mc-logo img { width: 26px; height: 26px; object-fit: contain; }
.ni-mc-org-name { font-size: 14px; font-weight: 800; letter-spacing: 0.05em; }
.ni-mc-org-sub  { font-size: 10.5px; opacity: 0.75; margin-top: 1px; }
.ni-mc-chip {
  margin-left: auto; width: 36px; height: 28px; border-radius: 5px;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.ni-mc-mid { margin-bottom: 24px; }
.ni-mc-name { font-size: 20px; font-weight: 700; letter-spacing: 0.02em; }
.ni-mc-type { font-size: 12.5px; font-weight: 600; opacity: 0.8; margin-top: 4px;
  text-transform: uppercase; letter-spacing: 0.12em; }
.ni-mc-bot {
  display: flex; flex-wrap: wrap; gap: 20px;
  padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.18);
}
.ni-mc-label { font-size: 10px; font-weight: 600; opacity: 0.65;
  text-transform: uppercase; letter-spacing: 0.1em; }
.ni-mc-val   { font-size: 13px; font-weight: 700; margin-top: 3px; }

/* ============================================================
   §31b — DUAL MEMBERSHIP CARD (front + back)
============================================================ */
.ni-mc-dual {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: stretch;   /* force both cards to the same height */
  margin-bottom: 28px;
}

/* Back card layout overrides */
.ni-mc-back {
  display: flex;
  flex-direction: column;
  padding: 0;           /* override front card padding */
  overflow: hidden;
}

/* Magnetic stripe — kept slim so total back height matches front */
.ni-mc-stripe {
  width: 100%; height: 28px;
  background: rgba(0,0,0,0.55);
  flex-shrink: 0;
}

/* Centre body fills remaining height */
.ni-mc-back-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  gap: 6px;
}

.ni-mc-back-label {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.65;
  text-align: center;
}

/* White box keeps QR scannable against the dark card */
.ni-mc-qr-wrap {
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.28);
}
.ni-mc-qr-wrap img {
  display: block;
  width: 110px;
  height: 110px;
}

.ni-mc-back-ref {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.9;
  text-align: center;
}

.ni-mc-back-url {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.55;
  text-align: center;
  letter-spacing: 0.06em;
}

/* Lock both cards to the same fixed width inside the dual wrapper */
.ni-mc-dual .ni-membership-card {
  flex: 0 0 440px;
  width: 440px;
  max-width: 440px;
}

/* Responsive: stack cards on narrow screens */
@media (max-width: 960px) {
  .ni-mc-dual { flex-direction: column; }
  .ni-mc-dual .ni-membership-card { flex: 1 1 auto; width: 100%; max-width: 100%; }
}

/* ============================================================
   §32 — NOTIF DROPDOWN WRAPPER
============================================================ */
.ni-notif-dropdown { position: relative; }

/* ============================================================
   §33 — RESPONSIVE: SIDEBAR OFFSET FOR ni-main
============================================================ */
.ni-main { margin-left: 280px; }
@media (max-width: 768px) {
  .ni-main { margin-left: 0; }
  .ni-stats-row { grid-template-columns: 1fr 1fr; }
  .ni-grid-2 { grid-template-columns: 1fr; }
  .ni-content { padding: 20px 16px 60px; }
  .ni-topbar { padding: 0 16px; }
}

/* ============================================================
   §34 — MOBILE SIDEBAR TOGGLE
============================================================ */
.ni-mob-toggle { display: none; }
@media (max-width: 768px) {
  .ni-mob-toggle { display: flex; }
}

.ni-mob-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 99;
  background: rgba(27,20,24,0.45);
}
.ni-mob-backdrop.active { display: block; }

@media (max-width: 768px) {
  .ni-sidebar {
    display: flex;
    transform: translateX(-100%);
    transition: transform 220ms ease;
    z-index: 100;
  }
  .ni-sidebar.open { transform: translateX(0); }
}

/* ============================================================
   §35 — MODAL
============================================================ */
.ni-modal-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 300;
  background: rgba(27,20,24,0.5);
  align-items: center; justify-content: center;
  padding: 24px;
}
.ni-modal-backdrop.open { display: flex; }

.ni-modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  animation: ni-modal-in 180ms ease;
}
@keyframes ni-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ni-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.ni-modal-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.ni-modal-close {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--line); background: none;
  font-size: 18px; color: var(--muted); cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background 80ms;
}
.ni-modal-close:hover { background: var(--red-soft); color: var(--red); border-color: var(--red-soft); }
.ni-modal-body { padding: 22px; }

/* ============================================================
   §36 — NOTIFICATIONS LIST
============================================================ */
.ni-notif-list {}
.ni-notif-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  transition: background 80ms;
}
.ni-notif-item:last-child { border-bottom: none; }
.ni-notif-item:hover { background: var(--maroon-tint); }
.ni-notif-unread { background: #FDFBFF; }
.ni-notif-unread:hover { background: var(--maroon-tint); }

.ni-notif-icon {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ni-notif-icon svg { width: 16px; height: 16px; }
.ni-notif-icon-green { background: var(--green-soft);  color: var(--green); }
.ni-notif-icon-amber { background: var(--amber-soft);  color: var(--amber); }
.ni-notif-icon-red   { background: var(--red-soft);    color: var(--red); }
.ni-notif-icon-blue  { background: var(--blue-soft);   color: var(--blue); }

.ni-notif-body { flex: 1; min-width: 0; }
.ni-notif-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ni-notif-title a { color: inherit; text-decoration: none; }
.ni-notif-title a:hover { color: var(--maroon); }
.ni-notif-msg  { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.ni-notif-time { font-size: 11.5px; color: var(--muted-2); margin-top: 5px; }

/* ============================================================
   §37 — PROFILE AVATAR (large)
============================================================ */
.ni-profile-avatar-lg {
  width: 80px; height: 80px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--maroon), var(--maroon-deep));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px; font-weight: 700; overflow: hidden;
}
.ni-profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   §38 — PAYMENT PAGE
============================================================ */
.ni-payment-success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}

/* ============================================================
   §39 — TOPBAR MOBILE
============================================================ */
@media (max-width: 768px) {
  .ni-bc-link, .ni-bc-sep { display: none; }
  .ni-bc-current { font-size: 15px; font-weight: 700; }
  .ni-av-name, .ni-av-role { display: none; }
  .ni-avatar-chip { padding: 4px; border: none; background: none; }
}
