@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

:root {
  --bg: #f0f2f7;
  --surface: #ffffff;
  --surface2: #f7f8fc;
  --border: #e4e6ef;
  --text: #1a1d2e;
  --text2: #6b7280;
  --text3: #9ca3af;
  --accent: #5c6ef8;
  --accent-hover: #4a5ce6;
  --accent-light: #eef0fe;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --success: #22c55e;
  --success-light: #f0fdf4;
  --warning: #f59e0b;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --shadow-md: 0 4px 24px rgba(0,0,0,.08);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-width: 260px;
  --transition: .18s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #1a1d2e;
  --surface2: #232740;
  --border: #2d3152;
  --text: #e8eaf6;
  --text2: #9da5c8;
  --text3: #5b6288;
  --accent: #6c7dff;
  --accent-hover: #7c8dff;
  --accent-light: #1e2244;
  --danger: #f87171;
  --danger-light: #2d1b1b;
  --success: #4ade80;
  --success-light: #1a2d1e;
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.2);
  --shadow-md: 0 4px 24px rgba(0,0,0,.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
  transition: background var(--transition), color var(--transition);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── Layout ── */
.app-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--nav-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition), background var(--transition);
  overflow-y: auto;
}

.sidebar-logo {
  padding: 22px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  color: white;
  font-size: 13px;
  flex-shrink: 0;
}

.logo-text {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  padding: 16px 12px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition);
  position: relative;
}

.nav-link:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.sidebar-user {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-login { font-size: 12px; color: var(--text3); }

/* ── Main content ── */
.main-content { margin-left: var(--nav-width); flex: 1; min-width: 0; }

.content-wrapper { max-width: 640px; margin: 0 auto; padding: 24px 16px; }
.content-wrapper.wide { max-width: 1000px; }

/* ── Topbar ── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  transition: background var(--transition);
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(92,110,248,.35); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-icon { padding: 8px; border-radius: 10px; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: background var(--transition), border-color var(--transition);
}

.card-body { padding: 20px; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Post Card ── */
.post-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  transition: all var(--transition);
}

.post-card:hover { box-shadow: var(--shadow-md); border-color: transparent; }

.post-header {
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  transition: opacity var(--transition);
}
.post-avatar:hover { opacity: .85; }

.post-author { flex: 1; min-width: 0; }
.post-author-name { font-weight: 700; font-size: 14px; display: block; color: var(--text); }
.post-author-name:hover { color: var(--accent); text-decoration: none; }
.post-meta { font-size: 12px; color: var(--text3); }

.post-content {
  padding: 0 20px 16px;
  font-size: 15px;
  line-height: 1.7;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Post images grid */
.post-images { overflow: hidden; }
.post-images-grid { display: grid; gap: 2px; }
.post-images-grid.count-1 { grid-template-columns: 1fr; }
.post-images-grid.count-2 { grid-template-columns: 1fr 1fr; }
.post-images-grid.count-3 { grid-template-columns: 1fr 1fr; }
.post-images-grid.count-3 .img-item:first-child { grid-column: 1 / -1; }
.post-images-grid.count-4 { grid-template-columns: 1fr 1fr; }
.post-images-grid.count-5 { grid-template-columns: 1fr 1fr 1fr; }
.post-images-grid.count-5 .img-item:nth-child(-n+2) { /* first 2 are full row */ }

.img-item {
  overflow: hidden;
  cursor: zoom-in;
  background: var(--surface2);
  max-height: 380px;
}

.img-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.post-images-grid.count-1 .img-item img { height: auto; max-height: 500px; object-fit: contain; }
.img-item:hover img { transform: scale(1.03); }

.post-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.action-btn:hover { background: var(--surface2); color: var(--text); }
.action-btn.liked { color: var(--danger); }
.action-btn.liked svg { fill: currentColor; }
.action-btn svg { width: 18px; height: 18px; }

/* ── Comments ── */
.comments-section { border-top: 1px solid var(--border); background: var(--surface2); }
.comments-list { padding: 12px 16px 4px; }

.comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  animation: fadeIn .2s ease;
}

.comment-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; margin-top: 2px; }

.comment-body {
  flex: 1;
  background: var(--surface);
  border-radius: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  min-width: 0;
}

.comment-header { display: flex; align-items: center; justify-content: space-between; }
.comment-author { font-weight: 600; font-size: 13px; }
.comment-author:hover { color: var(--accent); }
.comment-del-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 12px; padding: 0 4px;
  line-height: 1; border-radius: 4px; transition: all var(--transition);
  margin-left: auto; flex-shrink: 0;
}
.comment-del-btn:hover { color: var(--danger); background: var(--danger-light); }
.comment-text { font-size: 14px; margin-top: 2px; word-break: break-word; line-height: 1.5; }
.comment-time { font-size: 11px; color: var(--text3); margin-top: 3px; }

.comment-form {
  padding: 10px 16px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  border-top: 1px solid var(--border);
}

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }

.form-control {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
  appearance: none;
}

.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(92,110,248,.12); }
.form-control::placeholder { color: var(--text3); }
textarea.form-control { resize: vertical; min-height: 80px; line-height: 1.6; }
.form-hint { font-size: 12px; color: var(--text3); margin-top: 5px; }

/* ── Auth Pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 40px 36px;
  box-shadow: var(--shadow-md);
}

.auth-logo { text-align: center; margin-bottom: 28px; }

.auth-logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Mono', monospace;
  font-weight: 700; color: white; font-size: 20px;
  margin: 0 auto 12px;
}

.auth-title { font-size: 24px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 4px; }
.auth-subtitle { font-size: 14px; color: var(--text2); }

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(239,68,68,.2); }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(34,197,94,.2); }
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }

/* ── Profile ── */
.profile-cover {
  height: 200px;
  background: linear-gradient(135deg, #5c6ef8 0%, #a78bfa 50%, #ec4899 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
  overflow: hidden;
}

.profile-cover::after {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='40' cy='40' r='30' fill='none' stroke='white' stroke-opacity='.07' stroke-width='2'/%3E%3C/svg%3E") repeat;
}

.profile-info { padding: 0 24px 24px; position: relative; }

.profile-avatar-wrap {
  display: inline-block;
  margin-top: -52px;
  margin-bottom: 12px;
}

.profile-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface);
  display: block;
  box-shadow: var(--shadow);
}

.profile-name { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.profile-username { font-size: 14px; color: var(--text3); margin-bottom: 10px; margin-top: 2px; }
.profile-bio { font-size: 14px; color: var(--text2); margin-bottom: 16px; line-height: 1.6; }

.profile-stats { display: flex; gap: 28px; margin-bottom: 16px; flex-wrap: wrap; }
.profile-stat { display: flex; flex-direction: column; align-items: center; }
.profile-stat-value { font-size: 20px; font-weight: 800; }
.profile-stat-label { font-size: 12px; color: var(--text3); }

/* ── Compose Post ── */
.compose-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.compose-row { display: flex; gap: 12px; align-items: flex-start; }

.compose-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; margin-top: 2px; }

.compose-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px; font-family: inherit;
  color: var(--text); background: var(--surface2);
  resize: none; min-height: 52px; max-height: 300px;
  transition: all var(--transition); outline: none; line-height: 1.6;
}

.compose-input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(92,110,248,.1);
  min-height: 100px;
}

.compose-input::placeholder { color: var(--text3); }

.compose-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-left: 56px;
}
.compose-tools { display: flex; gap: 4px; }

.images-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-left: 56px; }
.img-preview-item { position: relative; width: 80px; height: 80px; border-radius: 8px; overflow: hidden; border: 1.5px solid var(--border); }
.img-preview-item img { width: 100%; height: 100%; object-fit: cover; }

/* ── Search ── */
.search-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); color: var(--text3);
  width: 18px; height: 18px; pointer-events: none;
}

/* ── User card ── */
.user-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; transition: background var(--transition);
}
.user-card:hover { background: var(--surface2); }
.user-card-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-card-info { flex: 1; min-width: 0; }
.user-card-name { font-weight: 600; font-size: 14px; display: block; color: var(--text); }
.user-card-name:hover { color: var(--accent); }
.user-card-meta { font-size: 12px; color: var(--text3); margin-top: 1px; }

/* ── Admin pinned user card ── */
.user-card-admin {
  background: linear-gradient(135deg, rgba(99,102,241,.08) 0%, rgba(168,85,247,.07) 50%, rgba(236,72,153,.06) 100%);
  border-left: 3px solid transparent;
  border-image: linear-gradient(180deg, #6366f1, #a855f7, #ec4899) 1;
  position: relative;
}
.user-card-admin:hover {
  background: linear-gradient(135deg, rgba(99,102,241,.14) 0%, rgba(168,85,247,.12) 50%, rgba(236,72,153,.10) 100%);
}
.user-card-avatar-admin {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #a855f7;
}
[data-theme="dark"] .user-card-avatar-admin {
  box-shadow: 0 0 0 2px #1e1e2e, 0 0 0 4px #a855f7;
}
.user-card-name-admin {
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}
.admin-pin-badge {
  position: absolute;
  top: 6px; right: 10px;
  font-size: 10px; font-weight: 700;
  color: #a855f7;
  display: flex; align-items: center; gap: 3px;
  letter-spacing: .3px;
  text-transform: uppercase;
}

/* ── Notifications ── */
.notif-item {
  display: flex; align-items: flex-start;
  gap: 12px; padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition); cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: var(--accent-light); }

.notif-icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.notif-icon.like { background: #fee2e2; color: var(--danger); }
.notif-icon.comment { background: #dbeafe; color: #3b82f6; }
.notif-icon.friend_request { background: var(--accent-light); color: var(--accent); }
.notif-icon.friend_accept { background: var(--success-light); color: var(--success); }
.notif-icon svg { width: 16px; height: 16px; }
.notif-text { font-size: 13px; line-height: 1.5; }
.notif-time { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ── Admin ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat-card-value { font-size: 36px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.stat-card-label { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* ── Theme toggle ── */
.theme-toggle {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface2); border: 1.5px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text2); transition: all var(--transition);
}
.theme-toggle:hover { background: var(--border); color: var(--text); }

/* ── Lightbox ── */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.92);
  z-index: 1000; display: none; align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 8px; cursor: default; }
.lightbox-close {
  position: absolute; top: 20px; right: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.15); backdrop-filter: blur(4px);
  border: none; cursor: pointer; color: white;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,.25); }

/* ── Dropdown ── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); min-width: 170px;
  box-shadow: var(--shadow-md); z-index: 200; display: none; overflow: hidden;
}
.dropdown-menu.open { display: block; animation: fadeIn .15s ease; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 13px; font-weight: 500;
  color: var(--text); cursor: pointer; border: none;
  background: none; width: 100%; text-align: left;
  transition: background var(--transition); font-family: inherit;
}
.dropdown-item:hover { background: var(--surface2); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-light); }
.dropdown-item svg { width: 15px; height: 15px; }

/* ── Pagination ── */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.page-btn {
  min-width: 38px; height: 38px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text2); font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); padding: 0 12px;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text3); }
.empty-state svg { width: 52px; height: 52px; margin-bottom: 16px; opacity: .4; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text2); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── Badge ── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-admin { background: var(--accent-light); color: var(--accent); }
.badge-banned { background: var(--danger-light); color: var(--danger); }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Mobile ── */
.mobile-menu-btn {
  display: none; width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface2); border: 1.5px solid var(--border);
  cursor: pointer; align-items: center; justify-content: center; color: var(--text);
}
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-md); }
  .mobile-menu-btn { display: flex; }
  .mobile-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .content-wrapper { padding: 14px 10px; }
  .auth-card { padding: 28px 20px; }
  .profile-stats { gap: 16px; }
  .compose-footer { padding-left: 0; flex-wrap: wrap; gap: 8px; }
  .images-preview { padding-left: 0; }
  .topbar { padding: 0 14px; }
  .post-header { padding: 12px 14px 10px; }
  .post-content { padding: 0 14px 12px; }
  .post-footer { padding: 8px 10px; }
  .profile-cover { height: 140px; }
  .profile-info { padding: 0 16px 20px; }
}

/* ── Tabs ── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 12px 20px; font-size: 14px; font-weight: 600;
  color: var(--text2); background: none; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: all var(--transition); margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  z-index: 500; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  width: 100%; max-width: 480px; box-shadow: var(--shadow-md); overflow: hidden;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: 16px;
}
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

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

/* ── Toast / notification dot ── */
#notif-count { pointer-events: none; }

/* ── Spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Topbar left alignment fix ── */
.topbar-left { display: flex; align-items: center; gap: 12px; }

/* ── Search form relative wrapper ── */
.search-wrapper { position: relative; }
