/* ============================================================
   ACCESS COMMUNITY — Main Stylesheet  v2.0
   Blue #1a3c6e | Green #4caf50 | Gold #f9a825
   Font: Plus Jakarta Sans + Inter
   ============================================================ */

:root {
  --primary:       #1a3c6e;
  --primary-dark:  #122c52;
  --primary-light: #2756a0;
  --green:         #2e7d32;
  --green-light:   #4caf50;
  --accent:        #00c853;
  --gold:          #f9a825;

  --bg:            #f0f2f7;
  --bg-card:       #ffffff;
  --bg-input:      #f5f7fa;

  --text:          #1a1f36;
  --text-muted:    #6b7280;
  --text-light:    #9ca3af;
  --border:        #e5e9f0;
  --border-light:  #f0f2f5;

  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow:        0 2px 12px rgba(0,0,0,.10);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.14);

  --radius-sm:     8px;
  --radius:        14px;
  --radius-lg:     20px;
  --radius-full:   9999px;

  --navbar-h:      60px;
  --sidebar-w:     240px;
  --right-w:       280px;
  --transition:    .18s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  padding-top: var(--navbar-h);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, textarea, select { font-family: inherit; outline: none; }
ul { list-style: none; }

/* ===== UTILS ===== */
.font-600 { font-weight: 600; }
.font-700 { font-weight: 700; }
.text-sm  { font-size: 13px; }
.text-xs  { font-size: 11px; }
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-green   { color: var(--green-light); }
.text-danger  { color: #e53935; }
.text-gold    { color: var(--gold); }
.d-flex { display: flex; }
.gap-8  { gap: 8px; }
.mt-1   { margin-top: .5rem; }
.mb-1   { margin-bottom: .5rem; }

/* ===== TOP NAVBAR ===== */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--navbar-h);
  background: var(--primary);
  box-shadow: 0 2px 16px rgba(0,0,0,.22);
}
.topnav-inner {
  max-width: 1400px; margin: 0 auto;
  height: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
}
.topnav-logo {
  display: flex; align-items: center; gap: 9px;
  flex-shrink: 0; text-decoration: none;
}
.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff;
}
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-access    { font-weight: 800; font-size: 15px; color: #fff; letter-spacing: 2px; }
.logo-community { font-size: 9px; color: rgba(255,255,255,.6); letter-spacing: 3px; }

.topnav-search {
  flex: 1; max-width: 400px;
  position: relative;
}
.topnav-search i {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,.55); font-size: 14px; pointer-events: none;
}
.topnav-search input {
  width: 100%;
  background: rgba(255,255,255,.14);
  border: 1.5px solid rgba(255,255,255,.18);
  border-radius: var(--radius-full);
  padding: 9px 14px 9px 38px;
  color: #fff; font-size: 14px;
  transition: background var(--transition), border-color var(--transition);
}
.topnav-search input::placeholder { color: rgba(255,255,255,.5); }
.topnav-search input:focus {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.4);
}
.search-close-btn {
  display: none; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,.7); background: none; border: none; font-size: 15px; cursor: pointer; padding: 4px;
}
.mobile-search-btn { display: none; }

/* Mobile: search expands full-width over navbar */
@media (max-width: 768px) {
  .topnav-search {
    display: none;
    position: absolute; left: 0; right: 0; top: 0; bottom: 0;
    max-width: 100%; z-index: 10;
    background: var(--primary-dark);
    padding: 8px 12px;
    align-items: center;
  }
  .topnav-search.mobile-open {
    display: flex;
  }
  .topnav-search input {
    background: rgba(255,255,255,.2);
    padding-right: 38px;
  }
  .search-close-btn { display: block; }
  .mobile-search-btn { display: flex !important; }
}
.search-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 300; max-height: 320px; overflow-y: auto;
}
.search-dropdown.show { display: block; }
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition);
}
.search-result-item:hover { background: var(--bg); }
.search-result-item img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }

.topnav-actions {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
}
.nav-icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.8); font-size: 18px;
  transition: background var(--transition);
  position: relative;
  text-decoration: none;
}
.nav-icon-btn:hover, .nav-icon-btn.active { background: rgba(255,255,255,.15); color: #fff; }
.nav-icon-btn .badge {
  position: absolute; top: 4px; right: 4px;
  background: #e53935; color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--primary);
}
.user-menu-wrap { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-full);
  transition: background var(--transition);
}
.user-menu-btn:hover { background: rgba(255,255,255,.14); }
.topnav-avatar {
  width: 34px !important; height: 34px !important;
  min-width: 34px; min-height: 34px;
  border-radius: 50% !important;
  object-fit: cover; object-position: center;
  border: 2px solid rgba(255,255,255,.4);
  overflow: hidden; display: block; flex-shrink: 0;
}
.user-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  min-width: 220px; z-index: 300; overflow: hidden;
}
.user-dropdown.show { display: block; animation: fadeDown .15s ease; }
@keyframes fadeDown { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }
.user-dropdown-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.user-dropdown-header img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.user-dropdown a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; font-size: 14px; color: var(--text);
  transition: background var(--transition);
}
.user-dropdown a:hover { background: var(--bg); }
.user-dropdown a i { width: 16px; color: var(--text-muted); }
.dropdown-divider { height: 1px; background: var(--border); }
.mobile-menu-btn {
  display: none; width: 40px; height: 40px;
  align-items: center; justify-content: center;
  color: #fff; font-size: 20px; border-radius: 8px;
  transition: background var(--transition);
  flex-shrink: 0;
}
.mobile-menu-btn:hover { background: rgba(255,255,255,.12); }

/* ===== NOTIFICATIONS PANEL ===== */
.notif-panel {
  position: fixed; top: var(--navbar-h); right: -380px;
  width: 360px; height: calc(100vh - var(--navbar-h));
  background: var(--bg-card); z-index: 190;
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  display: flex; flex-direction: column;
  transition: right .28s ease;
  border-left: 1px solid var(--border);
}
.notif-panel.open { right: 0; }
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-panel-header h3 { font-size: 17px; font-weight: 800; }
.btn-text { color: var(--primary); font-size: 13px; font-weight: 600; background: none; border: none; cursor: pointer; }
.notif-list { flex: 1; overflow-y: auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border-light);
  cursor: pointer; transition: background var(--transition);
  position: relative;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: rgba(26,60,110,.04); }
.notif-item img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.notif-text { flex: 1; min-width: 0; }
.notif-text div { font-size: 13.5px; line-height: 1.4; }
.notif-time { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.notif-dot {
  width: 9px; height: 9px; background: var(--primary);
  border-radius: 50%; flex-shrink: 0; margin-top: 6px;
}
/* ===== MOBILE SIDEBAR DRAWER ===== */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 170;
  background: rgba(0,0,0,.45);
}
.sidebar-overlay.show { display: block; }

@media (max-width: 768px) {
  .left-sidebar, .sidebar-left {
    display: flex !important;
    flex-direction: column;
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    width: 280px !important;
    max-width: 85vw;
    z-index: 180;
    border-radius: 0 !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    box-shadow: 4px 0 32px rgba(0,0,0,.22);
  }
  .left-sidebar.mobile-open, .sidebar-left.mobile-open {
    transform: translateX(0);
  }
}

/* ===== PAGE LAYOUT ===== */
.page-layout {
  max-width: 1400px; margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--right-w);
  gap: 20px;
  padding: 20px 16px;
  align-items: start;
}
.page-layout.no-right { grid-template-columns: var(--sidebar-w) 1fr; }
.page-layout.full     { grid-template-columns: 1fr; }

/* ===== LEFT SIDEBAR ===== */
.left-sidebar, .sidebar-left {
  position: sticky;
  top: calc(var(--navbar-h) + 12px);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  align-self: start;
}
.sidebar-user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--primary); flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; }
.sidebar-name     { display: block; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-username { font-size: 12px; color: var(--text-muted); }
.sidebar-earnings-card {
  margin: 12px;
  background: linear-gradient(135deg, var(--primary), #2756a0);
  border-radius: var(--radius);
  padding: 13px 14px;
  color: #fff;
}
.earnings-label  { font-size: 11px; opacity: .75; display: block; }
.earnings-amount { font-size: 19px; font-weight: 800; display: block; }
.earnings-btn {
  display: inline-block; margin-top: 8px;
  background: rgba(255,255,255,.18); color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: var(--radius-full);
  transition: background var(--transition);
}
.earnings-btn:hover { background: rgba(255,255,255,.3); }
.sidebar-nav { padding: 6px 0 10px; }
/* OLD sidebar-menu-item (feed/profile pages) */
.sidebar-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; font-size: 14px; font-weight: 500;
  color: var(--text);
  border-left: 3px solid transparent;
  transition: all var(--transition);
}
.sidebar-menu-item:hover { background: var(--bg); color: var(--primary); }
.sidebar-menu-item.active {
  background: rgba(26,60,110,.07); color: var(--primary); font-weight: 600;
  border-left-color: var(--primary);
}
.sidebar-menu-item .icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.sidebar-menu-item.active .icon { background: rgba(26,60,110,.1); color: var(--primary); }
/* NEW nav-item (sidebar.php include) */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 14px; font-weight: 500;
  color: var(--text);
  border-left: 3px solid transparent;
  transition: all var(--transition);
}
.nav-item:hover   { background: var(--bg); color: var(--primary); }
.nav-item.active  {
  background: rgba(26,60,110,.07); color: var(--primary); font-weight: 600;
  border-left-color: var(--primary);
}
.nav-item svg  { flex-shrink: 0; color: var(--text-muted); }
.nav-item.active svg, .nav-item:hover svg { color: var(--primary); }
.nav-item.logout:hover { color: #e53935; background: rgba(229,57,53,.05); }
.nav-item.logout:hover svg { color: #e53935; }
.nav-badge {
  margin-left: auto;
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: var(--radius-full);
}
.nav-divider { height: 1px; background: var(--border-light); margin: 6px 0; }
/* old earnings-card */
.earnings-card {
  margin: 10px 12px 4px;
  background: linear-gradient(135deg, var(--primary), #2756a0);
  border-radius: var(--radius);
  padding: 14px;
  color: #fff;
}
.earnings-card .label  { font-size: 11px; opacity: .7; margin-bottom: 2px; }
.earnings-card .amount { font-size: 20px; font-weight: 800; }
.earnings-card .sub    { font-size: 12px; opacity: .7; margin-top: 2px; }

/* ===== RIGHT SIDEBAR ===== */
.right-sidebar {
  position: sticky; top: calc(var(--navbar-h) + 12px);
  align-self: start;
  display: flex; flex-direction: column; gap: 14px;
}

/* ===== MAIN CONTENT ===== */
.main-content { min-width: 0; }

/* ===== CARDS ===== */
.card, .ac-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.ac-card { padding: 1.2rem; }
.card-body { padding: 16px 20px; }
.card-header {
  padding: 16px 20px 0;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .75rem;
}
.card-header h3, .card-header h4 { font-size: .95rem; font-weight: 700; }
.card-link { font-size: .82rem; color: var(--primary); font-weight: 600; }
.widget-header { margin-bottom: .75rem; }
.widget-header h4 { font-size: .95rem; font-weight: 700; }

/* ===== PAGE HEADER BAR ===== */
.page-header-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; flex-wrap: wrap; gap: 10px;
}
.page-title {
  font-size: 1.3rem; font-weight: 800; color: var(--primary);
  display: flex; align-items: center; gap: 8px;
}
.page-subtitle { color: var(--text-muted); font-size: .88rem; }

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--primary); color: #fff;
  padding: 10px 20px; border-radius: var(--radius-full);
  font-size: 14px; font-weight: 600;
  cursor: pointer; border: none;
  transition: background var(--transition), transform var(--transition);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-sm   { padding: 6px 14px; font-size: 13px; }
.btn-outline {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--primary); color: var(--primary);
  padding: 9px 18px; border-radius: var(--radius-full);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all var(--transition); background: transparent;
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-success { background: var(--green-light) !important; }
.btn-danger  { background: #e53935; color: #fff; }

/* ===== FILTER CHIPS ===== */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600;
  color: var(--text-muted); background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer; transition: all var(--transition);
}
.chip.active, .chip:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 14px; color: var(--text);
  transition: border-color var(--transition);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--primary);
  background: #fff;
}
.form-group textarea { resize: vertical; min-height: 90px; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert-success { background: rgba(76,175,80,.1); color: #2e7d32; border: 1px solid rgba(76,175,80,.25); }
.alert-error   { background: rgba(229,57,53,.08); color: #c62828; border: 1px solid rgba(229,57,53,.2); }

/* ===== STORIES ===== */
.stories-strip {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  padding: 14px 16px; margin-bottom: 16px; overflow-x: auto;
}
.stories-row { display: flex; gap: 14px; }
.story-item { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; }
.story-ring {
  width: 60px; height: 60px; border-radius: 50%;
  border: 2.5px solid var(--primary);
  padding: 2px; flex-shrink: 0;
}
.story-ring.add-story { border-style: dashed; border-color: var(--text-muted); }
.story-add-btn {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 18px;
}
.story-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.story-name { font-size: 11px; font-weight: 600; color: var(--text); max-width: 64px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== CREATE POST ===== */
.create-post-card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  padding: 16px; margin-bottom: 16px;
}
.create-post-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.create-post-input {
  flex: 1; background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 11px 18px; font-size: 14px; cursor: pointer;
  transition: border-color var(--transition);
}
.create-post-input:hover { border-color: var(--primary); }
.create-post-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding-top: 12px; border-top: 1px solid var(--border-light);
}
.post-action-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  min-width: 80px;
}
.post-action-btn:hover { background: var(--bg); }
.post-action-btn.photo:hover { color: #1a73e8; }
.post-action-btn.video:hover { color: #e53935; }
.post-action-btn.poll:hover  { color: var(--green); }
.post-action-btn.event:hover { color: var(--gold); }

/* ===== POST CARDS ===== */
.post-card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.post-header { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px 0; }
.post-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.post-user-info { flex: 1; min-width: 0; }
.post-user-name { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 5px; }
.post-user-name .verified { color: var(--primary); font-size: 14px; }
.post-meta { font-size: 12px; color: var(--text-muted); }
.post-menu-btn { color: var(--text-muted); padding: 4px 8px; border-radius: 6px; }
.post-menu-btn:hover { background: var(--bg); }
.post-dropdown { display:none; position:absolute; top:100%; right:0; background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-sm); box-shadow:var(--shadow-md); min-width:160px; z-index:200; overflow:hidden; }
.post-dropdown.open { display:block; }
.post-dropdown button { display:flex; align-items:center; gap:10px; width:100%; padding:10px 16px; font-size:14px; color:var(--text); text-align:left; background:none; border:none; cursor:pointer; transition:background var(--transition); }
.post-dropdown button:hover { background:var(--bg); }
.post-dropdown button.danger { color:#e53935; }
.post-dropdown button.danger:hover { background:#fde8e8; }
.post-body { padding: 10px 16px 12px; font-size: 15px; line-height: 1.65; word-break: break-word; overflow-wrap: break-word; white-space: pre-wrap; }
.post-image { width: 100%; max-height: 480px; object-fit: cover; }
.post-stats {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px; font-size: 13px; color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  gap: 8px;
}
.post-actions {
  display: flex; gap: 4px;
  padding: 6px 10px;
  border-top: 1px solid var(--border-light);
}
.post-action {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.post-action:hover   { background: var(--bg); }
.post-action.liked   { color: #e53935; }
.post-action.liked:hover { background: rgba(229,57,53,.07); }

/* ===== COMMENTS ===== */
.comment-box {
  display: none; padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
  border-radius: 0 0 var(--radius) var(--radius);
}
.comment-box.open { display: block; }
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment-item { display: flex; gap: 8px; }
.comment-item img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-bubble {
  background: var(--bg-card); border-radius: 12px 12px 12px 0;
  padding: 9px 13px; flex: 1;
  border: 1px solid var(--border);
}
.comment-bubble .author { font-weight: 700; font-size: 12.5px; margin-bottom: 2px; }
.comment-bubble .text   { font-size: 13.5px; line-height: 1.4; }
.comment-bubble .time   { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.comment-input-row { display: flex; gap: 8px; align-items: center; }
.comment-input-row img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.comment-input {
  flex: 1; background: var(--bg-card);
  border: 1.5px solid var(--border); border-radius: var(--radius-full);
  padding: 9px 14px; font-size: 14px;
  transition: border-color var(--transition);
}
.comment-input:focus { border-color: var(--primary); }
.comment-send-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; transition: background var(--transition);
}
.comment-send-btn:hover { background: var(--primary-dark); }

/* ===== RIGHT SIDEBAR WIDGETS ===== */
.widget-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border-light);
}
.widget-item:last-child { border-bottom: none; }
.widget-item img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.widget-item-info { flex: 1; min-width: 0; }
.widget-item-name { font-weight: 600; font-size: 13.5px; }
.widget-item-sub  { font-size: 12px; color: var(--text-muted); }
.follow-btn {
  padding: 5px 13px; border-radius: var(--radius-full);
  border: 1.5px solid var(--primary); color: var(--primary);
  font-size: 12px; font-weight: 700;
  transition: all var(--transition); cursor: pointer;
  background: transparent;
}
.follow-btn:hover, .follow-btn.following {
  background: var(--primary); color: #fff;
}
.referral-box {
  background: linear-gradient(135deg, var(--primary), #2756a0);
  border-radius: var(--radius); padding: 16px; color: #fff;
  margin-top: 14px;
}
.referral-box h4 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.referral-code {
  background: rgba(255,255,255,.15);
  border-radius: var(--radius-sm); padding: 8px 12px;
  font-size: 18px; font-weight: 800; letter-spacing: 2px;
  text-align: center; margin: 8px 0;
}
.copy-btn {
  width: 100%; padding: 8px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.2); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background var(--transition);
}
.copy-btn:hover { background: rgba(255,255,255,.35); }

/* ===== PROFILE PAGE ===== */
.profile-cover {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  height: 200px; border-radius: var(--radius) var(--radius) 0 0;
  position: relative; overflow: hidden;
}
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-info-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0 20px 16px;
  margin-bottom: 16px;
}
.profile-avatar-wrap {
  margin-top: -50px; margin-bottom: 10px;
  position: relative; display: inline-block;
}
.profile-avatar {
  width: 100px; height: 100px; border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-card);
  box-shadow: var(--shadow);
}
.verified-badge { color: var(--primary); font-size: 18px; }
.profile-name { font-size: 1.3rem; font-weight: 800; margin-bottom: 2px; word-break: break-word; }
.profile-username { color: var(--text-muted); font-size: 14px; word-break: break-all; }
.profile-bio { font-size: 14px; margin: 8px 0; color: var(--text); word-break: break-word; overflow-wrap: break-word; line-height: 1.6; }
.profile-stats {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin: 12px 0;
}
.profile-stat { text-align: center; }
.profile-stat .num { font-weight: 800; font-size: 1.2rem; color: var(--primary); }
.profile-stat .lbl { font-size: 12px; color: var(--text-muted); }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== MESSAGES PAGE ===== */
.messages-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - var(--navbar-h) - 40px);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.messages-sidebar {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.messages-sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.messages-sidebar-header h3 { font-size: 1.1rem; font-weight: 800; }
.messages-search-wrap {
  position: relative; margin: 10px 12px;
}
.messages-search-wrap i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 13px;
}
.messages-search-wrap input {
  width: 100%; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  padding: 9px 12px 9px 35px; font-size: 13.5px;
}
.conv-list { flex: 1; overflow-y: auto; }
.conv-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; cursor: pointer;
  transition: background var(--transition); border-bottom: 1px solid var(--border-light);
}
.conv-item:hover, .conv-item.active { background: rgba(26,60,110,.06); }
.conv-item img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.conv-info { flex: 1; min-width: 0; }
.conv-name {
  font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
.conv-preview { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time    { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.conv-unread  {
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: var(--radius-full);
}
.chat-area {
  display: flex; flex-direction: column; flex: 1; min-width: 0;
  min-height: 0; /* critical: lets flex children shrink below content size */
  overflow: hidden;
}
.chat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.chat-header img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.chat-header-name   { font-weight: 700; font-size: 15px; }
.chat-header-status { font-size: 12px; color: var(--green-light); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.msg-bubble {
  max-width: 68%; padding: 10px 14px;
  border-radius: 18px; font-size: 14px; line-height: 1.5;
  word-break: break-word;
}
.msg-bubble.mine   { background: var(--primary); color: #fff; border-radius: 18px 18px 4px 18px; }
.msg-bubble.theirs { background: var(--bg-input); color: var(--text); border-radius: 18px 18px 18px 4px; }
.msg-time { font-size: 11px; color: var(--text-light); padding: 0 4px; }
.chat-input-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.chat-input-bar input {
  flex: 1; background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: var(--radius-full); padding: 10px 16px; font-size: 14px;
}
.chat-input-bar input:focus { border-color: var(--primary); background: #fff; }
.chat-send-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; transition: background var(--transition);
}
.chat-send-btn:hover { background: var(--primary-dark); }

/* ===== WALLET PAGE ===== */
.wallet-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #2756a0 60%, var(--green) 100%);
  border-radius: var(--radius-lg); padding: 28px 24px; color: #fff; margin-bottom: 1.25rem;
}
.wallet-balance-label { font-size: 13px; opacity: .75; margin-bottom: 4px; }
.wallet-balance       { font-size: 2.8rem; font-weight: 800; line-height: 1; margin-bottom: 6px; }
.wallet-points        { font-size: 13px; opacity: .75; }
.wallet-actions       { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.wallet-action-btn {
  flex: 1; min-width: 100px; padding: 10px 12px; border-radius: var(--radius);
  background: rgba(255,255,255,.18); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; transition: background var(--transition); border: none;
}
.wallet-action-btn:hover { background: rgba(255,255,255,.3); }
.wallet-stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-bottom: 1.25rem;
}
.wallet-stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  text-align: center; box-shadow: var(--shadow-sm);
}
.wallet-stat-card .ws-icon { font-size: 1.5rem; margin-bottom: 6px; }
.wallet-stat-card .ws-val  { font-size: 1.2rem; font-weight: 800; color: var(--primary); }
.wallet-stat-card .ws-lbl  { font-size: 11px; color: var(--text-muted); }
.tx-list { display: flex; flex-direction: column; }
.tx-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border-light);
}
.tx-item:last-child { border-bottom: none; }
.tx-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.tx-icon.credit  { background: rgba(76,175,80,.12); }
.tx-icon.debit   { background: rgba(229,57,53,.09); }
.tx-info { flex: 1; min-width: 0; }
.tx-desc { font-weight: 600; font-size: 14px; }
.tx-date { font-size: 12px; color: var(--text-muted); }
.tx-amount { font-weight: 700; font-size: 15px; }
.tx-amount.credit { color: var(--green-light); }
.tx-amount.debit  { color: #e53935; }
/* short tx items used in analytics */
.tx-item-small { display: flex; align-items: center; gap: 10px; padding: .55rem 0; border-bottom: 1px solid var(--border-light); }
.tx-item-small:last-child { border-bottom: none; }
.tx-icon-sm  { font-size: 1.1rem; }
.tx-info-sm  { flex: 1; min-width: 0; }
.tx-desc-sm  { display: block; font-size: .84rem; font-weight: 600; }
.tx-date-sm  { font-size: .75rem; color: var(--text-muted); }
.tx-amount-sm { font-weight: 700; font-size: .88rem; white-space: nowrap; }
.tx-amount-sm.credit { color: var(--green-light); }
.tx-amount-sm.debit  { color: #e53935; }

/* ===== COMMUNITIES ===== */
.community-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.community-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  box-shadow: var(--shadow-sm);
}
.community-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.community-card-cover { height: 72px; background: linear-gradient(135deg, var(--primary), #2756a0); }
.community-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.community-card-body { padding: 12px 14px; }
.community-card-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.community-card-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.community-card-footer { display: flex; align-items: center; justify-content: space-between; }
.community-members { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

/* ===== MARKETPLACE ===== */
.marketplace-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.product-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: box-shadow var(--transition); box-shadow: var(--shadow-sm);
}
.product-card:hover { box-shadow: var(--shadow); }
.product-img { height: 150px; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 38px; overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: 12px 14px; }
.product-title { font-weight: 700; font-size: 14px; }
.product-price { color: var(--primary); font-weight: 800; font-size: 15px; margin-top: 4px; }
.product-seller { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ===== ANALYTICS ===== */
.analytics-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px; margin-bottom: 1.25rem;
}
.stat-card { display: flex; align-items: center; gap: 12px; }
.stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.blue   { background: rgba(26,60,110,.1);  color: var(--primary); }
.stat-icon.green  { background: rgba(76,175,80,.12); color: var(--green-light); }
.stat-icon.orange { background: rgba(255,152,0,.12); color: #ff9800; }
.stat-icon.purple { background: rgba(103,58,183,.1); color: #673ab7; }
.stat-icon.teal   { background: rgba(0,188,212,.1);  color: #00bcd4; }
.stat-icon.gold   { background: rgba(249,168,37,.12);color: var(--gold); }
.stat-info { display: flex; flex-direction: column; min-width: 0; }
.stat-value { font-size: 1.35rem; font-weight: 800; color: var(--primary); line-height: 1.1; }
.stat-label { font-size: .77rem; color: var(--text-muted); }
.analytics-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 1.25rem; }
.analytics-chart-card { overflow: hidden; }
.chart-wrap { padding: .5rem 0; }
.top-posts-list { display: flex; flex-direction: column; gap: .7rem; }
.top-post-item { display: flex; align-items: flex-start; gap: 10px; padding: .5rem 0; border-bottom: 1px solid var(--border-light); }
.top-post-item:last-child { border-bottom: none; }
.rank { font-weight: 800; font-size: 1.1rem; color: var(--primary); min-width: 26px; }
.post-preview p { font-size: .87rem; line-height: 1.4; margin-bottom: 2px; }
.post-date { font-size: .75rem; color: var(--text-muted); }
.post-metrics { margin-left: auto; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.metric { font-size: .78rem; }

/* ===== NOTIFICATIONS PAGE ===== */
.notif-page-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 1.25rem;
}
.badge-count {
  background: #e53935; color: #fff;
  font-size: 12px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-full);
}
.notif-filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-tab {
  padding: 6px 14px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  background: var(--bg); border: 1px solid var(--border);
  transition: all var(--transition);
}
.filter-tab.active, .filter-tab:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.notif-list-card { padding: 0; overflow: hidden; }
.notif-group-label { padding: 8px 16px 5px; font-size: 11px; font-weight: 700; color: var(--text-muted); background: var(--bg); text-transform: uppercase; letter-spacing: .5px; }
.notif-page-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border-light);
  transition: background var(--transition); position: relative;
}
.notif-page-item:hover { background: var(--bg); }
.notif-page-item.unread { background: rgba(26,60,110,.03); }
.notif-avatar-wrap { position: relative; flex-shrink: 0; }
.notif-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.notif-type-icon {
  position: absolute; bottom: -2px; right: -4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 10px;
}
.notif-body { flex: 1; min-width: 0; }
.notif-text-msg { font-size: .87rem; line-height: 1.4; }
.notif-content-preview { color: var(--text-muted); }
.notif-ts { font-size: .77rem; color: var(--text-muted); margin-top: 3px; display: block; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .45rem 0; border-bottom: 1px solid var(--border-light); font-size: .87rem;
}
.summary-row:last-child { border-bottom: none; }
.badge-num { background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: var(--radius-full); }

/* ===== EVENTS PAGE ===== */
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; }
.event-card { padding: 0; overflow: hidden; }
.event-img-wrap { position: relative; }
.event-img { width: 100%; height: 170px; object-fit: cover; }
.event-type-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 9px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700; backdrop-filter: blur(8px);
}
.event-type-badge.online    { background: rgba(76,175,80,.88); color: #fff; }
.event-type-badge.in-person { background: rgba(26,60,110,.88); color: #fff; }
.event-upcoming-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--gold); color: #000;
  padding: 3px 9px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700;
}
.event-body { padding: .9rem 1rem; }
.event-title { font-size: .95rem; font-weight: 700; margin-bottom: .4rem; }
.event-meta  { display: flex; flex-direction: column; gap: 3px; margin-bottom: .55rem; }
.event-date, .event-location { font-size: .8rem; color: var(--text-muted); }
.event-desc { font-size: .83rem; color: var(--text-muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: .7rem; }
.event-footer { display: flex; align-items: center; justify-content: space-between; }
.event-attendees { font-size: .8rem; color: var(--text-muted); }

/* ===== AUTH ===== */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.auth-container { display: grid; grid-template-columns: 1fr 1fr; max-width: 900px; width: 100%; background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.auth-left { background: linear-gradient(135deg, var(--primary) 0%, #2756a0 60%, var(--green) 100%); padding: 40px 36px; color: #fff; display: flex; flex-direction: column; justify-content: center; }
.auth-left-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.auth-left-logo-icon { width: 50px; height: 50px; background: rgba(255,255,255,.2); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 18px; }
.auth-left h2 { font-size: 1.7rem; font-weight: 800; margin-bottom: 10px; }
.auth-left p  { opacity: .8; font-size: 14px; line-height: 1.7; margin-bottom: 28px; }
.auth-features { display: flex; flex-direction: column; gap: 14px; }
.auth-feature { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.auth-feature-icon { width: 38px; height: 38px; background: rgba(255,255,255,.15); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.auth-right { padding: 36px 32px; overflow-y: auto; }
.auth-tab-bar { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.auth-tab-btn { flex: 1; padding: 12px; font-size: 15px; font-weight: 700; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--transition); cursor: pointer; }
.auth-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-form-panel { display: none; }
.auth-form-panel.active { display: block; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 13px; margin: 16px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.social-auth { display: flex; gap: 10px; }
.social-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); font-size: 14px; font-weight: 600; color: var(--text); transition: border-color var(--transition); cursor: pointer; }
.social-btn:hover { border-color: var(--primary); }
.social-btn i.fa-google { color: #ea4335; }
.social-btn i.fa-facebook { color: #1877f2; }

/* ===== TABS ===== */
.tab-bar { display: flex; border-bottom: 2px solid var(--border); }
.tab-btn { padding: 12px 18px; font-size: 14px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--transition); cursor: pointer; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; padding-top: 16px; }
.tab-content.active { display: block; }

/* ===== LOADING / SKELETONS ===== */
.loading-dots { display: flex; gap: 6px; justify-content: center; padding: 24px; }
.loading-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); opacity: .3; animation: blink 1.2s infinite; }
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100%{opacity:.3} 40%{opacity:1} }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 80px; right: 16px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--text); color: #fff; border-radius: var(--radius); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: slideIn .3s ease; max-width: 300px; }
.toast.success { background: var(--green); }
.toast.error   { background: #e53935; }
.toast.info    { background: var(--primary); }
@keyframes slideIn { from{transform:translateX(120%);opacity:0} to{transform:translateX(0);opacity:1} }

/* ===== MODAL ===== */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,.5); backdrop-filter: blur(3px); align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.open { display: flex; animation: fadeIn .15s; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.modal { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; animation: popIn .2s ease; }
@keyframes popIn { from{transform:scale(.93);opacity:0} to{transform:scale(1);opacity:1} }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 17px; font-weight: 800; }
.modal-close { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: background var(--transition); }
.modal-close:hover { background: var(--bg); }
.modal-body { padding: 20px; }

/* ===== MISC ===== */
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state i { font-size: 44px; margin-bottom: 10px; opacity: .28; }
.empty-state p { font-size: 15px; }
.empty-icon { font-size: 2.4rem; margin-bottom: .5rem; }

/* ===== MOBILE BOTTOM NAV ===== */
.mobile-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 6px 0 max(8px, env(safe-area-inset-bottom));
  justify-content: space-around;
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}
.mbnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 12px;
  font-size: 20px; color: var(--text-muted);
  position: relative; transition: color var(--transition);
}
.mbnav-item.active { color: var(--primary); }
.mbnav-item span { font-size: 10px; font-weight: 600; }
.mbnav-create {
  width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--green-light));
  color: #fff !important; font-size: 22px !important;
  display: flex; align-items: center; justify-content: center;
  margin-top: -12px;
  box-shadow: 0 4px 16px rgba(26,60,110,.4);
}
.mbnav-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.badge-dot { width: 8px; height: 8px; background: #e53935; border-radius: 50%; position: absolute; top: 3px; right: 8px; border: 2px solid var(--bg-card); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  :root { --right-w: 250px; }
}

@media (max-width: 900px) {
  .page-layout { grid-template-columns: var(--sidebar-w) 1fr; }
  .right-sidebar { display: none; }
  :root { --sidebar-w: 210px; }
  .analytics-row { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  :root { --navbar-h: 56px; }
  body { padding-bottom: 68px; }

  .page-layout {
    grid-template-columns: 1fr !important;
    padding: 10px 10px;
    gap: 12px;
  }
  .left-sidebar, .sidebar-left { /* hidden by transform via drawer CSS above */ }
  .right-sidebar { display: none; }

  .topnav-search { /* handled by mobile search CSS above */ }
  .topnav-actions .nav-icon-btn.hide-mobile { display: none; }
  .mobile-menu-btn { display: flex !important; }
  .mobile-bottom-nav { display: flex !important; }

  .auth-container { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { padding: 24px 20px; }

  .community-grid { grid-template-columns: 1fr; }
  .marketplace-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .wallet-stats-grid { grid-template-columns: repeat(3, 1fr); }

  .messages-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - var(--navbar-h) - 68px);
    min-height: 0;
    overflow: visible; /* allow topnav sidebar drawer to render above */
  }
  .messages-sidebar {
    display: none;
    position: fixed;
    inset: var(--navbar-h) 0 68px 0;
    z-index: 60;
    background: var(--bg-card);
    overflow-y: auto;
  }
  .messages-sidebar.show { display: flex; flex-direction: column; }
  .chat-area { display: flex !important; }
  #backToConvs { display: flex !important; }

  .profile-cover { height: 140px; }
  .profile-avatar { width: 80px; height: 80px; }

  .post-action span { display: none; }
  .stories-strip { overflow-x: auto; }

  .events-grid { grid-template-columns: 1fr; }

  .notif-panel { width: 100%; right: -100%; }

  .wallet-hero { padding: 20px 16px; }
  .wallet-balance { font-size: 2rem; }
  .create-post-actions { gap: 4px; }
  .post-action-btn span { display: none; }
}

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