:root {
  /* ---------------- Brand & core palette ----------------
     Modern indigo-navy + vibrant blue system (replaces the old
     orange/dark-slate palette) - soft-tint status colors instead of
     solid saturated ones, softer diffused shadows, larger radii. */
  --brand: #3B6FF0;
  --brand-dark: #2B54C4;
  --brand-light: #EAF0FE;
  --brand-rgb: 59, 111, 240;

  --dark: #10173A;
  --dark-2: #161F4D;
  --dark-border: rgba(255,255,255,0.08);

  --body-bg: #F5F7FC;
  --surface: #ffffff;
  --border: #E9ECF3;
  --text: #1B2340;
  --text-muted: #6B7280;

  --shadow-sm: 0 1px 2px rgba(16, 24, 64, 0.04);
  --shadow: 0 4px 18px rgba(16, 24, 64, 0.07);
  --shadow-lg: 0 10px 32px rgba(16, 24, 64, 0.14);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --success: #16A34A;   --success-bg: #E7F8ED;  --success-text: #157F3C;
  --danger:  #E11D48;   --danger-bg:  #FDECEE;  --danger-text:  #B0123A;
  --warning: #D97706;   --warning-bg: #FEF3E0;  --warning-text: #A85D04;
  --info:    #2563EB;   --info-bg:    #EAF0FE;  --info-text:    #1D4ED8;
  --neutral: #6B7280;   --neutral-bg: #EEF1F5;  --neutral-text: #52606D;

  --sidebar-width: 254px;
  --sidebar-collapsed-width: 76px;
  --topbar-height: 64px;
}

body {
  background-color: var(--body-bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { letter-spacing: -0.01em; }

/* ============================================================
   App shell layout: fixed left sidebar + main content area
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------------- Sidebar ---------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--dark), var(--dark-2));
  color: #fff;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.2s ease, transform 0.25s ease;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid var(--dark-border);
  white-space: nowrap;
  flex-shrink: 0;
}
.sidebar-brand img {
  height: 32px;
  width: 32px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 2px;
}
.sidebar-brand .brand-text {
  font-weight: 700;
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  padding: 14px 14px 24px;
  flex: 1;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 30px 20px;
  border-bottom: 1px solid var(--dark-border);
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(var(--brand-rgb), 0.35);
}
.sidebar-user-info {
  overflow: hidden;
  min-width: 0;
}
.sidebar-user-name {
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  color: rgba(255,255,255,0.45);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
body.sidebar-collapsed .sidebar-user-info,
body.sidebar-collapsed .sidebar-user {
  justify-content: center;
}
body.sidebar-collapsed .sidebar-user-info {
  display: none;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.65);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.sidebar-nav .nav-link i {
  font-size: 1.05rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-nav .nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.sidebar-nav .nav-link.active {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(var(--brand-rgb), 0.35);
}
.sidebar-nav .nav-link.active i {
  color: #fff;
}

.nav-section-label {
  text-transform: uppercase;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.32);
  padding: 18px 14px 8px;
  white-space: nowrap;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,12,30,0.55);
  z-index: 1030;
  backdrop-filter: blur(1px);
}

/* ---------------- Main content area ---------------- */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.2s ease;
}

.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.toggle-btn {
  background: none;
  border: none;
  font-size: 1.35rem;
  color: var(--text);
  cursor: pointer;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: background 0.15s ease;
}
.toggle-btn:hover {
  background: var(--body-bg);
}

.topbar-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  flex: 1;
}

.topbar-user {
  white-space: nowrap;
}
.topbar-user .dropdown-toggle {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

/* ---------------- Topbar search ---------------- */
.topbar-search {
  max-width: 380px;
  position: relative;
}
.topbar-search-input {
  padding-left: 36px;
  background: var(--body-bg);
  border-color: var(--border);
  border-radius: var(--radius-pill);
}
.topbar-search-input:focus {
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-light);
}
.topbar-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa1ac;
  z-index: 2;
}
.search-results-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 360px;
  overflow-y: auto;
  z-index: 1050;
}
.search-results-dropdown.show { display: block; }
.search-results-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--body-bg);
}
.search-results-dropdown a:hover { background: var(--body-bg); }
.search-results-dropdown .search-empty {
  padding: 14px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------------- Notification bell ---------------- */
.topbar-bell {
  position: relative;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}
.topbar-bell:hover { background: var(--body-bg); }
.bell-badge {
  position: absolute;
  top: -1px;
  right: 0px;
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 50%;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  box-shadow: 0 0 0 2px var(--surface);
}
.notif-dropdown {
  width: 320px;
  max-height: 380px;
  overflow-y: auto;
}

@media (max-width: 767.98px) {
  .topbar-search { max-width: 160px; }
  .topbar-search-input::placeholder { font-size: 0.78rem; }
}

.content-area {
  flex: 1;
}

/* ============================================================
   Desktop: collapse to a slim icon-only rail
   ============================================================ */
@media (min-width: 992px) {
  body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
  }
  body.sidebar-collapsed .sidebar .brand-text,
  body.sidebar-collapsed .sidebar .nav-link span,
  body.sidebar-collapsed .sidebar .nav-section-label {
    display: none;
  }
  body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 18px 8px;
  }
  body.sidebar-collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 12px 8px;
  }
  body.sidebar-collapsed .main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
  }
}

/* ============================================================
   Mobile / tablet: off-canvas sidebar, full-width content
   ============================================================ */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }
  .sidebar .brand-text,
  .sidebar .nav-link span,
  .sidebar .nav-section-label {
    display: block;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar-backdrop {
    display: block;
  }
  .main-wrapper {
    margin-left: 0 !important;
  }
  .topbar-title {
    font-size: 0.95rem;
  }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 500;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.btn-sm { border-radius: 8px; }
.btn-lg { border-radius: 12px; }

.btn-brand {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.28);
}
.btn-brand:hover,
.btn-brand:focus {
  background-color: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.btn-outline-secondary {
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-outline-secondary:hover {
  background: var(--body-bg);
  border-color: var(--border);
  color: var(--text);
}

/* ============================================================
   Cards, tables, badges - shared across every page
   ============================================================ */
.card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.table thead {
  background-color: var(--body-bg);
}
.table thead th {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  border-bottom-width: 1px;
}
.table > :not(caption) > * > * {
  border-bottom-color: var(--border);
}
.table-hover > tbody > tr:hover > * {
  background-color: var(--brand-light);
}

/* Denser variant for wide/data-heavy tables (many columns) - smaller text
   and tighter cell padding so everything fits without feeling cramped. */
.table-compact {
  font-size: 0.8rem; /* 20% smaller than the default 1rem table text */
}
.table-compact th,
.table-compact td {
  padding: 0.55rem 0.7rem;
}
.table-compact thead th {
  font-size: 0.72rem;
}
.table-compact .member-avatar,
.table-compact .member-avatar-placeholder {
  width: 30px;
  height: 30px;
  font-size: 0.8rem;
}
.table-compact .badge {
  font-size: 0.68rem;
  padding: 0.32em 0.6em;
}
.table-compact .btn-sm {
  padding: 0.2rem 0.5rem;
  font-size: 0.76rem;
}

/* Plan/Package cards (Membership Plans, Training Packages): keep every card in
   a row visually identical regardless of whether its description is empty or
   long, so the Edit/Delete buttons always land in the same spot. */
.plan-card-body {
  display: flex;
  flex-direction: column;
}
.plan-card-desc {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 1.35em;
}
.plan-card-actions {
  margin-top: auto;
  padding-top: 0.75rem;
}

/* Soft-tint pill badges (signature of this theme - replaces old solid-color badges) */
.badge {
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.74rem;
  padding: 0.4em 0.75em;
  letter-spacing: 0.01em;
}
.badge-active   { background-color: var(--success-bg); color: var(--success-text); }
.badge-expired  { background-color: var(--danger-bg);  color: var(--danger-text); }
.badge-inactive { background-color: var(--neutral-bg); color: var(--neutral-text); }
.badge-pending  { background-color: var(--warning-bg); color: var(--warning-text); }

/* Soften the generic Bootstrap status badges used ad hoc across a few pages
   (bg-success/bg-danger/bg-warning/bg-info) to match the same soft-tint style. */
.badge.bg-success { background-color: var(--success-bg) !important; color: var(--success-text) !important; }
.badge.bg-danger  { background-color: var(--danger-bg)  !important; color: var(--danger-text)  !important; }
.badge.bg-warning { background-color: var(--warning-bg) !important; color: var(--warning-text) !important; }
.badge.bg-info    { background-color: var(--info-bg)    !important; color: var(--info-text)    !important; }
.badge.bg-secondary { background-color: var(--neutral-bg) !important; color: var(--neutral-text) !important; }

/* ============================================================
   Stat tiles (dashboard, reports) - kept as gradient tiles per
   existing markup, refined to feel premium rather than flat.
   ============================================================ */
.stat-card {
  border-radius: var(--radius);
  color: #fff;
  padding: 1.35rem 1.5rem;
  display: block;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.stat-card-watermark {
  position: absolute;
  right: -10px;
  bottom: -14px;
  font-size: 4.2rem;
  opacity: 0.15;
  pointer-events: none;
}
.stat-card p, .stat-card h3 {
  position: relative;
  z-index: 1;
}
.stat-card p {
  font-size: 0.82rem;
  font-weight: 500;
  margin: 0;
  opacity: 0.92;
}
.stat-card h3 {
  margin: 0.15rem 0 0;
  font-weight: 700;
  font-size: 1.6rem;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  color: #fff;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 5px;
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ============================================================
   Premium stat tiles - white card + soft-tinted icon badge + big
   number + an optional trend/context line. Used on the dashboard
   in place of the old solid-gradient tiles. IMPORTANT: the trend
   line must only ever show real, already-available numbers (e.g.
   "62% of total") - never invent a growth percentage with no
   query backing it.
   ============================================================ */
.stat-tile {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  height: 100%;
}
.stat-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  color: inherit;
}
.stat-tile-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.9rem;
}
.stat-tile-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.15rem;
}
.stat-tile-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.stat-tile-meta {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-tile-meta.trend-up      { color: var(--success-text); }
.stat-tile-meta.trend-down    { color: var(--danger-text); }
.stat-tile-meta.trend-neutral { color: var(--text-muted); font-weight: 500; }

.stat-tile-icon.tint-brand  { background: var(--brand-light); color: var(--brand); }
.stat-tile-icon.tint-green  { background: var(--success-bg);  color: var(--success); }
.stat-tile-icon.tint-red    { background: var(--danger-bg);   color: var(--danger); }
.stat-tile-icon.tint-blue   { background: var(--info-bg);     color: var(--info); }
.stat-tile-icon.tint-purple { background: #F1EAFE; color: #7C3AED; }
.stat-tile-icon.tint-teal   { background: #E3FBF8; color: #0F9C8F; }

body.dark-mode .stat-tile { background-color: #131A30; }
body.dark-mode .stat-tile-value { color: #DCE1EC; }

/* ============================================================
   Alert-style list rows (e.g. "Memberships Expiring Soon") -
   colored left accent bar + tinted icon, matches the reference's
   alert-panel treatment. Built entirely from real existing data.
   ============================================================ */
.alert-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  margin-bottom: 6px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s ease;
}
.alert-row:last-child { margin-bottom: 0; }
.alert-row:hover { background: var(--body-bg); color: var(--text); }
.alert-row-title { font-weight: 600; font-size: 0.87rem; }
.alert-row-sub { font-size: 0.78rem; color: var(--text-muted); }
.alert-row.severity-danger  { border-left-color: var(--danger); }
.alert-row.severity-warning { border-left-color: var(--warning); }

body.dark-mode .alert-row:hover { background: #1B2445; }

/* Soft-tint summary chips (e.g. Income vs Expenses range summary) */
.stat-chip { border-radius: var(--radius-sm); padding: 1rem; }
.stat-chip.chip-success { background: var(--success-bg); }
.stat-chip.chip-danger  { background: var(--danger-bg); }
.stat-chip.chip-info    { background: var(--info-bg); }
body.dark-mode .stat-chip.chip-success { background: rgba(22,163,74,0.15); }
body.dark-mode .stat-chip.chip-danger  { background: rgba(225,29,72,0.15); }
body.dark-mode .stat-chip.chip-info    { background: rgba(37,99,235,0.15); }

/* Curated gradient palette (replaces the old ad-hoc orange/blue/green/purple mix) */
.bg-brand { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); }
.bg-blue  { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }
.bg-green { background: linear-gradient(135deg, #22C55E, #15803D); }
.bg-purple{ background: linear-gradient(135deg, #8B5CF6, #6D28D9); }
.bg-teal  { background: linear-gradient(135deg, #14B8A6, #0F766E); }
.bg-orange{ background: linear-gradient(135deg, #FB923C, #C2410C); }
.bg-red   { background: linear-gradient(135deg, #F43F5E, #BE123C); }

.report-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.report-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.report-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
}

.dash-hero {
  background: linear-gradient(120deg, var(--dark), var(--dark-2) 60%, #1B2B6B);
  border-radius: var(--radius);
  padding: 30px 34px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.dash-hero h3, .dash-hero p { position: relative; z-index: 1; }
.dash-hero p.text-muted { color: rgba(255,255,255,0.65) !important; }
.dash-hero-icon {
  font-size: 6rem;
  color: rgba(255,255,255,0.08);
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}
@media (max-width: 575.98px) {
  .dash-hero { padding: 20px; }
  .dash-hero-icon { font-size: 4rem; }
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dark), var(--dark-2) 55%, #1B2B6B);
}

.login-card {
  width: 380px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.member-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.member-avatar-lg {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 4px solid var(--brand-light);
  box-shadow: var(--shadow-lg);
}
.member-avatar-lg.member-avatar-placeholder {
  font-size: 2.5rem;
  border: 4px solid var(--brand-light);
}

/* ============================================================
   Form controls - consistent rounding/focus ring app-wide
   ============================================================ */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border);
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-light);
}
.form-label {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text);
}

/* ============================================================
   Member portal navbar
   ============================================================ */
.portal-navbar {
  background: linear-gradient(120deg, var(--dark), var(--dark-2) 60%, #1B2B6B);
  padding: 14px 0;
}
.portal-navbar .navbar-brand {
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.portal-navbar .navbar-brand img {
  height: 28px;
  width: 28px;
  border-radius: 6px;
  background: #fff;
  padding: 2px;
  object-fit: contain;
}
.portal-nav-pills .nav-link {
  color: rgba(255,255,255,0.7);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  margin: 0 2px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.portal-nav-pills .nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.portal-nav-pills .nav-link.active {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}
.portal-logout-btn {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}
.portal-logout-btn:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* ============================================================
   Dark mode
   ============================================================ */
body.dark-mode {
  background-color: #0B0F1E;
  color: #DCE1EC;
}
body.dark-mode .card,
body.dark-mode .topbar,
body.dark-mode .report-card {
  background-color: #131A30;
  color: #DCE1EC;
}
body.dark-mode .card-header {
  background-color: #171F3A !important;
  color: #DCE1EC;
  border-color: #232C4D;
}
body.dark-mode .table {
  color: #DCE1EC;
}
body.dark-mode .table thead {
  background-color: #171F3A;
  color: #DCE1EC;
}
body.dark-mode .table td,
body.dark-mode .table th {
  border-color: #232C4D;
}
body.dark-mode .table-hover > tbody > tr:hover > * {
  background-color: #1B2445;
}
body.dark-mode .form-control,
body.dark-mode .form-select {
  background-color: #171F3A;
  color: #DCE1EC;
  border-color: #2A3560;
}
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
  background-color: #171F3A;
  color: #DCE1EC;
}
body.dark-mode .text-dark,
body.dark-mode .topbar-title,
body.dark-mode .toggle-btn,
body.dark-mode .topbar-bell,
body.dark-mode .topbar-user .dropdown-toggle,
body.dark-mode .toggle-btn i,
body.dark-mode .topbar-bell i,
body.dark-mode .topbar-user .dropdown-toggle i {
  color: #DCE1EC !important;
}
body.dark-mode .topbar-user-avatar {
  color: #fff !important;
}
body.dark-mode .topbar-search-input {
  background-color: #171F3A;
  border-color: #2A3560;
  color: #DCE1EC;
}
body.dark-mode .toggle-btn:hover,
body.dark-mode .topbar-bell:hover {
  background: #1B2445;
}
body.dark-mode .search-results-dropdown,
body.dark-mode .notif-dropdown,
body.dark-mode .dropdown-menu {
  background-color: #131A30;
  color: #DCE1EC;
}
body.dark-mode .search-results-dropdown a,
body.dark-mode .dropdown-item {
  color: #DCE1EC;
}
body.dark-mode .search-results-dropdown a:hover,
body.dark-mode .dropdown-item:hover {
  background-color: #1B2445;
  color: #fff;
}
body.dark-mode .dropdown-header {
  color: #8A93A8;
}
body.dark-mode .dropdown-divider {
  border-color: #2A3560;
}
body.dark-mode .text-muted {
  color: #8A93A8 !important;
}
body.dark-mode .badge-active   { background-color: rgba(22,163,74,0.18);  color: #4ADE80; }
body.dark-mode .badge-expired  { background-color: rgba(225,29,72,0.18);  color: #FB7185; }
body.dark-mode .badge-inactive { background-color: rgba(107,114,128,0.22); color: #9AA4B2; }
body.dark-mode .badge-pending  { background-color: rgba(217,119,6,0.20);  color: #FBBF24; }
