/* ============================================================
   NairaLink - Main Stylesheet
   Theme: Bold Nigerian Green + Modern Editorial
   ============================================================ */

:root {
  --green-deep:   #006B35;
  --green-mid:    #008751;
  --green-bright: #00A86B;
  --green-light:  #E8F5EF;
  --gold:         #E8A020;
  --gold-light:   #FFF4DE;
  --white:        #FFFFFF;
  --off-white:    #F7F8FA;
  --border:       #E4E8ED;
  --text-primary: #0F1923;
  --text-secondary: #4A5568;
  --text-muted:   #8795A1;
  --danger:       #E53E3E;
  --danger-light: #FFF5F5;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:    0 12px 40px rgba(0,0,0,0.14);
  --radius:       10px;
  --radius-lg:    16px;
  --transition:   0.2s ease;
  --font-body:    'Sora', sans-serif;
  --font-mono:    'Space Mono', monospace;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
}
a { color: var(--green-deep); text-decoration: none; }
a:hover { color: var(--green-bright); }
img { max-width: 100%; height: auto; }
hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
input, textarea, select, button { font-family: var(--font-body); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--green-mid); color: #fff; border: none;
  padding: .55rem 1.25rem; border-radius: 8px; font-size: .875rem;
  font-weight: 600; cursor: pointer; transition: var(--transition);
  letter-spacing: .01em;
}
.btn-primary:hover { background: var(--green-deep); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,135,81,.3); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: .45rem;
  background: transparent; color: var(--text-primary);
  border: 1.5px solid var(--border); padding: .5rem 1.2rem;
  border-radius: 8px; font-size: .875rem; font-weight: 500;
  cursor: pointer; transition: var(--transition);
}
.btn-ghost:hover { border-color: var(--green-mid); color: var(--green-mid); }

.btn-danger { background: var(--danger); color: #fff; border: none; padding: .5rem 1rem; border-radius: 7px; cursor: pointer; font-weight: 600; transition: var(--transition); }
.btn-danger:hover { background: #c53030; }

.btn-post {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--gold); color: var(--text-primary);
  border: none; padding: .5rem 1.1rem; border-radius: 8px;
  font-size: .85rem; font-weight: 700; cursor: pointer;
  transition: var(--transition); white-space: nowrap;
}
.btn-post:hover { background: #d4911a; color: var(--text-primary); transform: translateY(-1px); }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--green-deep);
  box-shadow: 0 2px 16px rgba(0,107,53,.3);
}
.nav-container {
  max-width: 1280px; margin: 0 auto;
  padding: 0 1.5rem;
  display: flex; align-items: center; gap: 1.2rem;
  height: 62px;
}
.nav-logo {
  display: flex; align-items: center; gap: .5rem;
  color: #fff; font-weight: 700; font-size: 1.25rem;
  letter-spacing: -.02em; white-space: nowrap;
  text-decoration: none;
}
.logo-icon { font-size: 1.4rem; }
.logo-accent { color: var(--gold); }

.nav-search {
  flex: 1; max-width: 480px;
  display: flex;
}
.nav-search form {
  display: flex; width: 100%;
  background: rgba(255,255,255,.12); border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,.18); overflow: hidden;
  transition: var(--transition);
}
.nav-search form:focus-within {
  background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.4);
}
.nav-search input {
  flex: 1; background: transparent; border: none; outline: none;
  padding: .5rem 1rem; color: #fff; font-size: .875rem;
}
.nav-search input::placeholder { color: rgba(255,255,255,.55); }
.nav-search button {
  background: transparent; border: none; color: rgba(255,255,255,.8);
  padding: 0 1rem; cursor: pointer; transition: var(--transition);
}
.nav-search button:hover { color: #fff; }

.nav-actions {
  display: flex; align-items: center; gap: .5rem; margin-left: auto;
}
.nav-icon-btn {
  position: relative; width: 38px; height: 38px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; color: rgba(255,255,255,.85);
  transition: var(--transition); background: rgba(255,255,255,.08);
}
.nav-icon-btn:hover { background: rgba(255,255,255,.18); color: #fff; }
.badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--gold); color: var(--text-primary);
  font-size: .65rem; 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(--green-deep);
}
.nav-avatar-wrap {
  display: flex; align-items: center; gap: .5rem;
  cursor: pointer; padding: .3rem .6rem; border-radius: 8px;
  color: rgba(255,255,255,.9); transition: var(--transition);
  background: rgba(255,255,255,.08);
}
.nav-avatar-wrap:hover { background: rgba(255,255,255,.18); }
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.3); }
.nav-username { font-size: .825rem; font-weight: 600; }
.nav-chevron { font-size: .6rem; opacity: .7; }

/* Dropdowns */
.dropdown, .notif-dropdown {
  position: absolute; top: calc(100% + 12px); right: 0;
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  min-width: 200px; z-index: 200; opacity: 0; pointer-events: none;
  transform: translateY(-8px); transition: all .2s ease;
}
.dropdown.open, .notif-dropdown.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown a {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.2rem; color: var(--text-primary); font-size: .875rem;
  transition: background .15s;
}
.dropdown a:hover { background: var(--off-white); }
.dropdown a.text-danger { color: var(--danger); }
.dropdown a i { width: 16px; color: var(--text-muted); }
.nav-avatar-wrap { position: relative; }
#user-menu { width: 220px; }

.notif-dropdown { width: 360px; right: 0; }
.notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: .9rem;
}
.notif-header button { font-size: .75rem; color: var(--green-mid); background: none; border: none; cursor: pointer; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
  display: flex; gap: .75rem; padding: .85rem 1.2rem;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s;
}
.notif-item:hover { background: var(--off-white); }
.notif-item.unread { background: var(--green-light); }
.notif-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.notif-content { flex: 1; min-width: 0; }
.notif-content p { font-size: .82rem; color: var(--text-primary); line-height: 1.4; }
.notif-content .notif-time { font-size: .72rem; color: var(--text-muted); margin-top: .25rem; }
.notif-loading { text-align: center; padding: 2rem; color: var(--text-muted); }

/* Flash messages */
.flash {
  max-width: 1280px; margin: .75rem auto; padding: .9rem 1.25rem;
  border-radius: var(--radius); display: flex; align-items: center; gap: .75rem;
  font-size: .875rem; font-weight: 500; position: relative;
}
.flash button { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 1.1rem; opacity: .6; }
.flash-success { background: #EBF8F1; color: #276749; border: 1px solid #9AE6B4; }
.flash-error   { background: var(--danger-light); color: var(--danger); border: 1px solid #FEB2B2; }

/* ── Page Layout ─────────────────────────────────────────────── */
.page-wrap { max-width: 1280px; margin: 0 auto; padding: 1.5rem; }

.content-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 1.5rem;
}
.sidebar { display: flex; flex-direction: column; gap: 1rem; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: #fff; border-radius: var(--radius-lg);
  border: 1px solid var(--border); overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: .9rem;
}
.card-header .card-icon { color: var(--green-mid); margin-right: .4rem; }
.card-body { padding: 1.25rem; }

/* ── Homepage Hero ───────────────────────────────────────────── */
.hero-banner {
  background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 60%, var(--green-bright) 100%);
  border-radius: var(--radius-lg); padding: 2.5rem 2rem;
  color: #fff; position: relative; overflow: hidden; margin-bottom: 1.5rem;
}
.hero-banner::before {
  content: '🇳🇬'; font-size: 12rem; position: absolute;
  right: -2rem; top: 50%; transform: translateY(-50%);
  opacity: .07; pointer-events: none;
}
.hero-title { font-size: 1.75rem; font-weight: 700; line-height: 1.2; margin-bottom: .5rem; }
.hero-sub { font-size: .95rem; opacity: .88; max-width: 480px; }
.hero-actions { display: flex; gap: .75rem; margin-top: 1.5rem; }
.hero-actions .btn-white {
  background: #fff; color: var(--green-deep); font-weight: 700;
  padding: .65rem 1.4rem; border-radius: 8px; font-size: .9rem;
  transition: var(--transition);
}
.hero-actions .btn-white:hover { background: var(--gold); color: var(--text-primary); }
.hero-actions .btn-outline {
  background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.5);
  padding: .65rem 1.4rem; border-radius: 8px; font-size: .9rem;
  transition: var(--transition);
}
.hero-actions .btn-outline:hover { border-color: #fff; background: rgba(255,255,255,.1); }

.stats-row {
  display: flex; gap: 1.5rem; margin-top: 1.5rem;
  padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.2);
}
.stat-item { display: flex; flex-direction: column; }
.stat-num { font-size: 1.35rem; font-weight: 700; font-family: var(--font-mono); }
.stat-label { font-size: .72rem; opacity: .75; text-transform: uppercase; letter-spacing: .05em; }

/* ── Category Grid ───────────────────────────────────────────── */
.category-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1.5rem;
}
.category-card {
  background: #fff; border-radius: var(--radius); border: 1px solid var(--border);
  padding: 1.1rem 1.2rem; display: flex; align-items: flex-start; gap: .9rem;
  transition: var(--transition); cursor: pointer; text-decoration: none; color: inherit;
}
.category-card:hover { border-color: var(--green-mid); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cat-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.cat-info { min-width: 0; }
.cat-name { font-weight: 700; font-size: .9rem; color: var(--text-primary); margin-bottom: .15rem; }
.cat-desc { font-size: .75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-stats { font-size: .7rem; color: var(--text-muted); margin-top: .3rem; }

/* ── Thread List ─────────────────────────────────────────────── */
.thread-list { display: flex; flex-direction: column; gap: .5rem; }

.thread-item {
  background: #fff; border-radius: var(--radius); border: 1px solid var(--border);
  padding: 1rem 1.2rem; display: flex; gap: 1rem; align-items: flex-start;
  transition: var(--transition);
}
.thread-item:hover { border-color: var(--green-bright); box-shadow: var(--shadow-sm); }
.thread-item.pinned { border-left: 3px solid var(--gold); background: var(--gold-light); }
.thread-item.featured { border-left: 3px solid var(--green-mid); }

.thread-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

.thread-body { flex: 1; min-width: 0; }
.thread-meta { display: flex; align-items: center; gap: .5rem; font-size: .75rem; color: var(--text-muted); margin-bottom: .3rem; flex-wrap: wrap; }
.thread-category-tag {
  background: var(--green-light); color: var(--green-deep);
  padding: .15rem .55rem; border-radius: 4px; font-size: .7rem; font-weight: 600;
}
.thread-pin-badge { color: var(--gold); font-size: .75rem; }

.thread-title {
  font-size: .95rem; font-weight: 600; color: var(--text-primary);
  margin-bottom: .35rem; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.thread-title a { color: inherit; }
.thread-title a:hover { color: var(--green-deep); }

.thread-stats {
  display: flex; align-items: center; gap: 1rem; font-size: .75rem; color: var(--text-muted);
}
.thread-stat { display: flex; align-items: center; gap: .3rem; }
.thread-stat i { font-size: .7rem; }

.thread-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; flex-shrink: 0; }
.thread-last-reply { font-size: .72rem; color: var(--text-muted); text-align: right; }

/* ── Thread View ─────────────────────────────────────────────── */
.thread-view-header {
  background: #fff; border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 1.75rem 2rem; margin-bottom: 1rem;
}
.thread-view-title { font-size: 1.35rem; font-weight: 700; line-height: 1.3; margin-bottom: .75rem; }
.thread-view-meta { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; font-size: .8rem; color: var(--text-muted); }

.ai-summary {
  background: linear-gradient(135deg, #E8F5EF, #F0FFF9);
  border: 1px solid #9AE6B4; border-radius: var(--radius);
  padding: 1rem 1.25rem; margin: 1rem 0;
  display: flex; gap: .75rem;
}
.ai-summary-icon { font-size: 1.4rem; }
.ai-summary-text { font-size: .85rem; color: #276749; line-height: 1.55; }
.ai-summary-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--green-mid); margin-bottom: .3rem; }

/* Posts */
.post-card {
  background: #fff; border-radius: var(--radius); border: 1px solid var(--border);
  margin-bottom: .75rem; overflow: hidden; transition: var(--transition);
}
.post-card:target { border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(0,135,81,.15); }

.post-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.25rem; border-bottom: 1px solid var(--border);
  background: var(--off-white);
}
.post-author { display: flex; align-items: center; gap: .75rem; }
.post-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.post-author-info .post-username { font-weight: 700; font-size: .875rem; color: var(--text-primary); }
.post-author-info .post-role-badge {
  font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: .1rem .45rem; border-radius: 4px; margin-left: .35rem;
}
.badge-admin { background: #FED7D7; color: var(--danger); }
.badge-moderator { background: #E9D8FD; color: #6B46C1; }
.badge-member { background: var(--green-light); color: var(--green-deep); }
.post-author-stats { font-size: .7rem; color: var(--text-muted); }
.post-time { font-size: .75rem; color: var(--text-muted); }

.post-body {
  padding: 1.25rem 1.5rem;
  font-size: .9rem; line-height: 1.75; color: var(--text-primary);
}
.post-body p { margin-bottom: .75rem; }
.post-body blockquote {
  border-left: 3px solid var(--border); padding: .5rem 1rem;
  background: var(--off-white); border-radius: 0 6px 6px 0;
  margin: .75rem 0; color: var(--text-secondary); font-style: italic;
}
.post-body code { background: #F0F4F8; padding: .1rem .35rem; border-radius: 4px; font-family: var(--font-mono); font-size: .82rem; }
.post-body img { max-width: 100%; border-radius: 8px; margin: .5rem 0; }

.post-footer {
  padding: .65rem 1.25rem; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
}
.post-action-btn {
  background: none; border: none; cursor: pointer; display: flex; align-items: center;
  gap: .35rem; font-size: .78rem; color: var(--text-muted); padding: .3rem .6rem;
  border-radius: 6px; transition: var(--transition);
}
.post-action-btn:hover { background: var(--off-white); color: var(--text-primary); }
.post-action-btn.liked { color: var(--danger); }
.post-action-btn.liked i { animation: pop .25s ease; }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.4); } 100% { transform: scale(1); } }

/* Reply form */
.reply-form-wrap {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border);
  padding: 1.5rem; margin-top: 1rem;
}
.reply-form-wrap h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .825rem; font-weight: 600; margin-bottom: .4rem; color: var(--text-secondary); }
.form-control {
  width: 100%; padding: .65rem .9rem; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: .875rem; outline: none; transition: var(--transition);
  background: #fff; color: var(--text-primary);
}
.form-control:focus { border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(0,135,81,.12); }
textarea.form-control { min-height: 130px; resize: vertical; }
.form-error { font-size: .775rem; color: var(--danger); margin-top: .3rem; display: flex; align-items: center; gap: .3rem; }

/* Pagination */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  margin: 1.5rem 0;
}
.page-link {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 7px;
  font-size: .825rem; font-weight: 600; border: 1.5px solid var(--border);
  color: var(--text-secondary); transition: var(--transition); text-decoration: none;
}
.page-link:hover { border-color: var(--green-mid); color: var(--green-mid); }
.page-link.active { background: var(--green-mid); border-color: var(--green-mid); color: #fff; }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* ── Sidebar Widgets ─────────────────────────────────────────── */
.sidebar-widget {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border);
  overflow: hidden;
}
.widget-title {
  padding: .9rem 1.2rem; border-bottom: 1px solid var(--border);
  font-size: .85rem; font-weight: 700; display: flex; align-items: center; gap: .5rem;
}
.widget-title i { color: var(--green-mid); }
.widget-body { padding: .75rem; }

.trending-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .6rem .5rem; border-radius: 8px; transition: background .15s; cursor: pointer;
}
.trending-item:hover { background: var(--off-white); }
.trending-num { font-family: var(--font-mono); font-size: .8rem; font-weight: 700; color: var(--green-mid); width: 20px; flex-shrink: 0; padding-top: .1rem; }
.trending-text { font-size: .82rem; font-weight: 500; color: var(--text-primary); line-height: 1.35; }
.trending-stats { font-size: .7rem; color: var(--text-muted); margin-top: .2rem; }

.top-user-item {
  display: flex; align-items: center; gap: .75rem; padding: .55rem .5rem;
  border-radius: 8px; transition: background .15s; text-decoration: none; color: inherit;
}
.top-user-item:hover { background: var(--off-white); }
.top-user-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.top-user-name { font-size: .825rem; font-weight: 600; color: var(--text-primary); }
.top-user-rep { font-size: .7rem; color: var(--text-muted); }
.top-user-rank { margin-left: auto; font-family: var(--font-mono); font-size: .75rem; color: var(--gold); font-weight: 700; }

/* ── Auth Pages ──────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--green-deep) 0%, #004D26 100%);
  padding: 1.5rem;
}
.auth-card {
  background: #fff; border-radius: var(--radius-lg); padding: 2.5rem;
  width: 100%; max-width: 440px; box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; font-size: 1.5rem; font-weight: 800; color: var(--green-deep); margin-bottom: .25rem; }
.auth-logo span { color: var(--gold); }
.auth-tagline { text-align: center; font-size: .825rem; color: var(--text-muted); margin-bottom: 2rem; }
.auth-title { font-size: 1.35rem; font-weight: 700; text-align: center; margin-bottom: 1.5rem; }
.auth-footer { text-align: center; font-size: .825rem; color: var(--text-muted); margin-top: 1.25rem; }
.auth-footer a { color: var(--green-mid); font-weight: 600; }
.error-list { background: var(--danger-light); border: 1px solid #FEB2B2; border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; }
.error-list li { font-size: .825rem; color: var(--danger); margin-left: 1rem; }

/* ── Profile Page ─────────────────────────────────────────────── */
.profile-cover {
  height: 200px; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(135deg, var(--green-deep), var(--green-bright));
  position: relative; overflow: hidden;
}
.profile-card {
  background: #fff; border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border: 1px solid var(--border); border-top: none;
  padding: 0 2rem 1.5rem; margin-bottom: 1.5rem;
}
.profile-avatar-wrap {
  margin-top: -50px; margin-bottom: .75rem; position: relative; display: inline-block;
}
.profile-avatar-img {
  width: 100px; height: 100px; border-radius: 50%; object-fit: cover;
  border: 4px solid #fff; box-shadow: var(--shadow-md);
}
.profile-name { font-size: 1.35rem; font-weight: 800; }
.profile-meta { font-size: .825rem; color: var(--text-muted); display: flex; gap: 1.25rem; flex-wrap: wrap; margin: .5rem 0; }
.profile-stats { display: flex; gap: 2rem; margin: 1rem 0; }
.profile-stat { text-align: center; }
.profile-stat-num { font-size: 1.25rem; font-weight: 700; font-family: var(--font-mono); color: var(--text-primary); }
.profile-stat-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

/* ── Messaging ──────────────────────────────────────────────── */
.messages-layout { display: grid; grid-template-columns: 300px 1fr; gap: 0; height: calc(100vh - 180px); }
.convo-sidebar { border-right: 1px solid var(--border); overflow-y: auto; }
.convo-item {
  display: flex; gap: .85rem; padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s;
}
.convo-item:hover, .convo-item.active { background: var(--green-light); }
.convo-item img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.convo-info { flex: 1; min-width: 0; }
.convo-name { font-weight: 700; font-size: .875rem; }
.convo-preview { font-size: .775rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-unread { background: var(--green-mid); color: #fff; font-size: .65rem; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-area { display: flex; flex-direction: column; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .65rem; }
.msg-row { display: flex; gap: .6rem; max-width: 75%; }
.msg-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-row img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; align-self: flex-end; }
.msg-bubble {
  padding: .65rem .9rem; border-radius: 14px;
  font-size: .875rem; line-height: 1.5; max-width: 100%;
  background: var(--off-white); color: var(--text-primary); border: 1px solid var(--border);
}
.msg-row.mine .msg-bubble { background: var(--green-mid); color: #fff; border-color: var(--green-mid); }
.msg-time { font-size: .65rem; color: var(--text-muted); margin-top: .2rem; }
.msg-row.mine .msg-time { text-align: right; }
.chat-input-bar {
  padding: 1rem 1.25rem; border-top: 1px solid var(--border);
  display: flex; gap: .75rem; align-items: center;
  background: #fff;
}
.chat-input-bar input {
  flex: 1; padding: .6rem 1rem; border: 1.5px solid var(--border);
  border-radius: 20px; outline: none; font-size: .875rem; transition: var(--transition);
}
.chat-input-bar input:focus { border-color: var(--green-mid); }

/* ── Admin Dashboard ──────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; }
.admin-sidebar {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border);
  padding: 1.25rem 0; height: fit-content; position: sticky; top: 80px;
}
.admin-nav-item {
  display: flex; align-items: center; gap: .75rem; padding: .75rem 1.5rem;
  font-size: .875rem; color: var(--text-secondary); transition: var(--transition);
  border-left: 3px solid transparent; text-decoration: none;
}
.admin-nav-item:hover, .admin-nav-item.active {
  background: var(--green-light); color: var(--green-deep);
  border-left-color: var(--green-mid);
}
.admin-nav-item i { width: 18px; text-align: center; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border);
  padding: 1.25rem; display: flex; align-items: center; gap: 1rem;
}
.stat-card-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.stat-card-value { font-size: 1.5rem; font-weight: 800; font-family: var(--font-mono); line-height: 1; }
.stat-card-label { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }

/* ── Chatbot ─────────────────────────────────────────────────── */
.chatbot-widget { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 300; }
.chatbot-toggle {
  width: 58px; height: 58px; border-radius: 50%; background: var(--green-deep);
  border: none; color: #fff; font-size: 1.4rem; cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,107,53,.4); transition: var(--transition);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.chatbot-toggle:hover { background: var(--green-mid); transform: scale(1.05); }
.chatbot-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--gold); color: var(--text-primary);
  width: 20px; height: 20px; border-radius: 50%;
  font-size: .65rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.chatbot-badge.hidden { display: none; }

.chatbot-panel {
  position: absolute; bottom: 70px; right: 0;
  width: 360px; background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  display: none; flex-direction: column; overflow: hidden;
  max-height: 520px;
}
.chatbot-panel.open { display: flex; }
.chatbot-header {
  background: var(--green-deep); color: #fff; padding: .9rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between;
}
.chatbot-info { display: flex; align-items: center; gap: .75rem; }
.chatbot-avatar { font-size: 1.5rem; }
.chatbot-info strong { display: block; font-size: .9rem; }
.chatbot-status { font-size: .7rem; opacity: .8; }
.chatbot-close { background: rgba(255,255,255,.2); border: none; color: #fff; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 1rem; transition: var(--transition); }
.chatbot-close:hover { background: rgba(255,255,255,.3); }
.chatbot-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.chat-msg { max-width: 85%; }
.bot-msg { align-self: flex-start; }
.user-msg { align-self: flex-end; }
.bot-msg .msg-bubble { background: var(--off-white); border: 1px solid var(--border); color: var(--text-primary); }
.user-msg .msg-bubble { background: var(--green-mid); color: #fff; border-color: var(--green-mid); }
.chatbot-input {
  padding: .75rem; border-top: 1px solid var(--border);
  display: flex; gap: .5rem;
}
.chatbot-input input {
  flex: 1; padding: .55rem .85rem; border: 1.5px solid var(--border);
  border-radius: 20px; font-size: .85rem; outline: none; transition: var(--transition);
}
.chatbot-input input:focus { border-color: var(--green-mid); }
.chatbot-input button {
  width: 36px; height: 36px; border-radius: 50%; background: var(--green-mid);
  border: none; color: #fff; cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.chatbot-input button:hover { background: var(--green-deep); }
.typing-indicator { display: flex; gap: 4px; align-items: center; padding: .6rem .9rem; }
.typing-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: typingDot 1.2s infinite; }
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typingDot { 0%,80%,100% { transform: scale(.7); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  background: var(--text-primary); color: rgba(255,255,255,.75);
  margin-top: 3rem; padding: 3rem 1.5rem 0;
}
.footer-grid {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem;
  padding-bottom: 2.5rem; border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-logo { font-size: 1.4rem; font-weight: 800; color: #fff; margin-bottom: .75rem; }
.footer-brand p { font-size: .85rem; line-height: 1.7; }
.footer-social { display: flex; gap: .75rem; margin-top: 1rem; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 8px; background: rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.7);
  transition: var(--transition);
}
.footer-social a:hover { background: var(--green-mid); color: #fff; }
.footer-links h4 { font-size: .85rem; font-weight: 700; color: #fff; margin-bottom: .85rem; }
.footer-links a { display: block; font-size: .825rem; margin-bottom: .5rem; color: rgba(255,255,255,.65); transition: color .15s; }
.footer-links a:hover { color: var(--green-bright); }
.footer-bottom {
  max-width: 1280px; margin: 0 auto;
  padding: 1.25rem 0; text-align: center; font-size: .8rem;
}

/* ── Utilities ──────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger) !important; }
.text-green  { color: var(--green-mid); }
.text-gold   { color: var(--gold); }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.hidden { display: none !important; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: .5rem; }
.w-100 { width: 100%; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .content-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .category-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav-search { display: none; }
  .nav-username { display: none; }
  .hero-title { font-size: 1.35rem; }
  .stats-row { gap: 1rem; }
  .admin-layout { grid-template-columns: 1fr; }
  .messages-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .chatbot-panel { width: calc(100vw - 2rem); right: -1rem; }
  .thread-item { flex-direction: column; gap: .5rem; }
  .thread-actions { align-items: flex-start; }
}
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: .5rem; flex-direction: column; gap: 5px; }
.mobile-menu-btn span { display: block; width: 22px; height: 2px; background: rgba(255,255,255,.8); border-radius: 2px; }
@media (max-width: 600px) { .mobile-menu-btn { display: flex; } }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn .35s ease forwards; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
