/*!
 * CareerBridge Academic Design System
 * Version: 4.0.0
 * 
 * A single comprehensive theme file for the CareerBridge system.
 * Replaces: theme.css, theme-careerbridge.css, theme-dashboard.css
 * 
 * Design Language: Modern Academic
 * Primary: Deep Maroon (#7B1113)
 * Accent: Academic Gold (#C4972A)
 * Typography: Poppins
 */

/* ============================================
   1. DESIGN TOKENS
   ============================================ */

:root {
  /* Brand Colors */
  --cb-primary: #7B1113;
  --cb-primary-hover: #5E0D0F;
  --cb-primary-light: #9B2D30;
  --cb-primary-bg: rgba(123, 17, 19, 0.08);
  --cb-primary-bg-hover: rgba(123, 17, 19, 0.12);
  
  /* Accent - Academic Gold */
  --cb-accent: #C4972A;
  /* Darker gold for small text/icons on light backgrounds (AA contrast) */
  --cb-accent-text: #7A611C;
  --cb-accent-hover: #A67F20;
  --cb-accent-bg: rgba(196, 151, 42, 0.10);
  
  /* Backgrounds */
  --cb-bg-app: #FAF8F5;
  --cb-bg-card: #FFFFFF;
  --cb-bg-sidebar: #FFFFFF;
  --cb-bg-hover: #F5F2EF;
  --cb-bg-active: rgba(123, 17, 19, 0.06);
  
  /* Text */
  --cb-text-primary: #1A1A1A;
  --cb-text-secondary: #6B6560;
  --cb-text-muted: #6E6963;
  --cb-text-inverse: #FFFFFF;
  
  /* Borders */
  --cb-border: #E8E0D8;
  --cb-border-light: #F0EBE6;
  --cb-border-focus: #7B1113;
  
  /* Status Colors */
  --cb-success: #166534;
  --cb-success-bg: rgba(22, 101, 52, 0.08);
  --cb-danger: #991B1B;
  --cb-danger-bg: rgba(153, 27, 27, 0.08);
  --cb-warning: #92400E;
  --cb-warning-bg: rgba(146, 64, 14, 0.08);
  --cb-info: #1E40AF;
  --cb-info-bg: rgba(30, 64, 175, 0.08);
  
  /* Shadows - Warm tinted */
  --cb-shadow-xs: 0 1px 2px rgba(26, 26, 26, 0.04);
  --cb-shadow-sm: 0 1px 3px rgba(26, 26, 26, 0.06), 0 1px 2px rgba(26, 26, 26, 0.04);
  --cb-shadow-md: 0 4px 6px -1px rgba(26, 26, 26, 0.06), 0 2px 4px -2px rgba(26, 26, 26, 0.04);
  --cb-shadow-lg: 0 10px 15px -3px rgba(26, 26, 26, 0.06), 0 4px 6px -4px rgba(26, 26, 26, 0.04);
  --cb-shadow-xl: 0 20px 25px -5px rgba(26, 26, 26, 0.08), 0 8px 10px -6px rgba(26, 26, 26, 0.04);
  
  /* Typography */
  --cb-font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --cb-font-mono: 'IBM Plex Mono', 'Consolas', monospace;
  
  /* Spacing */
  --cb-radius-sm: 6px;
  --cb-radius-md: 8px;
  --cb-radius-lg: 12px;
  --cb-radius-xl: 16px;
  --cb-radius-full: 9999px;
  
  /* Sidebar */
  --cb-sidebar-width: 260px;
  --cb-sidebar-hover: rgba(123, 17, 19, 0.04);
  --cb-sidebar-active: rgba(123, 17, 19, 0.08);
  
  /* Transitions */
  --cb-transition-fast: 150ms ease;
  --cb-transition-normal: 200ms ease;
  --cb-transition-slow: 300ms ease;
}

/* ============================================
   2. DARK MODE TOKENS
   ============================================ */

body.dark-mode {
  --cb-primary: #B83538;
  --cb-primary-hover: #D44548;
  --cb-primary-light: #9B2D30;
  --cb-primary-bg: rgba(184, 53, 56, 0.15);
  --cb-primary-bg-hover: rgba(184, 53, 56, 0.20);
  
  --cb-accent: #D4A843;
  --cb-accent-hover: #E0B855;
  --cb-accent-bg: rgba(212, 168, 67, 0.15);
  
  --cb-bg-app: #141210;
  --cb-bg-card: #1C1A17;
  --cb-bg-sidebar: #1A1816;
  --cb-bg-hover: #252320;
  --cb-bg-active: rgba(184, 53, 56, 0.12);
  
  --cb-text-primary: #F0EDE8;
  --cb-text-secondary: #A09890;
  --cb-text-muted: #A89E95;
  --cb-text-inverse: #1A1A1A;
  
  --cb-border: #2E2B28;
  --cb-border-light: #242220;
  --cb-border-focus: #B83538;
  
  --cb-success: #4ADE80;
  --cb-success-bg: rgba(74, 222, 128, 0.12);
  --cb-danger: #F87171;
  --cb-danger-bg: rgba(248, 113, 113, 0.12);
  --cb-warning: #FBBF24;
  --cb-warning-bg: rgba(251, 191, 36, 0.12);
  --cb-info: #60A5FA;
  --cb-info-bg: rgba(96, 165, 250, 0.12);
  
  --cb-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --cb-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --cb-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --cb-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
  --cb-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  
  --cb-sidebar-hover: rgba(184, 53, 56, 0.10);
  --cb-sidebar-active: rgba(184, 53, 56, 0.18);
}

/* ============================================
   3. TYPOGRAPHY OVERRIDE
   ============================================ */

body,
body.nk-body {
  font-family: var(--cb-font-family) !important;
  color: var(--cb-text-primary) !important;
  background: var(--cb-bg-app) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Force Poppins globally - override DashLite's Roboto */
body {
  --bs-font-sans-serif: var(--cb-font-family);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--cb-text-primary);
  font-weight: 600;
}

/* ============================================
   4. APP LAYOUT
   ============================================ */

body, html {
  background: var(--cb-bg-app) !important;
}

.nk-content,
.nk-wrap,
.nk-main,
.nk-content-body,
.nk-content-wrap,
.nk-app-root,
.nk-block,
.nk-block-head,
.nk-page-head,
.page-body,
.page-content,
.main-content {
  background: var(--cb-bg-app) !important;
}

.nk-content-body,
.nk-content-wrap {
  padding: 0;
}

/* No topbar — remove all top margin from content */
.nk-header-fixed + .nk-content {
  margin-top: 0 !important;
}

/* ============================================
   NO-TOPBAR LAYOUT — sidebar + content side by side
   Sidebar lives INSIDE .nk-content > .container-fluid >
   .nk-content-inner, so strip every inset that would push
   the sidebar off the viewport edge. Padding belongs on
   .nk-content-body, not on its ancestors.
   ============================================ */
body.no-topbar .nk-content {
  padding: 0 !important;
  margin: 0 !important;
}

body.no-topbar .nk-content > .container-fluid {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
}

body.no-topbar .nk-content-inner {
  display: flex !important;
  align-items: stretch;
  gap: 0;
  padding: 0 !important;
  margin: 0 !important;
}

body.no-topbar .nk-content-body {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  padding: 24px !important;
}

@media (max-width: 575px) {
  body.no-topbar .nk-content-body {
    padding: 16px !important;
  }
}

/* Override DashLite's content-body width calc — let flex handle it */
.has-aside .nk-content-body {
  width: auto !important;
  flex: 1 !important;
  min-width: 0 !important;
  padding: 0 !important;
}

/* Content inner — proper flex layout */
.has-aside .nk-content-inner {
  display: flex !important;
  gap: 0;
}

/* Override DashLite's nk-aside margin */
.nk-aside {
  margin-right: 0 !important;
}

/* ============================================
   5. SIDEBAR
   ============================================ */

/* ============================================
   SIDEBAR — FaculTeach-Inspired Clean Design
   ============================================ */

/* Sidebar container — mobile first (fixed overlay) */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--cb-sidebar-width);
  height: 100vh;
  background: var(--cb-bg-sidebar);
  border-right: 1px solid var(--cb-border);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: background var(--cb-transition-normal), border-color var(--cb-transition-normal), transform var(--cb-transition-normal);
}

.sidebar.open {
  transform: translateX(0);
}

/* Desktop — sidebar becomes a sticky flex child, flush left */
@media (min-width: 992px) {
  .sidebar {
    position: sticky;
    top: 0;
    left: 0;
    transform: none;
    flex-shrink: 0;
    flex-grow: 0;
    align-self: flex-start;
    width: var(--cb-sidebar-width);
    min-width: var(--cb-sidebar-width);
    height: 100vh;
    margin: 0;
    /* Own stacking context above page content (below Bootstrap modals
       at 1050+) so header dropdowns never render under cards */
    z-index: 1020;
    border-right: 1px solid var(--cb-border);
  }
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  /* Visible (not hidden/auto): the bell + gear dropdowns are wider than
     the 260px sidebar and must paint over the content area. Inner
     scrolling is handled by .sidebar-nav, and data-simplebar is NOT
     used here so SimpleBar can't wrap this node and re-clip it. */
  overflow: visible;
  padding: 0;
}

/* ============================================
   SIDEBAR HEADER — Profile + Name + Actions
   ============================================ */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--cb-border-light);
  flex-shrink: 0;
  min-height: 60px;
}

.sidebar-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: var(--cb-text-secondary);
  cursor: pointer;
  border-radius: var(--cb-radius-md);
  flex-shrink: 0;
  transition: all var(--cb-transition-fast);
}

.sidebar-hamburger:hover {
  background: var(--cb-bg-hover);
  color: var(--cb-text-primary);
}

.sidebar-hamburger:focus-visible,
.mobile-menu-btn:focus-visible,
.mobile-topbar-account:focus-visible,
.mobile-topbar-brand:focus-visible {
  outline: 2px solid var(--cb-primary);
  outline-offset: 2px;
}

.sidebar-header-logo {
  flex-shrink: 0;
}

.sidebar-header-logo img {
  width: 36px;
  height: 36px;
  border-radius: var(--cb-radius-md);
  object-fit: contain;
}

.sidebar-header-info {
  flex: 1;
  min-width: 0;
}

.sidebar-header-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--cb-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.sidebar-header-role {
  font-size: 11px;
  font-weight: 500;
  color: var(--cb-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.sidebar-header-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--cb-radius-md);
  color: var(--cb-text-secondary);
  text-decoration: none;
  transition: all var(--cb-transition-fast);
  position: relative;
}

.sidebar-header-action:hover {
  background: var(--cb-bg-hover);
  color: var(--cb-text-primary);
}

/* Notification badge inside sidebar header */
.sidebar-header-action .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--cb-danger);
  border-radius: 50%;
  border: 2px solid var(--cb-bg-sidebar);
}

/* Override notification dropdown for sidebar header */
.sidebar-header-actions .notification-dropdown-wrapper .dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--cb-text-secondary);
}

.sidebar-header-actions .notification-dropdown-wrapper .dropdown-toggle:hover {
  color: var(--cb-text-primary);
  background: var(--cb-bg-hover);
  border-radius: var(--cb-radius-md);
}

/* Bell sits near the viewport's left edge, so the 380px panel must
   open left-aligned — right-aligned would run off-screen. The inline
   right:0 on the panel is overridden here. */
.sidebar-header-actions .notification-dropdown .notification-panel {
  left: 0 !important;
  right: auto !important;
  max-width: calc(100vw - 32px);
  /* Above Bootstrap dropdown menus (z-index 1000) and page content */
  z-index: 1060 !important;
}

/* Bell matches the 34px gear button next to it */
.sidebar-header-actions .notification-bell {
  width: 34px;
  height: 34px;
}

.sidebar-header-actions .notification-bell .icon {
  font-size: 18px;
}

/* ============================================
   SIDEBAR HEADER DROPDOWNS — design system
   The gear menu reuses DashLite markup (.dropdown-menu,
   .user-card, .link-list); restyle it with CB tokens so it
   matches the sidebar instead of the default theme.
   ============================================ */
.sidebar-header .dropdown-menu {
  min-width: 250px;
  padding: 6px;
  margin-top: 8px !important;
  background: var(--cb-bg-card) !important;
  border: 1px solid var(--cb-border) !important;
  border-radius: var(--cb-radius-lg);
  box-shadow: var(--cb-shadow-lg);
}

.sidebar-header .dropdown-menu .dropdown-inner {
  padding: 0;
}

.sidebar-header .dropdown-menu .dropdown-inner + .dropdown-inner {
  border-top: 1px solid var(--cb-border-light);
  margin-top: 6px;
  padding-top: 6px;
}

.sidebar-header .user-card-wrap.bg-lighter {
  background: transparent !important;
  border: none;
}

.sidebar-header .user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

.sidebar-header .user-card .user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--cb-radius-full);
  background: var(--cb-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-header .user-card .user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-header .user-card .lead-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--cb-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-header .user-card .sub-text {
  font-size: 11px;
  color: var(--cb-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-header .link-list {
  list-style: none;
  margin: 0;
  padding: 4px;
}

.sidebar-header .link-list li {
  margin: 0;
}

.sidebar-header .link-list a,
.sidebar-header .link-list .link-list-signout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: none;
  border-radius: var(--cb-radius-md);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  color: var(--cb-text-secondary) !important;
  text-decoration: none;
  text-align: left;
  transition: all var(--cb-transition-fast);
}

.sidebar-header .link-list a .icon,
.sidebar-header .link-list .link-list-signout .icon {
  font-size: 16px;
  width: 18px;
  text-align: center;
  color: var(--cb-text-muted);
  transition: color var(--cb-transition-fast);
}

.sidebar-header .link-list a:hover,
.sidebar-header .link-list .link-list-signout:hover {
  background: var(--cb-bg-hover) !important;
  color: var(--cb-text-primary) !important;
}

.sidebar-header .link-list a:hover .icon,
.sidebar-header .link-list .link-list-signout:hover .icon {
  color: var(--cb-primary);
}

.sidebar-header .link-list .link-list-signout:hover {
  background: var(--cb-danger-bg) !important;
  color: var(--cb-danger) !important;
}

.sidebar-header .link-list .link-list-signout:hover .icon {
  color: var(--cb-danger);
}

/* Navigation container */
.sidebar-nav {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
}

/* Section group */
.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cb-text-muted);
  padding: 16px 12px 8px;
  margin: 0;
}

/* Navigation links */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--cb-radius-md);
  color: var(--cb-text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--cb-transition-fast);
  margin-bottom: 2px;
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  color: var(--cb-text-muted);
  flex-shrink: 0;
  transition: color var(--cb-transition-fast);
}

.sidebar-link:hover {
  background: var(--cb-sidebar-hover);
  color: var(--cb-text-primary);
}

.sidebar-link:hover svg {
  color: var(--cb-text-primary);
}

/* Active state — solid pill background */
.sidebar-link.active {
  background: var(--cb-primary);
  color: var(--cb-text-inverse);
  font-weight: 600;
}

.sidebar-link.active svg {
  color: var(--cb-text-inverse);
}

/* Footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--cb-border-light);
  margin-top: auto;
  flex-shrink: 0;
}

/* Sidebar copyright */
.sidebar-copyright {
  padding: 4px 12px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--cb-text-muted);
  text-align: center;
}

.sidebar-copyright span {
  display: block;
}

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  opacity: 0;
  transition: opacity var(--cb-transition-normal);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

@media (min-width: 992px) {
  .sidebar-close {
    display: none !important;
  }
}

/* Dark mode */
body.dark-mode .sidebar {
  background: var(--cb-bg-sidebar);
  border-right-color: var(--cb-border);
}

body.dark-mode .sidebar-header {
  border-bottom-color: var(--cb-border-light);
}

body.dark-mode .sidebar-link.active {
  background: var(--cb-primary);
}

body.dark-mode .sidebar-footer {
  border-top-color: var(--cb-border-light);
}

/* ============================================
   6. HEADER / NAVBAR — Hidden (no topbar)
   ============================================ */

/* Completely hide the navbar */
.nk-header,
.nk-header-fixed {
  display: none !important;
}

/* Remove gap between header and content */
.nk-header-fixed + .nk-content {
  margin-top: 0 !important;
}

/* Dropdown menu — kept for sidebar dropdowns */
.dropdown-menu-s1 {
  background: var(--cb-bg-card) !important;
  border: 1px solid var(--cb-border) !important;
  border-radius: var(--cb-radius-lg);
  box-shadow: var(--cb-shadow-lg);
}

.dropdown-menu .link-list a {
  color: var(--cb-text-secondary) !important;
  transition: all var(--cb-transition-fast);
}

.dropdown-menu .link-list a:hover {
  color: var(--cb-text-primary) !important;
  background: var(--cb-bg-hover) !important;
}

.user-card-wrap.bg-lighter {
  background: var(--cb-bg-app) !important;
  border-bottom: 1px solid var(--cb-border);
}

/* ============================================
   CONTENT AREA — Modernization
   ============================================ */

/* Content wrapper */
.nk-content {
  background: var(--cb-bg-app);
  padding: 16px !important;
}

@media (min-width: 576px) {
  .nk-content {
    padding: 20px !important;
  }
}

@media (min-width: 992px) {
  .nk-content {
    padding: 24px !important;
  }
}

.nk-content-wrap {
  padding: 0;
}

@media (max-width: 575px) {
  .nk-content-wrap {
    padding: 16px;
  }
}

/* Page blocks spacing */
.nk-block {
  margin-bottom: 24px;
}

.nk-block:last-child {
  margin-bottom: 0;
}

.nk-block-head {
  margin-bottom: 20px;
}

.nk-block-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--cb-text-primary);
  margin-bottom: 4px;
}

.nk-block-sub-title {
  font-size: 13px;
  color: var(--cb-text-secondary);
  margin-bottom: 0;
}

/* Table cards */
.nk-block .card .card-inner {
  padding: 0;
}

/* Lesson reading cards need Dashlite's native card padding back: the
   table rule above also matches them, pinning content to all four
   borders. Scoped narrowly so tables and other pages are untouched. */
.nk-block .card.support-topic-details > .card-inner,
.nk-block .card.support-topic-more > .card-inner {
  padding: 1.25rem;
}

/* Divider between stacked Previous / Next lesson links. */
.nk-block .card.support-topic-more > .card-inner + .card-inner {
  border-top: 1px solid var(--cb-border, #dbdfea);
}

.nk-block .card .card-table {
  margin: 0;
}

/* Form spacing */
.nk-block .form-group {
  margin-bottom: 20px;
}

.nk-block .form-label {
  font-weight: 500;
  color: var(--cb-text-primary);
  margin-bottom: 6px;
}

/* Alert in blocks */
.nk-block .alert {
  margin-bottom: 20px;
}

/* ============================================
   7. CARDS
   ============================================ */

.card,
.card-bordered,
.nk-block .card,
.card-full {
  background: var(--cb-bg-card);
  border: 1px solid var(--cb-border) !important;
  border-radius: var(--cb-radius-lg) !important;
  box-shadow: var(--cb-shadow-xs);
  transition: box-shadow var(--cb-transition-normal), border-color var(--cb-transition-normal);
}

.card:hover {
  box-shadow: var(--cb-shadow-sm);
}

.card-body {
  background: transparent;
}

.card-inner {
  background: transparent;
}

/* ============================================
   8. STAT CARDS
   ============================================ */

.stat-card {
  background: var(--cb-bg-card);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--cb-transition-normal), box-shadow var(--cb-transition-normal);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--cb-shadow-md);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-card-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--cb-text-secondary);
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--cb-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* Stat card color variants */
.stat-card--light-orange .stat-card-icon {
  background: var(--cb-primary-bg);
  color: var(--cb-primary);
}

.stat-card--light-teal .stat-card-icon {
  background: rgba(196, 151, 42, 0.10);
  color: var(--cb-accent-text);
}

.stat-card--light-green .stat-card-icon {
  background: var(--cb-success-bg);
  color: var(--cb-success);
}

.stat-card--light-blue .stat-card-icon {
  background: var(--cb-info-bg);
  color: var(--cb-info);
}

.stat-card--light-purple .stat-card-icon {
  background: rgba(124, 58, 237, 0.08);
  color: #7C3AED;
}

.stat-card--light-amber .stat-card-icon {
  background: var(--cb-warning-bg);
  color: var(--cb-warning);
}

.stat-card--light-rose .stat-card-icon {
  background: var(--cb-danger-bg);
  color: var(--cb-danger);
}

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--cb-text-primary);
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-card-change {
  font-size: 12px;
  font-weight: 500;
  color: var(--cb-text-secondary);
}

.stat-card-change.positive {
  color: var(--cb-success);
}

.stat-card-change.negative {
  color: var(--cb-danger);
}

/* ============================================
   9. TABLES
   ============================================ */

table.table,
table.user-table {
  color: var(--cb-text-primary);
  background: var(--cb-bg-card);
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th,
.user-table thead th {
  color: var(--cb-text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--cb-border);
  background: var(--cb-bg-app);
}

.table td,
.user-table td {
  border-bottom: 1px solid var(--cb-border-light);
  color: var(--cb-text-primary);
  vertical-align: middle;
}

.table tbody tr,
.user-table tbody tr {
  transition: background var(--cb-transition-fast);
}

.table tbody tr:hover,
.user-table tbody tr:hover {
  background: var(--cb-bg-hover);
}

/* DashLite table overrides */
.nk-tb-list .nk-tb-item {
  background: var(--cb-bg-card) !important;
}

.nk-tb-list .nk-tb-item.nk-tb-head {
  background: var(--cb-bg-app) !important;
}

.nk-tb-item .nk-tb-col {
  border-color: var(--cb-border-light) !important;
  color: var(--cb-text-primary);
}

.nk-tb-list .nk-tb-item:not(.nk-tb-head):hover {
  background: var(--cb-bg-hover) !important;
}

/* ============================================
   10. BUTTONS
   ============================================ */

.btn {
  border-radius: var(--cb-radius-md);
  font-weight: 500;
  font-family: var(--cb-font-family);
  transition: all var(--cb-transition-fast);
  box-shadow: none;
}

/* Primary buttons */
.btn-primary {
  background: var(--cb-primary) !important;
  border-color: var(--cb-primary) !important;
  color: #fff !important;
}

.btn-primary:hover {
  background: var(--cb-primary-hover) !important;
  border-color: var(--cb-primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: var(--cb-shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--cb-shadow-xs);
}

.btn-primary:focus,
.btn-primary:focus-visible {
  box-shadow: 0 0 0 3px var(--cb-primary-bg);
}

/* Skip link — hidden until focused. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--cb-primary);
  color: #fff !important;
  padding: 0.5rem 1rem;
  border-radius: 0 0 8px 0;
}
.skip-link:focus-visible {
  left: 0;
  outline-offset: -2px;
}

/* Visible keyboard focus — DashLite resets outline in several places
   without a replacement, leaving keyboard focus invisible. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.btn:focus-visible,
.page-link:focus-visible,
.dropdown-item:focus-visible,
.sidebar-link:focus-visible,
.sidebar-hamburger:focus-visible,
.sidebar-header-action:focus-visible,
.notification-bell:focus-visible,
.dashboard-tab:focus-visible,
.chart-filter-btn:focus-visible {
  outline: 2px solid var(--cb-primary);
  outline-offset: 2px;
}

/* Success buttons */
.btn-success {
  background: var(--cb-success) !important;
  border-color: var(--cb-success) !important;
  color: #fff !important;
}

.btn-success:hover {
  background: #14532D !important;
  border-color: #14532D !important;
  transform: translateY(-1px);
  box-shadow: var(--cb-shadow-md);
}

/* Danger buttons */
.btn-danger {
  background: var(--cb-danger) !important;
  border-color: var(--cb-danger) !important;
  color: #fff !important;
}

.btn-danger:hover {
  background: #7F1D1D !important;
  border-color: #7F1D1D !important;
  transform: translateY(-1px);
  box-shadow: var(--cb-shadow-md);
}

/* Warning buttons */
.btn-warning {
  background: var(--cb-warning) !important;
  border-color: var(--cb-warning) !important;
  color: #fff !important;
}

.btn-warning:hover {
  background: #78350F !important;
  border-color: #78350F !important;
}

/* Info buttons */
.btn-info {
  background: var(--cb-info) !important;
  border-color: var(--cb-info) !important;
  color: #fff !important;
}

.btn-info:hover {
  background: #1E3A8A !important;
  border-color: #1E3A8A !important;
}

/* Secondary buttons */
.btn-secondary {
  background: var(--cb-bg-card) !important;
  border-color: var(--cb-border) !important;
  color: var(--cb-text-primary) !important;
}

.btn-secondary:hover {
  background: var(--cb-bg-hover) !important;
  border-color: var(--cb-border) !important;
}

/* Outline buttons */
.btn-outline-primary {
  border-color: var(--cb-primary);
  color: var(--cb-primary);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--cb-primary);
  border-color: var(--cb-primary);
  color: #fff;
}

/* Icon buttons */
.btn-icon.btn-trigger {
  color: var(--cb-text-secondary) !important;
}

.btn-icon.btn-trigger:hover {
  color: var(--cb-primary) !important;
  background: var(--cb-primary-bg) !important;
}

/* Dim/flat buttons - no shadow */
.btn-dim,
.btn-link {
  box-shadow: none !important;
  transform: none !important;
}

/* ============================================
   11. FORMS
   ============================================ */

.form-control,
.form-select {
  border-radius: var(--cb-radius-md);
  border-color: var(--cb-border);
  color: var(--cb-text-primary);
  font-family: var(--cb-font-family);
  transition: border-color var(--cb-transition-fast), box-shadow var(--cb-transition-fast);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--cb-border-focus) !important;
  box-shadow: 0 0 0 3px var(--cb-primary-bg) !important;
}

.form-control::placeholder {
  color: var(--cb-text-muted);
}

.form-label {
  color: var(--cb-text-primary);
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 6px;
}

.form-control-wrap .input-group {
  border-radius: var(--cb-radius-md);
  overflow: hidden;
}

.input-group-text {
  background: var(--cb-bg-app);
  border-color: var(--cb-border);
  color: var(--cb-text-secondary);
}

/* ============================================
   12. BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--cb-radius-sm);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-success,
.bg-success {
  background: var(--cb-success-bg) !important;
  color: var(--cb-success) !important;
}

.badge-danger,
.bg-danger {
  background: var(--cb-danger-bg) !important;
  color: var(--cb-danger) !important;
}

.badge-warning,
.bg-warning {
  background: var(--cb-warning-bg) !important;
  color: var(--cb-warning) !important;
}

.badge-info,
.bg-info {
  background: var(--cb-info-bg) !important;
  color: var(--cb-info) !important;
}

.badge-primary,
.bg-primary {
  background: var(--cb-primary-bg) !important;
  color: var(--cb-primary) !important;
}

.badge-secondary,
.bg-secondary {
  background: var(--cb-bg-hover) !important;
  color: var(--cb-text-secondary) !important;
}

/* DashLite badge overrides */
.badge.bg-success {
  background: var(--cb-success-bg) !important;
  color: var(--cb-success) !important;
}

.badge.bg-danger {
  background: var(--cb-danger-bg) !important;
  color: var(--cb-danger) !important;
}

.badge.bg-warning {
  background: var(--cb-warning-bg) !important;
  color: var(--cb-warning) !important;
}

.badge.bg-primary {
  background: var(--cb-primary-bg) !important;
  color: var(--cb-primary) !important;
}

/* ============================================
   13. MODALS
   ============================================ */

.modal-content {
  background: var(--cb-bg-card);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-xl);
  box-shadow: var(--cb-shadow-xl);
}

.modal-header {
  border-bottom: 1px solid var(--cb-border);
  padding: 20px 24px;
}

.modal-title {
  font-weight: 600;
  color: var(--cb-text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 1px solid var(--cb-border);
  padding: 16px 24px;
}

/* ============================================
   14. ALERTS
   ============================================ */

.alert {
  border-radius: var(--cb-radius-md);
  font-size: 14px;
}

.alert-info {
  background: var(--cb-info-bg);
  border-color: rgba(30, 64, 175, 0.2);
  color: var(--cb-info);
}

.alert-success {
  background: var(--cb-success-bg);
  border-color: rgba(22, 101, 52, 0.2);
  color: var(--cb-success);
}

.alert-danger {
  background: var(--cb-danger-bg);
  border-color: rgba(153, 27, 27, 0.2);
  color: var(--cb-danger);
}

.alert-warning {
  background: var(--cb-warning-bg);
  border-color: rgba(146, 64, 14, 0.2);
  color: var(--cb-warning);
}

/* ============================================
   15. PAGINATION
   ============================================ */

.page-link {
  color: var(--cb-text-secondary);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-md);
  margin: 0 2px;
  transition: all var(--cb-transition-fast);
}

.page-link:hover {
  background: var(--cb-bg-hover);
  border-color: var(--cb-border);
  color: var(--cb-text-primary);
}

.page-item.active .page-link {
  background: var(--cb-primary) !important;
  border-color: var(--cb-primary) !important;
  color: #fff !important;
}

/* ============================================
   16. DROPDOWNS
   ============================================ */

.dropdown-menu {
  background: var(--cb-bg-card);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-lg);
  box-shadow: var(--cb-shadow-lg);
  padding: 8px;
}

.dropdown-item {
  border-radius: var(--cb-radius-md);
  padding: 8px 12px;
  color: var(--cb-text-secondary);
  transition: all var(--cb-transition-fast);
}

.dropdown-item:hover {
  background: var(--cb-bg-hover);
  color: var(--cb-text-primary);
}

.dropdown-item.active,
.dropdown-item:active {
  background: var(--cb-primary);
  color: #fff;
}

/* ============================================
   17. LINKS & TEXT
   ============================================ */

a {
  color: var(--cb-text-primary);
  transition: color var(--cb-transition-fast);
}

a:hover {
  color: var(--cb-primary);
}

.text-primary {
  color: var(--cb-primary) !important;
}

.text-gray,
.text-gray-500 {
  color: var(--cb-text-muted) !important;
}

/* ============================================
   18. DARK MODE OVERRIDES
   ============================================ */

body.dark-mode,
body.dark-mode.nk-body {
  background: var(--cb-bg-app) !important;
  color: var(--cb-text-primary) !important;
}

body.dark-mode .nk-content,
body.dark-mode .nk-wrap,
body.dark-mode .nk-main,
body.dark-mode .nk-content-body,
body.dark-mode .nk-content-wrap,
body.dark-mode .nk-app-root,
body.dark-mode .nk-block,
body.dark-mode .nk-block-head {
  background: var(--cb-bg-app) !important;
}

body.dark-mode .card,
body.dark-mode .card-body,
body.dark-mode .card-bordered,
body.dark-mode .card-inner,
body.dark-mode .card-full,
body.dark-mode .table-wrapper,
body.dark-mode .table-responsive,
body.dark-mode .nk-tb-list,
body.dark-mode .dropdown-menu,
body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .input-group,
body.dark-mode .modal-content,
body.dark-mode .tab-content,
body.dark-mode .tab-pane,
body.dark-mode .alert,
body.dark-mode .popover {
  background-color: var(--cb-bg-card) !important;
  border-color: var(--cb-border) !important;
  color: var(--cb-text-primary) !important;
}

body.dark-mode .card {
  border: 1px solid var(--cb-border) !important;
}

body.dark-mode .btn-primary,
body.dark-mode .btn-success {
  background: var(--cb-primary) !important;
  border-color: var(--cb-primary) !important;
  color: #fff !important;
}

body.dark-mode .btn-primary:hover,
body.dark-mode .btn-success:hover {
  background: var(--cb-primary-hover) !important;
  border-color: var(--cb-primary-hover) !important;
}

body.dark-mode .btn-icon.btn-trigger {
  color: var(--cb-text-secondary) !important;
}

body.dark-mode .btn-icon.btn-trigger:hover {
  color: var(--cb-primary) !important;
  background: var(--cb-bg-hover) !important;
}

body.dark-mode .page-link {
  color: var(--cb-text-secondary);
}

body.dark-mode .page-item.active .page-link {
  background: var(--cb-primary) !important;
  border-color: var(--cb-primary) !important;
}

/* Sidebar dark */
body.dark-mode .nk-aside,
body.dark-mode .nk-sidebar {
  background: var(--cb-bg-sidebar) !important;
  color: var(--cb-text-primary);
  border-right: 1px solid var(--cb-border);
}

body.dark-mode .nk-menu-item > .nk-menu-link {
  color: var(--cb-text-secondary);
}

body.dark-mode .nk-menu-item > .nk-menu-link .nk-menu-icon {
  color: var(--cb-text-muted);
}

body.dark-mode .nk-menu-item > .nk-menu-link:hover {
  background: var(--cb-sidebar-hover);
  color: var(--cb-text-primary);
}

body.dark-mode .nk-menu-item > .nk-menu-link:hover .nk-menu-icon {
  color: var(--cb-text-primary);
}

body.dark-mode .nk-menu-item.active > .nk-menu-link,
body.dark-mode .nk-menu-item.current-page > .nk-menu-link {
  background: var(--cb-sidebar-active);
  color: var(--cb-primary);
}

body.dark-mode .nk-menu-item.active > .nk-menu-link .nk-menu-icon,
body.dark-mode .nk-menu-item.current-page > .nk-menu-link .nk-menu-icon {
  color: var(--cb-primary);
}

body.dark-mode .nk-menu-heading .overline-title,
body.dark-mode .nk-menu-heading h6 {
  color: var(--cb-text-muted);
}

/* Navbar dark */
body.dark-mode .nk-header,
body.dark-mode .nk-header.is-light,
body.dark-mode .nk-header.is-theme {
  background: var(--cb-bg-card) !important;
  border-bottom: 1px solid var(--cb-border) !important;
  color: var(--cb-text-primary) !important;
}

body.dark-mode .nk-header .user-name,
body.dark-mode .nk-header .dropdown-indicator,
body.dark-mode .nk-header .toggle.nk-quick-nav-icon {
  color: var(--cb-text-primary) !important;
}

body.dark-mode .nk-header .user-avatar {
  background: var(--cb-primary) !important;
  color: #fff !important;
}

body.dark-mode .nk-header .nk-menu-link,
body.dark-mode .nk-quick-nav-icon,
body.dark-mode .nk-nav-tools .icon {
  color: var(--cb-text-secondary) !important;
}

body.dark-mode .logo-light {
  opacity: 1 !important;
  display: block !important;
}

body.dark-mode .logo-dark {
  display: none !important;
}

/* Dropdown dark */
body.dark-mode .dropdown-menu-s1 {
  background: var(--cb-bg-card) !important;
  border: 1px solid var(--cb-border) !important;
}

body.dark-mode .dropdown-menu .link-list a {
  color: var(--cb-text-secondary) !important;
}

body.dark-mode .dropdown-menu .link-list a:hover {
  color: var(--cb-text-primary) !important;
  background: var(--cb-bg-hover) !important;
}

body.dark-mode .user-card-wrap.bg-lighter {
  background: var(--cb-bg-sidebar) !important;
}

/* Tables dark */
body.dark-mode .table,
body.dark-mode .user-table {
  color: var(--cb-text-primary);
}

body.dark-mode .table thead th,
body.dark-mode .user-table thead th {
  color: var(--cb-text-secondary);
  background: var(--cb-bg-card);
}

body.dark-mode .nk-tb-item .nk-tb-col,
body.dark-mode .table td {
  border-color: var(--cb-border);
  color: var(--cb-text-primary);
}

body.dark-mode table.table td,
body.dark-mode table.table th,
body.dark-mode table.user-table td,
body.dark-mode table.user-table th {
  border-color: var(--cb-border) !important;
}

/* Form dark */
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
  border-color: var(--cb-border-focus) !important;
  box-shadow: 0 0 0 3px var(--cb-primary-bg) !important;
  background: var(--cb-bg-card);
  color: var(--cb-text-primary);
}

/* Badges dark */
body.dark-mode .badge.bg-success,
body.dark-mode .badge-dot.bg-success {
  background: var(--cb-success-bg) !important;
  color: var(--cb-success) !important;
}

body.dark-mode .badge.bg-danger,
body.dark-mode .badge-dot.bg-danger {
  background: var(--cb-danger-bg) !important;
  color: var(--cb-danger) !important;
}

body.dark-mode .badge.bg-warning {
  background: var(--cb-warning-bg) !important;
  color: var(--cb-warning) !important;
}

body.dark-mode .badge.bg-secondary {
  background: var(--cb-bg-hover) !important;
  color: var(--cb-text-secondary) !important;
}

/* Dashboard card dark */
body.dark-mode .dashboard-card {
  background: var(--cb-bg-card);
  border: 1px solid var(--cb-border);
}

body.dark-mode .dashboard-card-header {
  border-bottom-color: var(--cb-border);
}

body.dark-mode .dashboard-card-title {
  color: var(--cb-text-primary);
}

/* Stat card dark */
body.dark-mode .stat-card {
  background: var(--cb-bg-card);
  border-color: var(--cb-border);
}

body.dark-mode .stat-card:hover {
  box-shadow: var(--cb-shadow-md);
}

body.dark-mode .stat-card-label,
body.dark-mode .stat-card-change {
  color: var(--cb-text-secondary);
}

body.dark-mode .stat-card-value {
  color: var(--cb-text-primary);
}

/* Status badges dark */
body.dark-mode .badge-success {
  background: var(--cb-success-bg) !important;
  color: var(--cb-success) !important;
  border: 1px solid rgba(74, 222, 128, 0.2) !important;
}

/* Page elements dark */
body.dark-mode .nk-block-title,
body.dark-mode .page-title,
body.dark-mode .nk-block-title.page-title {
  color: var(--cb-text-primary);
}

body.dark-mode a {
  color: var(--cb-text-primary);
}

body.dark-mode a:hover {
  color: var(--cb-primary);
}

body.dark-mode .text-gray,
body.dark-mode .text-gray-500 {
  color: var(--cb-text-muted) !important;
}

/* Spending / transaction dark */
body.dark-mode .spending-item {
  background: var(--cb-bg-sidebar);
}

body.dark-mode .spending-label {
  color: var(--cb-text-secondary);
}

body.dark-mode .spending-value,
body.dark-mode .transaction-name {
  color: var(--cb-text-primary);
}

body.dark-mode .transaction-desc {
  color: var(--cb-text-secondary);
}

body.dark-mode .transaction-item {
  border-bottom-color: var(--cb-border);
}

/* Dashboard tabs dark */
body.dark-mode .dashboard-card-tabs {
  background: var(--cb-bg-sidebar);
}

body.dark-mode .dashboard-tab {
  color: var(--cb-text-secondary);
}

body.dark-mode .dashboard-tab.active {
  background: var(--cb-primary);
  color: #fff;
}

body.dark-mode .dashboard-tab:hover:not(.active) {
  background: var(--cb-bg-hover);
}

/* Form select dark */
body.dark-mode .form-select option {
  background: var(--cb-bg-card);
  color: var(--cb-text-primary);
}

/* nk-footer dark */
body.dark-mode .nk-footer {
  background: var(--cb-bg-app);
  border-top: 1px solid var(--cb-border);
}

/* Mobile overlay dark */
body.dark-mode .nk-overlay,
body.dark-mode .sidebar-overlay {
  background: rgba(0, 0, 0, 0.6);
}

/* Dark mode completion — hardcoded light colors below would otherwise
   survive the token swap. */
/* Button hovers: reuse tokens instead of fixed light hexes. */
body.dark-mode .btn-success:hover {
  background: var(--cb-success) !important;
  border-color: var(--cb-success) !important;
  filter: brightness(1.12);
}
body.dark-mode .btn-danger:hover {
  background: var(--cb-danger) !important;
  border-color: var(--cb-danger) !important;
  filter: brightness(1.12);
}
body.dark-mode .btn-warning:hover {
  background: var(--cb-warning) !important;
  border-color: var(--cb-warning) !important;
  filter: brightness(1.12);
}
body.dark-mode .btn-info:hover {
  background: var(--cb-info) !important;
  border-color: var(--cb-info) !important;
  filter: brightness(1.12);
}

/* Badge variants missing from the first dark pass. */
body.dark-mode .badge.bg-info,
body.dark-mode .badge-dot.bg-info {
  background: var(--cb-info-bg) !important;
  color: var(--cb-info) !important;
}
body.dark-mode .badge.bg-primary,
body.dark-mode .badge-dot.bg-primary,
body.dark-mode .badge-dot.bg-warning {
  background: var(--cb-primary-bg) !important;
  color: var(--cb-primary) !important;
}
body.dark-mode .badge-dot.bg-warning {
  background: var(--cb-warning-bg) !important;
  color: var(--cb-warning) !important;
}
body.dark-mode .badge-info,
body.dark-mode .badge-primary,
body.dark-mode .badge-warning,
body.dark-mode .badge-danger,
body.dark-mode .badge-secondary {
  background: var(--cb-bg-hover) !important;
  color: var(--cb-text-primary) !important;
}

/* Form elements missing from the first dark pass. */
body.dark-mode .form-control,
body.dark-mode .form-select {
  background: var(--cb-bg-card);
  border-color: var(--cb-border);
  color: var(--cb-text-primary);
}
body.dark-mode .form-control::placeholder {
  color: var(--cb-text-muted);
  opacity: 1;
}
body.dark-mode .form-control:disabled,
body.dark-mode .form-control[readonly],
body.dark-mode .form-select:disabled {
  background: var(--cb-bg-hover);
  color: var(--cb-text-muted);
}
body.dark-mode .input-group-text {
  background: var(--cb-bg-hover);
  border-color: var(--cb-border);
  color: var(--cb-text-secondary);
}

/* Hardcoded icon accents: swap to tokens that work on dark. */
body.dark-mode .stat-card--light-purple .stat-card-icon {
  background: rgba(167, 139, 250, 0.14);
  color: #A78BFA;
}
body.dark-mode .stat-card--light-teal .stat-card-icon {
  background: var(--cb-accent-bg);
  color: var(--cb-accent);
}
body.dark-mode .transaction-icon--teal {
  background: rgba(45, 212, 191, 0.12);
  color: #2DD4BF;
}

/* Pagination chrome. */
body.dark-mode .page-link {
  background: var(--cb-bg-card);
  border-color: var(--cb-border);
}

/* ============================================
   19. NOTIFICATION DROPDOWN
   ============================================ */

.notification-dropdown-wrapper {
  position: relative;
}

.notification-dropdown {
  position: relative;
}

.notification-bell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--cb-radius-md);
  position: relative;
  color: var(--cb-text-secondary);
  transition: background var(--cb-transition-fast), color var(--cb-transition-fast);
  cursor: pointer;
}

.notification-bell:hover {
  background: var(--cb-bg-hover);
  color: var(--cb-text-primary);
}

.notification-bell .icon {
  font-size: 20px;
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--cb-radius-full);
  background: var(--cb-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.notification-dropdown .dropdown-menu,
.notification-dropdown .notification-panel {
  margin-top: 8px;
  padding: 0;
  border: 1px solid var(--cb-border);
  box-shadow: var(--cb-shadow-lg);
  background: var(--cb-bg-card);
}

.notification-dropdown .dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--cb-border);
}

.notification-dropdown .dropdown-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--cb-text-primary);
  margin: 0;
}

.notification-dropdown .dropdown-head a {
  font-size: 12px;
  color: var(--cb-primary);
  text-decoration: none;
}

.notification-dropdown .dropdown-head a:hover {
  text-decoration: underline;
}

.notification-dropdown .dropdown-body {
  max-height: 360px;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--cb-border-light);
  transition: background var(--cb-transition-fast);
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: var(--cb-bg-hover);
}

.notification-item.unread {
  background: var(--cb-primary-bg);
}

.notification-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--cb-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.notification-icon.text-primary {
  color: var(--cb-primary);
  background: var(--cb-primary-bg);
}

.notification-icon.text-success {
  color: var(--cb-success);
  background: var(--cb-success-bg);
}

.notification-icon.text-danger {
  color: var(--cb-danger);
  background: var(--cb-danger-bg);
}

.notification-icon.text-warning {
  color: var(--cb-warning);
  background: var(--cb-warning-bg);
}

.notification-icon.text-info {
  color: var(--cb-info);
  background: var(--cb-info-bg);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-text {
  font-size: 13px;
  color: var(--cb-text-primary);
  line-height: 1.4;
  word-wrap: break-word;
}

.notification-time {
  font-size: 11px;
  color: var(--cb-text-muted);
  margin-top: 2px;
}

.notification-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cb-primary);
  margin-top: 6px;
}

.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  color: var(--cb-text-muted);
}

.notification-empty p {
  margin-top: 8px;
  font-size: 13px;
}

/* ============================================
   20. CONTENT HAMBURGER — Mobile only
   ============================================ */

.content-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--cb-border);
  background: var(--cb-bg-card);
  color: var(--cb-text-secondary);
  cursor: pointer;
  border-radius: var(--cb-radius-md);
  box-shadow: var(--cb-shadow-sm);
  transition: all var(--cb-transition-fast);
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: 12px;
}

.content-hamburger:hover {
  background: var(--cb-bg-hover);
  color: var(--cb-primary);
  border-color: var(--cb-primary);
}

@media (max-width: 991px) {
  .content-hamburger {
    display: inline-flex;
  }
}

/* ============================================
   20b. MOBILE TOPBAR — Unified compact header
   Purpose: single persistent nav entry on phones
   where sidebar is off-canvas. Solid card color
   keeps hierarchy, 60px height keeps content dominant.
   ============================================ */

.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 990;
  height: 60px;
  min-height: 60px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--cb-bg-card);
  border-bottom: 1px solid var(--cb-border);
  max-width: 100%;
  overflow: hidden;
}

@media (max-width: 991px) {
  .mobile-topbar {
    display: flex;
  }
}

@media (min-width: 992px) {
  .mobile-topbar {
    display: none !important;
  }
}

.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--cb-border);
  background: var(--cb-bg-card);
  color: var(--cb-text-secondary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--cb-radius-md);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--cb-transition-fast), color var(--cb-transition-fast), border-color var(--cb-transition-fast);
}

.mobile-menu-btn:hover {
  background: var(--cb-bg-hover);
  color: var(--cb-primary);
  border-color: var(--cb-primary);
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.mobile-topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  text-decoration: none;
  color: var(--cb-text-primary);
}

.mobile-topbar-brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: var(--cb-radius-md);
  flex-shrink: 0;
}

.mobile-topbar-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-topbar-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--cb-border);
  background: var(--cb-primary-bg);
  color: var(--cb-primary);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
}

.mobile-topbar-account:hover {
  background: var(--cb-primary-bg-hover);
}

/* ============================================
   21. RESUME BUILDER
   ============================================ */

.resume-section-card {
  border-left: 3px solid var(--cb-primary) !important;
}

.resume-section-card .nk-block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
}

.resume-section-card .section-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--cb-radius-md);
  background: var(--cb-primary-bg);
  color: var(--cb-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.resume-section-card .section-icon svg {
  width: 18px;
  height: 18px;
}

.resume-form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--cb-text-secondary);
  margin-bottom: 6px;
}

.resume-entry-row {
  padding: 16px;
  border: 1px solid var(--cb-border-light);
  border-radius: var(--cb-radius-md);
  background: var(--cb-bg-app);
  margin-bottom: 12px;
  transition: border-color var(--cb-transition-fast);
}

.resume-entry-row:hover {
  border-color: var(--cb-border);
}

.resume-entry-row:last-of-type {
  margin-bottom: 0;
}

.resume-entry-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--cb-border);
  background: var(--cb-bg-card);
  color: var(--cb-text-muted);
  border-radius: var(--cb-radius-md);
  cursor: pointer;
  transition: all var(--cb-transition-fast);
  flex-shrink: 0;
}

.resume-entry-delete:hover {
  background: var(--cb-danger-bg);
  border-color: var(--cb-danger);
  color: var(--cb-danger);
}

.resume-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.resume-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--cb-info-bg);
  border: 1px solid rgba(30, 64, 175, 0.15);
  border-radius: var(--cb-radius-md);
  color: var(--cb-info);
  font-size: 13px;
  margin-bottom: 16px;
}

.resume-notice svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

@media (max-width: 575px) {
  .resume-entry-row .row {
    gap: 8px;
  }

  .resume-entry-row [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .resume-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .resume-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   22. RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  .nk-aside,
  .nk-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform var(--cb-transition-slow);
    box-shadow: none;
  }

  .nk-aside.show,
  .nk-sidebar.show,
  .nk-aside.open,
  .nk-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--cb-shadow-xl);
  }

  .nk-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
  }

  .nk-overlay.show {
    display: block;
  }

  body.nav-open {
    overflow: hidden;
  }
}

@media (max-width: 640px) {
  .nk-content,
  .nk-content-wrap,
  .nk-content-body {
    padding: 16px;
  }
}

/* ============================================
   21. DASHBOARD CARD
   ============================================ */

.dashboard-card {
  background: var(--cb-bg-card);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-lg);
  overflow: hidden;
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--cb-border);
}

.dashboard-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--cb-text-primary);
  margin: 0;
}

.dashboard-card-more {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cb-text-secondary);
  padding: 4px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--cb-radius-sm);
  transition: all var(--cb-transition-fast);
}

.dashboard-card-more:hover {
  background: var(--cb-bg-hover);
  color: var(--cb-primary);
}

.dashboard-card-body {
  padding: 16px 20px;
}

/* Dashboard tabs */
.dashboard-card-tabs {
  display: flex;
  gap: 4px;
  background: var(--cb-bg-app);
  padding: 4px;
  border-radius: var(--cb-radius-md);
}

.dashboard-tab {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--cb-text-secondary);
  border-radius: var(--cb-radius-sm);
  cursor: pointer;
  transition: all var(--cb-transition-fast);
}

.dashboard-tab.active {
  background: var(--cb-primary);
  color: #fff;
}

.dashboard-tab:hover:not(.active) {
  background: var(--cb-bg-hover);
}

/* ============================================
   22. CHART CARD
   ============================================ */

.chart-card {
  background: var(--cb-bg-card);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-lg);
  padding: 24px;
}

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.chart-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--cb-text-primary);
  margin-bottom: 2px;
}

.chart-subtitle {
  font-size: 13px;
  color: var(--cb-text-secondary);
}

/* Filter / segmented control */
.chart-filters {
  display: inline-flex;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-md);
  overflow: hidden;
}

.chart-filter-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--cb-text-secondary);
  cursor: pointer;
  transition: background var(--cb-transition-fast), color var(--cb-transition-fast);
}

.chart-filter-btn:not(:last-child) {
  border-right: 1px solid var(--cb-border);
}

.chart-filter-btn:hover {
  background: var(--cb-bg-hover);
}

.chart-filter-btn.active {
  background: var(--cb-primary);
  color: #fff;
}

/* ============================================
   23. TRANSACTION ITEM
   ============================================ */

.transaction-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--cb-border-light);
}

.transaction-item:last-child {
  border-bottom: none;
}

.transaction-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--cb-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.transaction-icon--primary {
  background: var(--cb-primary-bg);
  color: var(--cb-primary);
}

.transaction-info {
  flex: 1;
  min-width: 0;
}

.transaction-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--cb-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-desc {
  font-size: 12px;
  color: var(--cb-text-secondary);
}

/* ============================================
   24. WELCOME HEADER
   ============================================ */

.welcome-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--cb-text-primary);
  margin-bottom: 4px;
}

.welcome-header p {
  font-size: 14px;
  color: var(--cb-text-secondary);
}

/* ============================================
   25. STATS GRID
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   26. TRACER PROGRESS
   ============================================ */

.tracer-progress {
  width: 100%;
}

.tracer-progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
}

.tracer-progress-step {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-radius: var(--cb-radius-md);
  font-size: 13px;
  font-weight: 600;
  background: var(--cb-bg-card);
  color: var(--cb-text-muted);
  border: 1px solid var(--cb-border);
  transition: all var(--cb-transition-normal);
  white-space: nowrap;
}

.tracer-progress-step.active {
  background: var(--cb-primary);
  color: #fff;
  border-color: var(--cb-primary);
}

.tracer-progress-step.completed {
  background: var(--cb-success-bg);
  color: var(--cb-success);
  border-color: var(--cb-success);
}

.tracer-progress-label {
  vertical-align: middle;
}

.tracer-progress-connector {
  width: 20px;
  height: 2px;
  background: var(--cb-border);
  flex-shrink: 0;
  transition: background var(--cb-transition-normal);
}

.tracer-progress-connector.completed {
  background: var(--cb-success);
}

@media (max-width: 575px) {
  .tracer-progress-steps {
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .tracer-progress-step {
    font-size: 11px;
    padding: 8px 4px;
    flex-shrink: 0;
  }

  .tracer-progress-connector {
    width: 10px;
  }

  .input-group {
    flex-direction: column;
  }

  .input-group .input-group-prepend {
    width: 100%;
  }

  .input-group .input-group-text {
    width: 100%;
    border-bottom: 0;
    border-radius: var(--cb-radius-md) var(--cb-radius-md) 0 0;
  }

  .input-group .form-control,
  .input-group .form-select {
    border-radius: 0 0 var(--cb-radius-md) var(--cb-radius-md);
    min-height: 44px !important;
    width: 100% !important;
    flex: 1 1 auto !important;
  }
}

/* ============================================
   27. DASHBOARD — PAGE GREETING
   ============================================ */

.page-greeting {
  margin-bottom: 24px;
}

.page-greeting h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--cb-text-primary);
  margin: 0 0 4px;
}

.page-greeting p {
  font-size: 13px;
  color: var(--cb-text-secondary);
  margin: 0;
}

/* ============================================
   28. DASHBOARD — GROWTH CHART CARD
   ============================================ */

.stat-chart-card {
  background: var(--cb-bg-card);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-lg);
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.stat-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.stat-chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--cb-text-primary);
}

.stat-chart-subtitle {
  font-size: 12px;
  color: var(--cb-text-secondary);
  margin-top: 2px;
}

.stat-chart-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--cb-text-secondary);
  background: var(--cb-bg-app);
  border: 1px solid var(--cb-border-light);
  border-radius: var(--cb-radius-full);
  padding: 4px 10px;
  white-space: nowrap;
}

.stat-chart-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--cb-text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.stat-chart-trend {
  font-size: 12px;
  font-weight: 600;
}

.stat-chart-trend.positive {
  color: var(--cb-success);
}

.stat-chart-trend.negative {
  color: var(--cb-danger);
}

.stat-chart-area {
  position: relative;
  flex: 1;
  min-height: 140px;
}

.stat-chart-area canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

/* ============================================
   29. DASHBOARD — TRANSACTION EXTRAS
   ============================================ */

.transaction-icon--teal {
  background: rgba(13, 148, 136, 0.1);
  color: #0d9488;
}

.transaction-icon--green {
  background: var(--cb-success-bg);
  color: var(--cb-success);
}

.transaction-icon--blue {
  background: var(--cb-info-bg);
  color: var(--cb-info);
}

.transaction-time {
  font-size: 11px;
  color: var(--cb-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Exam countdown readout */
.nk-block-des.timer {
  font-size: 13px;
  color: var(--cb-text-secondary);
}

.nk-block-des.timer strong {
  color: var(--cb-primary);
}

.transaction-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ============================================
   30. DASHBOARD — EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--cb-text-muted);
}

.empty-state .icon {
  font-size: 28px;
  opacity: 0.5;
  display: block;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
  margin: 0;
}

/* ============================================
   31. DETAIL LISTS (profile-ud) — positioning
   ============================================ */

/* Long values (emails, addresses) must wrap instead of pushing
   the card past the viewport. */
.profile-ud-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Detail-list breathing room: DashLite pulls .profile-ud-list 3.25rem
   past the card padding, jamming labels against the card edge.
   Reign it in so labels sit inside the content column. */
@media (min-width: 768px) {
  .profile-ud-list {
    margin-left: -1.25rem;
    margin-right: -1.25rem;
  }
  .profile-ud-item {
    padding-left: 2.25rem;
    padding-right: 2.25rem;
  }
}

/* All section headings inside cards share one content column — whether
   their block holds a detail list (.profile-ud-list), a bio box
   (.bq-note), or plain job-detail paragraphs (job-details component).
   Detail rows sit at content + 1rem on desktop (2.25rem item padding
   minus 1.25rem list pull) and content + 0.5rem on mobile, while
   .nk-block-head sits at content + 0. Page headers, tabs, and dividers
   live outside .card-inner > .nk-block and are untouched. Applies to
   admin alumni/employer views, user/employer profiles, and all job
   view pages (all load careerbridge.css). */
.card-inner > .nk-block > .nk-block-head {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
@media (min-width: 768px) {
  .card-inner > .nk-block > .nk-block-head {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Table-tab headings (Mock Up Board, Activities, Job Listings): same
   content column as detail-list headings. These headings are direct
   children of .card-inner (no .nk-block wrapper, no .profile-ud-list),
   so the rule above misses them and they sit leftmost vs table text. */
.card-inner > .nk-block-head {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
@media (min-width: 768px) {
  .card-inner > .nk-block-head {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Breathing room below the tabs: `.nk-block .card .card-inner{padding:0}`
   removes the native card-inner top padding, so h5 titles would sit
   directly on the tab border. Restore an airy 2rem instead. Scoped to
   tabbed cards only (tabs ul + content div are siblings); stacked
   sections (e.g. Archive after Recent table) keep the 28px separation
   matching .nk-block + .nk-block-head. */
.nav-tabs-card + .card-inner > .nk-block-head:first-child,
.nav-tabs-card + .card-inner > .nk-block:first-child {
  padding-top: 2rem;
  margin-top: 0;
}
.card-inner > .card + .nk-block-head,
.card-inner > .nk-block + .nk-block-head {
  padding-top: 28px;
}

/* Flex ancestors must be allowed to shrink, or wide content
   overflows the card on small screens. */
.nk-content-body,
.nk-content-wrap,
.card-inner {
  min-width: 0;
}

/* Long page titles (names, emails) must wrap instead of pushing
   header rows past the viewport. */
.nk-block-title.page-title {
  overflow-wrap: anywhere;
}

/* Bio/description text must always wrap, including long
   unbroken strings (URLs, single-word blobs). */
.bq-note-text,
.bq-note-text p {
  overflow-wrap: anywhere;
}

@media (max-width: 767px) {
  /* Stack label above value. The 120px fixed label + right-aligned
     value looks broken and cramped on phones. */
  .profile-ud-list {
    padding-left: 0.5rem;
  }
  /* Stack label above value. The 120px fixed label + right-aligned
     value looks broken and cramped on phones. */
  .profile-ud.wider {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .wider .profile-ud-label {
    width: auto;
  }
  .wider .profile-ud-value {
    text-align: left;
    width: 100%;
  }
  /* Tab bars scroll instead of clipping tab names. */
  .nav-tabs-card {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
  }
  .nav-tabs-card .nav-item {
    flex-shrink: 0;
  }
  /* Header rows (title + Back button) wrap instead of colliding. */
  .nk-block-between {
    flex-wrap: wrap;
    row-gap: 0.75rem;
  }
  .nk-block-head-content {
    min-width: 0;
  }
  /* Dashboard card headers wrap instead of squeezing. */
  .dashboard-card-header,
  .stat-chart-header {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
  /* Filter segmented controls scroll instead of overflowing. */
  .chart-filters {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .chart-filter-btn {
    flex-shrink: 0;
  }
  /* Dropdowns and the notification panel stay inside the viewport. */
  .dropdown-menu {
    max-width: calc(100vw - 32px);
  }
  .notification-panel {
    width: calc(100vw - 32px) !important;
    max-width: 380px;
  }
  /* Tighter modal chrome on phones. */
  .modal-header {
    padding: 16px;
  }
  .modal-body {
    padding: 16px;
  }
  .modal-footer {
    padding: 12px 16px;
  }
}

/* Lesson reading view: keep user-authored content inside the card. */
.lesson-body {
  overflow-wrap: break-word;
}
.lesson-body > :first-child {
  margin-top: 0.75rem;
}
.lesson-body img {
  max-width: 100%;
  height: auto;
}
.lesson-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}
.lesson-body pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 100%;
  overflow-x: auto;
}
.lesson-body iframe {
  max-width: 100%;
}
