/* Header & Sidebar module styles */
.hidden{ display: none !important; }

/* Header container - ensures proper layout when rendered by JS */
.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* Desktop: header content slight margin (top/bottom auto, left/right 10px) */
@media (min-width: 1024px) {
  .header-content { margin: auto 10px; }
}

/* Brand logo and text (ensure consistent styling across pages)
   Some pages only import this module CSS, so include brand basics here. */
.header-brand .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.header-brand .logo:hover {
  transform: translateY(-1px);
}

.header-logo, .logo-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: block;
  object-fit: contain;
}

.logo-text {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  line-height: 1.05;
  font-weight: 700;
  background: var(--gradient, linear-gradient(135deg, var(--primary-color, #2563eb), var(--secondary-color, #7c3aed)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  display: inline-block;
  margin: 0;
}

/* Fallback for browsers that don't support background-clip: text */
@supports not (background-clip: text) {
  .logo-text {
    color: var(--primary-color, #2563eb);
    background: none;
  }
}

/* Dark theme support for logo text */
[data-theme="dark"] .logo-text {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@supports not (background-clip: text) {
  [data-theme="dark"] .logo-text {
    color: #60a5fa;
    background: none;
  }
}

/* Remove any shadow on nav across pages that include this module */
.header .nav, .header-nav { box-shadow: none !important; }

/* Strongly override generic `nav {}` from legacy index.css inside header */
.header nav, nav#nav-menu, .header .nav {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 18px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Header nav container */
nav#nav-menu {
  display: flex;
  align-items: center;
  min-width: fit-content;
  gap: 10px !important;
  padding: 18px;
}
/* Header nav dropdown (desktop) */
.header-nav .nav-item, .header .nav .nav-item { position: relative; }
.header-nav .nav-link, .header .nav .nav-link { font-weight: 500; transition: color .2s; display: inline-flex; align-items: center; gap: 6px; }
.header-nav .nav-link:hover, .header .nav .nav-link:hover { color: var(--primary-color, #2563eb); }
.nav-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #111);
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
  padding: 6px; min-width: 180px; display: none; z-index: 1600;
}
.nav-dropdown a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: inherit; }
.nav-dropdown a:hover { background: var(--bg-tertiary, #f3f4f6); }
.header-nav .nav-item:hover > .nav-dropdown, .header .nav .nav-item:hover > .nav-dropdown { display: block; }
.header-nav .nav-item.open > .nav-dropdown, .header .nav .nav-item.open > .nav-dropdown { display: block; }

/* Strong override: sidebar nav menu never has shadow */
nav#sidebar-nav-menu,
#sidebar nav#sidebar-nav-menu,
.sidebar nav#sidebar-nav-menu {
  box-shadow: none !important;
}

/* Sidebar auth block */
.sidebar-auth {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.08));
}
.sidebar-auth .btn-login {
  display: block;
  width: 100%;
  text-align: center;
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  color: var(--text-primary, #111);
  background: var(--bg-tertiary, #f3f4f6);
  border-radius: 10px;
}
.sidebar-auth .btn-login:hover { background: var(--bg-secondary, #eef2f7); }

/* Sidebar brand + divider */
.sidebar-brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 6px 0 12px;
}
.sidebar-divider {
  height: 1px;
  background: var(--border, rgba(0,0,0,0.08));
  margin: 12px 0 8px;
}

.sidebar-auth .sidebar-link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-primary, #111);
  background: transparent;
  border: 1px solid transparent;
}
.sidebar-auth .sidebar-link:hover {
  background: var(--bg-tertiary, #f3f4f6);
  border-color: var(--border, rgba(0,0,0,0.06));
}

/* Desktop dropdown items alignment */
.dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Compact language button with globe + overlaid code */
#langBtn.btn-secondary.toggle-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 40px;
  min-width: 48px;
  max-width: 48px;
  padding: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transition: all 0.2s ease;
  overflow: hidden;
  flex-shrink: 0;
}

#langBtn.btn-secondary.toggle-btn:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.lang-icon {
  position: relative;
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Globe icon as subtle background */
.lang-icon i[data-lucide="globe"],
.lang-icon svg.lucide.lucide-globe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  color: rgba(255,255,255,0.3);
  opacity: 1;
  pointer-events: none;
  z-index: 1;
}

/* Language code as prominent overlay */
.lang-code {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  color: white;
  z-index: 2;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

#langBtn.active { 
  outline: 2px solid var(--primary-color, #2563eb); 
  outline-offset: 2px; 
}

/* Keyboard focus */
#langBtn:focus-visible { 
  outline: 2px solid white; 
  outline-offset: 2px; 
}

/* User toggle (avatar-only in header) */
#userToggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0; /* allow inner text to shrink */
  padding: 4px 6px; /* compact */
  border-radius: 999px;
  cursor: pointer;
}
#userToggle .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
#username { display: none !important; }

/* Strong overrides so index.css cannot change header dropdown layout */
#userDropdown, .user-dropdown {
  /* Stick to viewport so it follows fixed headers */
  position: fixed !important;
  /* Align just below header; fallback to 70px for legacy pages */
  top: calc(var(--header-height, 70px) + 6px) !important;
  /* Keep aligned with centered containers (max-width: 1280px) */
  right: calc(max(20px, (100vw - 1280px) / 2 + 20px)) !important;
  left: auto !important;
  background: var(--bg-primary, #fff) !important;
  color: var(--text-primary, #111) !important;
  border: 1px solid var(--border, rgba(0,0,0,0.08)) !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 18px rgba(0,0,0,0.08) !important;
  min-width: 220px !important;
  padding: 8px 0 !important;
  z-index: 2100 !important;
  display: none;
}
#userDropdown.show, .user-dropdown.show { display: block !important; }
#userDropdown a, .user-dropdown a { color: var(--text-primary, #111) !important; }
#userDropdown a:hover, .user-dropdown a:hover { background: var(--bg-tertiary, #f3f4f6) !important; }

/* Toggle-style header buttons */
.header-actions .btn-secondary.toggle-btn,
.header-actions .btn-primary.toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  background: var(--bg-tertiary, #f3f4f6);
}
.header-actions .btn-secondary.toggle-btn:hover,
.header-actions .btn-primary.toggle-btn:hover {
  background: var(--bg-secondary, #eef2f7);
}

/* Notification Sidebar (desktop right, mobile left) */
#notifOverlay {
  position: fixed;
  left: 0;
  right: 0;
  /* Don’t block the header; start below it */
  top: var(--header-height, 70px);
  bottom: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  z-index: 2100;
  display: none;
}
#notifOverlay.active { display: block; }

#notifSidebar {
  position: fixed;
  /* Slide under the header */
  top: var(--header-height, 70px);
  right: 0;
  height: 100vh;
  /* Subtract header height so internal body can scroll fully */
  height: calc(100vh - var(--header-height, 70px));
  width: 360px;
  max-width: 90vw;
  background: var(--bg-primary, #fff);
  border-left: 1px solid var(--border, rgba(0,0,0,0.08));
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  z-index: 2200;
  transform: translateX(100%);
  transition: transform .28s ease;
  display: flex;
  flex-direction: column;
}
#notifSidebar.active { transform: translateX(0); }

@media (max-width: 768px) {
  #notifSidebar {
    left: 0;
    right: auto;
    transform: translateX(-100%);
  }
  #notifSidebar.active { transform: translateX(0); }
}

#notifSidebar .notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.08));
}
#notifSidebar .notif-title {
  font-weight: 700;
}
#notifSidebar .notif-close {
  border: none; background: transparent; cursor: pointer;
  font-size: 1.2rem; color: var(--text-secondary, #555);
}
#notifSidebar .notif-body {
  padding: 8px 8px 12px;
  overflow-y: auto;
}
#notifList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border, rgba(0,0,0,0.06));
  border-radius: 10px;
  background: var(--bg-secondary, #f8fafc);
}
.notif-item .icon { font-size: 18px; }
.notif-item .content { flex: 1; }
.notif-item .title { font-weight: 600; color: var(--text-primary, #111); }
.notif-item .time { font-size: .8rem; color: var(--text-secondary, #666); }

/* Exam history items */
.notif-item.exam-item .actions { margin-top: 6px; }
.notif-item .notif-btn {
  display: inline-block; padding: 6px 10px; border-radius: 8px;
  background: var(--bg-tertiary, #f3f4f6); color: var(--text-primary, #111);
  border: 1px solid var(--border, rgba(0,0,0,0.08)); text-decoration: none;
  font-size: .86rem; font-weight: 600;
}
.notif-item .notif-btn:hover { background: var(--bg-secondary, #eef2f7); }

/* Mobile notification button in header */
#mobileNotificationBtn {
  display: none; /* show only on mobile */
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--bg-tertiary, #f3f4f6);
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  color: var(--text-primary, #111);
  cursor: pointer;
}
#mobileNotificationBtn:hover { background: var(--bg-secondary, #eef2f7); }
@media (max-width: 768px) {
  #mobileNotificationBtn { display: inline-flex; }
  nav#nav-menu, .header .nav { display: none !important; }
}

/* Mobile header layout: Logo + Actions only */
@media (max-width: 768px) {
  .header {
    padding: 8px 16px !important;
    min-height: 60px !important;
  }
  
  .header-content {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 16px !important;
  }
  
  /* Logo section - LEFT side */
  .header-brand {
    flex: 0 0 auto !important;
    margin-right: auto !important;
  }
  
  .header-brand .logo {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-decoration: none !important;
  }
  
  .header-logo {
    width: 32px !important;
    height: 32px !important;
    flex-shrink: 0 !important;
  }
  
  .logo-text {
    font-size: 1rem !important;
    font-weight: 700 !important;
    display: inline-block !important;
    white-space: nowrap !important;
  }
  
  /* CRITICAL: Hide ALL navigation elements on mobile */
  .header-nav, 
  .header .nav,
  #nav-menu,
  .nav-item,
  .nav-link { 
    display: none !important; 
    visibility: hidden !important;
  }
  
  .header .lang-dropdown { display: none !important; }
  #loginBtn, #registerBtn, #userToggle, #userDropdown { display: none !important; }
  
  /* CRITICAL: Hide ALL theme toggle buttons in header on mobile - HIGHEST PRIORITY */

  /* Actions section - RIGHT side */
  .header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
  }
  
  .mobile-menu-toggle { 
    display: inline-flex !important; 
    order: 3 !important;
  }
  
  /* Enhanced language button with globe background - MOBILE */
  #langBtn.btn-secondary.toggle-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
    position: relative !important;
    overflow: hidden !important;
    order: 2 !important;
    cursor: pointer !important;
    z-index: 10 !important;
    pointer-events: auto !important;
  }
  
  #langBtn.btn-secondary.toggle-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
    transform: translateY(-1px) !important;
  }
  
  #langBtn.btn-secondary.toggle-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3) !important;
  }
  
  /* Mobile lang icon container */
  #langBtn .lang-icon {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none !important;
  }
  
  /* Globe icon as background - MOBILE */
  #langBtn .lang-icon i[data-lucide="globe"],
  #langBtn .lang-icon svg.lucide.lucide-globe {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 24px !important;
    height: 24px !important;
    color: rgba(255,255,255,0.4) !important;
    z-index: 1 !important;
    pointer-events: none !important;
  }
  
  /* Language code overlay - MOBILE */
  #langBtn .lang-code {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: 0.5px !important;
    color: white !important;
    z-index: 2 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
    pointer-events: none !important;
  }
  
  /* Compact mobile notification button */
  #mobileNotificationBtn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    background: var(--bg-tertiary, #f3f4f6) !important;
    border: 1px solid var(--border, rgba(0,0,0,0.08)) !important;
    order: 1 !important;
  }
  
  /* Compact mobile menu toggle */
  .mobile-menu-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border: 1px solid var(--border, rgba(0,0,0,0.08)) !important;
    border-radius: 8px !important;
    background: var(--bg-tertiary, #f3f4f6) !important;
    flex-direction: column !important;
  }
  
  .mobile-menu-toggle span {
    width: 18px !important;
    height: 2px !important;
    background: var(--text-primary, #111) !important;
    margin: 1.5px 0 !important;
    border-radius: 1px !important;
    transition: all 0.3s ease !important;
  }
}

/* Remove dropdown styles: lang now cycles directly on click */

/* Toast (shared, lightweight) */
#toast.hidden { display: none !important; }
#toast.toast {
  position: fixed;
  top: calc(var(--header-height, 70px) + 10px);
  right: 20px;
  z-index: 2050;
  background: rgba(0,0,0,.85);
  color: #333;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
#toast .toast-content { display: inline-flex; align-items: center; gap: 10px; }
#toast .toast-icon { font-weight: 700; }
#toast.toast.success { background: rgba(16,185,129,.92); }
#toast.toast.error { background: rgba(239,68,68,.92); }
#toast.toast.warning { background: rgba(245,158,11,.92); }
#toast.toast.info { background: rgba(30,64,175,.92); }

/* Sidebar-specific adjustments for language dropdown */
#sidebar .lang-dropdown { display: block; }
#sidebar #sidebarLangBtn { width: 100%; }
#sidebar .lang-options { right: auto; left: 0; width: 100%; }

/* Sidebar link + icon alignment for mobile menu */
.sidebar .sidebar-link { display: flex; align-items: center; gap: 10px; }
.sidebar .sidebar-link i[data-lucide] { width: 18px; height: 18px; flex: 0 0 auto; }
.sidebar .sidebar-link span { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 768px) {
  /* Ensure left alignment on mobile and avoid wrapping glitches */
  .sidebar .sidebar-link { justify-content: flex-start; }
}

/* Faint version note at the bottom of sidebar */
.sidebar-version {
  margin: 12px 8px 6px;
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.sidebar-version .version-number {
  font-weight: 600;
  color: #4FA3A3;
  letter-spacing: 0.5px;
}

.sidebar-version .rights-text {
  font-size: 10px;
  opacity: 0.7;
  line-height: 1.3;
}
/* Header auth buttons style override */
.header-actions #loginBtn,
.header-actions #registerBtn {
  padding: 0.5rem 1rem;
  background: #007acc;
  color: #333;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s ease;
}

/* Sidebar theme toggle */
.sidebar-theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  margin: 8px 0;
  border-radius: 10px;
  background: var(--bg-tertiary, #f3f4f6);
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  cursor: pointer;
  transition: background 0.2s ease;
}

.sidebar-theme-toggle:hover {
  background: var(--bg-secondary, #eef2f7);
}

.sidebar-theme-toggle i,
.sidebar-theme-toggle svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary, #6b7280);
}

.sidebar-theme-toggle span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #111);
}

[data-theme="dark"] .sidebar-theme-toggle {
  background: var(--bg-tertiary, #2a2a2a);
  border-color: var(--border, rgba(255,255,255,0.1));
}

[data-theme="dark"] .sidebar-theme-toggle:hover {
  background: var(--bg-secondary, #333333);
}

[data-theme="dark"] .sidebar-theme-toggle span {
  color: var(--text-primary, #e0e0e0);
}

.header-actions #registerBtn { 
  background: #ff9800; 
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s ease;
}
.header-actions #loginBtn:hover { background: #0062a3; }
.header-actions #registerBtn:hover { background: #e68900; }

/* Sidebar language pills */
.lang-pills { display: flex; gap: 8px; margin-bottom: 12px; }
.lang-pill {
  flex: 1 1 auto;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  background: var(--bg-tertiary, #f3f4f6);
  color: var(--text-primary, #111);
  font-weight: 700;
  cursor: pointer;
}
.lang-pill.active { background: linear-gradient(135deg, #60a5fa, #6366f1); color: #333; border-color: transparent; }

/* On mobile, give some side padding and align below header */
@media (max-width: 768px) {
  #toast.toast {
    top: calc(var(--header-height, 70px) + 8px) !important;
    right: 12px;
    left: 12px;
  }
}

/* Make the user toggle visually consistent with modern chips */
#userToggle {
  background: var(--bg-card, #fff) !important;
  border: 1px solid var(--border, rgba(0,0,0,0.08)) !important;
  border-radius: 12px !important;
  padding: 6px 10px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06) !important;
  color: var(--text-primary, #111) !important;
}

/* Notification sidebar */
.notif-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: none;
}

.notif-overlay.active {
  display: block;
}

.notif-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100%;
  background: var(--bg-primary);
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  z-index: 2001;
  overflow-y: auto;
}

.notif-sidebar.active {
  right: 0;
}

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

.notif-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.notif-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.notif-list {
  padding: 20px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  padding: 15px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s ease;
}

.notif-item:hover {
  background: var(--bg-secondary);
}

.notif-item .icon {
  margin-right: 12px;
  font-size: 1.2rem;
}

.notif-item .content {
  flex: 1;
}

.notif-item .title {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.notif-item .message {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.notif-item .time {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .notif-sidebar {
    width: 100%;
    right: -100%;
  }
}

.toggle-submenu::after {
  content: '#';
  position: absolute;
  inset: 0;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: #fff;
  transition: background .15s;
  margin: 0 5px 0 0;
  text-align: center;
}
.header-nav .nav-link i[data-lucide], .header .nav .nav-link i[data-lucide] { width: 16px; height: 16px; }
.nav-dropdown .nav-dropdown-link { display: flex; align-items: center; gap: 8px; }
.nav-dropdown .nav-dropdown-link i[data-lucide] { width: 16px; height: 16px; }
.btn-secondary {
  background: none;
  color: var(--text-primary);
  border: none;
  cursor: pointer;
}
nav.sidebar-nav {
  display: none;
}
nav#sidebar-nav-menu {
  display: flex;
}
@media (max-width: 768px) {
.lang-dropdown { display: none !important; }
}
nav#sidebar-nav-menu {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-content: flex-start;
  align-items: flex-start;
  background: none!important;
  /* overflow: auto; */
  margin: 10px;
  padding: 18px;
  position: relative;
}

/* Tablet portrait: collapse nav like mobile (iPad / large tablets turned vertical) */
@media (orientation: portrait) and (max-width: 1024px) {
  /* Hide full nav bars */
  nav#nav-menu,
  .header .nav,
  .header-nav {
    display: none !important;
  }

  /* Hide theme toggle on tablet portrait too */
  #theme-toggle, 
  .theme-toggle,
  button[aria-label*="theme"],
  button[aria-label*="Theme"] { 
    display: none !important;
    visibility: hidden !important;
  }

  /* Show hamburger + notification only (NO theme toggle) */
  .mobile-menu-toggle,
  #mobileNotificationBtn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Hide auth / user blocks to save space (handled inside sidebar/drawer) */
  #loginBtn,
  #registerBtn,
  #userToggle,
  #userDropdown {
    display: none !important;
  }

  /* Ensure header container doesn't overflow */
  .header,
  .header .container,
  .site-header {
    flex-wrap: nowrap !important;
  }
}

/* Optional: slightly wider safety range for some Android tablets */
@media (orientation: portrait) and (max-width: 1100px) and (min-width: 1025px) {
  nav#nav-menu,
  .header .nav,
  .header-nav { display: none !important; }
  .mobile-menu-toggle { display: inline-flex !important; }
}
