/* ============================================================
   Forum — Design System CSS (DESIGN.md)
   Font: /assets/font/a.ttf
   Icons: Remix Icon (CDN)
   ============================================================ */

@font-face {
  font-family: 'ForumFont';
  src: url('../font/a.ttf') format('truetype');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  /* Brand */
  --terracotta:     #c96442;
  --coral:          #d97757;
  --error:          #b53333;
  --focus-blue:     #3898ec;

  /* Surfaces */
  --parchment:      #f5f4ed;
  --ivory:          #faf9f5;
  --white:          #ffffff;
  --warm-sand:      #e8e6dc;
  --dark-surface:   #30302e;
  --deep-dark:      #141413;

  /* Text */
  --near-black:     #141413;
  --charcoal-warm:  #4d4c48;
  --olive-gray:     #5e5d59;
  --stone-gray:     #87867f;
  --dark-warm:      #3d3d3a;
  --warm-silver:    #b0aea5;

  /* Borders */
  --border-cream:   #f0eee6;
  --border-warm:    #e8e6dc;
  --border-dark:    #30302e;
  --ring-warm:      #d1cfc5;
  --ring-deep:      #c2c0b6;

  /* Admin / Badge */
  --admin-bg:       #d4a017;
  --admin-fg:       #141413;

  /* Typography */
  --font-main: 'ForumFont', Georgia, serif;

  /* Radius */
  --r-sm:   6px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-2xl:  24px;
  --r-3xl:  32px;

  /* Shadows */
  --shadow-ring:    0 0 0 1px var(--ring-warm);
  --shadow-whisper: rgba(0,0,0,.05) 0 4px 24px;
  --shadow-card:    rgba(0,0,0,.06) 0 2px 16px;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--parchment);
  color: var(--near-black);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}
ul, ol { list-style: none; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--parchment); }
::-webkit-scrollbar-thumb { background: var(--ring-warm); border-radius: 3px; }

/* ── Toast / Flash ───────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 72px; right: 20px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--ivory);
  border: 1px solid var(--border-cream);
  border-left: 4px solid var(--terracotta);
  border-radius: var(--r-lg);
  padding: 12px 16px;
  box-shadow: var(--shadow-card);
  min-width: 260px; max-width: 380px;
  font-size: 15px;
  animation: slideIn .25s ease;
}
.toast.success { border-left-color: #4caf50; }
.toast.error   { border-left-color: var(--error); }
.toast.info    { border-left-color: var(--focus-blue); }
.toast i { font-size: 18px; flex-shrink: 0; }
.toast.success i { color: #4caf50; }
.toast.error   i { color: var(--error); }
.toast.info    i { color: var(--focus-blue); }
.toast-close {
  margin-left: auto; cursor: pointer; font-size: 16px;
  color: var(--stone-gray); background: none; border: none;
  padding: 0 2px; line-height: 1;
}
@keyframes slideIn {
  from { transform: translateX(30px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Nav ─────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--parchment);
  border-bottom: 1px solid var(--border-cream);
  backdrop-filter: blur(8px);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex; align-items: center; gap: 16px;
}
.nav-logo {
  font-size: 20px; font-weight: 600;
  color: var(--near-black);
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.nav-logo i { color: var(--terracotta); font-size: 22px; }
.nav-spacer { flex: 1; }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* avatar button */
.nav-user {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-cream);
  background: var(--ivory);
  cursor: pointer;
  transition: box-shadow .2s, background .2s;
}
.nav-user:hover { box-shadow: var(--shadow-ring); background: var(--white); }
.nav-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-warm);
}
.nav-username { font-size: 14px; color: var(--charcoal-warm); font-weight: 500; }
.nav-dropdown {
  position: absolute; top: 54px; right: 20px;
  background: var(--ivory);
  border: 1px solid var(--border-cream);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  min-width: 180px;
  overflow: hidden;
  display: none;
}
.nav-dropdown.open { display: block; animation: fadeDown .2s ease; }
@keyframes fadeDown {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  font-size: 14px; color: var(--charcoal-warm);
  cursor: pointer;
  transition: background .15s;
}
.dropdown-item:hover { background: var(--warm-sand); }
.dropdown-item i { font-size: 16px; color: var(--olive-gray); }
.dropdown-divider { height: 1px; background: var(--border-cream); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; cursor: pointer;
  font-size: 15px; font-family: var(--font-main);
  font-weight: 500; line-height: 1;
  padding: 9px 16px;
  border-radius: var(--r-md);
  transition: box-shadow .18s, background .18s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--terracotta); color: var(--ivory);
  box-shadow: 0 0 0 0 var(--terracotta), 0 0 0 1px var(--terracotta);
}
.btn-primary:hover { background: #b85a3a; }
.btn-secondary {
  background: var(--warm-sand); color: var(--charcoal-warm);
  box-shadow: 0 0 0 1px var(--ring-warm);
}
.btn-secondary:hover { box-shadow: 0 0 0 1px var(--ring-deep); background: var(--border-warm); }
.btn-dark {
  background: var(--dark-surface); color: var(--ivory);
}
.btn-dark:hover { background: var(--near-black); }
.btn-danger {
  background: var(--error); color: var(--white);
}
.btn-ghost {
  background: transparent; color: var(--olive-gray);
  box-shadow: 0 0 0 1px var(--border-cream);
}
.btn-ghost:hover { background: var(--warm-sand); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg { padding: 12px 24px; font-size: 16px; border-radius: var(--r-lg); }
.btn-icon { padding: 8px; }

/* ── Inputs ──────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-label { font-size: 14px; color: var(--charcoal-warm); font-weight: 500; }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--border-warm);
  border-radius: var(--r-lg);
  color: var(--near-black);
  font-size: 15px;
  font-family: var(--font-main);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--focus-blue);
  box-shadow: 0 0 0 3px rgba(56,152,236,.15);
}
.form-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-hint { font-size: 12px; color: var(--stone-gray); }
.form-error { font-size: 12px; color: var(--error); }

/* ── Container ───────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.container-xs { max-width: 480px; margin: 0 auto; padding: 0 20px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--ivory);
  border: 1px solid var(--border-cream);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-whisper);
  overflow: hidden;
}
.card-body { padding: 24px; }
.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-cream);
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 600;
}
.card-header i { color: var(--terracotta); }

/* ── Auth Pages ──────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--parchment);
  padding: 40px 20px;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--ivory);
  border: 1px solid var(--border-cream);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-whisper);
  padding: 40px 36px;
}
.auth-logo {
  text-align: center; margin-bottom: 28px;
}
.auth-logo i { font-size: 36px; color: var(--terracotta); }
.auth-title {
  font-size: 24px; font-weight: 600; text-align: center;
  color: var(--near-black); margin-bottom: 6px;
}
.auth-subtitle {
  font-size: 14px; color: var(--stone-gray); text-align: center;
  margin-bottom: 28px;
}
.auth-link {
  text-align: center; margin-top: 20px;
  font-size: 14px; color: var(--olive-gray);
}
.auth-link a { color: var(--terracotta); font-weight: 500; }
.auth-link a:hover { text-decoration: underline; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--stone-gray); font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border-warm);
}

/* ── Category Tabs ───────────────────────────────────────── */
.category-bar {
  background: var(--ivory);
  border-bottom: 1px solid var(--border-cream);
  position: sticky; top: 60px; z-index: 90;
}
.category-tabs {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; gap: 2px; overflow-x: auto;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 13px 16px;
  font-size: 14px; font-weight: 500;
  color: var(--olive-gray);
  white-space: nowrap; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  text-decoration: none;
}
.cat-tab:hover  { color: var(--near-black); }
.cat-tab.active { color: var(--terracotta); border-bottom-color: var(--terracotta); }
.cat-tab i { font-size: 16px; }

/* ── Post List ───────────────────────────────────────────── */
.main-layout {
  max-width: 1200px; margin: 0 auto;
  padding: 24px 20px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
.post-list { display: flex; flex-direction: column; gap: 2px; }
.post-item {
  background: var(--ivory);
  border: 1px solid var(--border-cream);
  border-radius: var(--r-xl);
  padding: 18px 20px;
  display: flex; gap: 14px;
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
  text-decoration: none;
  color: inherit;
  margin-bottom: 6px;
}
.post-item:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}
.post-item.pinned {
  border-left: 3px solid var(--terracotta);
}
.post-avatar {
  width: 44px; height: 44px;
  border-radius: 50%; object-fit: cover;
  flex-shrink: 0; border: 1px solid var(--border-warm);
}
.post-body { flex: 1; min-width: 0; }
.post-meta {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 6px;
}
.post-author { font-size: 13px; font-weight: 500; color: var(--charcoal-warm); }
.badge-admin {
  font-size: 10px; font-weight: 600;
  background: var(--admin-bg); color: var(--admin-fg);
  padding: 1px 6px; border-radius: 4px;
  letter-spacing: .4px;
}
.badge-user {
  font-size: 10px;
  background: var(--warm-sand); color: var(--stone-gray);
  padding: 1px 6px; border-radius: 4px;
}
.cat-badge {
  font-size: 11px; padding: 2px 8px;
  border-radius: var(--r-2xl);
  background: var(--warm-sand); color: var(--olive-gray);
  display: flex; align-items: center; gap: 4px;
}
.post-time { font-size: 12px; color: var(--stone-gray); margin-left: auto; }
.post-title {
  font-size: 15px; font-weight: 600;
  color: var(--near-black); margin-bottom: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-excerpt { font-size: 13px; color: var(--olive-gray); line-height: 1.55; }
.post-stats {
  display: flex; gap: 14px; margin-top: 8px;
  font-size: 12px; color: var(--stone-gray);
}
.post-stats span { display: flex; align-items: center; gap: 4px; }
.pin-badge {
  font-size: 11px; background: var(--terracotta);
  color: var(--ivory); padding: 1px 7px; border-radius: 4px;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.sidebar-card {
  background: var(--ivory);
  border: 1px solid var(--border-cream);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.sidebar-card-header {
  padding: 14px 18px;
  font-size: 14px; font-weight: 600;
  border-bottom: 1px solid var(--border-cream);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-card-header i { color: var(--terracotta); }
.sidebar-card-body { padding: 14px 18px; }
.sidebar-stat { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; color: var(--olive-gray); }
.sidebar-stat b { color: var(--near-black); }
.sidebar-cats li {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; font-size: 14px; color: var(--charcoal-warm);
  border-bottom: 1px solid var(--border-cream);
}
.sidebar-cats li:last-child { border: none; }
.sidebar-cats a { display: flex; align-items: center; gap: 8px; flex:1; color: var(--charcoal-warm); }
.sidebar-cats a:hover { color: var(--terracotta); }
.sidebar-cats i { color: var(--terracotta); font-size: 15px; }

/* ── FAB ─────────────────────────────────────────────────── */
.fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 200;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--terracotta);
  color: var(--ivory);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: 0 4px 20px rgba(201,100,66,.4);
  transition: transform .2s, box-shadow .2s;
}
.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(201,100,66,.5);
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(20,20,19,.45);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--ivory);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: rgba(0,0,0,.2) 0 -4px 40px;
  transform: translateY(20px);
  transition: transform .25s;
}
@media (min-width: 640px) {
  .modal { border-radius: var(--r-2xl); transform: scale(.97); }
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header {
  padding: 20px 24px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-cream);
}
.modal-title { font-size: 18px; font-weight: 600; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--warm-sand); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--olive-gray);
  transition: background .15s;
}
.modal-close:hover { background: var(--border-warm); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-cream);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── Post Detail ─────────────────────────────────────────── */
.post-detail-page { max-width: 860px; margin: 0 auto; padding: 24px 20px; }
.post-detail-header { margin-bottom: 20px; }
.post-detail-title {
  font-size: 24px; font-weight: 600;
  color: var(--near-black); line-height: 1.3; margin-bottom: 14px;
}
.post-author-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--border-cream);
  border-bottom: 1px solid var(--border-cream); margin-bottom: 24px;
}
.post-author-row img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.post-content {
  font-size: 16px; line-height: 1.8; color: var(--near-black);
  white-space: pre-wrap; word-break: break-word;
}
.post-images {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px; margin-top: 20px;
}
.post-images img {
  border-radius: var(--r-md); cursor: pointer;
  aspect-ratio: 1; object-fit: cover;
  transition: opacity .2s;
  border: 1px solid var(--border-cream);
}
.post-images img:hover { opacity: .88; }

/* Comments */
.comments-section { margin-top: 36px; }
.comments-title {
  font-size: 18px; font-weight: 600; margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.comments-title i { color: var(--terracotta); }
.comment-item {
  display: flex; gap: 12px; padding: 16px 0;
  border-bottom: 1px solid var(--border-cream);
}
.comment-item:last-child { border: none; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-content { flex: 1; }
.comment-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.comment-author { font-size: 14px; font-weight: 500; }
.comment-time { font-size: 12px; color: var(--stone-gray); }
.comment-text { font-size: 14px; color: var(--charcoal-warm); line-height: 1.6; }
.comment-form { margin-top: 24px; }

/* ── Profile / Settings ──────────────────────────────────── */
.settings-page { max-width: 640px; margin: 32px auto; padding: 0 20px; }
.settings-title {
  font-size: 22px; font-weight: 600; margin-bottom: 24px;
  display: flex; align-items: center; gap: 10px;
}
.settings-title i { color: var(--terracotta); }
.avatar-upload-area {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 24px; margin-bottom: 24px;
  background: var(--parchment); border-radius: var(--r-xl);
  border: 2px dashed var(--border-warm);
}
.avatar-preview {
  width: 90px; height: 90px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--border-warm);
  cursor: pointer;
}
.avatar-upload-hint { font-size: 13px; color: var(--stone-gray); }

/* ── Admin Layout ────────────────────────────────────────── */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--near-black);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.admin-sidebar-logo {
  padding: 22px 20px 16px;
  display: flex; align-items: center; gap: 10px;
  color: var(--ivory); font-size: 17px; font-weight: 600;
  border-bottom: 1px solid var(--dark-surface);
}
.admin-sidebar-logo i { color: var(--terracotta); font-size: 22px; }
.admin-nav { padding: 12px 0; flex: 1; }
.admin-nav-section {
  padding: 10px 16px 4px;
  font-size: 10px; font-weight: 600;
  color: var(--stone-gray); letter-spacing: .8px; text-transform: uppercase;
}
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; font-size: 14px;
  color: var(--warm-silver); cursor: pointer;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.admin-nav-item:hover  { background: var(--dark-surface); color: var(--ivory); }
.admin-nav-item.active { background: rgba(201,100,66,.2); color: var(--terracotta); }
.admin-nav-item i { font-size: 17px; }
.admin-main { flex: 1; background: var(--parchment); overflow-y: auto; }
.admin-topbar {
  background: var(--ivory); border-bottom: 1px solid var(--border-cream);
  padding: 0 28px; height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.admin-page-title { font-size: 18px; font-weight: 600; }
.admin-content { padding: 28px; }

/* ── Admin Table ─────────────────────────────────────────── */
.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--ivory);
  border: 1px solid var(--border-cream);
  border-radius: var(--r-xl); overflow: hidden;
  box-shadow: var(--shadow-whisper);
}
.data-table thead { background: var(--warm-sand); }
.data-table th {
  padding: 12px 16px; text-align: left;
  font-size: 13px; font-weight: 600; color: var(--charcoal-warm);
  border-bottom: 1px solid var(--border-cream);
}
.data-table td {
  padding: 12px 16px; font-size: 14px; color: var(--charcoal-warm);
  border-bottom: 1px solid var(--border-cream);
  vertical-align: middle;
}
.data-table tr:last-child td { border: none; }
.data-table tr:hover td { background: rgba(245,244,237,.6); }
.status-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  font-weight: 500; display: inline-block;
}
.status-active  { background: #d4edda; color: #155724; }
.status-pending { background: #fff3cd; color: #856404; }
.status-banned  { background: #f8d7da; color: #721c24; }

/* ── Admin Stats Cards ───────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.stat-card {
  background: var(--ivory);
  border: 1px solid var(--border-cream);
  border-radius: var(--r-xl);
  padding: 20px 22px;
  box-shadow: var(--shadow-whisper);
}
.stat-card-icon {
  width: 42px; height: 42px; border-radius: var(--r-md);
  background: rgba(201,100,66,.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--terracotta); margin-bottom: 12px;
}
.stat-card-num { font-size: 28px; font-weight: 700; color: var(--near-black); line-height: 1; }
.stat-card-label { font-size: 13px; color: var(--stone-gray); margin-top: 4px; }

/* ── Upload image preview ────────────────────────────────── */
.img-preview-grid {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.img-preview-item {
  position: relative; width: 80px; height: 80px;
}
.img-preview-item img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: var(--r-md); border: 1px solid var(--border-warm);
}
.img-preview-remove {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--error); color: white;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-top: 28px; flex-wrap: wrap;
}
.page-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  font-size: 14px; color: var(--charcoal-warm);
  background: var(--ivory); border: 1px solid var(--border-cream);
  cursor: pointer; transition: background .15s;
  text-decoration: none;
}
.page-btn:hover  { background: var(--warm-sand); }
.page-btn.active { background: var(--terracotta); color: var(--ivory); border-color: var(--terracotta); }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--stone-gray);
}
.empty-state i { font-size: 48px; opacity: .4; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ── Lightbox ────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,.85);
  display: none; align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 90vw; max-height: 90vh;
  border-radius: var(--r-lg); box-shadow: 0 8px 48px rgba(0,0,0,.4);
}
.lightbox-close {
  position: absolute; top: 20px; right: 20px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: none; cursor: pointer;
  color: white; font-size: 20px; display: flex; align-items: center; justify-content: center;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .admin-sidebar { width: 200px; }
}
@media (max-width: 640px) {
  .admin-wrap { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: relative; }
  .admin-nav { display: flex; overflow-x: auto; padding: 8px 0; }
  .admin-nav-section { display: none; }
  .admin-nav-item { padding: 8px 16px; flex-shrink: 0; }
  .nav-username { display: none; }
  .post-item { gap: 10px; }
  .auth-card { padding: 28px 20px; }
}

/* ── Utility ─────────────────────────────────────────────── */
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-16  { margin-bottom: 16px; }
.text-muted { color: var(--stone-gray); }
.text-sm { font-size: 13px; }
.fw-600 { font-weight: 600; }
.w-100  { width: 100%; }
.text-danger { color: var(--error); }
.text-terracotta { color: var(--terracotta); }
