/* ═══════════════════════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* Palette */
  --primary:        #6366f1;
  --primary-hover:  #4f46e5;
  --primary-light:  #eef2ff;
  --primary-subtle: #e0e7ff;

  --bg:             #f8fafc;
  --card:           #ffffff;
  --text:           #1e293b;
  --text-secondary: #64748b;
  --text-muted:     #94a3b8;
  --border:         #e2e8f0;
  --border-hover:   #cbd5e1;
  --input-bg:       #f1f5f9;

  --danger:         #ef4444;
  --danger-hover:   #dc2626;

  /* Status colours */
  --status-open:        #64748b;
  --status-open-bg:     #f1f5f9;
  --status-planned:     #3b82f6;
  --status-planned-bg:  #eff6ff;
  --status-in_progress: #f59e0b;
  --status-in_progress-bg: #fffbeb;
  --status-complete:    #10b981;
  --status-complete-bg: #ecfdf5;

  /* Vote */
  --voted:      #6366f1;
  --voted-bg:   #eef2ff;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg:  0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);

  /* Radii */
  --radius:     12px;
  --radius-sm:  8px;
  --radius-xs:  6px;

  /* Transitions */
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a   { color: var(--primary); text-decoration: none; }

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}
.container-narrow { max-width: 720px; }

.view { display: none; padding: 32px 0 80px; }
.view.active { display: block; animation: fadeIn 0.25s var(--ease); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   LOADING SCREEN
   ═══════════════════════════════════════════════════════════════ */
.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */
#app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.logo-icon {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.user-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#user-menu {
  position: relative;
}

.user-menu-wrapper {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 8px 4px 12px;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.user-menu-btn:hover,
.user-menu-btn:focus-visible {
  background: var(--primary-light);
  border-color: var(--primary-subtle);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 180px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 1000;
  animation: dropdownFadeIn 0.15s var(--ease);
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.dropdown-item:hover {
  background: var(--input-bg);
  color: var(--primary);
}

.dropdown-item-danger:hover {
  background: #fef2f2;
  color: var(--danger);
}

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

/* Avatar Option Cards in User Settings Modal */
.avatar-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.avatar-radio-label {
  cursor: pointer;
  position: relative;
}
.avatar-radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.avatar-radio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  text-align: center;
  transition: all 0.15s var(--ease);
}

.avatar-radio-card span {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.avatar-preview {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.avatar-radio-label input[type="radio"]:checked + .avatar-radio-card {
  border-color: var(--primary);
  background: var(--primary-light);
}

.avatar-radio-label input[type="radio"]:checked + .avatar-radio-card span {
  color: var(--primary);
}

.avatar-radio-label input[type="radio"]:disabled + .avatar-radio-card {
  opacity: 0.4;
  cursor: not-allowed;
}


/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s var(--ease), transform 0.1s var(--ease), box-shadow 0.15s var(--ease);
  white-space: nowrap;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 8px rgba(99,102,241,0.35);
}
.btn-primary:active { transform: scale(0.97); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.btn-ghost:hover {
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--border-hover);
}

.btn-sm { padding: 5px 12px; font-size: 0.8125rem; }
.btn-full { width: 100%; justify-content: center; }

.btn-danger-sm {
  padding: 4px 10px;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.btn-danger-sm:hover {
  background: var(--danger);
  color: #fff;
}

.btn-edit-sm {
  padding: 4px 10px;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.btn-edit-sm:hover {
  background: var(--primary);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   BACK LINK
   ═══════════════════════════════════════════════════════════════ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 20px;
  transition: color 0.15s var(--ease);
}
.back-link:hover { color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════
   HOME — BOARD GRID
   ═══════════════════════════════════════════════════════════════ */
.view-hero {
  text-align: center;
  margin-bottom: 36px;
}
.view-hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.view-hero p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.board-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.board-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.board-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.board-card-name {
  font-size: 1.0625rem;
  font-weight: 700;
}

.board-card-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════
   BOARD — HEADER
   ═══════════════════════════════════════════════════════════════ */
.board-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.board-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  flex-shrink: 0;
}

.board-info h1 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
}
.board-info p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   BOARD — TOOLBAR
   ═══════════════════════════════════════════════════════════════ */
.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sort-pills {
  display: flex;
  background: var(--input-bg);
  border-radius: var(--radius-xs);
  padding: 3px;
  gap: 2px;
}
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.sort-btn.active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.search-wrapper {
  position: relative;
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  padding: 7px 12px 7px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 0.8125rem;
  background: var(--card);
  color: var(--text);
  width: 180px;
  transition: border-color 0.15s var(--ease), width 0.2s var(--ease);
}
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
  width: 240px;
}

/* ═══════════════════════════════════════════════════════════════
   POST CARDS
   ═══════════════════════════════════════════════════════════════ */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-card {
  display: flex;
  align-items: stretch;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.post-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

/* ── Vote Button ─────────────────────────────────────────────── */
.vote-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 16px 14px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s var(--ease);
  flex-shrink: 0;
  min-width: 64px;
}
.vote-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.vote-btn.voted {
  color: var(--voted);
  background: var(--voted-bg);
}

.vote-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.15s var(--ease);
}
.vote-btn:hover .vote-arrow { transform: translateY(-2px); }
.vote-btn.voted .vote-arrow { transform: translateY(-2px); }

.vote-count {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1;
}

/* Large variant for post detail */
.vote-btn-lg {
  padding: 20px 18px;
  min-width: 76px;
  border-right: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.vote-btn-lg .vote-arrow { width: 22px; height: 22px; }
.vote-btn-lg .vote-count { font-size: 1.125rem; }

/* ── Post Card Body ──────────────────────────────────────────── */
.post-card-body {
  flex: 1;
  padding: 16px 18px;
  cursor: pointer;
  min-width: 0;
}

.post-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  color: var(--text);
}

.post-card-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════
   STATUS BADGES
   ═══════════════════════════════════════════════════════════════ */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.8;
}
.status-open {
  color: var(--status-open);
  background: var(--status-open-bg);
}
.status-planned {
  color: var(--status-planned);
  background: var(--status-planned-bg);
}
.status-in_progress {
  color: var(--status-in_progress);
  background: var(--status-in_progress-bg);
}
.status-complete {
  color: var(--status-complete);
  background: var(--status-complete-bg);
}

/* ═══════════════════════════════════════════════════════════════
   POST DETAIL
   ═══════════════════════════════════════════════════════════════ */
.post-detail-card {
  display: flex;
  gap: 20px;
  margin-bottom: 36px;
}

.post-detail-vote {
  flex-shrink: 0;
}

.post-detail-body {
  flex: 1;
  min-width: 0;
}

.post-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.meta-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.meta-dot {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.post-detail-title {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 14px;
}

.post-detail-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ═══════════════════════════════════════════════════════════════
   COMMENTS
   ═══════════════════════════════════════════════════════════════ */
.comments-section {
  border-top: 1px solid var(--border);
  padding-top: 28px;
}

.comments-heading {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.comment {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-author {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.comment-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.comment-delete {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s var(--ease);
}
.comment-delete:hover {
  background: #fef2f2;
  color: var(--danger);
}

.comment-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

.no-comments {
  text-align: center;
  color: var(--text-muted);
  padding: 24px 0;
  font-size: 0.875rem;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.875rem;
  resize: vertical;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.15s var(--ease);
}
.comment-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.comment-form .btn-primary {
  align-self: flex-end;
}

/* ═══════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.open {
  display: flex;
  animation: modalIn 0.2s var(--ease);
}
#auth-modal.open {
  z-index: 1001;
}

@keyframes modalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.25s var(--ease);
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  background: var(--input-bg);
  color: var(--text);
}

.modal-body {
  padding: 32px 28px;
}
.modal-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.modal-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════════════════
   AUTH MODAL — GOOGLE BUTTON
   ═══════════════════════════════════════════════════════════════ */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.btn-google:hover {
  background: var(--input-bg);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-divider span { padding: 0 12px; }

.email-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.email-form input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 0.875rem;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.15s var(--ease);
}
.email-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.auth-error {
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-xs);
  font-size: 0.813rem;
  font-weight: 500;
  color: #991b1b;
}

.auth-success {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-xs);
  font-size: 0.813rem;
  font-weight: 500;
  color: #065f46;
}

.auth-toggle {
  text-align: center;
  margin-top: 16px;
  font-size: 0.813rem;
  color: var(--text-muted);
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font: inherit;
  font-size: 0.813rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
}
.link-btn:hover {
  text-decoration: underline;
}

.verify-email {
  text-align: center;
  padding: 8px 0;
}
.verify-email-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.08);
  margin: 0 auto 16px;
}
.verify-email-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}
.verify-email-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 20px;
}
.verify-email-desc strong {
  color: var(--text);
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.btn-secondary:hover {
  background: var(--input-bg);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════
   FORMS (shared)
   ═══════════════════════════════════════════════════════════════ */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 0.875rem;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.15s var(--ease);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.form-group textarea { resize: vertical; }

.form-row {
  display: flex;
  gap: 12px;
}
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.form-select {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 0.875rem;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════════════ */
.admin-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.admin-tabs {
  display: flex;
  gap: 2px;
  background: var(--input-bg);
  border-radius: var(--radius-xs);
  padding: 3px;
  margin-bottom: 28px;
  width: fit-content;
}

.admin-tab {
  padding: 7px 20px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.admin-tab.active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.admin-form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
}
.admin-form-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 18px;
}

/* Admin table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.8125rem;
}
.admin-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--input-bg);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table .actions-cell {
  display: flex;
  gap: 6px;
}

.admin-board-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: contain;
}

.status-select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 0.75rem;
  background: var(--card);
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY & ERROR STATES
   ═══════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state p { margin-top: 12px; }
.text-muted { color: var(--text-muted); font-size: 0.8125rem; }

.error-state {
  text-align: center;
  padding: 40px 24px;
  color: var(--danger);
  font-size: 0.875rem;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .header-inner { padding: 0 14px; }
  .container { padding: 0 14px; }
  .user-name { display: none; }

  .view-hero h1 { font-size: 1.375rem; }
  .boards-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .board-card { padding: 18px 14px; }
  .board-card-icon { width: 44px; height: 44px; }

  .board-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-left {
    flex-direction: column;
    align-items: stretch;
  }
  .search-input { width: 100%; }
  .search-input:focus { width: 100%; }

  .post-detail-card { flex-direction: column; gap: 14px; }
  .post-detail-vote { align-self: flex-start; }
  .post-detail-title { font-size: 1.125rem; }

  .form-row { flex-direction: column; gap: 0; }

  .modal-body { padding: 28px 22px; }
}

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

/* ═══════════════════════════════════════════════════════════════
   FOCUS VISIBLE (accessibility)
   ═══════════════════════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: none;
}
