/* AchieveX — notifications.html styles */

/* ═══════════════════════════════════════════════════════════
   ACHIEVEX — NOTIFICATIONS v2 (CLEAN REBUILD)
   Architecture: Mobile-first, fluid, zero horizontal overflow
   Breakpoints: 360 | 480 | 640 | 768 | 960 | 1024 | 1280
═══════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ─────────────────────────────────────── */
:root {
  /* Fonts */
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Sora', sans-serif;

  /* Palette */
  --blue-50: #EFF6FF;  --blue-100: #DBEAFE; --blue-200: #BFDBFE;
  --blue-400: #60A5FA; --blue-500: #3B82F6; --blue-600: #2563EB;
  --blue-700: #1D4ED8; --blue-900: #1E3A8A;
  --green-500: #22C55E; --green-100: #DCFCE7;
  --amber-500: #F59E0B; --amber-100: #FEF3C7;
  --red-500:   #EF4444; --red-100:   #FEE2E2;
  --purple-500:#A855F7; --purple-100:#F3E8FF;
  --cyan-500:  #06B6D4; --cyan-100:  #CFFAFE;
  --orange-500:#F97316; --orange-100:#FFEDD5;

  /* Semantic surface / text */
  --bg:       #F8F9FA; --bg2: #F1F3F4; --bg3: #E8EAED;
  --surface:  #FFFFFF; --surface2: #F8F9FA; --surface3: #F1F3F4;
  --surface4: rgba(255,255,255,.92);
  --border:   rgba(0,0,0,.06); --border-m: rgba(0,0,0,.10);
  --border-s: rgba(59,130,246,.18);
  --txt:  #202124; --txt2: #3C4043; --txt3: #5F6368; --txt4: #9AA0A6;
  --glass: rgba(255,255,255,.88); --glass-border: rgba(255,255,255,.65);
  --primary: var(--blue-500); --primary-d: var(--blue-600);

  /* Shadows */
  --sh-xs: 0 1px 2px rgba(60,64,67,.07),0 1px 3px rgba(60,64,67,.05);
  --sh-sm: 0 1px 3px rgba(60,64,67,.09),0 2px 8px rgba(60,64,67,.06);
  --sh:    0 2px 6px rgba(60,64,67,.10),0 4px 16px rgba(60,64,67,.07);
  --sh-md: 0 4px 12px rgba(60,64,67,.12),0 8px 32px rgba(60,64,67,.08);
  --sh-lg: 0 8px 24px rgba(60,64,67,.14),0 16px 56px rgba(60,64,67,.10);
  --sh-xl: 0 16px 48px rgba(60,64,67,.16),0 32px 80px rgba(60,64,67,.12);
  --sh-blue: 0 4px 16px rgba(59,130,246,.32),0 2px 6px rgba(59,130,246,.18);

  /* Radii */
  --r-xs: 4px; --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --r-xl: 20px; --r-2xl: 24px; --r-full: 9999px;

  /* Layout */
  --nav-h:  60px;
  --side-w: 240px;

  /* Easing */
  --ease:        cubic-bezier(.25,.46,.45,.94);
  --ease-out:    cubic-bezier(.16,1,.3,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --ease-md:     cubic-bezier(.4,0,.2,1);
}

/* ── DARK MODE TOKENS ───────────────────────────────────── */
.dark {
  --bg: #1A1B1E; --bg2: #202124; --bg3: #2D2E31;
  --surface: #28292C; --surface2: #303134; --surface3: #3C4043;
  --surface4: rgba(40,41,44,.92);
  --border: rgba(255,255,255,.06); --border-m: rgba(255,255,255,.10);
  --glass: rgba(30,31,34,.92); --glass-border: rgba(255,255,255,.08);
  --txt: #E8EAED; --txt2: #BDC1C6; --txt3: #9AA0A6; --txt4: #5F6368;
  --sh-xs: 0 1px 3px rgba(0,0,0,.4),0 1px 4px rgba(0,0,0,.3);
  --sh-sm: 0 2px 6px rgba(0,0,0,.5),0 1px 3px rgba(0,0,0,.3);
  --sh:    0 4px 12px rgba(0,0,0,.55),0 2px 6px rgba(0,0,0,.35);
  --sh-md: 0 8px 24px rgba(0,0,0,.60),0 4px 12px rgba(0,0,0,.4);
  --sh-lg: 0 16px 48px rgba(0,0,0,.70),0 8px 20px rgba(0,0,0,.45);
  --sh-xl: 0 24px 72px rgba(0,0,0,.75),0 12px 32px rgba(0,0,0,.50);
}

/* ═══ RESET ═══ */
body{
  font-family:var(--font-sans);background:var(--bg);color:var(--txt);
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  
  /* Is line ko change kiya: standard auto vertical scroll ke liye */
  overflow-y: auto; 
  overflow-x: hidden;
  
  overscroll-behavior-x: none;
  line-height: 1.6;
  transition: background .35s var(--ease-google),color .35s var(--ease-google);
  
  /* Is line ko change kiya: 'none' ya 'contain' se mobile scroll freeze ho jata hai */
  overscroll-behavior-y: auto; 
  
  max-width: 100vw;
}


html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  /* Prevent iOS bounce from causing layout issues */
  overscroll-behavior: none;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--txt);
  line-height: 1.6;
  /* Never allow body-level horizontal overflow */
  overflow-x: hidden;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .35s var(--ease-md), color .35s var(--ease-md);
}

::selection { background: rgba(59,130,246,.15); color: var(--txt); }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: var(--txt4); }

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img, svg { display: block; max-width: 100%; }

/* ── KEYFRAMES ──────────────────────────────────────────── */
@keyframes fadeUp     { from { opacity:0; transform:translateY(14px) } to { opacity:1; transform:translateY(0) } }
@keyframes fadeIn     { from { opacity:0 } to { opacity:1 } }
@keyframes shimmer    { from { background-position:200% 0 } to { background-position:-200% 0 } }
@keyframes spin       { to { transform:rotate(360deg) } }
@keyframes pulse      { 0%,100% { opacity:1 } 50% { opacity:.45 } }
@keyframes slideDown  { from { opacity:0; transform:translateY(-8px) } to { opacity:1; transform:translateY(0) } }
@keyframes cardIn     { from { opacity:0; transform:translateY(12px) } to { opacity:1; transform:translateY(0) } }
@keyframes notifSlide { from { opacity:0; transform:translateX(-10px) } to { opacity:1; transform:translateX(0) } }
@keyframes toastIn    { from { opacity:0; transform:translateY(8px) scale(.97) } to { opacity:1; transform:translateY(0) scale(1) } }
@keyframes badgePop   { from { transform:scale(0) } to { transform:scale(1) } }
@keyframes dotPulse   { 0%,100% { transform:scale(1); opacity:1 } 50% { transform:scale(1.3); opacity:.7 } }

/* ═══════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
  /* Constrain so toasts never cause overflow */
  max-width: calc(100vw - 48px);
}
@media (max-width: 480px) {
  #toast-container { bottom: 16px; right: 12px; left: 12px; max-width: none; }
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 16px;
  box-shadow: var(--sh-lg);
  font-size: 13px; font-weight: 500; color: var(--txt);
  display: flex; align-items: center; gap: 10px;
  min-width: 220px; max-width: 320px;
  animation: toastIn .25s var(--ease);
  pointer-events: all;
  transition: opacity .25s, transform .25s;
}
@media (max-width: 480px) { .toast { min-width: 0; max-width: none; width: 100%; } }
.toast.hide { opacity: 0; transform: translateX(20px); }
.toast-icon { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.toast.success .toast-icon { background: rgba(34,197,94,.15);  color: var(--green-500); }
.toast.error   .toast-icon { background: rgba(239,68,68,.15);  color: var(--red-500); }
.toast.info    .toast-icon { background: rgba(59,130,246,.12); color: var(--blue-500); }
.toast.warn    .toast-icon { background: rgba(245,158,11,.12); color: var(--amber-500); }

/* ═══════════════════════════════════════════════════════════
   APP SHELL — fluid layout, sidebar + main
═══════════════════════════════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  /* Never let this element overflow horizontally */
  width: 100%;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════ */
.sidebar {
  /* Fixed, off-canvas on tablet/mobile, visible on desktop */
  position: fixed;
  top: 0; left: 0;
  width: var(--side-w);
  height: 100vh; height: 100dvh;
  z-index: 300;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  display: flex; flex-direction: column;
  /* GPU-composited slide */
  transform: translateX(0);
  transition: transform .32s var(--ease-out), background .35s var(--ease-md);
    overflow: hidden;
}

/* On tablet / mobile: hide sidebar by default */
@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--sh-xl);
    z-index: 300;
  }
  .sidebar.open { transform: translateX(0); }
}

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  height: var(--nav-h);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}

.sidebar-logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(145deg, #4F93F8 0%, #1D4ED8 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(59,130,246,.35);
  flex-shrink: 0;
  transition: transform .22s var(--ease-spring), box-shadow .22s;
}
.sidebar-logo-mark:hover { transform: scale(1.07) rotate(-3deg); box-shadow: 0 4px 14px rgba(59,130,246,.4); }

.sidebar-logo-name {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700; letter-spacing: -.04em;
  color: var(--txt);
}

.sidebar-close {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  background: var(--surface2); border: 1px solid var(--border);
  display: none; align-items: center; justify-content: center;
  color: var(--txt3); transition: all .18s; flex-shrink: 0;
}
@media (max-width: 1023px) { .sidebar-close { display: flex; } }
.sidebar-close:hover { background: var(--surface3); color: var(--txt); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
  display: flex; flex-direction: column; gap: 1px;
}

.sidebar-section-label {
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .9px;
  color: var(--txt4);
  padding: 10px 10px 4px;
}

.sidebar-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--r);
  font-size: 13px; font-weight: 500; color: var(--txt3);
  transition: background .15s, color .15s;
  cursor: pointer; user-select: none;
  /* Prevent text overflow */
  min-width: 0;
  text-decoration: none;
}
.sidebar-link:hover { background: var(--surface2); color: var(--txt); }
.sidebar-link.active { background: rgba(59,130,246,.09); color: var(--blue-600); }
.sidebar-link.active .sidebar-link-icon { color: var(--blue-600); }

.sidebar-link-icon {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--txt4); transition: color .15s;
}
.sidebar-link:hover .sidebar-link-icon { color: var(--txt3); }

.sidebar-link-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-badge {
  font-size: 9.5px; font-weight: 700;
  background: var(--blue-500); color: #fff;
  padding: 1px 6px; border-radius: var(--r-full);
  flex-shrink: 0;
}
.sidebar-badge.green  { background: var(--green-500); }
.sidebar-badge.amber  { background: var(--amber-500); }
.sidebar-badge.red    { background: var(--red-500); }
.sidebar-badge.ai     { background: linear-gradient(135deg,#A855F7,#7C3AED); }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r);
  background: var(--surface2); border: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
  min-width: 0;
}
.sidebar-user:hover { background: var(--surface3); }

.sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg,var(--blue-500),var(--blue-700));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 12.5px; font-weight: 600; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10.5px; color: var(--txt4); }

/* ── SIDEBAR OVERLAY ─────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════
   MAIN AREA — sits beside sidebar on desktop, full-width on mobile
═══════════════════════════════════════════════════════════ */
.main-area {
  /* Reserve sidebar width on desktop */
  margin-left: var(--side-w);
  flex: 1;
  display: flex; flex-direction: column;
  /* Critical: allows this child to shrink below content width */
  min-width: 0;
  overflow-x: hidden;
  transition: margin-left .32s var(--ease-out);
}
@media (max-width: 1023px) {
  .main-area { margin-left: 0; }
}

/* ═══════════════════════════════════════════════════════════
   TOP NAVBAR
═══════════════════════════════════════════════════════════ */
.topnav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background:var(--surface);
  
  
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border), var(--sh-xs);
  display: flex; align-items: center;
  /* Use padding not gap for the outer container */
  padding: 0 20px; gap: 10px;
  transition: background .35s var(--ease-md);
  flex-shrink: 0;
  /* Prevent overflow from absolutely positioned children */
  overflow: visible;
  /* Do NOT use 100vw — use 100% which respects its container */
  width: 100%;
}
@media (max-width: 640px) { .topnav { padding: 0 12px; gap: 8px; } }
@media (max-width: 420px) { .topnav { padding: 0 10px; gap: 6px; } }

.topnav-hamburger {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--surface2); border: 1px solid var(--border);
  display: none; align-items: center; justify-content: center;
  color: var(--txt3); transition: all .18s; flex-shrink: 0;
}
@media (max-width: 1023px) { .topnav-hamburger { display: flex; } }
.topnav-hamburger:hover { background: var(--surface3); color: var(--txt); }

.topnav-page-title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700; letter-spacing: -.03em;
  color: var(--txt); white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 480px) { .topnav-page-title { font-size: 13.5px; } }

/* Search — grows to fill remaining space */
.search-wrap {
  flex: 1 1 0%;
  /* max-width prevents it from becoming huge on wide screens */
  max-width: 340px;
  position: relative;
  /* min-width:0 allows flex child to shrink */
  min-width: 0;
}
@media (max-width: 640px) { .search-wrap { max-width: none; } }
@media (max-width: 380px) { .search-wrap { display: none; } }

.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--txt4); pointer-events: none;
  display: flex; align-items: center;
}

.search-input {
  width: 100%; height: 34px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0 12px 0 34px;
  font-size: 13px; font-family: var(--font-sans);
  color: var(--txt); outline: none;
  transition: all .2s;
  /* Prevent input from causing overflow */
  min-width: 0;
}
.search-input::placeholder { color: var(--txt4); }
.search-input:focus {
  background: var(--surface); border-color: var(--border-s);
  box-shadow: 0 0 0 3px rgba(59,130,246,.10);
}
@media (max-width: 480px) { .search-input { font-size: 12px; } }

/* Actions cluster — right side of nav */
.topnav-actions {
  display: flex; align-items: center; gap: 5px;
  margin-left: auto; flex-shrink: 0;
}
@media (max-width: 420px) { .topnav-actions { gap: 4px; } }

/* Generic icon button */
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--txt3); transition: all .18s;
  flex-shrink: 0; position: relative;
}
.icon-btn:hover { background: var(--surface3); color: var(--txt); }
.icon-btn.active { background: rgba(59,130,246,.09); border-color: var(--border-s); color: var(--blue-600); }
@media (max-width: 640px) { .icon-btn { width: 30px; height: 30px; } }

/* Notification dot on bell icon */
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red-500); border: 1.5px solid var(--surface);
  animation: dotPulse 2s ease-in-out infinite;
}
@media (max-width: 640px) { .notif-dot { top: 4px; right: 4px; } }

/* Profile button */
.profile-wrap { position: relative; }

.profile-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 3px 9px 3px 3px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-full);
  transition: all .18s; cursor: pointer; flex-shrink: 0;
}
.profile-btn:hover { background: var(--surface3); border-color: var(--border-m); }

.profile-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg,var(--blue-500),var(--blue-700));
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0;
}

.profile-name { font-size: 12.5px; font-weight: 600; color: var(--txt); }
@media (max-width: 480px) { .profile-name { display: none; } }

/* Profile dropdown */
.profile-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  z-index: 500; min-width: 200px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  overflow: hidden;
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
  pointer-events: none;
}
.profile-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: all; }

.profile-dropdown-user { padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface2); }
.profile-dropdown-uname { font-size: 13px; font-weight: 700; color: var(--txt); }
.profile-dropdown-email { font-size: 11.5px; color: var(--txt4); margin-top: 2px; }

.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 13px; font-weight: 500;
  color: var(--txt2); cursor: pointer;
  transition: background .12s, color .12s;
}
.dropdown-item:hover { background: var(--surface2); color: var(--txt); }
.dropdown-item.danger { color: var(--red-500); }
.dropdown-item.danger:hover { background: rgba(239,68,68,.06); }
.dropdown-sep { height: 1px; background: var(--border); margin: 2px 0; }

/* ═══════════════════════════════════════════════════════════
   BULK ACTIONS BAR
═══════════════════════════════════════════════════════════ */
.bulk-bar {
  position: sticky; top: var(--nav-h); z-index: 90;
  background: var(--blue-600);
  display: none; align-items: center; gap: 10px;
  padding: 10px 20px;
  animation: slideDown .2s var(--ease);
  /* Allow wrap on very small screens */
  flex-wrap: wrap;
  /* Width must be 100% of container, not 100vw */
  width: 100%;
}
.bulk-bar.visible { display: flex; }
@media (max-width: 640px) { .bulk-bar { padding: 10px 14px; gap: 8px; } }
@media (max-width: 360px) { .bulk-bar { padding: 8px 12px; gap: 6px; } }

.bulk-bar-text { font-size: 13px; font-weight: 600; color: #fff; flex: 1; min-width: 80px; }
@media (max-width: 360px) { .bulk-bar-text { font-size: 12px; } }

.bulk-btn {
  height: 30px; padding: 0 12px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; font-family: var(--font-sans);
  display: flex; align-items: center; gap: 5px;
  cursor: pointer; border: none; transition: all .15s; white-space: nowrap;
}
.bulk-btn.glass  { background: rgba(255,255,255,.15); color: #fff; }
.bulk-btn.glass:hover { background: rgba(255,255,255,.25); }
.bulk-btn.danger { background: rgba(239,68,68,.3); color: #fff; }
.bulk-btn.danger:hover { background: rgba(239,68,68,.5); }
@media (max-width: 480px) { .bulk-btn { padding: 0 10px; font-size: 11.5px; } }

/* ═══════════════════════════════════════════════════════════
   PAGE CONTENT
═══════════════════════════════════════════════════════════ */
.page-content {
  flex: 1;
  padding: 24px;
  /* Scroll within this element on mobile */
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
  /* Ensure children can't overflow this */
  min-width: 0;
}
@media (max-width: 768px) { .page-content { padding: 18px; } }
@media (max-width: 640px) { .page-content { padding: 12px; } }
@media (max-width: 360px) { .page-content { padding: 8px; } }

/* ── SPACING UTILITY ─────────────────────────────────────── */
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }

/* ═══════════════════════════════════════════════════════════
   PAGE HEADER (blue gradient banner)
═══════════════════════════════════════════════════════════ */
.notif-header {
  background: linear-gradient(135deg, #1E3A8A 0%, var(--blue-700) 45%, var(--blue-600) 100%);
  border-radius: var(--r-xl); padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
  overflow: hidden; position: relative;
  box-shadow: var(--sh-blue);
  /* Wrap on narrow screens */
  flex-wrap: wrap; gap: 14px;
}
.notif-header::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 50% 80% at 85% 50%, rgba(255,255,255,.06), transparent);
  pointer-events: none;
}
.notif-header::after {
  content: ''; position: absolute; top: -30px; right: -30px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.04); pointer-events: none;
}

.notif-header-text { position: relative; z-index: 1; min-width: 0; }
.notif-header-text h2 {
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
  color: #fff; letter-spacing: -.03em; margin-bottom: 4px;
}
.notif-header-text p { font-size: 12.5px; color: rgba(255,255,255,.6); }

.notif-header-actions {
  display: flex; gap: 8px;
  position: relative; z-index: 1;
  flex-shrink: 0; flex-wrap: wrap;
}

@media (max-width: 600px) {
  .notif-header { padding: 16px; flex-direction: column; align-items: flex-start; }
  .notif-header-text h2 { font-size: 17px; }
  .notif-header-actions { width: 100%; }
  .btn-hdr { flex: 1; justify-content: center; }
}
@media (max-width: 360px) {
  .notif-header { padding: 12px; }
  .notif-header-text h2 { font-size: 15px; }
  .notif-header-text p { font-size: 11.5px; }
}

.btn-hdr {
  height: 34px; padding: 0 14px; border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 600; font-family: var(--font-sans);
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; border: 1px solid rgba(255,255,255,.2);
  transition: all .18s; white-space: nowrap; min-width: 0;
}
.btn-hdr.glass { background: rgba(255,255,255,.12); color: #fff; }
.btn-hdr.glass:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.35); }
.btn-hdr.solid { background: #fff; color: var(--blue-700); }
.btn-hdr.solid:hover { background: rgba(255,255,255,.9); }

/* ═══════════════════════════════════════════════════════════
   OVERVIEW STATS GRID
═══════════════════════════════════════════════════════════ */
.overview-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 900px) { .overview-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .overview-stats { gap: 8px; } }
@media (max-width: 360px) { .overview-stats { gap: 6px; } }

.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 16px 18px;
  box-shadow: var(--sh-xs); transition: all .2s;
  cursor: default; display: flex; flex-direction: column; gap: 8px;
  animation: cardIn .4s var(--ease) both;
  /* Prevent overflow of contents */
  min-width: 0; overflow: hidden;
}
.stat-card:hover { box-shadow: var(--sh); border-color: var(--border-s); transform: translateY(-2px); }

@media (max-width: 640px) { .stat-card { padding: 12px; } }
@media (max-width: 360px) { .stat-card { padding: 10px; } }

.stat-card-top { display: flex; align-items: center; justify-content: space-between; }

.stat-card-icon {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.stat-chip {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: var(--r-full);
  display: inline-flex; align-items: center; gap: 3px;
  white-space: nowrap;
}
.stat-chip.up      { background: rgba(34,197,94,.1);  color: var(--green-500); }
.stat-chip.down    { background: rgba(239,68,68,.1);  color: var(--red-500); }
.stat-chip.neutral { background: var(--surface2); color: var(--txt4); }

.stat-val {
  font-family: var(--font-display); font-weight: 700;
  letter-spacing: -.05em; color: var(--txt); line-height: 1;
  font-size: clamp(20px, 4vw, 28px);
}
.stat-val.blue   { color: var(--blue-500); }
.stat-val.green  { color: var(--green-500); }
.stat-val.amber  { color: var(--amber-500); }
.stat-val.red    { color: var(--red-500); }
.stat-val.purple { color: var(--purple-500); }

.stat-lbl { font-size: 11.5px; color: var(--txt4); }
@media (max-width: 640px) { .stat-lbl { font-size: 10.5px; } }

/* ═══════════════════════════════════════════════════════════
   SMART ALERT BANNER (horizontal scroll)
═══════════════════════════════════════════════════════════ */
.smart-alert-row {
  display: flex; gap: 10px;
  overflow-x: auto;
  margin-bottom: 20px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.smart-alert-row::-webkit-scrollbar { display: none; }

.smart-alert {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--r-lg); border: 1px solid;
  white-space: nowrap; cursor: pointer; transition: all .18s;
  animation: cardIn .35s var(--ease) both;
}
.smart-alert:hover { transform: translateY(-2px); box-shadow: var(--sh-sm); }
.smart-alert.blue   { background: rgba(59,130,246,.08);  border-color: rgba(59,130,246,.18);  color: var(--blue-600); }
.smart-alert.green  { background: rgba(34,197,94,.08);   border-color: rgba(34,197,94,.18);   color: #16A34A; }
.smart-alert.amber  { background: rgba(245,158,11,.08);  border-color: rgba(245,158,11,.18);  color: #B45309; }
.smart-alert.red    { background: rgba(239,68,68,.08);   border-color: rgba(239,68,68,.18);   color: #DC2626; }
.smart-alert.purple { background: rgba(168,85,247,.08);  border-color: rgba(168,85,247,.18);  color: #7C3AED; }
.dark .smart-alert.blue   { background: rgba(59,130,246,.12);  color: var(--blue-400); }
.dark .smart-alert.green  { color: var(--green-500); }
.dark .smart-alert.amber  { color: var(--amber-500); }
.dark .smart-alert.red    { color: var(--red-500); }
.dark .smart-alert.purple { color: var(--purple-500); }

.smart-alert-icon {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: rgba(0,0,0,.06);
}
.dark .smart-alert-icon { background: rgba(255,255,255,.06); }
.smart-alert-title { font-size: 12px; font-weight: 700; line-height: 1.2; }
.smart-alert-sub   { font-size: 11px; opacity: .7; margin-top: 1px; }

/* ═══════════════════════════════════════════════════════════
   LAYOUT GRIDS
═══════════════════════════════════════════════════════════ */
/* 2/3 + 1/3 split for main content vs sidebar panel */
.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
  /* Prevent grid overflow */
  min-width: 0;
}
@media (max-width: 960px) { .grid-main { grid-template-columns: 1fr; } }

/* Two equal columns */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

/* Right column stack */
.panel-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ═══════════════════════════════════════════════════════════
   CARD
═══════════════════════════════════════════════════════════ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--sh-xs);
  overflow: hidden; transition: box-shadow .2s;
  animation: cardIn .4s var(--ease) both;
  /* Prevent card contents from escaping */
  min-width: 0;
}
.card:hover { box-shadow: var(--sh-sm); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
  flex-shrink: 0; gap: 8px;
  /* Allow wrapping on very small screens */
  flex-wrap: nowrap;
}
@media (max-width: 480px) { .card-header { padding: 12px 14px; } }
@media (max-width: 360px) { .card-header { padding: 10px 12px; } }

.card-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }

.card-icon {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.card-title    { font-size: 14px; font-weight: 700; color: var(--txt); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-subtitle { font-size: 11.5px; color: var(--txt4); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card-body { padding: 16px 18px; }
@media (max-width: 480px) { .card-body { padding: 12px 14px; } }
@media (max-width: 360px) { .card-body { padding: 10px 12px; } }

.card-action {
  font-size: 12px; font-weight: 600; color: var(--blue-500);
  padding: 5px 10px; border-radius: var(--r-sm);
  transition: all .15s; border: 1px solid transparent;
  background: none; cursor: pointer; font-family: var(--font-sans);
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap; flex-shrink: 0;
}
.card-action:hover { background: rgba(59,130,246,.07); border-color: var(--border-s); }
.card-action.red { color: var(--red-500); }
.card-action.red:hover { background: rgba(239,68,68,.07); border-color: rgba(239,68,68,.15); }

/* ═══════════════════════════════════════════════════════════
   FILTER TABS
═══════════════════════════════════════════════════════════ */
.filter-row {
  display: flex; gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }

.filter-tab {
  padding: 6px 14px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface2); color: var(--txt3);
  border: 1px solid var(--border); cursor: pointer;
  transition: all .15s; display: flex; align-items: center; gap: 6px;
  flex-shrink: 0; font-family: var(--font-sans);
}
.filter-tab:hover  { background: var(--surface3); color: var(--txt); }
.filter-tab.active { background: var(--blue-500); color: #fff; border-color: var(--blue-500); }
@media (max-width: 480px) { .filter-tab { padding: 5px 10px; font-size: 11.5px; } }

.filter-count {
  font-size: 10px; font-weight: 700;
  background: rgba(255,255,255,.25); padding: 1px 5px;
  border-radius: var(--r-full); min-width: 16px; text-align: center;
}
.filter-tab:not(.active) .filter-count { background: var(--bg3); color: var(--txt4); }

/* ═══════════════════════════════════════════════════════════
   NOTIFICATION LIST
═══════════════════════════════════════════════════════════ */
.notif-list { display: flex; flex-direction: column; gap: 0; }

.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  transition: background .15s; cursor: pointer;
  position: relative; overflow: hidden;
  animation: notifSlide .3s var(--ease) both;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface2); }

/* State variants */
.notif-item.unread   { background: rgba(59,130,246,.028); }
.notif-item.unread:hover { background: rgba(59,130,246,.055); }
.dark .notif-item.unread { background: rgba(59,130,246,.06); }
.dark .notif-item.unread:hover { background: rgba(59,130,246,.10); }
.notif-item.pinned   { background: rgba(245,158,11,.04); }
.notif-item.selected { background: rgba(59,130,246,.07) !important; }
.dark .notif-item.selected { background: rgba(59,130,246,.12) !important; }

@media (max-width: 480px) { .notif-item { padding: 10px 12px; gap: 10px; } }
@media (max-width: 360px) { .notif-item { padding: 8px 10px; gap: 8px; } }

/* Unread left bar */
.notif-unread-line {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--blue-500); opacity: 0; transition: opacity .15s;
}
.notif-item.unread .notif-unread-line  { opacity: 1; }
.notif-item.pinned .notif-unread-line  { background: var(--amber-500); opacity: 1; }

.notif-icon-wrap {
  width: 40px; height: 40px; border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative;
}
@media (max-width: 360px) { .notif-icon-wrap { width: 32px; height: 32px; border-radius: var(--r-sm); } }

.notif-unread-dot {
  position: absolute; top: -2px; right: -2px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--surface);
  animation: badgePop .3s var(--ease-spring);
}

/* Notification body — must flex-shrink to prevent overflow */
.notif-body { flex: 1 1 0%; min-width: 0; }

.notif-title {
  font-size: 13px; font-weight: 600; color: var(--txt);
  line-height: 1.3; margin-bottom: 3px;
  /* Allow long words to wrap rather than overflow */
  word-break: break-word; overflow-wrap: anywhere;
}
.notif-item.unread .notif-title { font-weight: 700; }
.notif-item.read   .notif-title { color: var(--txt3); }
@media (max-width: 360px) { .notif-title { font-size: 12px; } }

.notif-desc {
  font-size: 12px; color: var(--txt3); line-height: 1.45;
  word-break: break-word; overflow-wrap: anywhere;
}
.notif-item.read .notif-desc { color: var(--txt4); }
@media (max-width: 360px) { .notif-desc { font-size: 11px; } }

.notif-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px; flex-wrap: wrap;
}
.notif-time { font-size: 11px; color: var(--txt4); white-space: nowrap; }
.notif-type-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: var(--r-full); white-space: nowrap; }
.notif-priority { display: flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.priority-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* Action buttons */
.notif-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.notif-action-btn {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--txt4); transition: all .15s;
  border: 1px solid transparent; background: none; font-family: var(--font-sans);
}
/* Hover devices: reveal on hover */
@media (hover: hover) {
  .notif-action-btn { opacity: 0; }
  .notif-item:hover .notif-action-btn { opacity: 1; }
}
/* Touch devices: always visible */
@media (hover: none) {
  .notif-action-btn { opacity: 1; }
}
.notif-action-btn:hover { background: var(--surface3); color: var(--txt); border-color: var(--border); }
.notif-action-btn.read-btn:hover { background: rgba(59,130,246,.09); color: var(--blue-500); border-color: var(--border-s); }
.notif-action-btn.pin-btn:hover  { background: rgba(245,158,11,.09); color: var(--amber-500); border-color: rgba(245,158,11,.18); }
.notif-action-btn.del-btn:hover  { background: rgba(239,68,68,.09);  color: var(--red-500);   border-color: rgba(239,68,68,.18); }
.notif-action-btn.pin-btn.pinned { opacity: 1; color: var(--amber-500); }

/* On narrow screens: column layout for actions, always visible */
@media (max-width: 480px) {
  .notif-actions { flex-direction: column; gap: 2px; }
  .notif-action-btn { opacity: 1; width: 24px; height: 24px; }
  .notif-action-btn.read-btn, .notif-action-btn.pin-btn { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   CATEGORY GRID
═══════════════════════════════════════════════════════════ */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 640px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 360px) { .cat-grid { gap: 6px; } }

.cat-card {
  padding: 14px; border-radius: var(--r-lg);
  border: 1px solid var(--border); background: var(--surface2);
  cursor: pointer; transition: all .18s;
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0;
}
.cat-card:hover { background: var(--surface); border-color: var(--border-m); box-shadow: var(--sh-xs); transform: translateY(-1px); }
.cat-card.active-cat { border-color: var(--border-s); background: rgba(59,130,246,.05); }
.dark .cat-card.active-cat { background: rgba(59,130,246,.09); }
@media (max-width: 360px) { .cat-card { padding: 10px; } }

.cat-card-top { display: flex; align-items: center; justify-content: space-between; }
.cat-icon { width: 32px; height: 32px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; }
.cat-badge { font-size: 10px; font-weight: 700; min-width: 20px; height: 18px; padding: 0 6px; border-radius: var(--r-full); display: flex; align-items: center; justify-content: center; }
.cat-name { font-size: 12px; font-weight: 700; color: var(--txt); }
.cat-sub  { font-size: 10.5px; color: var(--txt4); margin-top: 1px; }

/* ═══════════════════════════════════════════════════════════
   REMINDER LIST
═══════════════════════════════════════════════════════════ */
.reminder-list { display: flex; flex-direction: column; gap: 8px; }

.reminder-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--r-lg);
  background: var(--surface2); border: 1px solid var(--border);
  transition: all .18s;
  /* Prevent overflow */
  min-width: 0;
}
.reminder-item:hover { background: var(--surface); border-color: var(--border-m); box-shadow: var(--sh-xs); }
@media (max-width: 480px) { .reminder-item { padding: 10px; gap: 8px; } }

.reminder-icon {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
@media (max-width: 480px) { .reminder-icon { width: 28px; height: 28px; } }

.reminder-info { flex: 1; min-width: 0; }
.reminder-title { font-size: 12.5px; font-weight: 600; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reminder-time  { font-size: 11px; color: var(--txt4); margin-top: 2px; }

.reminder-status {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: var(--r-full); flex-shrink: 0; white-space: nowrap;
}
.reminder-status.active { background: rgba(34,197,94,.1);  color: var(--green-500); }
.reminder-status.due    { background: rgba(245,158,11,.1); color: var(--amber-500); }
.reminder-status.missed { background: rgba(239,68,68,.1);  color: var(--red-500); }

/* ═══════════════════════════════════════════════════════════
   PREFERENCES
═══════════════════════════════════════════════════════════ */
.pref-list { display: flex; flex-direction: column; gap: 0; }

.pref-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
  min-width: 0;
}
.pref-item:last-child { border-bottom: none; padding-bottom: 0; }
@media (max-width: 360px) { .pref-item { flex-wrap: wrap; } }

.pref-icon {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.pref-info { flex: 1; min-width: 0; }
.pref-name { font-size: 13px; font-weight: 600; color: var(--txt); }
.pref-desc { font-size: 11.5px; color: var(--txt4); margin-top: 2px; }

/* Toggle switch */
.toggle { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; pointer-events: none; }
.toggle-track {
  width: 42px; height: 24px; background: var(--bg3);
  border-radius: var(--r-full); transition: background .2s;
  position: relative; border: 1.5px solid var(--border-m);
  display: block; flex-shrink: 0;
}
.toggle input:checked + .toggle-track { background: var(--blue-500); border-color: var(--blue-500); }
.toggle-thumb {
  position: absolute; top: 50%; transform: translateY(-50%);
  left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: left .2s var(--ease-spring); pointer-events: none;
}
.toggle input:checked + .toggle-track .toggle-thumb { left: 20px; }

/* Timing select */
.timing-select {
  height: 34px; padding: 0 10px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--txt); font-size: 12.5px; font-weight: 600;
  font-family: var(--font-sans); cursor: pointer; transition: all .18s;
  outline: none; min-width: 100px; max-width: 130px; flex-shrink: 0;
}
.timing-select:focus { border-color: var(--border-s); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
@media (max-width: 360px) { .timing-select { min-width: 80px; font-size: 11.5px; } }

.timing-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; min-width: 0;
}
.timing-label { min-width: 0; flex: 1; }
.timing-label-name { font-size: 12.5px; font-weight: 600; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timing-label-unit { font-size: 11px; color: var(--txt4); }

/* ═══════════════════════════════════════════════════════════
   SECTION HEADER
═══════════════════════════════════════════════════════════ */
.section-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 8px;
}
.section-title {
  font-size: 13px; font-weight: 700; color: var(--txt);
  letter-spacing: -.02em; display: flex; align-items: center; gap: 7px;
}
.section-badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: var(--r-full); background: rgba(59,130,246,.1); color: var(--blue-500);
}

/* ═══════════════════════════════════════════════════════════
   EMPTY / ERROR / SKELETON STATES
═══════════════════════════════════════════════════════════ */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 24px; text-align: center; gap: 12px; color: var(--txt4);
}
@media (max-width: 480px) { .empty-state { padding: 32px 16px; } }
.empty-state svg          { opacity: .3; }
.empty-state-title        { font-size: 14px; font-weight: 600; color: var(--txt3); }
.empty-state-desc         { font-size: 12.5px; color: var(--txt4); max-width: 240px; line-height: 1.5; }

.error-state {
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 24px; text-align: center; gap: 10px;
}
.error-state-title { font-size: 13.5px; font-weight: 600; color: var(--red-500); }
.error-state-desc  { font-size: 12px; color: var(--txt4); max-width: 220px; line-height: 1.45; }

.skeleton {
  background: linear-gradient(90deg, var(--surface2) 0%, var(--surface3) 50%, var(--surface2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
.skeleton-notif { height: 76px; border-radius: var(--r-lg); margin-bottom: 8px; }
.skeleton-notif:last-child { margin-bottom: 0; }

/* ═══════════════════════════════════════════════════════════
   FIREBASE STATUS
═══════════════════════════════════════════════════════════ */
.firebase-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; color: var(--txt4);
  padding: 3px 8px; border-radius: var(--r-full);
  background: var(--surface2); border: 1px solid var(--border);
  white-space: nowrap;
}
.firebase-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--txt4); flex-shrink: 0; }
.firebase-status.connected .firebase-dot { background: var(--green-500); animation: dotPulse 2s ease-in-out infinite; }
.firebase-status.connected { color: var(--green-500); }
.firebase-status.error .firebase-dot { background: var(--red-500); }
.firebase-status.error { color: var(--red-500); }

/* ═══════════════════════════════════════════════════════════
   UTILITY COMPONENTS
═══════════════════════════════════════════════════════════ */
.btn-sec {
  height: 34px; padding: 0 14px; border-radius: var(--r-sm);
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600; font-family: var(--font-sans);
  color: var(--txt3); display: flex; align-items: center; gap: 6px;
  cursor: pointer; transition: all .18s; white-space: nowrap;
}
.btn-sec:hover { background: var(--surface3); color: var(--txt); }
.btn-sec.red:hover { background: rgba(239,68,68,.09); border-color: rgba(239,68,68,.18); color: var(--red-500); }

.btn-blue {
  height: 36px; padding: 0 18px; border-radius: var(--r-sm);
  background: var(--blue-500); color: #fff;
  font-size: 13px; font-weight: 600; font-family: var(--font-sans);
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; border: none; transition: all .18s; white-space: nowrap;
}
.btn-blue:hover { background: var(--blue-600); transform: translateY(-1px); box-shadow: var(--sh-blue); }

.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ═══════════════════════════════════════════════════════════
   INSIGHTS ITEM
═══════════════════════════════════════════════════════════ */
.insight-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px; border-radius: var(--r-lg);
  background: var(--surface2); border: 1px solid var(--border);
  cursor: default; transition: border-color .15s, background .15s;
  animation: notifSlide .3s var(--ease) both;
  /* Prevent overflow */
  min-width: 0;
}
.insight-item:hover { border-color: var(--border-m); background: var(--surface); }
.insight-icon { width: 30px; height: 30px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.insight-body { flex: 1; min-width: 0; }
.insight-title { font-size: 12.5px; font-weight: 700; color: var(--txt); margin-bottom: 2px; }
.insight-desc  { font-size: 11.5px; color: var(--txt3); line-height: 1.4; }
.insight-badge { display: inline-block; margin-top: 5px; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: var(--r-full); }

/* ═══════════════════════════════════════════════════════════
   STATE BADGES
═══════════════════════════════════════════════════════════ */
.state-badge {
  font-size: 9.5px; font-weight: 700;
  padding: 1px 6px; border-radius: var(--r-full);
  border: 1px solid transparent; white-space: nowrap;
}
.state-badge.reminder { background: rgba(245,158,11,.12); color: #B45309; border-color: rgba(245,158,11,.2); }
.state-badge.alert    { background: rgba(239,68,68,.1);   color: #DC2626; border-color: rgba(239,68,68,.15); }
.state-badge.pinned   { background: rgba(245,158,11,.1);  color: #B45309; }